]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-udp.c
Fix a minor bug in the ack packet printing.
[tcpdump] / print-udp.c
index d1e734b85e0343dc4d92dd9653aeb5f49c91783c..13e571c5b9e03f68a7b021466ed8d72395e171a7 100644 (file)
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.64 1999-11-17 05:45:58 assar Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.70 1999-12-22 06:27:23 itojun Exp $ (LBL)";
+#endif
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
 #endif
 
 #include <sys/param.h>
@@ -59,7 +63,7 @@ static const char rcsid[] =
 #include "addrtoname.h"
 #include "appletalk.h"
 
-#include "nfsv2.h"
+#include "nfs.h"
 #include "bootp.h"
 
 struct rtcphdr {
@@ -303,6 +307,9 @@ rtcp_print(const u_char *hdr, const u_char *ep)
 #define ISAKMP_PORT_USER2 8500 /*??? - nonstandard*/
 #define RX_PORT_LOW 7000       /*XXX*/
 #define RX_PORT_HIGH 7009      /*XXX*/
+#define NETBIOS_NS_PORT   137
+#define NETBIOS_DGRAM_PORT   138
+#define CISCO_AUTORP_PORT 496  /*XXX*/
 
 #ifdef INET6
 #define RIPNG_PORT 521         /*XXX*/
@@ -334,11 +341,14 @@ udp_print(register const u_char *bp, u_int length, register const u_char *bp2)
 #endif /*INET6*/
        cp = (u_char *)(up + 1);
        if (cp > snapend) {
-               printf("[|udp]");
+               (void)printf("%s > %s: [|udp]",
+                       ipaddr_string(&ip->ip_src), ipaddr_string(&ip->ip_dst));
                return;
        }
        if (length < sizeof(struct udphdr)) {
-               (void)printf(" truncated-udp %d", length);
+               (void)printf("%s > %s: truncated-udp %d",
+                       ipaddr_string(&ip->ip_src), ipaddr_string(&ip->ip_dst),
+                       length);
                return;
        }
        length -= sizeof(struct udphdr);
@@ -503,6 +513,12 @@ udp_print(register const u_char *bp, u_int length, register const u_char *bp2)
                        krb_print((const void *)(up + 1), length);
                else if (ISPORT(L2TP_PORT))
                        l2tp_print((const u_char *)(up + 1), length);
+               else if (ISPORT(NETBIOS_NS_PORT)) {
+                       nbt_udp137_print((const u_char *)(up + 1), length);
+               }
+               else if (ISPORT(NETBIOS_DGRAM_PORT)) {
+                       nbt_udp138_print((const u_char *)(up + 1), length);
+               }
                else if (dport == 3456)
                        vat_print((const void *)(up + 1), length, up);
                /*
@@ -526,6 +542,8 @@ udp_print(register const u_char *bp, u_int length, register const u_char *bp2)
                 */
                else if (dport == 4567)
                        wb_print((const void *)(up + 1), length);
+               else if (ISPORT(CISCO_AUTORP_PORT))
+                       cisco_autorp_print((const void *)(up + 1), length);
                else
                        (void)printf(" udp %u",
                            (u_int32_t)(ulen - sizeof(*up)));