X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/62af1ac58c6afa5d616f278c94a42e6dba6f0626..0ce779d1756e2bc1f5a845df5acf86f0dc698a14:/print-udp.c diff --git a/print-udp.c b/print-udp.c index be1da675..02684fd8 100644 --- a/print-udp.c +++ b/print-udp.c @@ -48,24 +48,24 @@ static const char rtcp_tstr[] = " [|rtcp]"; static const char udp_tstr[] = " [|udp]"; struct rtcphdr { - uint16_t rh_flags; /* T:2 P:1 CNT:5 PT:8 */ - uint16_t rh_len; /* length of message (in words) */ - uint32_t rh_ssrc; /* synchronization src id */ + nd_uint16_t rh_flags; /* T:2 P:1 CNT:5 PT:8 */ + nd_uint16_t rh_len; /* length of message (in words) */ + nd_uint32_t rh_ssrc; /* synchronization src id */ }; typedef struct { - uint32_t upper; /* more significant 32 bits */ - uint32_t lower; /* less significant 32 bits */ + nd_uint32_t upper; /* more significant 32 bits */ + nd_uint32_t lower; /* less significant 32 bits */ } ntp64; /* * Sender report. */ struct rtcp_sr { - ntp64 sr_ntp; /* 64-bit ntp timestamp */ - uint32_t sr_ts; /* reference media timestamp */ - uint32_t sr_np; /* no. packets sent */ - uint32_t sr_nb; /* no. bytes sent */ + ntp64 sr_ntp; /* 64-bit ntp timestamp */ + nd_uint32_t sr_ts; /* reference media timestamp */ + nd_uint32_t sr_np; /* no. packets sent */ + nd_uint32_t sr_nb; /* no. bytes sent */ }; /* @@ -73,12 +73,12 @@ struct rtcp_sr { * Time stamps are middle 32-bits of ntp timestamp. */ struct rtcp_rr { - uint32_t rr_srcid; /* sender being reported */ - uint32_t rr_nl; /* no. packets lost */ - uint32_t rr_ls; /* extended last seq number received */ - uint32_t rr_dv; /* jitter (delay variance) */ - uint32_t rr_lsr; /* orig. ts from last rr from this src */ - uint32_t rr_dlsr; /* time from recpt of last rr to xmit time */ + nd_uint32_t rr_srcid; /* sender being reported */ + nd_uint32_t rr_nl; /* no. packets lost */ + nd_uint32_t rr_ls; /* extended last seq number received */ + nd_uint32_t rr_dv; /* jitter (delay variance) */ + nd_uint32_t rr_lsr; /* orig. ts from last rr from this src */ + nd_uint32_t rr_dlsr; /* time from recpt of last rr to xmit time */ }; /*XXX*/ @@ -97,46 +97,46 @@ struct rtcp_rr { #define RTCP_PT_APP 204 static void -vat_print(netdissect_options *ndo, const void *hdr, register const struct udphdr *up) +vat_print(netdissect_options *ndo, const void *hdr, const struct udphdr *up) { /* vat/vt audio */ u_int ts; - ND_TCHECK_16BITS((const u_int *)hdr); - ts = EXTRACT_16BITS(hdr); + ND_TCHECK_2((const u_int *)hdr); + ts = EXTRACT_BE_U_2(hdr); if ((ts & 0xf060) != 0) { /* probably vt */ - ND_TCHECK_16BITS(&up->uh_ulen); - ND_PRINT((ndo, "udp/vt %u %d / %d", - (uint32_t)(EXTRACT_16BITS(&up->uh_ulen) - sizeof(*up)), - ts & 0x3ff, ts >> 10)); + ND_TCHECK_2(up->uh_ulen); + ND_PRINT("udp/vt %u %d / %d", + (uint32_t)(EXTRACT_BE_U_2(up->uh_ulen) - sizeof(*up)), + ts & 0x3ff, ts >> 10); } else { /* probably vat */ uint32_t i0, i1; - ND_TCHECK_32BITS(&((const u_int *)hdr)[0]); - i0 = EXTRACT_32BITS(&((const u_int *)hdr)[0]); - ND_TCHECK_32BITS(&((const u_int *)hdr)[1]); - i1 = EXTRACT_32BITS(&((const u_int *)hdr)[1]); - ND_TCHECK_16BITS(&up->uh_ulen); - ND_PRINT((ndo, "udp/vat %u c%d %u%s", - (uint32_t)(EXTRACT_16BITS(&up->uh_ulen) - sizeof(*up) - 8), + ND_TCHECK_4(&((const u_int *)hdr)[0]); + i0 = EXTRACT_BE_U_4(&((const u_int *)hdr)[0]); + ND_TCHECK_4(&((const u_int *)hdr)[1]); + i1 = EXTRACT_BE_U_4(&((const u_int *)hdr)[1]); + ND_TCHECK_2(up->uh_ulen); + ND_PRINT("udp/vat %u c%d %u%s", + (uint32_t)(EXTRACT_BE_U_2(up->uh_ulen) - sizeof(*up) - 8), i0 & 0xffff, - i1, i0 & 0x800000? "*" : "")); + i1, i0 & 0x800000? "*" : ""); /* audio format */ if (i0 & 0x1f0000) - ND_PRINT((ndo, " f%d", (i0 >> 16) & 0x1f)); + ND_PRINT(" f%d", (i0 >> 16) & 0x1f); if (i0 & 0x3f000000) - ND_PRINT((ndo, " s%d", (i0 >> 24) & 0x3f)); + ND_PRINT(" s%d", (i0 >> 24) & 0x3f); } trunc: - ND_PRINT((ndo, "%s", vat_tstr)); + ND_PRINT("%s", vat_tstr); } static void rtp_print(netdissect_options *ndo, const void *hdr, u_int len, - register const struct udphdr *up) + const struct udphdr *up) { /* rtp v1 or v2 */ const u_int *ip = (const u_int *)hdr; @@ -144,12 +144,12 @@ rtp_print(netdissect_options *ndo, const void *hdr, u_int len, uint32_t i0, i1; const char * ptype; - ND_TCHECK_32BITS(&((const u_int *)hdr)[0]); - i0 = EXTRACT_32BITS(&((const u_int *)hdr)[0]); - ND_TCHECK_32BITS(&((const u_int *)hdr)[1]); - i1 = EXTRACT_32BITS(&((const u_int *)hdr)[1]); - ND_TCHECK_16BITS(&up->uh_ulen); - dlen = EXTRACT_16BITS(&up->uh_ulen) - sizeof(*up) - 8; + ND_TCHECK_4(&((const u_int *)hdr)[0]); + i0 = EXTRACT_BE_U_4(&((const u_int *)hdr)[0]); + ND_TCHECK_4(&((const u_int *)hdr)[1]); + i1 = EXTRACT_BE_U_4(&((const u_int *)hdr)[1]); + ND_TCHECK_2(up->uh_ulen); + dlen = EXTRACT_BE_U_2(up->uh_ulen) - sizeof(*up) - 8; ip += 2; len >>= 2; len -= 2; @@ -171,25 +171,25 @@ rtp_print(netdissect_options *ndo, const void *hdr, u_int len, ip += 1; len -= 1; } - ND_PRINT((ndo, "udp/%s %d c%d %s%s %d %u", + ND_PRINT("udp/%s %d c%d %s%s %d %u", ptype, dlen, contype, (hasopt || hasext)? "+" : "", hasmarker? "*" : "", i0 & 0xffff, - i1)); + i1); if (ndo->ndo_vflag) { - ND_TCHECK_32BITS(&((const u_int *)hdr)[2]); - ND_PRINT((ndo, " %u", EXTRACT_32BITS(&((const u_int *)hdr)[2]))); + ND_TCHECK_4(&((const u_int *)hdr)[2]); + ND_PRINT(" %u", EXTRACT_BE_U_4(&((const u_int *)hdr)[2])); if (hasopt) { u_int i2, optlen; do { - ND_TCHECK_32BITS(ip); - i2 = EXTRACT_32BITS(ip); + ND_TCHECK_4(ip); + i2 = EXTRACT_BE_U_4(ip); optlen = (i2 >> 16) & 0xff; if (optlen == 0 || optlen > len) { - ND_PRINT((ndo, " !opt")); + ND_PRINT(" !opt"); return; } ip += optlen; @@ -198,22 +198,22 @@ rtp_print(netdissect_options *ndo, const void *hdr, u_int len, } if (hasext) { u_int i2, extlen; - ND_TCHECK_32BITS(ip); - i2 = EXTRACT_32BITS(ip); + ND_TCHECK_4(ip); + i2 = EXTRACT_BE_U_4(ip); extlen = (i2 & 0xffff) + 1; if (extlen > len) { - ND_PRINT((ndo, " !ext")); + ND_PRINT(" !ext"); return; } ip += extlen; } - ND_TCHECK_32BITS(ip); + ND_TCHECK_4(ip); if (contype == 0x1f) /*XXX H.261 */ - ND_PRINT((ndo, " 0x%04x", EXTRACT_32BITS(ip) >> 16)); + ND_PRINT(" 0x%04x", EXTRACT_BE_U_4(ip) >> 16); } trunc: - ND_PRINT((ndo, "%s", rtp_tstr)); + ND_PRINT("%s", rtp_tstr); } static const u_char * @@ -229,78 +229,78 @@ rtcp_print(netdissect_options *ndo, const u_char *hdr, const u_char *ep) double ts, dts; if ((const u_char *)(rh + 1) > ep) goto trunc; - ND_TCHECK(*rh); - len = (EXTRACT_16BITS(&rh->rh_len) + 1) * 4; - flags = EXTRACT_16BITS(&rh->rh_flags); + ND_TCHECK_SIZE(rh); + len = (EXTRACT_BE_U_2(rh->rh_len) + 1) * 4; + flags = EXTRACT_BE_U_2(rh->rh_flags); cnt = (flags >> 8) & 0x1f; switch (flags & 0xff) { case RTCP_PT_SR: sr = (const struct rtcp_sr *)(rh + 1); - ND_PRINT((ndo, " sr")); + ND_PRINT(" sr"); if (len != cnt * sizeof(*rr) + sizeof(*sr) + sizeof(*rh)) - ND_PRINT((ndo, " [%d]", len)); + ND_PRINT(" [%d]", len); if (ndo->ndo_vflag) - ND_PRINT((ndo, " %u", EXTRACT_32BITS(&rh->rh_ssrc))); + ND_PRINT(" %u", EXTRACT_BE_U_4(rh->rh_ssrc)); if ((const u_char *)(sr + 1) > ep) goto trunc; - ND_TCHECK(*sr); - ts = (double)(EXTRACT_32BITS(&sr->sr_ntp.upper)) + - ((double)(EXTRACT_32BITS(&sr->sr_ntp.lower)) / - 4294967296.0); - ND_PRINT((ndo, " @%.2f %u %up %ub", ts, EXTRACT_32BITS(&sr->sr_ts), - EXTRACT_32BITS(&sr->sr_np), EXTRACT_32BITS(&sr->sr_nb))); + ND_TCHECK_SIZE(sr); + ts = (double)(EXTRACT_BE_U_4(sr->sr_ntp.upper)) + + ((double)(EXTRACT_BE_U_4(sr->sr_ntp.lower)) / + 4294967296.0); + ND_PRINT(" @%.2f %u %up %ub", ts, EXTRACT_BE_U_4(sr->sr_ts), + EXTRACT_BE_U_4(sr->sr_np), EXTRACT_BE_U_4(sr->sr_nb)); rr = (const struct rtcp_rr *)(sr + 1); break; case RTCP_PT_RR: - ND_PRINT((ndo, " rr")); + ND_PRINT(" rr"); if (len != cnt * sizeof(*rr) + sizeof(*rh)) - ND_PRINT((ndo, " [%d]", len)); + ND_PRINT(" [%d]", len); rr = (const struct rtcp_rr *)(rh + 1); if (ndo->ndo_vflag) - ND_PRINT((ndo, " %u", EXTRACT_32BITS(&rh->rh_ssrc))); + ND_PRINT(" %u", EXTRACT_BE_U_4(rh->rh_ssrc)); break; case RTCP_PT_SDES: - ND_PRINT((ndo, " sdes %d", len)); + ND_PRINT(" sdes %d", len); if (ndo->ndo_vflag) - ND_PRINT((ndo, " %u", EXTRACT_32BITS(&rh->rh_ssrc))); + ND_PRINT(" %u", EXTRACT_BE_U_4(rh->rh_ssrc)); cnt = 0; break; case RTCP_PT_BYE: - ND_PRINT((ndo, " bye %d", len)); + ND_PRINT(" bye %d", len); if (ndo->ndo_vflag) - ND_PRINT((ndo, " %u", EXTRACT_32BITS(&rh->rh_ssrc))); + ND_PRINT(" %u", EXTRACT_BE_U_4(rh->rh_ssrc)); cnt = 0; break; default: - ND_PRINT((ndo, " type-0x%x %d", flags & 0xff, len)); + ND_PRINT(" type-0x%x %d", flags & 0xff, len); cnt = 0; break; } if (cnt > 1) - ND_PRINT((ndo, " c%d", cnt)); + ND_PRINT(" c%d", cnt); while (--cnt >= 0) { if ((const u_char *)(rr + 1) > ep) goto trunc; - ND_TCHECK(*rr); + ND_TCHECK_SIZE(rr); if (ndo->ndo_vflag) - ND_PRINT((ndo, " %u", EXTRACT_32BITS(&rr->rr_srcid))); - ts = (double)(EXTRACT_32BITS(&rr->rr_lsr)) / 65536.; - dts = (double)(EXTRACT_32BITS(&rr->rr_dlsr)) / 65536.; - ND_PRINT((ndo, " %ul %us %uj @%.2f+%.2f", - EXTRACT_32BITS(&rr->rr_nl) & 0x00ffffff, - EXTRACT_32BITS(&rr->rr_ls), - EXTRACT_32BITS(&rr->rr_dv), ts, dts)); + ND_PRINT(" %u", EXTRACT_BE_U_4(rr->rr_srcid)); + ts = (double)(EXTRACT_BE_U_4(rr->rr_lsr)) / 65536.; + dts = (double)(EXTRACT_BE_U_4(rr->rr_dlsr)) / 65536.; + ND_PRINT(" %ul %us %uj @%.2f+%.2f", + EXTRACT_BE_U_4(rr->rr_nl) & 0x00ffffff, + EXTRACT_BE_U_4(rr->rr_ls), + EXTRACT_BE_U_4(rr->rr_dv), ts, dts); } return (hdr + len); trunc: - ND_PRINT((ndo, "%s", rtcp_tstr)); + ND_PRINT("%s", rtcp_tstr); return ep; } -static int udp_cksum(netdissect_options *ndo, register const struct ip *ip, - register const struct udphdr *up, - register u_int len) +static int udp_cksum(netdissect_options *ndo, const struct ip *ip, + const struct udphdr *up, + u_int len) { return nextproto4_cksum(ndo, ip, (const uint8_t *)(const void *)up, len, len, IPPROTO_UDP); @@ -324,58 +324,58 @@ udpipaddr_print(netdissect_options *ndo, const struct ip *ip, int sport, int dpo ip6 = NULL; if (ip6) { - if (ip6->ip6_nxt == IPPROTO_UDP) { + if (EXTRACT_U_1(ip6->ip6_nxt) == IPPROTO_UDP) { if (sport == -1) { - ND_PRINT((ndo, "%s > %s: ", + ND_PRINT("%s > %s: ", ip6addr_string(ndo, &ip6->ip6_src), - ip6addr_string(ndo, &ip6->ip6_dst))); + ip6addr_string(ndo, &ip6->ip6_dst)); } else { - ND_PRINT((ndo, "%s.%s > %s.%s: ", + ND_PRINT("%s.%s > %s.%s: ", ip6addr_string(ndo, &ip6->ip6_src), udpport_string(ndo, sport), ip6addr_string(ndo, &ip6->ip6_dst), - udpport_string(ndo, dport))); + udpport_string(ndo, dport)); } } else { if (sport != -1) { - ND_PRINT((ndo, "%s > %s: ", + ND_PRINT("%s > %s: ", udpport_string(ndo, sport), - udpport_string(ndo, dport))); + udpport_string(ndo, dport)); } } } else { - if (ip->ip_p == IPPROTO_UDP) { + if (EXTRACT_U_1(ip->ip_p) == IPPROTO_UDP) { if (sport == -1) { - ND_PRINT((ndo, "%s > %s: ", + ND_PRINT("%s > %s: ", ipaddr_string(ndo, &ip->ip_src), - ipaddr_string(ndo, &ip->ip_dst))); + ipaddr_string(ndo, &ip->ip_dst)); } else { - ND_PRINT((ndo, "%s.%s > %s.%s: ", + ND_PRINT("%s.%s > %s.%s: ", ipaddr_string(ndo, &ip->ip_src), udpport_string(ndo, sport), ipaddr_string(ndo, &ip->ip_dst), - udpport_string(ndo, dport))); + udpport_string(ndo, dport)); } } else { if (sport != -1) { - ND_PRINT((ndo, "%s > %s: ", + ND_PRINT("%s > %s: ", udpport_string(ndo, sport), - udpport_string(ndo, dport))); + udpport_string(ndo, dport)); } } } } void -udp_print(netdissect_options *ndo, register const u_char *bp, u_int length, - register const u_char *bp2, int fragmented) +udp_print(netdissect_options *ndo, const u_char *bp, u_int length, + const u_char *bp2, int fragmented) { - register const struct udphdr *up; - register const struct ip *ip; - register const u_char *cp; - register const u_char *ep = bp + length; + const struct udphdr *up; + const struct ip *ip; + const u_char *cp; + const u_char *ep = bp + length; uint16_t sport, dport, ulen; - register const struct ip6_hdr *ip6; + const struct ip6_hdr *ip6; if (ep > ndo->ndo_snapend) ep = ndo->ndo_snapend; @@ -390,22 +390,22 @@ udp_print(netdissect_options *ndo, register const u_char *bp, u_int length, goto trunc; } - sport = EXTRACT_16BITS(&up->uh_sport); - dport = EXTRACT_16BITS(&up->uh_dport); + sport = EXTRACT_BE_U_2(up->uh_sport); + dport = EXTRACT_BE_U_2(up->uh_dport); if (length < sizeof(struct udphdr)) { udpipaddr_print(ndo, ip, sport, dport); - ND_PRINT((ndo, "truncated-udp %d", length)); + ND_PRINT("truncated-udp %d", length); return; } if (!ND_TTEST(up->uh_ulen)) { udpipaddr_print(ndo, ip, sport, dport); goto trunc; } - ulen = EXTRACT_16BITS(&up->uh_ulen); + ulen = EXTRACT_BE_U_2(up->uh_ulen); if (ulen < sizeof(struct udphdr)) { udpipaddr_print(ndo, ip, sport, dport); - ND_PRINT((ndo, "truncated-udplength %d", ulen)); + ND_PRINT("truncated-udplength %d", ulen); return; } ulen -= sizeof(struct udphdr); @@ -420,7 +420,7 @@ udp_print(netdissect_options *ndo, register const u_char *bp, u_int length, } if (ndo->ndo_packettype) { - register const struct sunrpc_msg *rp; + const struct sunrpc_msg *rp; enum sunrpc_msg_type direction; switch (ndo->ndo_packettype) { @@ -432,12 +432,12 @@ udp_print(netdissect_options *ndo, register const u_char *bp, u_int length, case PT_WB: udpipaddr_print(ndo, ip, sport, dport); - wb_print(ndo, (const void *)(up + 1), length); + wb_print(ndo, (const u_char *)(up + 1), length); break; case PT_RPC: rp = (const struct sunrpc_msg *)(up + 1); - direction = (enum sunrpc_msg_type)EXTRACT_32BITS(&rp->rm_direction); + direction = (enum sunrpc_msg_type) EXTRACT_BE_U_4(&rp->rm_direction); if (direction == SUNRPC_CALL) sunrpc_print(ndo, (const u_char *)rp, length, (const u_char *)ip); @@ -503,21 +503,21 @@ udp_print(netdissect_options *ndo, register const u_char *bp, u_int length, udpipaddr_print(ndo, ip, sport, dport); if (!ndo->ndo_qflag) { - register const struct sunrpc_msg *rp; + const struct sunrpc_msg *rp; enum sunrpc_msg_type direction; rp = (const struct sunrpc_msg *)(up + 1); if (ND_TTEST(rp->rm_direction)) { - direction = (enum sunrpc_msg_type)EXTRACT_32BITS(&rp->rm_direction); + direction = (enum sunrpc_msg_type) EXTRACT_BE_U_4(&rp->rm_direction); if (dport == NFS_PORT && direction == SUNRPC_CALL) { - ND_PRINT((ndo, "NFS request xid %u ", EXTRACT_32BITS(&rp->rm_xid))); - nfsreq_print_noaddr(ndo, (const u_char *)rp, length, + ND_PRINT("NFS request xid %u ", EXTRACT_BE_U_4(&rp->rm_xid)); + nfsreq_noaddr_print(ndo, (const u_char *)rp, length, (const u_char *)ip); return; } if (sport == NFS_PORT && direction == SUNRPC_REPLY) { - ND_PRINT((ndo, "NFS reply xid %u ", EXTRACT_32BITS(&rp->rm_xid))); - nfsreply_print_noaddr(ndo, (const u_char *)rp, length, + ND_PRINT("NFS reply xid %u ", EXTRACT_BE_U_4(&rp->rm_xid)); + nfsreply_noaddr_print(ndo, (const u_char *)rp, length, (const u_char *)ip); return; } @@ -539,32 +539,32 @@ udp_print(netdissect_options *ndo, register const u_char *bp, u_int length, * TCP does, and we do so for UDP-over-IPv6. */ if (IP_V(ip) == 4 && (ndo->ndo_vflag > 1)) { - udp_sum = EXTRACT_16BITS(&up->uh_sum); + udp_sum = EXTRACT_BE_U_2(up->uh_sum); if (udp_sum == 0) { - ND_PRINT((ndo, "[no cksum] ")); - } else if (ND_TTEST2(cp[0], length)) { + ND_PRINT("[no cksum] "); + } else if (ND_TTEST_LEN(cp, length)) { sum = udp_cksum(ndo, ip, up, length + sizeof(struct udphdr)); if (sum != 0) { - ND_PRINT((ndo, "[bad udp cksum 0x%04x -> 0x%04x!] ", + ND_PRINT("[bad udp cksum 0x%04x -> 0x%04x!] ", udp_sum, - in_cksum_shouldbe(udp_sum, sum))); + in_cksum_shouldbe(udp_sum, sum)); } else - ND_PRINT((ndo, "[udp sum ok] ")); + ND_PRINT("[udp sum ok] "); } } else if (IP_V(ip) == 6 && ip6->ip6_plen) { /* for IPv6, UDP checksum is mandatory */ - if (ND_TTEST2(cp[0], length)) { + if (ND_TTEST_LEN(cp, length)) { sum = udp6_cksum(ndo, ip6, up, length + sizeof(struct udphdr)); - udp_sum = EXTRACT_16BITS(&up->uh_sum); + udp_sum = EXTRACT_BE_U_2(up->uh_sum); if (sum != 0) { - ND_PRINT((ndo, "[bad udp cksum 0x%04x -> 0x%04x!] ", + ND_PRINT("[bad udp cksum 0x%04x -> 0x%04x!] ", udp_sum, - in_cksum_shouldbe(udp_sum, sum))); + in_cksum_shouldbe(udp_sum, sum)); } else - ND_PRINT((ndo, "[udp sum ok] ")); + ND_PRINT("[udp sum ok] "); } } } @@ -631,7 +631,7 @@ udp_print(netdissect_options *ndo, register const u_char *bp, u_int length, * Kludge in test for whiteboard packets. */ else if (dport == WB_PORT) - wb_print(ndo, (const void *)(up + 1), length); + wb_print(ndo, (const u_char *)(up + 1), length); else if (IS_SRC_OR_DST_PORT(CISCO_AUTORP_PORT)) cisco_autorp_print(ndo, (const void *)(up + 1), length); else if (IS_SRC_OR_DST_PORT(RADIUS_PORT) || @@ -682,29 +682,29 @@ udp_print(netdissect_options *ndo, register const u_char *bp, u_int length, else if (IS_SRC_OR_DST_PORT(VXLAN_GPE_PORT)) vxlan_gpe_print(ndo, (const u_char *)(up + 1), length); else if (ND_TTEST(((const struct LAP *)cp)->type) && - ((const struct LAP *)cp)->type == lapDDP && + EXTRACT_U_1(((const struct LAP *)cp)->type) == lapDDP && (atalk_port(sport) || atalk_port(dport))) { if (ndo->ndo_vflag) - ND_PRINT((ndo, "kip ")); + ND_PRINT("kip "); llap_print(ndo, cp, length); } else { if (ulen > length) - ND_PRINT((ndo, "UDP, bad length %u > %u", - ulen, length)); + ND_PRINT("UDP, bad length %u > %u", + ulen, length); else - ND_PRINT((ndo, "UDP, length %u", ulen)); + ND_PRINT("UDP, length %u", ulen); } } else { if (ulen > length) - ND_PRINT((ndo, "UDP, bad length %u > %u", - ulen, length)); + ND_PRINT("UDP, bad length %u > %u", + ulen, length); else - ND_PRINT((ndo, "UDP, length %u", ulen)); + ND_PRINT("UDP, length %u", ulen); } return; trunc: - ND_PRINT((ndo, "%s", udp_tstr)); + ND_PRINT("%s", udp_tstr); }