PcapPlusPlus
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();
57 
62  void setFamily(uint32_t family);
63 
64 
65  // implement abstract methods
66 
73  void parseNextLayer();
74 
78  inline size_t getHeaderLen() { return sizeof(uint32_t); }
79 
84 
85  std::string toString();
86 
88  };
89 
90 } // namespace pcpp
91 
92 #endif /* PACKETPP_NULL_LOOPBACK_LAYER */
NullLoopbackLayer(uint8_t *data, size_t dataLen, Packet *packet)
Definition: NullLoopbackLayer.h:40
Definition: ProtocolType.h:218
size_t getHeaderLen()
Definition: NullLoopbackLayer.h:78
Definition: Layer.h:70
std::string toString()
Definition: Packet.h:26
OsiModelLayer getOsiModelLayer()
Definition: NullLoopbackLayer.h:87
void setFamily(uint32_t family)
OsiModelLayer
Definition: ProtocolType.h:213
Definition: NullLoopbackLayer.h:32
void computeCalculateFields()
Definition: NullLoopbackLayer.h:83
Definition: ProtocolType.h:146
~NullLoopbackLayer()
Definition: NullLoopbackLayer.h:51
The main namespace for the PcapPlusPlus lib.