curvetun: Fix issues detected by the Coverity scanner
[netsniff-ng.git] / proto_vlan.h
blobdc31cfac98e4c7185c7430ba9d48e7fa6283bc2d
1 /*
2 * proto_vlan.h - VLAN proto helpers & declarations
3 * Subject to the GPL, version 2.
4 */
6 #ifndef PROTO_VLAN_H
7 #define PROTO_VLAN_H
9 #include <stdbool.h>
10 #include <inttypes.h>
12 static inline uint16_t vlan_tci2prio(uint16_t tci)
14 return (tci & 0xe000) >> 13;
17 static inline uint16_t vlan_tci2cfi(uint16_t tci)
19 return (tci & 0x1000) >> 12;
22 static inline uint16_t vlan_tci2vid(uint16_t tci)
24 return tci & 0x0fff;
27 #endif