4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen/* @(#)rquota.x 2.1 88/08/01 4.0 RPCSRC */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen/* @(#)rquota.x 1.2 87/09/20 Copyr 1987 Sun Micro */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen/*
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen * Remote quota protocol
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen * Requires unix authentication
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainenconst RQ_PATHLEN = 1024;
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainenstruct sq_dqblk {
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen unsigned int rq_bhardlimit; /* absolute limit on disk blks alloc */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen unsigned int rq_bsoftlimit; /* preferred limit on disk blks */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen unsigned int rq_curblocks; /* current block count */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen unsigned int rq_fhardlimit; /* absolute limit on allocated files */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen unsigned int rq_fsoftlimit; /* preferred file limit */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen unsigned int rq_curfiles; /* current # allocated files */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen unsigned int rq_btimeleft; /* time left for excessive disk use */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen unsigned int rq_ftimeleft; /* time left for excessive files */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen};
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainenstruct getquota_args {
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen string gqa_pathp<RQ_PATHLEN>; /* path to filesystem of interest */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen int gqa_uid; /* Inquire about quota for uid */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen};
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainenstruct setquota_args {
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen int sqa_qcmd;
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen string sqa_pathp<RQ_PATHLEN>; /* path to filesystem of interest */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen int sqa_id; /* Set quota for uid */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen sq_dqblk sqa_dqblk;
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen};
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainenstruct ext_getquota_args {
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen string gqa_pathp<RQ_PATHLEN>; /* path to filesystem of interest */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen int gqa_type; /* Type of quota info is needed about */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen int gqa_id; /* Inquire about quota for id */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen};
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainenstruct ext_setquota_args {
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen int sqa_qcmd;
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen string sqa_pathp<RQ_PATHLEN>; /* path to filesystem of interest */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen int sqa_id; /* Set quota for id */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen int sqa_type; /* Type of quota to set */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen sq_dqblk sqa_dqblk;
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen};
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen/*
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen * remote quota structure
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainenstruct rquota {
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen int rq_bsize; /* block size for block counts */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen bool rq_active; /* indicates whether quota is active */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen unsigned int rq_bhardlimit; /* absolute limit on disk blks alloc */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen unsigned int rq_bsoftlimit; /* preferred limit on disk blks */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen unsigned int rq_curblocks; /* current block count */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen unsigned int rq_fhardlimit; /* absolute limit on allocated files */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen unsigned int rq_fsoftlimit; /* preferred file limit */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen unsigned int rq_curfiles; /* current # allocated files */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen unsigned int rq_btimeleft; /* time left for excessive disk use */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen unsigned int rq_ftimeleft; /* time left for excessive files */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen};
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainenenum qr_status {
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen Q_OK = 1, /* quota returned */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen Q_NOQUOTA = 2, /* noquota for uid */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen Q_EPERM = 3 /* no permission to access quota */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen};
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainenunion getquota_rslt switch (qr_status status) {
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainencase Q_OK:
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen rquota gqr_rquota; /* valid if status == Q_OK */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainencase Q_NOQUOTA:
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen void;
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainencase Q_EPERM:
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen void;
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen};
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainenunion setquota_rslt switch (qr_status status) {
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainencase Q_OK:
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen rquota sqr_rquota; /* valid if status == Q_OK */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainencase Q_NOQUOTA:
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen void;
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainencase Q_EPERM:
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen void;
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen};
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainenprogram RQUOTAPROG {
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen version RQUOTAVERS {
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen /*
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen * Get all quotas
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen getquota_rslt
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen RQUOTAPROC_GETQUOTA(getquota_args) = 1;
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen /*
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen * Get active quotas only
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen getquota_rslt
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen RQUOTAPROC_GETACTIVEQUOTA(getquota_args) = 2;
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen /*
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen * Set all quotas
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen setquota_rslt
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen RQUOTAPROC_SETQUOTA(setquota_args) = 3;
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen /*
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen * Get active quotas only
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen setquota_rslt
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen RQUOTAPROC_SETACTIVEQUOTA(setquota_args) = 4;
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen } = 1;
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen version EXT_RQUOTAVERS {
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen /*
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen * Get all quotas
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen getquota_rslt
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen RQUOTAPROC_GETQUOTA(ext_getquota_args) = 1;
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen /*
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen * Get active quotas only
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen getquota_rslt
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen RQUOTAPROC_GETACTIVEQUOTA(ext_getquota_args) = 2;
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen /*
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen * Set all quotas
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen setquota_rslt
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen RQUOTAPROC_SETQUOTA(ext_setquota_args) = 3;
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen /*
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen * Set active quotas only
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen */
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen setquota_rslt
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen RQUOTAPROC_SETACTIVEQUOTA(ext_setquota_args) = 4;
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen } = 2;
4c7caf83adc56d54e2ecec0a803f5ca9b6d0498dTimo Sirainen} = 100011;