1*53ee8cc1Swenshuai.xi /* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. 2*53ee8cc1Swenshuai.xi This file is part of the GNU C Library. 3*53ee8cc1Swenshuai.xi Contributed by Thorsten Kukuk <kukuk@suse.de>, 1996. 4*53ee8cc1Swenshuai.xi 5*53ee8cc1Swenshuai.xi The GNU C Library is free software; you can redistribute it and/or 6*53ee8cc1Swenshuai.xi modify it under the terms of the GNU Lesser General Public 7*53ee8cc1Swenshuai.xi License as published by the Free Software Foundation; either 8*53ee8cc1Swenshuai.xi version 2.1 of the License, or (at your option) any later version. 9*53ee8cc1Swenshuai.xi 10*53ee8cc1Swenshuai.xi The GNU C Library is distributed in the hope that it will be useful, 11*53ee8cc1Swenshuai.xi but WITHOUT ANY WARRANTY; without even the implied warranty of 12*53ee8cc1Swenshuai.xi MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13*53ee8cc1Swenshuai.xi Lesser General Public License for more details. 14*53ee8cc1Swenshuai.xi 15*53ee8cc1Swenshuai.xi You should have received a copy of the GNU Lesser General Public 16*53ee8cc1Swenshuai.xi License along with the GNU C Library; if not, write to the Free 17*53ee8cc1Swenshuai.xi Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 18*53ee8cc1Swenshuai.xi 02111-1307 USA. */ 19*53ee8cc1Swenshuai.xi 20*53ee8cc1Swenshuai.xi 21*53ee8cc1Swenshuai.xi #ifndef __RPCSVC_YPCLNT_H__ 22*53ee8cc1Swenshuai.xi #define __RPCSVC_YPCLNT_H__ 23*53ee8cc1Swenshuai.xi 24*53ee8cc1Swenshuai.xi #include <features.h> 25*53ee8cc1Swenshuai.xi 26*53ee8cc1Swenshuai.xi /* Some defines */ 27*53ee8cc1Swenshuai.xi #define YPERR_SUCCESS 0 /* There is no error */ 28*53ee8cc1Swenshuai.xi #define YPERR_BADARGS 1 /* Args to function are bad */ 29*53ee8cc1Swenshuai.xi #define YPERR_RPC 2 /* RPC failure */ 30*53ee8cc1Swenshuai.xi #define YPERR_DOMAIN 3 /* Can't bind to a server with this domain */ 31*53ee8cc1Swenshuai.xi #define YPERR_MAP 4 /* No such map in server's domain */ 32*53ee8cc1Swenshuai.xi #define YPERR_KEY 5 /* No such key in map */ 33*53ee8cc1Swenshuai.xi #define YPERR_YPERR 6 /* Internal yp server or client error */ 34*53ee8cc1Swenshuai.xi #define YPERR_RESRC 7 /* Local resource allocation failure */ 35*53ee8cc1Swenshuai.xi #define YPERR_NOMORE 8 /* No more records in map database */ 36*53ee8cc1Swenshuai.xi #define YPERR_PMAP 9 /* Can't communicate with portmapper */ 37*53ee8cc1Swenshuai.xi #define YPERR_YPBIND 10 /* Can't communicate with ypbind */ 38*53ee8cc1Swenshuai.xi #define YPERR_YPSERV 11 /* Can't communicate with ypserv */ 39*53ee8cc1Swenshuai.xi #define YPERR_NODOM 12 /* Local domain name not set */ 40*53ee8cc1Swenshuai.xi #define YPERR_BADDB 13 /* yp data base is bad */ 41*53ee8cc1Swenshuai.xi #define YPERR_VERS 14 /* YP version mismatch */ 42*53ee8cc1Swenshuai.xi #define YPERR_ACCESS 15 /* Access violation */ 43*53ee8cc1Swenshuai.xi #define YPERR_BUSY 16 /* Database is busy */ 44*53ee8cc1Swenshuai.xi 45*53ee8cc1Swenshuai.xi /* Types of update operations */ 46*53ee8cc1Swenshuai.xi #define YPOP_CHANGE 1 /* Change, do not add */ 47*53ee8cc1Swenshuai.xi #define YPOP_INSERT 2 /* Add, do not change */ 48*53ee8cc1Swenshuai.xi #define YPOP_DELETE 3 /* Delete this entry */ 49*53ee8cc1Swenshuai.xi #define YPOP_STORE 4 /* Add, or change */ 50*53ee8cc1Swenshuai.xi 51*53ee8cc1Swenshuai.xi __BEGIN_DECLS 52*53ee8cc1Swenshuai.xi 53*53ee8cc1Swenshuai.xi /* struct ypall_callback * is the arg which must be passed to yp_all. */ 54*53ee8cc1Swenshuai.xi struct ypall_callback 55*53ee8cc1Swenshuai.xi { 56*53ee8cc1Swenshuai.xi int (*foreach) (int __status, char *__key, int __keylen, 57*53ee8cc1Swenshuai.xi char *__val, int __vallen, char *__data); 58*53ee8cc1Swenshuai.xi char *data; 59*53ee8cc1Swenshuai.xi }; 60*53ee8cc1Swenshuai.xi 61*53ee8cc1Swenshuai.xi /* External NIS client function references. */ 62*53ee8cc1Swenshuai.xi extern int yp_bind (__const char *) __THROW; 63*53ee8cc1Swenshuai.xi extern void yp_unbind (__const char *) __THROW; 64*53ee8cc1Swenshuai.xi extern int yp_get_default_domain (char **) __THROW; 65*53ee8cc1Swenshuai.xi extern int yp_match (__const char *, __const char *, __const char *, 66*53ee8cc1Swenshuai.xi __const int, char **, int *) __THROW; 67*53ee8cc1Swenshuai.xi extern int yp_first (__const char *, __const char *, char **, 68*53ee8cc1Swenshuai.xi int *, char **, int *) __THROW; 69*53ee8cc1Swenshuai.xi extern int yp_next (__const char *, __const char *, __const char *, 70*53ee8cc1Swenshuai.xi __const int, char **, int *, char **, int *) __THROW; 71*53ee8cc1Swenshuai.xi extern int yp_master (__const char *, __const char *, char **) __THROW; 72*53ee8cc1Swenshuai.xi extern int yp_order (__const char *, __const char *, unsigned int *) __THROW; 73*53ee8cc1Swenshuai.xi extern int yp_all (__const char *, __const char *, 74*53ee8cc1Swenshuai.xi __const struct ypall_callback *) __THROW; 75*53ee8cc1Swenshuai.xi extern __const char *yperr_string (__const int) __THROW; 76*53ee8cc1Swenshuai.xi extern __const char *ypbinderr_string (__const int) __THROW; 77*53ee8cc1Swenshuai.xi extern int ypprot_err (__const int) __THROW; 78*53ee8cc1Swenshuai.xi extern int yp_update (char *, char *, unsigned int, char *, 79*53ee8cc1Swenshuai.xi int, char *, int) __THROW; 80*53ee8cc1Swenshuai.xi #if 0 81*53ee8cc1Swenshuai.xi extern int yp_maplist (__const char *, struct ypmaplist **) __THROW; 82*53ee8cc1Swenshuai.xi #endif 83*53ee8cc1Swenshuai.xi 84*53ee8cc1Swenshuai.xi /* This functions exists only under BSD and Linux systems. */ 85*53ee8cc1Swenshuai.xi extern int __yp_check (char **) __THROW; 86*53ee8cc1Swenshuai.xi 87*53ee8cc1Swenshuai.xi __END_DECLS 88*53ee8cc1Swenshuai.xi 89*53ee8cc1Swenshuai.xi #endif /* __RPCSVC_YPCLNT_H__ */ 90