xref: /freebsd/contrib/tcpdump/nfsfh.h (revision f0adf7f5cdd241db2f2c817683191a6ef64a4e95)
1 /* @(#) $Header: /tcpdump/master/tcpdump/nfsfh.h,v 1.13 2002/04/24 06:27:05 guy Exp $ (LBL) */
2 
3 /*
4  * Copyright (c) 1993, 1994 Jeffrey C. Mogul, Digital Equipment Corporation,
5  * Western Research Laboratory. All rights reserved.
6  * Copyright (c) 2001 Compaq Computer Corporation. All rights reserved.
7  *
8  *  Permission to use, copy, and modify this software and its
9  *  documentation is hereby granted only under the following terms and
10  *  conditions.  Both the above copyright notice and this permission
11  *  notice must appear in all copies of the software, derivative works
12  *  or modified versions, and any portions thereof, and both notices
13  *  must appear in supporting documentation.
14  *
15  *  Redistribution and use in source and binary forms, with or without
16  *  modification, are permitted provided that the following conditions
17  *  are met:
18  *    1. Redistributions of source code must retain the above copyright
19  *    notice, this list of conditions and the following disclaimer.
20  *    2. Redistributions in binary form must reproduce the above copyright
21  *    notice, this list of conditions and the following disclaimer in
22  *    the documentation and/or other materials provided with the
23  *    distribution.
24  *
25  *  THE SOFTWARE IS PROVIDED "AS IS" AND COMPAQ COMPUTER CORPORATION
26  *  DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
27  *  ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.   IN NO
28  *  EVENT SHALL COMPAQ COMPUTER CORPORATION BE LIABLE FOR ANY
29  *  SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
30  *  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
31  *  AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
32  *  OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
33  *  SOFTWARE.
34  */
35 
36 /*
37  * nfsfh.h - NFS file handle definitions (for portable use)
38  *
39  * Jeffrey C. Mogul
40  * Digital Equipment Corporation
41  * Western Research Laboratory
42  *	$FreeBSD$
43  *	$NetBSD: nfsfh.h,v 1.1.1.2 1997/10/03 17:25:13 christos Exp $
44  */
45 
46 /*
47  * Internal representation of dev_t, because different NFS servers
48  * that we might be spying upon use different external representations.
49  */
50 typedef struct {
51 	u_int32_t Minor;	/* upper case to avoid clashing with macro names */
52 	u_int32_t Major;
53 } my_devt;
54 
55 #define	dev_eq(a,b)	((a.Minor == b.Minor) && (a.Major == b.Major))
56 
57 /*
58  * Many file servers now use a large file system ID.  This is
59  * our internal representation of that.
60  */
61 typedef	struct {
62 	my_devt	Fsid_dev;		/* XXX avoid name conflict with AIX */
63 	char Opaque_Handle[2 * 32 + 1];
64 	u_int32_t fsid_code;
65 } my_fsid;
66 
67 #define	fsid_eq(a,b)	((a.fsid_code == b.fsid_code) &&\
68 			 dev_eq(a.Fsid_dev, b.Fsid_dev))
69 
70 extern void Parse_fh(const unsigned char *, int, my_fsid *, ino_t *, const char **, const char **, int);
71