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