30 #ifndef TINS_IEEE8022_H 31 #define TINS_IEEE8022_H 35 #include <tins/macros.h> 37 #include <tins/endianness.h> 107 LLC(uint8_t dsap, uint8_t ssap);
119 LLC(
const uint8_t* buffer, uint32_t total_sz);
127 void group(
bool value);
133 void dsap(uint8_t new_dsap);
139 void response(
bool value);
145 void ssap(uint8_t new_ssap);
158 void send_seq_number(uint8_t seq_number);
165 void receive_seq_number(uint8_t seq_number);
171 void poll_final(
bool value);
194 void add_xid_information(uint8_t xid_id,
195 uint8_t llc_type_class,
196 uint8_t receive_window);
207 return header_.dsap & 0x01;
223 return (header_.ssap & 0x01);
248 return (type() == INFORMATION) ? (control_field.info.send_seq_num) : 0;
260 return control_field.info.recv_seq_num;
262 return control_field.super.recv_seq_num;
277 return control_field.unnumbered.poll_final_bit;
279 return control_field.info.poll_final_bit;
281 return control_field.super.poll_final_bit;
293 if (type() == SUPERVISORY) {
294 return control_field.super.supervisory_func;
305 if (type() == UNNUMBERED) {
306 return (control_field.unnumbered.mod_func1 << 3) + control_field.unnumbered.mod_func2;
317 uint32_t header_size()
const;
330 void clear_information_fields();
338 return new LLC(*
this);
347 #if TINS_IS_LITTLE_ENDIAN 349 struct info_control_field {
358 struct super_control_field {
367 struct un_control_field {
373 #elif TINS_IS_BIG_ENDIAN 375 struct info_control_field {
376 uint16_t send_seq_num:7,
383 struct super_control_field {
392 struct un_control_field {
400 typedef std::vector<uint8_t> field_type;
401 typedef std::vector<field_type> field_list;
403 void write_serialization(uint8_t* buffer, uint32_t total_sz);
406 uint8_t control_field_length_;
408 info_control_field info;
409 super_control_field super;
410 un_control_field unnumbered;
413 uint8_t information_field_length_;
414 field_list information_fields_;
419 #endif // TINS_IEEE8022_H SupervisoryFunctions
LLC Supervisory functions.
Definition: llc.h:90
PDUType
Enum which identifies each type of PDU.
Definition: pdu.h:127
static const uint8_t GLOBAL_DSAP_ADDR
Represents the LLC global DSAP address.
Definition: llc.h:57
uint8_t send_seq_number()
Getter for sender send sequence number.
Definition: llc.h:247
PDUType pdu_type() const
Getter for the PDU's type.
Definition: llc.h:323
uint8_t type()
Getter for the LLC frame format type.
Definition: llc.h:238
uint8_t receive_seq_number()
Getter for sender receive sequence number.
Definition: llc.h:257
uint8_t dsap()
Getter for the dsap field.
Definition: llc.h:214
uint8_t modifier_function()
Getter for the modifier function field.
Definition: llc.h:304
uint8_t supervisory_function()
Getter for the supervisory function.
Definition: llc.h:292
bool poll_final()
Getter for the poll/final flag.
Definition: llc.h:274
The Tins namespace.
Definition: address_range.h:38
Representing a LLC frame.
Definition: llc.h:47
LLC * clone() const
Clones this PDU.
Definition: llc.h:337
bool response()
Getter for the response bit.
Definition: llc.h:222
ModifierFunctions
LLC Modifier functions.
Definition: llc.h:76
static const uint8_t NULL_ADDR
Represents the LLC NULL address.
Definition: llc.h:62
uint8_t ssap()
Getter for the ssap field.
Definition: llc.h:230
Base class for protocol data units.
Definition: pdu.h:107
Format
LLC Format flags.
Definition: llc.h:67
bool group()
Getter for the group destination bit.
Definition: llc.h:206