home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / usr.sbin / amd / rpcx / amq.x < prev    next >
Encoding:
Text File  |  1991-05-12  |  5.1 KB  |  186 lines

  1. /*
  2.  * Copyright (c) 1990 Jan-Simon Pendry
  3.  * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
  4.  * Copyright (c) 1990 The Regents of the University of California.
  5.  * All rights reserved.
  6.  *
  7.  * This code is derived from software contributed to Berkeley by
  8.  * Jan-Simon Pendry at Imperial College, London.
  9.  *
  10.  * Redistribution and use in source and binary forms, with or without
  11.  * modification, are permitted provided that the following conditions
  12.  * are met:
  13.  * 1. Redistributions of source code must retain the above copyright
  14.  *    notice, this list of conditions and the following disclaimer.
  15.  * 2. Redistributions in binary form must reproduce the above copyright
  16.  *    notice, this list of conditions and the following disclaimer in the
  17.  *    documentation and/or other materials provided with the distribution.
  18.  * 3. All advertising materials mentioning features or use of this software
  19.  *    must display the following acknowledgement:
  20.  *    This product includes software developed by the University of
  21.  *    California, Berkeley and its contributors.
  22.  * 4. Neither the name of the University nor the names of its contributors
  23.  *    may be used to endorse or promote products derived from this software
  24.  *    without specific prior written permission.
  25.  *
  26.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  27.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  28.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  29.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  30.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  31.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  32.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  33.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  34.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  35.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  36.  * SUCH DAMAGE.
  37.  *
  38.  *    @(#)amq.x    5.3 (Berkeley) 5/12/91
  39.  *
  40.  * $Id: amq.x,v 5.2.1.3 91/05/07 22:18:48 jsp Alpha $
  41.  *
  42.  */
  43.  
  44. /*
  45.  * Protocol description used by the amq program
  46.  */
  47.  
  48. const AMQ_STRLEN = 1024;    /* Maximum length of a pathname */
  49.  
  50. /*
  51.  * The type dirpath is the pathname of a directory
  52.  */
  53. typedef string amq_string<AMQ_STRLEN>;
  54.  
  55. /*
  56.  * The type time_type should correspond to the system time_t
  57.  */
  58. typedef long time_type;
  59.  
  60. /*
  61.  * A tree of what is mounted
  62.  */
  63. struct amq_mount_tree {
  64.     amq_string    mt_mountinfo;    /* Mounted filesystem */
  65.     amq_string     mt_directory;    /* Virtual mount */
  66.     amq_string     mt_mountpoint;    /* Mount point */
  67.     amq_string    mt_type;    /* Filesystem type */
  68.     time_type    mt_mounttime;    /* Mount time */
  69.     u_short        mt_mountuid;    /* Mounter */
  70.     int        mt_getattr;    /* Count of getattrs */
  71.     int        mt_lookup;    /* Count of lookups */
  72.     int        mt_readdir;    /* Count of readdirs */
  73.     int        mt_readlink;    /* Count of readlinks */
  74.     int        mt_statfs;    /* Count of statfss */
  75.     amq_mount_tree    *mt_next;    /* Sibling mount tree */
  76.     amq_mount_tree    *mt_child;    /* Child mount tree */
  77. };
  78. typedef amq_mount_tree *amq_mount_tree_p;
  79.  
  80. /*
  81.  * List of mounted filesystems
  82.  */
  83. struct amq_mount_info {
  84.     amq_string    mi_type;    /* Type of mount */
  85.     amq_string    mi_mountpt;    /* Mount point */
  86.     amq_string    mi_mountinfo;    /* Mount info */
  87.     amq_string    mi_fserver;    /* Fileserver */
  88.     int        mi_error;    /* Error code */
  89.     int        mi_refc;    /* References */
  90.     int        mi_up;        /* Filesystem available */
  91. };
  92. typedef amq_mount_info amq_mount_info_list<>;
  93.  
  94. /*
  95.  * A list of mount trees
  96.  */
  97. typedef amq_mount_tree_p amq_mount_tree_list<>;
  98.  
  99. /*
  100.  * System wide stats
  101.  */
  102. struct amq_mount_stats {
  103.     int    as_drops;    /* Dropped requests */
  104.     int    as_stale;    /* Stale NFS handles */
  105.     int    as_mok;        /* Succesful mounts */
  106.     int    as_merr;    /* Failed mounts */
  107.     int    as_uerr;    /* Failed unmounts */
  108. };
  109.  
  110. enum amq_opt {
  111.     AMOPT_DEBUG=0,
  112.     AMOPT_LOGFILE=1,
  113.     AMOPT_XLOG=2,
  114.     AMOPT_FLUSHMAPC=3
  115. };
  116.  
  117. struct amq_setopt {
  118.     amq_opt    as_opt;        /* Option */
  119.     amq_string as_str;    /* String */
  120. };
  121.  
  122. program AMQ_PROGRAM {
  123.     version AMQ_VERSION {
  124.         /*
  125.          * Does no work. It is made available in all RPC services
  126.          * to allow server reponse testing and timing
  127.          */
  128.         void
  129.         AMQPROC_NULL(void) = 0;
  130.  
  131.         /*
  132.          * Returned the mount tree descending from
  133.          * the given directory.  The directory must
  134.          * be a top-level mount point of the automounter.
  135.          */
  136.         amq_mount_tree_p
  137.         AMQPROC_MNTTREE(amq_string) = 1;
  138.  
  139.         /*
  140.          * Force a timeout unmount on the specified directory.
  141.          */
  142.         void
  143.         AMQPROC_UMNT(amq_string) = 2;
  144.  
  145.         /*
  146.          * Obtain system wide statistics from the automounter
  147.          */
  148.         amq_mount_stats
  149.         AMQPROC_STATS(void) = 3;
  150.  
  151.         /*
  152.          * Obtain full tree
  153.          */
  154.         amq_mount_tree_list
  155.         AMQPROC_EXPORT(void) = 4;
  156.  
  157.         /*
  158.          * Control debug options.
  159.          * Return status:
  160.          *    -1: debug not available
  161.          *     0: everything wonderful
  162.          *    >0: number of options not recognised
  163.          */
  164.         int
  165.         AMQPROC_SETOPT(amq_setopt) = 5;
  166.  
  167.         /*
  168.          * List of mounted filesystems
  169.          */
  170.         amq_mount_info_list
  171.         AMQPROC_GETMNTFS(void) = 6;
  172.  
  173.         /*
  174.          * Mount a filesystem
  175.          */
  176.         int
  177.         AMQPROC_MOUNT(amq_string) = 7;
  178.  
  179.         /*
  180.          * Get version info
  181.          */
  182.         amq_string
  183.         AMQPROC_GETVERS(void) = 8;
  184.     } = 1;
  185. } = 300019;    /* Allocated by Sun, 89/8/29 */
  186.