diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2016-01-27 11:46:57 +0100 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2016-01-27 11:46:57 +0100 |
commit | c5bd0062b3e6b6456512d223b84e8e82aa6aa1c9 (patch) | |
tree | 42edbd6b4b5c35e4b94282c0b27331dd2315eb45 /vlan.h | |
parent | 56fd1dec9b72960a19d07b4b145b0811257359ab (diff) |
netsniff-ng: Rename proto_vlan.h to vlan.h
The proto_ prefix is reserved for dissectors and the header contains
helper functions not exclusive to the proto_vlan dissector, so give it a
more generic name.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'vlan.h')
-rw-r--r-- | vlan.h | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -0,0 +1,22 @@ +#ifndef VLAN_H +#define VLAN_H + +#include <stdbool.h> +#include <inttypes.h> + +static inline uint16_t vlan_tci2prio(uint16_t tci) +{ + return (tci & 0xe000) >> 13; +} + +static inline uint16_t vlan_tci2cfi(uint16_t tci) +{ + return (tci & 0x1000) >> 12; +} + +static inline uint16_t vlan_tci2vid(uint16_t tci) +{ + return tci & 0x0fff; +} + +#endif |