1 /* $OpenBSD: rquota.x,v 1.4 2009/10/27 23:59:30 deraadt Exp $ */ 2 3 /* 4 * Remote quota protocol 5 * Requires unix authentication 6 */ 7 8 #ifndef RPC_HDR 9 #endif 10 11 const RQ_PATHLEN = 1024; 12 13 struct getquota_args { 14 string gqa_pathp<RQ_PATHLEN>; /* path to filesystem of interest */ 15 int gqa_uid; /* inquire about quota for uid */ 16 }; 17 18 /* 19 * remote quota structure 20 */ 21 struct rquota { 22 int rq_bsize; /* block size for block counts */ 23 bool rq_active; /* indicates whether quota is active */ 24 unsigned int rq_bhardlimit; /* absolute limit on disk blks alloc */ 25 unsigned int rq_bsoftlimit; /* preferred limit on disk blks */ 26 unsigned int rq_curblocks; /* current block count */ 27 unsigned int rq_fhardlimit; /* absolute limit on allocated files */ 28 unsigned int rq_fsoftlimit; /* preferred file limit */ 29 unsigned int rq_curfiles; /* current # allocated files */ 30 unsigned int rq_btimeleft; /* time left for excessive disk use */ 31 unsigned int rq_ftimeleft; /* time left for excessive files */ 32 }; 33 34 enum gqr_status { 35 Q_OK = 1, /* quota returned */ 36 Q_NOQUOTA = 2, /* noquota for uid */ 37 Q_EPERM = 3 /* no permission to access quota */ 38 }; 39 40 union getquota_rslt switch (gqr_status status) { 41 case Q_OK: 42 rquota gqr_rquota; /* valid if status == Q_OK */ 43 case Q_NOQUOTA: 44 void; 45 case Q_EPERM: 46 void; 47 }; 48 49 program RQUOTAPROG { 50 version RQUOTAVERS { 51 /* 52 * Get all quotas 53 */ 54 getquota_rslt 55 RQUOTAPROC_GETQUOTA(getquota_args) = 1; 56 57 /* 58 * Get active quotas only 59 */ 60 getquota_rslt 61 RQUOTAPROC_GETACTIVEQUOTA(getquota_args) = 2; 62 } = 1; 63 } = 100011; 64