PcapPlusPlus
SllLayer.h
Go to the documentation of this file.
1 #ifndef PACKETPP_SLL_LAYER
2 #define PACKETPP_SLL_LAYER
3 
4 #include <MacAddress.h>
5 #include <Layer.h>
6 
8 
13 namespace pcpp
14 {
15 
20 #pragma pack(push, 1)
21  struct sll_header
22  {
27  uint16_t packet_type;
29  uint16_t ARPHRD_type;
35  uint8_t link_layer_addr[8];
37  uint16_t protocol_type;
38  };
39 #pragma pack(pop)
40 
45  class SllLayer : public Layer
46  {
47  public:
54  SllLayer(uint8_t* data, size_t dataLen, Packet* packet) : Layer(data, dataLen, NULL, packet) { m_Protocol = SLL; }
55 
61  SllLayer(uint16_t packetType, uint16_t ARPHRDType);
62 
63  ~SllLayer() {}
64 
69  inline sll_header* getSllHeader() { return (sll_header*)m_Data; }
70 
77  bool setLinkLayerAddr(uint8_t* addr, size_t addrLength);
78 
85 
91  void parseNextLayer();
92 
96  inline size_t getHeaderLen() { return sizeof(sll_header); }
97 
101  void computeCalculateFields();
102 
103  std::string toString();
104 
106  };
107 
108 } // namespace pcpp
109 
110 #endif /* PACKETPP_SLL_LAYER */
111 
OsiModelLayer getOsiModelLayer()
Definition: SllLayer.h:105
void computeCalculateFields()
std::string toString()
uint16_t protocol_type
Definition: SllLayer.h:37
uint8_t link_layer_addr[8]
Definition: SllLayer.h:35
Definition: ProtocolType.h:136
size_t getHeaderLen()
Definition: SllLayer.h:96
void parseNextLayer()
uint16_t packet_type
Definition: SllLayer.h:27
bool setLinkLayerAddr(uint8_t *addr, size_t addrLength)
Definition: MacAddress.h:21
OsiModelLayer
Definition: ProtocolType.h:203
Definition: Packet.h:26
Definition: SllLayer.h:45
sll_header * getSllHeader()
Definition: SllLayer.h:69
Definition: Layer.h:52
Definition: SllLayer.h:21
bool setMacAddressAsLinkLayer(MacAddress macAddr)
uint16_t ARPHRD_type
Definition: SllLayer.h:29
uint16_t link_layer_addr_len
Definition: SllLayer.h:31
The main namespace for the PcapPlusPlus lib.
SllLayer(uint8_t *data, size_t dataLen, Packet *packet)
Definition: SllLayer.h:54
Definition: ProtocolType.h:208