xref: /freebsd/include/rpc/pmap_prot.h (revision bb28f3c29b4c91af1b0e79e456294bb08735648a)
18360efbdSAlfred Perlstein /*	$NetBSD: pmap_prot.h,v 1.8 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_prot.h 1.14 88/02/08 SMI
3286b9a9ccSGarrett Wollman  *	from: @(#)pmap_prot.h	2.1 88/07/29 4.0 RPCSRC
33a4add9a9SPeter Wemm  * $FreeBSD$
34dba7a33eSGarrett Wollman  */
35dba7a33eSGarrett Wollman 
36dba7a33eSGarrett Wollman /*
37dba7a33eSGarrett Wollman  * pmap_prot.h
38dba7a33eSGarrett Wollman  * Protocol for the local binder service, or pmap.
39dba7a33eSGarrett Wollman  *
40dba7a33eSGarrett Wollman  * Copyright (C) 1984, Sun Microsystems, Inc.
41dba7a33eSGarrett Wollman  *
42dba7a33eSGarrett Wollman  * The following procedures are supported by the protocol:
43dba7a33eSGarrett Wollman  *
44dba7a33eSGarrett Wollman  * PMAPPROC_NULL() returns ()
45dba7a33eSGarrett Wollman  * 	takes nothing, returns nothing
46dba7a33eSGarrett Wollman  *
47dba7a33eSGarrett Wollman  * PMAPPROC_SET(struct pmap) returns (bool_t)
48dba7a33eSGarrett Wollman  * 	TRUE is success, FALSE is failure.  Registers the tuple
49dba7a33eSGarrett Wollman  *	[prog, vers, prot, port].
50dba7a33eSGarrett Wollman  *
51dba7a33eSGarrett Wollman  * PMAPPROC_UNSET(struct pmap) returns (bool_t)
52dba7a33eSGarrett Wollman  *	TRUE is success, FALSE is failure.  Un-registers pair
53dba7a33eSGarrett Wollman  *	[prog, vers].  prot and port are ignored.
54dba7a33eSGarrett Wollman  *
55dba7a33eSGarrett Wollman  * PMAPPROC_GETPORT(struct pmap) returns (long unsigned).
56dba7a33eSGarrett Wollman  *	0 is failure.  Otherwise returns the port number where the pair
57dba7a33eSGarrett Wollman  *	[prog, vers] is registered.  It may lie!
58dba7a33eSGarrett Wollman  *
59dba7a33eSGarrett Wollman  * PMAPPROC_DUMP() RETURNS (struct pmaplist *)
60dba7a33eSGarrett Wollman  *
61dba7a33eSGarrett Wollman  * PMAPPROC_CALLIT(unsigned, unsigned, unsigned, string<>)
62dba7a33eSGarrett Wollman  * 	RETURNS (port, string<>);
63dba7a33eSGarrett Wollman  * usage: encapsulatedresults = PMAPPROC_CALLIT(prog, vers, proc, encapsulatedargs);
64dba7a33eSGarrett Wollman  * 	Calls the procedure on the local machine.  If it is not registered,
65dba7a33eSGarrett Wollman  *	this procedure is quite; ie it does not return error information!!!
66dba7a33eSGarrett Wollman  *	This procedure only is supported on rpc/udp and calls via
67dba7a33eSGarrett Wollman  *	rpc/udp.  This routine only passes null authentication parameters.
68dba7a33eSGarrett Wollman  *	This file has no interface to xdr routines for PMAPPROC_CALLIT.
69dba7a33eSGarrett Wollman  *
70dba7a33eSGarrett Wollman  * The service supports remote procedure calls on udp/ip or tcp/ip socket 111.
71dba7a33eSGarrett Wollman  */
72dba7a33eSGarrett Wollman 
738360efbdSAlfred Perlstein #ifndef _RPC_PMAP_PROT_H
748360efbdSAlfred Perlstein #define _RPC_PMAP_PROT_H
7586b9a9ccSGarrett Wollman #include <sys/cdefs.h>
7686b9a9ccSGarrett Wollman 
77dba7a33eSGarrett Wollman #define PMAPPORT		((u_short)111)
78dba7a33eSGarrett Wollman #define PMAPPROG		((u_long)100000)
79dba7a33eSGarrett Wollman #define PMAPVERS		((u_long)2)
80dba7a33eSGarrett Wollman #define PMAPVERS_PROTO		((u_long)2)
81dba7a33eSGarrett Wollman #define PMAPVERS_ORIG		((u_long)1)
82dba7a33eSGarrett Wollman #define PMAPPROC_NULL		((u_long)0)
83dba7a33eSGarrett Wollman #define PMAPPROC_SET		((u_long)1)
84dba7a33eSGarrett Wollman #define PMAPPROC_UNSET		((u_long)2)
85dba7a33eSGarrett Wollman #define PMAPPROC_GETPORT	((u_long)3)
86dba7a33eSGarrett Wollman #define PMAPPROC_DUMP		((u_long)4)
87dba7a33eSGarrett Wollman #define PMAPPROC_CALLIT		((u_long)5)
88dba7a33eSGarrett Wollman 
89dba7a33eSGarrett Wollman struct pmap {
90dba7a33eSGarrett Wollman 	long unsigned pm_prog;
91dba7a33eSGarrett Wollman 	long unsigned pm_vers;
92dba7a33eSGarrett Wollman 	long unsigned pm_prot;
93dba7a33eSGarrett Wollman 	long unsigned pm_port;
94dba7a33eSGarrett Wollman };
95dba7a33eSGarrett Wollman 
96dba7a33eSGarrett Wollman struct pmaplist {
97dba7a33eSGarrett Wollman 	struct pmap	pml_map;
98dba7a33eSGarrett Wollman 	struct pmaplist *pml_next;
99dba7a33eSGarrett Wollman };
100dba7a33eSGarrett Wollman 
10186b9a9ccSGarrett Wollman __BEGIN_DECLS
102bb28f3c2SWarner Losh extern bool_t xdr_pmap(XDR *, struct pmap *);
103bb28f3c2SWarner Losh extern bool_t xdr_pmaplist(XDR *, struct pmaplist **);
104bb28f3c2SWarner Losh extern bool_t xdr_pmaplist_ptr(XDR *, struct pmaplist *);
10586b9a9ccSGarrett Wollman __END_DECLS
10686b9a9ccSGarrett Wollman 
1078360efbdSAlfred Perlstein #endif /* !_RPC_PMAP_PROT_H */
108