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