1/* $OpenBSD: rpc.h,v 1.11 2010/09/01 14:43:34 millert Exp $ */
2/* $NetBSD: rpc.h,v 1.5 1994/12/04 01:15:30 cgd Exp $ */
3
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 * from: @(#)rpc.h 1.9 88/02/08 SMI
35 * @(#)rpc.h 2.4 89/07/11 4.0 RPCSRC
36 */
37
38/*
39 * rpc.h, Just includes the billions of rpc header files necessary to
40 * do remote procedure calling.
41 */
42#ifndef _RPC_RPC_H
43#define _RPC_RPC_H
44
45#include <rpc/types.h> /* some typedefs */
46#include <netinet/in.h>
47
48/* external data representation interfaces */
49#include <rpc/xdr.h> /* generic (de)serializer */
50
51/* Client side only authentication */
52#include <rpc/auth.h> /* generic authenticator (client side) */
53
54/* Client side (mostly) remote procedure call */
55#include <rpc/clnt.h> /* generic rpc stuff */
56
57/* Client side (mostly) pmap functions */
58#include <rpc/pmap_clnt.h> /* generic pmap stuff */
59
60/* semi-private protocol headers */
61#include <rpc/rpc_msg.h> /* protocol for rpc messages */
62#include <rpc/auth_unix.h> /* protocol for unix style cred */
63/*
64 * Uncomment-out the next line if you are building the rpc library with
65 * DES Authentication (see the README file in the secure_rpc/ directory).
66 */
67#ifdef notdef
68#include <rpc/auth_des.h> /* protocol for des style cred */
69#endif
70
71/* Server side only remote procedure callee */
72#include <rpc/svc.h> /* service manager and multiplexer */
73#include <rpc/svc_auth.h> /* service side authenticator */
74
75/*
76 * COMMENT OUT THE NEXT INCLUDE (or add to the #ifndef) IF RUNNING ON
77 * A VERSION OF UNIX THAT USES SUN'S NFS SOURCE. These systems will
78 * already have the structures defined by <rpc/netdb.h> included in <netdb.h>.
79 */
80/* routines for parsing /etc/rpc */
81
82struct rpcent {
83 char *r_name; /* name of server for this rpc program */
84 char **r_aliases; /* alias list */
85 int r_number; /* rpc program number */
86};
87
88__BEGIN_DECLS
89extern struct rpcent *getrpcbyname(char *);
90extern struct rpcent *getrpcbynumber(int);
91extern struct rpcent *getrpcent(void);
92extern void setrpcent(int);
93extern void endrpcent(void);
94
95extern int get_myaddress(struct sockaddr_in *);
96extern int registerrpc(int, int, int, char *(*)(char [UDPMSGSIZE]),
97 xdrproc_t, xdrproc_t);
98extern int callrpc(char *, int, int, int, xdrproc_t, char *,
99 xdrproc_t , char *);
100extern int getrpcport(char *, int, int, int);
101
102extern bool_t xdr_opaque_auth(XDR *, struct opaque_auth *);
103
104extern int _rpc_dtablesize(void);
105
106__END_DECLS
107
108#endif /* !_RPC_RPC_H */