PcapPlusPlus  23.09
LLCLayer.h
Go to the documentation of this file.
1 #ifndef PACKETPP_LLC_LAYER
2 #define PACKETPP_LLC_LAYER
3 
4 #include "Layer.h"
5 
7 
12 namespace pcpp
13 {
18  #pragma pack(push, 1)
19  struct llc_header
20  {
22  uint8_t dsap,
24  ssap,
26  control;
27  };
28  #pragma pack(pop)
29 
34  class LLCLayer : public Layer
35  {
36  public:
37 
45  LLCLayer(uint8_t* data, size_t dataLen, Layer* prevLayer, Packet* packet) : Layer(data, dataLen, prevLayer, packet) { m_Protocol = LLC; }
46 
53  LLCLayer(uint8_t dsap, uint8_t ssap, uint8_t control);
54 
59  inline llc_header *getLlcHeader() const { return (llc_header*)m_Data; };
60 
61  // overridden methods
62 
64  void parseNextLayer();
65 
68 
72  size_t getHeaderLen() const { return sizeof(llc_header); }
73 
77  std::string toString() const;
78 
83 
90  static bool isDataValid(const uint8_t *data, size_t dataLen);
91  };
92 
93 } // namespace pcpp
94 
95 #endif /* PACKETPP_LLC_LAYER */
size_t getHeaderLen() const
Definition: LLCLayer.h:72
The main namespace for the PcapPlusPlus lib.
OsiModelLayer
Definition: ProtocolType.h:333
uint8_t control
Control Field.
Definition: LLCLayer.h:22
Definition: LLCLayer.h:19
Definition: ProtocolType.h:338
Definition: Layer.h:70
Definition: Packet.h:26
Definition: LLCLayer.h:34
const ProtocolType LLC
Definition: ProtocolType.h:283
uint8_t dsap
Destination Service Access Point.
Definition: LLCLayer.h:22
llc_header * getLlcHeader() const
Definition: LLCLayer.h:59
void computeCalculateFields()
Does nothing for this layer.
Definition: LLCLayer.h:67
LLCLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: LLCLayer.h:45
uint8_t ssap
Source Service Access Point.
Definition: LLCLayer.h:22
OsiModelLayer getOsiModelLayer() const
Definition: LLCLayer.h:82