diff options
author | mlaier <mlaier@FreeBSD.org> | 2007-10-16 02:20:42 +0000 |
---|---|---|
committer | mlaier <mlaier@FreeBSD.org> | 2007-10-16 02:20:42 +0000 |
commit | 3b74598d7ea581deadb14ec8ba1c77c14295a7c8 (patch) | |
tree | 01f74f6819cfb28636e2f6d04efefacdfecafc5c /contrib/tcpdump/parsenfsfh.c | |
parent | 68a3d30d4eef678528761ead6b0743885324cdd0 (diff) | |
download | FreeBSD-src-3b74598d7ea581deadb14ec8ba1c77c14295a7c8.zip FreeBSD-src-3b74598d7ea581deadb14ec8ba1c77c14295a7c8.tar.gz |
Import of tcpdump v3.9.8
Diffstat (limited to 'contrib/tcpdump/parsenfsfh.c')
-rw-r--r-- | contrib/tcpdump/parsenfsfh.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/contrib/tcpdump/parsenfsfh.c b/contrib/tcpdump/parsenfsfh.c index 686d01e..ef1e0ba 100644 --- a/contrib/tcpdump/parsenfsfh.c +++ b/contrib/tcpdump/parsenfsfh.c @@ -42,7 +42,7 @@ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/parsenfsfh.c,v 1.28 2004/03/25 03:30:55 mcr Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/parsenfsfh.c,v 1.28.2.1 2007/06/15 19:15:04 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -79,6 +79,7 @@ static const char rcsid[] _U_ = #define FHT_SUNOS5 9 #define FHT_AIX32 10 #define FHT_HPUX9 11 +#define FHT_BSD44 12 #ifdef ultrix /* Nasty hack to keep the Ultrix C compiler from emitting bogus warnings */ @@ -146,6 +147,10 @@ int ourself; /* true if file handle was generated on this host */ #if defined(__osf__) fhtype = FHT_DECOSF; #endif +#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) \ + || defined(__OpenBSD__) + fhtype = FHT_BSD44; +#endif } /* * This is basically a big decision tree @@ -196,8 +201,11 @@ int ourself; /* true if file handle was generated on this host */ * could be Ultrix, IRIX5, AIX, or SUNOS5 * might be HP-UX (depends on their values for minor devs) */ + if ((fhp[6] == 0) && (fhp[7] == 0)) { + fhtype = FHT_BSD44; + } /*XXX we probably only need to test of these two bytes */ - if ((fhp[21] == 0) && (fhp[23] == 0)) { + else if ((fhp[21] == 0) && (fhp[23] == 0)) { fhtype = FHT_ULTRIX; } else { @@ -263,6 +271,18 @@ int ourself; /* true if file handle was generated on this host */ *osnamep = "Auspex"; break; + case FHT_BSD44: + fsidp->Fsid_dev.Minor = fhp[0]; + fsidp->Fsid_dev.Major = fhp[1]; + fsidp->fsid_code = 0; + + temp = make_uint32(fhp[15], fhp[14], fhp[13], fhp[12]); + *inop = temp; + + if (osnamep) + *osnamep = "BSD 4.4"; + break; + case FHT_DECOSF: fsidp->fsid_code = make_uint32(fhp[7], fhp[6], fhp[5], fhp[4]); /* XXX could ignore 3 high-order bytes */ @@ -301,10 +321,16 @@ int ourself; /* true if file handle was generated on this host */ *osnamep = "IRIX5"; break; +#ifdef notdef case FHT_SUNOS3: + /* + * XXX - none of the heuristics above return this. + * Are there any SunOS 3.x systems around to care about? + */ if (osnamep) *osnamep = "SUNOS3"; break; +#endif case FHT_SUNOS4: fsidp->Fsid_dev.Minor = fhp[3]; |