PcapPlusPlus  24.09
NullLoopbackLayer.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 #include "Layer.h"
6 
7 namespace pcpp
8 {
9 
11 #define PCPP_BSD_AF_INET 2
13 #define PCPP_BSD_AF_NS 6
15 #define PCPP_BSD_AF_ISO 7
17 #define PCPP_BSD_AF_APPLETALK 16
19 #define PCPP_BSD_AF_IPX 23
21 #define PCPP_BSD_AF_INET6_BSD 24
23 #define PCPP_BSD_AF_INET6_FREEBSD 28
25 #define PCPP_BSD_AF_INET6_DARWIN 30
26 
31  class NullLoopbackLayer : public Layer
32  {
33  public:
39  NullLoopbackLayer(uint8_t* data, size_t dataLen, Packet* packet)
40  : Layer(data, dataLen, nullptr, packet, NULL_LOOPBACK)
41  {}
42 
47  explicit NullLoopbackLayer(uint32_t family);
48 
53  {}
54 
58  uint32_t getFamily() const;
59 
64  void setFamily(uint32_t family);
65 
66  // implement abstract methods
67 
76 
80  size_t getHeaderLen() const
81  {
82  return sizeof(uint32_t);
83  }
84 
89  {}
90 
91  std::string toString() const;
92 
94  {
95  return OsiModelDataLinkLayer;
96  }
97  };
98 
99 } // namespace pcpp
Definition: Layer.h:70
Definition: NullLoopbackLayer.h:32
uint32_t getFamily() const
OsiModelLayer getOsiModelLayer() const
Definition: NullLoopbackLayer.h:93
NullLoopbackLayer(uint8_t *data, size_t dataLen, Packet *packet)
Definition: NullLoopbackLayer.h:39
NullLoopbackLayer(uint32_t family)
void setFamily(uint32_t family)
std::string toString() const
size_t getHeaderLen() const
Definition: NullLoopbackLayer.h:80
~NullLoopbackLayer()
Definition: NullLoopbackLayer.h:52
void computeCalculateFields()
Definition: NullLoopbackLayer.h:88
Definition: Packet.h:27
The main namespace for the PcapPlusPlus lib.
OsiModelLayer
Definition: ProtocolType.h:354
@ OsiModelDataLinkLayer
Definition: ProtocolType.h:358
const ProtocolType NULL_LOOPBACK
Definition: ProtocolType.h:153