1177633Sdfr/*	$NetBSD: rpc.h,v 1.13 2000/06/02 22:57:56 fvdl Exp $	*/
2177633Sdfr
3261046Smav/*-
4261046Smav * Copyright (c) 2009, Sun Microsystems, Inc.
5261046Smav * All rights reserved.
6177633Sdfr *
7261046Smav * Redistribution and use in source and binary forms, with or without
8261046Smav * modification, are permitted provided that the following conditions are met:
9261046Smav * - Redistributions of source code must retain the above copyright notice,
10261046Smav *   this list of conditions and the following disclaimer.
11261046Smav * - Redistributions in binary form must reproduce the above copyright notice,
12261046Smav *   this list of conditions and the following disclaimer in the documentation
13261046Smav *   and/or other materials provided with the distribution.
14261046Smav * - Neither the name of Sun Microsystems, Inc. nor the names of its
15261046Smav *   contributors may be used to endorse or promote products derived
16261046Smav *   from this software without specific prior written permission.
17261046Smav *
18261046Smav * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19261046Smav * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20261046Smav * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21261046Smav * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22261046Smav * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23261046Smav * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24261046Smav * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25261046Smav * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26261046Smav * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27261046Smav * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28261046Smav * POSSIBILITY OF SUCH DAMAGE.
29177633Sdfr *
30177633Sdfr *	from: @(#)rpc.h 1.9 88/02/08 SMI
31177633Sdfr *	from: @(#)rpc.h	2.4 89/07/11 4.0 RPCSRC
32177633Sdfr * $FreeBSD$
33177633Sdfr */
34177633Sdfr
35177633Sdfr/*
36177633Sdfr * rpc.h, Just includes the billions of rpc header files necessary to
37177633Sdfr * do remote procedure calling.
38177633Sdfr *
39177633Sdfr * Copyright (C) 1984, Sun Microsystems, Inc.
40177633Sdfr */
41177633Sdfr#ifndef _RPC_RPC_H
42177633Sdfr#define _RPC_RPC_H
43177633Sdfr
44177633Sdfr#include <rpc/types.h>		/* some typedefs */
45177633Sdfr#include <sys/socket.h>
46177633Sdfr#include <netinet/in.h>
47177633Sdfr
48177633Sdfr/* external data representation interfaces */
49177633Sdfr#include <rpc/xdr.h>		/* generic (de)serializer */
50177633Sdfr
51177633Sdfr/* Client side only authentication */
52177633Sdfr#include <rpc/auth.h>		/* generic authenticator (client side) */
53177633Sdfr
54177633Sdfr/* Client side (mostly) remote procedure call */
55177633Sdfr#include <rpc/clnt.h>		/* generic rpc stuff */
56177633Sdfr
57177633Sdfr/* semi-private protocol headers */
58177633Sdfr#include <rpc/rpc_msg.h>	/* protocol for rpc messages */
59177633Sdfr
60177633Sdfr#ifndef _KERNEL
61177633Sdfr#include <rpc/auth_unix.h>	/* protocol for unix style cred */
62177633Sdfr/*
63177633Sdfr *  Uncomment-out the next line if you are building the rpc library with
64177633Sdfr *  DES Authentication (see the README file in the secure_rpc/ directory).
65177633Sdfr */
66177633Sdfr#include <rpc/auth_des.h>	/* protocol for des style cred */
67177633Sdfr#endif
68177633Sdfr
69177633Sdfr/* Server side only remote procedure callee */
70177633Sdfr#include <rpc/svc.h>		/* service manager and multiplexer */
71177633Sdfr#include <rpc/svc_auth.h>	/* service side authenticator */
72177633Sdfr
73177633Sdfr#ifndef _KERNEL
74177633Sdfr/* Portmapper client, server, and protocol headers */
75177633Sdfr#include <rpc/pmap_clnt.h>
76177633Sdfr#endif
77177633Sdfr#include <rpc/pmap_prot.h>
78177633Sdfr
79177633Sdfr#include <rpc/rpcb_clnt.h>	/* rpcbind interface functions */
80177633Sdfr
81177633Sdfr#ifndef _KERNEL
82177633Sdfr#include <rpc/rpcent.h>
83177633Sdfr#endif
84177633Sdfr
85177633Sdfr#ifndef UDPMSGSIZE
86177633Sdfr#define UDPMSGSIZE 8800
87177633Sdfr#endif
88177633Sdfr
89177633Sdfr__BEGIN_DECLS
90177633Sdfrextern int get_myaddress(struct sockaddr_in *);
91177633Sdfr#ifndef _KERNEL
92177633Sdfrextern int bindresvport(int, struct sockaddr_in *);
93177633Sdfr#endif
94177633Sdfrextern int registerrpc(int, int, int, char *(*)(char [UDPMSGSIZE]),
95177633Sdfr    xdrproc_t, xdrproc_t);
96177633Sdfrextern int callrpc(const char *, int, int, int, xdrproc_t, void *,
97177633Sdfr    xdrproc_t , void *);
98177633Sdfrextern int getrpcport(char *, int, int, int);
99177633Sdfr
100177633Sdfrchar *taddr2uaddr(const struct netconfig *, const struct netbuf *);
101177633Sdfrstruct netbuf *uaddr2taddr(const struct netconfig *, const char *);
102177633Sdfr
103177633Sdfrstruct sockaddr;
104177633Sdfrextern int bindresvport_sa(int, struct sockaddr *);
105177633Sdfr__END_DECLS
106177633Sdfr
107177633Sdfr/*
108177633Sdfr * The following are not exported interfaces, they are for internal library
109177633Sdfr * and rpcbind use only. Do not use, they may change without notice.
110177633Sdfr */
111177633Sdfr__BEGIN_DECLS
112177633Sdfr#ifndef _KERNEL
113177633Sdfrint __rpc_nconf2fd(const struct netconfig *);
114177633Sdfrint __rpc_nconf2sockinfo(const struct netconfig *, struct __rpc_sockinfo *);
115177633Sdfrint __rpc_fd2sockinfo(int, struct __rpc_sockinfo *);
116177633Sdfr#else
117177633Sdfrstruct socket *__rpc_nconf2socket(const struct netconfig *);
118177633Sdfrint __rpc_nconf2sockinfo(const struct netconfig *, struct __rpc_sockinfo *);
119177633Sdfrint __rpc_socket2sockinfo(struct socket *, struct __rpc_sockinfo *);
120177633Sdfr#endif
121177633Sdfru_int __rpc_get_t_size(int, int, int);
122177633Sdfr__END_DECLS
123177633Sdfr
124177633Sdfr#endif /* !_RPC_RPC_H */
125