- 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_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_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;
- 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((ndo, " %u", EXTRACT_BE_U_4(&((const u_int *)hdr)[2])));
optlen = (i2 >> 16) & 0xff;
if (optlen == 0 || optlen > len) {
ND_PRINT((ndo, " !opt"));
optlen = (i2 >> 16) & 0xff;
if (optlen == 0 || optlen > len) {
ND_PRINT((ndo, " !opt"));
extlen = (i2 & 0xffff) + 1;
if (extlen > len) {
ND_PRINT((ndo, " !ext"));
extlen = (i2 & 0xffff) + 1;
if (extlen > len) {
ND_PRINT((ndo, " !ext"));
if (len != cnt * sizeof(*rr) + sizeof(*sr) + sizeof(*rh))
ND_PRINT((ndo, " [%d]", len));
if (ndo->ndo_vflag)
if (len != cnt * sizeof(*rr) + sizeof(*sr) + sizeof(*rh))
ND_PRINT((ndo, " [%d]", len));
if (ndo->ndo_vflag)
- 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)));
+ 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((ndo, " [%d]", len));
rr = (const struct rtcp_rr *)(rh + 1);
if (ndo->ndo_vflag)
ND_PRINT((ndo, " [%d]", len));
rr = (const struct rtcp_rr *)(rh + 1);
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, " %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.;
- EXTRACT_32BITS(&rr->rr_nl) & 0x00ffffff,
- EXTRACT_32BITS(&rr->rr_ls),
- EXTRACT_32BITS(&rr->rr_dv), ts, dts));
+ EXTRACT_BE_U_4(&rr->rr_nl) & 0x00ffffff,
+ EXTRACT_BE_U_4(&rr->rr_ls),
+ EXTRACT_BE_U_4(&rr->rr_dv), ts, dts));
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;
}
udpipaddr_print(ndo, ip, sport, dport);
goto trunc;
}
if (ulen < sizeof(struct udphdr)) {
udpipaddr_print(ndo, ip, sport, dport);
ND_PRINT((ndo, "truncated-udplength %d", ulen));
if (ulen < sizeof(struct udphdr)) {
udpipaddr_print(ndo, ip, sport, dport);
ND_PRINT((ndo, "truncated-udplength %d", ulen));
- sunrpcrequest_print(ndo, (const u_char *)rp, length,
+ sunrpc_print(ndo, (const u_char *)rp, length,
(const u_char *)ip);
else
nfsreply_print(ndo, (const u_char *)rp, length,
(const u_char *)ip);
else
nfsreply_print(ndo, (const u_char *)rp, length,
- ND_PRINT((ndo, "NFS request xid %u ", EXTRACT_32BITS(&rp->rm_xid)));
- nfsreq_print_noaddr(ndo, (const u_char *)rp, length,
+ ND_PRINT((ndo, "NFS request xid %u ", EXTRACT_BE_U_4(&rp->rm_xid)));
+ nfsreq_noaddr_print(ndo, (const u_char *)rp, length,
- ND_PRINT((ndo, "NFS reply xid %u ", EXTRACT_32BITS(&rp->rm_xid)));
- nfsreply_print_noaddr(ndo, (const u_char *)rp, length,
+ ND_PRINT((ndo, "NFS reply xid %u ", EXTRACT_BE_U_4(&rp->rm_xid)));
+ nfsreply_noaddr_print(ndo, (const u_char *)rp, length,
* 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)) {
if (udp_sum == 0) {
ND_PRINT((ndo, "[no cksum] "));
} else if (ND_TTEST2(cp[0], length)) {
if (udp_sum == 0) {
ND_PRINT((ndo, "[no cksum] "));
} else if (ND_TTEST2(cp[0], length)) {
/* for IPv6, UDP checksum is mandatory */
if (ND_TTEST2(cp[0], length)) {
sum = udp6_cksum(ndo, ip6, up, length + sizeof(struct udphdr));
/* for IPv6, UDP checksum is mandatory */
if (ND_TTEST2(cp[0], length)) {
sum = udp6_cksum(ndo, ip6, up, length + sizeof(struct udphdr));
- ns_print(ndo, (const u_char *)(up + 1), length, 0);
+ domain_print(ndo, (const u_char *)(up + 1), length, 0);
- ns_print(ndo, (const u_char *)(up + 1), length, 1);
+ domain_print(ndo, (const u_char *)(up + 1), length, 1);
else if (IS_SRC_OR_DST_PORT(TIMED_PORT))
timed_print(ndo, (const u_char *)(up + 1));
else if (IS_SRC_OR_DST_PORT(TFTP_PORT))
else if (IS_SRC_OR_DST_PORT(TIMED_PORT))
timed_print(ndo, (const u_char *)(up + 1));
else if (IS_SRC_OR_DST_PORT(TFTP_PORT))