144928Smckusick /* 244928Smckusick * Copyright (c) 1990 Jan-Simon Pendry 344928Smckusick * Copyright (c) 1990 Imperial College of Science, Technology & Medicine 4*61801Sbostic * Copyright (c) 1990, 1993 5*61801Sbostic * The Regents of the University of California. All rights reserved. 644928Smckusick * 744928Smckusick * This code is derived from software contributed to Berkeley by 844928Smckusick * Jan-Simon Pendry at Imperial College, London. 944928Smckusick * 1044928Smckusick * %sccs.include.redist.c% 1144928Smckusick * 12*61801Sbostic * @(#)amq.x 8.1 (Berkeley) 06/06/93 1349685Spendry * 1452457Spendry * $Id: amq.x,v 5.2.2.1 1992/02/09 15:09:20 jsp beta $ 1549685Spendry * 1644928Smckusick */ 1744928Smckusick 1844928Smckusick /* 1944928Smckusick * Protocol description used by the amq program 2044928Smckusick */ 2144928Smckusick 2244928Smckusick const AMQ_STRLEN = 1024; /* Maximum length of a pathname */ 2344928Smckusick 2444928Smckusick /* 2544928Smckusick * The type dirpath is the pathname of a directory 2644928Smckusick */ 2744928Smckusick typedef string amq_string<AMQ_STRLEN>; 2844928Smckusick 2944928Smckusick /* 3044928Smckusick * The type time_type should correspond to the system time_t 3144928Smckusick */ 3244928Smckusick typedef long time_type; 3344928Smckusick 3444928Smckusick /* 3544928Smckusick * A tree of what is mounted 3644928Smckusick */ 3744928Smckusick struct amq_mount_tree { 3844928Smckusick amq_string mt_mountinfo; /* Mounted filesystem */ 3944928Smckusick amq_string mt_directory; /* Virtual mount */ 4044928Smckusick amq_string mt_mountpoint; /* Mount point */ 4144928Smckusick amq_string mt_type; /* Filesystem type */ 4244928Smckusick time_type mt_mounttime; /* Mount time */ 4344928Smckusick u_short mt_mountuid; /* Mounter */ 4444928Smckusick int mt_getattr; /* Count of getattrs */ 4544928Smckusick int mt_lookup; /* Count of lookups */ 4644928Smckusick int mt_readdir; /* Count of readdirs */ 4744928Smckusick int mt_readlink; /* Count of readlinks */ 4844928Smckusick int mt_statfs; /* Count of statfss */ 4944928Smckusick amq_mount_tree *mt_next; /* Sibling mount tree */ 5044928Smckusick amq_mount_tree *mt_child; /* Child mount tree */ 5144928Smckusick }; 5244928Smckusick typedef amq_mount_tree *amq_mount_tree_p; 5344928Smckusick 5444928Smckusick /* 5544928Smckusick * List of mounted filesystems 5644928Smckusick */ 5744928Smckusick struct amq_mount_info { 5844928Smckusick amq_string mi_type; /* Type of mount */ 5944928Smckusick amq_string mi_mountpt; /* Mount point */ 6044928Smckusick amq_string mi_mountinfo; /* Mount info */ 6144928Smckusick amq_string mi_fserver; /* Fileserver */ 6244928Smckusick int mi_error; /* Error code */ 6344928Smckusick int mi_refc; /* References */ 6444928Smckusick int mi_up; /* Filesystem available */ 6544928Smckusick }; 6644928Smckusick typedef amq_mount_info amq_mount_info_list<>; 6744928Smckusick 6844928Smckusick /* 6944928Smckusick * A list of mount trees 7044928Smckusick */ 7144928Smckusick typedef amq_mount_tree_p amq_mount_tree_list<>; 7244928Smckusick 7344928Smckusick /* 7444928Smckusick * System wide stats 7544928Smckusick */ 7644928Smckusick struct amq_mount_stats { 7744928Smckusick int as_drops; /* Dropped requests */ 7844928Smckusick int as_stale; /* Stale NFS handles */ 7944928Smckusick int as_mok; /* Succesful mounts */ 8044928Smckusick int as_merr; /* Failed mounts */ 8144928Smckusick int as_uerr; /* Failed unmounts */ 8244928Smckusick }; 8344928Smckusick 8444928Smckusick enum amq_opt { 8544928Smckusick AMOPT_DEBUG=0, 8644928Smckusick AMOPT_LOGFILE=1, 8744928Smckusick AMOPT_XLOG=2, 8844928Smckusick AMOPT_FLUSHMAPC=3 8944928Smckusick }; 9044928Smckusick 9144928Smckusick struct amq_setopt { 9244928Smckusick amq_opt as_opt; /* Option */ 9344928Smckusick amq_string as_str; /* String */ 9444928Smckusick }; 9544928Smckusick 9644928Smckusick program AMQ_PROGRAM { 9744928Smckusick version AMQ_VERSION { 9844928Smckusick /* 9944928Smckusick * Does no work. It is made available in all RPC services 10044928Smckusick * to allow server reponse testing and timing 10144928Smckusick */ 10244928Smckusick void 10344928Smckusick AMQPROC_NULL(void) = 0; 10444928Smckusick 10544928Smckusick /* 10644928Smckusick * Returned the mount tree descending from 10744928Smckusick * the given directory. The directory must 10844928Smckusick * be a top-level mount point of the automounter. 10944928Smckusick */ 11044928Smckusick amq_mount_tree_p 11144928Smckusick AMQPROC_MNTTREE(amq_string) = 1; 11244928Smckusick 11344928Smckusick /* 11444928Smckusick * Force a timeout unmount on the specified directory. 11544928Smckusick */ 11644928Smckusick void 11744928Smckusick AMQPROC_UMNT(amq_string) = 2; 11844928Smckusick 11944928Smckusick /* 12044928Smckusick * Obtain system wide statistics from the automounter 12144928Smckusick */ 12244928Smckusick amq_mount_stats 12344928Smckusick AMQPROC_STATS(void) = 3; 12444928Smckusick 12544928Smckusick /* 12644928Smckusick * Obtain full tree 12744928Smckusick */ 12844928Smckusick amq_mount_tree_list 12944928Smckusick AMQPROC_EXPORT(void) = 4; 13044928Smckusick 13144928Smckusick /* 13244928Smckusick * Control debug options. 13344928Smckusick * Return status: 13444928Smckusick * -1: debug not available 13544928Smckusick * 0: everything wonderful 13644928Smckusick * >0: number of options not recognised 13744928Smckusick */ 13844928Smckusick int 13944928Smckusick AMQPROC_SETOPT(amq_setopt) = 5; 14044928Smckusick 14144928Smckusick /* 14244928Smckusick * List of mounted filesystems 14344928Smckusick */ 14444928Smckusick amq_mount_info_list 14544928Smckusick AMQPROC_GETMNTFS(void) = 6; 14647532Spendry 14747532Spendry /* 14847532Spendry * Mount a filesystem 14947532Spendry */ 15047532Spendry int 15147532Spendry AMQPROC_MOUNT(amq_string) = 7; 15247532Spendry 15347532Spendry /* 15447532Spendry * Get version info 15547532Spendry */ 15647532Spendry amq_string 15747532Spendry AMQPROC_GETVERS(void) = 8; 15844928Smckusick } = 1; 15944928Smckusick } = 300019; /* Allocated by Sun, 89/8/29 */ 160