summaryrefslogtreecommitdiff
path: root/parsenfsfh.c
diff options
context:
space:
mode:
authoritojun <itojun>2001-06-24 21:41:28 +0000
committeritojun <itojun>2001-06-24 21:41:28 +0000
commit8bdecae47b46803b70d67176f13f60c0be9bf3f1 (patch)
treebb580ff43630080f8b5d685739bfdaffd1c44df2 /parsenfsfh.c
parent57b2b8fb2fbde4f39f08c756bd52d700c2e3b828 (diff)
downloadtcpdump-8bdecae47b46803b70d67176f13f60c0be9bf3f1.tar.gz
on netbsd mailing list, it was mentioned that the NetBSD byteorder guessing
code needs revisit.
Diffstat (limited to 'parsenfsfh.c')
-rw-r--r--parsenfsfh.c74
1 files changed, 1 insertions, 73 deletions
diff --git a/parsenfsfh.c b/parsenfsfh.c
index c1c9a51f..e9fce107 100644
--- a/parsenfsfh.c
+++ b/parsenfsfh.c
@@ -42,7 +42,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/parsenfsfh.c,v 1.21 2001-06-18 08:39:36 itojun Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/parsenfsfh.c,v 1.22 2001-06-24 21:41:29 itojun Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -81,8 +81,6 @@ static const char rcsid[] =
#define FHT_SUNOS5 9
#define FHT_AIX32 10
#define FHT_HPUX9 11
-#define FHT_NETBSDEL 12
-#define FHT_NETBSDEB 13
#ifdef ultrix
/* Nasty hack to keep the Ultrix C compiler from emitting bogus warnings */
@@ -150,28 +148,10 @@ int ourself; /* true if file handle was generated on this host */
#if defined(__osf__)
fhtype = FHT_DECOSF;
#endif
-#if defined(__NetBSD__)
-#if BYTE_ORDER == LITTLE_ENDIAN
- fhtype = FHT_NETBSDEL;
-#else
- fhtype = FHT_NETBSDEB;
-#endif
-#endif
}
/*
* This is basically a big decision tree
*/
- else if (fhp[8] == 12 && fhp[9] == 0 && fhp[10] == 0 && fhp[11] == 0)
- /*
- * bytes[8,9] = (12,0); sizeof(struct ufid).
- * bytes[10,11] = (0,0); pad.
- */
- fhtype = FHT_NETBSDEL;
- else if (fhp[8] == 0 && fhp[9] == 12 && fhp[10] == 0 && fhp[11] == 0)
- /*
- * ... same as above but from big-endian machine.
- */
- fhtype = FHT_NETBSDEB;
else if ((fhp[0] == 0) && (fhp[1] == 0)) {
/* bytes[0,1] == (0,0); rules out Ultrix, IRIX5, SUNOS5 */
/* probably rules out HP-UX, AIX unless they allow major=0 */
@@ -419,58 +399,6 @@ int ourself; /* true if file handle was generated on this host */
*osnamep = "HPUX9";
break;
- case FHT_NETBSDEL:
-#define netbsd_major(x) ((int32_t)((((x) & 0x000fff00) >> 8)))
-#define netbsd_minor(x) ((int32_t)((((x) & 0xfff00000) >> 12) | \
- (((x) & 0x000000ff) >> 0)))
- /*
- * fsid_t.val[0]
- *
- * device number for a file system on real device or
- * some unique number for layer file system.
- */
- temp = make_uint32(fhp[3], fhp[2], fhp[1], fhp[0]);
- fsidp->Fsid_dev.Major = netbsd_major(temp);
- fsidp->Fsid_dev.Minor = netbsd_minor(temp);
-
- /*
- * fsid_t.val[1]
- *
- * number based on file system type name.
- */
- fsidp->fsid_code = make_uint32(fhp[7], fhp[6], fhp[5], fhp[4]);
-
- /*
- * struct fid (typically struct ufid)
- *
- * 2 octet of size of file handle followed by 2 octet of pad.
- */
-
- /*
- * if struct ufid, 4 octet of inode number. The null file
- * system also forwards vptofh vnode call to underlying file
- * system.
- */
- temp = make_uint32(fhp[15], fhp[14], fhp[13], fhp[12]);
- *inop = temp;
-
- if (osnamep)
- *osnamep = "NetBSDEL";
- break;
-
- case FHT_NETBSDEB:
- temp = make_uint32(fhp[0], fhp[1], fhp[2], fhp[3]);
- fsidp->Fsid_dev.Major = netbsd_major(temp);
- fsidp->Fsid_dev.Minor = netbsd_minor(temp);
- fsidp->fsid_code = make_uint32(fhp[4], fhp[5], fhp[6], fhp[7]);
-
- temp = make_uint32(fhp[12], fhp[13], fhp[14], fhp[15]);
- *inop = temp;
-
- if (osnamep)
- *osnamep = "NetBSDEB";
- break;
-
case FHT_UNKNOWN:
#ifdef DEBUG
/* XXX debugging */