Deleted Added
full compact
yp.x (31305) yp.x (31387)
1/* @(#)yp.x 2.1 88/08/01 4.0 RPCSRC */
2
1/*
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.
8 *
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.
12 *
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.
16 *
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.
20 *
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.
24 *
25 * Sun Microsystems, Inc.
26 * 2550 Garcia Avenue
27 * Mountain View, California 94043
28 */
29
30/*
31 * Protocol description file for the Yellow Pages Service
32 */
33
34#ifndef RPC_HDR
35%#ifndef lint
36%static const char rcsid[] =
3/*
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.
10 *
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.
14 *
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.
18 *
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.
22 *
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.
26 *
27 * Sun Microsystems, Inc.
28 * 2550 Garcia Avenue
29 * Mountain View, California 94043
30 */
31
32/*
33 * Protocol description file for the Yellow Pages Service
34 */
35
36#ifndef RPC_HDR
37%#ifndef lint
38%static const char rcsid[] =
37% "$Id: yp.x,v 1.9 1997/10/31 12:26:52 charnier Exp $";
39% "$Id: yp.x,v 1.10 1997/11/20 07:18:07 charnier Exp $";
38%#endif /* not lint */
39#endif
40
41const YPMAXRECORD = 1024;
42const YPMAXDOMAIN = 64;
43const YPMAXMAP = 64;
44const YPMAXPEER = 64;
45
46
47enum ypstat {
48 YP_TRUE = 1,
49 YP_NOMORE = 2,
50 YP_FALSE = 0,
51 YP_NOMAP = -1,
52 YP_NODOM = -2,
53 YP_NOKEY = -3,
54 YP_BADOP = -4,
55 YP_BADDB = -5,
56 YP_YPERR = -6,
57 YP_BADARGS = -7,
58 YP_VERS = -8
59};
60
61
62enum ypxfrstat {
63 YPXFR_SUCC = 1,
64 YPXFR_AGE = 2,
65 YPXFR_NOMAP = -1,
66 YPXFR_NODOM = -2,
67 YPXFR_RSRC = -3,
68 YPXFR_RPC = -4,
69 YPXFR_MADDR = -5,
70 YPXFR_YPERR = -6,
71 YPXFR_BADARGS = -7,
72 YPXFR_DBM = -8,
73 YPXFR_FILE = -9,
74 YPXFR_SKEW = -10,
75 YPXFR_CLEAR = -11,
76 YPXFR_FORCE = -12,
77 YPXFR_XFRERR = -13,
78 YPXFR_REFUSED = -14
79};
80
81
82typedef string domainname<YPMAXDOMAIN>;
83typedef string mapname<YPMAXMAP>;
84typedef string peername<YPMAXPEER>;
85typedef opaque keydat<YPMAXRECORD>;
86typedef opaque valdat<YPMAXRECORD>;
87
88
89struct ypmap_parms {
90 domainname domain;
91 mapname map;
92 unsigned int ordernum;
93 peername peer;
94};
95
96struct ypreq_key {
97 domainname domain;
98 mapname map;
99 keydat key;
100};
101
102struct ypreq_nokey {
103 domainname domain;
104 mapname map;
105};
106
107struct ypreq_xfr {
108 ypmap_parms map_parms;
109 unsigned int transid;
110 unsigned int prog;
111 unsigned int port;
112};
113
114
115struct ypresp_val {
116 ypstat stat;
117 valdat val;
118};
119
120struct ypresp_key_val {
121 ypstat stat;
122#ifdef STUPID_SUN_BUG /* These are backwards */
123 keydat key;
124 valdat val;
125#else
126 valdat val;
127 keydat key;
128#endif
129};
130
131
132struct ypresp_master {
133 ypstat stat;
134 peername peer;
135};
136
137struct ypresp_order {
138 ypstat stat;
139 unsigned int ordernum;
140};
141
142union ypresp_all switch (bool more) {
143case TRUE:
144 ypresp_key_val val;
145case FALSE:
146 void;
147};
148
149struct ypresp_xfr {
150 unsigned int transid;
151 ypxfrstat xfrstat;
152};
153
154struct ypmaplist {
155 mapname map;
156 ypmaplist *next;
157};
158
159struct ypresp_maplist {
160 ypstat stat;
161 ypmaplist *maps;
162};
163
164enum yppush_status {
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 */
181};
182
183struct yppushresp_xfr {
184 unsigned transid;
185 yppush_status status;
186};
187
188/*
189 * Response structure and overall result status codes. Success and failure
190 * represent two separate response message types.
191 */
192
193enum ypbind_resptype {
194 YPBIND_SUCC_VAL = 1,
195 YPBIND_FAIL_VAL = 2
196};
197
198struct ypbind_binding {
199 opaque ypbind_binding_addr[4]; /* In network order */
200 opaque ypbind_binding_port[2]; /* In network order */
201};
202
203union ypbind_resp switch (ypbind_resptype ypbind_status) {
204case YPBIND_FAIL_VAL:
205 unsigned ypbind_error;
206case YPBIND_SUCC_VAL:
207 ypbind_binding ypbind_bindinfo;
208};
209
210/* Detailed failure reason codes for response field ypbind_error*/
211
212const YPBIND_ERR_ERR = 1; /* Internal error */
213const YPBIND_ERR_NOSERV = 2; /* No bound server for passed domain */
214const YPBIND_ERR_RESC = 3; /* System resource allocation failure */
215
216
217/*
218 * Request data structure for ypbind "Set domain" procedure.
219 */
220struct ypbind_setdom {
221 domainname ypsetdom_domain;
222 ypbind_binding ypsetdom_binding;
223 unsigned ypsetdom_vers;
224};
225
226
227/*
228 * NIS v1 support for backwards compatibility
229 */
230enum ypreqtype {
231 YPREQ_KEY = 1,
232 YPREQ_NOKEY = 2,
233 YPREQ_MAP_PARMS = 3
234};
235
236enum ypresptype {
237 YPRESP_VAL = 1,
238 YPRESP_KEY_VAL = 2,
239 YPRESP_MAP_PARMS = 3
240};
241
242union yprequest switch (ypreqtype yp_reqtype) {
243case YPREQ_KEY:
244 ypreq_key yp_req_keytype;
245case YPREQ_NOKEY:
246 ypreq_nokey yp_req_nokeytype;
247case YPREQ_MAP_PARMS:
248 ypmap_parms yp_req_map_parmstype;
249};
250
251union ypresponse switch (ypresptype yp_resptype) {
252case YPRESP_VAL:
253 ypresp_val yp_resp_valtype;
254case YPRESP_KEY_VAL:
255 ypresp_key_val yp_resp_key_valtype;
256case YPRESP_MAP_PARMS:
257 ypmap_parms yp_resp_map_parmstype;
258};
259
260#if !defined(YPBIND_ONLY) && !defined(YPPUSH_ONLY)
261/*
262 * YP access protocol
263 */
264program YPPROG {
265/*
266 * NIS v1 support for backwards compatibility
267 */
268 version YPOLDVERS {
269 void
270 YPOLDPROC_NULL(void) = 0;
271
272 bool
273 YPOLDPROC_DOMAIN(domainname) = 1;
274
275 bool
276 YPOLDPROC_DOMAIN_NONACK(domainname) = 2;
277
278 ypresponse
279 YPOLDPROC_MATCH(yprequest) = 3;
280
281 ypresponse
282 YPOLDPROC_FIRST(yprequest) = 4;
283
284 ypresponse
285 YPOLDPROC_NEXT(yprequest) = 5;
286
287 ypresponse
288 YPOLDPROC_POLL(yprequest) = 6;
289
290 ypresponse
291 YPOLDPROC_PUSH(yprequest) = 7;
292
293 ypresponse
294 YPOLDPROC_PULL(yprequest) = 8;
295
296 ypresponse
297 YPOLDPROC_GET(yprequest) = 9;
298 } = 1;
299
300 version YPVERS {
301 void
302 YPPROC_NULL(void) = 0;
303
304 bool
305 YPPROC_DOMAIN(domainname) = 1;
306
307 bool
308 YPPROC_DOMAIN_NONACK(domainname) = 2;
309
310 ypresp_val
311 YPPROC_MATCH(ypreq_key) = 3;
312
313 ypresp_key_val
314#ifdef STUPID_SUN_BUG /* should be ypreq_nokey */
315 YPPROC_FIRST(ypreq_key) = 4;
316#else
317 YPPROC_FIRST(ypreq_nokey) = 4;
318#endif
319 ypresp_key_val
320 YPPROC_NEXT(ypreq_key) = 5;
321
322 ypresp_xfr
323 YPPROC_XFR(ypreq_xfr) = 6;
324
325 void
326 YPPROC_CLEAR(void) = 7;
327
328 ypresp_all
329 YPPROC_ALL(ypreq_nokey) = 8;
330
331 ypresp_master
332 YPPROC_MASTER(ypreq_nokey) = 9;
333
334 ypresp_order
335 YPPROC_ORDER(ypreq_nokey) = 10;
336
337 ypresp_maplist
338 YPPROC_MAPLIST(domainname) = 11;
339 } = 2;
340} = 100004;
341#endif
342#if !defined(YPSERV_ONLY) && !defined(YPBIND_ONLY)
343/*
344 * YPPUSHPROC_XFRRESP is the callback routine for result of YPPROC_XFR
345 */
346program YPPUSH_XFRRESPPROG {
347 version YPPUSH_XFRRESPVERS {
348 void
349 YPPUSHPROC_NULL(void) = 0;
350#ifdef STUPID_SUN_BUG /* argument and return value are backwards */
351 yppushresp_xfr
352 YPPUSHPROC_XFRRESP(void) = 1;
353#else
354 void
355 YPPUSHPROC_XFRRESP(yppushresp_xfr) = 1;
356#endif
357 } = 1;
358} = 0x40000000; /* transient: could be anything up to 0x5fffffff */
359#endif
360#if !defined(YPSERV_ONLY) && !defined(YPPUSH_ONLY)
361/*
362 * YP binding protocol
363 */
364program YPBINDPROG {
365 version YPBINDVERS {
366 void
367 YPBINDPROC_NULL(void) = 0;
368
369 ypbind_resp
370 YPBINDPROC_DOMAIN(domainname) = 1;
371
372 void
373 YPBINDPROC_SETDOM(ypbind_setdom) = 2;
374 } = 2;
375} = 100007;
376
377#endif
40%#endif /* not lint */
41#endif
42
43const YPMAXRECORD = 1024;
44const YPMAXDOMAIN = 64;
45const YPMAXMAP = 64;
46const YPMAXPEER = 64;
47
48
49enum ypstat {
50 YP_TRUE = 1,
51 YP_NOMORE = 2,
52 YP_FALSE = 0,
53 YP_NOMAP = -1,
54 YP_NODOM = -2,
55 YP_NOKEY = -3,
56 YP_BADOP = -4,
57 YP_BADDB = -5,
58 YP_YPERR = -6,
59 YP_BADARGS = -7,
60 YP_VERS = -8
61};
62
63
64enum ypxfrstat {
65 YPXFR_SUCC = 1,
66 YPXFR_AGE = 2,
67 YPXFR_NOMAP = -1,
68 YPXFR_NODOM = -2,
69 YPXFR_RSRC = -3,
70 YPXFR_RPC = -4,
71 YPXFR_MADDR = -5,
72 YPXFR_YPERR = -6,
73 YPXFR_BADARGS = -7,
74 YPXFR_DBM = -8,
75 YPXFR_FILE = -9,
76 YPXFR_SKEW = -10,
77 YPXFR_CLEAR = -11,
78 YPXFR_FORCE = -12,
79 YPXFR_XFRERR = -13,
80 YPXFR_REFUSED = -14
81};
82
83
84typedef string domainname<YPMAXDOMAIN>;
85typedef string mapname<YPMAXMAP>;
86typedef string peername<YPMAXPEER>;
87typedef opaque keydat<YPMAXRECORD>;
88typedef opaque valdat<YPMAXRECORD>;
89
90
91struct ypmap_parms {
92 domainname domain;
93 mapname map;
94 unsigned int ordernum;
95 peername peer;
96};
97
98struct ypreq_key {
99 domainname domain;
100 mapname map;
101 keydat key;
102};
103
104struct ypreq_nokey {
105 domainname domain;
106 mapname map;
107};
108
109struct ypreq_xfr {
110 ypmap_parms map_parms;
111 unsigned int transid;
112 unsigned int prog;
113 unsigned int port;
114};
115
116
117struct ypresp_val {
118 ypstat stat;
119 valdat val;
120};
121
122struct ypresp_key_val {
123 ypstat stat;
124#ifdef STUPID_SUN_BUG /* These are backwards */
125 keydat key;
126 valdat val;
127#else
128 valdat val;
129 keydat key;
130#endif
131};
132
133
134struct ypresp_master {
135 ypstat stat;
136 peername peer;
137};
138
139struct ypresp_order {
140 ypstat stat;
141 unsigned int ordernum;
142};
143
144union ypresp_all switch (bool more) {
145case TRUE:
146 ypresp_key_val val;
147case FALSE:
148 void;
149};
150
151struct ypresp_xfr {
152 unsigned int transid;
153 ypxfrstat xfrstat;
154};
155
156struct ypmaplist {
157 mapname map;
158 ypmaplist *next;
159};
160
161struct ypresp_maplist {
162 ypstat stat;
163 ypmaplist *maps;
164};
165
166enum yppush_status {
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 */
183};
184
185struct yppushresp_xfr {
186 unsigned transid;
187 yppush_status status;
188};
189
190/*
191 * Response structure and overall result status codes. Success and failure
192 * represent two separate response message types.
193 */
194
195enum ypbind_resptype {
196 YPBIND_SUCC_VAL = 1,
197 YPBIND_FAIL_VAL = 2
198};
199
200struct ypbind_binding {
201 opaque ypbind_binding_addr[4]; /* In network order */
202 opaque ypbind_binding_port[2]; /* In network order */
203};
204
205union ypbind_resp switch (ypbind_resptype ypbind_status) {
206case YPBIND_FAIL_VAL:
207 unsigned ypbind_error;
208case YPBIND_SUCC_VAL:
209 ypbind_binding ypbind_bindinfo;
210};
211
212/* Detailed failure reason codes for response field ypbind_error*/
213
214const YPBIND_ERR_ERR = 1; /* Internal error */
215const YPBIND_ERR_NOSERV = 2; /* No bound server for passed domain */
216const YPBIND_ERR_RESC = 3; /* System resource allocation failure */
217
218
219/*
220 * Request data structure for ypbind "Set domain" procedure.
221 */
222struct ypbind_setdom {
223 domainname ypsetdom_domain;
224 ypbind_binding ypsetdom_binding;
225 unsigned ypsetdom_vers;
226};
227
228
229/*
230 * NIS v1 support for backwards compatibility
231 */
232enum ypreqtype {
233 YPREQ_KEY = 1,
234 YPREQ_NOKEY = 2,
235 YPREQ_MAP_PARMS = 3
236};
237
238enum ypresptype {
239 YPRESP_VAL = 1,
240 YPRESP_KEY_VAL = 2,
241 YPRESP_MAP_PARMS = 3
242};
243
244union yprequest switch (ypreqtype yp_reqtype) {
245case YPREQ_KEY:
246 ypreq_key yp_req_keytype;
247case YPREQ_NOKEY:
248 ypreq_nokey yp_req_nokeytype;
249case YPREQ_MAP_PARMS:
250 ypmap_parms yp_req_map_parmstype;
251};
252
253union ypresponse switch (ypresptype yp_resptype) {
254case YPRESP_VAL:
255 ypresp_val yp_resp_valtype;
256case YPRESP_KEY_VAL:
257 ypresp_key_val yp_resp_key_valtype;
258case YPRESP_MAP_PARMS:
259 ypmap_parms yp_resp_map_parmstype;
260};
261
262#if !defined(YPBIND_ONLY) && !defined(YPPUSH_ONLY)
263/*
264 * YP access protocol
265 */
266program YPPROG {
267/*
268 * NIS v1 support for backwards compatibility
269 */
270 version YPOLDVERS {
271 void
272 YPOLDPROC_NULL(void) = 0;
273
274 bool
275 YPOLDPROC_DOMAIN(domainname) = 1;
276
277 bool
278 YPOLDPROC_DOMAIN_NONACK(domainname) = 2;
279
280 ypresponse
281 YPOLDPROC_MATCH(yprequest) = 3;
282
283 ypresponse
284 YPOLDPROC_FIRST(yprequest) = 4;
285
286 ypresponse
287 YPOLDPROC_NEXT(yprequest) = 5;
288
289 ypresponse
290 YPOLDPROC_POLL(yprequest) = 6;
291
292 ypresponse
293 YPOLDPROC_PUSH(yprequest) = 7;
294
295 ypresponse
296 YPOLDPROC_PULL(yprequest) = 8;
297
298 ypresponse
299 YPOLDPROC_GET(yprequest) = 9;
300 } = 1;
301
302 version YPVERS {
303 void
304 YPPROC_NULL(void) = 0;
305
306 bool
307 YPPROC_DOMAIN(domainname) = 1;
308
309 bool
310 YPPROC_DOMAIN_NONACK(domainname) = 2;
311
312 ypresp_val
313 YPPROC_MATCH(ypreq_key) = 3;
314
315 ypresp_key_val
316#ifdef STUPID_SUN_BUG /* should be ypreq_nokey */
317 YPPROC_FIRST(ypreq_key) = 4;
318#else
319 YPPROC_FIRST(ypreq_nokey) = 4;
320#endif
321 ypresp_key_val
322 YPPROC_NEXT(ypreq_key) = 5;
323
324 ypresp_xfr
325 YPPROC_XFR(ypreq_xfr) = 6;
326
327 void
328 YPPROC_CLEAR(void) = 7;
329
330 ypresp_all
331 YPPROC_ALL(ypreq_nokey) = 8;
332
333 ypresp_master
334 YPPROC_MASTER(ypreq_nokey) = 9;
335
336 ypresp_order
337 YPPROC_ORDER(ypreq_nokey) = 10;
338
339 ypresp_maplist
340 YPPROC_MAPLIST(domainname) = 11;
341 } = 2;
342} = 100004;
343#endif
344#if !defined(YPSERV_ONLY) && !defined(YPBIND_ONLY)
345/*
346 * YPPUSHPROC_XFRRESP is the callback routine for result of YPPROC_XFR
347 */
348program YPPUSH_XFRRESPPROG {
349 version YPPUSH_XFRRESPVERS {
350 void
351 YPPUSHPROC_NULL(void) = 0;
352#ifdef STUPID_SUN_BUG /* argument and return value are backwards */
353 yppushresp_xfr
354 YPPUSHPROC_XFRRESP(void) = 1;
355#else
356 void
357 YPPUSHPROC_XFRRESP(yppushresp_xfr) = 1;
358#endif
359 } = 1;
360} = 0x40000000; /* transient: could be anything up to 0x5fffffff */
361#endif
362#if !defined(YPSERV_ONLY) && !defined(YPPUSH_ONLY)
363/*
364 * YP binding protocol
365 */
366program YPBINDPROG {
367 version YPBINDVERS {
368 void
369 YPBINDPROC_NULL(void) = 0;
370
371 ypbind_resp
372 YPBINDPROC_DOMAIN(domainname) = 1;
373
374 void
375 YPBINDPROC_SETDOM(ypbind_setdom) = 2;
376 } = 2;
377} = 100007;
378
379#endif