]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-atm.c
There's no link-layer header on Linux ARPHRD_ATM packets; there's
[tcpdump] / print-atm.c
index 6d6463c9eb2e4653bdf02b35c1d591cbad823655..e2a2a46e7598a66d993a183e7d439c35a842ec1c 100644 (file)
  */
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-atm.c,v 1.9 1999-10-07 23:47:11 mcr Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-atm.c,v 1.21 2001-07-05 18:54:14 guy Exp $ (LBL)";
+#endif
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
 #endif
 
 #include <sys/param.h>
 #include <sys/time.h>
 #include <sys/socket.h>
 
-#if __STDC__
-struct mbuf;
-struct rtentry;
-#endif
-#include <net/if.h>
-
 #include <netinet/in.h>
-#include <netinet/if_ether.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-#include <netinet/udp.h>
-#include <netinet/udp_var.h>
-#include <netinet/tcp.h>
-#include <netinet/tcpip.h>
 
 #include <stdio.h>
 #include <pcap.h>
@@ -63,6 +53,7 @@ atm_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
        u_int length = h->len;
        u_short ethertype;
 
+       ++infodelay;
        ts_print(&h->ts);
 
        if (caplen < 8) {
@@ -106,6 +97,12 @@ atm_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
                ip_print(p, length);
                break;
 
+#ifdef INET6
+       case ETHERTYPE_IPV6:
+               ip6_print(p, length);
+               break;
+#endif /*INET6*/
+
                /*XXX this probably isn't right */
        case ETHERTYPE_ARP:
        case ETHERTYPE_REVARP:
@@ -135,8 +132,8 @@ atm_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
                /* ether_type not known, print raw packet */
                if (!eflag)
                        printf("%02x %02x %02x %02x-%02x-%02x %04x: ",
-                              p[0], p[1], p[2], /* dsap/ssap/ctrl */
-                              p[3], p[4], p[5], /* manufacturer's code */
+                              packetp[0], packetp[1], packetp[2], /* dsap/ssap/ctrl */
+                              packetp[3], packetp[4], packetp[5], /* manufacturer's code */
                               ethertype);
                if (!xflag && !qflag)
                        default_print(p, caplen);
@@ -145,4 +142,7 @@ atm_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
                default_print(p, caplen);
  out:
        putchar('\n');
+       --infodelay;
+       if (infoprint)
+               info(0);
 }