ND_TCHECK_2((const u_int *)hdr);
ts = EXTRACT_BE_U_2(hdr);
if ((ts & 0xf060) != 0) {
/* probably vt */
ND_TCHECK_2((const u_int *)hdr);
ts = EXTRACT_BE_U_2(hdr);
if ((ts & 0xf060) != 0) {
/* probably vt */
- ND_TCHECK_2(up->uh_ulen);
- ND_PRINT((ndo, "udp/vt %u %d / %d",
- (uint32_t)(EXTRACT_BE_U_2(up->uh_ulen) - sizeof(*up)),
- ts & 0x3ff, ts >> 10));
+ ND_PRINT("udp/vt %u %u / %u",
+ length,
+ ts & 0x3ff, ts >> 10);
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_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((ndo, "udp/vat %u c%d %u%s",
- (uint32_t)(EXTRACT_BE_U_2(up->uh_ulen) - sizeof(*up) - 8),
+ ND_PRINT("udp/vat %u c%u %u%s",
+ length - 8,
-rtp_print(netdissect_options *ndo, const void *hdr, u_int len,
- const struct udphdr *up)
+rtp_print(netdissect_options *ndo, const void *hdr, u_int len)
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_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]);
hasext = i0 & 0x10000000;
contype = (i0 >> 16) & 0x7f;
hasmarker = i0 & 0x800000;
hasext = i0 & 0x10000000;
contype = (i0 >> 16) & 0x7f;
hasmarker = i0 & 0x800000;
if ((const u_char *)(sr + 1) > ep)
goto trunc;
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);
if ((const u_char *)(sr + 1) > ep)
goto trunc;
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((ndo, " @%.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)));
+ 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));
- ND_PRINT((ndo, " type-0x%x %d", flags & 0xff, len));
+ ND_PRINT(" type-0x%x %u", flags & 0xff, len);
ts = (double)(EXTRACT_BE_U_4(rr->rr_lsr)) / 65536.;
dts = (double)(EXTRACT_BE_U_4(rr->rr_dlsr)) / 65536.;
ts = (double)(EXTRACT_BE_U_4(rr->rr_lsr)) / 65536.;
dts = (double)(EXTRACT_BE_U_4(rr->rr_dlsr)) / 65536.;
EXTRACT_BE_U_4(rr->rr_nl) & 0x00ffffff,
EXTRACT_BE_U_4(rr->rr_ls),
EXTRACT_BE_U_4(rr->rr_nl) & 0x00ffffff,
EXTRACT_BE_U_4(rr->rr_ls),
- ND_PRINT((ndo, "%s > %s: ",
- ip6addr_string(ndo, &ip6->ip6_src),
- ip6addr_string(ndo, &ip6->ip6_dst)));
+ ND_PRINT("%s > %s: ",
+ ip6addr_string(ndo, ip6->ip6_src),
+ ip6addr_string(ndo, ip6->ip6_dst));
- ND_PRINT((ndo, "%s.%s > %s.%s: ",
- ip6addr_string(ndo, &ip6->ip6_src),
+ ND_PRINT("%s.%s > %s.%s: ",
+ ip6addr_string(ndo, ip6->ip6_src),
- ip6addr_string(ndo, &ip6->ip6_dst),
- udpport_string(ndo, dport)));
+ ip6addr_string(ndo, ip6->ip6_dst),
+ udpport_string(ndo, dport));
- ND_PRINT((ndo, "%s > %s: ",
- ipaddr_string(ndo, &ip->ip_src),
- ipaddr_string(ndo, &ip->ip_dst)));
+ ND_PRINT("%s > %s: ",
+ ipaddr_string(ndo, ip->ip_src),
+ ipaddr_string(ndo, ip->ip_dst));
- ND_PRINT((ndo, "%s.%s > %s.%s: ",
- ipaddr_string(ndo, &ip->ip_src),
+ ND_PRINT("%s.%s > %s.%s: ",
+ ipaddr_string(ndo, ip->ip_src),
- ipaddr_string(ndo, &ip->ip_dst),
- udpport_string(ndo, dport)));
+ ipaddr_string(ndo, ip->ip_dst),
+ udpport_string(ndo, dport));
uint16_t sport, dport, ulen;
const struct ip6_hdr *ip6;
uint16_t sport, dport, ulen;
const struct ip6_hdr *ip6;
up = (const struct udphdr *)bp;
ip = (const struct ip *)bp2;
if (IP_V(ip) == 6)
ip6 = (const struct ip6_hdr *)bp2;
else
ip6 = NULL;
up = (const struct udphdr *)bp;
ip = (const struct ip *)bp2;
if (IP_V(ip) == 6)
ip6 = (const struct ip6_hdr *)bp2;
else
ip6 = NULL;
udpipaddr_print(ndo, ip, -1, -1);
goto trunc;
}
udpipaddr_print(ndo, ip, -1, -1);
goto trunc;
}
if (length < sizeof(struct udphdr)) {
udpipaddr_print(ndo, ip, sport, dport);
if (length < sizeof(struct udphdr)) {
udpipaddr_print(ndo, ip, sport, dport);
udpipaddr_print(ndo, ip, sport, dport);
goto trunc;
}
ulen = EXTRACT_BE_U_2(up->uh_ulen);
if (ulen < sizeof(struct udphdr)) {
udpipaddr_print(ndo, ip, sport, dport);
udpipaddr_print(ndo, ip, sport, dport);
goto trunc;
}
ulen = EXTRACT_BE_U_2(up->uh_ulen);
if (ulen < sizeof(struct udphdr)) {
udpipaddr_print(ndo, ip, sport, dport);
case PT_VAT:
udpipaddr_print(ndo, ip, sport, dport);
case PT_VAT:
udpipaddr_print(ndo, ip, sport, dport);
if (direction == SUNRPC_CALL)
sunrpc_print(ndo, (const u_char *)rp, length,
(const u_char *)ip);
if (direction == SUNRPC_CALL)
sunrpc_print(ndo, (const u_char *)rp, length,
(const u_char *)ip);
case PT_RTP:
udpipaddr_print(ndo, ip, sport, dport);
case PT_RTP:
udpipaddr_print(ndo, ip, sport, dport);
- rtp_print(ndo, (const void *)(up + 1), length, up);
+ rtp_print(ndo, (const void *)(up + 1), length);
- if (ND_TTEST(rp->rm_direction)) {
- direction = (enum sunrpc_msg_type) EXTRACT_BE_U_4(&rp->rm_direction);
+ if (ND_TTEST_4(rp->rm_direction)) {
+ direction = (enum sunrpc_msg_type) EXTRACT_BE_U_4(rp->rm_direction);
- ND_PRINT((ndo, "NFS request xid %u ", EXTRACT_BE_U_4(&rp->rm_xid)));
+ 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) {
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_BE_U_4(&rp->rm_xid)));
+ 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;
nfsreply_noaddr_print(ndo, (const u_char *)rp, length,
(const u_char *)ip);
return;
* TCP does, and we do so for UDP-over-IPv6.
*/
if (IP_V(ip) == 4 && (ndo->ndo_vflag > 1)) {
* TCP does, and we do so for UDP-over-IPv6.
*/
if (IP_V(ip) == 4 && (ndo->ndo_vflag > 1)) {
} else if (ND_TTEST_LEN(cp, length)) {
sum = udp_cksum(ndo, ip, up, length + sizeof(struct udphdr));
if (sum != 0) {
} else if (ND_TTEST_LEN(cp, length)) {
sum = udp_cksum(ndo, ip, up, length + sizeof(struct udphdr));
if (sum != 0) {
}
}
else if (IP_V(ip) == 6 && ip6->ip6_plen) {
/* for IPv6, UDP checksum is mandatory */
if (ND_TTEST_LEN(cp, length)) {
sum = udp6_cksum(ndo, ip6, up, length + sizeof(struct udphdr));
}
}
else if (IP_V(ip) == 6 && ip6->ip6_plen) {
/* for IPv6, UDP checksum is mandatory */
if (ND_TTEST_LEN(cp, length)) {
sum = udp6_cksum(ndo, ip6, up, length + sizeof(struct udphdr));
else if (IS_SRC_OR_DST_PORT(NTP_PORT))
ntp_print(ndo, (const u_char *)(up + 1), length);
else if (IS_SRC_OR_DST_PORT(KERBEROS_PORT) || IS_SRC_OR_DST_PORT(KERBEROS_SEC_PORT))
else if (IS_SRC_OR_DST_PORT(NTP_PORT))
ntp_print(ndo, (const u_char *)(up + 1), length);
else if (IS_SRC_OR_DST_PORT(KERBEROS_PORT) || IS_SRC_OR_DST_PORT(KERBEROS_SEC_PORT))
else if (IS_SRC_OR_DST_PORT(L2TP_PORT))
l2tp_print(ndo, (const u_char *)(up + 1), length);
#ifdef ENABLE_SMB
else if (IS_SRC_OR_DST_PORT(L2TP_PORT))
l2tp_print(ndo, (const u_char *)(up + 1), length);
#ifdef ENABLE_SMB
nbt_udp138_print(ndo, (const u_char *)(up + 1), length);
#endif
else if (dport == VAT_PORT)
nbt_udp138_print(ndo, (const u_char *)(up + 1), length);
#endif
else if (dport == VAT_PORT)
/*
* Since there are 10 possible ports to check, I think
* a <> test would be more efficient
*/
else if ((sport >= RX_PORT_LOW && sport <= RX_PORT_HIGH) ||
(dport >= RX_PORT_LOW && dport <= RX_PORT_HIGH))
/*
* Since there are 10 possible ports to check, I think
* a <> test would be more efficient
*/
else if ((sport >= RX_PORT_LOW && sport <= RX_PORT_HIGH) ||
(dport >= RX_PORT_LOW && dport <= RX_PORT_HIGH))
- rx_print(ndo, (const void *)(up + 1), length, sport, dport,
+ rx_print(ndo, (const u_char *)(up + 1), length, sport, dport,
(const u_char *) ip);
else if (IS_SRC_OR_DST_PORT(RIPNG_PORT))
ripng_print(ndo, (const u_char *)(up + 1), length);
(const u_char *) ip);
else if (IS_SRC_OR_DST_PORT(RIPNG_PORT))
ripng_print(ndo, (const u_char *)(up + 1), length);
else if (dport == WB_PORT)
wb_print(ndo, (const u_char *)(up + 1), length);
else if (IS_SRC_OR_DST_PORT(CISCO_AUTORP_PORT))
else if (dport == WB_PORT)
wb_print(ndo, (const u_char *)(up + 1), length);
else if (IS_SRC_OR_DST_PORT(CISCO_AUTORP_PORT))
else if (IS_SRC_OR_DST_PORT(RADIUS_PORT) ||
IS_SRC_OR_DST_PORT(RADIUS_NEW_PORT) ||
IS_SRC_OR_DST_PORT(RADIUS_ACCOUNTING_PORT) ||
else if (IS_SRC_OR_DST_PORT(RADIUS_PORT) ||
IS_SRC_OR_DST_PORT(RADIUS_NEW_PORT) ||
IS_SRC_OR_DST_PORT(RADIUS_ACCOUNTING_PORT) ||
lisp_print(ndo, (const u_char *)(up + 1), length);
else if (IS_SRC_OR_DST_PORT(VXLAN_GPE_PORT))
vxlan_gpe_print(ndo, (const u_char *)(up + 1), length);
lisp_print(ndo, (const u_char *)(up + 1), 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) &&
- EXTRACT_U_1(((const struct LAP *)cp)->type) == lapDDP &&
- (atalk_port(sport) || atalk_port(dport))) {
+ else if (IS_SRC_OR_DST_PORT(ZEP_PORT))
+ zep_print(ndo, (const u_char *)(up + 1), length);
+ else if (ND_TTEST_1(((const struct LAP *)cp)->type) &&
+ EXTRACT_U_1(((const struct LAP *)cp)->type) == lapDDP &&
+ (atalk_port(sport) || atalk_port(dport))) {