bootparam_prot.x 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /* @(#)bootparam_prot.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. * RPC for bootparms service.
  33. * There are two procedures:
  34. * WHOAMI takes a net address and returns a client name and also a
  35. * likely net address for routing
  36. * GETFILE takes a client name and file identifier and returns the
  37. * server name, server net address and pathname for the file.
  38. * file identifiers typically include root, swap, pub and dump
  39. */
  40. #ifdef RPC_HDR
  41. %#include <rpc/types.h>
  42. %#include <sys/time.h>
  43. %#include <sys/errno.h>
  44. %#include <nfs/nfs.h>
  45. #endif
  46. const MAX_MACHINE_NAME = 255;
  47. const MAX_PATH_LEN = 1024;
  48. const MAX_FILEID = 32;
  49. const IP_ADDR_TYPE = 1;
  50. typedef string bp_machine_name_t<MAX_MACHINE_NAME>;
  51. typedef string bp_path_t<MAX_PATH_LEN>;
  52. typedef string bp_fileid_t<MAX_FILEID>;
  53. struct ip_addr_t {
  54. char net;
  55. char host;
  56. char lh;
  57. char impno;
  58. };
  59. union bp_address switch (int address_type) {
  60. case IP_ADDR_TYPE:
  61. ip_addr_t ip_addr;
  62. };
  63. struct bp_whoami_arg {
  64. bp_address client_address;
  65. };
  66. struct bp_whoami_res {
  67. bp_machine_name_t client_name;
  68. bp_machine_name_t domain_name;
  69. bp_address router_address;
  70. };
  71. struct bp_getfile_arg {
  72. bp_machine_name_t client_name;
  73. bp_fileid_t file_id;
  74. };
  75. struct bp_getfile_res {
  76. bp_machine_name_t server_name;
  77. bp_address server_address;
  78. bp_path_t server_path;
  79. };
  80. program BOOTPARAMPROG {
  81. version BOOTPARAMVERS {
  82. bp_whoami_res BOOTPARAMPROC_WHOAMI(bp_whoami_arg) = 1;
  83. bp_getfile_res BOOTPARAMPROC_GETFILE(bp_getfile_arg) = 2;
  84. } = 1;
  85. } = 100026;