xref: /original-bsd/sys/miscfs/portal/portal.h (revision 28ba1365)
1 /*
2  * Copyright (c) 1992, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  * All rights reserved.
5  *
6  * This code is derived from software donated to Berkeley by
7  * Jan-Simon Pendry.
8  *
9  * %sccs.include.redist.c%
10  *
11  *	@(#)portal.h	8.2 (Berkeley) 01/04/94
12  *
13  * $Id: portal.h,v 1.3 1992/05/30 10:05:24 jsp Exp jsp $
14  */
15 
16 struct portal_args {
17 	char		*pa_config;	/* Config file */
18 	int		pa_socket;	/* Socket to server */
19 };
20 
21 struct portal_cred {
22 	int		pcr_flag;		/* File open mode */
23 	uid_t		pcr_uid;		/* From ucred */
24 	short		pcr_ngroups;		/* From ucred */
25 	gid_t		pcr_groups[NGROUPS];	/* From ucred */
26 };
27 
28 #ifdef KERNEL
29 
30 #ifndef VT_PORTAL
31 #define VT_PORTAL VT_UFS
32 #endif
33 
34 struct portalmount {
35 	struct vnode	*pm_root;	/* Root node */
36 	struct file	*pm_server;	/* Held reference to server socket */
37 };
38 
39 struct portalnode {
40 	int		pt_size;	/* Length of Arg */
41 	char		*pt_arg;	/* Arg to send to server */
42 	int		pt_fileid;	/* cookie */
43 };
44 
45 #define VFSTOPORTAL(mp)	((struct portalmount *)((mp)->mnt_data))
46 #define	VTOPORTAL(vp) ((struct portalnode *)(vp)->v_data)
47 
48 #define PORTAL_ROOTFILEID	2
49 
50 extern int (**portal_vnodeop_p)();
51 extern struct vfsops portal_vfsops;
52 #endif /* KERNEL */
53