xref: /freebsd/include/rpc/pmap_clnt.h (revision 2e322d379631c3bd6107e295f3e5d814c7845fc7)
18360efbdSAlfred Perlstein /*	$NetBSD: pmap_clnt.h,v 1.9 2000/06/02 22:57:55 fvdl Exp $	*/
28360efbdSAlfred Perlstein 
3*2e322d37SHiroki Sato /*-
4*2e322d37SHiroki Sato  * Copyright (c) 2009, Sun Microsystems, Inc.
5*2e322d37SHiroki Sato  * All rights reserved.
6dba7a33eSGarrett Wollman  *
7*2e322d37SHiroki Sato  * Redistribution and use in source and binary forms, with or without
8*2e322d37SHiroki Sato  * modification, are permitted provided that the following conditions are met:
9*2e322d37SHiroki Sato  * - Redistributions of source code must retain the above copyright notice,
10*2e322d37SHiroki Sato  *   this list of conditions and the following disclaimer.
11*2e322d37SHiroki Sato  * - Redistributions in binary form must reproduce the above copyright notice,
12*2e322d37SHiroki Sato  *   this list of conditions and the following disclaimer in the documentation
13*2e322d37SHiroki Sato  *   and/or other materials provided with the distribution.
14*2e322d37SHiroki Sato  * - Neither the name of Sun Microsystems, Inc. nor the names of its
15*2e322d37SHiroki Sato  *   contributors may be used to endorse or promote products derived
16*2e322d37SHiroki Sato  *   from this software without specific prior written permission.
17dba7a33eSGarrett Wollman  *
18*2e322d37SHiroki Sato  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19*2e322d37SHiroki Sato  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20*2e322d37SHiroki Sato  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21*2e322d37SHiroki Sato  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22*2e322d37SHiroki Sato  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23*2e322d37SHiroki Sato  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24*2e322d37SHiroki Sato  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25*2e322d37SHiroki Sato  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26*2e322d37SHiroki Sato  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27*2e322d37SHiroki Sato  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28*2e322d37SHiroki Sato  * POSSIBILITY OF SUCH DAMAGE.
2986b9a9ccSGarrett Wollman  *
3086b9a9ccSGarrett Wollman  *	from: @(#)pmap_clnt.h 1.11 88/02/08 SMI
3186b9a9ccSGarrett Wollman  *	from: @(#)pmap_clnt.h	2.1 88/07/29 4.0 RPCSRC
32a4add9a9SPeter Wemm  * $FreeBSD$
33dba7a33eSGarrett Wollman  */
34dba7a33eSGarrett Wollman 
35dba7a33eSGarrett Wollman /*
36dba7a33eSGarrett Wollman  * pmap_clnt.h
37dba7a33eSGarrett Wollman  * Supplies C routines to get to portmap services.
38dba7a33eSGarrett Wollman  *
39dba7a33eSGarrett Wollman  * Copyright (C) 1984, Sun Microsystems, Inc.
40dba7a33eSGarrett Wollman  */
41dba7a33eSGarrett Wollman 
42dba7a33eSGarrett Wollman /*
43dba7a33eSGarrett Wollman  * Usage:
44dba7a33eSGarrett Wollman  *	success = pmap_set(program, version, protocol, port);
45dba7a33eSGarrett Wollman  *	success = pmap_unset(program, version);
46dba7a33eSGarrett Wollman  *	port = pmap_getport(address, program, version, protocol);
47dba7a33eSGarrett Wollman  *	head = pmap_getmaps(address);
48dba7a33eSGarrett Wollman  *	clnt_stat = pmap_rmtcall(address, program, version, procedure,
49dba7a33eSGarrett Wollman  *		xdrargs, argsp, xdrres, resp, tout, port_ptr)
50dba7a33eSGarrett Wollman  *		(works for udp only.)
51dba7a33eSGarrett Wollman  * 	clnt_stat = clnt_broadcast(program, version, procedure,
52dba7a33eSGarrett Wollman  *		xdrargs, argsp,	xdrres, resp, eachresult)
53dba7a33eSGarrett Wollman  *		(like pmap_rmtcall, except the call is broadcasted to all
54dba7a33eSGarrett Wollman  *		locally connected nets.  For each valid response received,
55dba7a33eSGarrett Wollman  *		the procedure eachresult is called.  Its form is:
56dba7a33eSGarrett Wollman  *	done = eachresult(resp, raddr)
57dba7a33eSGarrett Wollman  *		bool_t done;
58dba7a33eSGarrett Wollman  *		caddr_t resp;
59dba7a33eSGarrett Wollman  *		struct sockaddr_in raddr;
60dba7a33eSGarrett Wollman  *		where resp points to the results of the call and raddr is the
61dba7a33eSGarrett Wollman  *		address if the responder to the broadcast.
62dba7a33eSGarrett Wollman  */
63dba7a33eSGarrett Wollman 
648360efbdSAlfred Perlstein #ifndef _RPC_PMAP_CLNT_H_
658360efbdSAlfred Perlstein #define _RPC_PMAP_CLNT_H_
6686b9a9ccSGarrett Wollman #include <sys/cdefs.h>
6786b9a9ccSGarrett Wollman 
6886b9a9ccSGarrett Wollman __BEGIN_DECLS
69bb28f3c2SWarner Losh extern bool_t		pmap_set(u_long, u_long, int, int);
70bb28f3c2SWarner Losh extern bool_t		pmap_unset(u_long, u_long);
71bb28f3c2SWarner Losh extern struct pmaplist	*pmap_getmaps(struct sockaddr_in *);
72bb28f3c2SWarner Losh extern enum clnt_stat	pmap_rmtcall(struct sockaddr_in *,
7386b9a9ccSGarrett Wollman 				     u_long, u_long, u_long,
7486b9a9ccSGarrett Wollman 				     xdrproc_t, caddr_t,
7586b9a9ccSGarrett Wollman 				     xdrproc_t, caddr_t,
76bb28f3c2SWarner Losh 				     struct timeval, u_long *);
77bb28f3c2SWarner Losh extern enum clnt_stat	clnt_broadcast(u_long, u_long, u_long,
78f249dbccSDag-Erling Smørgrav 				       xdrproc_t, void *,
79f249dbccSDag-Erling Smørgrav 				       xdrproc_t, void *,
80bb28f3c2SWarner Losh 				       resultproc_t);
81bb28f3c2SWarner Losh extern u_short		pmap_getport(struct sockaddr_in *,
82bb28f3c2SWarner Losh 				     u_long, u_long, u_int);
8386b9a9ccSGarrett Wollman __END_DECLS
8486b9a9ccSGarrett Wollman 
858360efbdSAlfred Perlstein #endif /* !_RPC_PMAP_CLNT_H_ */
86