pmap_prot.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. * pmap_prot.h
  3. * Protocol for the local binder service, or pmap.
  4. *
  5. * Copyright (c) 2010, Oracle America, Inc.
  6. *
  7. * Redistribution and use in source and binary forms, with or without
  8. * modification, are permitted provided that the following conditions are
  9. * met:
  10. *
  11. * * Redistributions of source code must retain the above copyright
  12. * notice, this list of conditions and the following disclaimer.
  13. * * Redistributions in binary form must reproduce the above
  14. * copyright notice, this list of conditions and the following
  15. * disclaimer in the documentation and/or other materials
  16. * provided with the distribution.
  17. * * Neither the name of the "Oracle America, Inc." nor the names of its
  18. * contributors may be used to endorse or promote products derived
  19. * from this software without specific prior written permission.
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  24. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  25. * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  26. * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  27. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  28. * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  29. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  30. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  31. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  32. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  33. */
  34. #ifndef _RPC_PMAP_PROT_H
  35. #define _RPC_PMAP_PROT_H 1
  36. #include <features.h>
  37. #include <rpc/xdr.h>
  38. __BEGIN_DECLS
  39. /* The following procedures are supported by the protocol:
  40. *
  41. * PMAPPROC_NULL() returns ()
  42. * takes nothing, returns nothing
  43. *
  44. * PMAPPROC_SET(struct pmap) returns (bool_t)
  45. * TRUE is success, FALSE is failure. Registers the tuple
  46. * [prog, vers, prot, port].
  47. *
  48. * PMAPPROC_UNSET(struct pmap) returns (bool_t)
  49. * TRUE is success, FALSE is failure. Un-registers pair
  50. * [prog, vers]. prot and port are ignored.
  51. *
  52. * PMAPPROC_GETPORT(struct pmap) returns (long unsigned).
  53. * 0 is failure. Otherwise returns the port number where the pair
  54. * [prog, vers] is registered. It may lie!
  55. *
  56. * PMAPPROC_DUMP() RETURNS (struct pmaplist *)
  57. *
  58. * PMAPPROC_CALLIT(unsigned, unsigned, unsigned, string<>)
  59. * RETURNS (port, string<>);
  60. * usage: encapsulatedresults = PMAPPROC_CALLIT(prog, vers, proc, encapsulatedargs);
  61. * Calls the procedure on the local machine. If it is not registered,
  62. * this procedure is quite; ie it does not return error information!!!
  63. * This procedure only is supported on rpc/udp and calls via
  64. * rpc/udp. This routine only passes null authentication parameters.
  65. * This file has no interface to xdr routines for PMAPPROC_CALLIT.
  66. *
  67. * The service supports remote procedure calls on udp/ip or tcp/ip socket 111.
  68. */
  69. #define PMAPPORT ((u_short)111)
  70. #define PMAPPROG ((u_long)100000)
  71. #define PMAPVERS ((u_long)2)
  72. #define PMAPVERS_PROTO ((u_long)2)
  73. #define PMAPVERS_ORIG ((u_long)1)
  74. #define PMAPPROC_NULL ((u_long)0)
  75. #define PMAPPROC_SET ((u_long)1)
  76. #define PMAPPROC_UNSET ((u_long)2)
  77. #define PMAPPROC_GETPORT ((u_long)3)
  78. #define PMAPPROC_DUMP ((u_long)4)
  79. #define PMAPPROC_CALLIT ((u_long)5)
  80. struct pmap {
  81. long unsigned pm_prog;
  82. long unsigned pm_vers;
  83. long unsigned pm_prot;
  84. long unsigned pm_port;
  85. };
  86. extern bool_t xdr_pmap (XDR *__xdrs, struct pmap *__regs) __THROW;
  87. struct pmaplist {
  88. struct pmap pml_map;
  89. struct pmaplist *pml_next;
  90. };
  91. extern bool_t xdr_pmaplist (XDR *__xdrs, struct pmaplist **__rp) __THROW;
  92. __END_DECLS
  93. #endif /* rpc/pmap_prot.h */