1 #ifndef PACKETPP_TPKT_LAYER 2 #define PACKETPP_TPKT_LAYER 47 :
Layer(data, dataLen, prevLayer, packet)
64 uint8_t getReserved()
const;
69 uint8_t getVersion()
const;
74 uint16_t getLength()
const;
80 void setVersion(uint8_t version)
const;
86 void setLength(uint16_t length)
const;
101 void parseNextLayer()
override;
109 static bool isTpktPort(uint16_t portSrc, uint16_t portDst) {
return portSrc == 102 || portDst == 102; }
117 static bool isDataValid(
const uint8_t *data,
size_t dataSize) {
return data && dataSize >=
sizeof(
tpkthdr); }
119 std::string toString()
const override;
134 #endif // PACKETPP_TPKT_LAYER The main namespace for the PcapPlusPlus lib.
OsiModelLayer
Definition: ProtocolType.h:333
Definition: TpktLayer.h:21
static bool isDataValid(const uint8_t *data, size_t dataSize)
Definition: TpktLayer.h:117
void computeCalculateFields() override
Definition: TpktLayer.h:96
uint8_t version
Definition: TpktLayer.h:24
Definition: TpktLayer.h:36
static bool isTpktPort(uint16_t portSrc, uint16_t portDst)
Definition: TpktLayer.h:109
uint16_t length
Definition: TpktLayer.h:28
Definition: ProtocolType.h:342
OsiModelLayer getOsiModelLayer() const override
Definition: TpktLayer.h:121
uint8_t reserved
Definition: TpktLayer.h:26
const ProtocolType TPKT
Definition: ProtocolType.h:303
TpktLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: TpktLayer.h:46
size_t getHeaderLen() const override
Definition: TpktLayer.h:91