/*-1* SPDX-License-Identifier: BSD-4-Clause2*3* Copyright (c) 19954* Bill Paul <[email protected]>. All rights reserved.5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions8* are met:9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11* 2. Redistributions in binary form must reproduce the above copyright12* notice, this list of conditions and the following disclaimer in the13* documentation and/or other materials provided with the distribution.14* 3. All advertising materials mentioning features or use of this software15* must display the following acknowledgement:16* This product includes software developed by Bill Paul.17* 4. Neither the name of the author nor the names of any co-contributors18* may be used to endorse or promote products derived from this software19* without specific prior written permission.20*21* THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND22* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE23* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE24* ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR CONTRIBUTORS BE LIABLE25* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL26* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS27* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)28* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT29* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY30* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF31* SUCH DAMAGE.32*/33#include <sys/types.h>34#include <limits.h>35#include <paths.h>36#include <db.h>37#include <rpcsvc/yp.h>3839extern HASHINFO openinfo;40extern BTREEINFO openinfo_b;4142#ifndef _PATH_YP43#define _PATH_YP "/var/yp/"44#endif4546extern char *yp_dir;47extern int debug;48extern enum ypstat yp_errno;49extern void yp_error(const char *, ...);50extern int _yp_check(char **);51extern const char *ypxfrerr_string(ypxfrstat);52extern DB *yp_open_db_rw(const char *, const char *, const int);53extern void yp_init_dbs(void);54extern int yp_put_record(DB *, DBT *, DBT *, int);55extern int yp_get_record(const char *, const char *, const DBT *, DBT *, int);56extern int ypxfr_get_map(char *, char *, char *, int (*)(int, char *, int, char *, int, char*));57extern char *ypxfr_get_master(char *, char *, char *, const int);58extern unsigned long ypxfr_get_order(char *, char *, char *, const int);59extern int ypxfr_match(char *, char *, char *, char *, unsigned long);60extern char *ypxfxerr_string(ypxfrstat);61extern int ypxfrd_get_map(char *, char *, char *, char *);626364