PcapPlusPlus
Next
|
#include <ArpLayer.h>
Public Member Functions | |
ArpLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet) | |
ArpLayer (ArpOpcode opCode, const MacAddress &senderMacAddr, const IPv4Address &senderIpAddr, const MacAddress &targetMacAddr, const IPv4Address &targetIpAddr) | |
A constructor that creates an ARP header. More... | |
ArpLayer (ArpOpcode opCode, const MacAddress &senderMacAddr, const MacAddress &targetMacAddr, const IPv4Address &senderIpAddr, const IPv4Address &targetIpAddr) | |
ArpLayer (ArpRequest const &arpRequest) | |
A constructor that creates an ARP request header. More... | |
ArpLayer (ArpReply const &arpReply) | |
A constructor that creates an ARP reply header. More... | |
ArpLayer (GratuitousArpRequest const &gratuitousArpRequest) | |
A constructor that creates a gratuitous ARP request header. More... | |
ArpLayer (GratuitousArpReply const &gratuitousArpReply) | |
A constructor that creates a gratuitous ARP reply header. More... | |
arphdr * | getArpHeader () const |
ArpOpcode | getOpcode () const |
MacAddress | getSenderMacAddress () const |
MacAddress | getTargetMacAddress () const |
IPv4Address | getSenderIpAddr () const |
IPv4Address | getTargetIpAddr () const |
void | parseNextLayer () override |
Does nothing for this layer (ArpLayer is always last) | |
size_t | getHeaderLen () const override |
void | computeCalculateFields () override |
ArpMessageType | getMessageType () const |
Attempts to determine the ARP message type based on the header signature. More... | |
bool | isRequest () const |
Is this packet an ARP request? | |
bool | isReply () const |
Is this packet an ARP reply? | |
std::string | toString () const override |
OsiModelLayer | getOsiModelLayer () const override |
![]() | |
~Layer () override | |
Layer * | getNextLayer () const |
Layer * | getPrevLayer () const |
ProtocolType | getProtocol () const |
bool | isMemberOfProtocolFamily (ProtocolTypeFamily protocolTypeFamily) const |
uint8_t * | getData () const |
size_t | getDataLen () const |
uint8_t * | getLayerPayload () const |
size_t | getLayerPayloadSize () const |
bool | isAllocatedToPacket () const |
void | copyData (uint8_t *toArr) const |
uint8_t * | getDataPtr (size_t offset=0) const override |
Represents an ARP protocol layer. Currently only IPv4 ARP messages are supported
pcpp::ArpLayer::ArpLayer | ( | ArpOpcode | opCode, |
const MacAddress & | senderMacAddr, | ||
const IPv4Address & | senderIpAddr, | ||
const MacAddress & | targetMacAddr, | ||
const IPv4Address & | targetIpAddr | ||
) |
A constructor that creates an ARP header.
[in] | opCode | ARP message type (ARP request or ARP reply) |
[in] | senderMacAddr | The sender MAC address (will be put in arphdr::senderMacAddr) |
[in] | senderIpAddr | The sender IP address (will be put in arphdr::senderIpAddr) |
[in] | targetMacAddr | The target MAC address (will be put in arphdr::targetMacAddr) |
[in] | targetIpAddr | The target IP address (will be put in arphdr::targetIpAddr) |
pcpp::ArpLayer::ArpLayer | ( | ArpOpcode | opCode, |
const MacAddress & | senderMacAddr, | ||
const MacAddress & | targetMacAddr, | ||
const IPv4Address & | senderIpAddr, | ||
const IPv4Address & | targetIpAddr | ||
) |
A constructor that allocates a new ARP header
[in] | opCode | ARP message type (ARP request or ARP reply) |
[in] | senderMacAddr | The sender MAC address (will be put in arphdr::senderMacAddr) |
[in] | targetMacAddr | The target MAC address (will be put in arphdr::targetMacAddr) |
[in] | senderIpAddr | The sender IP address (will be put in arphdr::senderIpAddr) |
[in] | targetIpAddr | The target IP address (will be put in arphdr::targetIpAddr) |
|
explicit |
A constructor that creates an ARP request header.
arpRequest | The ARP request data |
|
explicit |
A constructor that creates an ARP reply header.
arpReply | The ARP reply data |
|
explicit |
A constructor that creates a gratuitous ARP request header.
gratuitousArpRequest | The gratuitous ARP request data |
|
explicit |
A constructor that creates a gratuitous ARP reply header.
gratuitousArpReply | The gratuitous ARP reply data |
|
overridevirtual |
Calculate the following fields:
Implements pcpp::Layer.
|
inline |
Get a pointer to the ARP header. Notice this points directly to the data, so every change will change the actual packet data
|
inlineoverridevirtual |
Implements pcpp::Layer.
ArpMessageType pcpp::ArpLayer::getMessageType | ( | ) | const |
Attempts to determine the ARP message type based on the header signature.
ArpOpcode pcpp::ArpLayer::getOpcode | ( | ) | const |
Get the ARP opcode
|
inlineoverridevirtual |
Implements pcpp::Layer.
|
inline |
Get the sender protocol address (SPA) in the form of IPv4Address
|
inline |
Get the sender hardware address (SHA) in the form of MacAddress
|
inline |
Get the target protocol address (TPA) in the form of IPv4Address
|
inline |
Get the target hardware address (THA) in the form of MacAddress
|
overridevirtual |
Implements pcpp::Layer.