rquota.x revision 50473
1276789Sdim/*
2276789Sdim * Remote quota protocol
3276789Sdim * Requires unix authentication
4276789Sdim */
5276789Sdim
6276789Sdim#ifndef RPC_HDR
7276789Sdim%#ifndef lint
8276789Sdim%/*static char sccsid[] = "from: @(#)rquota.x 1.2 87/09/20 Copyr 1987 Sun Micro";*/
9276789Sdim%/*static char sccsid[] = "from: @(#)rquota.x	2.1 88/08/01 4.0 RPCSRC";*/
10276789Sdim%static const char rcsid[] =
11276789Sdim%  "$FreeBSD: head/include/rpcsvc/rquota.x 50473 1999-08-27 23:45:13Z peter $";
12276789Sdim%#endif /* not lint */
13276789Sdim#endif
14276789Sdim
15276789Sdimconst RQ_PATHLEN = 1024;
16276789Sdim
17276789Sdimstruct getquota_args {
18276789Sdim	string gqa_pathp<RQ_PATHLEN>;  	/* path to filesystem of interest */
19276789Sdim	int gqa_uid;	        	/* inquire about quota for uid */
20276789Sdim};
21276789Sdim
22276789Sdim/*
23276789Sdim * remote quota structure
24276789Sdim */
25276789Sdimstruct rquota {
26276789Sdim	int rq_bsize;			/* block size for block counts */
27276789Sdim	bool rq_active;  		/* indicates whether quota is active */
28276789Sdim	unsigned int rq_bhardlimit;	/* absolute limit on disk blks alloc */
29276789Sdim	unsigned int rq_bsoftlimit;	/* preferred limit on disk blks */
30276789Sdim	unsigned int rq_curblocks;	/* current block count */
31276789Sdim	unsigned int rq_fhardlimit;	/* absolute limit on allocated files */
32276789Sdim	unsigned int rq_fsoftlimit;	/* preferred file limit */
33276789Sdim	unsigned int rq_curfiles;	/* current # allocated files */
34276789Sdim	unsigned int rq_btimeleft;	/* time left for excessive disk use */
35276789Sdim	unsigned int rq_ftimeleft;	/* time left for excessive files */
36276789Sdim};
37276789Sdim
38276789Sdimenum gqr_status {
39276789Sdim	Q_OK = 1,		/* quota returned */
40276789Sdim	Q_NOQUOTA = 2,  	/* noquota for uid */
41276789Sdim	Q_EPERM = 3		/* no permission to access quota */
42276789Sdim};
43276789Sdim
44276789Sdimunion getquota_rslt switch (gqr_status status) {
45276789Sdimcase Q_OK:
46276789Sdim	rquota gqr_rquota;	/* valid if status == Q_OK */
47276789Sdimcase Q_NOQUOTA:
48276789Sdim	void;
49276789Sdimcase Q_EPERM:
50276789Sdim	void;
51276789Sdim};
52276789Sdim
53276789Sdimprogram RQUOTAPROG {
54276789Sdim	version RQUOTAVERS {
55276789Sdim		/*
56276789Sdim		 * Get all quotas
57276789Sdim		 */
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