PcapPlusPlus  21.05
NullLoopbackLayer.h
Go to the documentation of this file.
1 #ifndef PACKETPP_NULL_LOOPBACK_LAYER
2 #define PACKETPP_NULL_LOOPBACK_LAYER
3 
5 
6 #include "Layer.h"
7 
8 namespace pcpp
9 {
10 
12  #define PCPP_BSD_AF_INET 2
13 
14  #define PCPP_BSD_AF_NS 6
15 
16  #define PCPP_BSD_AF_ISO 7
17 
18  #define PCPP_BSD_AF_APPLETALK 16
19 
20  #define PCPP_BSD_AF_IPX 23
21 
22  #define PCPP_BSD_AF_INET6_BSD 24
23 
24  #define PCPP_BSD_AF_INET6_FREEBSD 28
25 
26  #define PCPP_BSD_AF_INET6_DARWIN 30
27 
32  class NullLoopbackLayer : public Layer
33  {
34  public:
40  NullLoopbackLayer(uint8_t* data, size_t dataLen, Packet* packet) : Layer(data, dataLen, NULL, packet) { m_Protocol = NULL_LOOPBACK; }
41 
46  NullLoopbackLayer(uint32_t family);
47 
52 
56  uint32_t getFamily() const;
57 
62  void setFamily(uint32_t family);
63 
64 
65  // implement abstract methods
66 
73  void parseNextLayer();
74 
78  size_t getHeaderLen() const { return sizeof(uint32_t); }
79 
84 
85  std::string toString() const;
86 
88  };
89 
90 } // namespace pcpp
91 
92 #endif /* PACKETPP_NULL_LOOPBACK_LAYER */
The main namespace for the PcapPlusPlus lib.
OsiModelLayer
Definition: ProtocolType.h:253
OsiModelLayer getOsiModelLayer() const
Definition: NullLoopbackLayer.h:87
NullLoopbackLayer(uint8_t *data, size_t dataLen, Packet *packet)
Definition: NullLoopbackLayer.h:40
~NullLoopbackLayer()
Definition: NullLoopbackLayer.h:51
Definition: ProtocolType.h:258
size_t getHeaderLen() const
Definition: NullLoopbackLayer.h:78
Definition: Layer.h:70
Definition: Packet.h:26
void computeCalculateFields()
Definition: NullLoopbackLayer.h:83
std::string toString() const
void setFamily(uint32_t family)
const ProtocolType NULL_LOOPBACK
Definition: ProtocolType.h:148
uint32_t getFamily() const
Definition: NullLoopbackLayer.h:32