ypclnt.h revision 32552
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 *
2932552Sbde *	$Id: ypclnt.h,v 1.9 1997/05/28 04:38:25 wpaul Exp $
301832Swollman */
311832Swollman
3221060Speter#ifndef _RPCSVC_YPCLNT_H_
3321060Speter#define _RPCSVC_YPCLNT_H_
341832Swollman
3532552Sbde#include <sys/cdefs.h>
3632552Sbde
371832Swollman#define YPERR_BADARGS	1		/* args to function are bad */
381832Swollman#define YPERR_RPC	2		/* RPC failure */
391832Swollman#define YPERR_DOMAIN	3		/* can't bind to a server for domain */
401832Swollman#define YPERR_MAP	4		/* no such map in server's domain */
411832Swollman#define YPERR_KEY	5		/* no such key in map */
421832Swollman#define YPERR_YPERR	6		/* some internal YP server or client error */
431832Swollman#define YPERR_RESRC	7		/* local resource allocation failure */
441832Swollman#define YPERR_NOMORE	8		/* no more records in map database */
451832Swollman#define YPERR_PMAP	9		/* can't communicate with portmapper */
461832Swollman#define YPERR_YPBIND	10		/* can't communicate with ypbind */
471832Swollman#define YPERR_YPSERV	11		/* can't communicate with ypserv */
481832Swollman#define YPERR_NODOM	12		/* local domain name not set */
491832Swollman#define YPERR_BADDB	13		/* YP data base is bad */
501832Swollman#define YPERR_VERS	14		/* YP version mismatch */
511832Swollman#define YPERR_ACCESS	15		/* access violation */
521832Swollman#define YPERR_BUSY	16		/* database is busy */
531832Swollman
541832Swollman/*
551832Swollman * Types of update operations
561832Swollman */
571832Swollman#define YPOP_CHANGE	1		/* change, do not add */
581832Swollman#define YPOP_INSERT	2		/* add, do not change */
591832Swollman#define YPOP_DELETE	3		/* delete this entry */
601832Swollman#define YPOP_STORE 	4		/* add, or change */
618858Srgrimes
621832Swollmanstruct ypall_callback {
6321060Speter	/* return non-0 to stop getting called */
6432552Sbde	int (*foreach) __P((unsigned long, char *, int, char *, int, void *));
651832Swollman	char *data;		/* opaque pointer for use of callback fn */
661832Swollman};
671832Swollman
6832552Sbdestruct dom_binding;
6932552Sbde
7021060Speter__BEGIN_DECLS
711832Swollmanint	yp_bind		__P((char *dom));
721832Swollmanint	_yp_dobind	__P((char *dom, struct dom_binding **ypdb));
731832Swollmanvoid	yp_unbind	__P((char *dom));
741832Swollmanint	yp_get_default_domain __P((char **domp));
751832Swollmanint	yp_match 	__P((char *indomain, char *inmap,
761832Swollman			    const char *inkey, int inkeylen, char **outval,
771832Swollman			    int *outvallen));
781832Swollmanint	yp_first 	__P((char *indomain, char *inmap,
791832Swollman			    char **outkey, int *outkeylen, char **outval,
801832Swollman			    int *outvallen));
811832Swollmanint	yp_next		__P((char *indomain, char *inmap,
821832Swollman			    char *inkey, int inkeylen, char **outkey,
831832Swollman			    int *outkeylen, char **outval, int *outvallen));
841832Swollmanint	yp_master	__P((char *indomain, char *inmap, char **outname));
851832Swollmanint	yp_order	__P((char *indomain, char *inmap, int *outorder));
861832Swollmanint	yp_all		__P((char *indomain, char *inmap,
871832Swollman			    struct ypall_callback *incallback));
881832Swollmanchar *	yperr_string	__P((int incode));
897983Swpaulchar *	ypbinderr_string __P((int incode));
901832Swollmanint	ypprot_err	__P((unsigned int incode));
9121060Speter__END_DECLS
921832Swollman
9321060Speter#endif /* _RPCSVC_YPCLNT_H_ */
941832Swollman
95