1 /* @(#)yp.x 2.1 88/08/01 4.0 RPCSRC */
4 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
5 * unrestricted use provided that this legend is included on all tape
6 * media and as a part of the software program in whole or part. Users
7 * may copy or modify Sun RPC without charge, but are not authorized
8 * to license or distribute it to anyone else except as part of a product or
9 * program developed by the user.
11 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
12 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
13 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
15 * Sun RPC is provided with no support and without any obligation on the
16 * part of Sun Microsystems, Inc. to assist in its use, correction,
17 * modification or enhancement.
19 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
20 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
21 * OR ANY PART THEREOF.
23 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
24 * or profits or other special, indirect and consequential damages, even if
25 * Sun has been advised of the possibility of such damages.
27 * Sun Microsystems, Inc.
29 * Mountain View, California 94043
33 * Protocol description file for the Yellow Pages Service
38 %static const char rcsid[] =
39 % "$FreeBSD: src/include/rpcsvc/yp.x,v 1.12 1999/08/27 23:45:12 peter Exp $";
40 %#endif /* not lint */
43 const YPMAXRECORD = 1024;
44 const YPMAXDOMAIN = 64;
84 typedef string domainname<YPMAXDOMAIN>;
85 typedef string mapname<YPMAXMAP>;
86 typedef string peername<YPMAXPEER>;
87 typedef opaque keydat<YPMAXRECORD>;
88 typedef opaque valdat<YPMAXRECORD>;
94 unsigned int ordernum;
110 ypmap_parms map_parms;
111 unsigned int transid;
122 struct ypresp_key_val {
124 #ifdef STUPID_SUN_BUG /* These are backwards */
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;
230 * NIS v1 support for backwards compatibility
244 union yprequest switch (ypreqtype yp_reqtype) {
246 ypreq_key yp_req_keytype;
248 ypreq_nokey yp_req_nokeytype;
249 case YPREQ_MAP_PARMS:
250 ypmap_parms yp_req_map_parmstype;
253 union ypresponse switch (ypresptype yp_resptype) {
255 ypresp_val yp_resp_valtype;
257 ypresp_key_val yp_resp_key_valtype;
258 case YPRESP_MAP_PARMS:
259 ypmap_parms yp_resp_map_parmstype;
262 #if !defined(YPBIND_ONLY) && !defined(YPPUSH_ONLY)
268 * NIS v1 support for backwards compatibility
272 YPOLDPROC_NULL(void) = 0;
275 YPOLDPROC_DOMAIN(domainname) = 1;
278 YPOLDPROC_DOMAIN_NONACK(domainname) = 2;
281 YPOLDPROC_MATCH(yprequest) = 3;
284 YPOLDPROC_FIRST(yprequest) = 4;
287 YPOLDPROC_NEXT(yprequest) = 5;
290 YPOLDPROC_POLL(yprequest) = 6;
293 YPOLDPROC_PUSH(yprequest) = 7;
296 YPOLDPROC_PULL(yprequest) = 8;
299 YPOLDPROC_GET(yprequest) = 9;
304 YPPROC_NULL(void) = 0;
307 YPPROC_DOMAIN(domainname) = 1;
310 YPPROC_DOMAIN_NONACK(domainname) = 2;
313 YPPROC_MATCH(ypreq_key) = 3;
316 #ifdef STUPID_SUN_BUG /* should be ypreq_nokey */
317 YPPROC_FIRST(ypreq_key) = 4;
319 YPPROC_FIRST(ypreq_nokey) = 4;
322 YPPROC_NEXT(ypreq_key) = 5;
325 YPPROC_XFR(ypreq_xfr) = 6;
328 YPPROC_CLEAR(void) = 7;
331 YPPROC_ALL(ypreq_nokey) = 8;
334 YPPROC_MASTER(ypreq_nokey) = 9;
337 YPPROC_ORDER(ypreq_nokey) = 10;
340 YPPROC_MAPLIST(domainname) = 11;
344 #if !defined(YPSERV_ONLY) && !defined(YPBIND_ONLY)
346 * YPPUSHPROC_XFRRESP is the callback routine for result of YPPROC_XFR
348 program YPPUSH_XFRRESPPROG {
349 version YPPUSH_XFRRESPVERS {
351 YPPUSHPROC_NULL(void) = 0;
352 #ifdef STUPID_SUN_BUG /* argument and return value are backwards */
354 YPPUSHPROC_XFRRESP(void) = 1;
357 YPPUSHPROC_XFRRESP(yppushresp_xfr) = 1;
360 } = 0x40000000; /* transient: could be anything up to 0x5fffffff */
362 #if !defined(YPSERV_ONLY) && !defined(YPPUSH_ONLY)
364 * YP binding protocol
369 YPBINDPROC_NULL(void) = 0;
372 YPBINDPROC_DOMAIN(domainname) = 1;
375 YPBINDPROC_SETDOM(ypbind_setdom) = 2;