]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-udp.c
(fs_reply_print): support parsing and printing of the errors in abort
[tcpdump] / print-udp.c
index c200951fdf722432e22a894bca0acf822eac7fb2..13e571c5b9e03f68a7b021466ed8d72395e171a7 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.65 1999-11-21 09:37:03 fenner 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
@@ -63,7 +63,7 @@ static const char rcsid[] =
 #include "addrtoname.h"
 #include "appletalk.h"
 
-#include "nfsv2.h"
+#include "nfs.h"
 #include "bootp.h"
 
 struct rtcphdr {
@@ -307,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*/
@@ -338,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);
@@ -507,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);
                /*
@@ -530,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)));