From c5bd0062b3e6b6456512d223b84e8e82aa6aa1c9 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Wed, 27 Jan 2016 11:46:57 +0100 Subject: 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 --- dissector.h | 2 +- proto_vlan.c | 2 +- proto_vlan.h | 27 --------------------------- vlan.h | 22 ++++++++++++++++++++++ 4 files changed, 24 insertions(+), 29 deletions(-) delete mode 100644 proto_vlan.h create mode 100644 vlan.h diff --git a/dissector.h b/dissector.h index d8ad6ac..52f341b 100644 --- a/dissector.h +++ b/dissector.h @@ -17,7 +17,7 @@ #include "ring.h" #include "tprintf.h" #include "linktype.h" -#include "proto_vlan.h" +#include "vlan.h" #define PRINT_NORM 0 #define PRINT_LESS 1 diff --git a/proto_vlan.c b/proto_vlan.c index c1b3e65..ebdf281 100644 --- a/proto_vlan.c +++ b/proto_vlan.c @@ -10,7 +10,7 @@ #include /* for ntohs() */ #include "proto.h" -#include "proto_vlan.h" +#include "vlan.h" #include "dissector_eth.h" #include "pkt_buff.h" diff --git a/proto_vlan.h b/proto_vlan.h deleted file mode 100644 index dc31cfa..0000000 --- a/proto_vlan.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * proto_vlan.h - VLAN proto helpers & declarations - * Subject to the GPL, version 2. - */ - -#ifndef PROTO_VLAN_H -#define PROTO_VLAN_H - -#include -#include - -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 diff --git a/vlan.h b/vlan.h new file mode 100644 index 0000000..b58d1a2 --- /dev/null +++ b/vlan.h @@ -0,0 +1,22 @@ +#ifndef VLAN_H +#define VLAN_H + +#include +#include + +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 -- cgit v1.2.3-54-g00ecf