35#include <tins/macros.h>
36#include <tins/endianness.h>
37#include <tins/small_uint.h>
74 SNAP(
const uint8_t* buffer, uint32_t total_sz);
82 void control(uint8_t new_control);
94 void eth_type(uint16_t new_eth);
119 #if TINS_IS_LITTLE_ENDIAN
120 return (snap_.control_org) & 0xff;
122 return (snap_.control_org >> 24) & 0xff;
131 #if TINS_IS_LITTLE_ENDIAN
132 return Endian::be_to_host<uint32_t>(snap_.control_org & 0xffffff00);
134 return snap_.control_org & 0xffffff;
143 return Endian::be_to_host(snap_.eth_type);
152 uint32_t header_size()
const;
168 return new SNAP(*
this);
175 uint32_t control_org;
179 void write_serialization(uint8_t* buffer, uint32_t total_sz);
Base class for protocol data units.
Definition pdu.h:107
PDUType
Enum which identifies each type of PDU.
Definition pdu.h:127
Represents a SNAP frame.
Definition snap.h:48
uint16_t eth_type() const
Getter for the Ethernet Type field.
Definition snap.h:142
small_uint< 24 > org_code() const
Getter for the Organization Code field.
Definition snap.h:130
uint8_t ssap() const
Getter for the SSAP field.
Definition snap.h:110
uint8_t control() const
Getter for the Control field.
Definition snap.h:118
PDUType pdu_type() const
Getter for the PDU's type.
Definition snap.h:158
SNAP * clone() const
Clones this PDU.
Definition snap.h:167
uint8_t dsap() const
Getter for the DSAP field.
Definition snap.h:102
Represents a field of n bits.
Definition small_uint.h:52
The Tins namespace.
Definition address_range.h:38