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