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 = GenericPayolad; }
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 */
Definition: PayloadLayer.h:19
void computeCalculateFields()
Definition: PayloadLayer.h:68
Definition: ProtocolType.h:171
Definition: ProtocolType.h:218
OsiModelLayer
Definition: ProtocolType.h:203
size_t getPayloadLen()
Definition: PayloadLayer.h:51
Definition: Packet.h:26
size_t getHeaderLen()
Definition: PayloadLayer.h:63
OsiModelLayer getOsiModelLayer()
Definition: PayloadLayer.h:72
uint8_t * getPayload()
Definition: PayloadLayer.h:45
Definition: Layer.h:52
PayloadLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: PayloadLayer.h:28
void parseNextLayer()
Definition: PayloadLayer.h:58
The main namespace for the PcapPlusPlus lib.
std::string toString()