PcapPlusPlus
22.11
|
#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 () |
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 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 |
|
virtual |
Calculate udphdr::headerChecksum field
Implements pcpp::Layer.
uint16_t pcpp::UdpLayer::getDstPort | ( | ) | const |
|
inlinevirtual |
Implements pcpp::Layer.
|
inlinevirtual |
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
|
virtual |
Currently identifies the following next layers: DnsLayer, DhcpLayer, VxlanLayer, SipRequestLayer, SipResponseLayer, RadiusLayer. Otherwise sets PayloadLayer
Implements pcpp::Layer.
|
virtual |
Implements pcpp::Layer.