]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-token.c
When discussing the "gateway" keyword, don't say that the host must be
[tcpdump] / print-token.c
index d634c673377879b822b28998c0518e39f514a607..3f1f44ba97760a6d267eeb244ef868bbd207b608 100644 (file)
@@ -25,7 +25,7 @@
  */
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-token.c,v 1.5 2000-09-28 06:43:08 guy Exp $";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-token.c,v 1.11 2000-12-23 20:48:13 guy Exp $";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -36,14 +36,11 @@ static const char rcsid[] =
 #include <sys/time.h>
 #include <sys/socket.h>
 
-struct mbuf;
-struct rtentry;
-
 #include <netinet/in.h>
-#include <netinet/in_systm.h>
 
 #include <pcap.h>
 #include <stdio.h>
+#include <string.h>
 
 #include "interface.h"
 #include "addrtoname.h"
@@ -139,10 +136,10 @@ token_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
         */
        snapend = p + caplen;
        /*
-        * Actually, the only printer that uses packetp is print-bootp.c,
-        * and it assumes that packetp points to an Ethernet header.  The
-        * right thing to do is to fix print-bootp.c to know which link
-        * type is in use when it excavates. XXX
+        * Actually, the only printers that use packetp are print-arp.c
+        * and print-bootp.c, and they assume that packetp points to an
+        * Ethernet header.  The right thing to do is to fix them to know
+        * which link type is in use when they excavate. XXX
         */
        packetp = (u_char *)&ehdr;
 
@@ -183,11 +180,12 @@ token_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
        extracted_ethertype = 0;
        if (FRAME_TYPE(trp) == TOKEN_FC_LLC) {
                /* Try to print the LLC-layer header & higher layers */
-               if (llc_print(p, length, caplen, ESRC(&ehdr), EDST(&ehdr))
-                   == 0) {
+               if (llc_print(p, length, caplen, ESRC(&ehdr), EDST(&ehdr),
+                   &extracted_ethertype) == 0) {
                        /* ether_type not known, print raw packet */
                        if (!eflag)
-                               token_print(trp, length,
+                               token_print(trp,
+                                   length + TOKEN_HDRLEN + route_len,
                                    ESRC(&ehdr), EDST(&ehdr));
                        if (extracted_ethertype) {
                                printf("(LLC %s) ",
@@ -200,7 +198,8 @@ token_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
                /* Some kinds of TR packet we cannot handle intelligently */
                /* XXX - dissect MAC packets if frame type is 0 */
                if (!eflag)
-                       token_print(trp, length, ESRC(&ehdr), EDST(&ehdr));
+                       token_print(trp, length + TOKEN_HDRLEN + route_len,
+                           ESRC(&ehdr), EDST(&ehdr));
                if (!xflag && !qflag)
                        default_print(p, caplen);
        }