xref: /openbsd-src/include/rpc/rpc.h (revision cb7760d181b85988239aa31e102cfd38c6ab30ad)
1*cb7760d1Smillert /*	$OpenBSD: rpc.h,v 1.11 2010/09/01 14:43:34 millert Exp $	*/
2df930be7Sderaadt /*	$NetBSD: rpc.h,v 1.5 1994/12/04 01:15:30 cgd Exp $	*/
3df930be7Sderaadt 
4df930be7Sderaadt /*
5*cb7760d1Smillert  * Copyright (c) 2010, Oracle America, Inc.
6df930be7Sderaadt  *
7*cb7760d1Smillert  * Redistribution and use in source and binary forms, with or without
8*cb7760d1Smillert  * modification, are permitted provided that the following conditions are
9*cb7760d1Smillert  * met:
10df930be7Sderaadt  *
11*cb7760d1Smillert  *     * Redistributions of source code must retain the above copyright
12*cb7760d1Smillert  *       notice, this list of conditions and the following disclaimer.
13*cb7760d1Smillert  *     * Redistributions in binary form must reproduce the above
14*cb7760d1Smillert  *       copyright notice, this list of conditions and the following
15*cb7760d1Smillert  *       disclaimer in the documentation and/or other materials
16*cb7760d1Smillert  *       provided with the distribution.
17*cb7760d1Smillert  *     * Neither the name of the "Oracle America, Inc." nor the names of its
18*cb7760d1Smillert  *       contributors may be used to endorse or promote products derived
19*cb7760d1Smillert  *       from this software without specific prior written permission.
20df930be7Sderaadt  *
21*cb7760d1Smillert  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22*cb7760d1Smillert  *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23*cb7760d1Smillert  *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24*cb7760d1Smillert  *   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25*cb7760d1Smillert  *   COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
26*cb7760d1Smillert  *   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27*cb7760d1Smillert  *   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
28*cb7760d1Smillert  *   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29*cb7760d1Smillert  *   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
30*cb7760d1Smillert  *   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31*cb7760d1Smillert  *   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32*cb7760d1Smillert  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33df930be7Sderaadt  *
34df930be7Sderaadt  *	from: @(#)rpc.h 1.9 88/02/08 SMI
35df930be7Sderaadt  *	@(#)rpc.h	2.4 89/07/11 4.0 RPCSRC
36df930be7Sderaadt  */
37df930be7Sderaadt 
38df930be7Sderaadt /*
39df930be7Sderaadt  * rpc.h, Just includes the billions of rpc header files necessary to
40df930be7Sderaadt  * do remote procedure calling.
41df930be7Sderaadt  */
42df930be7Sderaadt #ifndef _RPC_RPC_H
43df930be7Sderaadt #define _RPC_RPC_H
44df930be7Sderaadt 
45df930be7Sderaadt #include <rpc/types.h>		/* some typedefs */
46df930be7Sderaadt #include <netinet/in.h>
47df930be7Sderaadt 
48df930be7Sderaadt /* external data representation interfaces */
49df930be7Sderaadt #include <rpc/xdr.h>		/* generic (de)serializer */
50df930be7Sderaadt 
51df930be7Sderaadt /* Client side only authentication */
52df930be7Sderaadt #include <rpc/auth.h>		/* generic authenticator (client side) */
53df930be7Sderaadt 
54df930be7Sderaadt /* Client side (mostly) remote procedure call */
55df930be7Sderaadt #include <rpc/clnt.h>		/* generic rpc stuff */
56df930be7Sderaadt 
57cc31112fSmillert /* Client side (mostly) pmap functions */
58cc31112fSmillert #include <rpc/pmap_clnt.h>	/* generic pmap stuff */
59cc31112fSmillert 
60df930be7Sderaadt /* semi-private protocol headers */
61df930be7Sderaadt #include <rpc/rpc_msg.h>	/* protocol for rpc messages */
62df930be7Sderaadt #include <rpc/auth_unix.h>	/* protocol for unix style cred */
63df930be7Sderaadt /*
64df930be7Sderaadt  *  Uncomment-out the next line if you are building the rpc library with
65df930be7Sderaadt  *  DES Authentication (see the README file in the secure_rpc/ directory).
66df930be7Sderaadt  */
67df930be7Sderaadt #ifdef notdef
68df930be7Sderaadt #include <rpc/auth_des.h>	/* protocol for des style cred */
69df930be7Sderaadt #endif
70df930be7Sderaadt 
71df930be7Sderaadt /* Server side only remote procedure callee */
72df930be7Sderaadt #include <rpc/svc.h>		/* service manager and multiplexer */
73df930be7Sderaadt #include <rpc/svc_auth.h>	/* service side authenticator */
74df930be7Sderaadt 
75df930be7Sderaadt /*
76df930be7Sderaadt  * COMMENT OUT THE NEXT INCLUDE (or add to the #ifndef) IF RUNNING ON
77df930be7Sderaadt  * A VERSION OF UNIX THAT USES SUN'S NFS SOURCE.  These systems will
78df930be7Sderaadt  * already have the structures defined by <rpc/netdb.h> included in <netdb.h>.
79df930be7Sderaadt  */
80df930be7Sderaadt /* routines for parsing /etc/rpc */
81df930be7Sderaadt 
82df930be7Sderaadt struct rpcent {
83df930be7Sderaadt       char    *r_name;        /* name of server for this rpc program */
84df930be7Sderaadt       char    **r_aliases;    /* alias list */
85df930be7Sderaadt       int     r_number;       /* rpc program number */
86df930be7Sderaadt };
87df930be7Sderaadt 
88df930be7Sderaadt __BEGIN_DECLS
89c72b5b24Smillert extern struct rpcent *getrpcbyname(char *);
90c72b5b24Smillert extern struct rpcent *getrpcbynumber(int);
91c72b5b24Smillert extern struct rpcent *getrpcent(void);
92c72b5b24Smillert extern void setrpcent(int);
93c72b5b24Smillert extern void endrpcent(void);
94ea166fb7Sderaadt 
95c72b5b24Smillert extern int get_myaddress(struct sockaddr_in *);
96f3c3a9c6Smillert extern int registerrpc(int, int, int, char *(*)(char [UDPMSGSIZE]),
97f3c3a9c6Smillert 	xdrproc_t, xdrproc_t);
98f3c3a9c6Smillert extern int callrpc(char *, int, int, int, xdrproc_t, char *,
99f3c3a9c6Smillert 	xdrproc_t , char *);
100c72b5b24Smillert extern int getrpcport(char *, int, int, int);
101ea166fb7Sderaadt 
102c72b5b24Smillert extern bool_t xdr_opaque_auth(XDR *, struct opaque_auth *);
10346d44c1dSderaadt 
104c72b5b24Smillert extern int _rpc_dtablesize(void);
10546d44c1dSderaadt 
106df930be7Sderaadt __END_DECLS
107df930be7Sderaadt 
108df930be7Sderaadt #endif /* !_RPC_RPC_H */
109