mount.x 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. /* @(#)mount.x 2.1 88/08/01 4.0 RPCSRC */
  2. /*
  3. * Copyright (c) 2010, Oracle America, Inc.
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions are
  6. * met:
  7. *
  8. * * Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. * * Redistributions in binary form must reproduce the above
  11. * copyright notice, this list of conditions and the following
  12. * disclaimer in the documentation and/or other materials
  13. * provided with the distribution.
  14. * * Neither the name of the "Oracle America, Inc." nor the names of its
  15. * contributors may be used to endorse or promote products derived
  16. * from this software without specific prior written permission.
  17. *
  18. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  19. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  20. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  21. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  22. * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  23. * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  24. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  25. * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  26. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  27. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  28. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  29. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  30. */
  31. /*
  32. * Protocol description for the mount program
  33. */
  34. const MNTPATHLEN = 1024; /* maximum bytes in a pathname argument */
  35. const MNTNAMLEN = 255; /* maximum bytes in a name argument */
  36. const FHSIZE = 32; /* size in bytes of a file handle */
  37. /*
  38. * The fhandle is the file handle that the server passes to the client.
  39. * All file operations are done using the file handles to refer to a file
  40. * or a directory. The file handle can contain whatever information the
  41. * server needs to distinguish an individual file.
  42. */
  43. typedef opaque fhandle[FHSIZE];
  44. /*
  45. * If a status of zero is returned, the call completed successfully, and
  46. * a file handle for the directory follows. A non-zero status indicates
  47. * some sort of error. The status corresponds with UNIX error numbers.
  48. */
  49. union fhstatus switch (unsigned fhs_status) {
  50. case 0:
  51. fhandle fhs_fhandle;
  52. default:
  53. void;
  54. };
  55. /*
  56. * The type dirpath is the pathname of a directory
  57. */
  58. typedef string dirpath<MNTPATHLEN>;
  59. /*
  60. * The type name is used for arbitrary names (hostnames, groupnames)
  61. */
  62. typedef string name<MNTNAMLEN>;
  63. /*
  64. * A list of who has what mounted
  65. */
  66. typedef struct mountbody *mountlist;
  67. struct mountbody {
  68. name ml_hostname;
  69. dirpath ml_directory;
  70. mountlist ml_next;
  71. };
  72. /*
  73. * A list of netgroups
  74. */
  75. typedef struct groupnode *groups;
  76. struct groupnode {
  77. name gr_name;
  78. groups gr_next;
  79. };
  80. /*
  81. * A list of what is exported and to whom
  82. */
  83. typedef struct exportnode *exports;
  84. struct exportnode {
  85. dirpath ex_dir;
  86. groups ex_groups;
  87. exports ex_next;
  88. };
  89. program MOUNTPROG {
  90. /*
  91. * Version one of the mount protocol communicates with version two
  92. * of the NFS protocol. The only connecting point is the fhandle
  93. * structure, which is the same for both protocols.
  94. */
  95. version MOUNTVERS {
  96. /*
  97. * Does no work. It is made available in all RPC services
  98. * to allow server response testing and timing
  99. */
  100. void
  101. MOUNTPROC_NULL(void) = 0;
  102. /*
  103. * If fhs_status is 0, then fhs_fhandle contains the
  104. * file handle for the directory. This file handle may
  105. * be used in the NFS protocol. This procedure also adds
  106. * a new entry to the mount list for this client mounting
  107. * the directory.
  108. * Unix authentication required.
  109. */
  110. fhstatus
  111. MOUNTPROC_MNT(dirpath) = 1;
  112. /*
  113. * Returns the list of remotely mounted filesystems. The
  114. * mountlist contains one entry for each hostname and
  115. * directory pair.
  116. */
  117. mountlist
  118. MOUNTPROC_DUMP(void) = 2;
  119. /*
  120. * Removes the mount list entry for the directory
  121. * Unix authentication required.
  122. */
  123. void
  124. MOUNTPROC_UMNT(dirpath) = 3;
  125. /*
  126. * Removes all of the mount list entries for this client
  127. * Unix authentication required.
  128. */
  129. void
  130. MOUNTPROC_UMNTALL(void) = 4;
  131. /*
  132. * Returns a list of all the exported filesystems, and which
  133. * machines are allowed to import it.
  134. */
  135. exports
  136. MOUNTPROC_EXPORT(void) = 5;
  137. /*
  138. * Identical to MOUNTPROC_EXPORT above
  139. */
  140. exports
  141. MOUNTPROC_EXPORTALL(void) = 6;
  142. } = 1;
  143. } = 100005;