diff options
Diffstat (limited to 'src/vnet/ethernet')
-rw-r--r-- | src/vnet/ethernet/packet.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/vnet/ethernet/packet.h b/src/vnet/ethernet/packet.h index 1a0506dc4d6..d70960b0f7b 100644 --- a/src/vnet/ethernet/packet.h +++ b/src/vnet/ethernet/packet.h @@ -146,6 +146,14 @@ ethernet_vlan_header_set_priority_net_order (ethernet_vlan_header_t * h, bytes[0] |= (prio & 0x7) << 5; } +always_inline u8 +ethernet_vlan_header_get_priority_net_order (ethernet_vlan_header_t * h) +{ + u8 *bytes = (u8 *) (&h->priority_cfi_and_id); + + return (bytes[0] >> 5); +} + /* VLAN with ethertype first and vlan id second */ typedef struct { |