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.
27 * Mountain View, California 94043
31 * Protocol description file for the Yellow Pages Service
35 %#include <sys/cdefs.h>
37 %/*static char sccsid[] = "from: @(#)yp.x 2.1 88/08/01 4.0 RPCSRC";*/
38 %__RCSID("$NetBSD: yp.x,v 1.4 1999/07/02 15:44:13 simonb Exp $");
39 %#endif /* not __lint__ */
42 const YPMAXRECORD = 1024;
43 const YPMAXDOMAIN = 64;
83 typedef string domainname<YPMAXDOMAIN>;
84 typedef string mapname<YPMAXMAP>;
85 typedef string peername<YPMAXPEER>;
86 typedef opaque keydat<YPMAXRECORD>;
87 typedef opaque valdat<YPMAXRECORD>;
93 unsigned int ordernum;
109 ypmap_parms map_parms;
110 unsigned int transid;
121 struct ypresp_key_val {
128 struct ypresp_master {
133 struct ypresp_order {
135 unsigned int ordernum;
138 union ypresp_all switch (bool more) {
146 unsigned int transid;
155 struct ypresp_maplist {
161 YPPUSH_SUCC = 1, /* Success */
162 YPPUSH_AGE = 2, /* Master's version not newer */
163 YPPUSH_NOMAP = -1, /* Can't find server for map */
164 YPPUSH_NODOM = -2, /* Domain not supported */
165 YPPUSH_RSRC = -3, /* Local resource alloc failure */
166 YPPUSH_RPC = -4, /* RPC failure talking to server */
167 YPPUSH_MADDR = -5, /* Can't get master address */
168 YPPUSH_YPERR = -6, /* YP server/map db error */
169 YPPUSH_BADARGS = -7, /* Request arguments bad */
170 YPPUSH_DBM = -8, /* Local dbm operation failed */
171 YPPUSH_FILE = -9, /* Local file I/O operation failed */
172 YPPUSH_SKEW = -10, /* Map version skew during transfer */
173 YPPUSH_CLEAR = -11, /* Can't send "Clear" req to local ypserv */
174 YPPUSH_FORCE = -12, /* No local order number in map use -f flag. */
175 YPPUSH_XFRERR = -13, /* ypxfr error */
176 YPPUSH_REFUSED = -14 /* Transfer request refused by ypserv */
179 struct yppushresp_xfr {
181 yppush_status status;
185 * Response structure and overall result status codes. Success and failure
186 * represent two separate response message types.
189 enum ypbind_resptype {
194 struct ypbind_binding {
195 opaque ypbind_binding_addr[4]; /* In network order */
196 opaque ypbind_binding_port[2]; /* In network order */
199 union ypbind_resp switch (ypbind_resptype ypbind_status) {
200 case YPBIND_FAIL_VAL:
201 unsigned ypbind_error;
202 case YPBIND_SUCC_VAL:
203 ypbind_binding ypbind_bindinfo;
206 /* Detailed failure reason codes for response field ypbind_error*/
208 const YPBIND_ERR_ERR = 1; /* Internal error */
209 const YPBIND_ERR_NOSERV = 2; /* No bound server for passed domain */
210 const YPBIND_ERR_RESC = 3; /* System resource allocation failure */
214 * Request data structure for ypbind "Set domain" procedure.
216 struct ypbind_setdom {
217 domainname ypsetdom_domain;
218 ypbind_binding ypsetdom_binding;
219 unsigned ypsetdom_vers;
229 YPPROC_NULL(void) = 0;
232 YPPROC_DOMAIN(domainname) = 1;
235 YPPROC_DOMAIN_NONACK(domainname) = 2;
238 YPPROC_MATCH(ypreq_key) = 3;
241 YPPROC_FIRST(ypreq_key) = 4;
244 YPPROC_NEXT(ypreq_key) = 5;
247 YPPROC_XFR(ypreq_xfr) = 6;
250 YPPROC_CLEAR(void) = 7;
253 YPPROC_ALL(ypreq_nokey) = 8;
256 YPPROC_MASTER(ypreq_nokey) = 9;
259 YPPROC_ORDER(ypreq_nokey) = 10;
262 YPPROC_MAPLIST(domainname) = 11;
268 * YPPUSHPROC_XFRRESP is the callback routine for result of YPPROC_XFR
270 program YPPUSH_XFRRESPPROG {
271 version YPPUSH_XFRRESPVERS {
273 YPPUSHPROC_NULL(void) = 0;
276 YPPUSHPROC_XFRRESP(void) = 1;
278 } = 0x40000000; /* transient: could be anything up to 0x5fffffff */
282 * YP binding protocol
287 YPBINDPROC_NULL(void) = 0;
290 YPBINDPROC_DOMAIN(domainname) = 1;
293 YPBINDPROC_SETDOM(ypbind_setdom) = 2;