Dr Andrew Scott G7VAV

My photo
 
June 2025
Mo Tu We Th Fr Sa Su
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 1 2 3 4 5 6


yp.x
001: /* @(#)yp.x     2.1 88/08/01 4.0 RPCSRC */
002: 
003: /*
004:  * Copyright (c) 2010, Oracle America, Inc.
005:  *
006:  * Redistribution and use in source and binary forms, with or without
007:  * modification, are permitted provided that the following conditions are
008:  * met:
009:  *
010:  *     * Redistributions of source code must retain the above copyright
011:  *       notice, this list of conditions and the following disclaimer.
012:  *     * Redistributions in binary form must reproduce the above
013:  *       copyright notice, this list of conditions and the following
014:  *       disclaimer in the documentation and/or other materials
015:  *       provided with the distribution.
016:  *     * Neither the name of the "Oracle America, Inc." nor the names of its
017:  *       contributors may be used to endorse or promote products derived
018:  *       from this software without specific prior written permission.
019:  *
020:  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
021:  *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
022:  *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
023:  *   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
024:  *   COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
025:  *   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
026:  *   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
027:  *   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
028:  *   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
029:  *   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
030:  *   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
031:  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
032:  */
033: 
034: /*
035:  * Protocol description file for the Yellow Pages Service
036:  */
037: 
038: const YPMAXRECORD = 1024;
039: const YPMAXDOMAIN = 64;
040: const YPMAXMAP = 64;
041: const YPMAXPEER = 64;
042: 
043: 
044: enum ypstat {
045:         YP_TRUE         =  1,
046:         YP_NOMORE       =  2,
047:         YP_FALSE        =  0,
048:         YP_NOMAP        = -1,
049:         YP_NODOM        = -2,
050:         YP_NOKEY        = -3,
051:         YP_BADOP        = -4,
052:         YP_BADDB        = -5,
053:         YP_YPERR        = -6,
054:         YP_BADARGS      = -7,
055:         YP_VERS         = -8
056: };
057: 
058: 
059: enum ypxfrstat {
060:         YPXFR_SUCC      =  1,
061:         YPXFR_AGE       =  2,
062:         YPXFR_NOMAP     = -1,
063:         YPXFR_NODOM     = -2,
064:         YPXFR_RSRC      = -3,
065:         YPXFR_RPC       = -4,
066:         YPXFR_MADDR     = -5,
067:         YPXFR_YPERR     = -6,
068:         YPXFR_BADARGS   = -7,
069:         YPXFR_DBM       = -8,
070:         YPXFR_FILE      = -9,
071:         YPXFR_SKEW      = -10,
072:         YPXFR_CLEAR     = -11,
073:         YPXFR_FORCE     = -12,
074:         YPXFR_XFRERR    = -13,
075:         YPXFR_REFUSED   = -14
076: };
077: 
078: 
079: typedef string domainname<YPMAXDOMAIN>;
080: typedef string mapname<YPMAXMAP>;
081: typedef string peername<YPMAXPEER>;
082: typedef opaque keydat<YPMAXRECORD>;
083: typedef opaque valdat<YPMAXRECORD>;
084: 
085: 
086: struct ypmap_parms {
087:         domainname domain;
088:         mapname map;
089:         unsigned int ordernum;
090:         peername peer;
091: };
092: 
093: struct ypreq_key {
094:         domainname domain;
095:         mapname map;
096:         keydat key;
097: };
098: 
099: struct ypreq_nokey {
100:         domainname domain;
101:         mapname map;
102: };
103: 
104: struct ypreq_xfr {
105:         ypmap_parms map_parms;
106:         unsigned int transid;
107:         unsigned int prog;
108:         unsigned int port;
109: };
110: 
111: 
112: struct ypresp_val {
113:         ypstat stat;
114:         valdat val;
115: };
116: 
117: struct ypresp_key_val {
118:         ypstat stat;
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.  */
125:         keydat key;
126:         valdat val;
127: #else
128:         valdat val;
129:         keydat key;
130: #endif
131: };
132: 
133: 
134: struct ypresp_master {
135:         ypstat stat;
136:         peername peer;
137: };
138: 
139: struct ypresp_order {
140:         ypstat stat;
141:         unsigned int ordernum;
142: };
143: 
144: union ypresp_all switch (bool more) {
145: case TRUE:
146:         ypresp_key_val val;
147: case FALSE:
148:         void;
149: };
150: 
151: struct ypresp_xfr {
152:         unsigned int transid;
153:         ypxfrstat xfrstat;
154: };
155: 
156: struct ypmaplist {
157:         mapname map;
158:         ypmaplist *next;
159: };
160: 
161: struct ypresp_maplist {
162:         ypstat stat;
163:         ypmaplist *maps;
164: };
165: 
166: enum 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: 
185: struct 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: 
195: enum ypbind_resptype {
196:         YPBIND_SUCC_VAL = 1,
197:         YPBIND_FAIL_VAL = 2
198: };
199: 
200: struct ypbind_binding {
201:     opaque ypbind_binding_addr[4]; /* In network order */
202:     opaque ypbind_binding_port[2]; /* In network order */
203: };
204: 
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;
210: };
211: 
212: /* Detailed failure reason codes for response field ypbind_error*/
213: 
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 */
217: 
218: 
219: /*
220:  * Request data structure for ypbind "Set domain" procedure.
221:  */
222: struct ypbind_setdom {
223:         domainname ypsetdom_domain;
224:         ypbind_binding ypsetdom_binding;
225:         unsigned ypsetdom_vers;
226: };
227: 
228: 
229: /*
230:  * YP access protocol
231:  */
232: program YPPROG {
233:         version YPVERS {
234:                 void
235:                 YPPROC_NULL(void) = 0;
236: 
237:                 bool
238:                 YPPROC_DOMAIN(domainname) = 1;
239: 
240:                 bool
241:                 YPPROC_DOMAIN_NONACK(domainname) = 2;
242: 
243:                 ypresp_val
244:                 YPPROC_MATCH(ypreq_key) = 3;
245: 
246:                 ypresp_key_val
247:                 YPPROC_FIRST(ypreq_key) = 4;
248: 
249:                 ypresp_key_val
250:                 YPPROC_NEXT(ypreq_key) = 5;
251: 
252:                 ypresp_xfr
253:                 YPPROC_XFR(ypreq_xfr) = 6;
254: 
255:                 void
256:                 YPPROC_CLEAR(void) = 7;
257: 
258:                 ypresp_all
259:                 YPPROC_ALL(ypreq_nokey) = 8;
260: 
261:                 ypresp_master
262:                 YPPROC_MASTER(ypreq_nokey) = 9;
263: 
264:                 ypresp_order
265:                 YPPROC_ORDER(ypreq_nokey) = 10;
266: 
267:                 ypresp_maplist
268:                 YPPROC_MAPLIST(domainname) = 11;
269:         } = 2;
270: } = 100004;
271: 
272: 
273: /*
274:  * YPPUSHPROC_XFRRESP is the callback routine for result of YPPROC_XFR
275:  */
276: program YPPUSH_XFRRESPPROG {
277:         version YPPUSH_XFRRESPVERS {
278:                 void
279:                 YPPUSHPROC_NULL(void) = 0;
280: 
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.  */
288:                 yppushresp_xfr
289:                 YPPUSHPROC_XFRRESP(void) = 1;
290: #else
291:                 void
292:                 YPPUSHPROC_XFRRESP(yppushresp_xfr) = 1;
293: #endif
294:         } = 1;
295: } = 0x40000000; /* transient: could be anything up to 0x5fffffff */
296: 
297: /*
298:  * YP binding protocol
299:  */
300: program YPBINDPROG {
301:         version YPBINDVERS {
302:                 void
303:                 YPBINDPROC_NULL(void) = 0;
304: 
305:                 ypbind_resp
306:                 YPBINDPROC_DOMAIN(domainname) = 1;
307: 
308:                 void
309:                 YPBINDPROC_SETDOM(ypbind_setdom) = 2;
310:         } = 2;
311: } = 100007;
312: 


for client (none)
© Andrew Scott 2006 - 2025,
All Rights Reserved
http://www.andrew-scott.uk/
Andrew Scott
http://www.andrew-scott.co.uk/