PcapPlusPlus  24.09
PacketTrailerLayer.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 #include "Layer.h"
6 
7 namespace pcpp
8 {
31  class PacketTrailerLayer : public Layer
32  {
33  public:
40  PacketTrailerLayer(uint8_t* data, size_t dataLen, Layer* prevLayer, Packet* packet)
41  : Layer(data, dataLen, prevLayer, packet, PacketTrailer)
42  {}
43 
45  {}
46 
51  uint8_t* getTrailerData() const
52  {
53  return m_Data;
54  }
55 
59  std::string getTrailerDataAsHexString() const;
60 
65  size_t getTrailerLen() const
66  {
67  return m_DataLen;
68  }
69 
70  // implement abstract methods
71 
76  {}
77 
81  size_t getHeaderLen() const
82  {
83  return m_DataLen;
84  }
85 
90  {}
91 
92  std::string toString() const;
93 
95  {
96  return OsiModelDataLinkLayer;
97  }
98  };
99 
100 } // namespace pcpp
Definition: Layer.h:70
Definition: Packet.h:27
Definition: PacketTrailerLayer.h:32
size_t getHeaderLen() const
Definition: PacketTrailerLayer.h:81
size_t getTrailerLen() const
Definition: PacketTrailerLayer.h:65
OsiModelLayer getOsiModelLayer() const
Definition: PacketTrailerLayer.h:94
void computeCalculateFields()
Definition: PacketTrailerLayer.h:89
uint8_t * getTrailerData() const
Definition: PacketTrailerLayer.h:51
void parseNextLayer()
Definition: PacketTrailerLayer.h:75
std::string toString() const
std::string getTrailerDataAsHexString() const
PacketTrailerLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: PacketTrailerLayer.h:40
The main namespace for the PcapPlusPlus lib.
const ProtocolType PacketTrailer
Definition: ProtocolType.h:208
OsiModelLayer
Definition: ProtocolType.h:354
@ OsiModelDataLinkLayer
Definition: ProtocolType.h:358