home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Headers / bsd / rpcsvc / mount.x < prev    next >
Text File  |  1990-01-29  |  3KB  |  135 lines

  1. /*    @(#)mount.x    1.2 88/05/08 4.0NFSSRC SMI    */
  2.  
  3. /* 
  4.  * Copyright (c) 1988 by Sun Microsystems, Inc.
  5.  * @(#) from SUN 1.4
  6.  */
  7.  
  8. /*
  9.  * Protocol description for the mount program
  10.  */
  11.  
  12.  
  13. const MNTPATHLEN = 1024;    /* maximum bytes in a pathname argument */
  14. const MNTNAMLEN = 255;        /* maximum bytes in a name argument */
  15. const FHSIZE = 32;        /* size in bytes of a file handle */
  16.  
  17. /*
  18.  * The fhandle is the file handle that the server passes to the client.
  19.  * All file operations are done using the file handles to refer to a file
  20.  * or a directory. The file handle can contain whatever information the
  21.  * server needs to distinguish an individual file.
  22.  */
  23. typedef opaque fhandle[FHSIZE];    
  24.  
  25. /*
  26.  * If a status of zero is returned, the call completed successfully, and 
  27.  * a file handle for the directory follows. A non-zero status indicates
  28.  * some sort of error. The status corresponds with UNIX error numbers.
  29.  */
  30. union fhstatus switch (unsigned fhs_status) {
  31. case 0:
  32.     fhandle fhs_fhandle;
  33. default:
  34.     void;
  35. };
  36.  
  37. /*
  38.  * The type dirpath is the pathname of a directory
  39.  */
  40. typedef string dirpath<MNTPATHLEN>;
  41.  
  42. /*
  43.  * The type name is used for arbitrary names (hostnames, groupnames)
  44.  */
  45. typedef string name<MNTNAMLEN>;
  46.  
  47. /*
  48.  * A list of who has what mounted
  49.  */
  50. struct mountlist {
  51.     name ml_hostname;
  52.     dirpath ml_directory;
  53.     mountlist *ml_next;
  54. };
  55.  
  56. /*
  57.  * A list of netgroups
  58.  */
  59. typedef struct groupnode *groups;
  60. struct groupnode {
  61.     name gr_name;
  62.     groups gr_next;
  63. };
  64.  
  65. /*
  66.  * A list of what is exported and to whom
  67.  */
  68. typedef struct exportnode *exports;
  69. struct exportnode {
  70.     dirpath ex_dir;
  71.     groups ex_groups;
  72.     exports ex_next;
  73. };
  74.  
  75. program MOUNTPROG {
  76.     /*
  77.      * Version one of the mount protocol communicates with version two
  78.      * of the NFS protocol. The only connecting point is the fhandle 
  79.      * structure, which is the same for both protocols.
  80.      */
  81.     version MOUNTVERS {
  82.         /*
  83.          * Does no work. It is made available in all RPC services
  84.          * to allow server reponse testing and timing
  85.         @V        void
  86.         MOUNTPROC_NULL(void) = 0;
  87.  
  88.         /*    
  89.          * If fhs_status is 0, then fhs_fhandle contains the
  90.           * file handle for the directory. This file handle may
  91.          * be used in the NFS protocol. This procedure also adds
  92.          * a new entry to the mount list for this client mounting
  93.          * the directory.
  94.          * Unix authentication required.
  95.          */
  96.         fhstatus 
  97.         MOUNTPROC_MNT(dirpath) = 1;
  98.  
  99.         /*
  100.          * Returns the list of remotely mounted filesystems. The 
  101.          * mountlist contains one entry for each hostname and 
  102.          * directory pair.
  103.          */
  104.         mountlist
  105.         MOUNTPROC_DUMP(void) = 2;
  106.  
  107.         /*
  108.          * Removes the mount list entry for the directory
  109.          * Unix authentication required.
  110.          */
  111.         void
  112.         MOUNTPROC_UMNT(dirpath) = 3;
  113.  
  114.         /*
  115.          * Removes all of the mount list entries for this client
  116.          * Unix authentication required.
  117.          */
  118.         void
  119.         MOUNTPROC_UMNTALL(void) = 4;
  120.  
  121.         /*
  122.          * Returns a list of all the exported filesystems, and which
  123.          * machines are allowed to import it.
  124.          */
  125.         exports
  126.         MOUNTPROC_EXPORT(void)  = 5;
  127.     
  128.         /*
  129.          * Identical to MOUNTPROC_EXPORT above
  130.          */
  131.         exports
  132.         MOUNTPROC_EXPORTALL(void) = 6;
  133.     } = 1;
  134. } = 100005;
  135.