26 #include <freeradius-devel/util/inet.h>
33 #define ETHER_ADDR_LEN 6
38 #define VLAN_PCP_UNPACK(_vlan) (((*(uint8_t const *)&(_vlan)->tag_control) & 0xe0) >> 5)
43 #define VLAN_DEI_UNPACK(_vlan) (((*(uint8_t const *)&(_vlan)->tag_control) & 0x10) >> 4)
48 #define VLAN_VID_UNPACK(_vlan) ((htons((_vlan)->tag_control) & 0x0fff))
61 #define VLAN_TCI_PACK(_pcp, _dei, _vid) htons((((uint16_t)(_pcp) & 0xe0) << 13) | (((uint16_t)(_dei) & 0x01) << 12) | ((_vid) & 0x0fff))
67 typedef struct CC_HINT(__packed__) {
78 typedef struct CC_HINT(__packed__) {
uint16_t ether_type
Ether type. Usually 0x0800 (IPv4) 0x086DD (IPv6).
uint16_t svlan_tpid
SVLAN tag type. If 0, no SVLAN present.
uint16_t cvlan_tpid
CVLAN tag type. If 0, no CVLAN/SVLAN present.
uint16_t cvlan_vid
CVLAN vlan ID.
uint16_t svlan_vid
SVLAN vlan ID.
uint8_t cvlan_dei
CVLAN drop eligible indicator.
size_t payload_len
Remaining bytes after the ethernet header has been parsed.
uint8_t svlan_dei
SVLAN drop eligible indicator.
fr_ethernet_options_t
Protocol options for ethernet.
@ PROTO_OPT_ETHERNET_SVLAN_PCP
Outer VLAN priority code point.
@ PROTO_OPT_ETHERNET_CVLAN_PCP
Inner VLAN priority code point.
@ PROTO_OPT_ETHERNET_CVLAN_VID
Inner VLAN ID.
@ PROTO_OPT_ETHERNET_SVLAN_VID
Outer VLAN ID.
@ PROTO_OPT_ETHERNET_CVLAN_DEI
Inner VLAN drop eligible indicator.
@ PROTO_OPT_ETHERNET_SVLAN_DEI
Outer VLAN drop eligible indicator.
@ PROTO_OPT_ETHERNET_SVLAN_TPID
Outer VLAN tag type.
@ PROTO_OPT_ETHERNET_CVLAN_TPID
Inner VLAN tag type.
uint16_t tag_type
Tag type.
uint8_t svlan_pcp
SVLAN priority code point 0-6.
uint8_t cvlan_pcp
CVLAN priority code point 0-6.
Src/dst link layer information.
Struct to represent an ethernet address.