xref: /freebsd/include/rpcsvc/rquota.x (revision 17ee9d00bc1ae1e598c38f25826f861e4bc6c3ce)
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 %static char rcsid[] = "$Id: rquota.x,v 1.1 1993/09/14 17:42:49 jtc Exp $";
11 %#endif /* not lint */
12 #endif
13 
14 const RQ_PATHLEN = 1024;
15 
16 struct getquota_args {
17 	string gqa_pathp<RQ_PATHLEN>;  	/* path to filesystem of interest */
18 	int gqa_uid;	        	/* inquire about quota for uid */
19 };
20 
21 /*
22  * remote quota structure
23  */
24 struct rquota {
25 	int rq_bsize;			/* block size for block counts */
26 	bool rq_active;  		/* indicates whether quota is active */
27 	unsigned int rq_bhardlimit;	/* absolute limit on disk blks alloc */
28 	unsigned int rq_bsoftlimit;	/* preferred limit on disk blks */
29 	unsigned int rq_curblocks;	/* current block count */
30 	unsigned int rq_fhardlimit;	/* absolute limit on allocated files */
31 	unsigned int rq_fsoftlimit;	/* preferred file limit */
32 	unsigned int rq_curfiles;	/* current # allocated files */
33 	unsigned int rq_btimeleft;	/* time left for excessive disk use */
34 	unsigned int rq_ftimeleft;	/* time left for excessive files */
35 };
36 
37 enum gqr_status {
38 	Q_OK = 1,		/* quota returned */
39 	Q_NOQUOTA = 2,  	/* noquota for uid */
40 	Q_EPERM = 3		/* no permission to access quota */
41 };
42 
43 union getquota_rslt switch (gqr_status status) {
44 case Q_OK:
45 	rquota gqr_rquota;	/* valid if status == Q_OK */
46 case Q_NOQUOTA:
47 	void;
48 case Q_EPERM:
49 	void;
50 };
51 
52 program RQUOTAPROG {
53 	version RQUOTAVERS {
54 		/*
55 		 * Get all quotas
56 		 */
57 		getquota_rslt
58 		RQUOTAPROC_GETQUOTA(getquota_args) = 1;
59 
60 		/*
61 	 	 * Get active quotas only
62 		 */
63 		getquota_rslt
64 		RQUOTAPROC_GETACTIVEQUOTA(getquota_args) = 2;
65 	} = 1;
66 } = 100011;
67