Merge from vendor branch BINUTILS:
[dragonfly.git] / include / rpcsvc / rquota.x
1 /*
2  * Remote quota protocol
3  * Requires unix authentication
4  *
5  * @(#)rquota.x 1.2 87/09/20 Copyr 1987 Sun Micro
6  * @(#)rquota.x 2.1 88/08/01 4.0 RPCSRC
7  * $FreeBSD: src/include/rpcsvc/rquota.x,v 1.6 1999/08/27 23:45:10 peter Exp $
8  * $DragonFly: src/include/rpcsvc/rquota.x,v 1.2 2003/06/17 04:25:58 dillon Exp $
9  */
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;