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.1 jtc %#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.3 lukem %__RCSID("$NetBSD: rquota.x,v 1.3 1997/10/09 14:21:24 lukem Exp $"); 12 1.1 jtc %#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.1 jtc /* 23 1.1 jtc * remote quota structure 24 1.1 jtc */ 25 1.1 jtc struct rquota { 26 1.1 jtc int rq_bsize; /* block size for block counts */ 27 1.1 jtc bool rq_active; /* indicates whether quota is active */ 28 1.1 jtc unsigned int rq_bhardlimit; /* absolute limit on disk blks alloc */ 29 1.1 jtc unsigned int rq_bsoftlimit; /* preferred limit on disk blks */ 30 1.1 jtc unsigned int rq_curblocks; /* current block count */ 31 1.1 jtc unsigned int rq_fhardlimit; /* absolute limit on allocated files */ 32 1.1 jtc unsigned int rq_fsoftlimit; /* preferred file limit */ 33 1.1 jtc unsigned int rq_curfiles; /* current # allocated files */ 34 1.1 jtc unsigned int rq_btimeleft; /* time left for excessive disk use */ 35 1.1 jtc unsigned int rq_ftimeleft; /* time left for excessive files */ 36 1.1 jtc }; 37 1.1 jtc 38 1.1 jtc enum gqr_status { 39 1.1 jtc Q_OK = 1, /* quota returned */ 40 1.1 jtc Q_NOQUOTA = 2, /* noquota for uid */ 41 1.1 jtc Q_EPERM = 3 /* no permission to access quota */ 42 1.1 jtc }; 43 1.1 jtc 44 1.1 jtc union getquota_rslt switch (gqr_status status) { 45 1.1 jtc case Q_OK: 46 1.1 jtc rquota gqr_rquota; /* valid if status == Q_OK */ 47 1.1 jtc case Q_NOQUOTA: 48 1.1 jtc void; 49 1.1 jtc case Q_EPERM: 50 1.1 jtc void; 51 1.1 jtc }; 52 1.1 jtc 53 1.1 jtc program RQUOTAPROG { 54 1.1 jtc version RQUOTAVERS { 55 1.1 jtc /* 56 1.1 jtc * Get all quotas 57 1.1 jtc */ 58 1.1 jtc getquota_rslt 59 1.1 jtc RQUOTAPROC_GETQUOTA(getquota_args) = 1; 60 1.1 jtc 61 1.1 jtc /* 62 1.1 jtc * Get active quotas only 63 1.1 jtc */ 64 1.1 jtc getquota_rslt 65 1.1 jtc RQUOTAPROC_GETACTIVEQUOTA(getquota_args) = 2; 66 1.1 jtc } = 1; 67 1.1 jtc } = 100011; 68