Subject: Re: NFS questions
To: Manuel Bouyer <bouyer@antioche.eu.org>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 06/16/2004 16:25:08
--2B/JsCI69OhZNC5r
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Jun 16, 2004 at 11:09:18PM +0200, Manuel Bouyer wrote:
> Hi,
> does someone know how to find a file from a NFS server, given a filehandle
> from tcpdump ?
> 23:05:38.425334 192.168.1.17.3538769044 > 132.227.103.2.2049: 112 getattr=
 fh 16,36/1931 (DF)
>=20
> Maybe the easiest way would be to use fhopen() or fhstat(), but then I ne=
ed
> to know how to build a fhandle_t from the above information :)

Look at nfsrv_fhtovp(), it shows how we decompose file handles. Assuming=20
its callers aren't being tricky, you should have the contents of a=20
fhandle_t.

Our file handle have two components. The first is a file system ID, which=
=20
identifies the mount point parrenting the vnode. The remainder is a=20
file-system-specific tag that identifies the vnode within the fs. For ffs,=
=20
it is a combination of the inode # and the inode's generation #.

Take care,

Bill

--2B/JsCI69OhZNC5r
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD8DBQFA0NbUWz+3JHUci9cRAlYkAJ46uCAXLVIxA85ylfsFbv+lUwXGPgCdGBCi
AIZ0Eyn9ZV9cBv5VSxwkbzc=
=5k8t
-----END PGP SIGNATURE-----

--2B/JsCI69OhZNC5r--