ypclnt.h revision 1.6 1 1.6 cgd /* $NetBSD: ypclnt.h,v 1.6 1994/10/26 00:57:11 cgd 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.2 deraadt #ifndef _YPCLNT_H_
35 1.2 deraadt #define _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.2 deraadt int (*foreach)(); /* return non-0 to stop getting called */
64 1.2 deraadt char *data; /* opaque pointer for use of callback fn */
65 1.1 deraadt };
66 1.1 deraadt
67 1.2 deraadt int yp_bind __P((char *dom));
68 1.4 deraadt struct dom_binding;
69 1.2 deraadt int _yp_dobind __P((char *dom, struct dom_binding **ypdb));
70 1.2 deraadt void yp_unbind __P((char *dom));
71 1.2 deraadt int yp_get_default_domain __P((char **domp));
72 1.2 deraadt int yp_match __P((char *indomain, char *inmap,
73 1.2 deraadt const char *inkey, int inkeylen, char **outval,
74 1.2 deraadt int *outvallen));
75 1.2 deraadt int yp_first __P((char *indomain, char *inmap,
76 1.2 deraadt char **outkey, int *outkeylen, char **outval,
77 1.2 deraadt int *outvallen));
78 1.2 deraadt int yp_next __P((char *indomain, char *inmap,
79 1.2 deraadt char *inkey, int inkeylen, char **outkey,
80 1.2 deraadt int *outkeylen, char **outval, int *outvallen));
81 1.2 deraadt int yp_master __P((char *indomain, char *inmap, char **outname));
82 1.2 deraadt int yp_order __P((char *indomain, char *inmap, int *outorder));
83 1.2 deraadt int yp_all __P((char *indomain, char *inmap,
84 1.2 deraadt struct ypall_callback *incallback));
85 1.2 deraadt char * yperr_string __P((int incode));
86 1.2 deraadt int ypprot_err __P((unsigned int incode));
87 1.2 deraadt
88 1.2 deraadt #endif /* _YPCLNT_H_ */
89 1.1 deraadt
90