ypclnt.h revision 1.7 1 1.7 christos /* $NetBSD: ypclnt.h,v 1.7 1995/07/14 21:11:10 christos Exp $ */
2 1.6 cgd
3 1.1 deraadt /*
4 1.5 deraadt * Copyright (c) 1992, 1993 Theo de Raadt <deraadt (at) fsa.ca>
5 1.2 deraadt * All rights reserved.
6 1.2 deraadt *
7 1.2 deraadt * Redistribution and use in source and binary forms, with or without
8 1.2 deraadt * modification, are permitted provided that the following conditions
9 1.2 deraadt * are met:
10 1.2 deraadt * 1. Redistributions of source code must retain the above copyright
11 1.2 deraadt * notice, this list of conditions and the following disclaimer.
12 1.2 deraadt * 2. Redistributions in binary form must reproduce the above copyright
13 1.2 deraadt * notice, this list of conditions and the following disclaimer in the
14 1.2 deraadt * documentation and/or other materials provided with the distribution.
15 1.5 deraadt * 3. All advertising materials mentioning features or use of this software
16 1.5 deraadt * must display the following acknowledgement:
17 1.5 deraadt * This product includes software developed by Theo de Raadt.
18 1.5 deraadt * 4. The name of the author may not be used to endorse or promote products
19 1.5 deraadt * derived from this software without specific prior written permission.
20 1.2 deraadt *
21 1.2 deraadt * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
22 1.2 deraadt * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 1.2 deraadt * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 1.2 deraadt * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
25 1.2 deraadt * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 1.2 deraadt * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 1.2 deraadt * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 1.2 deraadt * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 1.2 deraadt * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 1.2 deraadt * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 1.2 deraadt * SUCH DAMAGE.
32 1.2 deraadt */
33 1.2 deraadt
34 1.7 christos #ifndef _RPCSVC_YPCLNT_H_
35 1.7 christos #define _RPCSVC_YPCLNT_H_
36 1.2 deraadt
37 1.2 deraadt #define YPERR_BADARGS 1 /* args to function are bad */
38 1.2 deraadt #define YPERR_RPC 2 /* RPC failure */
39 1.2 deraadt #define YPERR_DOMAIN 3 /* can't bind to a server for domain */
40 1.2 deraadt #define YPERR_MAP 4 /* no such map in server's domain */
41 1.2 deraadt #define YPERR_KEY 5 /* no such key in map */
42 1.2 deraadt #define YPERR_YPERR 6 /* some internal YP server or client error */
43 1.2 deraadt #define YPERR_RESRC 7 /* local resource allocation failure */
44 1.2 deraadt #define YPERR_NOMORE 8 /* no more records in map database */
45 1.2 deraadt #define YPERR_PMAP 9 /* can't communicate with portmapper */
46 1.2 deraadt #define YPERR_YPBIND 10 /* can't communicate with ypbind */
47 1.2 deraadt #define YPERR_YPSERV 11 /* can't communicate with ypserv */
48 1.2 deraadt #define YPERR_NODOM 12 /* local domain name not set */
49 1.2 deraadt #define YPERR_BADDB 13 /* YP data base is bad */
50 1.2 deraadt #define YPERR_VERS 14 /* YP version mismatch */
51 1.2 deraadt #define YPERR_ACCESS 15 /* access violation */
52 1.2 deraadt #define YPERR_BUSY 16 /* database is busy */
53 1.1 deraadt
54 1.1 deraadt /*
55 1.1 deraadt * Types of update operations
56 1.1 deraadt */
57 1.2 deraadt #define YPOP_CHANGE 1 /* change, do not add */
58 1.2 deraadt #define YPOP_INSERT 2 /* add, do not change */
59 1.2 deraadt #define YPOP_DELETE 3 /* delete this entry */
60 1.2 deraadt #define YPOP_STORE 4 /* add, or change */
61 1.1 deraadt
62 1.1 deraadt struct ypall_callback {
63 1.7 christos /* return non-0 to stop getting called */
64 1.7 christos int (*foreach) __P((u_long, char *, int, char *, int, void *));
65 1.2 deraadt char *data; /* opaque pointer for use of callback fn */
66 1.1 deraadt };
67 1.1 deraadt
68 1.7 christos __BEGIN_DECLS
69 1.7 christos int yp_bind __P((const char *));
70 1.4 deraadt struct dom_binding;
71 1.7 christos int _yp_dobind __P((const char *, struct dom_binding **));
72 1.7 christos void yp_unbind __P((const char *));
73 1.7 christos int yp_get_default_domain __P((char **));
74 1.7 christos int yp_match __P((const char *, const char *, const char *,
75 1.7 christos int , char **, int *));
76 1.7 christos int yp_first __P((const char *, const char *, char **, int *,
77 1.7 christos char **, int *));
78 1.7 christos int yp_next __P((const char *, const char *, const char *,
79 1.7 christos int, char **, int *, char **, int *));
80 1.7 christos int yp_master __P((const char *, const char *, char **));
81 1.7 christos int yp_order __P((const char *, const char *, int *));
82 1.7 christos int yp_all __P((const char *, const char *,
83 1.7 christos struct ypall_callback *));
84 1.7 christos char * yperr_string __P((int));
85 1.7 christos int ypprot_err __P((unsigned int));
86 1.7 christos __END_DECLS
87 1.1 deraadt
88 1.7 christos #endif /* _RPCSVC_YPCLNT_H_ */
89