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
36 const YPMAXRECORD = 1024;
37 const YPMAXDOMAIN = 64;
77 typedef string domainname<YPMAXDOMAIN>;
78 typedef string mapname<YPMAXMAP>;
79 typedef string peername<YPMAXPEER>;
80 typedef opaque keydat<YPMAXRECORD>;
81 typedef opaque valdat<YPMAXRECORD>;
87 unsigned int ordernum;
103 ypmap_parms map_parms;
104 unsigned int transid;
115 struct ypresp_key_val {
117 #ifdef STUPID_SUN_BUG
118 /* This is the form as distributed by Sun. But even the Sun NIS
119 servers expect the values in the other order. So their
120 implementation somehow must change the order internally. We
121 don't want to follow this bad example since the user should be
122 able to use rpcgen on this file. */
132 struct ypresp_master {
137 struct ypresp_order {
139 unsigned int ordernum;
142 union ypresp_all switch (bool more) {
150 unsigned int transid;
159 struct ypresp_maplist {
165 YPPUSH_SUCC = 1, /* Success */
166 YPPUSH_AGE = 2, /* Master's version not newer */
167 YPPUSH_NOMAP = -1, /* Can't find server for map */
168 YPPUSH_NODOM = -2, /* Domain not supported */
169 YPPUSH_RSRC = -3, /* Local resource alloc failure */
170 YPPUSH_RPC = -4, /* RPC failure talking to server */
171 YPPUSH_MADDR = -5, /* Can't get master address */
172 YPPUSH_YPERR = -6, /* YP server/map db error */
173 YPPUSH_BADARGS = -7, /* Request arguments bad */
174 YPPUSH_DBM = -8, /* Local dbm operation failed */
175 YPPUSH_FILE = -9, /* Local file I/O operation failed */
176 YPPUSH_SKEW = -10, /* Map version skew during transfer */
177 YPPUSH_CLEAR = -11, /* Can't send "Clear" req to local ypserv */
178 YPPUSH_FORCE = -12, /* No local order number in map use -f flag. */
179 YPPUSH_XFRERR = -13, /* ypxfr error */
180 YPPUSH_REFUSED = -14 /* Transfer request refused by ypserv */
183 struct yppushresp_xfr {
185 yppush_status status;
189 * Response structure and overall result status codes. Success and failure
190 * represent two separate response message types.
193 enum ypbind_resptype {
198 struct ypbind_binding {
199 opaque ypbind_binding_addr[4]; /* In network order */
200 opaque ypbind_binding_port[2]; /* In network order */
203 union ypbind_resp switch (ypbind_resptype ypbind_status) {
204 case YPBIND_FAIL_VAL:
205 unsigned ypbind_error;
206 case YPBIND_SUCC_VAL:
207 ypbind_binding ypbind_bindinfo;
210 /* Detailed failure reason codes for response field ypbind_error*/
212 const YPBIND_ERR_ERR = 1; /* Internal error */
213 const YPBIND_ERR_NOSERV = 2; /* No bound server for passed domain */
214 const YPBIND_ERR_RESC = 3; /* System resource allocation failure */
218 * Request data structure for ypbind "Set domain" procedure.
220 struct ypbind_setdom {
221 domainname ypsetdom_domain;
222 ypbind_binding ypsetdom_binding;
223 unsigned ypsetdom_vers;
233 YPPROC_NULL(void) = 0;
236 YPPROC_DOMAIN(domainname) = 1;
239 YPPROC_DOMAIN_NONACK(domainname) = 2;
242 YPPROC_MATCH(ypreq_key) = 3;
245 YPPROC_FIRST(ypreq_key) = 4;
248 YPPROC_NEXT(ypreq_key) = 5;
251 YPPROC_XFR(ypreq_xfr) = 6;
254 YPPROC_CLEAR(void) = 7;
257 YPPROC_ALL(ypreq_nokey) = 8;
260 YPPROC_MASTER(ypreq_nokey) = 9;
263 YPPROC_ORDER(ypreq_nokey) = 10;
266 YPPROC_MAPLIST(domainname) = 11;
272 * YPPUSHPROC_XFRRESP is the callback routine for result of YPPROC_XFR
274 program YPPUSH_XFRRESPPROG {
275 version YPPUSH_XFRRESPVERS {
277 YPPUSHPROC_NULL(void) = 0;
279 #ifdef STUPID_SUN_BUG
280 /* This is the form as distributed by Sun. But even
281 the Sun NIS servers expect the values in the other
282 order. So their implementation somehow must change
283 the order internally. We don't want to follow this
284 bad example since the user should be able to use
285 rpcgen on this file. */
287 YPPUSHPROC_XFRRESP(void) = 1;
290 YPPUSHPROC_XFRRESP(yppushresp_xfr) = 1;
293 } = 0x40000000; /* transient: could be anything up to 0x5fffffff */
296 * YP binding protocol
301 YPBINDPROC_NULL(void) = 0;
304 YPBINDPROC_DOMAIN(domainname) = 1;
307 YPBINDPROC_SETDOM(ypbind_setdom) = 2;