xref: /titanic_44/usr/src/uts/common/rpc/pmap_clnt.h (revision 99ebb4ca412cb0a19d77a3899a87c055b9c30fa8)
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 #ifndef _RPC_PMAP_CLNT_H
35 #define	_RPC_PMAP_CLNT_H
36 
37 #pragma ident	"%Z%%M%	%I%	%E% SMI"
38 
39 
40 /*
41  * pmap_clnt.h
42  * Supplies C routines to get to portmap services.
43  */
44 
45 #include <netinet/in.h>
46 
47 #ifdef __STDC__
48 #include <rpc/clnt.h>
49 #endif
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
55 /*
56  * Usage:
57  *	success = pmap_set(program, version, protocol, port);
58  *	success = pmap_unset(program, version);
59  *	port = pmap_getport(address, program, version, protocol);
60  *	head = pmap_getmaps(address);
61  *	clnt_stat = pmap_rmtcall(address, program, version, procedure,
62  *		xdrargs, argsp, xdrres, resp, tout, port_ptr)
63  *		(works for udp only.)
64  * 	clnt_stat = clnt_broadcast(program, version, procedure,
65  *		xdrargs, argsp,	xdrres, resp, eachresult)
66  *		(like pmap_rmtcall, except the call is broadcasted to all
67  *		locally connected nets.  For each valid response received,
68  *		the procedure eachresult is called.  Its form is:
69  *	done = eachresult(resp, raddr)
70  *		bool_t done;
71  *		caddr_t resp;
72  *		struct sockaddr_in raddr;
73  *		where resp points to the results of the call and raddr is the
74  *		address if the responder to the broadcast.
75  */
76 
77 #ifdef __STDC__
78 extern bool_t pmap_set(rpcprog_t, rpcvers_t, rpcprot_t, unsigned short port);
79 extern bool_t pmap_unset(rpcprog_t, rpcvers_t);
80 extern struct pmaplist *pmap_getmaps(struct sockaddr_in *);
81 extern ushort_t pmap_getport(struct sockaddr_in *, rpcprog_t, rpcvers_t,
82     rpcprot_t);
83 #ifndef _KERNEL
84 enum clnt_stat clnt_broadcast(rpcprog_t, rpcvers_t, rpcproc_t, xdrproc_t,
85     char *, xdrproc_t, char *, resultproc_t);
86 enum clnt_stat pmap_rmtcall(struct sockaddr_in *, rpcprog_t, rpcvers_t,
87     rpcproc_t, xdrproc_t, caddr_t, xdrproc_t, caddr_t, struct timeval,
88     rpcport_t *);
89 #endif
90 #else
91 extern bool_t pmap_set();
92 extern bool_t pmap_unset();
93 extern struct pmaplist *pmap_getmaps();
94 extern ushort_t pmap_getport();
95 #ifndef _KERNEL
96 enum clnt_stat clnt_broadcast();
97 enum clnt_stat pmap_rmtcall();
98 #endif
99 #endif
100 
101 #ifdef __cplusplus
102 }
103 #endif
104 
105 #endif	/* _RPC_PMAP_CLNT_H */
106