Home | History | Annotate | Download | only in rpcsvc
      1 /*
      2  * CDDL HEADER START
      3  *
      4  * The contents of this file are subject to the terms of the
      5  * Common Development and Distribution License, Version 1.0 only
      6  * (the "License").  You may not use this file except in compliance
      7  * with the License.
      8  *
      9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
     10  * or http://www.opensolaris.org/os/licensing.
     11  * See the License for the specific language governing permissions
     12  * and limitations under the License.
     13  *
     14  * When distributing Covered Code, include this CDDL HEADER in each
     15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     16  * If applicable, add the following below this CDDL HEADER, with the
     17  * fields enclosed by brackets "[]" replaced with your own identifying
     18  * information: Portions Copyright [yyyy] [name of copyright owner]
     19  *
     20  * CDDL HEADER END
     21  *
     22  * Copyright 1987 Sun Microsystems, Inc.  All rights reserved.
     23  * Use is subject to license terms.
     24  */
     25 
     26 /* #ident	"%Z%%M%	%I%	%E% SMI" */
     27 
     28 /*
     29  * Remote quota protocol
     30  * Requires unix authentication
     31  */
     32 
     33 const RQ_PATHLEN = 1024;
     34 
     35 struct getquota_args {
     36 	string gqa_pathp<RQ_PATHLEN>;  	/* path to filesystem of interest */
     37 	int32_t gqa_uid;        	/* inquire about quota for uid */
     38 };
     39 
     40 /*
     41  * remote quota structure
     42  */
     43 struct rquota {
     44 	int32_t rq_bsize;		/* block size for block counts */
     45 	bool rq_active;  		/* indicates whether quota is active */
     46 	uint32_t rq_bhardlimit;		/* absolute limit on disk blks alloc */
     47 	uint32_t rq_bsoftlimit;		/* preferred limit on disk blks */
     48 	uint32_t rq_curblocks;		/* current block count */
     49 	uint32_t rq_fhardlimit;		/* absolute limit on allocated files */
     50 	uint32_t rq_fsoftlimit;		/* preferred file limit */
     51 	uint32_t rq_curfiles;		/* current # allocated files */
     52 	uint32_t rq_btimeleft;		/* time left for excessive disk use */
     53 	uint32_t rq_ftimeleft;		/* time left for excessive files */
     54 };
     55 
     56 enum gqr_status {
     57 	Q_OK = 1,		/* quota returned */
     58 	Q_NOQUOTA = 2,  	/* noquota for uid */
     59 	Q_EPERM = 3		/* no permission to access quota */
     60 };
     61 
     62 union getquota_rslt switch (gqr_status status) {
     63 case Q_OK:
     64 	rquota gqr_rquota;	/* valid if status == Q_OK */
     65 case Q_NOQUOTA:
     66 	void;
     67 case Q_EPERM:
     68 	void;
     69 };
     70 
     71 program RQUOTAPROG {
     72 	version RQUOTAVERS {
     73 		/*
     74 		 * Get all quotas
     75 		 */
     76 		getquota_rslt
     77 		RQUOTAPROC_GETQUOTA(getquota_args) = 1;
     78 
     79 		/*
     80 	 	 * Get active quotas only
     81 		 */
     82 		getquota_rslt
     83 		RQUOTAPROC_GETACTIVEQUOTA(getquota_args) = 2;
     84 	} = 1;
     85 } = 100011;
     86