xref: /freebsd/contrib/tcpdump/nfsfh.h (revision ee67461e56828dd1f8de165947ba83f6d9148a87)
14edb46e9SPaul Traina /*
2a1c2090eSBill Fenner  * Copyright (c) 1993, 1994 Jeffrey C. Mogul, Digital Equipment Corporation,
3a1c2090eSBill Fenner  * Western Research Laboratory. All rights reserved.
4a1c2090eSBill Fenner  * Copyright (c) 2001 Compaq Computer Corporation. All rights reserved.
54edb46e9SPaul Traina  *
6a1c2090eSBill Fenner  *  Permission to use, copy, and modify this software and its
7a1c2090eSBill Fenner  *  documentation is hereby granted only under the following terms and
8a1c2090eSBill Fenner  *  conditions.  Both the above copyright notice and this permission
9a1c2090eSBill Fenner  *  notice must appear in all copies of the software, derivative works
10a1c2090eSBill Fenner  *  or modified versions, and any portions thereof, and both notices
11a1c2090eSBill Fenner  *  must appear in supporting documentation.
12a1c2090eSBill Fenner  *
13a1c2090eSBill Fenner  *  Redistribution and use in source and binary forms, with or without
14a1c2090eSBill Fenner  *  modification, are permitted provided that the following conditions
15a1c2090eSBill Fenner  *  are met:
16a1c2090eSBill Fenner  *    1. Redistributions of source code must retain the above copyright
17a1c2090eSBill Fenner  *    notice, this list of conditions and the following disclaimer.
18a1c2090eSBill Fenner  *    2. Redistributions in binary form must reproduce the above copyright
19a1c2090eSBill Fenner  *    notice, this list of conditions and the following disclaimer in
20a1c2090eSBill Fenner  *    the documentation and/or other materials provided with the
21a1c2090eSBill Fenner  *    distribution.
22a1c2090eSBill Fenner  *
23a1c2090eSBill Fenner  *  THE SOFTWARE IS PROVIDED "AS IS" AND COMPAQ COMPUTER CORPORATION
24a1c2090eSBill Fenner  *  DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
25a1c2090eSBill Fenner  *  ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.   IN NO
26a1c2090eSBill Fenner  *  EVENT SHALL COMPAQ COMPUTER CORPORATION BE LIABLE FOR ANY
27a1c2090eSBill Fenner  *  SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
28a1c2090eSBill Fenner  *  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
29a1c2090eSBill Fenner  *  AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
30a1c2090eSBill Fenner  *  OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
31a1c2090eSBill Fenner  *  SOFTWARE.
32a1c2090eSBill Fenner  */
33a1c2090eSBill Fenner 
34a1c2090eSBill Fenner /*
354edb46e9SPaul Traina  * nfsfh.h - NFS file handle definitions (for portable use)
364edb46e9SPaul Traina  *
374edb46e9SPaul Traina  * Jeffrey C. Mogul
384edb46e9SPaul Traina  * Digital Equipment Corporation
394edb46e9SPaul Traina  * Western Research Laboratory
40a1c2090eSBill Fenner  */
414edb46e9SPaul Traina 
424edb46e9SPaul Traina /*
434edb46e9SPaul Traina  * Internal representation of dev_t, because different NFS servers
444edb46e9SPaul Traina  * that we might be spying upon use different external representations.
454edb46e9SPaul Traina  */
464edb46e9SPaul Traina typedef struct {
473c602fabSXin LI 	uint32_t Minor;	/* upper case to avoid clashing with macro names */
483c602fabSXin LI 	uint32_t Major;
494edb46e9SPaul Traina } my_devt;
504edb46e9SPaul Traina 
514edb46e9SPaul Traina #define	dev_eq(a,b)	((a.Minor == b.Minor) && (a.Major == b.Major))
524edb46e9SPaul Traina 
534edb46e9SPaul Traina /*
544edb46e9SPaul Traina  * Many file servers now use a large file system ID.  This is
554edb46e9SPaul Traina  * our internal representation of that.
564edb46e9SPaul Traina  */
574edb46e9SPaul Traina typedef	struct {
582ebf6c05SBill Fenner 	my_devt	Fsid_dev;		/* XXX avoid name conflict with AIX */
59943ee2b1SBill Fenner 	char Opaque_Handle[2 * 32 + 1];
603c602fabSXin LI 	uint32_t fsid_code;
614edb46e9SPaul Traina } my_fsid;
624edb46e9SPaul Traina 
634edb46e9SPaul Traina #define	fsid_eq(a,b)	((a.fsid_code == b.fsid_code) &&\
64699fc314SBill Fenner 			 dev_eq(a.Fsid_dev, b.Fsid_dev))
654edb46e9SPaul Traina 
66*ee67461eSJoseph Mingrone extern void Parse_fh(netdissect_options *, const unsigned char *, u_int, my_fsid *, uint32_t *, const char **, const char **, int);
67