diff options
author | 2000-01-16 12:32:16 +0000 | |
---|---|---|
committer | 2000-01-16 12:32:16 +0000 | |
commit | 76ebb09c13273568b5742f4cdf33a8bbfd30c45e (patch) | |
tree | 3f1814b4101e478c64dfbfaff764c11b8864e967 | |
parent | enable INET6 (diff) | |
download | wireguard-openbsd-76ebb09c13273568b5742f4cdf33a8bbfd30c45e.tar.xz wireguard-openbsd-76ebb09c13273568b5742f4cdf33a8bbfd30c45e.zip |
VLAN 802.1q support
-rw-r--r-- | usr.sbin/tcpdump/ethertype.h | 5 | ||||
-rw-r--r-- | usr.sbin/tcpdump/print-ether.c | 13 |
2 files changed, 16 insertions, 2 deletions
diff --git a/usr.sbin/tcpdump/ethertype.h b/usr.sbin/tcpdump/ethertype.h index e8da69140be..bc2173c4ffd 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: /home/cvs/src/usr.sbin/tcpdump/ethertype.h,v 1.6 1996/12/12 16:22:56 bitblt Exp $ (LBL) + * @(#) $Header: /home/cvs/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 3d7fadc2459..f906e6ae858 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: /home/cvs/src/usr.sbin/tcpdump/print-ether.c,v 1.9 1999/09/16 17:06:48 brad Exp $ (LBL)"; + "@(#) $Header: /home/cvs/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: |