4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 % * Copyright (c) 1984,1989 by Sun Microsystems, Inc.
26 %/* from pmap_prot.x */
35 * Port Mapper Protocol Specification (in RPC Language)
36 * derived from RFC 1057
40 % * Protocol for the local binder service, or pmap.
42 % * Copyright (C) 1984, Sun Microsystems, Inc.
44 % * The following procedures are supported by the protocol:
46 % * PMAPPROC_NULL() returns ()
47 % * takes nothing, returns nothing
49 % * PMAPPROC_SET(struct pmap) returns (bool_t)
50 % * TRUE is success, FALSE is failure. Registers the tuple
51 % * [prog, vers, prot, port].
53 % * PMAPPROC_UNSET(struct pmap) returns (bool_t)
54 % * TRUE is success, FALSE is failure. Un-registers pair
55 % * [prog, vers]. prot and port are ignored.
57 % * PMAPPROC_GETPORT(struct pmap) returns (rpcport_t).
58 % * 0 is failure. Otherwise returns the port number where the pair
59 % * [prog, vers] is registered. It may lie!
61 % * PMAPPROC_DUMP() RETURNS (struct pmaplist_ptr)
63 % * PMAPPROC_CALLIT(unsigned, unsigned, unsigned, string<>)
64 % * RETURNS (port, string<>);
65 % * usage: encapsulatedresults = PMAPPROC_CALLIT(prog, vers, proc,
66 % * encapsulatedargs);
67 % * Calls the procedure on the local machine. If it is not registered,
68 % * this procedure is quite; ie it does not return error information!!!
69 % * This procedure only is supported on rpc/udp and calls via
70 % * rpc/udp. This routine only passes null authentication parameters.
71 % * This file has no interface to xdr routines for PMAPPROC_CALLIT.
73 % * The service supports remote procedure calls on udp/ip or tcp/ip socket 111.
76 const PMAPPORT = 111; /* portmapper port number */
80 % * A mapping of (program, version, protocol) to port number
96 % * Supported values for the "prot" field
99 const PMAP_IPPROTO_TCP = 6; /* protocol number for TCP/IP */
100 const PMAP_IPPROTO_UDP = 17; /* protocol number for UDP/IP */
104 % * A list of mappings
106 % * Below are two definitions for the pmaplist structure. This is done because
107 % * xdr_pmaplist() is specified to take a struct pmaplist **, rather than a
108 % * struct pmaplist * that rpcgen would produce. One version of the pmaplist
109 % * structure (actually called pm__list) is used with rpcgen, and the other is
110 % * defined only in the header file for compatibility with the specified
116 struct pm__list *pml_next;
119 typedef pm__list *pmaplist_ptr; /* results of PMAPPROC_DUMP */
125 % struct pmaplist *pml_next;
128 %typedef struct pmaplist pmaplist;
129 %typedef struct pmaplist PMAPLIST;
135 %extern bool_t xdr_pmaplist(XDR *, pmaplist**);
137 %bool_t xdr_pmaplist();
147 % * Arguments to callit
159 % * Client-side only representation of rmtcallargs structure.
161 % * The routine that XDRs the rmtcallargs structure must deal with the
162 % * opaque arguments in the "args" structure. xdr_rmtcall_args() needs to be
163 % * passed the XDR routine that knows the args' structure. This routine
164 % * doesn't need to go over-the-wire (and it wouldn't make sense anyway) since
165 % * the application being called knows the args structure already. So we use a
166 % * different "XDR" structure on the client side, p_rmtcallargs, which includes
167 % * the args' XDR routine.
169 %struct p_rmtcallargs {
177 % xdrproc_t xdr_args; /* encodes args */
180 #endif /* def RPC_HDR */
184 % * Results of callit
194 % * Client-side only representation of rmtcallres structure.
196 %struct p_rmtcallres {
202 % xdrproc_t xdr_res; /* decodes res */
205 #endif /* def RPC_HDR */
208 * Port mapper procedures
214 PMAPPROC_NULL(void) = 0;
217 PMAPPROC_SET(pmap) = 1;
220 PMAPPROC_UNSET(pmap) = 2;
223 PMAPPROC_GETPORT(pmap) = 3;
226 PMAPPROC_DUMP(void) = 4;
229 PMAPPROC_CALLIT(rmtcallargs) = 5;
234 %#define PMAPVERS_PROTO ((rpcvers_t)2)
235 %#define PMAPVERS_ORIG ((rpcvers_t)1)
237 %#else /* ndef _KERNEL */
239 %#include <rpc/pmap_rmt.h>
245 %#define PMAPPORT 111
253 %typedef struct pmap PMAP;
255 %extern bool_t xdr_pmap (XDR *, struct pmap *);
257 %extern bool_t xdr_pmap ();
261 % struct pmap pml_map;
262 % struct pmaplist *pml_next;
264 %typedef struct pmaplist PMAPLIST;
265 %typedef struct pmaplist *pmaplist_ptr;
272 %#endif /* ndef _KERNEL */