summaryrefslogtreecommitdiff
path: root/usr.sbin/tcpdump
diff options
context:
space:
mode:
authorJakob Schlyter <jakob@cvs.openbsd.org>2000-01-16 12:32:17 +0000
committerJakob Schlyter <jakob@cvs.openbsd.org>2000-01-16 12:32:17 +0000
commit6576ec4fb3bde7edc941fac945265c5ca4eacad1 (patch)
tree7687ccc713b9150ec91c4807a23fd1240bd48d27 /usr.sbin/tcpdump
parent9d64909d570d6f997f34c55849b3afe156539b19 (diff)
VLAN 802.1q support
Diffstat (limited to 'usr.sbin/tcpdump')
-rw-r--r--usr.sbin/tcpdump/ethertype.h5
-rw-r--r--usr.sbin/tcpdump/print-ether.c13
2 files changed, 16 insertions, 2 deletions
diff --git a/usr.sbin/tcpdump/ethertype.h b/usr.sbin/tcpdump/ethertype.h
index 75c1b815d23..5307817849b 100644
--- a/usr.sbin/tcpdump/ethertype.h
+++ b/usr.sbin/tcpdump/ethertype.h
@@ -18,7 +18,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/ethertype.h,v 1.6 1996/12/12 16:22:56 bitblt Exp $ (LBL)
+ * @(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/ethertype.h,v 1.7 2000/01/16 12:32:16 jakob Exp $ (LBL)
*/
/* Types missing from some systems */
@@ -71,6 +71,9 @@
#ifndef ETHERTYPE_AARP
#define ETHERTYPE_AARP 0x80f3
#endif
+#ifndef ETHERTYPE_VLAN
+#define ETHERTYPE_VLAN 0x8100
+#endif
#ifndef ETHERTYPE_LOOPBACK
#define ETHERTYPE_LOOPBACK 0x9000
#endif
diff --git a/usr.sbin/tcpdump/print-ether.c b/usr.sbin/tcpdump/print-ether.c
index 0642e7d02e7..b5e199783ec 100644
--- a/usr.sbin/tcpdump/print-ether.c
+++ b/usr.sbin/tcpdump/print-ether.c
@@ -20,7 +20,7 @@
*/
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-ether.c,v 1.9 1999/09/16 17:06:48 brad Exp $ (LBL)";
+ "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-ether.c,v 1.10 2000/01/16 12:32:16 jakob Exp $ (LBL)";
#endif
#include <sys/param.h>
@@ -185,6 +185,17 @@ ether_encap_print(u_short ethertype, const u_char *p,
aarp_print(p, length);
return (1);
+ case ETHERTYPE_VLAN:
+ printf("802.1q");
+ if (eflag) {
+ printf(" %s %d",
+ etherproto_string(ntohs(*(u_int16_t *)p)),
+ length - 4);
+ }
+ printf(": ");
+ ether_print(p + 4, length - 4);
+ return (1);
+
case ETHERTYPE_LAT:
case ETHERTYPE_SCA:
case ETHERTYPE_MOPRC: