summaryrefslogtreecommitdiff
path: root/usr.sbin/tcpdump/print-llc.c
diff options
context:
space:
mode:
authordenny <denny@cvs.openbsd.org>1997-07-23 02:59:03 +0000
committerdenny <denny@cvs.openbsd.org>1997-07-23 02:59:03 +0000
commit47bc1a39c8cd804b6ceb8356dcfbd54e55d5f65d (patch)
tree141498fed41f459c754682ece773b3ab0d62e8cf /usr.sbin/tcpdump/print-llc.c
parent3bee95fea8a62e43f33a07f5aad7bc3a854d1410 (diff)
Better handling for AppleTalk, and netatalk in particular.
Handle native Ethertalk phase 1 & 2 as well as the localtalk encapsulation a la Kinetics FastPath previously handled.
Diffstat (limited to 'usr.sbin/tcpdump/print-llc.c')
-rw-r--r--usr.sbin/tcpdump/print-llc.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/usr.sbin/tcpdump/print-llc.c b/usr.sbin/tcpdump/print-llc.c
index 19282e8b015..2b24f602f72 100644
--- a/usr.sbin/tcpdump/print-llc.c
+++ b/usr.sbin/tcpdump/print-llc.c
@@ -24,7 +24,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-llc.c,v 1.5 1996/12/12 16:22:33 bitblt Exp $";
+ "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-llc.c,v 1.6 1997/07/23 02:59:02 denny Exp $";
#endif
#include <sys/param.h>
@@ -41,6 +41,7 @@ static const char rcsid[] =
#include "interface.h"
#include "addrtoname.h"
#include "extract.h" /* must come after interface.h */
+#include "ethertype.h"
#include "llc.h"
@@ -106,7 +107,24 @@ llc_print(const u_char *p, u_int length, u_int caplen,
/* This is an encapsulated Ethernet packet */
et = EXTRACT_16BITS(&llc.ethertype[0]);
- ret = ether_encap_print(et, p, length, caplen);
+
+ /*
+ * Some protocols have special handling if they are 802.3
+ * SNAP encapsulated vs vers II encapsulated. Handle
+ * those special protocols here, and hand the rest to
+ * print-ether.c so we don't have to duplicate
+ * all that code here.
+ */
+ switch (et) {
+ case ETHERTYPE_ATALK:
+ atalk_print(p, length);
+ ret = 1;
+ break;
+ default:
+ ret = ether_encap_print(et, p, length, caplen);
+ break;
+ }
+
if (ret)
return (ret);
}