PcapPlusPlus  24.09
LLCLayer.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Layer.h"
4 
6 
11 namespace pcpp
12 {
13 #pragma pack(push, 1)
18  struct llc_header
19  {
21  uint8_t dsap,
26  };
27 #pragma pack(pop)
28 
33  class LLCLayer : public Layer
34  {
35  public:
43  LLCLayer(uint8_t* data, size_t dataLen, Layer* prevLayer, Packet* packet)
44  : Layer(data, dataLen, prevLayer, packet, LLC)
45  {}
46 
53  LLCLayer(uint8_t dsap, uint8_t ssap, uint8_t control);
54 
59  inline llc_header* getLlcHeader() const
60  {
61  return (llc_header*)m_Data;
62  };
63 
64  // overridden methods
65 
68 
71  {}
72 
76  size_t getHeaderLen() const
77  {
78  return sizeof(llc_header);
79  }
80 
84  std::string toString() const;
85 
90  {
91  return OsiModelDataLinkLayer;
92  }
93 
100  static bool isDataValid(const uint8_t* data, size_t dataLen);
101  };
102 
103 } // namespace pcpp
Definition: LLCLayer.h:34
std::string toString() const
size_t getHeaderLen() const
Definition: LLCLayer.h:76
void computeCalculateFields()
Does nothing for this layer.
Definition: LLCLayer.h:70
LLCLayer(uint8_t dsap, uint8_t ssap, uint8_t control)
void parseNextLayer()
Parses the next layer. Currently only STP supported as next layer.
OsiModelLayer getOsiModelLayer() const
Definition: LLCLayer.h:89
LLCLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: LLCLayer.h:43
llc_header * getLlcHeader() const
Definition: LLCLayer.h:59
static bool isDataValid(const uint8_t *data, size_t dataLen)
Definition: Layer.h:70
Definition: Packet.h:27
The main namespace for the PcapPlusPlus lib.
OsiModelLayer
Definition: ProtocolType.h:354
@ OsiModelDataLinkLayer
Definition: ProtocolType.h:358
const ProtocolType LLC
Definition: ProtocolType.h:288
Definition: LLCLayer.h:19
uint8_t dsap
Destination Service Access Point.
Definition: LLCLayer.h:21
uint8_t control
Control Field.
Definition: LLCLayer.h:25
uint8_t ssap
Source Service Access Point.
Definition: LLCLayer.h:23