home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Headers / bsd / rpcsvc / rquota.x < prev    next >
Text File  |  1990-01-29  |  2KB  |  66 lines

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