2 % * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
3 % * unrestricted use provided that this legend is included on all tape
4 % * media and as a part of the software program in whole or part. Users
5 % * may copy or modify Sun RPC without charge, but are not authorized
6 % * to license or distribute it to anyone else except as part of a product or
7 % * program developed by the user.
9 % * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
10 % * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
11 % * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
13 % * Sun RPC is provided with no support and without any obligation on the
14 % * part of Sun Microsystems, Inc. to assist in its use, correction,
15 % * modification or enhancement.
17 % * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
18 % * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
19 % * OR ANY PART THEREOF.
21 % * In no event will Sun Microsystems, Inc. be liable for any lost revenue
22 % * or profits or other special, indirect and consequential damages, even if
23 % * Sun has been advised of the possibility of such damages.
25 % * Sun Microsystems, Inc.
26 % * 2550 Garcia Avenue
27 % * Mountain View, California 94043
30 % * Copyright (c) 1984,1989 by Sun Microsystems, Inc.
33 %/* from pmap_prot.x */
37 %#pragma ident "@(#)pmap_prot.x 1.6 94/04/29 SMI"
38 %#include <sys/cdefs.h>
39 %__FBSDID("$FreeBSD$");
46 * Port Mapper Protocol Specification (in RPC Language)
47 * derived from RFC 1057
51 % * Protocol for the local binder service, or pmap.
53 % * Copyright (C) 1984, Sun Microsystems, Inc.
55 % * The following procedures are supported by the protocol:
57 % * PMAPPROC_NULL() returns ()
58 % * takes nothing, returns nothing
60 % * PMAPPROC_SET(struct pmap) returns (bool_t)
61 % * TRUE is success, FALSE is failure. Registers the tuple
62 % * [prog, vers, prot, port].
64 % * PMAPPROC_UNSET(struct pmap) returns (bool_t)
65 % * TRUE is success, FALSE is failure. Un-registers pair
66 % * [prog, vers]. prot and port are ignored.
68 % * PMAPPROC_GETPORT(struct pmap) returns (long unsigned).
69 % * 0 is failure. Otherwise returns the port number where the pair
70 % * [prog, vers] is registered. It may lie!
72 % * PMAPPROC_DUMP() RETURNS (struct pmaplist_ptr)
74 % * PMAPPROC_CALLIT(unsigned, unsigned, unsigned, string<>)
75 % * RETURNS (port, string<>);
76 % * usage: encapsulatedresults = PMAPPROC_CALLIT(prog, vers, proc,
77 % * encapsulatedargs);
78 % * Calls the procedure on the local machine. If it is not registered,
79 % * this procedure is quite; ie it does not return error information!!!
80 % * This procedure only is supported on rpc/udp and calls via
81 % * rpc/udp. This routine only passes null authentication parameters.
82 % * This file has no interface to xdr routines for PMAPPROC_CALLIT.
84 % * The service supports remote procedure calls on udp/ip or tcp/ip socket 111.
87 const PMAPPORT = 111; /* portmapper port number */
91 % * A mapping of (program, version, protocol) to port number
95 unsigned long pm_prog;
96 unsigned long pm_vers;
97 unsigned long pm_prot;
98 unsigned long pm_port;
107 % * Supported values for the "prot" field
110 const PMAP_IPPROTO_TCP = 6; /* protocol number for TCP/IP */
111 const PMAP_IPPROTO_UDP = 17; /* protocol number for UDP/IP */
115 % * A list of mappings
117 % * Below are two definitions for the pmaplist structure. This is done because
118 % * xdr_pmaplist() is specified to take a struct pmaplist **, rather than a
119 % * struct pmaplist * that rpcgen would produce. One version of the pmaplist
120 % * structure (actually called pm__list) is used with rpcgen, and the other is
121 % * defined only in the header file for compatibility with the specified
127 struct pm__list *pml_next;
130 typedef pm__list *pmaplist_ptr; /* results of PMAPPROC_DUMP */
134 %typedef struct pm__list pmaplist;
135 %typedef struct pm__list PMAPLIST;
140 % struct pmaplist *pml_next;
147 %extern bool_t xdr_pmaplist(XDR *, pmaplist**);
156 % * Arguments to callit
168 % * Client-side only representation of rmtcallargs structure.
170 % * The routine that XDRs the rmtcallargs structure must deal with the
171 % * opaque arguments in the "args" structure. xdr_rmtcall_args() needs to be
172 % * passed the XDR routine that knows the args' structure. This routine
173 % * doesn't need to go over-the-wire (and it wouldn't make sense anyway) since
174 % * the application being called knows the args structure already. So we use a
175 % * different "XDR" structure on the client side, p_rmtcallargs, which includes
176 % * the args' XDR routine.
178 %struct p_rmtcallargs {
186 % xdrproc_t xdr_args; /* encodes args */
189 #endif /* def RPC_HDR */
193 % * Results of callit
203 % * Client-side only representation of rmtcallres structure.
205 %struct p_rmtcallres {
211 % xdrproc_t xdr_res; /* decodes res */
214 #endif /* def RPC_HDR */
217 * Port mapper procedures
223 PMAPPROC_NULL(void) = 0;
226 PMAPPROC_SET(pmap) = 1;
229 PMAPPROC_UNSET(pmap) = 2;
232 PMAPPROC_GETPORT(pmap) = 3;
235 PMAPPROC_DUMP(void) = 4;
238 PMAPPROC_CALLIT(rmtcallargs) = 5;
243 %#define PMAPVERS_PROTO ((u_long)2)
244 %#define PMAPVERS_ORIG ((u_long)1)
246 %#else /* ndef _KERNEL */
248 %#include <rpc/pmap_rmt.h>
254 %#define PMAPPORT 111
257 % long unsigned pm_prog;
258 % long unsigned pm_vers;
259 % long unsigned pm_prot;
260 % long unsigned pm_port;
262 %typedef struct pmap PMAP;
263 %extern bool_t xdr_pmap (XDR *, struct pmap *);
266 % struct pmap pml_map;
267 % struct pmaplist *pml_next;
269 %typedef struct pmaplist PMAPLIST;
270 %typedef struct pmaplist *pmaplist_ptr;
277 %#endif /* ndef _KERNEL */