xref: /original-bsd/usr.sbin/amd/rpcx/amq.x (revision c3e32dec)
1 /*
2  * Copyright (c) 1990 Jan-Simon Pendry
3  * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
4  * Copyright (c) 1990, 1993
5  *	The Regents of the University of California.  All rights reserved.
6  *
7  * This code is derived from software contributed to Berkeley by
8  * Jan-Simon Pendry at Imperial College, London.
9  *
10  * %sccs.include.redist.c%
11  *
12  *	@(#)amq.x	8.1 (Berkeley) 06/06/93
13  *
14  * $Id: amq.x,v 5.2.2.1 1992/02/09 15:09:20 jsp beta $
15  *
16  */
17 
18 /*
19  * Protocol description used by the amq program
20  */
21 
22 const AMQ_STRLEN = 1024;	/* Maximum length of a pathname */
23 
24 /*
25  * The type dirpath is the pathname of a directory
26  */
27 typedef string amq_string<AMQ_STRLEN>;
28 
29 /*
30  * The type time_type should correspond to the system time_t
31  */
32 typedef long time_type;
33 
34 /*
35  * A tree of what is mounted
36  */
37 struct amq_mount_tree {
38 	amq_string	mt_mountinfo;	/* Mounted filesystem */
39 	amq_string 	mt_directory;	/* Virtual mount */
40 	amq_string 	mt_mountpoint;	/* Mount point */
41 	amq_string	mt_type;	/* Filesystem type */
42 	time_type	mt_mounttime;	/* Mount time */
43 	u_short		mt_mountuid;	/* Mounter */
44 	int		mt_getattr;	/* Count of getattrs */
45 	int		mt_lookup;	/* Count of lookups */
46 	int		mt_readdir;	/* Count of readdirs */
47 	int		mt_readlink;	/* Count of readlinks */
48 	int		mt_statfs;	/* Count of statfss */
49 	amq_mount_tree	*mt_next;	/* Sibling mount tree */
50 	amq_mount_tree	*mt_child;	/* Child mount tree */
51 };
52 typedef amq_mount_tree *amq_mount_tree_p;
53 
54 /*
55  * List of mounted filesystems
56  */
57 struct amq_mount_info {
58 	amq_string	mi_type;	/* Type of mount */
59 	amq_string	mi_mountpt;	/* Mount point */
60 	amq_string	mi_mountinfo;	/* Mount info */
61 	amq_string	mi_fserver;	/* Fileserver */
62 	int		mi_error;	/* Error code */
63 	int		mi_refc;	/* References */
64 	int		mi_up;		/* Filesystem available */
65 };
66 typedef amq_mount_info amq_mount_info_list<>;
67 
68 /*
69  * A list of mount trees
70  */
71 typedef amq_mount_tree_p amq_mount_tree_list<>;
72 
73 /*
74  * System wide stats
75  */
76 struct amq_mount_stats {
77 	int	as_drops;	/* Dropped requests */
78 	int	as_stale;	/* Stale NFS handles */
79 	int	as_mok;		/* Succesful mounts */
80 	int	as_merr;	/* Failed mounts */
81 	int	as_uerr;	/* Failed unmounts */
82 };
83 
84 enum amq_opt {
85 	AMOPT_DEBUG=0,
86 	AMOPT_LOGFILE=1,
87 	AMOPT_XLOG=2,
88 	AMOPT_FLUSHMAPC=3
89 };
90 
91 struct amq_setopt {
92 	amq_opt	as_opt;		/* Option */
93 	amq_string as_str;	/* String */
94 };
95 
96 program AMQ_PROGRAM {
97 	version AMQ_VERSION {
98 		/*
99 		 * Does no work. It is made available in all RPC services
100 		 * to allow server reponse testing and timing
101 		 */
102 		void
103 		AMQPROC_NULL(void) = 0;
104 
105 		/*
106 		 * Returned the mount tree descending from
107 		 * the given directory.  The directory must
108 		 * be a top-level mount point of the automounter.
109 		 */
110 		amq_mount_tree_p
111 		AMQPROC_MNTTREE(amq_string) = 1;
112 
113 		/*
114 		 * Force a timeout unmount on the specified directory.
115 		 */
116 		void
117 		AMQPROC_UMNT(amq_string) = 2;
118 
119 		/*
120 		 * Obtain system wide statistics from the automounter
121 		 */
122 		amq_mount_stats
123 		AMQPROC_STATS(void) = 3;
124 
125 		/*
126 		 * Obtain full tree
127 		 */
128 		amq_mount_tree_list
129 		AMQPROC_EXPORT(void) = 4;
130 
131 		/*
132 		 * Control debug options.
133 		 * Return status:
134 		 *	-1: debug not available
135 		 *	 0: everything wonderful
136 		 *	>0: number of options not recognised
137 		 */
138 		int
139 		AMQPROC_SETOPT(amq_setopt) = 5;
140 
141 		/*
142 		 * List of mounted filesystems
143 		 */
144 		amq_mount_info_list
145 		AMQPROC_GETMNTFS(void) = 6;
146 
147 		/*
148 		 * Mount a filesystem
149 		 */
150 		int
151 		AMQPROC_MOUNT(amq_string) = 7;
152 
153 		/*
154 		 * Get version info
155 		 */
156 		amq_string
157 		AMQPROC_GETVERS(void) = 8;
158 	} = 1;
159 } = 300019;	/* Allocated by Sun, 89/8/29 */
160