Home | History | Annotate | Line # | Download | only in librpcsvc
      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.3   lukem %#include <sys/cdefs.h>
      8  1.6  kleink %#ifndef __lint__
      9  1.1     jtc %/*static char sccsid[] = "from: @(#)rquota.x 1.2 87/09/20 Copyr 1987 Sun Micro";*/
     10  1.1     jtc %/*static char sccsid[] = "from: @(#)rquota.x	2.1 88/08/01 4.0 RPCSRC";*/
     11  1.6  kleink %__RCSID("$NetBSD: rquota.x,v 1.6 2004/07/01 22:52:34 kleink Exp $");
     12  1.6  kleink %#endif /* not __lint__ */
     13  1.1     jtc #endif
     14  1.1     jtc 
     15  1.1     jtc const RQ_PATHLEN = 1024;
     16  1.1     jtc 
     17  1.1     jtc struct getquota_args {
     18  1.1     jtc 	string gqa_pathp<RQ_PATHLEN>;  	/* path to filesystem of interest */
     19  1.1     jtc 	int gqa_uid;	        	/* inquire about quota for uid */
     20  1.1     jtc };
     21  1.1     jtc 
     22  1.5  bouyer const RQUOTA_MAXQUOTAS = 0x02;
     23  1.5  bouyer const RQUOTA_USRQUOTA = 0x00;
     24  1.5  bouyer const RQUOTA_GRPQUOTA = 0x01;
     25  1.5  bouyer 
     26  1.5  bouyer struct ext_getquota_args {
     27  1.5  bouyer 	string gqa_pathp<RQ_PATHLEN>;  	/* path to filesystem of interest */
     28  1.5  bouyer 	int gqa_type;			/* type of quota */
     29  1.5  bouyer 	int gqa_id;	        	/* inquire about quota for uid/gid */
     30  1.5  bouyer };
     31  1.5  bouyer 
     32  1.1     jtc /*
     33  1.1     jtc  * remote quota structure
     34  1.1     jtc  */
     35  1.1     jtc struct rquota {
     36  1.1     jtc 	int rq_bsize;			/* block size for block counts */
     37  1.1     jtc 	bool rq_active;  		/* indicates whether quota is active */
     38  1.1     jtc 	unsigned int rq_bhardlimit;	/* absolute limit on disk blks alloc */
     39  1.1     jtc 	unsigned int rq_bsoftlimit;	/* preferred limit on disk blks */
     40  1.1     jtc 	unsigned int rq_curblocks;	/* current block count */
     41  1.1     jtc 	unsigned int rq_fhardlimit;	/* absolute limit on allocated files */
     42  1.1     jtc 	unsigned int rq_fsoftlimit;	/* preferred file limit */
     43  1.1     jtc 	unsigned int rq_curfiles;	/* current # allocated files */
     44  1.1     jtc 	unsigned int rq_btimeleft;	/* time left for excessive disk use */
     45  1.1     jtc 	unsigned int rq_ftimeleft;	/* time left for excessive files */
     46  1.4  simonb };
     47  1.1     jtc 
     48  1.1     jtc enum gqr_status {
     49  1.1     jtc 	Q_OK = 1,		/* quota returned */
     50  1.1     jtc 	Q_NOQUOTA = 2,  	/* noquota for uid */
     51  1.1     jtc 	Q_EPERM = 3		/* no permission to access quota */
     52  1.1     jtc };
     53  1.1     jtc 
     54  1.1     jtc union getquota_rslt switch (gqr_status status) {
     55  1.1     jtc case Q_OK:
     56  1.1     jtc 	rquota gqr_rquota;	/* valid if status == Q_OK */
     57  1.1     jtc case Q_NOQUOTA:
     58  1.1     jtc 	void;
     59  1.1     jtc case Q_EPERM:
     60  1.1     jtc 	void;
     61  1.1     jtc };
     62  1.1     jtc 
     63  1.1     jtc program RQUOTAPROG {
     64  1.1     jtc 	version RQUOTAVERS {
     65  1.1     jtc 		/*
     66  1.1     jtc 		 * Get all quotas
     67  1.1     jtc 		 */
     68  1.1     jtc 		getquota_rslt
     69  1.1     jtc 		RQUOTAPROC_GETQUOTA(getquota_args) = 1;
     70  1.1     jtc 
     71  1.1     jtc 		/*
     72  1.1     jtc 	 	 * Get active quotas only
     73  1.1     jtc 		 */
     74  1.1     jtc 		getquota_rslt
     75  1.1     jtc 		RQUOTAPROC_GETACTIVEQUOTA(getquota_args) = 2;
     76  1.1     jtc 	} = 1;
     77  1.5  bouyer 	version EXT_RQUOTAVERS {
     78  1.5  bouyer 		/*
     79  1.5  bouyer 		 * Get all quotas
     80  1.5  bouyer 		 */
     81  1.5  bouyer 		getquota_rslt
     82  1.5  bouyer 		RQUOTAPROC_GETQUOTA(ext_getquota_args) = 1;
     83  1.5  bouyer 
     84  1.5  bouyer 		/*
     85  1.5  bouyer 	 	 * Get active quotas only
     86  1.5  bouyer 		 */
     87  1.5  bouyer 		getquota_rslt
     88  1.5  bouyer 		RQUOTAPROC_GETACTIVEQUOTA(ext_getquota_args) = 2;
     89  1.5  bouyer 	} = 2;
     90  1.1     jtc } = 100011;
     91