PcapPlusPlus
PayloadLayer.h
Go to the documentation of this file.
1 #ifndef PACKETPP_PAYLOAD_LAYER
2 #define PACKETPP_PAYLOAD_LAYER
3 
4 #include "Layer.h"
5 
7 
12 namespace pcpp
13 {
14 
19  class PayloadLayer : public Layer
20  {
21  public:
28  PayloadLayer(uint8_t* data, size_t dataLen, Layer* prevLayer, Packet* packet) : Layer(data, dataLen, prevLayer, packet) { m_Protocol = GenericPayload; }
29 
37  PayloadLayer(const uint8_t* data, size_t dataLen, bool dummy);
38 
39  ~PayloadLayer() {}
40 
45  inline uint8_t* getPayload() { return m_Data; }
46 
51  inline size_t getPayloadLen() { return m_DataLen; }
52 
53  // implement abstract methods
54 
58  void parseNextLayer() {}
59 
63  inline size_t getHeaderLen() { return m_DataLen; }
64 
69 
70  std::string toString();
71 
73 
74  };
75 
76 } // namespace pcpp
77 
78 #endif /* PACKETPP_PAYLOAD_LAYER */
size_t getHeaderLen()
Definition: PayloadLayer.h:63
PayloadLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: PayloadLayer.h:28
Definition: Layer.h:70
size_t getPayloadLen()
Definition: PayloadLayer.h:51
Definition: Packet.h:26
std::string toString()
void parseNextLayer()
Definition: PayloadLayer.h:58
void computeCalculateFields()
Definition: PayloadLayer.h:68
Definition: ProtocolType.h:228
OsiModelLayer
Definition: ProtocolType.h:213
Definition: PayloadLayer.h:19
OsiModelLayer getOsiModelLayer()
Definition: PayloadLayer.h:72
Definition: ProtocolType.h:171
uint8_t * getPayload()
Definition: PayloadLayer.h:45
The main namespace for the PcapPlusPlus lib.