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