Source code pulled from OpenBSD for OpenNTPD. The place to contribute to this code is via the OpenBSD CVS tree.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 lines
4.0 KiB

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