xref: /freebsd/include/rpc/pmap_clnt.h (revision bb28f3c29b4c91af1b0e79e456294bb08735648a)
18360efbdSAlfred Perlstein /*	$NetBSD: pmap_clnt.h,v 1.9 2000/06/02 22:57:55 fvdl Exp $	*/
28360efbdSAlfred Perlstein 
3dba7a33eSGarrett Wollman /*
4dba7a33eSGarrett Wollman  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
5dba7a33eSGarrett Wollman  * unrestricted use provided that this legend is included on all tape
6dba7a33eSGarrett Wollman  * media and as a part of the software program in whole or part.  Users
7dba7a33eSGarrett Wollman  * may copy or modify Sun RPC without charge, but are not authorized
8dba7a33eSGarrett Wollman  * to license or distribute it to anyone else except as part of a product or
9dba7a33eSGarrett Wollman  * program developed by the user.
10dba7a33eSGarrett Wollman  *
11dba7a33eSGarrett Wollman  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
1271d9c781SMike Pritchard  * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
13dba7a33eSGarrett Wollman  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
14dba7a33eSGarrett Wollman  *
15dba7a33eSGarrett Wollman  * Sun RPC is provided with no support and without any obligation on the
16dba7a33eSGarrett Wollman  * part of Sun Microsystems, Inc. to assist in its use, correction,
17dba7a33eSGarrett Wollman  * modification or enhancement.
18dba7a33eSGarrett Wollman  *
19dba7a33eSGarrett Wollman  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
20dba7a33eSGarrett Wollman  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
21dba7a33eSGarrett Wollman  * OR ANY PART THEREOF.
22dba7a33eSGarrett Wollman  *
23dba7a33eSGarrett Wollman  * In no event will Sun Microsystems, Inc. be liable for any lost revenue
24dba7a33eSGarrett Wollman  * or profits or other special, indirect and consequential damages, even if
25dba7a33eSGarrett Wollman  * Sun has been advised of the possibility of such damages.
26dba7a33eSGarrett Wollman  *
27dba7a33eSGarrett Wollman  * Sun Microsystems, Inc.
28dba7a33eSGarrett Wollman  * 2550 Garcia Avenue
29dba7a33eSGarrett Wollman  * Mountain View, California  94043
3086b9a9ccSGarrett Wollman  *
3186b9a9ccSGarrett Wollman  *	from: @(#)pmap_clnt.h 1.11 88/02/08 SMI
3286b9a9ccSGarrett Wollman  *	from: @(#)pmap_clnt.h	2.1 88/07/29 4.0 RPCSRC
33a4add9a9SPeter Wemm  * $FreeBSD$
34dba7a33eSGarrett Wollman  */
35dba7a33eSGarrett Wollman 
36dba7a33eSGarrett Wollman /*
37dba7a33eSGarrett Wollman  * pmap_clnt.h
38dba7a33eSGarrett Wollman  * Supplies C routines to get to portmap services.
39dba7a33eSGarrett Wollman  *
40dba7a33eSGarrett Wollman  * Copyright (C) 1984, Sun Microsystems, Inc.
41dba7a33eSGarrett Wollman  */
42dba7a33eSGarrett Wollman 
43dba7a33eSGarrett Wollman /*
44dba7a33eSGarrett Wollman  * Usage:
45dba7a33eSGarrett Wollman  *	success = pmap_set(program, version, protocol, port);
46dba7a33eSGarrett Wollman  *	success = pmap_unset(program, version);
47dba7a33eSGarrett Wollman  *	port = pmap_getport(address, program, version, protocol);
48dba7a33eSGarrett Wollman  *	head = pmap_getmaps(address);
49dba7a33eSGarrett Wollman  *	clnt_stat = pmap_rmtcall(address, program, version, procedure,
50dba7a33eSGarrett Wollman  *		xdrargs, argsp, xdrres, resp, tout, port_ptr)
51dba7a33eSGarrett Wollman  *		(works for udp only.)
52dba7a33eSGarrett Wollman  * 	clnt_stat = clnt_broadcast(program, version, procedure,
53dba7a33eSGarrett Wollman  *		xdrargs, argsp,	xdrres, resp, eachresult)
54dba7a33eSGarrett Wollman  *		(like pmap_rmtcall, except the call is broadcasted to all
55dba7a33eSGarrett Wollman  *		locally connected nets.  For each valid response received,
56dba7a33eSGarrett Wollman  *		the procedure eachresult is called.  Its form is:
57dba7a33eSGarrett Wollman  *	done = eachresult(resp, raddr)
58dba7a33eSGarrett Wollman  *		bool_t done;
59dba7a33eSGarrett Wollman  *		caddr_t resp;
60dba7a33eSGarrett Wollman  *		struct sockaddr_in raddr;
61dba7a33eSGarrett Wollman  *		where resp points to the results of the call and raddr is the
62dba7a33eSGarrett Wollman  *		address if the responder to the broadcast.
63dba7a33eSGarrett Wollman  */
64dba7a33eSGarrett Wollman 
658360efbdSAlfred Perlstein #ifndef _RPC_PMAP_CLNT_H_
668360efbdSAlfred Perlstein #define _RPC_PMAP_CLNT_H_
6786b9a9ccSGarrett Wollman #include <sys/cdefs.h>
6886b9a9ccSGarrett Wollman 
6986b9a9ccSGarrett Wollman __BEGIN_DECLS
70bb28f3c2SWarner Losh extern bool_t		pmap_set(u_long, u_long, int, int);
71bb28f3c2SWarner Losh extern bool_t		pmap_unset(u_long, u_long);
72bb28f3c2SWarner Losh extern struct pmaplist	*pmap_getmaps(struct sockaddr_in *);
73bb28f3c2SWarner Losh extern enum clnt_stat	pmap_rmtcall(struct sockaddr_in *,
7486b9a9ccSGarrett Wollman 				     u_long, u_long, u_long,
7586b9a9ccSGarrett Wollman 				     xdrproc_t, caddr_t,
7686b9a9ccSGarrett Wollman 				     xdrproc_t, caddr_t,
77bb28f3c2SWarner Losh 				     struct timeval, u_long *);
78bb28f3c2SWarner Losh extern enum clnt_stat	clnt_broadcast(u_long, u_long, u_long,
7986b9a9ccSGarrett Wollman 				       xdrproc_t, char *,
8086b9a9ccSGarrett Wollman 				       xdrproc_t, char *,
81bb28f3c2SWarner Losh 				       resultproc_t);
82bb28f3c2SWarner Losh extern u_short		pmap_getport(struct sockaddr_in *,
83bb28f3c2SWarner Losh 				     u_long, u_long, u_int);
8486b9a9ccSGarrett Wollman __END_DECLS
8586b9a9ccSGarrett Wollman 
868360efbdSAlfred Perlstein #endif /* !_RPC_PMAP_CLNT_H_ */
87