NFS file handle is an opaque server-issued sequence of bytes. Parse_fh()
function implements heuristics to decode file handles generated by some
NFS servers, among other information extracting the node (inode) number.
It decodes only 32-bit node numbers.
NFS implementations use ino_t C type to represent the node number. The
type size may vary across implementations/encodings and may be missing
during compile time.
Tcpdump used to have its own typedef for ino_t. Gisle Vanem points that
it caused a problem with MSVC v.16.00.40219.01 for 80x86, which defines
the same type in <sys/types.h>. This change fixes tcpdump code to use
u_int32_t and removes the typedef.
#define fsid_eq(a,b) ((a.fsid_code == b.fsid_code) &&\
dev_eq(a.Fsid_dev, b.Fsid_dev))
#define fsid_eq(a,b) ((a.fsid_code == b.fsid_code) &&\
dev_eq(a.Fsid_dev, b.Fsid_dev))
-extern void Parse_fh(const unsigned char *, int, my_fsid *, ino_t *, const char **, const char **, int);
+extern void Parse_fh(const unsigned char *, int, my_fsid *, u_int32_t *, const char **, const char **, int);
register const unsigned char *fh;
int len _U_;
my_fsid *fsidp;
register const unsigned char *fh;
int len _U_;
my_fsid *fsidp;
const char **osnamep; /* if non-NULL, return OS name here */
const char **fsnamep; /* if non-NULL, return server fs name here (for VMS) */
int ourself; /* true if file handle was generated on this host */
const char **osnamep; /* if non-NULL, return OS name here */
const char **fsnamep; /* if non-NULL, return server fs name here (for VMS) */
int ourself; /* true if file handle was generated on this host */
fsidp->Fsid_dev.Major = fhp[6];
fsidp->fsid_code = 0;
fsidp->Fsid_dev.Major = fhp[6];
fsidp->fsid_code = 0;
- temp = make_uint32(fhp[12], fhp[13], fhp[14], fhp[15]);
- *inop = temp;
+ *inop = make_uint32(fhp[12], fhp[13], fhp[14], fhp[15]);
if (osnamep)
*osnamep = "Auspex";
if (osnamep)
*osnamep = "Auspex";
fsidp->Fsid_dev.Major = fhp[1];
fsidp->fsid_code = 0;
fsidp->Fsid_dev.Major = fhp[1];
fsidp->fsid_code = 0;
- temp = make_uint32(fhp[15], fhp[14], fhp[13], fhp[12]);
- *inop = temp;
+ *inop = make_uint32(fhp[15], fhp[14], fhp[13], fhp[12]);
if (osnamep)
*osnamep = "BSD 4.4";
if (osnamep)
*osnamep = "BSD 4.4";
fsidp->Fsid_dev.Minor = temp & 0xFFFFF;
fsidp->Fsid_dev.Major = (temp>>20) & 0xFFF;
fsidp->Fsid_dev.Minor = temp & 0xFFFFF;
fsidp->Fsid_dev.Major = (temp>>20) & 0xFFF;
- temp = make_uint32(fhp[15], fhp[14], fhp[13], fhp[12]);
- *inop = temp;
+ *inop = make_uint32(fhp[15], fhp[14], fhp[13], fhp[12]);
if (osnamep)
*osnamep = "OSF";
break;
if (osnamep)
*osnamep = "OSF";
break;
fsidp->Fsid_dev.Major = fhp[2];
fsidp->fsid_code = 0;
fsidp->Fsid_dev.Major = fhp[2];
fsidp->fsid_code = 0;
- temp = make_uint32(fhp[8], fhp[9], fhp[10], fhp[11]);
- *inop = temp;
+ *inop = make_uint32(fhp[8], fhp[9], fhp[10], fhp[11]);
if (osnamep)
*osnamep = "IRIX4";
if (osnamep)
*osnamep = "IRIX4";
fsidp->Fsid_dev.Major = make_uint16(fhp[0], fhp[1]);
fsidp->fsid_code = make_uint32(fhp[4], fhp[5], fhp[6], fhp[7]);
fsidp->Fsid_dev.Major = make_uint16(fhp[0], fhp[1]);
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;
+ *inop = make_uint32(fhp[12], fhp[13], fhp[14], fhp[15]);
if (osnamep)
*osnamep = "IRIX5";
if (osnamep)
*osnamep = "IRIX5";
fsidp->Fsid_dev.Major = fhp[2];
fsidp->fsid_code = make_uint32(fhp[4], fhp[5], fhp[6], fhp[7]);
fsidp->Fsid_dev.Major = fhp[2];
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;
+ *inop = make_uint32(fhp[12], fhp[13], fhp[14], fhp[15]);
if (osnamep)
*osnamep = "SUNOS4";
if (osnamep)
*osnamep = "SUNOS4";
fsidp->Fsid_dev.Minor = temp & 0x3FFFF;
fsidp->fsid_code = make_uint32(fhp[4], fhp[5], fhp[6], fhp[7]);
fsidp->Fsid_dev.Minor = temp & 0x3FFFF;
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;
+ *inop = make_uint32(fhp[12], fhp[13], fhp[14], fhp[15]);
if (osnamep)
*osnamep = "SUNOS5";
if (osnamep)
*osnamep = "SUNOS5";
fsidp->Fsid_dev.Major = make_uint16(fhp[0], fhp[1]);
fsidp->fsid_code = make_uint32(fhp[4], fhp[5], fhp[6], fhp[7]);
fsidp->Fsid_dev.Major = make_uint16(fhp[0], fhp[1]);
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;
+ *inop = make_uint32(fhp[12], fhp[13], fhp[14], fhp[15]);
if (osnamep)
*osnamep = "AIX32";
if (osnamep)
*osnamep = "AIX32";
fsidp->Fsid_dev.Minor = temp;
fsidp->fsid_code = make_uint32(fhp[4], fhp[5], fhp[6], fhp[7]);
fsidp->Fsid_dev.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;
+ *inop = make_uint32(fhp[12], fhp[13], fhp[14], fhp[15]);
if (osnamep)
*osnamep = "HPUX9";
if (osnamep)
*osnamep = "HPUX9";
nfs_printfh(register const u_int32_t *dp, const u_int len)
{
my_fsid fsid;
nfs_printfh(register const u_int32_t *dp, const u_int len)
{
my_fsid fsid;
const char *sfsname = NULL;
char *spacep;
const char *sfsname = NULL;
char *spacep;
#define read _read
#define close _close
#define O_RDONLY _O_RDONLY
#define read _read
#define close _close
#define O_RDONLY _O_RDONLY
#endif /* __MINGW32__ */
#ifdef __MINGW32__
#endif /* __MINGW32__ */
#ifdef __MINGW32__