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