1 /* @(#)yp.x 2.1 88/08/01 4.0 RPCSRC */
4 * Copyright (c) 2010, Oracle America, Inc.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * * Redistributions in binary form must reproduce the above
13 * copyright notice, this list of conditions and the following
14 * disclaimer in the documentation and/or other materials
15 * provided with the distribution.
16 * * Neither the name of the "Oracle America, Inc." nor the names of its
17 * contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
25 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
27 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 * Protocol description file for the Yellow Pages Service
38 const YPMAXRECORD = 1024;
39 const YPMAXDOMAIN = 64;
79 typedef string domainname<YPMAXDOMAIN>;
80 typedef string mapname<YPMAXMAP>;
81 typedef string peername<YPMAXPEER>;
82 typedef opaque keydat<YPMAXRECORD>;
83 typedef opaque valdat<YPMAXRECORD>;
89 unsigned int ordernum;
105 ypmap_parms map_parms;
106 unsigned int transid;
117 struct ypresp_key_val {
119 #ifdef STUPID_SUN_BUG
120 /* This is the form as distributed by Sun. But even the Sun NIS
121 servers expect the values in the other order. So their
122 implementation somehow must change the order internally. We
123 don't want to follow this bad example since the user should be
124 able to use rpcgen on this file. */
134 struct ypresp_master {
139 struct ypresp_order {
141 unsigned int ordernum;
144 union ypresp_all switch (bool more) {
152 unsigned int transid;
161 struct ypresp_maplist {
167 YPPUSH_SUCC = 1, /* Success */
168 YPPUSH_AGE = 2, /* Master's version not newer */
169 YPPUSH_NOMAP = -1, /* Can't find server for map */
170 YPPUSH_NODOM = -2, /* Domain not supported */
171 YPPUSH_RSRC = -3, /* Local resource alloc failure */
172 YPPUSH_RPC = -4, /* RPC failure talking to server */
173 YPPUSH_MADDR = -5, /* Can't get master address */
174 YPPUSH_YPERR = -6, /* YP server/map db error */
175 YPPUSH_BADARGS = -7, /* Request arguments bad */
176 YPPUSH_DBM = -8, /* Local dbm operation failed */
177 YPPUSH_FILE = -9, /* Local file I/O operation failed */
178 YPPUSH_SKEW = -10, /* Map version skew during transfer */
179 YPPUSH_CLEAR = -11, /* Can't send "Clear" req to local ypserv */
180 YPPUSH_FORCE = -12, /* No local order number in map use -f flag. */
181 YPPUSH_XFRERR = -13, /* ypxfr error */
182 YPPUSH_REFUSED = -14 /* Transfer request refused by ypserv */
185 struct yppushresp_xfr {
187 yppush_status status;
191 * Response structure and overall result status codes. Success and failure
192 * represent two separate response message types.
195 enum ypbind_resptype {
200 struct ypbind_binding {
201 opaque ypbind_binding_addr[4]; /* In network order */
202 opaque ypbind_binding_port[2]; /* In network order */
205 union ypbind_resp switch (ypbind_resptype ypbind_status) {
206 case YPBIND_FAIL_VAL:
207 unsigned ypbind_error;
208 case YPBIND_SUCC_VAL:
209 ypbind_binding ypbind_bindinfo;
212 /* Detailed failure reason codes for response field ypbind_error*/
214 const YPBIND_ERR_ERR = 1; /* Internal error */
215 const YPBIND_ERR_NOSERV = 2; /* No bound server for passed domain */
216 const YPBIND_ERR_RESC = 3; /* System resource allocation failure */
220 * Request data structure for ypbind "Set domain" procedure.
222 struct ypbind_setdom {
223 domainname ypsetdom_domain;
224 ypbind_binding ypsetdom_binding;
225 unsigned ypsetdom_vers;
235 YPPROC_NULL(void) = 0;
238 YPPROC_DOMAIN(domainname) = 1;
241 YPPROC_DOMAIN_NONACK(domainname) = 2;
244 YPPROC_MATCH(ypreq_key) = 3;
247 YPPROC_FIRST(ypreq_key) = 4;
250 YPPROC_NEXT(ypreq_key) = 5;
253 YPPROC_XFR(ypreq_xfr) = 6;
256 YPPROC_CLEAR(void) = 7;
259 YPPROC_ALL(ypreq_nokey) = 8;
262 YPPROC_MASTER(ypreq_nokey) = 9;
265 YPPROC_ORDER(ypreq_nokey) = 10;
268 YPPROC_MAPLIST(domainname) = 11;
274 * YPPUSHPROC_XFRRESP is the callback routine for result of YPPROC_XFR
276 program YPPUSH_XFRRESPPROG {
277 version YPPUSH_XFRRESPVERS {
279 YPPUSHPROC_NULL(void) = 0;
281 #ifdef STUPID_SUN_BUG
282 /* This is the form as distributed by Sun. But even
283 the Sun NIS servers expect the values in the other
284 order. So their implementation somehow must change
285 the order internally. We don't want to follow this
286 bad example since the user should be able to use
287 rpcgen on this file. */
289 YPPUSHPROC_XFRRESP(void) = 1;
292 YPPUSHPROC_XFRRESP(yppushresp_xfr) = 1;
295 } = 0x40000000; /* transient: could be anything up to 0x5fffffff */
298 * YP binding protocol
303 YPBINDPROC_NULL(void) = 0;
306 YPBINDPROC_DOMAIN(domainname) = 1;
309 YPBINDPROC_SETDOM(ypbind_setdom) = 2;