PcapPlusPlus
Next
|
#include <UdpLayer.h>
Public Member Functions | |
UdpLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet) | |
UdpLayer (uint16_t portSrc, uint16_t portDst) | |
udphdr * | getUdpHeader () const |
uint16_t | getSrcPort () const |
uint16_t | getDstPort () const |
uint16_t | calculateChecksum (bool writeResultToPacket) |
void | parseNextLayer () override |
size_t | getHeaderLen () const override |
void | computeCalculateFields () override |
std::string | toString () const override |
OsiModelLayer | getOsiModelLayer () const override |
Public Member Functions inherited from pcpp::Layer | |
~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 UDP (User Datagram Protocol) protocol layer
pcpp::UdpLayer::UdpLayer | ( | uint16_t | portSrc, |
uint16_t | portDst | ||
) |
A constructor that allocates a new UDP header with source and destination ports
[in] | portSrc | Source UDP port address |
[in] | portDst | Destination UDP port |
uint16_t pcpp::UdpLayer::calculateChecksum | ( | bool | writeResultToPacket | ) |
Calculate the checksum from header and data and possibly write the result to udphdr::headerChecksum
[in] | writeResultToPacket | If set to true then checksum result will be written to udphdr::headerChecksum |
|
overridevirtual |
Calculate udphdr::headerChecksum field
Implements pcpp::Layer.
uint16_t pcpp::UdpLayer::getDstPort | ( | ) | const |
|
inlineoverridevirtual |
Implements pcpp::Layer.
|
inlineoverridevirtual |
Implements pcpp::Layer.
uint16_t pcpp::UdpLayer::getSrcPort | ( | ) | const |
|
inline |
Get a pointer to the UDP header. Notice this points directly to the data, so every change will change the actual packet data
|
overridevirtual |
Currently identifies the following next layers: DnsLayer, DhcpLayer, VxlanLayer, SipRequestLayer, SipResponseLayer, RadiusLayer. Otherwise sets PayloadLayer
Implements pcpp::Layer.
|
overridevirtual |
Implements pcpp::Layer.