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