xref: /freebsd/include/rpc/pmap_prot.h (revision 5a1d14419a5b620430949a46cb6ee63148a43cb9)
18360efbdSAlfred Perlstein /*	$NetBSD: pmap_prot.h,v 1.8 2000/06/02 22:57:55 fvdl Exp $	*/
28360efbdSAlfred Perlstein 
32e322d37SHiroki Sato /*-
4*2321c474SPedro F. Giffuni  * SPDX-License-Identifier: BSD-3-Clause
5*2321c474SPedro F. Giffuni  *
62e322d37SHiroki Sato  * Copyright (c) 2009, Sun Microsystems, Inc.
72e322d37SHiroki Sato  * All rights reserved.
8dba7a33eSGarrett Wollman  *
92e322d37SHiroki Sato  * Redistribution and use in source and binary forms, with or without
102e322d37SHiroki Sato  * modification, are permitted provided that the following conditions are met:
112e322d37SHiroki Sato  * - Redistributions of source code must retain the above copyright notice,
122e322d37SHiroki Sato  *   this list of conditions and the following disclaimer.
132e322d37SHiroki Sato  * - Redistributions in binary form must reproduce the above copyright notice,
142e322d37SHiroki Sato  *   this list of conditions and the following disclaimer in the documentation
152e322d37SHiroki Sato  *   and/or other materials provided with the distribution.
162e322d37SHiroki Sato  * - Neither the name of Sun Microsystems, Inc. nor the names of its
172e322d37SHiroki Sato  *   contributors may be used to endorse or promote products derived
182e322d37SHiroki Sato  *   from this software without specific prior written permission.
19dba7a33eSGarrett Wollman  *
202e322d37SHiroki Sato  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
212e322d37SHiroki Sato  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
222e322d37SHiroki Sato  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
232e322d37SHiroki Sato  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
242e322d37SHiroki Sato  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
252e322d37SHiroki Sato  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
262e322d37SHiroki Sato  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
272e322d37SHiroki Sato  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
282e322d37SHiroki Sato  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
292e322d37SHiroki Sato  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
302e322d37SHiroki Sato  * POSSIBILITY OF SUCH DAMAGE.
31dba7a33eSGarrett Wollman  */
32dba7a33eSGarrett Wollman 
33dba7a33eSGarrett Wollman /*
34dba7a33eSGarrett Wollman  * pmap_prot.h
35dba7a33eSGarrett Wollman  * Protocol for the local binder service, or pmap.
36dba7a33eSGarrett Wollman  *
37dba7a33eSGarrett Wollman  * Copyright (C) 1984, Sun Microsystems, Inc.
38dba7a33eSGarrett Wollman  *
39dba7a33eSGarrett Wollman  * The following procedures are supported by the protocol:
40dba7a33eSGarrett Wollman  *
41dba7a33eSGarrett Wollman  * PMAPPROC_NULL() returns ()
42dba7a33eSGarrett Wollman  * 	takes nothing, returns nothing
43dba7a33eSGarrett Wollman  *
44dba7a33eSGarrett Wollman  * PMAPPROC_SET(struct pmap) returns (bool_t)
45dba7a33eSGarrett Wollman  * 	TRUE is success, FALSE is failure.  Registers the tuple
46dba7a33eSGarrett Wollman  *	[prog, vers, prot, port].
47dba7a33eSGarrett Wollman  *
48dba7a33eSGarrett Wollman  * PMAPPROC_UNSET(struct pmap) returns (bool_t)
49dba7a33eSGarrett Wollman  *	TRUE is success, FALSE is failure.  Un-registers pair
50dba7a33eSGarrett Wollman  *	[prog, vers].  prot and port are ignored.
51dba7a33eSGarrett Wollman  *
52dba7a33eSGarrett Wollman  * PMAPPROC_GETPORT(struct pmap) returns (long unsigned).
53dba7a33eSGarrett Wollman  *	0 is failure.  Otherwise returns the port number where the pair
54dba7a33eSGarrett Wollman  *	[prog, vers] is registered.  It may lie!
55dba7a33eSGarrett Wollman  *
56dba7a33eSGarrett Wollman  * PMAPPROC_DUMP() RETURNS (struct pmaplist *)
57dba7a33eSGarrett Wollman  *
58dba7a33eSGarrett Wollman  * PMAPPROC_CALLIT(unsigned, unsigned, unsigned, string<>)
59dba7a33eSGarrett Wollman  * 	RETURNS (port, string<>);
60dba7a33eSGarrett Wollman  * usage: encapsulatedresults = PMAPPROC_CALLIT(prog, vers, proc, encapsulatedargs);
61dba7a33eSGarrett Wollman  * 	Calls the procedure on the local machine.  If it is not registered,
62dba7a33eSGarrett Wollman  *	this procedure is quite; ie it does not return error information!!!
63dba7a33eSGarrett Wollman  *	This procedure only is supported on rpc/udp and calls via
64dba7a33eSGarrett Wollman  *	rpc/udp.  This routine only passes null authentication parameters.
65dba7a33eSGarrett Wollman  *	This file has no interface to xdr routines for PMAPPROC_CALLIT.
66dba7a33eSGarrett Wollman  *
67dba7a33eSGarrett Wollman  * The service supports remote procedure calls on udp/ip or tcp/ip socket 111.
68dba7a33eSGarrett Wollman  */
69dba7a33eSGarrett Wollman 
708360efbdSAlfred Perlstein #ifndef _RPC_PMAP_PROT_H
718360efbdSAlfred Perlstein #define _RPC_PMAP_PROT_H
7286b9a9ccSGarrett Wollman #include <sys/cdefs.h>
7386b9a9ccSGarrett Wollman 
74dba7a33eSGarrett Wollman #define PMAPPORT		((u_short)111)
75dba7a33eSGarrett Wollman #define PMAPPROG		((u_long)100000)
76dba7a33eSGarrett Wollman #define PMAPVERS		((u_long)2)
77dba7a33eSGarrett Wollman #define PMAPVERS_PROTO		((u_long)2)
78dba7a33eSGarrett Wollman #define PMAPVERS_ORIG		((u_long)1)
79dba7a33eSGarrett Wollman #define PMAPPROC_NULL		((u_long)0)
80dba7a33eSGarrett Wollman #define PMAPPROC_SET		((u_long)1)
81dba7a33eSGarrett Wollman #define PMAPPROC_UNSET		((u_long)2)
82dba7a33eSGarrett Wollman #define PMAPPROC_GETPORT	((u_long)3)
83dba7a33eSGarrett Wollman #define PMAPPROC_DUMP		((u_long)4)
84dba7a33eSGarrett Wollman #define PMAPPROC_CALLIT		((u_long)5)
85dba7a33eSGarrett Wollman 
86dba7a33eSGarrett Wollman struct pmap {
87dba7a33eSGarrett Wollman 	long unsigned pm_prog;
88dba7a33eSGarrett Wollman 	long unsigned pm_vers;
89dba7a33eSGarrett Wollman 	long unsigned pm_prot;
90dba7a33eSGarrett Wollman 	long unsigned pm_port;
91dba7a33eSGarrett Wollman };
92dba7a33eSGarrett Wollman 
93dba7a33eSGarrett Wollman struct pmaplist {
94dba7a33eSGarrett Wollman 	struct pmap	pml_map;
95dba7a33eSGarrett Wollman 	struct pmaplist *pml_next;
96dba7a33eSGarrett Wollman };
97dba7a33eSGarrett Wollman 
9886b9a9ccSGarrett Wollman __BEGIN_DECLS
99bb28f3c2SWarner Losh extern bool_t xdr_pmap(XDR *, struct pmap *);
100bb28f3c2SWarner Losh extern bool_t xdr_pmaplist(XDR *, struct pmaplist **);
101bb28f3c2SWarner Losh extern bool_t xdr_pmaplist_ptr(XDR *, struct pmaplist *);
10286b9a9ccSGarrett Wollman __END_DECLS
10386b9a9ccSGarrett Wollman 
1048360efbdSAlfred Perlstein #endif /* !_RPC_PMAP_PROT_H */
105