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