PcapPlusPlus
PacketTrailerLayer.h
Go to the documentation of this file.
1 #ifndef PACKETPP_PACKET_TRAILER_LAYER
2 #define PACKETPP_PACKET_TRAILER_LAYER
3 
5 
6 #include "Layer.h"
7 
8 namespace pcpp
9 {
30  class PacketTrailerLayer : public Layer
31  {
32  public:
39  PacketTrailerLayer(uint8_t* data, size_t dataLen, Layer* prevLayer, Packet* packet) : Layer(data, dataLen, prevLayer, packet) { m_Protocol = PacketTrailer; }
40 
41  ~PacketTrailerLayer() {}
42 
47  inline uint8_t* getTrailerData() { return m_Data; }
48 
52  std::string getTrailerDataAsHexString();
53 
58  inline size_t getTrailerLen() { return m_DataLen; }
59 
60  // implement abstract methods
61 
65  void parseNextLayer() {}
66 
70  inline size_t getHeaderLen() { return m_DataLen; }
71 
76 
77  std::string toString();
78 
80 
81  private:
82  std::string dataAsString(size_t sizeLimitation);
83 
84  };
85 
86 }
87 
88 #endif // PACKETPP_PACKET_TRAILER_LAYER
PacketTrailerLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: PacketTrailerLayer.h:39
OsiModelLayer getOsiModelLayer()
Definition: PacketTrailerLayer.h:79
uint8_t * getTrailerData()
Definition: PacketTrailerLayer.h:47
Definition: PacketTrailerLayer.h:30
std::string getTrailerDataAsHexString()
Definition: Packet.h:26
void computeCalculateFields()
Definition: PacketTrailerLayer.h:75
The main namespace for the PcapPlusPlus lib.
Definition: ProtocolType.h:213
OsiModelLayer
Definition: ProtocolType.h:208
void parseNextLayer()
Definition: PacketTrailerLayer.h:65
Definition: Layer.h:70
size_t getHeaderLen()
Definition: PacketTrailerLayer.h:70
size_t getTrailerLen()
Definition: PacketTrailerLayer.h:58
Definition: ProtocolType.h:201