]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-fddi.c
There's no link-layer header on Linux ARPHRD_ATM packets; there's
[tcpdump] / print-fddi.c
index 6763ad4bde82d827e1024124a3d54b823773928e..c1e3e2085a59780d155659da2335364a5ffec6b3 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-fddi.c,v 1.48 2000-12-18 05:41:59 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-fddi.c,v 1.52 2001-09-18 15:46:36 fenner Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -210,8 +210,8 @@ extract_fddi_addrs(const struct fddi_header *fddip, char *fsrc, char *fdst)
                        fsrc[i] = fddi_bit_swap[fddip->fddi_shost[i]];
        }
        else {
-               memcpy(fdst, (char *)fddip->fddi_dhost, 6);
-               memcpy(fsrc, (char *)fddip->fddi_shost, 6);
+               memcpy(fdst, (const char *)fddip->fddi_dhost, 6);
+               memcpy(fsrc, (const char *)fddip->fddi_shost, 6);
        }
 }
 
@@ -222,7 +222,7 @@ static inline void
 fddi_print(register const struct fddi_header *fddip, register u_int length,
           register const u_char *fsrc, register const u_char *fdst)
 {
-       char *srcname, *dstname;
+       const char *srcname, *dstname;
 
        srcname = etheraddr_string(fsrc);
        dstname = etheraddr_string(fdst);
@@ -258,10 +258,11 @@ fddi_if_print(u_char *pcap, const struct pcap_pkthdr *h,
 {
        u_int caplen = h->caplen;
        u_int length = h->len;
-       const struct fddi_header *fddip = (struct fddi_header *)p;
+       const struct fddi_header *fddip = (const struct fddi_header *)p;
        struct ether_header ehdr;
        u_short extracted_ethertype;
 
+       ++infodelay;
        ts_print(&h->ts);
 
        if (caplen < FDDI_HDRLEN) {
@@ -279,10 +280,10 @@ fddi_if_print(u_char *pcap, const struct pcap_pkthdr *h,
         */
        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;
 
@@ -305,7 +306,7 @@ fddi_if_print(u_char *pcap, const struct pcap_pkthdr *h,
                         * handle intelligently
                         */
                        if (!eflag)
-                               fddi_print(fddip, length,
+                               fddi_print(fddip, length + FDDI_HDRLEN,
                                    ESRC(&ehdr), EDST(&ehdr));
                        if (extracted_ethertype) {
                                printf("(LLC %s) ",
@@ -319,7 +320,8 @@ fddi_if_print(u_char *pcap, const struct pcap_pkthdr *h,
        else {
                /* Some kinds of FDDI packet we cannot handle intelligently */
                if (!eflag)
-                       fddi_print(fddip, length, ESRC(&ehdr), EDST(&ehdr));
+                       fddi_print(fddip, length + FDDI_HDRLEN, ESRC(&ehdr),
+                           EDST(&ehdr));
                if (!xflag && !qflag)
                        default_print(p, caplen);
        }
@@ -327,4 +329,7 @@ fddi_if_print(u_char *pcap, const struct pcap_pkthdr *h,
                default_print(p, caplen);
 out:
        putchar('\n');
+       --infodelay;
+       if (infoprint)
+               info(0);
 }