PcapPlusPlus  20.08
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 */
pcpp::NullLoopbackLayer::setFamily
void setFamily(uint32_t family)
pcpp::OsiModelLayer
OsiModelLayer
Definition: ProtocolType.h:233
pcpp::NullLoopbackLayer::parseNextLayer
void parseNextLayer()
pcpp::Packet
Definition: Packet.h:26
pcpp::OsiModelDataLinkLayer
@ OsiModelDataLinkLayer
Definition: ProtocolType.h:238
Layer.h
pcpp::NullLoopbackLayer::NullLoopbackLayer
NullLoopbackLayer(uint8_t *data, size_t dataLen, Packet *packet)
Definition: NullLoopbackLayer.h:40
pcpp::NullLoopbackLayer::~NullLoopbackLayer
~NullLoopbackLayer()
Definition: NullLoopbackLayer.h:51
pcpp::NullLoopbackLayer::getOsiModelLayer
OsiModelLayer getOsiModelLayer() const
Definition: NullLoopbackLayer.h:87
pcpp::NullLoopbackLayer::getHeaderLen
size_t getHeaderLen() const
Definition: NullLoopbackLayer.h:78
pcpp::NullLoopbackLayer::toString
std::string toString() const
pcpp
The main namespace for the PcapPlusPlus lib.
pcpp::Layer
Definition: Layer.h:70
pcpp::NullLoopbackLayer
Definition: NullLoopbackLayer.h:32
pcpp::NullLoopbackLayer::computeCalculateFields
void computeCalculateFields()
Definition: NullLoopbackLayer.h:83
pcpp::NULL_LOOPBACK
const ProtocolType NULL_LOOPBACK
Definition: ProtocolType.h:148
pcpp::NullLoopbackLayer::getFamily
uint32_t getFamily() const