xref: /openbsd/include/rpc/pmap_prot.h (revision cb7760d1)
1 /*	$OpenBSD: pmap_prot.h,v 1.6 2010/09/01 14:43:34 millert Exp $	*/
2 /*	$NetBSD: pmap_prot.h,v 1.4 1994/10/26 00:57:00 cgd Exp $	*/
3 
4 /*
5  * Copyright (c) 2010, Oracle America, Inc.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are
9  * met:
10  *
11  *     * Redistributions of source code must retain the above copyright
12  *       notice, this list of conditions and the following disclaimer.
13  *     * Redistributions in binary form must reproduce the above
14  *       copyright notice, this list of conditions and the following
15  *       disclaimer in the documentation and/or other materials
16  *       provided with the distribution.
17  *     * Neither the name of the "Oracle America, Inc." nor the names of its
18  *       contributors may be used to endorse or promote products derived
19  *       from this software without specific prior written permission.
20  *
21  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  *   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  *   COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
26  *   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27  *   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
28  *   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29  *   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
30  *   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31  *   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33  *
34  *	from: @(#)pmap_prot.h 1.14 88/02/08 SMI
35  *	@(#)pmap_prot.h	2.1 88/07/29 4.0 RPCSRC
36  */
37 
38 /*
39  * pmap_prot.h
40  * Protocol for the local binder service, or pmap.
41  *
42  * The following procedures are supported by the protocol:
43  *
44  * PMAPPROC_NULL() returns ()
45  * 	takes nothing, returns nothing
46  *
47  * PMAPPROC_SET(struct pmap) returns (bool_t)
48  * 	TRUE is success, FALSE is failure.  Registers the tuple
49  *	[prog, vers, prot, port].
50  *
51  * PMAPPROC_UNSET(struct pmap) returns (bool_t)
52  *	TRUE is success, FALSE is failure.  Un-registers pair
53  *	[prog, vers].  prot and port are ignored.
54  *
55  * PMAPPROC_GETPORT(struct pmap) returns (unsigned long).
56  *	0 is failure.  Otherwise returns the port number where the pair
57  *	[prog, vers] is registered.  It may lie!
58  *
59  * PMAPPROC_DUMP() RETURNS (struct pmaplist *)
60  *
61  * PMAPPROC_CALLIT(unsigned int, unsigned int, unsigned int, string<>)
62  * 	RETURNS (port, string<>);
63  * usage: encapsulatedresults = PMAPPROC_CALLIT(prog, vers, proc, encapsulatedargs);
64  * 	Calls the procedure on the local machine.  If it is not registered,
65  *	this procedure is quite; ie it does not return error information!!!
66  *	This procedure only is supported on rpc/udp and calls via
67  *	rpc/udp.  This routine only passes null authentication parameters.
68  *	This file has no interface to xdr routines for PMAPPROC_CALLIT.
69  *
70  * The service supports remote procedure calls on udp/ip or tcp/ip socket 111.
71  */
72 
73 #ifndef _RPC_PMAPPROT_H
74 #define _RPC_PMAPPROT_H
75 #include <sys/cdefs.h>
76 
77 #define PMAPPORT		((unsigned short)111)
78 #define PMAPPROG		((unsigned long)100000)
79 #define PMAPVERS		((unsigned long)2)
80 #define PMAPVERS_PROTO		((unsigned long)2)
81 #define PMAPVERS_ORIG		((unsigned long)1)
82 #define PMAPPROC_NULL		((unsigned long)0)
83 #define PMAPPROC_SET		((unsigned long)1)
84 #define PMAPPROC_UNSET		((unsigned long)2)
85 #define PMAPPROC_GETPORT	((unsigned long)3)
86 #define PMAPPROC_DUMP		((unsigned long)4)
87 #define PMAPPROC_CALLIT		((unsigned long)5)
88 
89 struct pmap {
90 	unsigned long pm_prog;
91 	unsigned long pm_vers;
92 	unsigned long pm_prot;
93 	unsigned long pm_port;
94 };
95 
96 struct pmaplist {
97 	struct pmap	pml_map;
98 	struct pmaplist *pml_next;
99 };
100 
101 __BEGIN_DECLS
102 extern bool_t xdr_pmap(XDR *, struct pmap *);
103 extern bool_t xdr_pmaplist(XDR *, struct pmaplist **);
104 __END_DECLS
105 
106 #endif /* !_RPC_PMAPPROT_H */
107