summaryrefslogtreecommitdiffstats
path: root/contrib/tcpdump/print-ether.c
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1997-12-08 21:42:35 +0000
committerwollman <wollman@FreeBSD.org>1997-12-08 21:42:35 +0000
commit0890a7ca8a5890b2f7da4618ab3e281cff8918b0 (patch)
tree952272c19cc541ce438a0c1133571336791c752e /contrib/tcpdump/print-ether.c
parent990e34ed3a014b94bb4b78fddc32fac9fa7a1d40 (diff)
downloadFreeBSD-src-0890a7ca8a5890b2f7da4618ab3e281cff8918b0.zip
FreeBSD-src-0890a7ca8a5890b2f7da4618ab3e281cff8918b0.tar.gz
This is a hack. Decode IEEE 802.1Q VLAN tagging so that we can decode
tagged traffic according to the encapsulated protocol. It needs in addition modifications to the filter generator which would deal with checking the ethertype and vlan header as required.
Diffstat (limited to 'contrib/tcpdump/print-ether.c')
-rw-r--r--contrib/tcpdump/print-ether.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/contrib/tcpdump/print-ether.c b/contrib/tcpdump/print-ether.c
index 2c92d4f..cabbe2b 100644
--- a/contrib/tcpdump/print-ether.c
+++ b/contrib/tcpdump/print-ether.c
@@ -158,6 +158,13 @@ int
ether_encap_print(u_short ethertype, const u_char *p,
u_int length, u_int caplen)
{
+ if (ethertype == 0x8100) { /* IEEE 802.1Q vlan tagging encapsulation */
+ printf ("[vlan %d] ", ntohs(*(u_short *)p) & 0x17ff);
+ ethertype = ntohs(((u_short *)p)[1]);
+ p += 4;
+ length -= 4;
+ caplen -= 4;
+ }
extracted_ethertype = ethertype;
switch (ethertype) {
OpenPOWER on IntegriCloud