#endif
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
-#include <netdissect-stdinc.h>
+#include "netdissect-stdinc.h"
#include <stdlib.h>
#include <string.h>
static int tcp_verify_signature(netdissect_options *ndo,
const struct ip *ip, const struct tcphdr *tp,
- const u_char *data, int length, const u_char *rcvsig);
+ const u_char *data, u_int length, const u_char *rcvsig);
#endif
static void print_tcp_rst_data(netdissect_options *, const u_char *sp, u_int length);
else
ip6 = NULL;
ch = '\0';
- if (!ND_TTEST(tp->th_dport)) {
+ if (!ND_TTEST_2(tp->th_dport)) {
ND_PRINT("%s > %s: [|tcp]",
ipaddr_string(ndo, &ip->ip_src),
ipaddr_string(ndo, &ip->ip_dst));
hlen = TH_OFF(tp) * 4;
if (hlen < sizeof(*tp)) {
- ND_PRINT(" tcp %d [bad hdr length %u - too short, < %lu]",
+ ND_PRINT(" tcp %u [bad hdr length %u - too short, < %lu]",
length - hlen, hlen, (unsigned long)sizeof(*tp));
return;
}
urp = EXTRACT_BE_U_2(tp->th_urp);
if (ndo->ndo_qflag) {
- ND_PRINT("tcp %d", length - hlen);
+ ND_PRINT("tcp %u", length - hlen);
if (hlen > length) {
ND_PRINT(" [bad hdr length %u - too long, > %u]",
hlen, length);
ND_PRINT(", ack %u", ack);
}
- ND_PRINT(", win %d", win);
+ ND_PRINT(", win %u", win);
if (flags & TH_URG)
- ND_PRINT(", urg %d", urp);
+ ND_PRINT(", urg %u", urp);
/*
* Handle any options.
*/
} else {
uint32_t s, e;
- ND_PRINT(" %d ", datalen / 8);
+ ND_PRINT(" %u ", datalen / 8);
for (i = 0; i < datalen; i += 8) {
LENCHECK(i + 4);
s = EXTRACT_BE_U_4(cp + i);
if (!ZEROLENOPT(opt))
++datalen; /* size octet */
if (datalen != len)
- ND_PRINT("[len %d]", len);
+ ND_PRINT("[len %u]", len);
ch = ',';
if (opt == TCPOPT_EOL)
break;
if (fraglen > (length) - 4)
fraglen = (length) - 4;
rp = (const struct sunrpc_msg *)(bp + 4);
- if (ND_TTEST(rp->rm_direction)) {
+ if (ND_TTEST_4(rp->rm_direction)) {
direction = (enum sunrpc_msg_type) EXTRACT_BE_U_4(rp->rm_direction);
if (dport == NFS_PORT && direction == SUNRPC_CALL) {
ND_PRINT(": NFS request xid %u ",
static int
tcp_verify_signature(netdissect_options *ndo,
const struct ip *ip, const struct tcphdr *tp,
- const u_char *data, int length, const u_char *rcvsig)
+ const u_char *data, u_int length, const u_char *rcvsig)
{
struct tcphdr tp1;
u_char sig[TCP_SIGLEN];