]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-udp.c
OpenFlow: Have a function for each message type.
[tcpdump] / print-udp.c
index 1db9bed96645aed9a9e9f3832a6aeeffcff6c521..0efb0f1e8d39654e25b761025b3aee0b6e29e2b4 100644 (file)
@@ -103,7 +103,6 @@ vat_print(netdissect_options *ndo, const u_char *hdr, u_int length)
                ND_PRINT("udp/va/vat, length %u < 2", length);
                return;
        }
-       ND_TCHECK_2((const u_int *)hdr);
        ts = GET_BE_U_2(hdr);
        if ((ts & 0xf060) != 0) {
                /* probably vt */
@@ -130,10 +129,6 @@ vat_print(netdissect_options *ndo, const u_char *hdr, u_int length)
                if (i0 & 0x3f000000)
                        ND_PRINT(" s%u", (i0 >> 24) & 0x3f);
        }
-       return;
-
-trunc:
-       nd_print_trunc(ndo);
 }
 
 static void
@@ -330,13 +325,13 @@ udpipaddr_print(netdissect_options *ndo, const struct ip *ip, int sport, int dpo
                if (GET_U_1(ip6->ip6_nxt) == IPPROTO_UDP) {
                        if (sport == -1) {
                                ND_PRINT("%s > %s: ",
-                                       ip6addr_string(ndo, ip6->ip6_src),
-                                       ip6addr_string(ndo, ip6->ip6_dst));
+                                       GET_IP6ADDR_STRING(ip6->ip6_src),
+                                       GET_IP6ADDR_STRING(ip6->ip6_dst));
                        } else {
                                ND_PRINT("%s.%s > %s.%s: ",
-                                       ip6addr_string(ndo, ip6->ip6_src),
+                                       GET_IP6ADDR_STRING(ip6->ip6_src),
                                        udpport_string(ndo, (uint16_t)sport),
-                                       ip6addr_string(ndo, ip6->ip6_dst),
+                                       GET_IP6ADDR_STRING(ip6->ip6_dst),
                                        udpport_string(ndo, (uint16_t)dport));
                        }
                } else {
@@ -350,13 +345,13 @@ udpipaddr_print(netdissect_options *ndo, const struct ip *ip, int sport, int dpo
                if (GET_U_1(ip->ip_p) == IPPROTO_UDP) {
                        if (sport == -1) {
                                ND_PRINT("%s > %s: ",
-                                       ipaddr_string(ndo, ip->ip_src),
-                                       ipaddr_string(ndo, ip->ip_dst));
+                                       GET_IPADDR_STRING(ip->ip_src),
+                                       GET_IPADDR_STRING(ip->ip_dst));
                        } else {
                                ND_PRINT("%s.%s > %s.%s: ",
-                                       ipaddr_string(ndo, ip->ip_src),
+                                       GET_IPADDR_STRING(ip->ip_src),
                                        udpport_string(ndo, (uint16_t)sport),
-                                       ipaddr_string(ndo, ip->ip_dst),
+                                       GET_IPADDR_STRING(ip->ip_dst),
                                        udpport_string(ndo, (uint16_t)dport));
                        }
                } else {