rpc.h 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * rpc.h, Just includes the billions of rpc header files necessary to
  3. * do remote procedure calling.
  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_RPC_H
  35. #define _RPC_RPC_H 1
  36. #include <rpc/types.h> /* some typedefs */
  37. #include <netinet/in.h>
  38. /* external data representation interfaces */
  39. #include <rpc/xdr.h> /* generic (de)serializer */
  40. /* Client side only authentication */
  41. #include <rpc/auth.h> /* generic authenticator (client side) */
  42. /* Client side (mostly) remote procedure call */
  43. #include <rpc/clnt.h> /* generic rpc stuff */
  44. /* semi-private protocol headers */
  45. #include <rpc/rpc_msg.h> /* protocol for rpc messages */
  46. #include <rpc/auth_unix.h> /* protocol for unix style cred */
  47. #include <rpc/auth_des.h> /* protocol for des style cred */
  48. /* Server side only remote procedure callee */
  49. #include <rpc/svc.h> /* service manager and multiplexer */
  50. #include <rpc/svc_auth.h> /* service side authenticator */
  51. /*
  52. * COMMENT OUT THE NEXT INCLUDE IF RUNNING ON SUN OS OR ON A VERSION
  53. * OF UNIX BASED ON NFSSRC. These systems will already have the structures
  54. * defined by <rpc/netdb.h> included in <netdb.h>.
  55. */
  56. /* routines for parsing /etc/rpc */
  57. #include <rpc/netdb.h> /* structures and routines to parse /etc/rpc */
  58. __BEGIN_DECLS
  59. /* Global variables, protected for multi-threaded applications. */
  60. extern fd_set *__rpc_thread_svc_fdset (void) __attribute__ ((__const__));
  61. #define svc_fdset (*__rpc_thread_svc_fdset ())
  62. extern struct rpc_createerr *__rpc_thread_createerr (void)
  63. __attribute__ ((__const__));
  64. #define get_rpc_createerr() (*__rpc_thread_createerr ())
  65. /* The people who "engineered" RPC should bee punished for naming the
  66. data structure and the variable the same. We cannot always define the
  67. macro 'rpc_createerr' because this would prevent people from defining
  68. object of type 'struct rpc_createerr'. So we leave it up to the user
  69. to select transparent replacement also of this variable. */
  70. #ifdef _RPC_MT_VARS
  71. # define rpc_createerr (*__rpc_thread_createerr ())
  72. #endif
  73. extern struct pollfd **__rpc_thread_svc_pollfd (void)
  74. __attribute__ ((__const__));
  75. #define svc_pollfd (*__rpc_thread_svc_pollfd ())
  76. extern int *__rpc_thread_svc_max_pollfd (void) __attribute__ ((__const__));
  77. #define svc_max_pollfd (*__rpc_thread_svc_max_pollfd ())
  78. __END_DECLS
  79. #endif /* rpc/rpc.h */