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