pmap_prot.h 3.8 KB

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