PcapPlusPlus
23.09
|
#include <TpktLayer.h>
Public Member Functions | |
TpktLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet) | |
TpktLayer (uint8_t version, uint16_t length) | |
uint8_t | getReserved () const |
uint8_t | getVersion () const |
uint16_t | getLength () const |
void | setVersion (uint8_t version) const |
void | setLength (uint16_t length) const |
size_t | getHeaderLen () const override |
void | computeCalculateFields () override |
void | parseNextLayer () override |
std::string | toString () const override |
OsiModelLayer | getOsiModelLayer () const override |
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 |
Static Public Member Functions | |
static bool | isTpktPort (uint16_t portSrc, uint16_t portDst) |
static bool | isDataValid (const uint8_t *data, size_t dataSize) |
Represents a TPKT (Transport Service on top of the TCP) protocol layer
pcpp::TpktLayer::TpktLayer | ( | uint8_t | version, |
uint16_t | length | ||
) |
A constructor that allocates a new TPKT header
[in] | version | Protocol version number |
[in] | length | Packet length |
|
inlineoverridevirtual |
Does nothing for this layer
Implements pcpp::Layer.
|
inlineoverridevirtual |
Implements pcpp::Layer.
uint16_t pcpp::TpktLayer::getLength | ( | ) | const |
|
inlineoverridevirtual |
Implements pcpp::Layer.
uint8_t pcpp::TpktLayer::getReserved | ( | ) | const |
uint8_t pcpp::TpktLayer::getVersion | ( | ) | const |
|
inlinestatic |
A static method that takes a byte array and detects whether it is a TPKT message
[in] | data | A byte array |
[in] | dataSize | The byte array size (in bytes) |
|
inlinestatic |
A static method that checks whether a source or dest port match those associated with the TPKT protocol
[in] | portSrc | Source port number to check |
[in] | portDst | Dest port number to check |
|
overridevirtual |
Currently parses the rest of the packet as a COTP protocol or generic payload (PayloadLayer)
Implements pcpp::Layer.
void pcpp::TpktLayer::setLength | ( | uint16_t | length | ) | const |
Set the value of the length
[in] | length | The value of the length |
void pcpp::TpktLayer::setVersion | ( | uint8_t | version | ) | const |
Set the value of the version
[in] | version | The value of the version |
|
overridevirtual |
Implements pcpp::Layer.