xref: /freebsd/include/rpc/rpc.h (revision 5a1d14419a5b620430949a46cb6ee63148a43cb9)
18360efbdSAlfred Perlstein /*	$NetBSD: rpc.h,v 1.13 2000/06/02 22:57:56 fvdl Exp $	*/
28360efbdSAlfred Perlstein 
32e322d37SHiroki Sato /*-
4*2321c474SPedro F. Giffuni  * SPDX-License-Identifier: BSD-3-Clause
5*2321c474SPedro F. Giffuni  *
62e322d37SHiroki Sato  * Copyright (c) 2009, Sun Microsystems, Inc.
72e322d37SHiroki Sato  * All rights reserved.
8dba7a33eSGarrett Wollman  *
92e322d37SHiroki Sato  * Redistribution and use in source and binary forms, with or without
102e322d37SHiroki Sato  * modification, are permitted provided that the following conditions are met:
112e322d37SHiroki Sato  * - Redistributions of source code must retain the above copyright notice,
122e322d37SHiroki Sato  *   this list of conditions and the following disclaimer.
132e322d37SHiroki Sato  * - Redistributions in binary form must reproduce the above copyright notice,
142e322d37SHiroki Sato  *   this list of conditions and the following disclaimer in the documentation
152e322d37SHiroki Sato  *   and/or other materials provided with the distribution.
162e322d37SHiroki Sato  * - Neither the name of Sun Microsystems, Inc. nor the names of its
172e322d37SHiroki Sato  *   contributors may be used to endorse or promote products derived
182e322d37SHiroki Sato  *   from this software without specific prior written permission.
19dba7a33eSGarrett Wollman  *
202e322d37SHiroki Sato  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
212e322d37SHiroki Sato  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
222e322d37SHiroki Sato  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
232e322d37SHiroki Sato  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
242e322d37SHiroki Sato  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
252e322d37SHiroki Sato  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
262e322d37SHiroki Sato  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
272e322d37SHiroki Sato  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
282e322d37SHiroki Sato  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
292e322d37SHiroki Sato  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
302e322d37SHiroki Sato  * POSSIBILITY OF SUCH DAMAGE.
31dba7a33eSGarrett Wollman  */
32dba7a33eSGarrett Wollman 
33dba7a33eSGarrett Wollman /*
34dba7a33eSGarrett Wollman  * rpc.h, Just includes the billions of rpc header files necessary to
35dba7a33eSGarrett Wollman  * do remote procedure calling.
36dba7a33eSGarrett Wollman  *
37dba7a33eSGarrett Wollman  * Copyright (C) 1984, Sun Microsystems, Inc.
38dba7a33eSGarrett Wollman  */
3986b9a9ccSGarrett Wollman #ifndef _RPC_RPC_H
4086b9a9ccSGarrett Wollman #define _RPC_RPC_H
41dba7a33eSGarrett Wollman 
42dba7a33eSGarrett Wollman #include <rpc/types.h>		/* some typedefs */
438360efbdSAlfred Perlstein #include <sys/socket.h>
44dba7a33eSGarrett Wollman #include <netinet/in.h>
45dba7a33eSGarrett Wollman 
46dba7a33eSGarrett Wollman /* external data representation interfaces */
47dba7a33eSGarrett Wollman #include <rpc/xdr.h>		/* generic (de)serializer */
48dba7a33eSGarrett Wollman 
49dba7a33eSGarrett Wollman /* Client side only authentication */
50dba7a33eSGarrett Wollman #include <rpc/auth.h>		/* generic authenticator (client side) */
51dba7a33eSGarrett Wollman 
52dba7a33eSGarrett Wollman /* Client side (mostly) remote procedure call */
53dba7a33eSGarrett Wollman #include <rpc/clnt.h>		/* generic rpc stuff */
54dba7a33eSGarrett Wollman 
55dba7a33eSGarrett Wollman /* semi-private protocol headers */
56dba7a33eSGarrett Wollman #include <rpc/rpc_msg.h>	/* protocol for rpc messages */
57dba7a33eSGarrett Wollman #include <rpc/auth_unix.h>	/* protocol for unix style cred */
58dba7a33eSGarrett Wollman /*
59dba7a33eSGarrett Wollman  *  Uncomment-out the next line if you are building the rpc library with
60dba7a33eSGarrett Wollman  *  DES Authentication (see the README file in the secure_rpc/ directory).
61dba7a33eSGarrett Wollman  */
62e4f13e77SPoul-Henning Kamp #include <rpc/auth_des.h>	/* protocol for des style cred */
63dba7a33eSGarrett Wollman 
64dba7a33eSGarrett Wollman /* Server side only remote procedure callee */
65dba7a33eSGarrett Wollman #include <rpc/svc.h>		/* service manager and multiplexer */
66dba7a33eSGarrett Wollman #include <rpc/svc_auth.h>	/* service side authenticator */
67dba7a33eSGarrett Wollman 
688360efbdSAlfred Perlstein /* Portmapper client, server, and protocol headers */
698360efbdSAlfred Perlstein #include <rpc/pmap_clnt.h>
708360efbdSAlfred Perlstein #include <rpc/pmap_prot.h>
71dba7a33eSGarrett Wollman 
7287800257SAlfred Perlstein #ifndef _KERNEL
738360efbdSAlfred Perlstein #include <rpc/rpcb_clnt.h>	/* rpcbind interface functions */
7487800257SAlfred Perlstein #endif
758360efbdSAlfred Perlstein 
768360efbdSAlfred Perlstein #include <rpc/rpcent.h>
77dba7a33eSGarrett Wollman 
7886b9a9ccSGarrett Wollman __BEGIN_DECLS
79bb28f3c2SWarner Losh extern int get_myaddress(struct sockaddr_in *);
80bb28f3c2SWarner Losh extern int bindresvport(int, struct sockaddr_in *);
81bb28f3c2SWarner Losh extern int registerrpc(int, int, int, char *(*)(char [UDPMSGSIZE]),
82bb28f3c2SWarner Losh     xdrproc_t, xdrproc_t);
83bb28f3c2SWarner Losh extern int callrpc(const char *, int, int, int, xdrproc_t, void *,
84bb28f3c2SWarner Losh     xdrproc_t , void *);
85bb28f3c2SWarner Losh extern int getrpcport(char *, int, int, int);
868360efbdSAlfred Perlstein 
87bb28f3c2SWarner Losh char *taddr2uaddr(const struct netconfig *, const struct netbuf *);
88bb28f3c2SWarner Losh struct netbuf *uaddr2taddr(const struct netconfig *, const char *);
898360efbdSAlfred Perlstein 
908360efbdSAlfred Perlstein struct sockaddr;
91bb28f3c2SWarner Losh extern int bindresvport_sa(int, struct sockaddr *);
928360efbdSAlfred Perlstein __END_DECLS
938360efbdSAlfred Perlstein 
948360efbdSAlfred Perlstein /*
958360efbdSAlfred Perlstein  * The following are not exported interfaces, they are for internal library
968360efbdSAlfred Perlstein  * and rpcbind use only. Do not use, they may change without notice.
978360efbdSAlfred Perlstein  */
988360efbdSAlfred Perlstein __BEGIN_DECLS
99bb28f3c2SWarner Losh int __rpc_nconf2fd(const struct netconfig *);
100bb28f3c2SWarner Losh int __rpc_nconf2sockinfo(const struct netconfig *, struct __rpc_sockinfo *);
101bb28f3c2SWarner Losh int __rpc_fd2sockinfo(int, struct __rpc_sockinfo *);
102bb28f3c2SWarner Losh u_int __rpc_get_t_size(int, int, int);
10386b9a9ccSGarrett Wollman __END_DECLS
104dba7a33eSGarrett Wollman 
10586b9a9ccSGarrett Wollman #endif /* !_RPC_RPC_H */
106