ypclnt.h revision 1832
11832Swollman/* 21832Swollman * Copyright (c) 1992/3 Theo de Raadt <deraadt@fsa.ca> 31832Swollman * All rights reserved. 41832Swollman * 51832Swollman * Redistribution and use in source and binary forms, with or without 61832Swollman * modification, are permitted provided that the following conditions 71832Swollman * are met: 81832Swollman * 1. Redistributions of source code must retain the above copyright 91832Swollman * notice, this list of conditions and the following disclaimer. 101832Swollman * 2. Redistributions in binary form must reproduce the above copyright 111832Swollman * notice, this list of conditions and the following disclaimer in the 121832Swollman * documentation and/or other materials provided with the distribution. 131832Swollman * 3. The name of the author may not be used to endorse or promote 141832Swollman * products derived from this software without specific prior written 151832Swollman * permission. 161832Swollman * 171832Swollman * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS 181832Swollman * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 191832Swollman * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 201832Swollman * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 211832Swollman * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 221832Swollman * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 231832Swollman * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 241832Swollman * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 251832Swollman * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 261832Swollman * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 271832Swollman * SUCH DAMAGE. 281832Swollman * 291832Swollman * $Id: ypclnt.h,v 1.1 1993/09/14 17:42:54 jtc Exp $ 301832Swollman */ 311832Swollman 321832Swollman#ifndef _YPCLNT_H_ 331832Swollman#define _YPCLNT_H_ 341832Swollman 351832Swollman#define YPERR_BADARGS 1 /* args to function are bad */ 361832Swollman#define YPERR_RPC 2 /* RPC failure */ 371832Swollman#define YPERR_DOMAIN 3 /* can't bind to a server for domain */ 381832Swollman#define YPERR_MAP 4 /* no such map in server's domain */ 391832Swollman#define YPERR_KEY 5 /* no such key in map */ 401832Swollman#define YPERR_YPERR 6 /* some internal YP server or client error */ 411832Swollman#define YPERR_RESRC 7 /* local resource allocation failure */ 421832Swollman#define YPERR_NOMORE 8 /* no more records in map database */ 431832Swollman#define YPERR_PMAP 9 /* can't communicate with portmapper */ 441832Swollman#define YPERR_YPBIND 10 /* can't communicate with ypbind */ 451832Swollman#define YPERR_YPSERV 11 /* can't communicate with ypserv */ 461832Swollman#define YPERR_NODOM 12 /* local domain name not set */ 471832Swollman#define YPERR_BADDB 13 /* YP data base is bad */ 481832Swollman#define YPERR_VERS 14 /* YP version mismatch */ 491832Swollman#define YPERR_ACCESS 15 /* access violation */ 501832Swollman#define YPERR_BUSY 16 /* database is busy */ 511832Swollman 521832Swollman/* 531832Swollman * Types of update operations 541832Swollman */ 551832Swollman#define YPOP_CHANGE 1 /* change, do not add */ 561832Swollman#define YPOP_INSERT 2 /* add, do not change */ 571832Swollman#define YPOP_DELETE 3 /* delete this entry */ 581832Swollman#define YPOP_STORE 4 /* add, or change */ 591832Swollman 601832Swollmanstruct ypall_callback { 611832Swollman int (*foreach)(); /* return non-0 to stop getting called */ 621832Swollman char *data; /* opaque pointer for use of callback fn */ 631832Swollman}; 641832Swollman 651832Swollmanint yp_bind __P((char *dom)); 661832Swollmanint _yp_dobind __P((char *dom, struct dom_binding **ypdb)); 671832Swollmanvoid yp_unbind __P((char *dom)); 681832Swollmanint yp_get_default_domain __P((char **domp)); 691832Swollmanint yp_match __P((char *indomain, char *inmap, 701832Swollman const char *inkey, int inkeylen, char **outval, 711832Swollman int *outvallen)); 721832Swollmanint yp_first __P((char *indomain, char *inmap, 731832Swollman char **outkey, int *outkeylen, char **outval, 741832Swollman int *outvallen)); 751832Swollmanint yp_next __P((char *indomain, char *inmap, 761832Swollman char *inkey, int inkeylen, char **outkey, 771832Swollman int *outkeylen, char **outval, int *outvallen)); 781832Swollmanint yp_master __P((char *indomain, char *inmap, char **outname)); 791832Swollmanint yp_order __P((char *indomain, char *inmap, int *outorder)); 801832Swollmanint yp_all __P((char *indomain, char *inmap, 811832Swollman struct ypall_callback *incallback)); 821832Swollmanchar * yperr_string __P((int incode)); 831832Swollmanint ypprot_err __P((unsigned int incode)); 841832Swollman 851832Swollman#endif /* _YPCLNT_H_ */ 861832Swollman 87