PcapPlusPlus  19.12
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  uint8_t* getPayload() const { return m_Data; }
46 
51  size_t getPayloadLen() const { return m_DataLen; }
52 
53  // implement abstract methods
54 
58  void parseNextLayer() {}
59 
63  size_t getHeaderLen() const { return m_DataLen; }
64 
69 
70  std::string toString() const;
71 
73 
74  };
75 
76 } // namespace pcpp
77 
78 #endif /* PACKETPP_PAYLOAD_LAYER */
pcpp::OsiModelLayer
OsiModelLayer
Definition: ProtocolType.h:224
pcpp::Packet
Definition: Packet.h:26
pcpp::PayloadLayer
Definition: PayloadLayer.h:19
pcpp::OsiModelApplicationLayer
Definition: ProtocolType.h:239
Layer.h
pcpp::PayloadLayer::getOsiModelLayer
OsiModelLayer getOsiModelLayer() const
Definition: PayloadLayer.h:72
pcpp::PayloadLayer::getHeaderLen
size_t getHeaderLen() const
Definition: PayloadLayer.h:63
pcpp::PayloadLayer::computeCalculateFields
void computeCalculateFields()
Definition: PayloadLayer.h:68
pcpp::PayloadLayer::getPayloadLen
size_t getPayloadLen() const
Definition: PayloadLayer.h:51
pcpp::GenericPayload
Definition: ProtocolType.h:171
pcpp
The main namespace for the PcapPlusPlus lib.
pcpp::Layer
Definition: Layer.h:70
pcpp::PayloadLayer::PayloadLayer
PayloadLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: PayloadLayer.h:28
pcpp::PayloadLayer::parseNextLayer
void parseNextLayer()
Definition: PayloadLayer.h:58
pcpp::PayloadLayer::toString
std::string toString() const
pcpp::PayloadLayer::getPayload
uint8_t * getPayload() const
Definition: PayloadLayer.h:45