#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-nfs.c,v 1.82 2000-09-23 08:03:38 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-nfs.c,v 1.89 2001-07-08 08:01:43 itojun Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
struct mbuf;
struct rtentry;
-#include <net/if.h>
#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#ifdef INET6
-#include <netinet/ip6.h>
-#endif
#include <rpc/rpc.h>
#include "nfs.h"
#include "nfsfh.h"
+#include "ip.h"
+#ifdef INET6
+#include "ip6.h"
+#endif
+
static void nfs_printfh(const u_int32_t *, const u_int);
static void xid_map_enter(const struct rpc_msg *, const u_char *);
static int32_t xid_map_find(const struct rpc_msg *, const u_char *,
#endif
srcaddr[0] = dstaddr[0] = '\0';
- switch (((struct ip *)bp)->ip_v) {
+ switch (IP_V((struct ip *)bp)) {
case 4:
ip = (struct ip *)bp;
strlcpy(srcaddr, ipaddr_string(&ip->ip_src), sizeof(srcaddr));
#endif
struct xid_map_entry *xmep;
- switch (((struct ip *)bp)->ip_v) {
+ switch (IP_V((struct ip *)bp)) {
case 4:
ip = (struct ip *)bp;
break;
do {
xmep = &xid_map[i];
cmp = 1;
- if (xmep->ipver != ip->ip_v || xmep->xid != xid)
+ if (xmep->ipver != IP_V(ip) || xmep->xid != xid)
goto nextitem;
switch (xmep->ipver) {
case 4:
int er;
dp = parsestatus(dp, &er);
- if (dp == 0 || er)
+ if (dp == NULL || er)
return (0);
if (qflag)
return (1);
case NFSPROC_ACCESS:
printf(" access");
- dp = parserep(rp, length);
+ if (!(dp = parserep(rp, length)))
+ break;
if (!(dp = parsestatus(dp, &er)))
break;
if (vflag)