]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-udp.c
Remove the request to ignore the warning, since the thing that
[tcpdump] / print-udp.c
index c53c319ceb1d7eebc69e9f11ffd0777c68a0d35f..fde6aad68aa37044bdd95725fef66c9d42ed64da 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.90 2000-12-23 20:55:22 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.96 2001-06-26 06:19:06 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -54,12 +54,6 @@ static const char rcsid[] =
 #include "ip6.h"
 #endif
 
-#ifdef NOERROR
-#undef NOERROR                                 /* Solaris sucks */
-#endif
-#ifdef T_UNSPEC
-#undef T_UNSPEC                                        /* SINIX does too */
-#endif
 #include "nameser.h"
 #include "nfs.h"
 #include "bootp.h"
@@ -396,8 +390,8 @@ static int udp6_cksum(const struct ip6_hdr *ip6, const struct udphdr *up,
 #define RIP_PORT 520           /*XXX*/
 #define KERBEROS_SEC_PORT 750  /*XXX*/
 #define L2TP_PORT 1701         /*XXX*/
-#define ISAKMP_PORT_USER1 7500 /*??? - nonstandard*/
-#define ISAKMP_PORT_USER2 8500 /*??? - nonstandard*/
+#define ISAKMP_PORT_USER1 7500 /*XXX - nonstandard*/
+#define ISAKMP_PORT_USER2 8500 /*XXX - nonstandard*/
 #define RX_PORT_LOW 7000       /*XXX*/
 #define RX_PORT_HIGH 7009      /*XXX*/
 #define NETBIOS_NS_PORT   137
@@ -407,6 +401,7 @@ static int udp6_cksum(const struct ip6_hdr *ip6, const struct udphdr *up,
 #define RADIUS_NEW_PORT 1812
 #define RADIUS_ACCOUNTING_PORT 1646
 #define RADIUS_NEW_ACCOUNTING_PORT 1813
+#define LWRES_PORT             921
 
 #ifdef INET6
 #define RIPNG_PORT 521         /*XXX*/
@@ -569,11 +564,6 @@ udp_print(register const u_char *bp, u_int length,
                        return;
                }
        }
-#if 0
-       (void)printf("%s.%s > %s.%s:",
-               ipaddr_string(&ip->ip_src), udpport_string(sport),
-               ipaddr_string(&ip->ip_dst), udpport_string(dport));
-#else
 #ifdef INET6
        if (ip6) {
                if (ip6->ip6_nxt == IPPROTO_UDP) {
@@ -600,18 +590,17 @@ udp_print(register const u_char *bp, u_int length,
                                udpport_string(sport), udpport_string(dport));
                }
        }
-#endif
 
        if (IP_V(ip) == 4 && vflag && !fragmented) {
                int sum = up->uh_sum;
                if (sum == 0) {
-                       (void)printf(" [no cksum]");
+                       (void)printf("[no cksum] ");
                } else if (TTEST2(cp[0], length)) {
                        sum = udp_cksum(ip, up, length);
                        if (sum != 0)
-                               (void)printf(" [bad udp cksum %x!]", sum);
+                               (void)printf("[bad udp cksum %x!] ", sum);
                        else
-                               (void)printf(" [udp sum ok]");
+                               (void)printf("[udp sum ok] ");
                }
        }
 #ifdef INET6
@@ -621,9 +610,9 @@ udp_print(register const u_char *bp, u_int length,
                if (TTEST2(cp[0], length)) {
                        sum = udp6_cksum(ip6, up, length);
                        if (sum != 0)
-                               (void)printf(" [bad udp cksum %x!]", sum);
+                               (void)printf("[bad udp cksum %x!] ", sum);
                        else
-                               (void)printf(" [udp sum ok]");
+                               (void)printf("[udp sum ok] ");
                }
        }
 #endif
@@ -655,12 +644,10 @@ udp_print(register const u_char *bp, u_int length,
                        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)) {
+               else if (ISPORT(NETBIOS_NS_PORT))
                        nbt_udp137_print((const u_char *)(up + 1), length);
-               }
-               else if (ISPORT(NETBIOS_DGRAM_PORT)) {
+               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);
                /*
@@ -687,10 +674,12 @@ udp_print(register const u_char *bp, u_int length,
                else if (ISPORT(CISCO_AUTORP_PORT))
                        cisco_autorp_print((const void *)(up + 1), length);
                else if (ISPORT(RADIUS_PORT) ||
-                        ISPORT(RADIUS_NEW_PORT) ||
-                        ISPORT(RADIUS_ACCOUNTING_PORT) || 
-                        ISPORT(RADIUS_NEW_ACCOUNTING_PORT) )
-                        radius_print((const u_char *)(up+1), length);
+                        ISPORT(RADIUS_NEW_PORT) ||
+                        ISPORT(RADIUS_ACCOUNTING_PORT) || 
+                        ISPORT(RADIUS_NEW_ACCOUNTING_PORT) )
+                       radius_print((const u_char *)(up+1), length);
+               else if (ISPORT(LWRES_PORT))
+                       lwres_print((const u_char *)(up + 1), length);
                else
                        (void)printf(" udp %u",
                            (u_int32_t)(ulen - sizeof(*up)));