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