xref: /illumos-gate/usr/src/uts/common/rpc/rpcb_clnt.h (revision 6dde88b51419b99fe0aab8e56184c693945826b8)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
27 /* All Rights Reserved */
28 /*
29  * Portions of this source code were derived from Berkeley
30  * 4.3 BSD under license from the Regents of the University of
31  * California.
32  */
33 
34 /*
35  * rpcb_clnt.h
36  * Supplies C routines to get to rpcbind services.
37  */
38 
39 /*
40  * Usage:
41  *	success = rpcb_set(program, version, nconf, address);
42  *	success = rpcb_unset(program, version, nconf);
43  *	success = rpcb_getaddr(program, version, nconf, host);
44  *	head = rpcb_getmaps(nconf, host);
45  *	clnt_stat = rpcb_rmtcall(nconf, host, program, version, procedure,
46  *		xdrargs, argsp, xdrres, resp, tout, addr_ptr)
47  *	success = rpcb_gettime(host, timep)
48  *	uaddr = rpcb_taddr2uaddr(nconf, taddr);
49  *	taddr = rpcb_uaddr2uaddr(nconf, uaddr);
50  */
51 
52 #ifndef _RPC_RPCB_CLNT_H
53 #define	_RPC_RPCB_CLNT_H
54 
55 #include <rpc/types.h>
56 #include <rpc/rpcb_prot.h>
57 #include <sys/netconfig.h>
58 
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62 
63 #ifdef __STDC__
64 extern bool_t		rpcb_set(const rpcprog_t, const rpcvers_t,
65 	const struct netconfig  *, const struct netbuf *);
66 extern bool_t		rpcb_unset(const rpcprog_t, const rpcvers_t,
67 	const struct netconfig *);
68 extern rpcblist	*rpcb_getmaps(const struct netconfig *, const char *);
69 extern enum clnt_stat	rpcb_rmtcall(const struct netconfig *, const char *,
70 const rpcprog_t, const rpcvers_t, const rpcproc_t, const xdrproc_t,
71 	const caddr_t, const xdrproc_t, const caddr_t,
72 	const struct timeval, struct netbuf *);
73 extern bool_t		rpcb_getaddr(const rpcprog_t, const rpcvers_t,
74 	const struct netconfig *, struct netbuf *, const  char *);
75 extern bool_t		rpcb_gettime(const char *, time_t *);
76 extern char		*rpcb_taddr2uaddr(struct netconfig *, struct netbuf *);
77 extern struct netbuf	*rpcb_uaddr2taddr(struct netconfig *, char *);
78 #else
79 extern bool_t		rpcb_set();
80 extern bool_t		rpcb_unset();
81 extern rpcblist	*rpcb_getmaps();
82 extern enum clnt_stat	rpcb_rmtcall();
83 extern bool_t		rpcb_getaddr();
84 extern bool_t		rpcb_gettime();
85 extern char		*rpcb_taddr2uaddr();
86 extern struct netbuf	*rpcb_uaddr2taddr();
87 #endif
88 
89 #ifdef __cplusplus
90 }
91 #endif
92 
93 #endif	/* !_RPC_RPCB_CLNT_H */
94