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