2 * Copyright (c) 2010, Oracle America, Inc.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following
12 * disclaimer in the documentation and/or other materials
13 * provided with the distribution.
14 * * Neither the name of the "Oracle America, Inc." nor the names of its
15 * contributors may be used to endorse or promote products derived
16 * from this software without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
25 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 #ifndef __RPCSVC_YP_H__
33 #define __RPCSVC_YP_H__
38 #define YPMAXRECORD 1024
39 #define YPMAXDOMAIN 64
56 typedef enum ypstat ypstat
;
76 typedef enum ypxfrstat ypxfrstat
;
78 typedef char *domainname
;
79 typedef char *mapname
;
80 typedef char *peername
;
98 typedef struct ypmap_parms ypmap_parms
;
105 typedef struct ypreq_key ypreq_key
;
111 typedef struct ypreq_nokey ypreq_nokey
;
114 ypmap_parms map_parms
;
119 typedef struct ypreq_xfr ypreq_xfr
;
125 typedef struct ypresp_val ypresp_val
;
127 struct ypresp_key_val
{
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. */
142 typedef struct ypresp_key_val ypresp_key_val
;
144 struct ypresp_master
{
148 typedef struct ypresp_master ypresp_master
;
150 struct ypresp_order
{
154 typedef struct ypresp_order ypresp_order
;
162 typedef struct ypresp_all ypresp_all
;
168 typedef struct ypresp_xfr ypresp_xfr
;
172 struct ypmaplist
*next
;
174 typedef struct ypmaplist ypmaplist
;
176 struct ypresp_maplist
{
180 typedef struct ypresp_maplist ypresp_maplist
;
198 YPPUSH_REFUSED
= -14,
200 typedef enum yppush_status yppush_status
;
202 struct yppushresp_xfr
{
204 yppush_status status
;
206 typedef struct yppushresp_xfr yppushresp_xfr
;
208 enum ypbind_resptype
{
212 typedef enum ypbind_resptype ypbind_resptype
;
214 struct ypbind_binding
{
215 char ypbind_binding_addr
[4];
216 char ypbind_binding_port
[2];
218 typedef struct ypbind_binding ypbind_binding
;
221 ypbind_resptype ypbind_status
;
224 ypbind_binding ypbind_bindinfo
;
227 typedef struct ypbind_resp ypbind_resp
;
229 #define YPBIND_ERR_ERR 1
230 #define YPBIND_ERR_NOSERV 2
231 #define YPBIND_ERR_RESC 3
233 struct ypbind_setdom
{
234 domainname ypsetdom_domain
;
235 ypbind_binding ypsetdom_binding
;
238 typedef struct ypbind_setdom ypbind_setdom
;
242 #define YPPROG 100004
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
*);
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
*);
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
);
284 #define YPPUSH_XFRRESPPROG (0x40000000)
285 #define YPPUSH_XFRRESPVERS 1
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
);
296 #define YPBINDPROG 100007
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
);
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
*);
339 #endif /* !__RPCSVC_YP_H__ */