138494Sobrien/* 2174294Sobrien * Copyright (c) 1997-2006 Erez Zadok 338494Sobrien * Copyright (c) 1990 Jan-Simon Pendry 438494Sobrien * Copyright (c) 1990 Imperial College of Science, Technology & Medicine 538494Sobrien * Copyright (c) 1990 The Regents of the University of California. 638494Sobrien * All rights reserved. 738494Sobrien * 838494Sobrien * This code is derived from software contributed to Berkeley by 938494Sobrien * Jan-Simon Pendry at Imperial College, London. 1038494Sobrien * 1138494Sobrien * Redistribution and use in source and binary forms, with or without 1238494Sobrien * modification, are permitted provided that the following conditions 1338494Sobrien * are met: 1438494Sobrien * 1. Redistributions of source code must retain the above copyright 1538494Sobrien * notice, this list of conditions and the following disclaimer. 1638494Sobrien * 2. Redistributions in binary form must reproduce the above copyright 1738494Sobrien * notice, this list of conditions and the following disclaimer in the 1838494Sobrien * documentation and/or other materials provided with the distribution. 1938494Sobrien * 3. All advertising materials mentioning features or use of this software 2042629Sobrien * must display the following acknowledgment: 2138494Sobrien * This product includes software developed by the University of 2238494Sobrien * California, Berkeley and its contributors. 2338494Sobrien * 4. Neither the name of the University nor the names of its contributors 2438494Sobrien * may be used to endorse or promote products derived from this software 2538494Sobrien * without specific prior written permission. 2638494Sobrien * 2738494Sobrien * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2838494Sobrien * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2938494Sobrien * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 3038494Sobrien * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 3138494Sobrien * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 3238494Sobrien * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 3338494Sobrien * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 3438494Sobrien * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 3538494Sobrien * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3638494Sobrien * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3738494Sobrien * SUCH DAMAGE. 3838494Sobrien * 3938494Sobrien * 40174294Sobrien * File: am-utils/include/amq_defs.h 4138494Sobrien * 4238494Sobrien */ 4338494Sobrien 4438494Sobrien#ifndef _AMQ_DEFS_H 4538494Sobrien#define _AMQ_DEFS_H 4638494Sobrien 4738494Sobrien/* 4838494Sobrien * MACROS 4938494Sobrien */ 5038494Sobrien#ifndef AMQ_SIZE 5138494Sobrien# define AMQ_SIZE 16384 5238494Sobrien#endif /* not AMQ_SIZE */ 53174294Sobrien#define AMQ_STRLEN 16384 5438494Sobrien#define AMQ_PROGRAM ((u_long)300019) 5538494Sobrien#define AMQ_VERSION ((u_long)1) 5638494Sobrien#define AMQPROC_NULL ((u_long)0) 5738494Sobrien#define AMQPROC_MNTTREE ((u_long)1) 5838494Sobrien#define AMQPROC_UMNT ((u_long)2) 5938494Sobrien#define AMQPROC_STATS ((u_long)3) 6038494Sobrien#define AMQPROC_EXPORT ((u_long)4) 6138494Sobrien#define AMQPROC_SETOPT ((u_long)5) 6238494Sobrien#define AMQPROC_GETMNTFS ((u_long)6) 6338494Sobrien#define AMQPROC_MOUNT ((u_long)7) 6438494Sobrien#define AMQPROC_GETVERS ((u_long)8) 6538494Sobrien#define AMQPROC_GETPID ((u_long)9) 66174294Sobrien#define AMQPROC_PAWD ((u_long)10) 6738494Sobrien 6838494Sobrien/* 6938494Sobrien * TYPEDEFS 7038494Sobrien */ 7138494Sobrientypedef long *time_type; 7238494Sobrientypedef struct amq_mount_info amq_mount_info; 7338494Sobrientypedef struct amq_mount_stats amq_mount_stats; 7438494Sobrientypedef struct amq_mount_tree amq_mount_tree; 7538494Sobrientypedef struct amq_setopt amq_setopt; 7638494Sobrientypedef amq_mount_tree *amq_mount_tree_p; 7738494Sobrien 7838494Sobrien/* 7938494Sobrien * STRUCTURES: 8038494Sobrien */ 8138494Sobrienstruct amq_mount_tree { 8238494Sobrien amq_string mt_mountinfo; 8338494Sobrien amq_string mt_directory; 8438494Sobrien amq_string mt_mountpoint; 8538494Sobrien amq_string mt_type; 8638494Sobrien time_type mt_mounttime; 8738494Sobrien u_short mt_mountuid; 8838494Sobrien int mt_getattr; 8938494Sobrien int mt_lookup; 9038494Sobrien int mt_readdir; 9138494Sobrien int mt_readlink; 9238494Sobrien int mt_statfs; 9338494Sobrien struct amq_mount_tree *mt_next; 9438494Sobrien struct amq_mount_tree *mt_child; 9538494Sobrien}; 9638494Sobrien 9738494Sobrienstruct amq_mount_info { 9838494Sobrien amq_string mi_type; 9938494Sobrien amq_string mi_mountpt; 10038494Sobrien amq_string mi_mountinfo; 10138494Sobrien amq_string mi_fserver; 10238494Sobrien int mi_error; 10338494Sobrien int mi_refc; 10438494Sobrien int mi_up; 10538494Sobrien}; 10638494Sobrien 10738494Sobrientypedef struct { 10838494Sobrien u_int amq_mount_info_list_len; 10938494Sobrien amq_mount_info *amq_mount_info_list_val; 11038494Sobrien} amq_mount_info_list; 11138494Sobrien 11238494Sobrientypedef struct { 11338494Sobrien u_int amq_mount_tree_list_len; 11438494Sobrien amq_mount_tree_p *amq_mount_tree_list_val; 11538494Sobrien} amq_mount_tree_list; 11638494Sobrien 11738494Sobrienstruct amq_mount_stats { 11838494Sobrien int as_drops; 11938494Sobrien int as_stale; 12038494Sobrien int as_mok; 12138494Sobrien int as_merr; 12238494Sobrien int as_uerr; 12338494Sobrien}; 12438494Sobrien 12538494Sobrienenum amq_opt { 12638494Sobrien AMOPT_DEBUG = 0, 12738494Sobrien AMOPT_LOGFILE = 1, 12838494Sobrien AMOPT_XLOG = 2, 12938494Sobrien AMOPT_FLUSHMAPC = 3 13038494Sobrien}; 13138494Sobrientypedef enum amq_opt amq_opt; /* enum typedefs should be after enum */ 13238494Sobrien 13338494Sobrienstruct amq_setopt { 13438494Sobrien amq_opt as_opt; 13538494Sobrien amq_string as_str; 13638494Sobrien}; 13738494Sobrien 13838494Sobrien/* 13938494Sobrien * EXTERNALS: 14038494Sobrien * 14138494Sobrien * external definitions for amqproc_*_1() have been moved off to private 14238494Sobrien * headers in lib/amu.h, amd/amd.h, etc. They have to be private since the 14338494Sobrien * same named functions appear in different places with different prototypes 14438494Sobrien * an functionality. 14538494Sobrien */ 14638494Sobrienextern bool_t xdr_amq_mount_info(XDR *xdrs, amq_mount_info *objp); 14738494Sobrienextern bool_t xdr_amq_mount_info_list(XDR *xdrs, amq_mount_info_list *objp); 14838494Sobrienextern bool_t xdr_amq_mount_stats(XDR *xdrs, amq_mount_stats *objp); 14938494Sobrienextern bool_t xdr_amq_mount_tree(XDR *xdrs, amq_mount_tree *objp); 15038494Sobrienextern bool_t xdr_amq_mount_tree_list(XDR *xdrs, amq_mount_tree_list *objp); 15138494Sobrienextern bool_t xdr_amq_mount_tree_p(XDR *xdrs, amq_mount_tree_p *objp); 15238494Sobrienextern bool_t xdr_amq_opt(XDR *xdrs, amq_opt *objp); 15338494Sobrienextern bool_t xdr_amq_setopt(XDR *xdrs, amq_setopt *objp); 15438494Sobrienextern bool_t xdr_pri_free(XDRPROC_T_TYPE xdr_args, caddr_t args_ptr); 15538494Sobrienextern bool_t xdr_time_type(XDR *xdrs, time_type *objp); 15638494Sobrien 15738494Sobrien#endif /* not _AMQ_DEFS_H */ 158