PcapPlusPlus
21.05
|
#include <ArpLayer.h>
Public Member Functions | |
ArpLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet) | |
ArpLayer (ArpOpcode opCode, const MacAddress &senderMacAddr, const MacAddress &targetMacAddr, const IPv4Address &senderIpAddr, const IPv4Address &targetIpAddr) | |
arphdr * | getArpHeader () const |
MacAddress | getSenderMacAddress () const |
MacAddress | getTargetMacAddress () const |
IPv4Address | getSenderIpAddr () const |
IPv4Address | getTargetIpAddr () const |
void | parseNextLayer () |
size_t | getHeaderLen () const |
void | computeCalculateFields () |
std::string | toString () const |
OsiModelLayer | getOsiModelLayer () const |
Public Member Functions inherited from pcpp::Layer | |
virtual | ~Layer () |
Layer * | getNextLayer () const |
Layer * | getPrevLayer () const |
ProtocolType | getProtocol () 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 |
Represents an ARP protocol layer. Currently only IPv4 ARP messages are supported
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) |
|
virtual |
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
|
inlinevirtual |
Implements pcpp::Layer.
|
inlinevirtual |
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
|
inlinevirtual |
Does nothing for this layer (ArpLayer is always last)
Implements pcpp::Layer.
|
virtual |
Implements pcpp::Layer.