|
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 |
| Calculate udphdr::headerChecksum field. | |
| 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 |
Static Public Member Functions | |
| static bool | isDataValid (const uint8_t *data, size_t dataLen) |
Additional Inherited Members | |
Protected Member Functions inherited from pcpp::Layer | |
| template<typename T , typename... Args> | |
| Layer * | constructNextLayer (uint8_t *data, size_t dataLen, Packet *packet, Args &&... extraArgs) |
| template<typename T , typename TFallback , typename... Args> | |
| Layer * | tryConstructNextLayerWithFallback (uint8_t *data, size_t dataLen, Packet *packet, Args &&... extraArgs) |
Static Protected Member Functions inherited from pcpp::Layer | |
| template<typename T > | |
| static bool | canReinterpretAs (const uint8_t *data, size_t dataLen) |
| Check if the data is large enough to reinterpret as a type. More... | |
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 |
| 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
|
inlinestatic |
A static method that validates the input data
| [in] | data | The pointer to the beginning of a byte stream of an UDP packet |
| [in] | dataLen | The length of the byte stream |
|
overridevirtual |
Currently identifies the following next layers: DnsLayer, DhcpLayer, VxlanLayer, SipRequestLayer, SipResponseLayer, RadiusLayer. Otherwise sets PayloadLayer
Implements pcpp::Layer.
|
overridevirtual |
Implements pcpp::Layer.