1 1.15 dholland /* $NetBSD: ypclnt.h,v 1.15 2016/01/22 23:23:13 dholland 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.2 deraadt * 16 1.2 deraadt * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS 17 1.2 deraadt * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 1.2 deraadt * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 1.2 deraadt * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 20 1.2 deraadt * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 1.2 deraadt * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 1.2 deraadt * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 1.2 deraadt * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 1.2 deraadt * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 1.2 deraadt * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 1.2 deraadt * SUCH DAMAGE. 27 1.2 deraadt */ 28 1.2 deraadt 29 1.7 christos #ifndef _RPCSVC_YPCLNT_H_ 30 1.7 christos #define _RPCSVC_YPCLNT_H_ 31 1.2 deraadt 32 1.15 dholland #include <sys/cdefs.h> 33 1.15 dholland 34 1.2 deraadt #define YPERR_BADARGS 1 /* args to function are bad */ 35 1.2 deraadt #define YPERR_RPC 2 /* RPC failure */ 36 1.2 deraadt #define YPERR_DOMAIN 3 /* can't bind to a server for domain */ 37 1.2 deraadt #define YPERR_MAP 4 /* no such map in server's domain */ 38 1.2 deraadt #define YPERR_KEY 5 /* no such key in map */ 39 1.2 deraadt #define YPERR_YPERR 6 /* some internal YP server or client error */ 40 1.2 deraadt #define YPERR_RESRC 7 /* local resource allocation failure */ 41 1.2 deraadt #define YPERR_NOMORE 8 /* no more records in map database */ 42 1.2 deraadt #define YPERR_PMAP 9 /* can't communicate with portmapper */ 43 1.2 deraadt #define YPERR_YPBIND 10 /* can't communicate with ypbind */ 44 1.2 deraadt #define YPERR_YPSERV 11 /* can't communicate with ypserv */ 45 1.2 deraadt #define YPERR_NODOM 12 /* local domain name not set */ 46 1.2 deraadt #define YPERR_BADDB 13 /* YP data base is bad */ 47 1.2 deraadt #define YPERR_VERS 14 /* YP version mismatch */ 48 1.2 deraadt #define YPERR_ACCESS 15 /* access violation */ 49 1.2 deraadt #define YPERR_BUSY 16 /* database is busy */ 50 1.1 deraadt 51 1.1 deraadt /* 52 1.1 deraadt * Types of update operations 53 1.1 deraadt */ 54 1.2 deraadt #define YPOP_CHANGE 1 /* change, do not add */ 55 1.2 deraadt #define YPOP_INSERT 2 /* add, do not change */ 56 1.2 deraadt #define YPOP_DELETE 3 /* delete this entry */ 57 1.2 deraadt #define YPOP_STORE 4 /* add, or change */ 58 1.1 deraadt 59 1.1 deraadt struct ypall_callback { 60 1.7 christos /* return non-0 to stop getting called */ 61 1.13 perry int (*foreach)(int, char *, int, char *, int, char *); 62 1.2 deraadt char *data; /* opaque pointer for use of callback fn */ 63 1.1 deraadt }; 64 1.1 deraadt 65 1.7 christos __BEGIN_DECLS 66 1.13 perry int yp_bind (const char *); 67 1.4 deraadt struct dom_binding; 68 1.13 perry int _yp_dobind (const char *, struct dom_binding **); 69 1.13 perry int _yp_check (char **); 70 1.13 perry void yp_unbind (const char *); 71 1.13 perry int yp_get_default_domain(char **); 72 1.8 christos struct ypmaplist; 73 1.13 perry int yp_maplist (const char *, struct ypmaplist **); 74 1.13 perry int yp_match (const char *, const char *, const char *, 75 1.13 perry int , char **, int *); 76 1.13 perry int yp_first (const char *, const char *, char **, int *, 77 1.13 perry char **, int *); 78 1.13 perry int yp_next (const char *, const char *, const char *, 79 1.13 perry int, char **, int *, char **, int *); 80 1.13 perry int yp_master (const char *, const char *, char **); 81 1.13 perry int yp_order (const char *, const char *, int *); 82 1.13 perry int yp_all (const char *, const char *, struct ypall_callback *); 83 1.13 perry char * yperr_string (int); 84 1.13 perry int ypprot_err (unsigned int); 85 1.14 christos int yp_setbindtries (int); 86 1.7 christos __END_DECLS 87 1.1 deraadt 88 1.7 christos #endif /* _RPCSVC_YPCLNT_H_ */ 89