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