1/*
2 * Remote quota protocol
3 * Requires unix authentication
4 */
5
6#ifndef RPC_HDR
7%#ifndef lint
8%/*static char sccsid[] = "from: @(#)rquota.x 1.2 87/09/20 Copyr 1987 Sun Micro";*/
9%/*static char sccsid[] = "from: @(#)rquota.x	2.1 88/08/01 4.0 RPCSRC";*/
10%#endif /* not lint */
11%#include <sys/cdefs.h>
12%__RCSID("$FreeBSD: src/include/rpcsvc/rquota.x,v 1.7 2003/05/04 02:51:42 obrien Exp $");
13#endif
14
15const RQ_PATHLEN = 1024;
16
17struct getquota_args {
18	string gqa_pathp<RQ_PATHLEN>;  	/* path to filesystem of interest */
19	int gqa_uid;	        	/* inquire about quota for uid */
20};
21
22/*
23 * remote quota structure
24 */
25struct rquota {
26	int rq_bsize;			/* block size for block counts */
27	bool rq_active;  		/* indicates whether quota is active */
28	unsigned int rq_bhardlimit;	/* absolute limit on disk blks alloc */
29	unsigned int rq_bsoftlimit;	/* preferred limit on disk blks */
30	unsigned int rq_curblocks;	/* current block count */
31	unsigned int rq_fhardlimit;	/* absolute limit on allocated files */
32	unsigned int rq_fsoftlimit;	/* preferred file limit */
33	unsigned int rq_curfiles;	/* current # allocated files */
34	unsigned int rq_btimeleft;	/* time left for excessive disk use */
35	unsigned int rq_ftimeleft;	/* time left for excessive files */
36};
37
38enum gqr_status {
39	Q_OK = 1,		/* quota returned */
40	Q_NOQUOTA = 2,  	/* noquota for uid */
41	Q_EPERM = 3		/* no permission to access quota */
42};
43
44union getquota_rslt switch (gqr_status status) {
45case Q_OK:
46	rquota gqr_rquota;	/* valid if status == Q_OK */
47case Q_NOQUOTA:
48	void;
49case Q_EPERM:
50	void;
51};
52
53program RQUOTAPROG {
54	version RQUOTAVERS {
55		/*
56		 * Get all quotas
57		 */
58		getquota_rslt
59		RQUOTAPROC_GETQUOTA(getquota_args) = 1;
60
61		/*
62	 	 * Get active quotas only
63		 */
64		getquota_rslt
65		RQUOTAPROC_GETACTIVEQUOTA(getquota_args) = 2;
66	} = 1;
67} = 100011;
68