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.h
001: /*
002:  * Copyright (c) 2010, Oracle America, Inc.
003:  *
004:  * Redistribution and use in source and binary forms, with or without
005:  * modification, are permitted provided that the following conditions are
006:  * met:
007:  *
008:  *     * Redistributions of source code must retain the above copyright
009:  *       notice, this list of conditions and the following disclaimer.
010:  *     * Redistributions in binary form must reproduce the above
011:  *       copyright notice, this list of conditions and the following
012:  *       disclaimer in the documentation and/or other materials
013:  *       provided with the distribution.
014:  *     * Neither the name of the "Oracle America, Inc." nor the names of its
015:  *       contributors may be used to endorse or promote products derived
016:  *       from this software without specific prior written permission.
017:  *
018:  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
019:  *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
020:  *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
021:  *   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
022:  *   COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
023:  *   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
024:  *   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
025:  *   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
026:  *   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
027:  *   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
028:  *   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
029:  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
030:  */
031: 
032: #ifndef __RPCSVC_YP_H__
033: #define __RPCSVC_YP_H__
034: 
035: #include <features.h>
036: #include <rpc/rpc.h>
037: 
038: #define YPMAXRECORD 1024
039: #define YPMAXDOMAIN 64
040: #define YPMAXMAP 64
041: #define YPMAXPEER 64
042: 
043: enum ypstat {
044:         YP_TRUE = 1,
045:         YP_NOMORE = 2,
046:         YP_FALSE = 0,
047:         YP_NOMAP = -1,
048:         YP_NODOM = -2,
049:         YP_NOKEY = -3,
050:         YP_BADOP = -4,
051:         YP_BADDB = -5,
052:         YP_YPERR = -6,
053:         YP_BADARGS = -7,
054:         YP_VERS = -8,
055: };
056: typedef enum ypstat ypstat;
057: 
058: enum ypxfrstat {
059:         YPXFR_SUCC = 1,
060:         YPXFR_AGE = 2,
061:         YPXFR_NOMAP = -1,
062:         YPXFR_NODOM = -2,
063:         YPXFR_RSRC = -3,
064:         YPXFR_RPC = -4,
065:         YPXFR_MADDR = -5,
066:         YPXFR_YPERR = -6,
067:         YPXFR_BADARGS = -7,
068:         YPXFR_DBM = -8,
069:         YPXFR_FILE = -9,
070:         YPXFR_SKEW = -10,
071:         YPXFR_CLEAR = -11,
072:         YPXFR_FORCE = -12,
073:         YPXFR_XFRERR = -13,
074:         YPXFR_REFUSED = -14,
075: };
076: typedef enum ypxfrstat ypxfrstat;
077: 
078: typedef char *domainname;
079: typedef char *mapname;
080: typedef char *peername;
081: 
082: typedef struct {
083:   u_int keydat_len;
084:   char *keydat_val;
085: } keydat;
086: 
087: typedef struct {
088:   u_int valdat_len;
089:   char *valdat_val;
090: } valdat;
091: 
092: struct ypmap_parms {
093:   domainname domain;
094:   mapname map;
095:   u_int ordernum;
096:   peername peer;
097: };
098: typedef struct ypmap_parms ypmap_parms;
099: 
100: struct ypreq_key {
101:   domainname domain;
102:   mapname map;
103:   keydat key;
104: };
105: typedef struct ypreq_key ypreq_key;
106: 
107: struct ypreq_nokey {
108:   domainname domain;
109:   mapname map;
110: };
111: typedef struct ypreq_nokey ypreq_nokey;
112: 
113: struct ypreq_xfr {
114:   ypmap_parms map_parms;
115:   u_int transid;
116:   u_int prog;
117:   u_int port;
118: };
119: typedef struct ypreq_xfr ypreq_xfr;
120: 
121: struct ypresp_val {
122:   ypstat stat;
123:   valdat val;
124: };
125: typedef struct ypresp_val ypresp_val;
126: 
127: struct ypresp_key_val {
128:   ypstat stat;
129: #ifdef STUPID_SUN_BUG
130:   /* This is the form as distributed by Sun.  But even the Sun NIS
131:      servers expect the values in the other order.  So their
132:      implementation somehow must change the order internally.  We
133:      don't want to follow this bad example since the user should be
134:      able to use rpcgen on this file.  */
135:   keydat key;
136:   valdat val;
137: #else
138:   valdat val;
139:   keydat key;
140: #endif
141: };
142: typedef struct ypresp_key_val ypresp_key_val;
143: 
144: struct ypresp_master {
145:   ypstat stat;
146:   peername peer;
147: };
148: typedef struct ypresp_master ypresp_master;
149: 
150: struct ypresp_order {
151:   ypstat stat;
152:   u_int ordernum;
153: };
154: typedef struct ypresp_order ypresp_order;
155: 
156: struct ypresp_all {
157:   bool_t more;
158:   union {
159:     ypresp_key_val val;
160:   } ypresp_all_u;
161: };
162: typedef struct ypresp_all ypresp_all;
163: 
164: struct ypresp_xfr {
165:   u_int transid;
166:   ypxfrstat xfrstat;
167: };
168: typedef struct ypresp_xfr ypresp_xfr;
169: 
170: struct ypmaplist {
171:   mapname map;
172:   struct ypmaplist *next;
173: };
174: typedef struct ypmaplist ypmaplist;
175: 
176: struct ypresp_maplist {
177:   ypstat stat;
178:   ypmaplist *maps;
179: };
180: typedef struct ypresp_maplist ypresp_maplist;
181: 
182: enum yppush_status {
183:   YPPUSH_SUCC = 1,
184:   YPPUSH_AGE = 2,
185:   YPPUSH_NOMAP = -1,
186:   YPPUSH_NODOM = -2,
187:   YPPUSH_RSRC = -3,
188:   YPPUSH_RPC = -4,
189:   YPPUSH_MADDR = -5,
190:   YPPUSH_YPERR = -6,
191:   YPPUSH_BADARGS = -7,
192:   YPPUSH_DBM = -8,
193:   YPPUSH_FILE = -9,
194:   YPPUSH_SKEW = -10,
195:   YPPUSH_CLEAR = -11,
196:   YPPUSH_FORCE = -12,
197:   YPPUSH_XFRERR = -13,
198:   YPPUSH_REFUSED = -14,
199: };
200: typedef enum yppush_status yppush_status;
201: 
202: struct yppushresp_xfr {
203:   u_int transid;
204:   yppush_status status;
205: };
206: typedef struct yppushresp_xfr yppushresp_xfr;
207: 
208: enum ypbind_resptype {
209:   YPBIND_SUCC_VAL = 1,
210:   YPBIND_FAIL_VAL = 2,
211: };
212: typedef enum ypbind_resptype ypbind_resptype;
213: 
214: struct ypbind_binding {
215:   char ypbind_binding_addr[4];
216:   char ypbind_binding_port[2];
217: };
218: typedef struct ypbind_binding ypbind_binding;
219: 
220: struct ypbind_resp {
221:   ypbind_resptype ypbind_status;
222:   union {
223:     u_int ypbind_error;
224:     ypbind_binding ypbind_bindinfo;
225:   } ypbind_resp_u;
226: };
227: typedef struct ypbind_resp ypbind_resp;
228: 
229: #define YPBIND_ERR_ERR 1
230: #define YPBIND_ERR_NOSERV 2
231: #define YPBIND_ERR_RESC 3
232: 
233: struct ypbind_setdom {
234:   domainname ypsetdom_domain;
235:   ypbind_binding ypsetdom_binding;
236:   u_int ypsetdom_vers;
237: };
238: typedef struct ypbind_setdom ypbind_setdom;
239: 
240: __BEGIN_DECLS
241: 
242: #define YPPROG 100004
243: #define YPVERS 2
244: 
245: #define YPPROC_NULL 0
246: extern  void *ypproc_null_2 (void *, CLIENT *);
247: extern  void *ypproc_null_2_svc (void *, struct svc_req *);
248: #define YPPROC_DOMAIN 1
249: extern  bool_t *ypproc_domain_2 (domainname *, CLIENT *);
250: extern  bool_t *ypproc_domain_2_svc (domainname *, struct svc_req *);
251: #define YPPROC_DOMAIN_NONACK 2
252: extern  bool_t *ypproc_domain_nonack_2 (domainname *, CLIENT *);
253: extern  bool_t *ypproc_domain_nonack_2_svc (domainname *, struct svc_req *);
254: #define YPPROC_MATCH 3
255: extern  ypresp_val *ypproc_match_2 (ypreq_key *, CLIENT *);
256: extern  ypresp_val *ypproc_match_2_svc (ypreq_key *, struct svc_req *);
257: #define YPPROC_FIRST 4
258: extern  ypresp_key_val *ypproc_first_2 (ypreq_key *, CLIENT *);
259: extern  ypresp_key_val *ypproc_first_2_svc (ypreq_key *, struct svc_req *);
260: #define YPPROC_NEXT 5
261: extern  ypresp_key_val *ypproc_next_2 (ypreq_key *, CLIENT *);
262: extern  ypresp_key_val *ypproc_next_2_svc (ypreq_key *, struct svc_req *);
263: #define YPPROC_XFR 6
264: extern  ypresp_xfr *ypproc_xfr_2 (ypreq_xfr *, CLIENT *);
265: extern  ypresp_xfr *ypproc_xfr_2_svc (ypreq_xfr *, struct svc_req *);
266: #define YPPROC_CLEAR 7
267: extern  void *ypproc_clear_2 (void *, CLIENT *);
268: extern  void *ypproc_clear_2_svc (void *, struct svc_req *);
269: #define YPPROC_ALL 8
270: extern  ypresp_all *ypproc_all_2 (ypreq_nokey *, CLIENT *);
271: extern  ypresp_all *ypproc_all_2_svc (ypreq_nokey *, struct svc_req *);
272: #define YPPROC_MASTER 9
273: extern  ypresp_master *ypproc_master_2 (ypreq_nokey *, CLIENT *);
274: extern  ypresp_master *ypproc_master_2_svc (ypreq_nokey *, struct svc_req *);
275: #define YPPROC_ORDER 10
276: extern  ypresp_order *ypproc_order_2 (ypreq_nokey *, CLIENT *);
277: extern  ypresp_order *ypproc_order_2_svc (ypreq_nokey *, struct svc_req *);
278: #define YPPROC_MAPLIST 11
279: extern  ypresp_maplist *ypproc_maplist_2 (domainname *, CLIENT *);
280: extern  ypresp_maplist *ypproc_maplist_2_svc (domainname *, struct svc_req *);
281: extern int ypprog_2_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
282: 
283: 
284: #define YPPUSH_XFRRESPPROG (0x40000000)
285: #define YPPUSH_XFRRESPVERS 1
286: 
287: #define YPPUSHPROC_NULL 0
288: extern  void *yppushproc_null_1 (void *, CLIENT *);
289: extern  void *yppushproc_null_1_svc (void *, struct svc_req *);
290: #define YPPUSHPROC_XFRRESP 1
291: extern  void *yppushproc_xfrresp_1 (yppushresp_xfr *, CLIENT *);
292: extern  void *yppushproc_xfrresp_1_svc (yppushresp_xfr *, struct svc_req *);
293: extern int yppush_xfrrespprog_1_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
294: 
295: 
296: #define YPBINDPROG 100007
297: #define YPBINDVERS 2
298: 
299: #define YPBINDPROC_NULL 0
300: extern  void *ypbindproc_null_2 (void *, CLIENT *);
301: extern  void *ypbindproc_null_2_svc (void *, struct svc_req *);
302: #define YPBINDPROC_DOMAIN 1
303: extern  ypbind_resp *ypbindproc_domain_2 (domainname *, CLIENT *);
304: extern  ypbind_resp *ypbindproc_domain_2_svc (domainname *, struct svc_req *);
305: #define YPBINDPROC_SETDOM 2
306: extern  void *ypbindproc_setdom_2 (ypbind_setdom *, CLIENT *);
307: extern  void *ypbindproc_setdom_2_svc (ypbind_setdom *, struct svc_req *);
308: extern int ypbindprog_2_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
309: 
310: 
311: extern  bool_t xdr_ypstat (XDR *, ypstat*);
312: extern  bool_t xdr_ypxfrstat (XDR *, ypxfrstat*);
313: extern  bool_t xdr_domainname (XDR *, domainname*);
314: extern  bool_t xdr_mapname (XDR *, mapname*);
315: extern  bool_t xdr_peername (XDR *, peername*);
316: extern  bool_t xdr_keydat (XDR *, keydat*);
317: extern  bool_t xdr_valdat (XDR *, valdat*);
318: extern  bool_t xdr_ypmap_parms (XDR *, ypmap_parms*);
319: extern  bool_t xdr_ypreq_key (XDR *, ypreq_key*);
320: extern  bool_t xdr_ypreq_nokey (XDR *, ypreq_nokey*);
321: extern  bool_t xdr_ypreq_xfr (XDR *, ypreq_xfr*);
322: extern  bool_t xdr_ypresp_val (XDR *, ypresp_val*);
323: extern  bool_t xdr_ypresp_key_val (XDR *, ypresp_key_val*);
324: extern  bool_t xdr_ypresp_master (XDR *, ypresp_master*);
325: extern  bool_t xdr_ypresp_order (XDR *, ypresp_order*);
326: extern  bool_t xdr_ypresp_all (XDR *, ypresp_all*);
327: extern  bool_t xdr_ypresp_xfr (XDR *, ypresp_xfr*);
328: extern  bool_t xdr_ypmaplist (XDR *, ypmaplist*);
329: extern  bool_t xdr_ypresp_maplist (XDR *, ypresp_maplist*);
330: extern  bool_t xdr_yppush_status (XDR *, yppush_status*);
331: extern  bool_t xdr_yppushresp_xfr (XDR *, yppushresp_xfr*);
332: extern  bool_t xdr_ypbind_resptype (XDR *, ypbind_resptype*);
333: extern  bool_t xdr_ypbind_binding (XDR *, ypbind_binding*);
334: extern  bool_t xdr_ypbind_resp (XDR *, ypbind_resp*);
335: extern  bool_t xdr_ypbind_setdom (XDR *, ypbind_setdom*);
336: 
337: __END_DECLS
338: 
339: #endif /* !__RPCSVC_YP_H__ */
340: 


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