X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/7c5a9ceee5f8e484cca9da32a9b22481319a4164..38a13e9304585a3e1b833be7a9faa37df1324e63:/print-tcp.c diff --git a/print-tcp.c b/print-tcp.c index fce2cc4e..c2fcd838 100644 --- a/print-tcp.c +++ b/print-tcp.c @@ -2,6 +2,8 @@ * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * + * Copyright (c) 1999-2004 The tcpdump.org project + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) @@ -21,7 +23,7 @@ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/print-tcp.c,v 1.118 2004-09-15 01:21:17 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-tcp.c,v 1.121 2005-04-18 00:22:40 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -30,8 +32,6 @@ static const char rcsid[] _U_ = #include -#include - #include #include #include @@ -47,6 +47,8 @@ static const char rcsid[] _U_ = #include "ip6.h" #endif #include "ipproto.h" +#include "rpc_auth.h" +#include "rpc_msg.h" #include "nameser.h" @@ -229,12 +231,12 @@ tcp_print(register const u_char *bp, register u_int length, * to NFS print routines. */ if (!qflag && hlen >= sizeof(*tp) && hlen <= length) { - if ((u_char *)tp + 4 + sizeof(struct rpc_msg) <= snapend && + if ((u_char *)tp + 4 + sizeof(struct sunrpc_msg) <= snapend && dport == NFS_PORT) { nfsreq_print((u_char *)tp + hlen + 4, length - hlen, (u_char *)ip); return; - } else if ((u_char *)tp + 4 + sizeof(struct rpc_msg) + } else if ((u_char *)tp + 4 + sizeof(struct sunrpc_msg) <= snapend && sport == NFS_PORT) { nfsreply_print((u_char *)tp + hlen + 4, length - hlen, @@ -518,14 +520,13 @@ tcp_print(register const u_char *bp, register u_int length, break; case TCPOPT_SACK: - (void)printf("sack"); datalen = len - 2; if (datalen % 8 != 0) { - (void)printf(" malformed sack "); + (void)printf("malformed sack"); } else { u_int32_t s, e; - (void)printf(" sack %d ", datalen / 8); + (void)printf("sack %d ", datalen / 8); for (i = 0; i < datalen; i += 8) { LENCHECK(i + 4); s = EXTRACT_32BITS(cp + i); @@ -540,7 +541,6 @@ tcp_print(register const u_char *bp, register u_int length, } (void)printf("{%u:%u}", s, e); } - (void)printf(" "); } break;