pmap_clnt.h 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /* @(#)pmap_clnt.h 2.1 88/07/29 4.0 RPCSRC; from 1.11 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_clnt.h
  36. * Supplies C routines to get to portmap services.
  37. */
  38. #ifndef GSSRPC_PMAP_CLNT_H
  39. #define GSSRPC_PMAP_CLNT_H
  40. /*
  41. * Usage:
  42. * success = pmap_set(program, version, protocol, port);
  43. * success = pmap_unset(program, version);
  44. * port = pmap_getport(address, program, version, protocol);
  45. * head = pmap_getmaps(address);
  46. * clnt_stat = pmap_rmtcall(address, program, version, procedure,
  47. * xdrargs, argsp, xdrres, resp, tout, port_ptr)
  48. * (works for udp only.)
  49. * clnt_stat = clnt_broadcast(program, version, procedure,
  50. * xdrargs, argsp, xdrres, resp, eachresult)
  51. * (like pmap_rmtcall, except the call is broadcasted to all
  52. * locally connected nets. For each valid response received,
  53. * the procedure eachresult is called. Its form is:
  54. * done = eachresult(resp, raddr)
  55. * bool_t done;
  56. * caddr_t resp;
  57. * struct sockaddr_in raddr;
  58. * where resp points to the results of the call and raddr is the
  59. * address if the responder to the broadcast.
  60. */
  61. GSSRPC__BEGIN_DECLS
  62. extern bool_t pmap_set(rpcprog_t, rpcvers_t, rpcprot_t, u_int);
  63. extern bool_t pmap_unset(rpcprog_t, rpcvers_t);
  64. extern struct pmaplist *pmap_getmaps(struct sockaddr_in *);
  65. enum clnt_stat pmap_rmtcall(struct sockaddr_in *, rpcprog_t,
  66. rpcvers_t, rpcproc_t, xdrproc_t,
  67. caddr_t, xdrproc_t, caddr_t,
  68. struct timeval, rpcport_t *);
  69. typedef bool_t (*resultproc_t)(caddr_t, struct sockaddr_in *);
  70. enum clnt_stat clnt_broadcast(rpcprog_t, rpcvers_t, rpcproc_t,
  71. xdrproc_t, caddr_t, xdrproc_t,
  72. caddr_t, resultproc_t);
  73. extern u_short pmap_getport(struct sockaddr_in *,
  74. rpcprog_t,
  75. rpcvers_t, rpcprot_t);
  76. GSSRPC__END_DECLS
  77. #endif /* !defined(GSSRPC_PMAP_CLNT_H) */