1 /*
   2  * CDDL HEADER START
   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License, Version 1.0 only
   6  * (the "License").  You may not use this file except in compliance
   7  * with the License.
   8  *
   9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10  * or http://www.opensolaris.org/os/licensing.
  11  * See the License for the specific language governing permissions
  12  * and limitations under the License.
  13  *
  14  * When distributing Covered Code, include this CDDL HEADER in each
  15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16  * If applicable, add the following below this CDDL HEADER, with the
  17  * fields enclosed by brackets "[]" replaced with your own identifying
  18  * information: Portions Copyright [yyyy] [name of copyright owner]
  19  *
  20  * CDDL HEADER END
  21  */
  22 /*
  23  * Copyright 1989 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  */
  26 
  27 /*      Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
  28 /*        All Rights Reserved   */
  29 
  30 /*
  31  * Portions of this source code were derived from Berkeley 4.3 BSD
  32  * under license from the Regents of the University of California.
  33  */
  34 
  35 #ifndef _RPCSVC_YPCLNT_H
  36 #define _RPCSVC_YPCLNT_H
  37 
  38 #pragma ident   "%Z%%M% %I%     %E% SMI"
  39 
  40 #ifdef  __cplusplus
  41 extern "C" {
  42 #endif
  43 
  44 /*
  45  * ypclnt.h
  46  * This defines the symbols used in the c language
  47  * interface to the yp client functions.  A description of this interface
  48  * can be read in ypclnt(3N).
  49  */
  50 
  51 /*
  52  * Failure reason codes.  The success condition is indicated by a functional
  53  * value of "0".
  54  */
  55 #define YPERR_BADARGS 1                 /* Args to function are bad */
  56 #define YPERR_RPC 2                     /* RPC failure */
  57 #define YPERR_DOMAIN 3                  /* Can't bind to a server which */
  58                                         /*   serves this domain. */
  59 #define YPERR_MAP 4                     /* No such map in server's domain */
  60 #define YPERR_KEY 5                     /* No such key in map */
  61 #define YPERR_YPERR 6                   /* Internal yp server or client */
  62                                         /*   interface error */
  63 #define YPERR_RESRC 7                   /* Local resource allocation failure */
  64 #define YPERR_NOMORE 8                  /* No more records in map database */
  65 #define YPERR_PMAP 9                    /* Can't communicate with portmapper */
  66 #define YPERR_YPBIND 10                 /* Can't communicate with ypbind */
  67 #define YPERR_YPSERV 11                 /* Can't communicate with ypserv */
  68 #define YPERR_NODOM 12                  /* Local domain name not set */
  69 #define YPERR_BADDB 13                  /*  yp data base is bad */
  70 #define YPERR_VERS 14                   /* YP version mismatch */
  71 #define YPERR_ACCESS 15                 /* Access violation */
  72 #define YPERR_BUSY 16                   /* Database is busy */
  73 
  74 /*
  75  * Types of update operations
  76  */
  77 #define YPOP_CHANGE 1                   /* change, do not add */
  78 #define YPOP_INSERT 2                   /* add, do not change */
  79 #define YPOP_DELETE 3                   /* delete this entry */
  80 #define YPOP_STORE  4                   /* add, or change */
  81 
  82 
  83 
  84 /*
  85  * Data definitions
  86  */
  87 
  88 /*
  89  * struct ypall_callback * is the arg which must be passed to yp_all
  90  */
  91 
  92 struct ypall_callback {
  93         int (*foreach)();               /* Return non-0 to stop getting */
  94                                         /*   called */
  95         char *data;                     /* Opaque pointer for use of callback */
  96                                         /*   function */
  97 };
  98 
  99 /*
 100  * External yp client function references.
 101  */
 102 
 103 #ifdef __STDC__
 104 extern int yp_bind(char *);
 105 extern void yp_unbind(char *);
 106 extern int yp_get_default_domain(char **);
 107 extern int yp_match(char *, char *, char *, int, char **, int *);
 108 extern int yp_first(char *, char *, char **, int *, char **, int *);
 109 extern int yp_next(char *, char *, char *, int, char **, int *, char **, int *);
 110 extern int yp_master(char *, char *, char **);
 111 extern int yp_order(char *, char *, unsigned long *);
 112 extern int yp_all(char *, char *, struct ypall_callback *);
 113 extern char *yperr_string(int);
 114 extern int ypprot_err(int);
 115 extern int yp_update(char *, char *, unsigned,  char *, int, char *, int);
 116 
 117 #else
 118 
 119 extern int yp_bind();
 120 extern int __yp_dobind();
 121 extern void yp_unbind();
 122 extern int yp_get_default_domain();
 123 extern int yp_match();
 124 extern int yp_first();
 125 extern int yp_next();
 126 extern int yp_master();
 127 extern int yp_order();
 128 extern int yp_all();
 129 extern char *yperr_string();
 130 extern int ypprot_err();
 131 extern int yp_update();
 132 #endif  /* __STDC__ */
 133 
 134 /*
 135  * Global yp data structures
 136  */
 137 
 138 #ifdef  __cplusplus
 139 }
 140 #endif
 141 
 142 #endif  /* _RPCSVC_YPCLNT_H */