Merge pull request #21 from Oichkatzelesfrettschen/eirikr/delete-netbsd-referencing-files
This commit is contained in:
commit
e37f7d9a18
|
|
@ -1,56 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.141 2015/07/29 00:10:26 christos Exp $
|
||||
# @(#)Makefile 8.2 (Berkeley) 1/4/94
|
||||
|
||||
# Doing a make includes builds /usr/include
|
||||
|
||||
NOOBJ= # defined
|
||||
|
||||
# Missing: mp.h
|
||||
|
||||
INCS= a.out.h aio.h ar.h assert.h atomic.h \
|
||||
bitstring.h bm.h cdbw.h complex.h cpio.h ctype.h \
|
||||
db.h dirent.h disktab.h dlfcn.h err.h errno.h fenv.h fmtmsg.h fnmatch.h \
|
||||
fstab.h fts.h ftw.h getopt.h glob.h grp.h ifaddrs.h iconv.h \
|
||||
inttypes.h iso646.h kvm.h langinfo.h libgen.h \
|
||||
limits.h link.h link_aout.h link_elf.h locale.h \
|
||||
login_cap.h lwp.h malloc.h math.h md2.h \
|
||||
memory.h mntopts.h monetary.h mpool.h mqueue.h \
|
||||
ndbm.h netconfig.h netdb.h netgroup.h nlist.h nl_types.h nsswitch.h \
|
||||
paths.h pwd.h quota.h randomid.h ranlib.h re_comp.h regex.h regexp.h \
|
||||
resolv.h res_update.h rmt.h sched.h search.h semaphore.h setjmp.h \
|
||||
string.h sgtty.h signal.h spawn.h stab.h stddef.h stdio.h \
|
||||
stdlib.h strings.h stringlist.h struct.h sysexits.h tar.h time.h \
|
||||
ttyent.h tzfile.h ucontext.h ulimit.h unistd.h util.h utime.h utmp.h \
|
||||
utmpx.h uuid.h vis.h wchar.h wctype.h wordexp.h
|
||||
INCS+= arpa/ftp.h arpa/inet.h arpa/nameser.h arpa/nameser_compat.h \
|
||||
arpa/telnet.h arpa/tftp.h
|
||||
INCS+= protocols/dumprestore.h protocols/routed.h protocols/rwhod.h \
|
||||
protocols/talkd.h protocols/timed.h
|
||||
|
||||
INCS+= hesiod.h
|
||||
|
||||
INCS+= rpcsvc/yp_prot.h rpcsvc/ypclnt.h
|
||||
|
||||
INCS+= ssp/ssp.h ssp/stdio.h ssp/string.h ssp/strings.h ssp/unistd.h
|
||||
|
||||
.if (${MACHINE_ARCH} != "vax")
|
||||
INCS+= ieeefp.h
|
||||
.endif
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
|
||||
INCSDIR= /usr/include
|
||||
|
||||
.if defined(__MINIX)
|
||||
# RPC is not compiled in the libc. This include also needs
|
||||
# rpcgen, which can be compiled if needed.
|
||||
SUBDIR+= ../minix/include
|
||||
.else
|
||||
SUBDIR= rpc
|
||||
.endif # defined(__MINIX)
|
||||
SUBDIR+= ../common/include/prop
|
||||
SUBDIR+= ../common/include/ppath
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <bsd.subdir.mk>
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
/* $NetBSD: a.out.h,v 1.20 2009/08/16 17:12:47 pgoyette Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1991, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)a.out.h 8.1 (Berkeley) 6/2/93
|
||||
*/
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1993 Theo de Raadt. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* @(#)a.out.h 8.1 (Berkeley) 6/2/93
|
||||
*/
|
||||
|
||||
#ifndef _AOUT_H_
|
||||
#define _AOUT_H_
|
||||
|
||||
#include <sys/exec_aout.h>
|
||||
|
||||
#define _AOUT_INCLUDE_
|
||||
#include <nlist.h>
|
||||
|
||||
#endif /* !_AOUT_H_ */
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
/* $NetBSD: aio.h,v 1.7 2009/01/13 15:11:09 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007, Mindaugas Rasiukevicius <rmind at NetBSD org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _AIO_H_
|
||||
#define _AIO_H_
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <signal.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/signal.h>
|
||||
|
||||
#include <sys/aio.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
int aio_cancel(int, struct aiocb *);
|
||||
int aio_error(const struct aiocb *);
|
||||
int aio_fsync(int, struct aiocb *);
|
||||
int aio_read(struct aiocb *);
|
||||
ssize_t aio_return(struct aiocb *);
|
||||
#ifndef __LIBC12_SOURCE__
|
||||
int aio_suspend(const struct aiocb * const [], int,
|
||||
const struct timespec *) __RENAME(__aio_suspend50);
|
||||
#endif
|
||||
int aio_write(struct aiocb *);
|
||||
int lio_listio(int, struct aiocb * const * __restrict,
|
||||
int, struct sigevent * __restrict);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _AIO_H_ */
|
||||
65
include/ar.h
65
include/ar.h
|
|
@ -1,65 +0,0 @@
|
|||
/* $NetBSD: ar.h,v 1.5 2003/08/07 09:44:09 agc Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1991, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
* (c) UNIX System Laboratories, Inc.
|
||||
* All or some portions of this file are derived from material licensed
|
||||
* to the University of California by American Telephone and Telegraph
|
||||
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
|
||||
* the permission of UNIX System Laboratories, Inc.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Hugh Smith at The University of Guelph.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)ar.h 8.2 (Berkeley) 1/21/94
|
||||
*/
|
||||
|
||||
#ifndef _AR_H_
|
||||
#define _AR_H_
|
||||
|
||||
/* Pre-4BSD archives had these magic numbers in them. */
|
||||
#define OARMAG1 0177555
|
||||
#define OARMAG2 0177545
|
||||
|
||||
#define ARMAG "!<arch>\n" /* ar "magic number" */
|
||||
#define SARMAG 8 /* strlen(ARMAG); */
|
||||
|
||||
#define AR_EFMT1 "#1/" /* extended format #1 */
|
||||
|
||||
struct ar_hdr {
|
||||
char ar_name[16]; /* name */
|
||||
char ar_date[12]; /* modification time */
|
||||
char ar_uid[6]; /* user id */
|
||||
char ar_gid[6]; /* group id */
|
||||
char ar_mode[8]; /* octal file permissions */
|
||||
char ar_size[10]; /* size in bytes */
|
||||
#define ARFMAG "`\n"
|
||||
char ar_fmag[2]; /* consistency check */
|
||||
};
|
||||
|
||||
#endif /* !_AR_H_ */
|
||||
|
|
@ -1,107 +0,0 @@
|
|||
/* $NetBSD: ftp.h,v 1.6 2003/08/07 09:44:12 agc Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1989, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)ftp.h 8.1 (Berkeley) 6/2/93
|
||||
*/
|
||||
|
||||
#ifndef _ARPA_FTP_H_
|
||||
#define _ARPA_FTP_H_
|
||||
|
||||
/* Definitions for FTP; see RFC-765. */
|
||||
|
||||
/*
|
||||
* Reply codes.
|
||||
*/
|
||||
#define PRELIM 1 /* positive preliminary */
|
||||
#define COMPLETE 2 /* positive completion */
|
||||
#define CONTINUE 3 /* positive intermediate */
|
||||
#define TRANSIENT 4 /* transient negative completion */
|
||||
#define ERROR 5 /* permanent negative completion */
|
||||
|
||||
/*
|
||||
* Type codes
|
||||
*/
|
||||
#define TYPE_A 1 /* ASCII */
|
||||
#define TYPE_E 2 /* EBCDIC */
|
||||
#define TYPE_I 3 /* image */
|
||||
#define TYPE_L 4 /* local byte size */
|
||||
|
||||
#ifdef FTP_NAMES
|
||||
char *typenames[] = {"0", "ASCII", "EBCDIC", "Image", "Local" };
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Form codes
|
||||
*/
|
||||
#define FORM_N 1 /* non-print */
|
||||
#define FORM_T 2 /* telnet format effectors */
|
||||
#define FORM_C 3 /* carriage control (ASA) */
|
||||
#ifdef FTP_NAMES
|
||||
char *formnames[] = {"0", "Nonprint", "Telnet", "Carriage-control" };
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Structure codes
|
||||
*/
|
||||
#define STRU_F 1 /* file (no record structure) */
|
||||
#define STRU_R 2 /* record structure */
|
||||
#define STRU_P 3 /* page structure */
|
||||
#ifdef FTP_NAMES
|
||||
char *strunames[] = {"0", "File", "Record", "Page" };
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Mode types
|
||||
*/
|
||||
#define MODE_S 1 /* stream */
|
||||
#define MODE_B 2 /* block */
|
||||
#define MODE_C 3 /* compressed */
|
||||
#ifdef FTP_NAMES
|
||||
char *modenames[] = {"0", "Stream", "Block", "Compressed" };
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Record Tokens
|
||||
*/
|
||||
#define REC_ESC '\377' /* Record-mode Escape */
|
||||
#define REC_EOR '\001' /* Record-mode End-of-Record */
|
||||
#define REC_EOF '\002' /* Record-mode End-of-File */
|
||||
|
||||
/*
|
||||
* Block Header
|
||||
*/
|
||||
#define BLK_EOR 0x80 /* Block is End-of-Record */
|
||||
#define BLK_EOF 0x40 /* Block is End-of-File */
|
||||
#define BLK_ERRORS 0x20 /* Block is suspected of containing errors */
|
||||
#define BLK_RESTART 0x10 /* Block is Restart Marker */
|
||||
|
||||
#define BLK_BYTECOUNT 2 /* Bytes in this block */
|
||||
|
||||
#endif /* _ARPA_FTP_H_ */
|
||||
|
|
@ -1,105 +0,0 @@
|
|||
/* $NetBSD: inet.h,v 1.24 2008/06/21 20:12:49 christos Exp $ */
|
||||
|
||||
/*
|
||||
* ++Copyright++ 1983, 1993
|
||||
* -
|
||||
* Copyright (c) 1983, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
* -
|
||||
* Portions Copyright (c) 1993 by Digital Equipment Corporation.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies, and that
|
||||
* the name of Digital Equipment Corporation not be used in advertising or
|
||||
* publicity pertaining to distribution of the document or software without
|
||||
* specific, written prior permission.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
|
||||
* CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
||||
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
* SOFTWARE.
|
||||
* -
|
||||
* --Copyright--
|
||||
*/
|
||||
|
||||
/*%
|
||||
* @(#)inet.h 8.1 (Berkeley) 6/2/93
|
||||
* Id: inet.h,v 1.3 2005/04/27 04:56:16 sra Exp
|
||||
*/
|
||||
|
||||
#ifndef _ARPA_INET_H_
|
||||
#define _ARPA_INET_H_
|
||||
|
||||
/* External definitions for functions in inet(3) */
|
||||
|
||||
#include <sys/ansi.h>
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/featuretest.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
|
||||
#if (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 520 || \
|
||||
defined(_NETBSD_SOURCE)
|
||||
#ifndef socklen_t
|
||||
typedef __socklen_t socklen_t;
|
||||
#define socklen_t __socklen_t
|
||||
#endif
|
||||
#endif /* _POSIX_C_SOURCE >= 200112 || XOPEN_SOURCE >= 520 || _NETBSD_SOURCE */
|
||||
|
||||
__BEGIN_DECLS
|
||||
in_addr_t inet_addr(const char *);
|
||||
in_addr_t inet_lnaof(struct in_addr);
|
||||
struct in_addr inet_makeaddr(in_addr_t, in_addr_t);
|
||||
in_addr_t inet_netof(struct in_addr);
|
||||
in_addr_t inet_network(const char *);
|
||||
char *inet_ntoa(struct in_addr);
|
||||
#if (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 520 || \
|
||||
defined(_NETBSD_SOURCE)
|
||||
const char *inet_ntop(int, const void * __restrict,
|
||||
char * __restrict, socklen_t);
|
||||
int inet_pton(int, const char * __restrict,
|
||||
void * __restrict);
|
||||
#endif
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
int inet_aton(const char *, struct in_addr *);
|
||||
char * inet_neta(u_long, char *, size_t);
|
||||
char *inet_net_ntop(int, const void *, int, char *, size_t);
|
||||
int inet_net_pton(int, const char *, void *, size_t);
|
||||
char *inet_cidr_ntop(int, const void *, int, char *, size_t);
|
||||
int inet_cidr_pton(int, const char *, void *, int *);
|
||||
u_int inet_nsap_addr(const char *, u_char *, int);
|
||||
char *inet_nsap_ntoa(int, const u_char *, char *);
|
||||
#endif
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _ARPA_INET_H_ */
|
||||
|
|
@ -1,681 +0,0 @@
|
|||
/* $NetBSD: nameser.h,v 1.25 2009/04/12 17:07:34 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Portions Copyright (C) 2004, 2005, 2008, 2009 Internet Systems Consortium, Inc. ("ISC")
|
||||
* Portions Copyright (C) 1996-2003 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
|
||||
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1989, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Id: nameser.h,v 1.16 2009/03/03 01:52:48 each Exp
|
||||
*/
|
||||
|
||||
#ifndef _ARPA_NAMESER_H_
|
||||
#define _ARPA_NAMESER_H_
|
||||
|
||||
#define BIND_4_COMPAT
|
||||
|
||||
#include <sys/param.h>
|
||||
#if (!defined(BSD)) || (BSD < 199306)
|
||||
# include <sys/bitypes.h>
|
||||
#else
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
/*%
|
||||
* Revision information. This is the release date in YYYYMMDD format.
|
||||
* It can change every day so the right thing to do with it is use it
|
||||
* in preprocessor commands such as "#if (__NAMESER > 19931104)". Do not
|
||||
* compare for equality; rather, use it to determine whether your libbind.a
|
||||
* contains a new enough lib/nameser/ to support the feature you need.
|
||||
*/
|
||||
|
||||
#define __NAMESER 20090302 /*%< New interface version stamp. */
|
||||
/*
|
||||
* Define constants based on RFC0883, RFC1034, RFC 1035
|
||||
*/
|
||||
#define NS_PACKETSZ 512 /*%< default UDP packet size */
|
||||
#define NS_MAXDNAME 1025 /*%< maximum domain name (presentation format)*/
|
||||
#define NS_MAXMSG 65535 /*%< maximum message size */
|
||||
#define NS_MAXCDNAME 255 /*%< maximum compressed domain name */
|
||||
#define NS_MAXLABEL 63 /*%< maximum length of domain label */
|
||||
#define NS_MAXLABELS 128 /*%< theoretical max #/labels per domain name */
|
||||
#define NS_MAXNNAME 256 /*%< maximum uncompressed (binary) domain name*/
|
||||
#define NS_MAXPADDR (sizeof "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff")
|
||||
#define NS_HFIXEDSZ 12 /*%< #/bytes of fixed data in header */
|
||||
#define NS_QFIXEDSZ 4 /*%< #/bytes of fixed data in query */
|
||||
#define NS_RRFIXEDSZ 10 /*%< #/bytes of fixed data in r record */
|
||||
#define NS_INT32SZ 4 /*%< #/bytes of data in a uint32_t */
|
||||
#define NS_INT16SZ 2 /*%< #/bytes of data in a uint16_t */
|
||||
#define NS_INT8SZ 1 /*%< #/bytes of data in a u_int8_t */
|
||||
#define NS_INADDRSZ 4 /*%< IPv4 T_A */
|
||||
#define NS_IN6ADDRSZ 16 /*%< IPv6 T_AAAA */
|
||||
#define NS_CMPRSFLGS 0xc0 /*%< Flag bits indicating name compression. */
|
||||
#define NS_DEFAULTPORT 53 /*%< For both TCP and UDP. */
|
||||
|
||||
/*
|
||||
* These can be expanded with synonyms, just keep ns_parse.c:ns_parserecord()
|
||||
* in synch with it.
|
||||
*/
|
||||
typedef enum __ns_sect {
|
||||
ns_s_qd = 0, /*%< Query: Question. */
|
||||
ns_s_zn = 0, /*%< Update: Zone. */
|
||||
ns_s_an = 1, /*%< Query: Answer. */
|
||||
ns_s_pr = 1, /*%< Update: Prerequisites. */
|
||||
ns_s_ns = 2, /*%< Query: Name servers. */
|
||||
ns_s_ud = 2, /*%< Update: Update. */
|
||||
ns_s_ar = 3, /*%< Query|Update: Additional records. */
|
||||
ns_s_max = 4
|
||||
} ns_sect;
|
||||
|
||||
/*%
|
||||
* Network name (compressed or not) type. Equivilent to a pointer when used
|
||||
* in a function prototype. Can be const'd.
|
||||
*/
|
||||
typedef u_char ns_nname[NS_MAXNNAME];
|
||||
typedef const u_char *ns_nname_ct;
|
||||
typedef u_char *ns_nname_t;
|
||||
|
||||
struct ns_namemap { ns_nname_ct base; int len; };
|
||||
typedef struct ns_namemap *ns_namemap_t;
|
||||
typedef const struct ns_namemap *ns_namemap_ct;
|
||||
|
||||
/*%
|
||||
* This is a message handle. It is caller allocated and has no dynamic data.
|
||||
* This structure is intended to be opaque to all but ns_parse.c, thus the
|
||||
* leading _'s on the member names. Use the accessor functions, not the _'s.
|
||||
*/
|
||||
typedef struct __ns_msg {
|
||||
const u_char *_msg, *_eom;
|
||||
uint16_t _id, _flags, _counts[ns_s_max];
|
||||
const u_char *_sections[ns_s_max];
|
||||
ns_sect _sect;
|
||||
int _rrnum;
|
||||
const u_char *_msg_ptr;
|
||||
} ns_msg;
|
||||
|
||||
/*
|
||||
* This is a newmsg handle, used when constructing new messages with
|
||||
* ns_newmsg_init, et al.
|
||||
*/
|
||||
struct ns_newmsg {
|
||||
ns_msg msg;
|
||||
const u_char *dnptrs[25];
|
||||
const u_char **lastdnptr;
|
||||
};
|
||||
typedef struct ns_newmsg ns_newmsg;
|
||||
|
||||
/* Private data structure - do not use from outside library. */
|
||||
struct _ns_flagdata { int mask, shift; };
|
||||
extern struct _ns_flagdata _ns_flagdata[];
|
||||
|
||||
/* Accessor macros - this is part of the public interface. */
|
||||
|
||||
#define ns_msg_id(handle) ((handle)._id + 0)
|
||||
#define ns_msg_base(handle) ((handle)._msg + 0)
|
||||
#define ns_msg_end(handle) ((handle)._eom + 0)
|
||||
#define ns_msg_size(handle) ((size_t)((handle)._eom - (handle)._msg))
|
||||
#define ns_msg_count(handle, section) ((handle)._counts[section] + 0)
|
||||
|
||||
/*%
|
||||
* This is a parsed record. It is caller allocated and has no dynamic data.
|
||||
*/
|
||||
typedef struct __ns_rr {
|
||||
char name[NS_MAXDNAME];
|
||||
uint16_t type;
|
||||
uint16_t rr_class;
|
||||
uint32_t ttl;
|
||||
uint16_t rdlength;
|
||||
const u_char * rdata;
|
||||
} ns_rr;
|
||||
|
||||
/*
|
||||
* Same thing, but using uncompressed network binary names, and real C types.
|
||||
*/
|
||||
typedef struct __ns_rr2 {
|
||||
ns_nname nname;
|
||||
size_t nnamel;
|
||||
int type;
|
||||
int rr_class;
|
||||
u_int ttl;
|
||||
int rdlength;
|
||||
const u_char * rdata;
|
||||
} ns_rr2;
|
||||
|
||||
/* Accessor macros - this is part of the public interface. */
|
||||
#define ns_rr_name(rr) (((rr).name[0] != '\0') ? (rr).name : ".")
|
||||
#define ns_rr_nname(rr) ((const ns_nname_t)(rr).nname)
|
||||
#define ns_rr_nnamel(rr) ((rr).nnamel + 0)
|
||||
#define ns_rr_type(rr) ((ns_type)((rr).type + 0))
|
||||
#define ns_rr_class(rr) ((ns_class)((rr).rr_class + 0))
|
||||
#define ns_rr_ttl(rr) ((u_long)(rr).ttl + 0)
|
||||
#define ns_rr_rdlen(rr) ((size_t)(rr).rdlength + 0)
|
||||
#define ns_rr_rdata(rr) ((rr).rdata + 0)
|
||||
|
||||
/*%
|
||||
* These don't have to be in the same order as in the packet flags word,
|
||||
* and they can even overlap in some cases, but they will need to be kept
|
||||
* in synch with ns_parse.c:ns_flagdata[].
|
||||
*/
|
||||
typedef enum __ns_flag {
|
||||
ns_f_qr, /*%< Question/Response. */
|
||||
ns_f_opcode, /*%< Operation code. */
|
||||
ns_f_aa, /*%< Authoritative Answer. */
|
||||
ns_f_tc, /*%< Truncation occurred. */
|
||||
ns_f_rd, /*%< Recursion Desired. */
|
||||
ns_f_ra, /*%< Recursion Available. */
|
||||
ns_f_z, /*%< MBZ. */
|
||||
ns_f_ad, /*%< Authentic Data (DNSSEC). */
|
||||
ns_f_cd, /*%< Checking Disabled (DNSSEC). */
|
||||
ns_f_rcode, /*%< Response code. */
|
||||
ns_f_max
|
||||
} ns_flag;
|
||||
|
||||
/*%
|
||||
* Currently defined opcodes.
|
||||
*/
|
||||
typedef enum __ns_opcode {
|
||||
ns_o_query = 0, /*%< Standard query. */
|
||||
ns_o_iquery = 1, /*%< Inverse query (deprecated/unsupported). */
|
||||
ns_o_status = 2, /*%< Name server status query (unsupported). */
|
||||
/* Opcode 3 is undefined/reserved. */
|
||||
ns_o_notify = 4, /*%< Zone change notification. */
|
||||
ns_o_update = 5, /*%< Zone update message. */
|
||||
ns_o_max = 6
|
||||
} ns_opcode;
|
||||
|
||||
/*%
|
||||
* Currently defined response codes.
|
||||
*/
|
||||
typedef enum __ns_rcode {
|
||||
ns_r_noerror = 0, /*%< No error occurred. */
|
||||
ns_r_formerr = 1, /*%< Format error. */
|
||||
ns_r_servfail = 2, /*%< Server failure. */
|
||||
ns_r_nxdomain = 3, /*%< Name error. */
|
||||
ns_r_notimpl = 4, /*%< Unimplemented. */
|
||||
ns_r_refused = 5, /*%< Operation refused. */
|
||||
/* these are for BIND_UPDATE */
|
||||
ns_r_yxdomain = 6, /*%< Name exists */
|
||||
ns_r_yxrrset = 7, /*%< RRset exists */
|
||||
ns_r_nxrrset = 8, /*%< RRset does not exist */
|
||||
ns_r_notauth = 9, /*%< Not authoritative for zone */
|
||||
ns_r_notzone = 10, /*%< Zone of record different from zone section */
|
||||
ns_r_max = 11,
|
||||
/* The following are EDNS extended rcodes */
|
||||
ns_r_badvers = 16,
|
||||
/* The following are TSIG errors */
|
||||
ns_r_badsig = 16,
|
||||
ns_r_badkey = 17,
|
||||
ns_r_badtime = 18
|
||||
} ns_rcode;
|
||||
|
||||
/* BIND_UPDATE */
|
||||
typedef enum __ns_update_operation {
|
||||
ns_uop_delete = 0,
|
||||
ns_uop_add = 1,
|
||||
ns_uop_max = 2
|
||||
} ns_update_operation;
|
||||
|
||||
/*%
|
||||
* This structure is used for TSIG authenticated messages
|
||||
*/
|
||||
struct ns_tsig_key {
|
||||
char name[NS_MAXDNAME], alg[NS_MAXDNAME];
|
||||
unsigned char *data;
|
||||
int len;
|
||||
};
|
||||
typedef struct ns_tsig_key ns_tsig_key;
|
||||
|
||||
/*%
|
||||
* This structure is used for TSIG authenticated TCP messages
|
||||
*/
|
||||
struct ns_tcp_tsig_state {
|
||||
int counter;
|
||||
struct dst_key *key;
|
||||
void *ctx;
|
||||
unsigned char sig[NS_PACKETSZ];
|
||||
int siglen;
|
||||
};
|
||||
typedef struct ns_tcp_tsig_state ns_tcp_tsig_state;
|
||||
|
||||
#define NS_TSIG_FUDGE 300
|
||||
#define NS_TSIG_TCP_COUNT 100
|
||||
#define NS_TSIG_ALG_HMAC_MD5 "HMAC-MD5.SIG-ALG.REG.INT"
|
||||
|
||||
#define NS_TSIG_ERROR_NO_TSIG -10
|
||||
#define NS_TSIG_ERROR_NO_SPACE -11
|
||||
#define NS_TSIG_ERROR_FORMERR -12
|
||||
|
||||
/*%
|
||||
* Currently defined type values for resources and queries.
|
||||
*/
|
||||
typedef enum __ns_type {
|
||||
ns_t_invalid = 0, /*%< Cookie. */
|
||||
ns_t_a = 1, /*%< Host address. */
|
||||
ns_t_ns = 2, /*%< Authoritative server. */
|
||||
ns_t_md = 3, /*%< Mail destination. */
|
||||
ns_t_mf = 4, /*%< Mail forwarder. */
|
||||
ns_t_cname = 5, /*%< Canonical name. */
|
||||
ns_t_soa = 6, /*%< Start of authority zone. */
|
||||
ns_t_mb = 7, /*%< Mailbox domain name. */
|
||||
ns_t_mg = 8, /*%< Mail group member. */
|
||||
ns_t_mr = 9, /*%< Mail rename name. */
|
||||
ns_t_null = 10, /*%< Null resource record. */
|
||||
ns_t_wks = 11, /*%< Well known service. */
|
||||
ns_t_ptr = 12, /*%< Domain name pointer. */
|
||||
ns_t_hinfo = 13, /*%< Host information. */
|
||||
ns_t_minfo = 14, /*%< Mailbox information. */
|
||||
ns_t_mx = 15, /*%< Mail routing information. */
|
||||
ns_t_txt = 16, /*%< Text strings. */
|
||||
ns_t_rp = 17, /*%< Responsible person. */
|
||||
ns_t_afsdb = 18, /*%< AFS cell database. */
|
||||
ns_t_x25 = 19, /*%< X_25 calling address. */
|
||||
ns_t_isdn = 20, /*%< ISDN calling address. */
|
||||
ns_t_rt = 21, /*%< Router. */
|
||||
ns_t_nsap = 22, /*%< NSAP address. */
|
||||
ns_t_nsap_ptr = 23, /*%< Reverse NSAP lookup (deprecated). */
|
||||
ns_t_sig = 24, /*%< Security signature. */
|
||||
ns_t_key = 25, /*%< Security key. */
|
||||
ns_t_px = 26, /*%< X.400 mail mapping. */
|
||||
ns_t_gpos = 27, /*%< Geographical position (withdrawn). */
|
||||
ns_t_aaaa = 28, /*%< IPv6 Address. */
|
||||
ns_t_loc = 29, /*%< Location Information. */
|
||||
ns_t_nxt = 30, /*%< Next domain (security). */
|
||||
ns_t_eid = 31, /*%< Endpoint identifier. */
|
||||
ns_t_nimloc = 32, /*%< Nimrod Locator. */
|
||||
ns_t_srv = 33, /*%< Server Selection. */
|
||||
ns_t_atma = 34, /*%< ATM Address */
|
||||
ns_t_naptr = 35, /*%< Naming Authority PoinTeR */
|
||||
ns_t_kx = 36, /*%< Key Exchange */
|
||||
ns_t_cert = 37, /*%< Certification record */
|
||||
ns_t_a6 = 38, /*%< IPv6 address (experimental) */
|
||||
ns_t_dname = 39, /*%< Non-terminal DNAME */
|
||||
ns_t_sink = 40, /*%< Kitchen sink (experimentatl) */
|
||||
ns_t_opt = 41, /*%< EDNS0 option (meta-RR) */
|
||||
ns_t_apl = 42, /*%< Address prefix list (RFC3123) */
|
||||
ns_t_ds = 43, /*%< Delegation Signer */
|
||||
ns_t_sshfp = 44, /*%< SSH Fingerprint */
|
||||
ns_t_ipseckey = 45, /*%< IPSEC Key */
|
||||
ns_t_rrsig = 46, /*%< RRset Signature */
|
||||
ns_t_nsec = 47, /*%< Negative security */
|
||||
ns_t_dnskey = 48, /*%< DNS Key */
|
||||
ns_t_dhcid = 49, /*%< Dynamic host configuratin identifier */
|
||||
ns_t_nsec3 = 50, /*%< Negative security type 3 */
|
||||
ns_t_nsec3param = 51, /*%< Negative security type 3 parameters */
|
||||
ns_t_hip = 55, /*%< Host Identity Protocol */
|
||||
ns_t_spf = 99, /*%< Sender Policy Framework */
|
||||
ns_t_tkey = 249, /*%< Transaction key */
|
||||
ns_t_tsig = 250, /*%< Transaction signature. */
|
||||
ns_t_ixfr = 251, /*%< Incremental zone transfer. */
|
||||
ns_t_axfr = 252, /*%< Transfer zone of authority. */
|
||||
ns_t_mailb = 253, /*%< Transfer mailbox records. */
|
||||
ns_t_maila = 254, /*%< Transfer mail agent records. */
|
||||
ns_t_any = 255, /*%< Wildcard match. */
|
||||
ns_t_zxfr = 256, /*%< BIND-specific, nonstandard. */
|
||||
ns_t_dlv = 32769, /*%< DNSSEC look-aside validatation. */
|
||||
ns_t_max = 65536
|
||||
} ns_type;
|
||||
|
||||
/* Exclusively a QTYPE? (not also an RTYPE) */
|
||||
#define ns_t_qt_p(t) (ns_t_xfr_p(t) || (t) == ns_t_any || \
|
||||
(t) == ns_t_mailb || (t) == ns_t_maila)
|
||||
/* Some kind of meta-RR? (not a QTYPE, but also not an RTYPE) */
|
||||
#define ns_t_mrr_p(t) ((t) == ns_t_tsig || (t) == ns_t_opt)
|
||||
/* Exclusively an RTYPE? (not also a QTYPE or a meta-RR) */
|
||||
#define ns_t_rr_p(t) (!ns_t_qt_p(t) && !ns_t_mrr_p(t))
|
||||
#define ns_t_udp_p(t) ((t) != ns_t_axfr && (t) != ns_t_zxfr)
|
||||
#define ns_t_xfr_p(t) ((t) == ns_t_axfr || (t) == ns_t_ixfr || \
|
||||
(t) == ns_t_zxfr)
|
||||
|
||||
/*%
|
||||
* Values for class field
|
||||
*/
|
||||
typedef enum __ns_class {
|
||||
ns_c_invalid = 0, /*%< Cookie. */
|
||||
ns_c_in = 1, /*%< Internet. */
|
||||
ns_c_2 = 2, /*%< unallocated/unsupported. */
|
||||
ns_c_chaos = 3, /*%< MIT Chaos-net. */
|
||||
ns_c_hs = 4, /*%< MIT Hesiod. */
|
||||
/* Query class values which do not appear in resource records */
|
||||
ns_c_none = 254, /*%< for prereq. sections in update requests */
|
||||
ns_c_any = 255, /*%< Wildcard match. */
|
||||
ns_c_max = 65536
|
||||
} ns_class;
|
||||
|
||||
/* DNSSEC constants. */
|
||||
|
||||
typedef enum __ns_key_types {
|
||||
ns_kt_rsa = 1, /*%< key type RSA/MD5 */
|
||||
ns_kt_dh = 2, /*%< Diffie Hellman */
|
||||
ns_kt_dsa = 3, /*%< Digital Signature Standard (MANDATORY) */
|
||||
ns_kt_private = 254 /*%< Private key type starts with OID */
|
||||
} ns_key_types;
|
||||
|
||||
typedef enum __ns_cert_types {
|
||||
cert_t_pkix = 1, /*%< PKIX (X.509v3) */
|
||||
cert_t_spki = 2, /*%< SPKI */
|
||||
cert_t_pgp = 3, /*%< PGP */
|
||||
cert_t_url = 253, /*%< URL private type */
|
||||
cert_t_oid = 254 /*%< OID private type */
|
||||
} ns_cert_types;
|
||||
|
||||
/* Flags field of the KEY RR rdata. */
|
||||
#define NS_KEY_TYPEMASK 0xC000 /*%< Mask for "type" bits */
|
||||
#define NS_KEY_TYPE_AUTH_CONF 0x0000 /*%< Key usable for both */
|
||||
#define NS_KEY_TYPE_CONF_ONLY 0x8000 /*%< Key usable for confidentiality */
|
||||
#define NS_KEY_TYPE_AUTH_ONLY 0x4000 /*%< Key usable for authentication */
|
||||
#define NS_KEY_TYPE_NO_KEY 0xC000 /*%< No key usable for either; no key */
|
||||
/* The type bits can also be interpreted independently, as single bits: */
|
||||
#define NS_KEY_NO_AUTH 0x8000 /*%< Key unusable for authentication */
|
||||
#define NS_KEY_NO_CONF 0x4000 /*%< Key unusable for confidentiality */
|
||||
#define NS_KEY_RESERVED2 0x2000 /* Security is *mandatory* if bit=0 */
|
||||
#define NS_KEY_EXTENDED_FLAGS 0x1000 /*%< reserved - must be zero */
|
||||
#define NS_KEY_RESERVED4 0x0800 /*%< reserved - must be zero */
|
||||
#define NS_KEY_RESERVED5 0x0400 /*%< reserved - must be zero */
|
||||
#define NS_KEY_NAME_TYPE 0x0300 /*%< these bits determine the type */
|
||||
#define NS_KEY_NAME_USER 0x0000 /*%< key is assoc. with user */
|
||||
#define NS_KEY_NAME_ENTITY 0x0200 /*%< key is assoc. with entity eg host */
|
||||
#define NS_KEY_NAME_ZONE 0x0100 /*%< key is zone key */
|
||||
#define NS_KEY_NAME_RESERVED 0x0300 /*%< reserved meaning */
|
||||
#define NS_KEY_RESERVED8 0x0080 /*%< reserved - must be zero */
|
||||
#define NS_KEY_RESERVED9 0x0040 /*%< reserved - must be zero */
|
||||
#define NS_KEY_RESERVED10 0x0020 /*%< reserved - must be zero */
|
||||
#define NS_KEY_RESERVED11 0x0010 /*%< reserved - must be zero */
|
||||
#define NS_KEY_SIGNATORYMASK 0x000F /*%< key can sign RR's of same name */
|
||||
#define NS_KEY_RESERVED_BITMASK ( NS_KEY_RESERVED2 | \
|
||||
NS_KEY_RESERVED4 | \
|
||||
NS_KEY_RESERVED5 | \
|
||||
NS_KEY_RESERVED8 | \
|
||||
NS_KEY_RESERVED9 | \
|
||||
NS_KEY_RESERVED10 | \
|
||||
NS_KEY_RESERVED11 )
|
||||
#define NS_KEY_RESERVED_BITMASK2 0xFFFF /*%< no bits defined here */
|
||||
|
||||
/* The Algorithm field of the KEY and SIG RR's is an integer, {1..254} */
|
||||
#define NS_ALG_MD5RSA 1 /*%< MD5 with RSA */
|
||||
#define NS_ALG_DH 2 /*%< Diffie Hellman KEY */
|
||||
#define NS_ALG_DSA 3 /*%< DSA KEY */
|
||||
#define NS_ALG_DSS NS_ALG_DSA
|
||||
#define NS_ALG_EXPIRE_ONLY 253 /*%< No alg, no security */
|
||||
#define NS_ALG_PRIVATE_OID 254 /*%< Key begins with OID giving alg */
|
||||
|
||||
/* Protocol values */
|
||||
/* value 0 is reserved */
|
||||
#define NS_KEY_PROT_TLS 1
|
||||
#define NS_KEY_PROT_EMAIL 2
|
||||
#define NS_KEY_PROT_DNSSEC 3
|
||||
#define NS_KEY_PROT_IPSEC 4
|
||||
#define NS_KEY_PROT_ANY 255
|
||||
|
||||
/* Signatures */
|
||||
#define NS_MD5RSA_MIN_BITS 512 /*%< Size of a mod or exp in bits */
|
||||
#define NS_MD5RSA_MAX_BITS 4096
|
||||
/* Total of binary mod and exp */
|
||||
#define NS_MD5RSA_MAX_BYTES ((NS_MD5RSA_MAX_BITS+7/8)*2+3)
|
||||
/* Max length of text sig block */
|
||||
#define NS_MD5RSA_MAX_BASE64 (((NS_MD5RSA_MAX_BYTES+2)/3)*4)
|
||||
#define NS_MD5RSA_MIN_SIZE ((NS_MD5RSA_MIN_BITS+7)/8)
|
||||
#define NS_MD5RSA_MAX_SIZE ((NS_MD5RSA_MAX_BITS+7)/8)
|
||||
|
||||
#define NS_DSA_SIG_SIZE 41
|
||||
#define NS_DSA_MIN_SIZE 213
|
||||
#define NS_DSA_MAX_BYTES 405
|
||||
|
||||
/* Offsets into SIG record rdata to find various values */
|
||||
#define NS_SIG_TYPE 0 /*%< Type flags */
|
||||
#define NS_SIG_ALG 2 /*%< Algorithm */
|
||||
#define NS_SIG_LABELS 3 /*%< How many labels in name */
|
||||
#define NS_SIG_OTTL 4 /*%< Original TTL */
|
||||
#define NS_SIG_EXPIR 8 /*%< Expiration time */
|
||||
#define NS_SIG_SIGNED 12 /*%< Signature time */
|
||||
#define NS_SIG_FOOT 16 /*%< Key footprint */
|
||||
#define NS_SIG_SIGNER 18 /*%< Domain name of who signed it */
|
||||
|
||||
/* How RR types are represented as bit-flags in NXT records */
|
||||
#define NS_NXT_BITS 8
|
||||
#define NS_NXT_BIT_SET( n,p) (p[(n)/NS_NXT_BITS] |= (0x80>>((n)%NS_NXT_BITS)))
|
||||
#define NS_NXT_BIT_CLEAR(n,p) (p[(n)/NS_NXT_BITS] &= ~(0x80>>((n)%NS_NXT_BITS)))
|
||||
#define NS_NXT_BIT_ISSET(n,p) (p[(n)/NS_NXT_BITS] & (0x80>>((n)%NS_NXT_BITS)))
|
||||
#define NS_NXT_MAX 127
|
||||
|
||||
/*%
|
||||
* EDNS0 extended flags and option codes, host order.
|
||||
*/
|
||||
#define NS_OPT_DNSSEC_OK 0x8000U
|
||||
#define NS_OPT_NSID 3
|
||||
|
||||
/*%
|
||||
* Inline versions of get/put short/long. Pointer is advanced.
|
||||
*/
|
||||
#define NS_GET16(s, cp) do { \
|
||||
const u_char *t_cp = (const u_char *)(cp); \
|
||||
(s) = ((uint16_t)t_cp[0] << 8) \
|
||||
| ((uint16_t)t_cp[1]) \
|
||||
; \
|
||||
(cp) += NS_INT16SZ; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define NS_GET32(l, cp) do { \
|
||||
const u_char *t_cp = (const u_char *)(cp); \
|
||||
(l) = ((uint32_t)t_cp[0] << 24) \
|
||||
| ((uint32_t)t_cp[1] << 16) \
|
||||
| ((uint32_t)t_cp[2] << 8) \
|
||||
| ((uint32_t)t_cp[3]) \
|
||||
; \
|
||||
(cp) += NS_INT32SZ; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define NS_PUT16(s, cp) do { \
|
||||
uint32_t t_s = (uint32_t)(s); \
|
||||
u_char *t_cp = (u_char *)(cp); \
|
||||
*t_cp++ = t_s >> 8; \
|
||||
*t_cp = t_s; \
|
||||
(cp) += NS_INT16SZ; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
#define NS_PUT32(l, cp) do { \
|
||||
uint32_t t_l = (uint32_t)(l); \
|
||||
u_char *t_cp = (u_char *)(cp); \
|
||||
*t_cp++ = t_l >> 24; \
|
||||
*t_cp++ = t_l >> 16; \
|
||||
*t_cp++ = t_l >> 8; \
|
||||
*t_cp = t_l; \
|
||||
(cp) += NS_INT32SZ; \
|
||||
} while (/*CONSTCOND*/0)
|
||||
|
||||
/*%
|
||||
* ANSI C identifier hiding for bind's lib/nameser.
|
||||
*/
|
||||
#define ns_msg_getflag __ns_msg_getflag
|
||||
#define ns_get16 __ns_get16
|
||||
#define ns_get32 __ns_get32
|
||||
#define ns_put16 __ns_put16
|
||||
#define ns_put32 __ns_put32
|
||||
#define ns_initparse __ns_initparse
|
||||
#define ns_skiprr __ns_skiprr
|
||||
#define ns_parserr __ns_parserr
|
||||
#define ns_parserr2 __ns_parserr2
|
||||
#define ns_sprintrr __ns_sprintrr
|
||||
#define ns_sprintrrf __ns_sprintrrf
|
||||
#define ns_format_ttl __ns_format_ttl
|
||||
#define ns_parse_ttl __ns_parse_ttl
|
||||
#define ns_datetosecs __ns_datetosecs
|
||||
#define ns_name_ntol __ns_name_ntol
|
||||
#define ns_name_ntop __ns_name_ntop
|
||||
#define ns_name_pton __ns_name_pton
|
||||
#define ns_name_pton2 __ns_name_pton2
|
||||
#define ns_name_unpack __ns_name_unpack
|
||||
#define ns_name_unpack2 __ns_name_unpack2
|
||||
#define ns_name_pack __ns_name_pack
|
||||
#define ns_name_compress __ns_name_compress
|
||||
#define ns_name_uncompress __ns_name_uncompress
|
||||
#define ns_name_skip __ns_name_skip
|
||||
#define ns_name_rollback __ns_name_rollback
|
||||
#define ns_name_length __ns_name_length
|
||||
#define ns_name_eq __ns_name_eq
|
||||
#define ns_name_owned __ns_name_owned
|
||||
#define ns_name_map __ns_name_map
|
||||
#define ns_name_labels __ns_name_labels
|
||||
#define ns_sign __ns_sign
|
||||
#define ns_sign2 __ns_sign2
|
||||
#define ns_sign_tcp __ns_sign_tcp
|
||||
#define ns_sign_tcp2 __ns_sign_tcp2
|
||||
#define ns_sign_tcp_init __ns_sign_tcp_init
|
||||
#define ns_find_tsig __ns_find_tsig
|
||||
#define ns_verify __ns_verify
|
||||
#define ns_verify_tcp __ns_verify_tcp
|
||||
#define ns_verify_tcp_init __ns_verify_tcp_init
|
||||
#define ns_samedomain __ns_samedomain
|
||||
#define ns_subdomain __ns_subdomain
|
||||
#define ns_makecanon __ns_makecanon
|
||||
#define ns_samename __ns_samename
|
||||
#define ns_newmsg_init __ns_newmsg_init
|
||||
#define ns_newmsg_copy __ns_newmsg_copy
|
||||
#define ns_newmsg_id __ns_newmsg_id
|
||||
#define ns_newmsg_flag __ns_newmsg_flag
|
||||
#define ns_newmsg_q __ns_newmsg_q
|
||||
#define ns_newmsg_rr __ns_newmsg_rr
|
||||
#define ns_newmsg_done __ns_newmsg_done
|
||||
#define ns_rdata_unpack __ns_rdata_unpack
|
||||
#define ns_rdata_equal __ns_rdata_equal
|
||||
#define ns_rdata_refers __ns_rdata_refers
|
||||
|
||||
__BEGIN_DECLS
|
||||
int ns_msg_getflag(ns_msg, int);
|
||||
uint16_t ns_get16(const u_char *);
|
||||
uint32_t ns_get32(const u_char *);
|
||||
void ns_put16(uint16_t, u_char *);
|
||||
void ns_put32(uint32_t, u_char *);
|
||||
int ns_initparse(const u_char *, int, ns_msg *);
|
||||
int ns_skiprr(const u_char *, const u_char *, ns_sect, int);
|
||||
int ns_parserr(ns_msg *, ns_sect, int, ns_rr *);
|
||||
int ns_parserr2(ns_msg *, ns_sect, int, ns_rr2 *);
|
||||
int ns_sprintrr(const ns_msg *, const ns_rr *,
|
||||
const char *, const char *, char *, size_t);
|
||||
int ns_sprintrrf(const u_char *, size_t, const char *,
|
||||
ns_class, ns_type, u_long, const u_char *,
|
||||
size_t, const char *, const char *,
|
||||
char *, size_t);
|
||||
int ns_format_ttl(u_long, char *, size_t);
|
||||
int ns_parse_ttl(const char *, u_long *);
|
||||
uint32_t ns_datetosecs(const char *cp, int *errp);
|
||||
int ns_name_ntol(const u_char *, u_char *, size_t);
|
||||
int ns_name_ntop(const u_char *, char *, size_t);
|
||||
int ns_name_pton(const char *, u_char *, size_t);
|
||||
int ns_name_pton2(const char *, u_char *, size_t, size_t *);
|
||||
int ns_name_unpack(const u_char *, const u_char *,
|
||||
const u_char *, u_char *, size_t);
|
||||
int ns_name_unpack2(const u_char *, const u_char *,
|
||||
const u_char *, u_char *, size_t,
|
||||
size_t *);
|
||||
int ns_name_pack(const u_char *, u_char *, int,
|
||||
const u_char **, const u_char **);
|
||||
int ns_name_uncompress(const u_char *, const u_char *,
|
||||
const u_char *, char *, size_t);
|
||||
int ns_name_compress(const char *, u_char *, size_t,
|
||||
const u_char **, const u_char **);
|
||||
int ns_name_skip(const u_char **, const u_char *);
|
||||
void ns_name_rollback(const u_char *, const u_char **,
|
||||
const u_char **);
|
||||
#ifndef __LIBC12_SOURCE__
|
||||
int ns_sign(u_char *, int *, int, int, void *,
|
||||
const u_char *, int, u_char *, int *, time_t)
|
||||
__RENAME(__ns_sign50);
|
||||
int ns_sign2(u_char *, int *, int, int, void *,
|
||||
const u_char *, int, u_char *, int *, time_t,
|
||||
u_char **, u_char **)
|
||||
__RENAME(__ns_sign250);
|
||||
#endif
|
||||
ssize_t ns_name_length(ns_nname_ct, size_t);
|
||||
int ns_name_eq(ns_nname_ct, size_t, ns_nname_ct, size_t);
|
||||
int ns_name_owned(ns_namemap_ct, int, ns_namemap_ct, int);
|
||||
int ns_name_map(ns_nname_ct, size_t, ns_namemap_t, int);
|
||||
int ns_name_labels(ns_nname_ct, size_t);
|
||||
int ns_sign_tcp(u_char *, int *, int, int,
|
||||
ns_tcp_tsig_state *, int);
|
||||
int ns_sign_tcp2(u_char *, int *, int, int,
|
||||
ns_tcp_tsig_state *, int,
|
||||
u_char **, u_char **);
|
||||
int ns_sign_tcp_init(void *, const u_char *, int,
|
||||
ns_tcp_tsig_state *);
|
||||
u_char *ns_find_tsig(u_char *, u_char *);
|
||||
#ifndef __LIBC12_SOURCE__
|
||||
int ns_verify(u_char *, int *, void *,
|
||||
const u_char *, int, u_char *, int *,
|
||||
time_t *, int)
|
||||
__RENAME(__ns_verify50);
|
||||
#endif
|
||||
int ns_verify_tcp(u_char *, int *, ns_tcp_tsig_state *, int);
|
||||
int ns_verify_tcp_init(void *, const u_char *, int,
|
||||
ns_tcp_tsig_state *);
|
||||
int ns_samedomain(const char *, const char *);
|
||||
int ns_subdomain(const char *, const char *);
|
||||
int ns_makecanon(const char *, char *, size_t);
|
||||
int ns_samename(const char *, const char *);
|
||||
int ns_newmsg_init(u_char *buffer, size_t bufsiz, ns_newmsg *);
|
||||
int ns_newmsg_copy(ns_newmsg *, ns_msg *);
|
||||
void ns_newmsg_id(ns_newmsg *handle, uint16_t id);
|
||||
void ns_newmsg_flag(ns_newmsg *handle, ns_flag flag, u_int value);
|
||||
int ns_newmsg_q(ns_newmsg *handle, ns_nname_ct qname,
|
||||
ns_type qtype, ns_class qclass);
|
||||
int ns_newmsg_rr(ns_newmsg *handle, ns_sect sect,
|
||||
ns_nname_ct name, ns_type type,
|
||||
ns_class rr_class, uint32_t ttl,
|
||||
uint16_t rdlen, const u_char *rdata);
|
||||
size_t ns_newmsg_done(ns_newmsg *handle);
|
||||
ssize_t ns_rdata_unpack(const u_char *, const u_char *, ns_type,
|
||||
const u_char *, size_t, u_char *, size_t);
|
||||
int ns_rdata_equal(ns_type,
|
||||
const u_char *, size_t,
|
||||
const u_char *, size_t);
|
||||
int ns_rdata_refers(ns_type,
|
||||
const u_char *, size_t,
|
||||
const u_char *);
|
||||
__END_DECLS
|
||||
|
||||
#ifdef BIND_4_COMPAT
|
||||
#include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#endif /* !_ARPA_NAMESER_H_ */
|
||||
|
|
@ -1,232 +0,0 @@
|
|||
/* $NetBSD: nameser_compat.h,v 1.6 2015/02/24 17:57:08 christos Exp $ */
|
||||
|
||||
/* Copyright (c) 1983, 1989
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*%
|
||||
* from nameser.h 8.1 (Berkeley) 6/2/93
|
||||
* Id: nameser_compat.h,v 1.8 2006/05/19 02:33:40 marka Exp
|
||||
*/
|
||||
|
||||
#ifndef _ARPA_NAMESER_COMPAT_
|
||||
#define _ARPA_NAMESER_COMPAT_
|
||||
|
||||
#define __BIND 19950621 /*%< (DEAD) interface version stamp. */
|
||||
|
||||
#ifndef BYTE_ORDER
|
||||
#if (BSD >= 199103)
|
||||
# include <machine/endian.h>
|
||||
#else
|
||||
#ifdef __linux
|
||||
# include <endian.h>
|
||||
#else
|
||||
#define LITTLE_ENDIAN 1234 /*%< least-significant byte first (vax, pc) */
|
||||
#define BIG_ENDIAN 4321 /*%< most-significant byte first (IBM, net) */
|
||||
#define PDP_ENDIAN 3412 /*%< LSB first in word, MSW first in long (pdp) */
|
||||
|
||||
#if defined(vax) || defined(ns32000) || defined(sun386) || defined(i386) || \
|
||||
defined(MIPSEL) || defined(_MIPSEL) || defined(BIT_ZERO_ON_RIGHT) || \
|
||||
defined(__i386__) || defined(__i386) || defined(__amd64__) || \
|
||||
defined(__x86_64__) || defined(MIPSEL) || defined(_MIPSEL) || \
|
||||
defined(BIT_ZERO_ON_RIGHT) || defined(__alpha__) || defined(__alpha) || \
|
||||
(defined(__Lynx__) && defined(__x86__))
|
||||
#define BYTE_ORDER LITTLE_ENDIAN
|
||||
#endif
|
||||
|
||||
#if defined(sel) || defined(pyr) || defined(mc68000) || defined(sparc) || \
|
||||
defined(is68k) || defined(tahoe) || defined(ibm032) || defined(ibm370) || \
|
||||
defined(MIPSEB) || defined(_MIPSEB) || defined(_IBMR2) || defined(DGUX) ||\
|
||||
defined(apollo) || defined(__convex__) || defined(_CRAY) || \
|
||||
defined(__hppa) || defined(__hp9000) || \
|
||||
defined(__hp9000s300) || defined(__hp9000s700) || \
|
||||
defined(__hp3000s900) || defined(__hpux) || defined(MPE) || \
|
||||
defined (BIT_ZERO_ON_LEFT) || defined(m68k) || defined(__sparc) || \
|
||||
(defined(__Lynx__) && \
|
||||
(defined(__68k__) || defined(__sparc__) || defined(__powerpc__)))
|
||||
#define BYTE_ORDER BIG_ENDIAN
|
||||
#endif
|
||||
#endif /* __linux */
|
||||
#endif /* BSD */
|
||||
#endif /* BYTE_ORDER */
|
||||
|
||||
#if !defined(BYTE_ORDER) || \
|
||||
(BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN && \
|
||||
BYTE_ORDER != PDP_ENDIAN)
|
||||
/* you must determine what the correct bit order is for
|
||||
* your compiler - the next line is an intentional error
|
||||
* which will force your compiles to bomb until you fix
|
||||
* the above macros.
|
||||
*/
|
||||
error "Undefined or invalid BYTE_ORDER";
|
||||
#endif
|
||||
|
||||
/*%
|
||||
* Structure for query header. The order of the fields is machine- and
|
||||
* compiler-dependent, depending on the byte/bit order and the layout
|
||||
* of bit fields. We use bit fields only in int variables, as this
|
||||
* is all ANSI requires. This requires a somewhat confusing rearrangement.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
unsigned id :16; /*%< query identification number */
|
||||
#if BYTE_ORDER == BIG_ENDIAN
|
||||
/* fields in third byte */
|
||||
unsigned qr: 1; /*%< response flag */
|
||||
unsigned opcode: 4; /*%< purpose of message */
|
||||
unsigned aa: 1; /*%< authoritive answer */
|
||||
unsigned tc: 1; /*%< truncated message */
|
||||
unsigned rd: 1; /*%< recursion desired */
|
||||
/* fields in fourth byte */
|
||||
unsigned ra: 1; /*%< recursion available */
|
||||
unsigned unused :1; /*%< unused bits (MBZ as of 4.9.3a3) */
|
||||
unsigned ad: 1; /*%< authentic data from named */
|
||||
unsigned cd: 1; /*%< checking disabled by resolver */
|
||||
unsigned rcode :4; /*%< response code */
|
||||
#endif
|
||||
#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN
|
||||
/* fields in third byte */
|
||||
unsigned rd :1; /*%< recursion desired */
|
||||
unsigned tc :1; /*%< truncated message */
|
||||
unsigned aa :1; /*%< authoritive answer */
|
||||
unsigned opcode :4; /*%< purpose of message */
|
||||
unsigned qr :1; /*%< response flag */
|
||||
/* fields in fourth byte */
|
||||
unsigned rcode :4; /*%< response code */
|
||||
unsigned cd: 1; /*%< checking disabled by resolver */
|
||||
unsigned ad: 1; /*%< authentic data from named */
|
||||
unsigned unused :1; /*%< unused bits (MBZ as of 4.9.3a3) */
|
||||
unsigned ra :1; /*%< recursion available */
|
||||
#endif
|
||||
/* remaining bytes */
|
||||
unsigned qdcount :16; /*%< number of question entries */
|
||||
unsigned ancount :16; /*%< number of answer entries */
|
||||
unsigned nscount :16; /*%< number of authority entries */
|
||||
unsigned arcount :16; /*%< number of resource entries */
|
||||
} HEADER;
|
||||
|
||||
#define PACKETSZ NS_PACKETSZ
|
||||
#define MAXDNAME NS_MAXDNAME
|
||||
#define MAXCDNAME NS_MAXCDNAME
|
||||
#define MAXLABEL NS_MAXLABEL
|
||||
#define HFIXEDSZ NS_HFIXEDSZ
|
||||
#define QFIXEDSZ NS_QFIXEDSZ
|
||||
#define RRFIXEDSZ NS_RRFIXEDSZ
|
||||
#define INT32SZ NS_INT32SZ
|
||||
#define INT16SZ NS_INT16SZ
|
||||
#define INT8SZ NS_INT8SZ
|
||||
#define INADDRSZ NS_INADDRSZ
|
||||
#define IN6ADDRSZ NS_IN6ADDRSZ
|
||||
#define INDIR_MASK NS_CMPRSFLGS
|
||||
#define NAMESERVER_PORT NS_DEFAULTPORT
|
||||
|
||||
#define S_ZONE ns_s_zn
|
||||
#define S_PREREQ ns_s_pr
|
||||
#define S_UPDATE ns_s_ud
|
||||
#define S_ADDT ns_s_ar
|
||||
|
||||
#define QUERY ns_o_query
|
||||
#define IQUERY ns_o_iquery
|
||||
#define STATUS ns_o_status
|
||||
#define NS_NOTIFY_OP ns_o_notify
|
||||
#define NS_UPDATE_OP ns_o_update
|
||||
|
||||
#define NOERROR ns_r_noerror
|
||||
#define FORMERR ns_r_formerr
|
||||
#define SERVFAIL ns_r_servfail
|
||||
#define NXDOMAIN ns_r_nxdomain
|
||||
#define NOTIMP ns_r_notimpl
|
||||
#define REFUSED ns_r_refused
|
||||
#define YXDOMAIN ns_r_yxdomain
|
||||
#define YXRRSET ns_r_yxrrset
|
||||
#define NXRRSET ns_r_nxrrset
|
||||
#define NOTAUTH ns_r_notauth
|
||||
#define NOTZONE ns_r_notzone
|
||||
/*#define BADSIG ns_r_badsig*/
|
||||
/*#define BADKEY ns_r_badkey*/
|
||||
/*#define BADTIME ns_r_badtime*/
|
||||
|
||||
|
||||
#define DELETE ns_uop_delete
|
||||
#define ADD ns_uop_add
|
||||
|
||||
#define T_A ns_t_a
|
||||
#define T_NS ns_t_ns
|
||||
#define T_MD ns_t_md
|
||||
#define T_MF ns_t_mf
|
||||
#define T_CNAME ns_t_cname
|
||||
#define T_SOA ns_t_soa
|
||||
#define T_MB ns_t_mb
|
||||
#define T_MG ns_t_mg
|
||||
#define T_MR ns_t_mr
|
||||
#define T_NULL ns_t_null
|
||||
#define T_WKS ns_t_wks
|
||||
#define T_PTR ns_t_ptr
|
||||
#define T_HINFO ns_t_hinfo
|
||||
#define T_MINFO ns_t_minfo
|
||||
#define T_MX ns_t_mx
|
||||
#define T_TXT ns_t_txt
|
||||
#define T_RP ns_t_rp
|
||||
#define T_AFSDB ns_t_afsdb
|
||||
#define T_X25 ns_t_x25
|
||||
#define T_ISDN ns_t_isdn
|
||||
#define T_RT ns_t_rt
|
||||
#define T_NSAP ns_t_nsap
|
||||
#define T_NSAP_PTR ns_t_nsap_ptr
|
||||
#define T_SIG ns_t_sig
|
||||
#define T_KEY ns_t_key
|
||||
#define T_PX ns_t_px
|
||||
#define T_GPOS ns_t_gpos
|
||||
#define T_AAAA ns_t_aaaa
|
||||
#define T_LOC ns_t_loc
|
||||
#define T_NXT ns_t_nxt
|
||||
#define T_EID ns_t_eid
|
||||
#define T_NIMLOC ns_t_nimloc
|
||||
#define T_SRV ns_t_srv
|
||||
#define T_ATMA ns_t_atma
|
||||
#define T_NAPTR ns_t_naptr
|
||||
#define T_A6 ns_t_a6
|
||||
#define T_TSIG ns_t_tsig
|
||||
#define T_IXFR ns_t_ixfr
|
||||
#define T_AXFR ns_t_axfr
|
||||
#define T_MAILB ns_t_mailb
|
||||
#define T_MAILA ns_t_maila
|
||||
#define T_ANY ns_t_any
|
||||
|
||||
#define C_IN ns_c_in
|
||||
#define C_CHAOS ns_c_chaos
|
||||
#define C_HS ns_c_hs
|
||||
/* BIND_UPDATE */
|
||||
#define C_NONE ns_c_none
|
||||
#define C_ANY ns_c_any
|
||||
|
||||
#define GETSHORT NS_GET16
|
||||
#define GETLONG NS_GET32
|
||||
#define PUTSHORT NS_PUT16
|
||||
#define PUTLONG NS_PUT32
|
||||
|
||||
#endif /* _ARPA_NAMESER_COMPAT_ */
|
||||
|
|
@ -1,354 +0,0 @@
|
|||
/* $NetBSD: telnet.h,v 1.12 2006/01/24 17:13:59 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)telnet.h 8.2 (Berkeley) 12/15/93
|
||||
*/
|
||||
|
||||
#ifndef _ARPA_TELNET_H_
|
||||
#define _ARPA_TELNET_H_
|
||||
|
||||
/*
|
||||
* Definitions for the TELNET protocol.
|
||||
*/
|
||||
#define IAC 255 /* interpret as command: */
|
||||
#define DONT 254 /* you are not to use option */
|
||||
#define DO 253 /* please, you use option */
|
||||
#define WONT 252 /* I won't use option */
|
||||
#define WILL 251 /* I will use option */
|
||||
#define SB 250 /* interpret as subnegotiation */
|
||||
#define GA 249 /* you may reverse the line */
|
||||
#define EL 248 /* erase the current line */
|
||||
#define EC 247 /* erase the current character */
|
||||
#define AYT 246 /* are you there */
|
||||
#define AO 245 /* abort output--but let prog finish */
|
||||
#define IP 244 /* interrupt process--permanently */
|
||||
#define BREAK 243 /* break */
|
||||
#define DM 242 /* data mark--for connect. cleaning */
|
||||
#define NOP 241 /* nop */
|
||||
#define SE 240 /* end sub negotiation */
|
||||
#define EOR 239 /* end of record (transparent mode) */
|
||||
#define ABORT 238 /* Abort process */
|
||||
#define SUSP 237 /* Suspend process */
|
||||
#define xEOF 236 /* End of file: EOF is already used... */
|
||||
|
||||
#define SYNCH 242 /* for telfunc calls */
|
||||
|
||||
#ifdef TELCMDS
|
||||
const char *telcmds[] = {
|
||||
"EOF", "SUSP", "ABORT", "EOR",
|
||||
"SE", "NOP", "DMARK", "BRK", "IP", "AO", "AYT", "EC",
|
||||
"EL", "GA", "SB", "WILL", "WONT", "DO", "DONT", "IAC", 0
|
||||
};
|
||||
#else
|
||||
extern const char *telcmds[];
|
||||
#endif
|
||||
|
||||
#define TELCMD_FIRST xEOF
|
||||
#define TELCMD_LAST IAC
|
||||
#define TELCMD_OK(x) ((unsigned int)(x) <= TELCMD_LAST && \
|
||||
(unsigned int)(x) >= TELCMD_FIRST)
|
||||
#define TELCMD(x) telcmds[(x)-TELCMD_FIRST]
|
||||
|
||||
/* telnet options */
|
||||
#define TELOPT_BINARY 0 /* 8-bit data path */
|
||||
#define TELOPT_ECHO 1 /* echo */
|
||||
#define TELOPT_RCP 2 /* prepare to reconnect */
|
||||
#define TELOPT_SGA 3 /* suppress go ahead */
|
||||
#define TELOPT_NAMS 4 /* approximate message size */
|
||||
#define TELOPT_STATUS 5 /* give status */
|
||||
#define TELOPT_TM 6 /* timing mark */
|
||||
#define TELOPT_RCTE 7 /* remote controlled transmission and echo */
|
||||
#define TELOPT_NAOL 8 /* negotiate about output line width */
|
||||
#define TELOPT_NAOP 9 /* negotiate about output page size */
|
||||
#define TELOPT_NAOCRD 10 /* negotiate about CR disposition */
|
||||
#define TELOPT_NAOHTS 11 /* negotiate about horizontal tabstops */
|
||||
#define TELOPT_NAOHTD 12 /* negotiate about horizontal tab disposition */
|
||||
#define TELOPT_NAOFFD 13 /* negotiate about formfeed disposition */
|
||||
#define TELOPT_NAOVTS 14 /* negotiate about vertical tab stops */
|
||||
#define TELOPT_NAOVTD 15 /* negotiate about vertical tab disposition */
|
||||
#define TELOPT_NAOLFD 16 /* negotiate about output LF disposition */
|
||||
#define TELOPT_XASCII 17 /* extended ascic character set */
|
||||
#define TELOPT_LOGOUT 18 /* force logout */
|
||||
#define TELOPT_BM 19 /* byte macro */
|
||||
#define TELOPT_DET 20 /* data entry terminal */
|
||||
#define TELOPT_SUPDUP 21 /* supdup protocol */
|
||||
#define TELOPT_SUPDUPOUTPUT 22 /* supdup output */
|
||||
#define TELOPT_SNDLOC 23 /* send location */
|
||||
#define TELOPT_TTYPE 24 /* terminal type */
|
||||
#define TELOPT_EOR 25 /* end or record */
|
||||
#define TELOPT_TUID 26 /* TACACS user identification */
|
||||
#define TELOPT_OUTMRK 27 /* output marking */
|
||||
#define TELOPT_TTYLOC 28 /* terminal location number */
|
||||
#define TELOPT_3270REGIME 29 /* 3270 regime */
|
||||
#define TELOPT_X3PAD 30 /* X.3 PAD */
|
||||
#define TELOPT_NAWS 31 /* window size */
|
||||
#define TELOPT_TSPEED 32 /* terminal speed */
|
||||
#define TELOPT_LFLOW 33 /* remote flow control */
|
||||
#define TELOPT_LINEMODE 34 /* Linemode option */
|
||||
#define TELOPT_XDISPLOC 35 /* X Display Location */
|
||||
#define TELOPT_OLD_ENVIRON 36 /* Old - Environment variables */
|
||||
#define TELOPT_AUTHENTICATION 37/* Authenticate */
|
||||
#define TELOPT_ENCRYPT 38 /* Encryption option */
|
||||
#define TELOPT_NEW_ENVIRON 39 /* New - Environment variables */
|
||||
#define TELOPT_TN3270E 40 /* RFC2355 - TN3270 Enhancements */
|
||||
#define TELOPT_CHARSET 42 /* RFC2066 - Charset */
|
||||
#define TELOPT_COMPORT 44 /* RFC2217 - Com Port Control */
|
||||
#define TELOPT_KERMIT 47 /* RFC2840 - Kermit */
|
||||
#define TELOPT_EXOPL 255 /* extended-options-list */
|
||||
|
||||
|
||||
#define TELOPT_FIRST TELOPT_BINARY
|
||||
#define TELOPT_LAST TELOPT_KERMIT
|
||||
#define TELOPT_OK(x) ((unsigned int)(x) <= TELOPT_LAST)
|
||||
#define TELOPT(x) telopts[(x)-TELOPT_FIRST]
|
||||
|
||||
#define NTELOPTS (1+TELOPT_LAST)
|
||||
|
||||
#ifdef TELOPTS
|
||||
const char *telopts[NTELOPTS+1] = {
|
||||
"BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME",
|
||||
"STATUS", "TIMING MARK", "RCTE", "NAOL", "NAOP",
|
||||
"NAOCRD", "NAOHTS", "NAOHTD", "NAOFFD", "NAOVTS",
|
||||
"NAOVTD", "NAOLFD", "EXTEND ASCII", "LOGOUT", "BYTE MACRO",
|
||||
"DATA ENTRY TERMINAL", "SUPDUP", "SUPDUP OUTPUT",
|
||||
"SEND LOCATION", "TERMINAL TYPE", "END OF RECORD",
|
||||
"TACACS UID", "OUTPUT MARKING", "TTYLOC",
|
||||
"3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", "LFLOW",
|
||||
"LINEMODE", "XDISPLOC", "OLD-ENVIRON", "AUTHENTICATION",
|
||||
"ENCRYPT", "NEW-ENVIRON", "TN3270E", "CHARSET", "COM-PORT",
|
||||
"KERMIT",
|
||||
0
|
||||
};
|
||||
#else
|
||||
extern const char *telopts[NTELOPTS+1];
|
||||
#endif
|
||||
|
||||
/* sub-option qualifiers */
|
||||
#define TELQUAL_IS 0 /* option is... */
|
||||
#define TELQUAL_SEND 1 /* send option */
|
||||
#define TELQUAL_INFO 2 /* ENVIRON: informational version of IS */
|
||||
#define TELQUAL_REPLY 2 /* AUTHENTICATION: client version of IS */
|
||||
#define TELQUAL_NAME 3 /* AUTHENTICATION: client version of IS */
|
||||
|
||||
#define LFLOW_OFF 0 /* Disable remote flow control */
|
||||
#define LFLOW_ON 1 /* Enable remote flow control */
|
||||
#define LFLOW_RESTART_ANY 2 /* Restart output on any char */
|
||||
#define LFLOW_RESTART_XON 3 /* Restart output only on XON */
|
||||
|
||||
/*
|
||||
* LINEMODE suboptions
|
||||
*/
|
||||
|
||||
#define LM_MODE 1
|
||||
#define LM_FORWARDMASK 2
|
||||
#define LM_SLC 3
|
||||
|
||||
#define MODE_EDIT 0x01
|
||||
#define MODE_TRAPSIG 0x02
|
||||
#define MODE_ACK 0x04
|
||||
#define MODE_SOFT_TAB 0x08
|
||||
#define MODE_LIT_ECHO 0x10
|
||||
|
||||
#define MODE_MASK 0x1f
|
||||
|
||||
/* Not part of protocol, but needed to simplify things... */
|
||||
#define MODE_FLOW 0x0100
|
||||
#define MODE_ECHO 0x0200
|
||||
#define MODE_INBIN 0x0400
|
||||
#define MODE_OUTBIN 0x0800
|
||||
#define MODE_FORCE 0x1000
|
||||
|
||||
#define SLC_SYNCH 1
|
||||
#define SLC_BRK 2
|
||||
#define SLC_IP 3
|
||||
#define SLC_AO 4
|
||||
#define SLC_AYT 5
|
||||
#define SLC_EOR 6
|
||||
#define SLC_ABORT 7
|
||||
#define SLC_EOF 8
|
||||
#define SLC_SUSP 9
|
||||
#define SLC_EC 10
|
||||
#define SLC_EL 11
|
||||
#define SLC_EW 12
|
||||
#define SLC_RP 13
|
||||
#define SLC_LNEXT 14
|
||||
#define SLC_XON 15
|
||||
#define SLC_XOFF 16
|
||||
#define SLC_FORW1 17
|
||||
#define SLC_FORW2 18
|
||||
#define SLC_MCL 19
|
||||
#define SLC_MCR 20
|
||||
#define SLC_MCWL 21
|
||||
#define SLC_MCWR 22
|
||||
#define SLC_MCBOL 23
|
||||
#define SLC_MCEOL 24
|
||||
#define SLC_INSRT 25
|
||||
#define SLC_OVER 26
|
||||
#define SLC_ECR 27
|
||||
#define SLC_EWR 28
|
||||
#define SLC_EBOL 29
|
||||
#define SLC_EEOL 30
|
||||
|
||||
#define NSLC 30
|
||||
|
||||
/*
|
||||
* For backwards compatibility, we define SLC_NAMES to be the
|
||||
* list of names if SLC_NAMES is not defined.
|
||||
*/
|
||||
#define SLC_NAMELIST "0", "SYNCH", "BRK", "IP", "AO", "AYT", "EOR", \
|
||||
"ABORT", "EOF", "SUSP", "EC", "EL", "EW", "RP", \
|
||||
"LNEXT", "XON", "XOFF", "FORW1", "FORW2", \
|
||||
"MCL", "MCR", "MCWL", "MCWR", "MCBOL", \
|
||||
"MCEOL", "INSRT", "OVER", "ECR", "EWR", \
|
||||
"EBOL", "EEOL", \
|
||||
0
|
||||
|
||||
#ifdef SLC_NAMES
|
||||
char *slc_names[] = {
|
||||
SLC_NAMELIST
|
||||
};
|
||||
#else
|
||||
extern char *slc_names[];
|
||||
#define SLC_NAMES SLC_NAMELIST
|
||||
#endif
|
||||
|
||||
#define SLC_NAME_OK(x) ((unsigned int)(x) <= NSLC)
|
||||
#define SLC_NAME(x) slc_names[x]
|
||||
|
||||
#define SLC_NOSUPPORT 0
|
||||
#define SLC_CANTCHANGE 1
|
||||
#define SLC_VARIABLE 2
|
||||
#define SLC_DEFAULT 3
|
||||
#define SLC_LEVELBITS 0x03
|
||||
|
||||
#define SLC_FUNC 0
|
||||
#define SLC_FLAGS 1
|
||||
#define SLC_VALUE 2
|
||||
|
||||
#define SLC_ACK 0x80
|
||||
#define SLC_FLUSHIN 0x40
|
||||
#define SLC_FLUSHOUT 0x20
|
||||
|
||||
#define OLD_ENV_VAR 1
|
||||
#define OLD_ENV_VALUE 0
|
||||
#define NEW_ENV_VAR 0
|
||||
#define NEW_ENV_VALUE 1
|
||||
#define ENV_ESC 2
|
||||
#define ENV_USERVAR 3
|
||||
|
||||
/*
|
||||
* AUTHENTICATION suboptions
|
||||
*/
|
||||
|
||||
/*
|
||||
* Who is authenticating who ...
|
||||
*/
|
||||
#define AUTH_WHO_CLIENT 0 /* Client authenticating server */
|
||||
#define AUTH_WHO_SERVER 1 /* Server authenticating client */
|
||||
#define AUTH_WHO_MASK 1
|
||||
|
||||
/*
|
||||
* amount of authentication done
|
||||
*/
|
||||
#define AUTH_HOW_ONE_WAY 0
|
||||
#define AUTH_HOW_MUTUAL 2
|
||||
#define AUTH_HOW_MASK 2
|
||||
|
||||
/*
|
||||
* should we be encrypting? (not yet formally standardized)
|
||||
*/
|
||||
#define AUTH_ENCRYPT_OFF 0
|
||||
#define AUTH_ENCRYPT_ON 4
|
||||
#define AUTH_ENCRYPT_MASK 4
|
||||
|
||||
#define AUTHTYPE_NULL 0
|
||||
#define AUTHTYPE_KERBEROS_V4 1
|
||||
#define AUTHTYPE_KERBEROS_V5 2
|
||||
#define AUTHTYPE_SPX 3
|
||||
#define AUTHTYPE_MINK 4
|
||||
#define AUTHTYPE_SRA 6
|
||||
#define AUTHTYPE_CNT 7
|
||||
|
||||
#define AUTHTYPE_TEST 99
|
||||
|
||||
#ifdef AUTH_NAMES
|
||||
const char *authtype_names[] = {
|
||||
"NULL", "KERBEROS_V4", "KERBEROS_V5", "SPX", "MINK", NULL, "SRA",
|
||||
0
|
||||
};
|
||||
#else
|
||||
extern const char *authtype_names[];
|
||||
#endif
|
||||
|
||||
#define AUTHTYPE_NAME_OK(x) ((unsigned int)(x) < AUTHTYPE_CNT)
|
||||
#define AUTHTYPE_NAME(x) authtype_names[x]
|
||||
|
||||
/*
|
||||
* ENCRYPTion suboptions
|
||||
*/
|
||||
#define ENCRYPT_IS 0 /* I pick encryption type ... */
|
||||
#define ENCRYPT_SUPPORT 1 /* I support encryption types ... */
|
||||
#define ENCRYPT_REPLY 2 /* Initial setup response */
|
||||
#define ENCRYPT_START 3 /* Am starting to send encrypted */
|
||||
#define ENCRYPT_END 4 /* Am ending encrypted */
|
||||
#define ENCRYPT_REQSTART 5 /* Request you start encrypting */
|
||||
#define ENCRYPT_REQEND 6 /* Request you send encrypting */
|
||||
#define ENCRYPT_ENC_KEYID 7
|
||||
#define ENCRYPT_DEC_KEYID 8
|
||||
#define ENCRYPT_CNT 9
|
||||
|
||||
#define ENCTYPE_ANY 0
|
||||
#define ENCTYPE_DES_CFB64 1
|
||||
#define ENCTYPE_DES_OFB64 2
|
||||
#define ENCTYPE_CNT 3
|
||||
|
||||
#ifdef ENCRYPT_NAMES
|
||||
const char *encrypt_names[] = {
|
||||
"IS", "SUPPORT", "REPLY", "START", "END",
|
||||
"REQUEST-START", "REQUEST-END", "ENC-KEYID", "DEC-KEYID",
|
||||
0
|
||||
};
|
||||
const char *enctype_names[] = {
|
||||
"ANY", "DES_CFB64", "DES_OFB64",
|
||||
0
|
||||
};
|
||||
#else
|
||||
extern const char *encrypt_names[];
|
||||
extern const char *enctype_names[];
|
||||
#endif
|
||||
|
||||
|
||||
#define ENCRYPT_NAME_OK(x) ((unsigned int)(x) < ENCRYPT_CNT)
|
||||
#define ENCRYPT_NAME(x) encrypt_names[x]
|
||||
|
||||
#define ENCTYPE_NAME_OK(x) ((unsigned int)(x) < ENCTYPE_CNT)
|
||||
#define ENCTYPE_NAME(x) enctype_names[x]
|
||||
|
||||
#endif /* _ARPA_TELNET_H_ */
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
/* $NetBSD: tftp.h,v 1.8 2003/08/07 09:44:12 agc Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)tftp.h 8.1 (Berkeley) 6/2/93
|
||||
*/
|
||||
|
||||
#ifndef _ARPA_TFTP_H_
|
||||
#define _ARPA_TFTP_H_
|
||||
|
||||
/*
|
||||
* Trivial File Transfer Protocol (IEN-133)
|
||||
*/
|
||||
#define SEGSIZE 512 /* data segment size */
|
||||
#define MAXSEGSIZE 65464 /* maximum negotiated data segment size */
|
||||
|
||||
#define PKTSIZE SEGSIZE + 4
|
||||
#define MAXPKTSIZE MAXSEGSIZE + 4
|
||||
|
||||
/*
|
||||
* Packet types.
|
||||
*/
|
||||
#define RRQ 01 /* read request */
|
||||
#define WRQ 02 /* write request */
|
||||
#define DATA 03 /* data packet */
|
||||
#define ACK 04 /* acknowledgement */
|
||||
#define ERROR 05 /* error code */
|
||||
#define OACK 06 /* option acknowledgement */
|
||||
|
||||
struct tftphdr {
|
||||
short th_opcode; /* packet type */
|
||||
union {
|
||||
unsigned short tu_block; /* block # */
|
||||
short tu_code; /* error code */
|
||||
char tu_stuff[1]; /* request packet stuff */
|
||||
} th_u;
|
||||
char th_data[1]; /* data or error string */
|
||||
};
|
||||
|
||||
#define th_block th_u.tu_block
|
||||
#define th_code th_u.tu_code
|
||||
#define th_stuff th_u.tu_stuff
|
||||
#define th_msg th_data
|
||||
|
||||
/*
|
||||
* Error codes.
|
||||
*/
|
||||
#define EUNDEF 0 /* not defined */
|
||||
#define ENOTFOUND 1 /* file not found */
|
||||
#define EACCESS 2 /* access violation */
|
||||
#define ENOSPACE 3 /* disk full or allocation exceeded */
|
||||
#define EBADOP 4 /* illegal TFTP operation */
|
||||
#define EBADID 5 /* unknown transfer ID */
|
||||
#define EEXISTS 6 /* file already exists */
|
||||
#define ENOUSER 7 /* no such user */
|
||||
#define EOPTNEG 8 /* option negotiation failed */
|
||||
|
||||
#endif /* _ARPA_TFTP_H_ */
|
||||
106
include/assert.h
106
include/assert.h
|
|
@ -1,106 +0,0 @@
|
|||
/* $NetBSD: assert.h,v 1.21 2011/08/26 01:10:49 joerg Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
* (c) UNIX System Laboratories, Inc.
|
||||
* All or some portions of this file are derived from material licensed
|
||||
* to the University of California by American Telephone and Telegraph
|
||||
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
|
||||
* the permission of UNIX System Laboratories, Inc.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)assert.h 8.2 (Berkeley) 1/21/94
|
||||
*/
|
||||
|
||||
/*
|
||||
* Unlike other ANSI header files, <assert.h> may usefully be included
|
||||
* multiple times, with and without NDEBUG defined.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/featuretest.h>
|
||||
#include <sys/null.h>
|
||||
|
||||
#undef assert
|
||||
|
||||
#ifdef NDEBUG
|
||||
# ifndef __lint__
|
||||
# define assert(e) (__static_cast(void,0))
|
||||
# else /* !__lint__ */
|
||||
# define assert(e)
|
||||
# endif /* __lint__ */
|
||||
#else /* !NDEBUG */
|
||||
# if __STDC__
|
||||
# define assert(e) \
|
||||
((e) ? __static_cast(void,0) : __assert13(__FILE__, __LINE__, \
|
||||
__assert_function__, #e))
|
||||
# else /* PCC */
|
||||
# define assert(e) \
|
||||
((e) ? __static_cast(void,0) : __assert13(__FILE__, __LINE__, \
|
||||
__assert_function__, "e"))
|
||||
# endif /* !__STDC__ */
|
||||
#endif /* NDEBUG */
|
||||
|
||||
#undef _DIAGASSERT
|
||||
#if !defined(_DIAGNOSTIC)
|
||||
# if !defined(__lint__)
|
||||
# define _DIAGASSERT(e) (__static_cast(void,0))
|
||||
# else /* !__lint__ */
|
||||
# define _DIAGASSERT(e)
|
||||
# endif /* __lint__ */
|
||||
#else /* _DIAGNOSTIC */
|
||||
# if __STDC__
|
||||
# define _DIAGASSERT(e) \
|
||||
((e) ? __static_cast(void,0) : __diagassert13(__FILE__, __LINE__, \
|
||||
__assert_function__, #e))
|
||||
# else /* !__STDC__ */
|
||||
# define _DIAGASSERT(e) \
|
||||
((e) ? __static_cast(void,0) : __diagassert13(__FILE__, __LINE__, \
|
||||
__assert_function__, "e"))
|
||||
# endif
|
||||
#endif /* _DIAGNOSTIC */
|
||||
|
||||
|
||||
#if defined(__lint__)
|
||||
#define __assert_function__ (__static_cast(const void *,0))
|
||||
#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||
#define __assert_function__ __func__
|
||||
#elif __GNUC_PREREQ__(2, 6)
|
||||
#define __assert_function__ __PRETTY_FUNCTION__
|
||||
#else
|
||||
#define __assert_function__ (__static_cast(const void *,0))
|
||||
#endif
|
||||
|
||||
#ifndef __ASSERT_DECLARED
|
||||
#define __ASSERT_DECLARED
|
||||
__BEGIN_DECLS
|
||||
__dead void __assert(const char *, int, const char *);
|
||||
__dead void __assert13(const char *, int, const char *, const char *);
|
||||
void __diagassert(const char *, int, const char *);
|
||||
void __diagassert13(const char *, int, const char *, const char *);
|
||||
__END_DECLS
|
||||
#endif /* __ASSERT_DECLARED */
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
/* $NetBSD: atomic.h,v 1.1 2008/05/28 12:28:12 ad Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/atomic.h>
|
||||
|
|
@ -1,134 +0,0 @@
|
|||
/* $NetBSD: bitstring.h,v 1.9 2010/05/06 18:54:22 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Paul Vixie.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)bitstring.h 8.1 (Berkeley) 7/19/93
|
||||
*/
|
||||
|
||||
#ifndef _BITSTRING_H_
|
||||
#define _BITSTRING_H_
|
||||
|
||||
/* modified for SV/AT and bitstring bugfix by M.R.Murphy, 11oct91
|
||||
* bitstr_size changed gratuitously, but shorter
|
||||
* bit_alloc spelling error fixed
|
||||
* the following were efficient, but didn't work, they've been made to
|
||||
* work, but are no longer as efficient :-)
|
||||
* bit_nclear, bit_nset, bit_ffc, bit_ffs
|
||||
*/
|
||||
/*
|
||||
* The comment above may or may not bear any resemblance to reality.
|
||||
* This code has been maintained in a confusing way, with little
|
||||
* information available on the provenance of much of it. "At least it
|
||||
* works."
|
||||
* /s/ Perry E. Metzger, 2 Feb 98
|
||||
*/
|
||||
typedef unsigned char bitstr_t;
|
||||
|
||||
/* internal macros */
|
||||
/* byte of the bitstring bit is in */
|
||||
#define _bit_byte(bit) \
|
||||
(uint32_t)((bit) >> 3)
|
||||
|
||||
/* mask for the bit within its byte */
|
||||
#define _bit_mask(bit) \
|
||||
(uint32_t)((1 << (uint32_t)((bit)&0x7)))
|
||||
|
||||
/* external macros */
|
||||
/* bytes in a bitstring of nbits bits */
|
||||
#define bitstr_size(nbits) \
|
||||
(size_t)((uint32_t)((nbits) + 7) >> 3)
|
||||
|
||||
/* allocate a bitstring */
|
||||
#define bit_alloc(nbits) \
|
||||
calloc(bitstr_size(nbits), sizeof(bitstr_t))
|
||||
|
||||
/* allocate a bitstring on the stack */
|
||||
#define bit_decl(name, nbits) \
|
||||
((name)[bitstr_size(nbits)])
|
||||
|
||||
/* is bit N of bitstring name set? */
|
||||
#define bit_test(name, bit) \
|
||||
/*LINTED bitwise on signed*/((name)[_bit_byte(bit)] & _bit_mask(bit))
|
||||
|
||||
/* set bit N of bitstring name */
|
||||
#define bit_set(name, bit) \
|
||||
/*LINTED bitwise on signed*/((name)[_bit_byte(bit)] |= _bit_mask(bit))
|
||||
|
||||
/* clear bit N of bitstring name */
|
||||
#define bit_clear(name, bit) \
|
||||
/*LINTED bitwise on signed*/((name)[_bit_byte(bit)] &= ~_bit_mask(bit))
|
||||
|
||||
/* clear bits start ... stop in bitstring */
|
||||
#define bit_nclear(name, start, stop) do { \
|
||||
bitstr_t *_name = name; \
|
||||
int _start = start, _stop = stop; \
|
||||
while (_start <= _stop) { \
|
||||
bit_clear(_name, _start); \
|
||||
_start++; \
|
||||
} \
|
||||
} while(/*CONSTCOND*/0)
|
||||
|
||||
/* set bits start ... stop in bitstring */
|
||||
#define bit_nset(name, start, stop) do { \
|
||||
bitstr_t *_name = name; \
|
||||
int _start = start, _stop = stop; \
|
||||
while (_start <= _stop) { \
|
||||
bit_set(_name, _start); \
|
||||
_start++; \
|
||||
} \
|
||||
} while(/*CONSTCOND*/0)
|
||||
|
||||
/* find first bit clear in name */
|
||||
#define bit_ffc(name, nbits, value) do { \
|
||||
bitstr_t *_name = name; \
|
||||
int _bit, _nbits = nbits, _value = -1; \
|
||||
for (_bit = 0; _bit < _nbits; ++_bit) \
|
||||
if (!bit_test(_name, _bit)) { \
|
||||
_value = _bit; \
|
||||
break; \
|
||||
} \
|
||||
*(value) = _value; \
|
||||
} while(/*CONSTCOND*/0)
|
||||
|
||||
/* find first bit set in name */
|
||||
#define bit_ffs(name, nbits, value) do { \
|
||||
bitstr_t *_name = name; \
|
||||
int _bit, _nbits = nbits, _value = -1; \
|
||||
for (_bit = 0; _bit < _nbits; ++_bit) \
|
||||
if (bit_test(_name, _bit)) { \
|
||||
_value = _bit; \
|
||||
break; \
|
||||
} \
|
||||
*(value) = _value; \
|
||||
} while(/*CONSTCOND*/0)
|
||||
|
||||
#endif /* !_BITSTRING_H_ */
|
||||
57
include/bm.h
57
include/bm.h
|
|
@ -1,57 +0,0 @@
|
|||
/* $NetBSD: bm.h,v 1.5 2005/02/03 04:39:32 perry Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1994
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Andrew Hume of AT&T Bell Laboratories.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)bm.h 8.6 (Berkeley) 6/21/94
|
||||
*/
|
||||
|
||||
#ifndef _BM_H_
|
||||
#define _BM_H_
|
||||
|
||||
typedef struct {
|
||||
u_char *pat; /* pattern */
|
||||
size_t patlen; /* pattern length */
|
||||
size_t *delta; /* skip delta */
|
||||
int rarec; /* rare character */
|
||||
size_t rareoff; /* rare offset */
|
||||
size_t md2; /* mini delta */
|
||||
} bm_pat;
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
bm_pat *bm_comp(u_char const *, size_t, u_char const *);
|
||||
u_char *bm_exec(bm_pat *, u_char *, size_t);
|
||||
void bm_free(bm_pat *);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_BM_H_ */
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
/* $NetBSD: cdbw.h,v 1.2 2012/06/03 21:21:45 joerg Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 2010 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Joerg Sonnenberger.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _CDBW_H
|
||||
#define _CDBW_H
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <inttypes.h>
|
||||
#include <stddef.h>
|
||||
|
||||
struct cdbw;
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
struct cdbw *cdbw_open(void);
|
||||
int cdbw_put(struct cdbw *, const void *, size_t,
|
||||
const void *, size_t);
|
||||
int cdbw_put_data(struct cdbw *, const void *, size_t,
|
||||
uint32_t *);
|
||||
int cdbw_put_key(struct cdbw *, const void *, size_t,
|
||||
uint32_t);
|
||||
uint32_t cdbw_stable_seeder(void);
|
||||
int cdbw_output(struct cdbw *, int, const char[16],
|
||||
uint32_t (*)(void));
|
||||
void cdbw_close(struct cdbw *);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _CDBW_H */
|
||||
|
|
@ -1,139 +0,0 @@
|
|||
/* $NetBSD: complex.h,v 1.4 2013/01/28 23:19:50 matt Exp $ */
|
||||
|
||||
/*
|
||||
* Written by Matthias Drochner.
|
||||
* Public domain.
|
||||
*/
|
||||
|
||||
#ifndef _COMPLEX_H
|
||||
#define _COMPLEX_H
|
||||
|
||||
#define complex _Complex
|
||||
#define _Complex_I 1.0fi
|
||||
#define I _Complex_I
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* 7.3.5 Trigonometric functions */
|
||||
/* 7.3.5.1 The cacos functions */
|
||||
double complex cacos(double complex);
|
||||
float complex cacosf(float complex);
|
||||
long double complex cacosl(long double complex);
|
||||
|
||||
/* 7.3.5.2 The casin functions */
|
||||
double complex casin(double complex);
|
||||
float complex casinf(float complex);
|
||||
long double complex casinl(long double complex);
|
||||
|
||||
/* 7.3.5.1 The catan functions */
|
||||
double complex catan(double complex);
|
||||
float complex catanf(float complex);
|
||||
long double complex catanl(long double complex);
|
||||
|
||||
/* 7.3.5.1 The ccos functions */
|
||||
double complex ccos(double complex);
|
||||
float complex ccosf(float complex);
|
||||
long double complex ccosl(long double complex);
|
||||
|
||||
/* 7.3.5.1 The csin functions */
|
||||
double complex csin(double complex);
|
||||
float complex csinf(float complex);
|
||||
long double complex csinl(long double complex);
|
||||
|
||||
/* 7.3.5.1 The ctan functions */
|
||||
double complex ctan(double complex);
|
||||
float complex ctanf(float complex);
|
||||
long double complex ctanl(long double complex);
|
||||
|
||||
/* 7.3.6 Hyperbolic functions */
|
||||
/* 7.3.6.1 The cacosh functions */
|
||||
double complex cacosh(double complex);
|
||||
float complex cacoshf(float complex);
|
||||
long double complex cacoshl(long double complex);
|
||||
|
||||
/* 7.3.6.2 The casinh functions */
|
||||
double complex casinh(double complex);
|
||||
float complex casinhf(float complex);
|
||||
long double complex casinhl(long double complex);
|
||||
|
||||
/* 7.3.6.3 The catanh functions */
|
||||
double complex catanh(double complex);
|
||||
float complex catanhf(float complex);
|
||||
long double complex catanhl(long double complex);
|
||||
|
||||
/* 7.3.6.4 The ccosh functions */
|
||||
double complex ccosh(double complex);
|
||||
float complex ccoshf(float complex);
|
||||
long double complex ccoshl(long double complex);
|
||||
|
||||
/* 7.3.6.5 The csinh functions */
|
||||
double complex csinh(double complex);
|
||||
float complex csinhf(float complex);
|
||||
long double complex csinhl(long double complex);
|
||||
|
||||
/* 7.3.6.6 The ctanh functions */
|
||||
double complex ctanh(double complex);
|
||||
float complex ctanhf(float complex);
|
||||
long double complex ctanhl(long double complex);
|
||||
|
||||
/* 7.3.7 Exponential and logarithmic functions */
|
||||
/* 7.3.7.1 The cexp functions */
|
||||
double complex cexp(double complex);
|
||||
float complex cexpf(float complex);
|
||||
long double complex cexpl(long double complex);
|
||||
|
||||
/* 7.3.7.2 The clog functions */
|
||||
double complex clog(double complex);
|
||||
float complex clogf(float complex);
|
||||
long double complex clogl(long double complex);
|
||||
|
||||
/* 7.3.8 Power and absolute-value functions */
|
||||
/* 7.3.8.1 The cabs functions */
|
||||
#ifndef __LIBM0_SOURCE__
|
||||
/* avoid conflict with historical cabs(struct complex) */
|
||||
double cabs(double complex) __RENAME(__c99_cabs);
|
||||
float cabsf(float complex) __RENAME(__c99_cabsf);
|
||||
long double cabsl(long double complex) __RENAME(__c99_cabsl);
|
||||
#endif
|
||||
|
||||
/* 7.3.8.2 The cpow functions */
|
||||
double complex cpow(double complex, double complex);
|
||||
float complex cpowf(float complex, float complex);
|
||||
long double complex cpowl(long double complex, long double complex);
|
||||
|
||||
/* 7.3.8.3 The csqrt functions */
|
||||
double complex csqrt(double complex);
|
||||
float complex csqrtf(float complex);
|
||||
long double complex csqrtl(long double complex);
|
||||
|
||||
/* 7.3.9 Manipulation functions */
|
||||
/* 7.3.9.1 The carg functions */
|
||||
double carg(double complex);
|
||||
float cargf(float complex);
|
||||
long double cargl(long double complex);
|
||||
|
||||
/* 7.3.9.2 The cimag functions */
|
||||
double cimag(double complex);
|
||||
float cimagf(float complex);
|
||||
long double cimagl(long double complex);
|
||||
|
||||
/* 7.3.9.3 The conj functions */
|
||||
double complex conj(double complex);
|
||||
float complex conjf(float complex);
|
||||
long double complex conjl(long double complex);
|
||||
|
||||
/* 7.3.9.4 The cproj functions */
|
||||
double complex cproj(double complex);
|
||||
float complex cprojf(float complex);
|
||||
long double complex cprojl(long double complex);
|
||||
|
||||
/* 7.3.9.5 The creal functions */
|
||||
double creal(double complex);
|
||||
float crealf(float complex);
|
||||
long double creall(long double complex);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* ! _COMPLEX_H */
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
/* $NetBSD: cpio.h,v 1.3 2008/04/28 20:22:54 martin Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by J.T. Conklin.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _CPIO_H_
|
||||
#define _CPIO_H_
|
||||
|
||||
#define C_IRUSR 0000400
|
||||
#define C_IWUSR 0000200
|
||||
#define C_IXUSR 0000100
|
||||
#define C_IRGRP 0000040
|
||||
#define C_IWGRP 0000020
|
||||
#define C_IXGRP 0000010
|
||||
#define C_IROTH 0000004
|
||||
#define C_IWOTH 0000002
|
||||
#define C_IXOTH 0000001
|
||||
#define C_ISUID 0004000
|
||||
#define C_ISGID 0002000
|
||||
#define C_ISVTX 0001000
|
||||
#define C_ISDIR 0040000
|
||||
#define C_ISFIFO 0010000
|
||||
#define C_ISREG 0100000
|
||||
#define C_ISBLK 0060000
|
||||
#define C_ISCHR 0020000
|
||||
#define C_ISCTG 0110000
|
||||
#define C_ISLNK 0120000
|
||||
#define C_ISSOCK 0140000
|
||||
|
||||
#define MAGIC "070707"
|
||||
|
||||
#endif /* _CPIO_H_ */
|
||||
102
include/ctype.h
102
include/ctype.h
|
|
@ -1,102 +0,0 @@
|
|||
/* $NetBSD: ctype.h,v 1.34 2013/04/28 19:39:56 joerg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* (c) UNIX System Laboratories, Inc.
|
||||
* All or some portions of this file are derived from material licensed
|
||||
* to the University of California by American Telephone and Telegraph
|
||||
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
|
||||
* the permission of UNIX System Laboratories, Inc.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)ctype.h 5.3 (Berkeley) 4/3/91
|
||||
*/
|
||||
|
||||
#ifndef _CTYPE_H_
|
||||
#define _CTYPE_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/featuretest.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
int isalnum(int);
|
||||
int isalpha(int);
|
||||
int iscntrl(int);
|
||||
int isdigit(int);
|
||||
int isgraph(int);
|
||||
int islower(int);
|
||||
int isprint(int);
|
||||
int ispunct(int);
|
||||
int isspace(int);
|
||||
int isupper(int);
|
||||
int isxdigit(int);
|
||||
int tolower(int);
|
||||
int toupper(int);
|
||||
|
||||
#if (_POSIX_C_SOURCE - 0) >= 200809L || defined(_NETBSD_SOURCE)
|
||||
# ifndef __LOCALE_T_DECLARED
|
||||
typedef struct _locale *locale_t;
|
||||
# define __LOCALE_T_DECLARED
|
||||
# endif
|
||||
|
||||
int isalnum_l(int, locale_t);
|
||||
int isalpha_l(int, locale_t);
|
||||
int isblank_l(int, locale_t);
|
||||
int iscntrl_l(int, locale_t);
|
||||
int isdigit_l(int, locale_t);
|
||||
int isgraph_l(int, locale_t);
|
||||
int islower_l(int, locale_t);
|
||||
int isprint_l(int, locale_t);
|
||||
int ispunct_l(int, locale_t);
|
||||
int isspace_l(int, locale_t);
|
||||
int isupper_l(int, locale_t);
|
||||
int isxdigit_l(int, locale_t);
|
||||
int tolower_l(int, locale_t);
|
||||
int toupper_l(int, locale_t);
|
||||
#endif
|
||||
|
||||
#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
|
||||
int isascii(int);
|
||||
int toascii(int);
|
||||
int _tolower(int);
|
||||
int _toupper(int);
|
||||
#endif
|
||||
|
||||
#if defined(_ISOC99_SOURCE) || (_POSIX_C_SOURCE - 0) > 200112L || \
|
||||
(_XOPEN_SOURCE - 0) > 600 || defined(_NETBSD_SOURCE)
|
||||
int isblank(int);
|
||||
#endif
|
||||
__END_DECLS
|
||||
|
||||
#if defined(_NETBSD_SOURCE) && !defined(_CTYPE_NOINLINE) && \
|
||||
!defined(__cplusplus)
|
||||
#include <sys/ctype_inline.h>
|
||||
#else
|
||||
#include <sys/ctype_bits.h>
|
||||
#endif
|
||||
|
||||
#endif /* !_CTYPE_H_ */
|
||||
228
include/db.h
228
include/db.h
|
|
@ -1,228 +0,0 @@
|
|||
/* $NetBSD: db.h,v 1.26 2013/12/01 00:23:11 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993, 1994
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)db.h 8.7 (Berkeley) 6/16/94
|
||||
*/
|
||||
|
||||
#ifndef _DB_H_
|
||||
#define _DB_H_
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#define RET_ERROR -1 /* Return values. */
|
||||
#define RET_SUCCESS 0
|
||||
#define RET_SPECIAL 1
|
||||
|
||||
#define MAX_PAGE_NUMBER 0xffffffff /* >= # of pages in a file */
|
||||
typedef uint32_t pgno_t;
|
||||
#define MAX_PAGE_OFFSET 65535 /* >= # of bytes in a page */
|
||||
typedef uint16_t indx_t;
|
||||
#define MAX_REC_NUMBER 0xffffffff /* >= # of records in a tree */
|
||||
typedef uint32_t recno_t;
|
||||
|
||||
/* Key/data structure -- a Data-Base Thang. */
|
||||
typedef struct {
|
||||
void *data; /* data */
|
||||
size_t size; /* data length */
|
||||
} DBT;
|
||||
|
||||
/* Routine flags. */
|
||||
#define R_CURSOR 1 /* del, put, seq */
|
||||
#define __R_UNUSED 2 /* UNUSED */
|
||||
#define R_FIRST 3 /* seq */
|
||||
#define R_IAFTER 4 /* put (RECNO) */
|
||||
#define R_IBEFORE 5 /* put (RECNO) */
|
||||
#define R_LAST 6 /* seq (BTREE, RECNO) */
|
||||
#define R_NEXT 7 /* seq */
|
||||
#define R_NOOVERWRITE 8 /* put */
|
||||
#define R_PREV 9 /* seq (BTREE, RECNO) */
|
||||
#define R_SETCURSOR 10 /* put (RECNO) */
|
||||
#define R_RECNOSYNC 11 /* sync (RECNO) */
|
||||
|
||||
typedef enum { DB_BTREE, DB_HASH, DB_RECNO } DBTYPE;
|
||||
|
||||
/*
|
||||
* !!!
|
||||
* The following flags are included in the dbopen(3) call as part of the
|
||||
* open(2) flags. In order to avoid conflicts with the open flags, start
|
||||
* at the top of the 16 or 32-bit number space and work our way down. If
|
||||
* the open flags were significantly expanded in the future, it could be
|
||||
* a problem. Wish I'd left another flags word in the dbopen call.
|
||||
*
|
||||
* !!!
|
||||
* None of this stuff is implemented yet. The only reason that it's here
|
||||
* is so that the access methods can skip copying the key/data pair when
|
||||
* the DB_LOCK flag isn't set.
|
||||
*/
|
||||
#if UINT_MAX > 65535
|
||||
#define DB_LOCK 0x20000000 /* Do locking. */
|
||||
#define DB_SHMEM 0x40000000 /* Use shared memory. */
|
||||
#define DB_TXN 0x80000000 /* Do transactions. */
|
||||
#else
|
||||
#define DB_LOCK 0x2000 /* Do locking. */
|
||||
#define DB_SHMEM 0x4000 /* Use shared memory. */
|
||||
#define DB_TXN 0x8000 /* Do transactions. */
|
||||
#endif
|
||||
|
||||
/* Access method description structure. */
|
||||
typedef struct __db {
|
||||
DBTYPE type; /* Underlying db type. */
|
||||
int (*close) (struct __db *);
|
||||
int (*del) (const struct __db *, const DBT *, unsigned int);
|
||||
int (*get) (const struct __db *, const DBT *, DBT *, unsigned int);
|
||||
int (*put) (const struct __db *, DBT *, const DBT *, unsigned int);
|
||||
int (*seq) (const struct __db *, DBT *, DBT *, unsigned int);
|
||||
int (*sync) (const struct __db *, unsigned int);
|
||||
void *internal; /* Access method private. */
|
||||
int (*fd) (const struct __db *);
|
||||
} DB;
|
||||
|
||||
#define BTREEMAGIC 0x053162
|
||||
#define BTREEVERSION 3
|
||||
|
||||
/* Structure used to pass parameters to the btree routines. */
|
||||
typedef struct {
|
||||
#define R_DUP 0x01 /* duplicate keys */
|
||||
unsigned long flags;
|
||||
unsigned int cachesize; /* bytes to cache */
|
||||
int maxkeypage; /* maximum keys per page */
|
||||
int minkeypage; /* minimum keys per page */
|
||||
unsigned int psize; /* page size */
|
||||
int (*compare) /* comparison function */
|
||||
(const DBT *, const DBT *);
|
||||
size_t (*prefix) /* prefix function */
|
||||
(const DBT *, const DBT *);
|
||||
int lorder; /* byte order */
|
||||
} BTREEINFO;
|
||||
|
||||
#define HASHMAGIC 0x061561
|
||||
#define HASHVERSION 2
|
||||
|
||||
/* Structure used to pass parameters to the hashing routines. */
|
||||
typedef struct {
|
||||
unsigned int bsize; /* bucket size */
|
||||
unsigned int ffactor; /* fill factor */
|
||||
unsigned int nelem; /* number of elements */
|
||||
unsigned int cachesize; /* bytes to cache */
|
||||
uint32_t /* hash function */
|
||||
(*hash)(const void *, size_t);
|
||||
int lorder; /* byte order */
|
||||
} HASHINFO;
|
||||
|
||||
/* Structure used to pass parameters to the record routines. */
|
||||
typedef struct {
|
||||
#define R_FIXEDLEN 0x01 /* fixed-length records */
|
||||
#define R_NOKEY 0x02 /* key not required */
|
||||
#define R_SNAPSHOT 0x04 /* snapshot the input */
|
||||
unsigned long flags;
|
||||
unsigned int cachesize; /* bytes to cache */
|
||||
unsigned int psize; /* page size */
|
||||
int lorder; /* byte order */
|
||||
size_t reclen; /* record length (fixed-length records) */
|
||||
uint8_t bval; /* delimiting byte (variable-length records */
|
||||
char *bfname; /* btree file name */
|
||||
} RECNOINFO;
|
||||
|
||||
#ifdef __DBINTERFACE_PRIVATE
|
||||
/*
|
||||
* Little endian <==> big endian 32-bit swap macros.
|
||||
* M_32_SWAP swap a memory location
|
||||
* P_32_SWAP swap a referenced memory location
|
||||
* P_32_COPY swap from one location to another
|
||||
*/
|
||||
#define M_32_SWAP(a) { \
|
||||
uint32_t _tmp = a; \
|
||||
((char *)(void *)&a)[0] = ((char *)(void *)&_tmp)[3]; \
|
||||
((char *)(void *)&a)[1] = ((char *)(void *)&_tmp)[2]; \
|
||||
((char *)(void *)&a)[2] = ((char *)(void *)&_tmp)[1]; \
|
||||
((char *)(void *)&a)[3] = ((char *)(void *)&_tmp)[0]; \
|
||||
}
|
||||
#define P_32_SWAP(a) { \
|
||||
char _tmp[4]; \
|
||||
_tmp[0] = ((char *)(void *)a)[0]; \
|
||||
_tmp[1] = ((char *)(void *)a)[1]; \
|
||||
_tmp[2] = ((char *)(void *)a)[2]; \
|
||||
_tmp[3] = ((char *)(void *)a)[3]; \
|
||||
((char *)(void *)a)[0] = _tmp[3]; \
|
||||
((char *)(void *)a)[1] = _tmp[2]; \
|
||||
((char *)(void *)a)[2] = _tmp[1]; \
|
||||
((char *)(void *)a)[3] = _tmp[0]; \
|
||||
}
|
||||
#define P_32_COPY(a, b) { \
|
||||
((char *)(void *)&(b))[0] = ((char *)(void *)&(a))[3]; \
|
||||
((char *)(void *)&(b))[1] = ((char *)(void *)&(a))[2]; \
|
||||
((char *)(void *)&(b))[2] = ((char *)(void *)&(a))[1]; \
|
||||
((char *)(void *)&(b))[3] = ((char *)(void *)&(a))[0]; \
|
||||
}
|
||||
|
||||
/*
|
||||
* Little endian <==> big endian 16-bit swap macros.
|
||||
* M_16_SWAP swap a memory location
|
||||
* P_16_SWAP swap a referenced memory location
|
||||
* P_16_COPY swap from one location to another
|
||||
*/
|
||||
#define M_16_SWAP(a) { \
|
||||
uint16_t _tmp = a; \
|
||||
((char *)(void *)&a)[0] = ((char *)(void *)&_tmp)[1]; \
|
||||
((char *)(void *)&a)[1] = ((char *)(void *)&_tmp)[0]; \
|
||||
}
|
||||
#define P_16_SWAP(a) { \
|
||||
char _tmp[2]; \
|
||||
_tmp[0] = ((char *)(void *)a)[0]; \
|
||||
_tmp[1] = ((char *)(void *)a)[1]; \
|
||||
((char *)(void *)a)[0] = _tmp[1]; \
|
||||
((char *)(void *)a)[1] = _tmp[0]; \
|
||||
}
|
||||
#define P_16_COPY(a, b) { \
|
||||
((char *)(void *)&(b))[0] = ((char *)(void *)&(a))[1]; \
|
||||
((char *)(void *)&(b))[1] = ((char *)(void *)&(a))[0]; \
|
||||
}
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
DB *dbopen(const char *, int, mode_t, DBTYPE, const void *);
|
||||
|
||||
#ifdef __DBINTERFACE_PRIVATE
|
||||
|
||||
#define _DBFIT(a, t) _DIAGASSERT(__type_fit(t, a))
|
||||
|
||||
DB *__bt_open(const char *, int, mode_t, const BTREEINFO *, int);
|
||||
DB *__hash_open(const char *, int, mode_t, const HASHINFO *, int);
|
||||
DB *__rec_open(const char *, int, mode_t, const RECNOINFO *, int);
|
||||
void __dbpanic(DB *);
|
||||
struct stat;
|
||||
int __dbopen(const char *, int, mode_t, struct stat *);
|
||||
int __dbtemp(const char *, struct stat *);
|
||||
#endif
|
||||
__END_DECLS
|
||||
#endif /* !_DB_H_ */
|
||||
122
include/dirent.h
122
include/dirent.h
|
|
@ -1,122 +0,0 @@
|
|||
/* $NetBSD: dirent.h,v 1.35 2012/07/30 23:11:13 yamt Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1989, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)dirent.h 8.2 (Berkeley) 7/28/94
|
||||
*/
|
||||
|
||||
#ifndef _DIRENT_H_
|
||||
#define _DIRENT_H_
|
||||
|
||||
#include <sys/featuretest.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
/*
|
||||
* The kernel defines the format of directory entries returned by
|
||||
* the getdents(2) system call.
|
||||
*/
|
||||
#include <sys/dirent.h>
|
||||
|
||||
#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
|
||||
#define d_ino d_fileno /* backward compatibility */
|
||||
#endif
|
||||
|
||||
typedef struct _dirdesc DIR;
|
||||
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
|
||||
/* definitions for library routines operating on directories. */
|
||||
#define DIRBLKSIZ 1024
|
||||
|
||||
/* structure describing an open directory. */
|
||||
struct _dirdesc {
|
||||
/*
|
||||
* dd_fd should be kept intact to preserve ABI compat. see dirfd().
|
||||
*/
|
||||
int dd_fd; /* file descriptor associated with directory */
|
||||
/*
|
||||
* the rest is hidden from user.
|
||||
*/
|
||||
long dd_loc; /* offset in current buffer */
|
||||
long dd_size; /* amount of data returned by getdents */
|
||||
char *dd_buf; /* data buffer */
|
||||
int dd_len; /* size of data buffer */
|
||||
off_t dd_seek; /* magic cookie returned by getdents */
|
||||
void *dd_internal; /* state for seekdir/telldir */
|
||||
int dd_flags; /* flags for readdir */
|
||||
void *dd_lock; /* lock for concurrent access */
|
||||
};
|
||||
|
||||
#define dirfd(dirp) ((dirp)->dd_fd)
|
||||
|
||||
/* flags for __opendir2() */
|
||||
#define DTF_HIDEW 0x0001 /* hide whiteout entries */
|
||||
#define DTF_NODUP 0x0002 /* don't return duplicate names */
|
||||
#define DTF_REWIND 0x0004 /* rewind after reading union stack */
|
||||
#define __DTF_READALL 0x0008 /* everything has been read */
|
||||
#define __DTF_RETRY_ON_BADCOOKIE 0x0001 /* retry on EINVAL
|
||||
(only valid with __DTF_READALL) */
|
||||
|
||||
#include <sys/null.h>
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef _KERNEL
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
int closedir(DIR *);
|
||||
void rewinddir(DIR *);
|
||||
#ifndef __LIBC12_SOURCE__
|
||||
DIR *opendir(const char *) __RENAME(__opendir30);
|
||||
struct dirent *readdir(DIR *) __RENAME(__readdir30);
|
||||
int readdir_r(DIR * __restrict, struct dirent * __restrict,
|
||||
struct dirent ** __restrict) __RENAME(__readdir_r30);
|
||||
#endif
|
||||
#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
|
||||
void seekdir(DIR *, long);
|
||||
long telldir(DIR *);
|
||||
#endif /* defined(_NETBSD_SOURCE) || defined(_XOPEN_SOURCE) */
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
#ifndef __LIBC12_SOURCE__
|
||||
DIR *fdopendir(int);
|
||||
DIR *__opendir2(const char *, int) __RENAME(__opendir230);
|
||||
int scandir(const char *, struct dirent ***,
|
||||
int (*)(const struct dirent *), int (*)(const void *, const void *))
|
||||
__RENAME(__scandir30);
|
||||
int getdents(int, char *, size_t) __RENAME(__getdents30);
|
||||
int alphasort(const void *, const void *) __RENAME(__alphasort30);
|
||||
#endif
|
||||
#endif /* defined(_NETBSD_SOURCE) */
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_KERNEL */
|
||||
|
||||
#endif /* !_DIRENT_H_ */
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
/* $NetBSD: disktab.h,v 1.10 2005/02/03 04:39:32 perry Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)disktab.h 8.1 (Berkeley) 6/2/93
|
||||
*/
|
||||
|
||||
#ifndef _DISKTAB_H_
|
||||
#define _DISKTAB_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
/*
|
||||
* Disk description table, see disktab(5)
|
||||
*/
|
||||
#define _PATH_DISKTAB "/etc/disktab"
|
||||
|
||||
__BEGIN_DECLS
|
||||
int setdisktab(const char *);
|
||||
struct disklabel *getdiskbyname(const char *);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_DISKTAB_H_ */
|
||||
117
include/dlfcn.h
117
include/dlfcn.h
|
|
@ -1,117 +0,0 @@
|
|||
/* $NetBSD: dlfcn.h,v 1.24 2012/02/16 23:00:39 joerg Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Paul Kranenburg.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _DLFCN_H_
|
||||
#define _DLFCN_H_
|
||||
|
||||
#include <sys/featuretest.h>
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
typedef struct _dl_info {
|
||||
const char *dli_fname; /* File defining the symbol */
|
||||
void *dli_fbase; /* Base address */
|
||||
const char *dli_sname; /* Symbol name */
|
||||
const void *dli_saddr; /* Symbol address */
|
||||
} Dl_info;
|
||||
#endif /* defined(_NETBSD_SOURCE) */
|
||||
|
||||
/*
|
||||
* User interface to the run-time linker.
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
void *_dlauxinfo(void) __pure;
|
||||
|
||||
void *dlopen(const char *, int);
|
||||
int dlclose(void *);
|
||||
void *dlsym(void * __restrict, const char * __restrict);
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
int dladdr(const void * __restrict, Dl_info * __restrict);
|
||||
int dlctl(void *, int, void *);
|
||||
int dlinfo(void *, int, void *);
|
||||
void *dlvsym(void * __restrict, const char * __restrict,
|
||||
const char * __restrict);
|
||||
#endif
|
||||
__aconst char *dlerror(void);
|
||||
__END_DECLS
|
||||
|
||||
/* Values for dlopen `mode'. */
|
||||
#define RTLD_LAZY 1
|
||||
#define RTLD_NOW 2
|
||||
#define RTLD_GLOBAL 0x100 /* Allow global searches in object */
|
||||
#define RTLD_LOCAL 0x200
|
||||
#define RTLD_NODELETE 0x01000 /* Do not remove members. */
|
||||
#define RTLD_NOLOAD 0x02000 /* Do not load if not already loaded. */
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
#define DL_LAZY RTLD_LAZY /* Compat */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Special handle arguments for dlsym().
|
||||
*/
|
||||
#define RTLD_NEXT ((void *) -1) /* Search subsequent objects. */
|
||||
#define RTLD_DEFAULT ((void *) -2) /* Use default search algorithm. */
|
||||
#define RTLD_SELF ((void *) -3) /* Search the caller itself. */
|
||||
|
||||
/*
|
||||
* dlctl() commands
|
||||
*/
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
#define DL_GETERRNO 1
|
||||
#define DL_GETSYMBOL 2
|
||||
#if 0
|
||||
#define DL_SETSRCHPATH x
|
||||
#define DL_GETLIST x
|
||||
#define DL_GETREFCNT x
|
||||
#define DL_GETLOADADDR x
|
||||
#endif /* 0 */
|
||||
#endif /* defined(_NETBSD_SOURCE) */
|
||||
|
||||
/*
|
||||
* dlinfo() commands
|
||||
*
|
||||
* From Solaris: http://docs.sun.com/app/docs/doc/816-5168/dlinfo-3c?a=view
|
||||
*/
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
#define RTLD_DI_LINKMAP 3
|
||||
#if 0
|
||||
#define RTLD_DI_ARGSINFO 1
|
||||
#define RTLD_DI_CONFIGADDR 2
|
||||
#define RTLD_DI_LMID 4
|
||||
#define RTLD_DI_SERINFO 5
|
||||
#define RTLD_DI_SERINFOSIZE 6
|
||||
#define RTLD_DI_ORIGIN 7
|
||||
#define RTLD_DI_GETSIGNAL 8
|
||||
#define RTLD_DI_SETSIGNAL 9
|
||||
#endif
|
||||
#endif /* _NETBSD_SOURCE */
|
||||
|
||||
#endif /* !defined(_DLFCN_H_) */
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
/* $NetBSD: err.h,v 1.17 2014/01/16 17:22:06 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)err.h 8.1 (Berkeley) 6/2/93
|
||||
*/
|
||||
|
||||
#ifndef _ERR_H_
|
||||
#define _ERR_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
__dead void err(int, const char *, ...)
|
||||
__printflike(2, 3) __dead;
|
||||
__dead void verr(int, const char *, va_list)
|
||||
__printflike(2, 0) __dead;
|
||||
__dead void errx(int, const char *, ...)
|
||||
__printflike(2, 3) __dead;
|
||||
__dead void verrx(int, const char *, va_list)
|
||||
__printflike(2, 0) __dead;
|
||||
__dead void errc(int, int, const char *, ...)
|
||||
__printflike(3, 4) __dead;
|
||||
__dead void verrc(int, int, const char *, va_list)
|
||||
__printflike(3, 0) __dead;
|
||||
void warn(const char *, ...)
|
||||
__printflike(1, 2);
|
||||
void vwarn(const char *, va_list)
|
||||
__printflike(1, 0);
|
||||
void warnx(const char *, ...)
|
||||
__printflike(1, 2);
|
||||
void vwarnx(const char *, va_list)
|
||||
__printflike(1, 0);
|
||||
void warnc(int, const char *, ...)
|
||||
__printflike(2, 3);
|
||||
void vwarnc(int, const char *, va_list)
|
||||
__printflike(2, 0);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_ERR_H_ */
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
/* $NetBSD: errno.h,v 1.11 2008/03/03 06:57:48 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1989, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
* (c) UNIX System Laboratories, Inc.
|
||||
* All or some portions of this file are derived from material licensed
|
||||
* to the University of California by American Telephone and Telegraph
|
||||
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
|
||||
* the permission of UNIX System Laboratories, Inc.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)errno.h 8.5 (Berkeley) 1/21/94
|
||||
*/
|
||||
|
||||
#ifndef _ERRNO_H_
|
||||
#define _ERRNO_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/errno.h>
|
||||
#include <sys/featuretest.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* note: this appears in both errno.h and signal.h */
|
||||
#ifndef __errno
|
||||
int *__errno(void);
|
||||
#define __errno __errno
|
||||
#endif
|
||||
|
||||
#ifndef errno
|
||||
#define errno (*__errno())
|
||||
#endif
|
||||
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
#ifndef __LIBC12_SOURCE__
|
||||
extern const int sys_nerr __RENAME(__sys_nerr14);
|
||||
extern const char *const *sys_errlist __RENAME(__sys_errlist14);
|
||||
#endif
|
||||
#endif
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_ERRNO_H_ */
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
/* $NetBSD: fenv.h,v 1.13 2014/12/27 16:54:02 martin Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2010 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if !defined(__aarch64__) && !defined(__arm__) && !defined(__i386__) \
|
||||
&& !defined(__hppa__) \
|
||||
&& !defined(__or1k__) && !defined(__riscv__) && !defined(__sparc__) \
|
||||
&& !defined(__x86_64__)
|
||||
#error "fenv.h is currently not supported for this architecture"
|
||||
#endif
|
||||
|
||||
#ifndef _FENV_H_
|
||||
#define _FENV_H_
|
||||
|
||||
#include <sys/featuretest.h>
|
||||
#include <machine/fenv.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Function prototypes */
|
||||
int feclearexcept(int);
|
||||
int fegetexceptflag(fexcept_t *, int);
|
||||
int feraiseexcept(int);
|
||||
int fesetexceptflag(const fexcept_t *, int);
|
||||
int fetestexcept(int);
|
||||
int fegetround(void);
|
||||
int fesetround(int);
|
||||
int fegetenv(fenv_t *);
|
||||
int feholdexcept(fenv_t *);
|
||||
int fesetenv(const fenv_t *);
|
||||
int feupdateenv(const fenv_t *);
|
||||
|
||||
#if defined(_NETBSD_SOURCE) || defined(_GNU_SOURCE)
|
||||
|
||||
int feenableexcept(int mask);
|
||||
int fedisableexcept(int mask);
|
||||
int fegetexcept(void);
|
||||
|
||||
#endif /* _NETBSD_SOURCE || _GNU_SOURCE */
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* ! _FENV_H_ */
|
||||
|
|
@ -1,81 +0,0 @@
|
|||
/* $NetBSD: fmtmsg.h,v 1.3 2008/04/28 20:22:54 martin Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Klaus Klein.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _FMTMSG_H_
|
||||
#define _FMTMSG_H_
|
||||
|
||||
/* Major Classifications: identifies the source of the condition. */
|
||||
#define MM_HARD 0x01L /* Hardware */
|
||||
#define MM_SOFT 0x02L /* Software */
|
||||
#define MM_FIRM 0x03L /* Firmware */
|
||||
|
||||
/* Message Source Subclassifications: type of software. */
|
||||
#define MM_APPL 0x04L /* Application */
|
||||
#define MM_UTIL 0x08L /* Utility */
|
||||
#define MM_OPSYS 0x0cL /* Operating system */
|
||||
|
||||
/* Display Subclassifications: where to display the message. */
|
||||
#define MM_PRINT 0x10L /* Display on standard error */
|
||||
#define MM_CONSOLE 0x20L /* Display on system console */
|
||||
|
||||
/* Status subclassifications: whether the application will recover. */
|
||||
#define MM_RECOVER 0x40L /* Recoverable */
|
||||
#define MM_NRECOV 0x80L /* Non-recoverable */
|
||||
|
||||
/* Severity: seriousness of the condition. */
|
||||
#define MM_NOSEV 0 /* No severity level provided */
|
||||
#define MM_HALT 1 /* Error causing application to halt */
|
||||
#define MM_ERROR 2 /* Encountered a non-fatal fault */
|
||||
#define MM_WARNING 3 /* Unusual non-error condition */
|
||||
#define MM_INFO 4 /* Informative message */
|
||||
|
||||
/* `Null' values for message components. */
|
||||
#define MM_NULLMC 0L /* `Null' classsification component */
|
||||
#define MM_NULLLBL (char *)0 /* `Null' label component */
|
||||
#define MM_NULLSEV 0 /* `Null' severity component */
|
||||
#define MM_NULLTXT (char *)0 /* `Null' text component */
|
||||
#define MM_NULLACT (char *)0 /* `Null' action component */
|
||||
#define MM_NULLTAG (char *)0 /* `Null' tag component */
|
||||
|
||||
/* Return values for fmtmsg(). */
|
||||
#define MM_OK 0 /* Function succeeded */
|
||||
#define MM_NOTOK (-1) /* Function failed completely */
|
||||
#define MM_NOMSG 0x01 /* Unable to perform MM_PRINT */
|
||||
#define MM_NOCON 0x02 /* Unable to perform MM_CONSOLE */
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
int fmtmsg(long, const char *, int, const char *, const char *,
|
||||
const char *);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_FMTMSG_H_ */
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
/* $NetBSD: fnmatch.h,v 1.13 2011/01/31 04:49:46 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)fnmatch.h 8.1 (Berkeley) 6/2/93
|
||||
*/
|
||||
|
||||
#ifndef _FNMATCH_H_
|
||||
#define _FNMATCH_H_
|
||||
|
||||
#include <sys/featuretest.h>
|
||||
|
||||
#define FNM_NOMATCH 1 /* Match failed. */
|
||||
#define FNM_NOSYS 2 /* Function not implemented. */
|
||||
#define FNM_NORES 3 /* Out of resources */
|
||||
|
||||
#define FNM_NOESCAPE 0x01 /* Disable backslash escaping. */
|
||||
#define FNM_PATHNAME 0x02 /* Slash must be matched by slash. */
|
||||
#define FNM_PERIOD 0x04 /* Period must be matched by period. */
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
#define FNM_CASEFOLD 0x08 /* Pattern is matched case-insensitive */
|
||||
#define FNM_LEADING_DIR 0x10 /* Ignore /<tail> after Imatch. */
|
||||
#endif
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
int fnmatch(const char *, const char *, int);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_FNMATCH_H_ */
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
/* $NetBSD: fstab.h,v 1.11 2005/02/03 04:39:32 perry Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)fstab.h 8.1 (Berkeley) 6/2/93
|
||||
*/
|
||||
|
||||
#ifndef _FSTAB_H_
|
||||
#define _FSTAB_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
/*
|
||||
* File system table, see fstab(5).
|
||||
*
|
||||
* Used by dump, mount, umount, swapon, fsck, df, ...
|
||||
*
|
||||
* For ufs fs_spec field is the block special name. Programs that want to
|
||||
* use the character special name must create that name by prepending a 'r'
|
||||
* after the right most slash. Quota files are always named "quotas", so
|
||||
* if type is "rq", then use concatenation of fs_file and "quotas" to locate
|
||||
* quota file.
|
||||
*/
|
||||
#define _PATH_FSTAB "/etc/fstab"
|
||||
#define FSTAB "/etc/fstab" /* deprecated */
|
||||
|
||||
#define FSTAB_RW "rw" /* read/write device */
|
||||
#define FSTAB_RQ "rq" /* read/write with quotas */
|
||||
#define FSTAB_RO "ro" /* read-only device */
|
||||
#define FSTAB_SW "sw" /* swap device */
|
||||
#define FSTAB_DP "dp" /* dump device */
|
||||
#define FSTAB_XX "xx" /* ignore totally */
|
||||
|
||||
struct fstab {
|
||||
__aconst char *fs_spec; /* block special device name */
|
||||
__aconst char *fs_file; /* file system path prefix */
|
||||
__aconst char *fs_vfstype; /* File system type, ufs, nfs */
|
||||
__aconst char *fs_mntops; /* Mount options ala -o */
|
||||
__aconst char *fs_type; /* FSTAB_* from fs_mntops */
|
||||
int fs_freq; /* dump frequency, in days */
|
||||
int fs_passno; /* pass number on parallel fsck */
|
||||
};
|
||||
|
||||
__BEGIN_DECLS
|
||||
struct fstab *getfsent(void);
|
||||
struct fstab *getfsspec(const char *);
|
||||
struct fstab *getfsfile(const char *);
|
||||
int setfsent(void);
|
||||
void endfsent(void);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_FSTAB_H_ */
|
||||
151
include/fts.h
151
include/fts.h
|
|
@ -1,151 +0,0 @@
|
|||
/* $NetBSD: fts.h,v 1.19 2009/08/16 19:33:38 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)fts.h 8.3 (Berkeley) 8/14/94
|
||||
*/
|
||||
|
||||
#ifndef _FTS_H_
|
||||
#define _FTS_H_
|
||||
|
||||
#ifndef __fts_stat_t
|
||||
#define __fts_stat_t struct stat
|
||||
#endif
|
||||
#ifndef __fts_nlink_t
|
||||
#define __fts_nlink_t nlink_t
|
||||
#endif
|
||||
#ifndef __fts_ino_t
|
||||
#define __fts_ino_t ino_t
|
||||
#endif
|
||||
#ifndef __fts_length_t
|
||||
#define __fts_length_t unsigned int
|
||||
#endif
|
||||
#ifndef __fts_number_t
|
||||
#define __fts_number_t int64_t
|
||||
#endif
|
||||
#ifndef __fts_dev_t
|
||||
#define __fts_dev_t dev_t
|
||||
#endif
|
||||
#ifndef __fts_level_t
|
||||
#define __fts_level_t int
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
struct _ftsent *fts_cur; /* current node */
|
||||
struct _ftsent *fts_child; /* linked list of children */
|
||||
struct _ftsent **fts_array; /* sort array */
|
||||
dev_t fts_dev; /* starting device # */
|
||||
char *fts_path; /* path for this descent */
|
||||
int fts_rfd; /* fd for root */
|
||||
unsigned int fts_pathlen; /* sizeof(path) */
|
||||
unsigned int fts_nitems; /* elements in the sort array */
|
||||
int (*fts_compar) /* compare function */
|
||||
(const struct _ftsent **, const struct _ftsent **);
|
||||
|
||||
#define FTS_COMFOLLOW 0x001 /* follow command line symlinks */
|
||||
#define FTS_LOGICAL 0x002 /* logical walk */
|
||||
#define FTS_NOCHDIR 0x004 /* don't change directories */
|
||||
#define FTS_NOSTAT 0x008 /* don't get stat info */
|
||||
#define FTS_PHYSICAL 0x010 /* physical walk */
|
||||
#define FTS_SEEDOT 0x020 /* return dot and dot-dot */
|
||||
#define FTS_XDEV 0x040 /* don't cross devices */
|
||||
#define FTS_WHITEOUT 0x080 /* return whiteout information */
|
||||
#define FTS_OPTIONMASK 0x0ff /* valid user option mask */
|
||||
|
||||
#define FTS_NAMEONLY 0x100 /* (private) child names only */
|
||||
#define FTS_STOP 0x200 /* (private) unrecoverable error */
|
||||
int fts_options; /* fts_open options, global flags */
|
||||
} FTS;
|
||||
|
||||
typedef struct _ftsent {
|
||||
struct _ftsent *fts_cycle; /* cycle node */
|
||||
struct _ftsent *fts_parent; /* parent directory */
|
||||
struct _ftsent *fts_link; /* next file in directory */
|
||||
__fts_number_t fts_number; /* local numeric value */
|
||||
void *fts_pointer; /* local address value */
|
||||
char *fts_accpath; /* access path */
|
||||
char *fts_path; /* root path */
|
||||
int fts_errno; /* errno for this node */
|
||||
int fts_symfd; /* fd for symlink */
|
||||
__fts_length_t fts_pathlen; /* strlen(fts_path) */
|
||||
__fts_length_t fts_namelen; /* strlen(fts_name) */
|
||||
|
||||
__fts_ino_t fts_ino; /* inode */
|
||||
__fts_dev_t fts_dev; /* device */
|
||||
__fts_nlink_t fts_nlink; /* link count */
|
||||
|
||||
#define FTS_ROOTPARENTLEVEL -1
|
||||
#define FTS_ROOTLEVEL 0
|
||||
__fts_level_t fts_level; /* depth (-1 to N) */
|
||||
|
||||
#define FTS_D 1 /* preorder directory */
|
||||
#define FTS_DC 2 /* directory that causes cycles */
|
||||
#define FTS_DEFAULT 3 /* none of the above */
|
||||
#define FTS_DNR 4 /* unreadable directory */
|
||||
#define FTS_DOT 5 /* dot or dot-dot */
|
||||
#define FTS_DP 6 /* postorder directory */
|
||||
#define FTS_ERR 7 /* error; errno is set */
|
||||
#define FTS_F 8 /* regular file */
|
||||
#define FTS_INIT 9 /* initialized only */
|
||||
#define FTS_NS 10 /* stat(2) failed */
|
||||
#define FTS_NSOK 11 /* no stat(2) requested */
|
||||
#define FTS_SL 12 /* symbolic link */
|
||||
#define FTS_SLNONE 13 /* symbolic link without target */
|
||||
#define FTS_W 14 /* whiteout object */
|
||||
unsigned short fts_info; /* user flags for FTSENT structure */
|
||||
|
||||
#define FTS_DONTCHDIR 0x01 /* don't chdir .. to the parent */
|
||||
#define FTS_SYMFOLLOW 0x02 /* followed a symlink to get here */
|
||||
#define FTS_ISW 0x04 /* this is a whiteout object */
|
||||
unsigned short fts_flags; /* private flags for FTSENT structure */
|
||||
|
||||
#define FTS_AGAIN 1 /* read node again */
|
||||
#define FTS_FOLLOW 2 /* follow symbolic link */
|
||||
#define FTS_NOINSTR 3 /* no instructions */
|
||||
#define FTS_SKIP 4 /* discard node */
|
||||
unsigned short fts_instr; /* fts_set() instructions */
|
||||
|
||||
__fts_stat_t *fts_statp; /* stat(2) information */
|
||||
char fts_name[1]; /* file name */
|
||||
} FTSENT;
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
#ifndef __LIBC12_SOURCE__
|
||||
FTSENT *fts_children(FTS *, int) __RENAME(__fts_children60);
|
||||
int fts_close(FTS *) __RENAME(__fts_close60);
|
||||
FTS *fts_open(char * const *, int,
|
||||
int (*)(const FTSENT **, const FTSENT **)) __RENAME(__fts_open60);
|
||||
FTSENT *fts_read(FTS *) __RENAME(__fts_read60);
|
||||
int fts_set(FTS *, FTSENT *, int) __RENAME(__fts_set60);
|
||||
#endif
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_FTS_H_ */
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
/* $NetBSD: ftw.h,v 1.1 2005/12/30 23:07:33 agc Exp $ */
|
||||
|
||||
/* From OpenBSD: ftw.h,v 1.1 2003/07/21 21:13:18 millert Exp */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2003 Todd C. Miller <Todd.Miller@courtesan.com>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
* Sponsored in part by the Defense Advanced Research Projects
|
||||
* Agency (DARPA) and Air Force Research Laboratory, Air Force
|
||||
* Materiel Command, USAF, under agreement number F39502-99-1-0512.
|
||||
*/
|
||||
|
||||
#ifndef _FTW_H
|
||||
#define _FTW_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
/*
|
||||
* Valid flags for the 3rd argument to the function that is passed as the
|
||||
* second argument to ftw(3) and nftw(3). Say it three times fast!
|
||||
*/
|
||||
#define FTW_F 0 /* File. */
|
||||
#define FTW_D 1 /* Directory. */
|
||||
#define FTW_DNR 2 /* Directory without read permission. */
|
||||
#define FTW_DP 3 /* Directory with subdirectories visited. */
|
||||
#define FTW_NS 4 /* Unknown type; stat() failed. */
|
||||
#define FTW_SL 5 /* Symbolic link. */
|
||||
#define FTW_SLN 6 /* Sym link that names a nonexistent file. */
|
||||
|
||||
/*
|
||||
* Flags for use as the 4th argument to nftw(3). These may be ORed together.
|
||||
*/
|
||||
#define FTW_PHYS 0x01 /* Physical walk, don't follow sym links. */
|
||||
#define FTW_MOUNT 0x02 /* The walk does not cross a mount point. */
|
||||
#define FTW_DEPTH 0x04 /* Subdirs visited before the dir itself. */
|
||||
#define FTW_CHDIR 0x08 /* Change to a directory before reading it. */
|
||||
|
||||
struct FTW {
|
||||
int base;
|
||||
int level;
|
||||
};
|
||||
|
||||
__BEGIN_DECLS
|
||||
int ftw(const char *, int (*)(const char *, const struct stat *, int), int);
|
||||
int nftw(const char *, int (*)(const char *, const struct stat *, int,
|
||||
struct FTW *), int, int);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_FTW_H */
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
/* $NetBSD: getopt.h,v 1.11 2008/04/28 20:22:54 martin Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Dieter Baron and Thomas Klausner.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _GETOPT_H_
|
||||
#define _GETOPT_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/*
|
||||
* Gnu like getopt_long() and BSD4.4 getsubopt()/optreset extensions
|
||||
*/
|
||||
#define no_argument 0
|
||||
#define required_argument 1
|
||||
#define optional_argument 2
|
||||
|
||||
struct option {
|
||||
/* name of long option */
|
||||
const char *name;
|
||||
/*
|
||||
* one of no_argument, required_argument, and optional_argument:
|
||||
* whether option takes an argument
|
||||
*/
|
||||
int has_arg;
|
||||
/* if not NULL, set *flag to val when option found */
|
||||
int *flag;
|
||||
/* if flag not NULL, value to set *flag to; else return value */
|
||||
int val;
|
||||
};
|
||||
|
||||
__BEGIN_DECLS
|
||||
int getopt_long(int, char * const *, const char *,
|
||||
const struct option *, int *);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_GETOPT_H_ */
|
||||
113
include/glob.h
113
include/glob.h
|
|
@ -1,113 +0,0 @@
|
|||
/* $NetBSD: glob.h,v 1.26 2010/09/06 14:38:56 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Guido van Rossum.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)glob.h 8.1 (Berkeley) 6/2/93
|
||||
*/
|
||||
|
||||
#ifndef _GLOB_H_
|
||||
#define _GLOB_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/featuretest.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifndef __gl_size_t
|
||||
#define __gl_size_t size_t
|
||||
#endif
|
||||
#ifndef __gl_stat_t
|
||||
#define __gl_stat_t struct stat
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
__gl_size_t gl_pathc; /* Count of total paths so far. */
|
||||
__gl_size_t gl_matchc; /* Count of paths matching pattern. */
|
||||
__gl_size_t gl_offs; /* Reserved at beginning of gl_pathv. */
|
||||
int gl_flags; /* Copy of flags parameter to glob. */
|
||||
char **gl_pathv; /* List of paths matching pattern. */
|
||||
/* Copy of errfunc parameter to glob. */
|
||||
int (*gl_errfunc)(const char *, int);
|
||||
|
||||
/*
|
||||
* Alternate filesystem access methods for glob; replacement
|
||||
* versions of closedir(3), readdir(3), opendir(3), stat(2)
|
||||
* and lstat(2).
|
||||
*/
|
||||
void (*gl_closedir)(void *);
|
||||
struct dirent *(*gl_readdir)(void *);
|
||||
void *(*gl_opendir)(const char *);
|
||||
int (*gl_lstat)(const char *, __gl_stat_t *);
|
||||
int (*gl_stat)(const char *, __gl_stat_t *);
|
||||
} glob_t;
|
||||
|
||||
#define GLOB_APPEND 0x0001 /* Append to output from previous call. */
|
||||
#define GLOB_DOOFFS 0x0002 /* Use gl_offs. */
|
||||
#define GLOB_ERR 0x0004 /* Return on error. */
|
||||
#define GLOB_MARK 0x0008 /* Append / to matching directories. */
|
||||
#define GLOB_NOCHECK 0x0010 /* Return pattern itself if nothing matches. */
|
||||
#define GLOB_NOSORT 0x0020 /* Don't sort. */
|
||||
#define GLOB_NOESCAPE 0x1000 /* Disable backslash escaping. */
|
||||
|
||||
#define GLOB_NOSPACE (-1) /* Malloc call failed. */
|
||||
#define GLOB_ABORTED (-2) /* Unignored error. */
|
||||
#define GLOB_NOMATCH (-3) /* No match, and GLOB_NOCHECK was not set. */
|
||||
#define GLOB_NOSYS (-4) /* Implementation does not support function. */
|
||||
|
||||
#if defined(_NETBSD_SOURCE) || defined(HAVE_NBTOOL_CONFIG_H)
|
||||
#define GLOB_ALTDIRFUNC 0x0040 /* Use alternately specified directory funcs. */
|
||||
#define GLOB_BRACE 0x0080 /* Expand braces ala csh. */
|
||||
#define GLOB_MAGCHAR 0x0100 /* Pattern had globbing characters. */
|
||||
#define GLOB_NOMAGIC 0x0200 /* GLOB_NOCHECK without magic chars (csh). */
|
||||
#define GLOB_LIMIT 0x0400 /* Limit memory used by matches to ARG_MAX */
|
||||
#define GLOB_TILDE 0x0800 /* Expand tilde names from the passwd file. */
|
||||
/* GLOB_NOESCAPE 0x1000 above */
|
||||
#define GLOB_PERIOD 0x2000 /* Allow metachars to match leading periods. */
|
||||
#define GLOB_NO_DOTDIRS 0x4000 /* Make . and .. vanish from wildcards. */
|
||||
#define GLOB_STAR 0x8000 /* Use glob ** to recurse directories */
|
||||
#define GLOB_QUOTE 0 /* source compatibility */
|
||||
|
||||
#define GLOB_ABEND GLOB_ABORTED /* source compatibility */
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
#ifndef __LIBC12_SOURCE__
|
||||
int glob(const char * __restrict, int,
|
||||
int (*)(const char *, int), glob_t * __restrict) __RENAME(__glob30);
|
||||
void globfree(glob_t *) __RENAME(__globfree30);
|
||||
#endif
|
||||
#ifdef _NETBSD_SOURCE
|
||||
int glob_pattern_p(const char *, int);
|
||||
#endif
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_GLOB_H_ */
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
/* $NetBSD: grp.h,v 1.24 2007/10/19 15:58:52 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1989, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
* (c) UNIX System Laboratories, Inc.
|
||||
* All or some portions of this file are derived from material licensed
|
||||
* to the University of California by American Telephone and Telegraph
|
||||
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
|
||||
* the permission of UNIX System Laboratories, Inc.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)grp.h 8.2 (Berkeley) 1/21/94
|
||||
*/
|
||||
|
||||
#ifndef _GRP_H_
|
||||
#define _GRP_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/featuretest.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
#define _PATH_GROUP "/etc/group"
|
||||
#endif
|
||||
|
||||
struct group {
|
||||
__aconst char *gr_name; /* group name */
|
||||
__aconst char *gr_passwd; /* group password */
|
||||
gid_t gr_gid; /* group id */
|
||||
__aconst char *__aconst *gr_mem; /* group members */
|
||||
};
|
||||
|
||||
__BEGIN_DECLS
|
||||
struct group *getgrgid(gid_t);
|
||||
struct group *getgrnam(const char *);
|
||||
#if (_POSIX_C_SOURCE - 0) >= 199506L || (_XOPEN_SOURCE - 0) >= 500 || \
|
||||
defined(_REENTRANT) || defined(_NETBSD_SOURCE)
|
||||
int getgrgid_r(gid_t, struct group *, char *, size_t,
|
||||
struct group **);
|
||||
int getgrnam_r(const char *, struct group *, char *, size_t,
|
||||
struct group **);
|
||||
#endif
|
||||
#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
|
||||
struct group *getgrent(void);
|
||||
void setgrent(void);
|
||||
void endgrent(void);
|
||||
#endif
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
void setgrfile(const char *);
|
||||
int setgroupent(int);
|
||||
int getgrent_r(struct group *, char *, size_t, struct group **);
|
||||
const char *group_from_gid(gid_t, int);
|
||||
int gid_from_group(const char *, gid_t *);
|
||||
int pwcache_groupdb(int (*)(int), void (*)(void),
|
||||
struct group * (*)(const char *),
|
||||
struct group * (*)(gid_t));
|
||||
#endif
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_GRP_H_ */
|
||||
|
|
@ -1,89 +0,0 @@
|
|||
/* $NetBSD: hesiod.h,v 1.5 2008/04/28 20:22:54 martin Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 by Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
|
||||
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
|
||||
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
||||
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef _HESIOD_H_
|
||||
#define _HESIOD_H_
|
||||
|
||||
/* Application-visible indication that we have the new interfaces */
|
||||
|
||||
#define HESIOD_INTERFACES
|
||||
|
||||
/* Configuration information. */
|
||||
|
||||
#ifndef _PATH_HESIOD_CONF /* Configuration file. */
|
||||
#define _PATH_HESIOD_CONF "/etc/hesiod.conf"
|
||||
#endif
|
||||
|
||||
#define DEF_RHS "" /* Defaults if HESIOD_CONF */
|
||||
#define DEF_LHS "" /* file is not present. */
|
||||
|
||||
/* Error codes (for backwards compatibility) */
|
||||
|
||||
#define HES_ER_UNINIT -1 /* uninitialized */
|
||||
#define HES_ER_OK 0 /* no error */
|
||||
#define HES_ER_NOTFOUND 1 /* Hesiod name not found by server */
|
||||
#define HES_ER_CONFIG 2 /* local problem (no config file?) */
|
||||
#define HES_ER_NET 3 /* network problem */
|
||||
|
||||
/* Declaration of routines */
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
int hesiod_init (void **);
|
||||
char **hesiod_resolve (void *, const char *, const char *);
|
||||
void hesiod_free_list(void *, char **);
|
||||
char *hesiod_to_bind (void *, const char *, const char *);
|
||||
void hesiod_end (void *);
|
||||
|
||||
/* backwards compatibility */
|
||||
int hes_init (void);
|
||||
char *hes_to_bind (const char *, const char *);
|
||||
char **hes_resolve (const char *, const char *);
|
||||
int hes_error (void);
|
||||
void hes_free (char **);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* ! _HESIOD_H_ */
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
/* $NetBSD: iconv.h,v 1.6 2005/02/03 04:39:32 perry Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c)2003 Citrus Project,
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _ICONV_H_
|
||||
#define _ICONV_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <machine/ansi.h>
|
||||
|
||||
#ifdef _BSD_SIZE_T_
|
||||
typedef _BSD_SIZE_T_ size_t;
|
||||
#undef _BSD_SIZE_T_
|
||||
#endif
|
||||
|
||||
struct __tag_iconv_t;
|
||||
typedef struct __tag_iconv_t *iconv_t;
|
||||
|
||||
__BEGIN_DECLS
|
||||
iconv_t iconv_open(const char *, const char *);
|
||||
size_t iconv(iconv_t, const char ** __restrict,
|
||||
size_t * __restrict, char ** __restrict,
|
||||
size_t * __restrict);
|
||||
int iconv_close(iconv_t);
|
||||
/*
|
||||
* non-portable interfaces for iconv
|
||||
*/
|
||||
int __iconv_get_list(char ***, size_t *);
|
||||
void __iconv_free_list(char **, size_t);
|
||||
size_t __iconv(iconv_t, const char **, size_t *, char **,
|
||||
size_t *, __uint32_t, size_t *);
|
||||
#define __ICONV_F_HIDE_INVALID 0x0001
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_ICONV_H_ */
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
/* $NetBSD: ieeefp.h,v 1.9 2011/03/27 05:13:15 mrg Exp $ */
|
||||
|
||||
/*
|
||||
* Written by J.T. Conklin, Apr 6, 1995
|
||||
* Public domain.
|
||||
*/
|
||||
|
||||
#ifndef _IEEEFP_H_
|
||||
#define _IEEEFP_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <machine/ieeefp.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
typedef fp_rnd fp_rnd_t;
|
||||
#ifdef _X86_IEEEFP_H_ /* XXX */
|
||||
typedef fp_prec fp_prec_t;
|
||||
#endif
|
||||
typedef fp_except fp_except_t;
|
||||
|
||||
fp_rnd_t fpgetround(void);
|
||||
fp_rnd_t fpsetround(fp_rnd_t);
|
||||
#ifdef _X86_IEEEFP_H_ /* XXX */
|
||||
fp_prec_t fpgetprec(void);
|
||||
fp_prec_t fpsetprec(fp_prec_t);
|
||||
#endif
|
||||
fp_except_t fpgetmask(void);
|
||||
fp_except_t fpsetmask(fp_except_t);
|
||||
fp_except_t fpgetsticky(void);
|
||||
fp_except_t fpsetsticky(fp_except_t);
|
||||
fp_except_t fpresetsticky(fp_except_t);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _IEEEFP_H_ */
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
/* $NetBSD: ifaddrs.h,v 1.5 2005/02/03 04:39:32 perry Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995, 1999
|
||||
* Berkeley Software Design, Inc. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY Berkeley Software Design, Inc. ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL Berkeley Software Design, Inc. BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* BSDI ifaddrs.h,v 2.5 2000/02/23 14:51:59 dab Exp
|
||||
*/
|
||||
|
||||
#ifndef _IFADDRS_H_
|
||||
#define _IFADDRS_H_
|
||||
|
||||
struct ifaddrs {
|
||||
struct ifaddrs *ifa_next;
|
||||
char *ifa_name;
|
||||
u_int ifa_flags;
|
||||
struct sockaddr *ifa_addr;
|
||||
struct sockaddr *ifa_netmask;
|
||||
struct sockaddr *ifa_dstaddr;
|
||||
void *ifa_data;
|
||||
};
|
||||
|
||||
/*
|
||||
* This may have been defined in <net/if.h>. Note that if <net/if.h> is
|
||||
* to be included it must be included before this header file.
|
||||
*/
|
||||
#ifndef ifa_broadaddr
|
||||
#define ifa_broadaddr ifa_dstaddr /* broadcast address interface */
|
||||
#endif
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
int getifaddrs(struct ifaddrs **);
|
||||
void freeifaddrs(struct ifaddrs *);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_IFADDRS_H_ */
|
||||
|
|
@ -1,95 +0,0 @@
|
|||
/* $NetBSD: inttypes.h,v 1.11 2015/01/16 18:35:59 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Klaus Klein.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _INTTYPES_H_
|
||||
#define _INTTYPES_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/featuretest.h>
|
||||
#include <sys/inttypes.h>
|
||||
#include <machine/ansi.h>
|
||||
|
||||
#if defined(_BSD_WCHAR_T_) && !defined(__cplusplus)
|
||||
typedef _BSD_WCHAR_T_ wchar_t;
|
||||
#undef _BSD_WCHAR_T_
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
intmax_t strtoimax(const char * __restrict,
|
||||
char ** __restrict, int);
|
||||
uintmax_t strtoumax(const char * __restrict,
|
||||
char ** __restrict, int);
|
||||
intmax_t wcstoimax(const wchar_t * __restrict,
|
||||
wchar_t ** __restrict, int);
|
||||
uintmax_t wcstoumax(const wchar_t * __restrict,
|
||||
wchar_t ** __restrict, int);
|
||||
|
||||
intmax_t imaxabs(intmax_t);
|
||||
|
||||
typedef struct {
|
||||
intmax_t quot;
|
||||
intmax_t rem;
|
||||
} imaxdiv_t;
|
||||
|
||||
imaxdiv_t imaxdiv(intmax_t, intmax_t);
|
||||
|
||||
#if (_POSIX_C_SOURCE - 0) >= 200809L || defined(_NETBSD_SOURCE)
|
||||
# ifndef __LOCALE_T_DECLARED
|
||||
typedef struct _locale *locale_t;
|
||||
# define __LOCALE_T_DECLARED
|
||||
# endif
|
||||
intmax_t strtoimax_l(const char * __restrict,
|
||||
char ** __restrict, int, locale_t);
|
||||
uintmax_t strtoumax_l(const char * __restrict,
|
||||
char ** __restrict, int, locale_t);
|
||||
intmax_t wcstoimax_l(const wchar_t * __restrict,
|
||||
wchar_t ** __restrict, int, locale_t);
|
||||
uintmax_t wcstoumax_l(const wchar_t * __restrict,
|
||||
wchar_t ** __restrict, int, locale_t);
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
intmax_t strtoi(const char * __restrict, char ** __restrict, int,
|
||||
intmax_t, intmax_t, int *);
|
||||
uintmax_t strtou(const char * __restrict, char ** __restrict, int,
|
||||
uintmax_t, uintmax_t, int *);
|
||||
|
||||
/* i18n variations */
|
||||
intmax_t strtoi_l(const char * __restrict, char ** __restrict, int,
|
||||
intmax_t, intmax_t, int *, locale_t);
|
||||
uintmax_t strtou_l(const char * __restrict, char ** __restrict, int,
|
||||
uintmax_t, uintmax_t, int *, locale_t);
|
||||
#endif /* defined(_NETBSD_SOURCE) */
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_INTTYPES_H_ */
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
/* $NetBSD: iso646.h,v 1.2 2013/04/26 10:58:45 joerg Exp $ */
|
||||
|
||||
/*
|
||||
* Written by J.T. Conklin <jtc@wimsey.com> 02/16/95.
|
||||
* Public domain.
|
||||
*/
|
||||
|
||||
#ifndef _ISO646_H_
|
||||
#define _ISO646_H_
|
||||
|
||||
#ifndef __cplusplus
|
||||
#define and &&
|
||||
#define and_eq &=
|
||||
#define bitand &
|
||||
#define bitor |
|
||||
#define compl ~
|
||||
#define not !
|
||||
#define not_eq !=
|
||||
#define or ||
|
||||
#define or_eq |=
|
||||
#define xor ^
|
||||
#define xor_eq ^=
|
||||
#endif
|
||||
|
||||
#endif /* !_ISO646_H_ */
|
||||
|
|
@ -1,89 +0,0 @@
|
|||
/* $NetBSD: kvm.h,v 1.16 2011/09/12 21:14:29 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1989, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)kvm.h 8.1 (Berkeley) 6/2/93
|
||||
*/
|
||||
|
||||
#ifndef _KVM_H_
|
||||
#define _KVM_H_
|
||||
|
||||
/* Default version symbol. */
|
||||
#define VRS_SYM "_version"
|
||||
#define VRS_KEY "VERSION"
|
||||
|
||||
/*
|
||||
* Flag for kvm_open*() to disable opening of kernel files - used
|
||||
* by programs that use only sysctl() function to access kernel
|
||||
* information.
|
||||
*/
|
||||
#define KVM_NO_FILES ((int)0x80000000)
|
||||
|
||||
#include <nlist.h>
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
typedef struct __kvm kvm_t;
|
||||
|
||||
struct kinfo_proc;
|
||||
struct kinfo_proc2;
|
||||
int kvm_close(kvm_t *);
|
||||
int kvm_dump_inval(kvm_t *);
|
||||
int kvm_dump_mkheader(kvm_t *, off_t);
|
||||
int kvm_dump_header(kvm_t *, bool (*)(void *, const void *, size_t),
|
||||
void *, int);
|
||||
int kvm_dump_wrtheader(kvm_t *, FILE *, int);
|
||||
char **kvm_getargv(kvm_t *, const struct kinfo_proc *, int);
|
||||
char **kvm_getargv2(kvm_t *, const struct kinfo_proc2 *, int);
|
||||
char **kvm_getenvv(kvm_t *, const struct kinfo_proc *, int);
|
||||
char **kvm_getenvv2(kvm_t *, const struct kinfo_proc2 *, int);
|
||||
char *kvm_geterr(kvm_t *);
|
||||
int kvm_getloadavg(kvm_t *, double [], int);
|
||||
char *kvm_getfiles(kvm_t *, int, int, int *);
|
||||
struct kinfo_lwp *
|
||||
kvm_getlwps(kvm_t *, int, u_long, size_t, int *);
|
||||
struct kinfo_proc2 *
|
||||
kvm_getproc2(kvm_t *, int, int, size_t, int *);
|
||||
struct kinfo_proc *
|
||||
kvm_getprocs(kvm_t *, int, int, int *);
|
||||
int kvm_nlist(kvm_t *, struct nlist *);
|
||||
kvm_t *kvm_open
|
||||
(const char *, const char *, const char *, int, const char *);
|
||||
kvm_t *kvm_openfiles(const char *, const char *, const char *, int, char *);
|
||||
ssize_t kvm_read(kvm_t *, u_long, void *, size_t);
|
||||
ssize_t kvm_write(kvm_t *, u_long, const void *, size_t);
|
||||
const char *kvm_getkernelname(kvm_t *);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_KVM_H_ */
|
||||
|
|
@ -1,101 +0,0 @@
|
|||
/* $NetBSD: langinfo.h,v 1.10 2013/08/19 08:03:33 joerg Exp $ */
|
||||
|
||||
/*
|
||||
* Written by J.T. Conklin <jtc@NetBSD.org>
|
||||
* Public domain.
|
||||
*/
|
||||
|
||||
#ifndef _LANGINFO_H_
|
||||
#define _LANGINFO_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <nl_types.h>
|
||||
|
||||
#define D_T_FMT ((nl_item)0) /* String for formatting date and
|
||||
time */
|
||||
#define D_FMT ((nl_item)1) /* Date format string */
|
||||
#define T_FMT ((nl_item)2) /* Time format string */
|
||||
#define T_FMT_AMPM ((nl_item)3) /* Time format string with 12 hour
|
||||
clock */
|
||||
#define AM_STR ((nl_item)4) /* Ante Meridiem afix */
|
||||
#define PM_STR ((nl_item)5) /* Post Meridiem afix */
|
||||
|
||||
#define DAY_1 ((nl_item)6) /* Name of the first day of the week */
|
||||
#define DAY_2 ((nl_item)7)
|
||||
#define DAY_3 ((nl_item)8)
|
||||
#define DAY_4 ((nl_item)9)
|
||||
#define DAY_5 ((nl_item)10)
|
||||
#define DAY_6 ((nl_item)11)
|
||||
#define DAY_7 ((nl_item)12)
|
||||
|
||||
#define ABDAY_1 ((nl_item)13) /* Abbrev. name of the first day of
|
||||
the week */
|
||||
#define ABDAY_2 ((nl_item)14)
|
||||
#define ABDAY_3 ((nl_item)15)
|
||||
#define ABDAY_4 ((nl_item)16)
|
||||
#define ABDAY_5 ((nl_item)17)
|
||||
#define ABDAY_6 ((nl_item)18)
|
||||
#define ABDAY_7 ((nl_item)19)
|
||||
|
||||
#define MON_1 ((nl_item)20) /* Name of the first month */
|
||||
#define MON_2 ((nl_item)21)
|
||||
#define MON_3 ((nl_item)22)
|
||||
#define MON_4 ((nl_item)23)
|
||||
#define MON_5 ((nl_item)24)
|
||||
#define MON_6 ((nl_item)25)
|
||||
#define MON_7 ((nl_item)26)
|
||||
#define MON_8 ((nl_item)27)
|
||||
#define MON_9 ((nl_item)28)
|
||||
#define MON_10 ((nl_item)29)
|
||||
#define MON_11 ((nl_item)30)
|
||||
#define MON_12 ((nl_item)31)
|
||||
|
||||
#define ABMON_1 ((nl_item)32) /* Abbrev. name of the first month */
|
||||
#define ABMON_2 ((nl_item)33)
|
||||
#define ABMON_3 ((nl_item)34)
|
||||
#define ABMON_4 ((nl_item)35)
|
||||
#define ABMON_5 ((nl_item)36)
|
||||
#define ABMON_6 ((nl_item)37)
|
||||
#define ABMON_7 ((nl_item)38)
|
||||
#define ABMON_8 ((nl_item)39)
|
||||
#define ABMON_9 ((nl_item)40)
|
||||
#define ABMON_10 ((nl_item)41)
|
||||
#define ABMON_11 ((nl_item)42)
|
||||
#define ABMON_12 ((nl_item)43)
|
||||
|
||||
#define RADIXCHAR ((nl_item)44) /* Radix character */
|
||||
#define THOUSEP ((nl_item)45) /* Separator for thousands */
|
||||
#define YESSTR ((nl_item)46) /* Affirmitive response for yes/no
|
||||
queries */
|
||||
#define YESEXPR ((nl_item)47) /* Affirmitive response for yes/no
|
||||
queries */
|
||||
#define NOSTR ((nl_item)48) /* Negative response for yes/no
|
||||
queries */
|
||||
#define NOEXPR ((nl_item)49) /* Negative response for yes/no
|
||||
queries */
|
||||
#define CRNCYSTR ((nl_item)50) /* Currency symbol */
|
||||
|
||||
#define CODESET ((nl_item)51) /* codeset name */
|
||||
|
||||
#define ERA ((nl_item)52) /* Era description segments */
|
||||
#define ERA_D_FMT ((nl_item)53) /* Era date format string */
|
||||
#define ERA_D_T_FMT ((nl_item)54) /* Era date and time format string */
|
||||
#define ERA_T_FMT ((nl_item)55) /* Era time format string */
|
||||
|
||||
#define ALT_DIGITS ((nl_item)56) /* Alternative symbols for digits */
|
||||
|
||||
__BEGIN_DECLS
|
||||
char *nl_langinfo(nl_item);
|
||||
__END_DECLS
|
||||
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
# ifndef __LOCALE_T_DECLARED
|
||||
typedef struct _locale *locale_t;
|
||||
# define __LOCALE_T_DECLARED
|
||||
# endif
|
||||
__BEGIN_DECLS
|
||||
char *nl_langinfo_l(nl_item, locale_t);
|
||||
__END_DECLS
|
||||
#endif
|
||||
|
||||
#endif /* _LANGINFO_H_ */
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
/* $NetBSD: libgen.h,v 1.5 2008/05/10 22:37:42 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Klaus Klein.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _LIBGEN_H_
|
||||
#define _LIBGEN_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
char *basename(char *);
|
||||
char *dirname(char *);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_LIBGEN_H_ */
|
||||
164
include/limits.h
164
include/limits.h
|
|
@ -1,164 +0,0 @@
|
|||
/* $NetBSD: limits.h,v 1.34 2015/05/29 07:37:31 manu Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)limits.h 8.2 (Berkeley) 1/4/94
|
||||
*/
|
||||
|
||||
#ifndef _LIMITS_H_
|
||||
#define _LIMITS_H_
|
||||
|
||||
#include <sys/featuretest.h>
|
||||
|
||||
#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
|
||||
defined(_NETBSD_SOURCE)
|
||||
#define _POSIX_AIO_LISTIO_MAX 2
|
||||
#define _POSIX_AIO_MAX 1
|
||||
#define _POSIX_ARG_MAX 4096
|
||||
#define _POSIX_CHILD_MAX 25
|
||||
#define _POSIX_HOST_NAME_MAX 255
|
||||
#define _POSIX_LINK_MAX 8
|
||||
#define _POSIX_LOGIN_NAME_MAX 9
|
||||
#define _POSIX_MAX_CANON 255
|
||||
#define _POSIX_MAX_INPUT 255
|
||||
#define _POSIX_MQ_OPEN_MAX 8
|
||||
#define _POSIX_MQ_PRIO_MAX 32
|
||||
#define _POSIX_NAME_MAX 14
|
||||
#define _POSIX_NGROUPS_MAX 8
|
||||
#define _POSIX_OPEN_MAX 20
|
||||
#define _POSIX_PATH_MAX 256
|
||||
#define _POSIX_PIPE_BUF 512
|
||||
#define _POSIX_RE_DUP_MAX 255
|
||||
#define _POSIX_SSIZE_MAX 32767
|
||||
#define _POSIX_STREAM_MAX 8
|
||||
#define _POSIX_SYMLINK_MAX 255
|
||||
#define _POSIX_SYMLOOP_MAX 8
|
||||
|
||||
/*
|
||||
* We have not implemented these yet
|
||||
*
|
||||
* _POSIX_THREAD_ATTR_STACKADDR
|
||||
* _POSIX_THREAD_ATTR_STACKSIZE
|
||||
* _POSIX_THREAD_CPUTIME
|
||||
* _POSIX_THREAD_PRIORITY_SCHEDULING
|
||||
* _POSIX_THREAD_PRIO_INHERIT
|
||||
* _POSIX_THREAD_PRIO_PROTECT
|
||||
* _POSIX_THREAD_PROCESS_SHARED
|
||||
* _POSIX_THREAD_SAFE_FUNCTIONS
|
||||
* _POSIX_THREAD_SPORADIC_SERVER
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following 3 are defined in
|
||||
* Open Group Base Specifications Issue 7
|
||||
*/
|
||||
#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
|
||||
#define _POSIX_THREAD_KEYS_MAX 128
|
||||
#define _POSIX_THREAD_THREADS_MAX 64
|
||||
|
||||
/*
|
||||
* These are the correct names, defined in terms of the above
|
||||
* except for PTHREAD_KEYS_MAX which is bigger than standard
|
||||
* mandated minimum value _POSIX_THREAD_KEYS_MAX.
|
||||
*/
|
||||
#define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS
|
||||
#define PTHREAD_KEYS_MAX 256
|
||||
/* Not yet: PTHREAD_STACK_MIN */
|
||||
#define PTHREAD_THREADS_MAX _POSIX_THREAD_THREADS_MAX
|
||||
|
||||
#define _POSIX_TIMER_MAX 32
|
||||
#define _POSIX_TTY_NAME_MAX 9
|
||||
#define _POSIX_TZNAME_MAX 6
|
||||
|
||||
#define _POSIX2_BC_BASE_MAX 99
|
||||
#define _POSIX2_BC_DIM_MAX 2048
|
||||
#define _POSIX2_BC_SCALE_MAX 99
|
||||
#define _POSIX2_BC_STRING_MAX 1000
|
||||
#define _POSIX2_CHARCLASS_NAME_MAX 14
|
||||
#define _POSIX2_COLL_WEIGHTS_MAX 2
|
||||
#define _POSIX2_EXPR_NEST_MAX 32
|
||||
#define _POSIX2_LINE_MAX 2048
|
||||
#define _POSIX2_RE_DUP_MAX 255
|
||||
|
||||
/*
|
||||
* X/Open CAE Specifications,
|
||||
* adopted in IEEE Std 1003.1-2001 XSI.
|
||||
*/
|
||||
#if (_POSIX_C_SOURCE - 0) >= 200112L || defined(_XOPEN_SOURCE) || \
|
||||
defined(_NETBSD_SOURCE)
|
||||
#define _XOPEN_IOV_MAX 16
|
||||
#define _XOPEN_NAME_MAX 256
|
||||
#define _XOPEN_PATH_MAX 1024
|
||||
|
||||
#define PASS_MAX 128 /* Legacy */
|
||||
|
||||
#define CHARCLASS_NAME_MAX 14
|
||||
#define NL_ARGMAX 9
|
||||
#define NL_LANGMAX 14
|
||||
#define NL_MSGMAX 32767
|
||||
#define NL_NMAX 1
|
||||
#define NL_SETMAX 255
|
||||
#define NL_TEXTMAX 2048
|
||||
|
||||
/* IEEE Std 1003.1-2001 TSF */
|
||||
#define _GETGR_R_SIZE_MAX 1024
|
||||
#define _GETPW_R_SIZE_MAX 1024
|
||||
|
||||
/* Always ensure that this is consistent with <stdio.h> */
|
||||
#ifndef TMP_MAX
|
||||
#define TMP_MAX 308915776 /* Legacy */
|
||||
#endif
|
||||
#endif /* _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE || _NETBSD_SOURCE */
|
||||
|
||||
#endif /* _POSIX_C_SOURCE || _XOPEN_SOURCE || _NETBSD_SOURCE */
|
||||
|
||||
#define MB_LEN_MAX 32 /* Allow ISO/IEC 2022 */
|
||||
|
||||
/*
|
||||
* X/Open Extended API set 2 (a.k.a. C063)
|
||||
* This hides unimplemented functions from GNU configure until
|
||||
* we are done implementing them.
|
||||
*/
|
||||
#if !defined(_INCOMPLETE_XOPEN_C063)
|
||||
#define __stub_fexecve
|
||||
#endif
|
||||
|
||||
#include <machine/limits.h>
|
||||
|
||||
#ifdef __CHAR_UNSIGNED__
|
||||
# define CHAR_MIN 0
|
||||
# define CHAR_MAX UCHAR_MAX
|
||||
#else
|
||||
# define CHAR_MIN SCHAR_MIN
|
||||
# define CHAR_MAX SCHAR_MAX
|
||||
#endif
|
||||
|
||||
#include <sys/syslimits.h>
|
||||
|
||||
#endif /* !_LIMITS_H_ */
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
/* $NetBSD: link.h,v 1.13 2008/04/28 20:22:54 martin Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
|
||||
* NASA Ames Research Center.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _LINK_H_
|
||||
#define _LINK_H_
|
||||
|
||||
/*
|
||||
* Pull in the correct definitions for our toolchain target.
|
||||
*/
|
||||
#ifdef __ELF__
|
||||
#include <link_elf.h>
|
||||
#else
|
||||
#include <link_aout.h>
|
||||
#endif
|
||||
|
||||
#endif /* _LINK_H_ */
|
||||
|
|
@ -1,288 +0,0 @@
|
|||
/* $NetBSD: link_aout.h,v 1.21 2008/04/28 20:22:54 martin Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Paul Kranenburg.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* RRS section definitions.
|
||||
*
|
||||
* The layout of some data structures defined in this header file is
|
||||
* such that we can provide compatibility with the SunOS 4.x shared
|
||||
* library scheme.
|
||||
*/
|
||||
|
||||
#ifndef _LINK_AOUT_H_
|
||||
#define _LINK_AOUT_H_
|
||||
|
||||
#include <dlfcn.h> /* for Dl_info */
|
||||
#include <a.out.h> /* for struct nlist */
|
||||
|
||||
/*
|
||||
* A `Shared Object Descriptor' describes a shared object that is needed
|
||||
* to complete the link edit process of the object containing it.
|
||||
* A list of such objects (chained through `sod_next') is pointed at
|
||||
* by `sdt_sods' in the section_dispatch_table structure.
|
||||
*/
|
||||
|
||||
struct sod { /* Shared Object Descriptor */
|
||||
long sod_name; /* name (relative to load address) */
|
||||
u_int sod_library : 1, /* Searched for by library rules */
|
||||
sod_reserved : 31;
|
||||
short sod_major; /* major version number */
|
||||
short sod_minor; /* minor version number */
|
||||
long sod_next; /* next sod */
|
||||
};
|
||||
|
||||
/*
|
||||
* `Shared Object Map's are used by the run-time link editor (ld.so) to
|
||||
* keep track of all shared objects loaded into a process' address space.
|
||||
* These structures are only used at run-time and do not occur within
|
||||
* the text or data segment of an executable or shared library.
|
||||
*/
|
||||
struct so_map { /* Shared Object Map */
|
||||
caddr_t som_addr; /* Address at which object mapped */
|
||||
char *som_path; /* Path to mmap'ed file */
|
||||
struct so_map *som_next; /* Next map in chain */
|
||||
struct sod *som_sod; /* Sod responsible for this map */
|
||||
caddr_t som_sodbase; /* Base address of this sod */
|
||||
u_int som_write : 1; /* Text is currently writable */
|
||||
struct _dynamic *som_dynamic; /* _dynamic structure */
|
||||
caddr_t som_spd; /* Private data */
|
||||
};
|
||||
|
||||
/*
|
||||
* Symbol description with size. This is simply an `nlist' with
|
||||
* one field (nz_size) added.
|
||||
* Used to convey size information on items in the data segment
|
||||
* of shared objects. An array of these live in the shared object's
|
||||
* text segment and is addressed by the `sdt_nzlist' field.
|
||||
*/
|
||||
struct nzlist {
|
||||
struct nlist nlist;
|
||||
u_long nz_size;
|
||||
#define nz_un nlist.n_un
|
||||
#define nz_strx nlist.n_un.n_strx
|
||||
#define nz_name nlist.n_un.n_name
|
||||
#define nz_type nlist.n_type
|
||||
#define nz_value nlist.n_value
|
||||
#define nz_desc nlist.n_desc
|
||||
#define nz_other nlist.n_other
|
||||
};
|
||||
|
||||
#define N_AUX(p) ((p)->n_other & 0xf)
|
||||
#define N_BIND(p) (((unsigned int)(p)->n_other >> 4) & 0xf)
|
||||
#define N_OTHER(r, v) (((unsigned int)(r) << 4) | ((v) & 0xf))
|
||||
|
||||
#define AUX_OBJECT 1
|
||||
#define AUX_FUNC 2
|
||||
#define AUX_LABEL 3
|
||||
/*#define BIND_LOCAL 0 not used */
|
||||
/*#define BIND_GLOBAL 1 not used */
|
||||
#define BIND_WEAK 2
|
||||
|
||||
|
||||
/*
|
||||
* The `section_dispatch_table' structure contains offsets to various data
|
||||
* structures needed to do run-time relocation.
|
||||
*/
|
||||
struct section_dispatch_table {
|
||||
struct so_map *sdt_loaded; /* List of loaded objects */
|
||||
long sdt_sods; /* List of shared objects descriptors */
|
||||
long sdt_paths; /* Library search paths */
|
||||
long sdt_got; /* Global offset table */
|
||||
long sdt_plt; /* Procedure linkage table */
|
||||
long sdt_rel; /* Relocation table */
|
||||
long sdt_hash; /* Symbol hash table */
|
||||
long sdt_nzlist; /* Symbol table itself */
|
||||
long sdt_filler2; /* Unused (was: stab_hash) */
|
||||
long sdt_buckets; /* Number of hash buckets */
|
||||
long sdt_strings; /* Symbol strings */
|
||||
long sdt_str_sz; /* Size of symbol strings */
|
||||
long sdt_text_sz; /* Size of text area */
|
||||
long sdt_plt_sz; /* Size of procedure linkage table */
|
||||
};
|
||||
|
||||
/*
|
||||
* RRS symbol hash table, addressed by `sdt_hash' in section_dispatch_table.
|
||||
* Used to quickly lookup symbols of the shared object by hashing
|
||||
* on the symbol's name. `rh_symbolnum' is the index of the symbol
|
||||
* in the shared object's symbol list (`sdt_nzlist'), `rh_next' is
|
||||
* the next symbol in the hash bucket (in case of collisions).
|
||||
*/
|
||||
struct rrs_hash {
|
||||
int rh_symbolnum; /* Symbol number */
|
||||
int rh_next; /* Next hash entry */
|
||||
};
|
||||
|
||||
/*
|
||||
* `rt_symbols' is used to keep track of run-time allocated commons
|
||||
* and data items copied from shared objects.
|
||||
*/
|
||||
struct rt_symbol {
|
||||
struct nzlist *rt_sp; /* The symbol */
|
||||
struct rt_symbol *rt_next; /* Next in linear list */
|
||||
struct rt_symbol *rt_link; /* Next in bucket */
|
||||
caddr_t rt_srcaddr; /* Address of "master" copy */
|
||||
struct so_map *rt_smp; /* Originating map */
|
||||
};
|
||||
|
||||
/*
|
||||
* Debugger interface structure.
|
||||
*/
|
||||
struct so_debug {
|
||||
int dd_version; /* Version # of interface */
|
||||
int dd_in_debugger; /* Set when run by debugger */
|
||||
int dd_sym_loaded; /* Run-time linking brought more
|
||||
symbols into scope */
|
||||
char *dd_bpt_addr; /* Address of rtld-generated bpt */
|
||||
int dd_bpt_shadow; /* Original contents of bpt */
|
||||
struct rt_symbol *dd_cc; /* Allocated commons/copied data */
|
||||
};
|
||||
|
||||
/*
|
||||
* Entry points into ld.so - user interface to the run-time linker.
|
||||
*/
|
||||
struct ld_entry {
|
||||
void *(*dlopen)(const char *, int);
|
||||
int (*dlclose)(void *);
|
||||
void *(*dlsym)(void *, const char *);
|
||||
int (*dlctl)(void *, int, void *);
|
||||
void (*dlexit)(void);
|
||||
int (*dladdr)(const void *, Dl_info *);
|
||||
void (*dlrsrvd[2])(void);
|
||||
};
|
||||
|
||||
/*
|
||||
* This is the structure pointed at by the __DYNAMIC symbol if an
|
||||
* executable requires the attention of the run-time link editor.
|
||||
* __DYNAMIC is given the value zero if no run-time linking needs to
|
||||
* be done (it is always present in shared objects).
|
||||
* The union `d_un' provides for different versions of the dynamic
|
||||
* linking mechanism (switched on by `d_version'). The last version
|
||||
* used by Sun is 3. We leave some room here and go to version number
|
||||
* 8 for NetBSD, the main difference lying in the support for the
|
||||
* `nz_list' type of symbols.
|
||||
*/
|
||||
|
||||
struct _dynamic {
|
||||
int d_version; /* version # of this interface */
|
||||
struct so_debug *d_debug;
|
||||
union {
|
||||
struct section_dispatch_table *d_sdt;
|
||||
} d_un;
|
||||
struct ld_entry *d_entry; /* compat - now in crt_ldso */
|
||||
};
|
||||
|
||||
#define LD_VERSION_SUN (3)
|
||||
#define LD_VERSION_BSD (8)
|
||||
#define LD_VERSION_NZLIST_P(v) ((v) >= 8)
|
||||
|
||||
#define LD_GOT(x) ((x)->d_un.d_sdt->sdt_got)
|
||||
#define LD_PLT(x) ((x)->d_un.d_sdt->sdt_plt)
|
||||
#define LD_REL(x) ((x)->d_un.d_sdt->sdt_rel)
|
||||
#define LD_SYMBOL(x) ((x)->d_un.d_sdt->sdt_nzlist)
|
||||
#define LD_HASH(x) ((x)->d_un.d_sdt->sdt_hash)
|
||||
#define LD_STRINGS(x) ((x)->d_un.d_sdt->sdt_strings)
|
||||
#define LD_NEED(x) ((x)->d_un.d_sdt->sdt_sods)
|
||||
#define LD_BUCKETS(x) ((x)->d_un.d_sdt->sdt_buckets)
|
||||
#define LD_PATHS(x) ((x)->d_un.d_sdt->sdt_paths)
|
||||
|
||||
#define LD_GOTSZ(x) ((x)->d_un.d_sdt->sdt_plt - (x)->d_un.d_sdt->sdt_got)
|
||||
#define LD_RELSZ(x) ((x)->d_un.d_sdt->sdt_hash - (x)->d_un.d_sdt->sdt_rel)
|
||||
#define LD_HASHSZ(x) ((x)->d_un.d_sdt->sdt_nzlist - (x)->d_un.d_sdt->sdt_hash)
|
||||
#define LD_STABSZ(x) ((x)->d_un.d_sdt->sdt_strings - (x)->d_un.d_sdt->sdt_nzlist)
|
||||
#define LD_PLTSZ(x) ((x)->d_un.d_sdt->sdt_plt_sz)
|
||||
#define LD_STRSZ(x) ((x)->d_un.d_sdt->sdt_str_sz)
|
||||
#define LD_TEXTSZ(x) ((x)->d_un.d_sdt->sdt_text_sz)
|
||||
|
||||
/*
|
||||
* Interface to ld.so
|
||||
*/
|
||||
struct crt_ldso {
|
||||
int crt_ba; /* Base address of ld.so */
|
||||
int crt_dzfd; /* "/dev/zero" file descriptor (SunOS) */
|
||||
int crt_ldfd; /* ld.so file descriptor */
|
||||
struct _dynamic *crt_dp; /* Main's __DYNAMIC */
|
||||
char **crt_ep; /* environment strings */
|
||||
caddr_t crt_bp; /* Breakpoint if run from debugger */
|
||||
char *crt_prog; /* Program name (v3) */
|
||||
char *crt_ldso; /* Link editor name (v4) */
|
||||
struct ld_entry *crt_ldentry; /* dl*() access (v4) */
|
||||
};
|
||||
|
||||
/*
|
||||
* Version passed from crt0 to ld.so (1st argument to _rtld()).
|
||||
*/
|
||||
#define CRT_VERSION_SUN 1
|
||||
#define CRT_VERSION_BSD_2 2
|
||||
#define CRT_VERSION_BSD_3 3
|
||||
#define CRT_VERSION_BSD_4 4
|
||||
|
||||
|
||||
/*
|
||||
* Maximum number of recognized shared object version numbers.
|
||||
*/
|
||||
#define MAXDEWEY 8
|
||||
|
||||
/*
|
||||
* Header of the hints file.
|
||||
*/
|
||||
struct hints_header {
|
||||
long hh_magic;
|
||||
#define HH_MAGIC 011421044151
|
||||
long hh_version; /* Interface version number */
|
||||
#define LD_HINTS_VERSION_1 1
|
||||
#define LD_HINTS_VERSION_2 2
|
||||
long hh_hashtab; /* Location of hash table */
|
||||
long hh_nbucket; /* Number of buckets in hashtab */
|
||||
long hh_strtab; /* Location of strings */
|
||||
long hh_strtab_sz; /* Size of strings */
|
||||
long hh_ehints; /* End of hints (max offset in file) */
|
||||
long hh_dirlist; /* Colon-separated list of srch dirs */
|
||||
};
|
||||
|
||||
#define HH_BADMAG(hdr) ((hdr).hh_magic != HH_MAGIC)
|
||||
|
||||
/*
|
||||
* Hash table element in hints file.
|
||||
*/
|
||||
struct hints_bucket {
|
||||
/* namex and pathx are indices into the string table */
|
||||
int hi_namex; /* Library name */
|
||||
int hi_pathx; /* Full path */
|
||||
int hi_dewey[MAXDEWEY]; /* The versions */
|
||||
int hi_ndewey; /* Number of version numbers */
|
||||
#define hi_major hi_dewey[0]
|
||||
#define hi_minor hi_dewey[1]
|
||||
int hi_next; /* Next in this bucket */
|
||||
};
|
||||
|
||||
#define _PATH_LD_HINTS "/var/run/ld.so.hints"
|
||||
|
||||
#endif /* _LINK_AOUT_H_ */
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
/* $NetBSD: link_elf.h,v 1.10 2010/10/16 10:27:06 skrll Exp $ */
|
||||
|
||||
#ifndef _LINK_ELF_H_
|
||||
#define _LINK_ELF_H_
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/exec_elf.h>
|
||||
|
||||
typedef struct link_map {
|
||||
caddr_t l_addr; /* Base Address of library */
|
||||
#ifdef __mips__
|
||||
caddr_t l_offs; /* Load Offset of library */
|
||||
#endif
|
||||
const char *l_name; /* Absolute Path to Library */
|
||||
void *l_ld; /* Pointer to .dynamic in memory */
|
||||
struct link_map *l_next; /* linked list of of mapped libs */
|
||||
struct link_map *l_prev;
|
||||
} Link_map;
|
||||
|
||||
/*
|
||||
* This only exists for GDB.
|
||||
*/
|
||||
struct r_debug {
|
||||
int r_version; /* not used */
|
||||
struct link_map *r_map; /* list of loaded images */
|
||||
void (*r_brk)(void); /* pointer to break point */
|
||||
enum {
|
||||
RT_CONSISTENT, /* things are stable */
|
||||
RT_ADD, /* adding a shared library */
|
||||
RT_DELETE /* removing a shared library */
|
||||
} r_state;
|
||||
};
|
||||
|
||||
struct dl_phdr_info
|
||||
{
|
||||
Elf_Addr dlpi_addr; /* module relocation base */
|
||||
const char *dlpi_name; /* module name */
|
||||
const Elf_Phdr *dlpi_phdr; /* pointer to module's phdr */
|
||||
Elf_Half dlpi_phnum; /* number of entries in phdr */
|
||||
unsigned long long int dlpi_adds; /* total # of loads */
|
||||
unsigned long long int dlpi_subs; /* total # of unloads */
|
||||
size_t dlpi_tls_modid;
|
||||
void *dlpi_tls_data;
|
||||
};
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
int dl_iterate_phdr(int (*)(struct dl_phdr_info *, size_t, void *),
|
||||
void *);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _LINK_ELF_H_ */
|
||||
127
include/locale.h
127
include/locale.h
|
|
@ -1,127 +0,0 @@
|
|||
/* $NetBSD: locale.h,v 1.24 2013/05/17 14:11:55 joerg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1991, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)locale.h 8.1 (Berkeley) 6/2/93
|
||||
*/
|
||||
|
||||
#ifndef _LOCALE_H_
|
||||
#define _LOCALE_H_
|
||||
|
||||
#include <sys/featuretest.h>
|
||||
|
||||
struct lconv {
|
||||
char *decimal_point;
|
||||
char *thousands_sep;
|
||||
char *grouping;
|
||||
char *int_curr_symbol;
|
||||
char *currency_symbol;
|
||||
char *mon_decimal_point;
|
||||
char *mon_thousands_sep;
|
||||
char *mon_grouping;
|
||||
char *positive_sign;
|
||||
char *negative_sign;
|
||||
char int_frac_digits;
|
||||
char frac_digits;
|
||||
char p_cs_precedes;
|
||||
char p_sep_by_space;
|
||||
char n_cs_precedes;
|
||||
char n_sep_by_space;
|
||||
char p_sign_posn;
|
||||
char n_sign_posn;
|
||||
char int_p_cs_precedes;
|
||||
char int_n_cs_precedes;
|
||||
char int_p_sep_by_space;
|
||||
char int_n_sep_by_space;
|
||||
char int_p_sign_posn;
|
||||
char int_n_sign_posn;
|
||||
};
|
||||
|
||||
#include <sys/null.h>
|
||||
|
||||
#define LC_ALL 0
|
||||
#define LC_COLLATE 1
|
||||
#define LC_CTYPE 2
|
||||
#define LC_MONETARY 3
|
||||
#define LC_NUMERIC 4
|
||||
#define LC_TIME 5
|
||||
#define LC_MESSAGES 6
|
||||
|
||||
#define _LC_LAST 7 /* marks end */
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#if (_POSIX_C_SOURCE - 0) >= 200809L || defined(_NETBSD_SOURCE) || \
|
||||
defined(__SETLOCALE_SOURCE__)
|
||||
# ifndef __LOCALE_T_DECLARED
|
||||
typedef struct _locale *locale_t;
|
||||
# define __LOCALE_T_DECLARED
|
||||
# endif
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
struct lconv *localeconv(void);
|
||||
char *setlocale(int, const char *) __RENAME(__setlocale50);
|
||||
|
||||
#if (_POSIX_C_SOURCE - 0) >= 200809L || defined(_NETBSD_SOURCE)
|
||||
# ifndef __LOCALE_T_DECLARED
|
||||
typedef struct _locale *locale_t;
|
||||
# define __LOCALE_T_DECLARED
|
||||
# endif
|
||||
#define LC_ALL_MASK ((int)~0)
|
||||
#define LC_COLLATE_MASK ((int)(1 << LC_COLLATE))
|
||||
#define LC_CTYPE_MASK ((int)(1 << LC_CTYPE))
|
||||
#define LC_MONETARY_MASK ((int)(1 << LC_MONETARY))
|
||||
#define LC_NUMERIC_MASK ((int)(1 << LC_NUMERIC))
|
||||
#define LC_TIME_MASK ((int)(1 << LC_TIME))
|
||||
#define LC_MESSAGES_MASK ((int)(1 << LC_MESSAGES))
|
||||
locale_t duplocale(locale_t);
|
||||
void freelocale(locale_t);
|
||||
struct lconv *localeconv_l(locale_t);
|
||||
locale_t newlocale(int, const char *, locale_t);
|
||||
|
||||
#ifndef _LIBC
|
||||
extern struct _locale _lc_global_locale;
|
||||
#else
|
||||
extern __dso_protected struct _locale _lc_global_locale;
|
||||
#endif
|
||||
#define LC_GLOBAL_LOCALE (&_lc_global_locale)
|
||||
#endif /* _POSIX_SOURCE >= 200809 || _NETBSD_SOURCE */
|
||||
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
# ifndef _LIBC
|
||||
extern const struct _locale _lc_C_locale;
|
||||
# else
|
||||
extern __dso_protected const struct _locale _lc_C_locale;
|
||||
# endif
|
||||
#define LC_C_LOCALE ((locale_t)__UNCONST(&_lc_C_locale))
|
||||
#endif
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _LOCALE_H_ */
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
/* $NetBSD: login_cap.h,v 1.11 2009/01/11 03:04:12 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1995,1997 Berkeley Software Design, Inc. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Berkeley Software Design,
|
||||
* Inc.
|
||||
* 4. The name of Berkeley Software Design, Inc. may not be used to endorse
|
||||
* or promote products derived from this software without specific prior
|
||||
* written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BERKELEY SOFTWARE DESIGN, INC. ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL BERKELEY SOFTWARE DESIGN, INC. BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* BSDI login_cap.h,v 2.10 1997/08/07 21:35:19 prb Exp
|
||||
*/
|
||||
|
||||
#ifndef _LOGIN_CAP_H_
|
||||
#define _LOGIN_CAP_H_
|
||||
|
||||
#define LOGIN_DEFCLASS "default"
|
||||
#define LOGIN_DEFSERVICE "login"
|
||||
#define LOGIN_DEFUMASK 022
|
||||
#define _PATH_LOGIN_CONF "/etc/login.conf"
|
||||
|
||||
#define LOGIN_OSETGROUP 0x0001 /* Obsolete setgroup */
|
||||
#define LOGIN_SETLOGIN 0x0002 /* Set login */
|
||||
#define LOGIN_SETPATH 0x0004 /* Set path */
|
||||
#define LOGIN_SETPRIORITY 0x0008 /* Set priority */
|
||||
#define LOGIN_SETRESOURCES 0x0010 /* Set resource limits */
|
||||
#define LOGIN_SETUMASK 0x0020 /* Set umask */
|
||||
#define LOGIN_SETUSER 0x0040 /* Set user */
|
||||
#define LOGIN_SETENV 0x0080 /* Set user environment */
|
||||
#define LOGIN_SETGID 0x0100 /* Set group id */
|
||||
#define LOGIN_SETGROUPS 0x0200 /* Set group membership (initgroups) */
|
||||
#define LOGIN_SETALL 0x03fe /* Set all. 0x0001 is obsolete! */
|
||||
#define LOGIN_SETGROUP (LOGIN_SETGID|LOGIN_SETGROUPS) /* Set group */
|
||||
|
||||
typedef struct {
|
||||
char *lc_class;
|
||||
char *lc_cap;
|
||||
char *lc_style;
|
||||
} login_cap_t;
|
||||
|
||||
typedef int (*envfunc_t)(void *, const char *, const char *, int);
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__BEGIN_DECLS
|
||||
struct passwd;
|
||||
|
||||
login_cap_t *login_getclass(const char *);
|
||||
#ifndef __LIBC12_SOURCE__
|
||||
login_cap_t *login_getpwclass(const struct passwd *)
|
||||
__RENAME(__login_getpwclass50);
|
||||
#endif
|
||||
void login_close(login_cap_t *);
|
||||
int login_getcapbool(login_cap_t *, const char *, u_int);
|
||||
quad_t login_getcapnum(login_cap_t *, const char *, quad_t, quad_t);
|
||||
quad_t login_getcapsize(login_cap_t *, const char *, quad_t, quad_t);
|
||||
char *login_getcapstr(login_cap_t *, const char *, char *, char *);
|
||||
quad_t login_getcaptime(login_cap_t *, const char *, quad_t, quad_t);
|
||||
|
||||
int setclasscontext(const char *, u_int);
|
||||
#ifndef __LIBC12_SOURCE__
|
||||
int setusercontext(login_cap_t *, struct passwd *, uid_t, u_int)
|
||||
__RENAME(__setusercontext50);
|
||||
#endif
|
||||
void setuserpath(login_cap_t *, const char *, envfunc_t, void *);
|
||||
int setuserenv(login_cap_t *, envfunc_t, void *);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_LOGIN_CAP_H_ */
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
/* $NetBSD: lwp.h,v 1.12 2014/01/31 20:44:17 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Nathan Williams.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _LWP_H_
|
||||
#define _LWP_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/ucontext.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
struct lwpctl;
|
||||
|
||||
__BEGIN_DECLS
|
||||
lwpid_t _lwp_self(void);
|
||||
int _lwp_create(const ucontext_t *, unsigned long, lwpid_t *);
|
||||
int _lwp_exit(void);
|
||||
int _lwp_wait(lwpid_t, lwpid_t *);
|
||||
int _lwp_suspend(lwpid_t);
|
||||
int _lwp_continue(lwpid_t);
|
||||
int _lwp_wakeup(lwpid_t);
|
||||
void _lwp_makecontext(ucontext_t *, void (*)(void *), void *, void *,
|
||||
caddr_t, size_t);
|
||||
void *_lwp_getprivate(void);
|
||||
void _lwp_setprivate(void *);
|
||||
int _lwp_kill(lwpid_t, int);
|
||||
int _lwp_detach(lwpid_t);
|
||||
#ifndef __LIBC12_SOURCE__
|
||||
int _lwp_park(clockid_t, int, const struct timespec *, lwpid_t,
|
||||
const void *, const void *) __RENAME(___lwp_park60);
|
||||
#endif
|
||||
int _lwp_unpark(lwpid_t, const void *);
|
||||
ssize_t _lwp_unpark_all(const lwpid_t *, size_t, const void *);
|
||||
int _lwp_setname(lwpid_t, const char *);
|
||||
int _lwp_getname(lwpid_t, char *, size_t);
|
||||
int _lwp_ctl(int, struct lwpctl **);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_LWP_H_ */
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
/* $NetBSD: malloc.h,v 1.3 1994/10/26 00:56:03 cgd Exp $ */
|
||||
|
||||
#include <stdlib.h>
|
||||
585
include/math.h
585
include/math.h
|
|
@ -1,585 +0,0 @@
|
|||
/* $NetBSD: math.h,v 1.63 2013/09/16 15:54:42 martin Exp $ */
|
||||
|
||||
/*
|
||||
* ====================================================
|
||||
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
* Developed at SunPro, a Sun Microsystems, Inc. business.
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software is freely granted, provided that this notice
|
||||
* is preserved.
|
||||
* ====================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
* @(#)fdlibm.h 5.1 93/09/24
|
||||
*/
|
||||
|
||||
#ifndef _MATH_H_
|
||||
#define _MATH_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/featuretest.h>
|
||||
|
||||
union __float_u {
|
||||
unsigned char __dummy[sizeof(float)];
|
||||
float __val;
|
||||
};
|
||||
|
||||
union __double_u {
|
||||
unsigned char __dummy[sizeof(double)];
|
||||
double __val;
|
||||
};
|
||||
|
||||
union __long_double_u {
|
||||
unsigned char __dummy[sizeof(long double)];
|
||||
long double __val;
|
||||
};
|
||||
|
||||
#include <machine/math.h> /* may use __float_u, __double_u,
|
||||
or __long_double_u */
|
||||
#include <limits.h> /* for INT_{MIN,MAX} */
|
||||
|
||||
#if ((_POSIX_C_SOURCE - 0) >= 200809L || defined(_NETBSD_SOURCE))
|
||||
# if defined(__FLT_EVAL_METHOD__) && (__FLT_EVAL_METHOD__ - 0) == 0
|
||||
typedef double double_t;
|
||||
typedef float float_t;
|
||||
# elif (__FLT_EVAL_METHOD__ - 0) == 1
|
||||
typedef double double_t;
|
||||
typedef double float_t;
|
||||
# elif (__FLT_EVAL_METHOD__ - 0) == 2
|
||||
typedef long double double_t;
|
||||
typedef long double float_t;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __HAVE_LONG_DOUBLE
|
||||
#define __fpmacro_unary_floating(__name, __arg0) \
|
||||
/* LINTED */ \
|
||||
((sizeof (__arg0) == sizeof (float)) \
|
||||
? __ ## __name ## f (__arg0) \
|
||||
: (sizeof (__arg0) == sizeof (double)) \
|
||||
? __ ## __name ## d (__arg0) \
|
||||
: __ ## __name ## l (__arg0))
|
||||
#else
|
||||
#define __fpmacro_unary_floating(__name, __arg0) \
|
||||
/* LINTED */ \
|
||||
((sizeof (__arg0) == sizeof (float)) \
|
||||
? __ ## __name ## f (__arg0) \
|
||||
: __ ## __name ## d (__arg0))
|
||||
#endif /* __HAVE_LONG_DOUBLE */
|
||||
|
||||
/*
|
||||
* ANSI/POSIX
|
||||
*/
|
||||
/* 7.12#3 HUGE_VAL, HUGELF, HUGE_VALL */
|
||||
#if __GNUC_PREREQ__(3, 3)
|
||||
#define HUGE_VAL __builtin_huge_val()
|
||||
#else
|
||||
extern const union __double_u __infinity;
|
||||
#define HUGE_VAL __infinity.__val
|
||||
#endif
|
||||
|
||||
/*
|
||||
* ISO C99
|
||||
*/
|
||||
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) && \
|
||||
!defined(_XOPEN_SOURCE) || \
|
||||
((__STDC_VERSION__ - 0) >= 199901L) || \
|
||||
((_POSIX_C_SOURCE - 0) >= 200112L) || \
|
||||
((_XOPEN_SOURCE - 0) >= 600) || \
|
||||
defined(_ISOC99_SOURCE) || defined(_NETBSD_SOURCE)
|
||||
/* 7.12#3 HUGE_VAL, HUGELF, HUGE_VALL */
|
||||
#if __GNUC_PREREQ__(3, 3)
|
||||
#define HUGE_VALF __builtin_huge_valf()
|
||||
#define HUGE_VALL __builtin_huge_vall()
|
||||
#else
|
||||
extern const union __float_u __infinityf;
|
||||
#define HUGE_VALF __infinityf.__val
|
||||
|
||||
extern const union __long_double_u __infinityl;
|
||||
#define HUGE_VALL __infinityl.__val
|
||||
#endif
|
||||
|
||||
/* 7.12#4 INFINITY */
|
||||
#if defined(__INFINITY)
|
||||
#define INFINITY __INFINITY /* float constant which overflows */
|
||||
#elif __GNUC_PREREQ__(3, 3)
|
||||
#define INFINITY __builtin_inff()
|
||||
#else
|
||||
#define INFINITY HUGE_VALF /* positive infinity */
|
||||
#endif /* __INFINITY */
|
||||
|
||||
/* 7.12#5 NAN: a quiet NaN, if supported */
|
||||
#ifdef __HAVE_NANF
|
||||
#if __GNUC_PREREQ__(3,3)
|
||||
#define NAN __builtin_nanf("")
|
||||
#else
|
||||
extern const union __float_u __nanf;
|
||||
#define NAN __nanf.__val
|
||||
#endif
|
||||
#endif /* __HAVE_NANF */
|
||||
|
||||
/* 7.12#6 number classification macros */
|
||||
#define FP_INFINITE 0x00
|
||||
#define FP_NAN 0x01
|
||||
#define FP_NORMAL 0x02
|
||||
#define FP_SUBNORMAL 0x03
|
||||
#define FP_ZERO 0x04
|
||||
/* NetBSD extensions */
|
||||
#define _FP_LOMD 0x80 /* range for machine-specific classes */
|
||||
#define _FP_HIMD 0xff
|
||||
|
||||
#define FP_ILOGB0 INT_MIN
|
||||
#define FP_ILOGBNAN INT_MAX
|
||||
|
||||
#endif /* !_ANSI_SOURCE && ... */
|
||||
|
||||
/*
|
||||
* XOPEN/SVID
|
||||
*/
|
||||
#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
|
||||
#define M_E 2.7182818284590452354 /* e */
|
||||
#define M_LOG2E 1.4426950408889634074 /* log 2e */
|
||||
#define M_LOG10E 0.43429448190325182765 /* log 10e */
|
||||
#define M_LN2 0.69314718055994530942 /* log e2 */
|
||||
#define M_LN10 2.30258509299404568402 /* log e10 */
|
||||
#define M_PI 3.14159265358979323846 /* pi */
|
||||
#define M_PI_2 1.57079632679489661923 /* pi/2 */
|
||||
#define M_PI_4 0.78539816339744830962 /* pi/4 */
|
||||
#define M_1_PI 0.31830988618379067154 /* 1/pi */
|
||||
#define M_2_PI 0.63661977236758134308 /* 2/pi */
|
||||
#define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */
|
||||
#define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
|
||||
#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
|
||||
|
||||
#define MAXFLOAT ((float)3.40282346638528860e+38)
|
||||
extern int signgam;
|
||||
#endif /* _XOPEN_SOURCE || _NETBSD_SOURCE */
|
||||
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
enum fdversion {fdlibm_ieee = -1, fdlibm_svid, fdlibm_xopen, fdlibm_posix};
|
||||
|
||||
#define _LIB_VERSION_TYPE enum fdversion
|
||||
#define _LIB_VERSION _fdlib_version
|
||||
|
||||
/* if global variable _LIB_VERSION is not desirable, one may
|
||||
* change the following to be a constant by:
|
||||
* #define _LIB_VERSION_TYPE const enum version
|
||||
* In that case, after one initializes the value _LIB_VERSION (see
|
||||
* s_lib_version.c) during compile time, it cannot be modified
|
||||
* in the middle of a program
|
||||
*/
|
||||
extern _LIB_VERSION_TYPE _LIB_VERSION;
|
||||
|
||||
#define _IEEE_ fdlibm_ieee
|
||||
#define _SVID_ fdlibm_svid
|
||||
#define _XOPEN_ fdlibm_xopen
|
||||
#define _POSIX_ fdlibm_posix
|
||||
|
||||
#ifndef __cplusplus
|
||||
struct exception {
|
||||
int type;
|
||||
const char *name;
|
||||
double arg1;
|
||||
double arg2;
|
||||
double retval;
|
||||
};
|
||||
#endif
|
||||
|
||||
#define HUGE MAXFLOAT
|
||||
|
||||
/*
|
||||
* set X_TLOSS = pi*2**52, which is possibly defined in <values.h>
|
||||
* (one may replace the following line by "#include <values.h>")
|
||||
*/
|
||||
|
||||
#define X_TLOSS 1.41484755040568800000e+16
|
||||
|
||||
#define DOMAIN 1
|
||||
#define SING 2
|
||||
#define OVERFLOW 3
|
||||
#define UNDERFLOW 4
|
||||
#define TLOSS 5
|
||||
#define PLOSS 6
|
||||
|
||||
#endif /* _NETBSD_SOURCE */
|
||||
|
||||
__BEGIN_DECLS
|
||||
/*
|
||||
* ANSI/POSIX
|
||||
*/
|
||||
double acos(double);
|
||||
double asin(double);
|
||||
double atan(double);
|
||||
double atan2(double, double);
|
||||
double cos(double);
|
||||
double sin(double);
|
||||
double tan(double);
|
||||
|
||||
double cosh(double);
|
||||
double sinh(double);
|
||||
double tanh(double);
|
||||
|
||||
double exp(double);
|
||||
double exp2(double);
|
||||
double frexp(double, int *);
|
||||
double ldexp(double, int);
|
||||
double log(double);
|
||||
double log2(double);
|
||||
double log10(double);
|
||||
double modf(double, double *);
|
||||
|
||||
double pow(double, double);
|
||||
double sqrt(double);
|
||||
|
||||
double ceil(double);
|
||||
double fabs(double);
|
||||
double floor(double);
|
||||
double fmod(double, double);
|
||||
|
||||
#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
|
||||
double erf(double);
|
||||
double erfc(double);
|
||||
double gamma(double);
|
||||
double hypot(double, double);
|
||||
int finite(double);
|
||||
double j0(double);
|
||||
double j1(double);
|
||||
double jn(int, double);
|
||||
double lgamma(double);
|
||||
double y0(double);
|
||||
double y1(double);
|
||||
double yn(int, double);
|
||||
|
||||
#if (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE)
|
||||
double acosh(double);
|
||||
double asinh(double);
|
||||
double atanh(double);
|
||||
double cbrt(double);
|
||||
double expm1(double);
|
||||
int ilogb(double);
|
||||
double log1p(double);
|
||||
double logb(double);
|
||||
double nextafter(double, double);
|
||||
double remainder(double, double);
|
||||
double rint(double);
|
||||
double scalb(double, double);
|
||||
#endif /* (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE)*/
|
||||
#endif /* _XOPEN_SOURCE || _NETBSD_SOURCE */
|
||||
|
||||
/*
|
||||
* ISO C99
|
||||
*/
|
||||
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) && \
|
||||
!defined(_XOPEN_SOURCE) || \
|
||||
((__STDC_VERSION__ - 0) >= 199901L) || \
|
||||
((_POSIX_C_SOURCE - 0) >= 200112L) || \
|
||||
((_XOPEN_SOURCE - 0) >= 600) || \
|
||||
defined(_ISOC99_SOURCE) || defined(_NETBSD_SOURCE)
|
||||
/* 7.12.3.1 int fpclassify(real-floating x) */
|
||||
#define fpclassify(__x) __fpmacro_unary_floating(fpclassify, __x)
|
||||
|
||||
/* 7.12.3.2 int isfinite(real-floating x) */
|
||||
#define isfinite(__x) __fpmacro_unary_floating(isfinite, __x)
|
||||
|
||||
/* 7.12.3.5 int isnormal(real-floating x) */
|
||||
#define isnormal(__x) (fpclassify(__x) == FP_NORMAL)
|
||||
|
||||
/* 7.12.3.6 int signbit(real-floating x) */
|
||||
#define signbit(__x) __fpmacro_unary_floating(signbit, __x)
|
||||
|
||||
/* 7.12.4 trigonometric */
|
||||
|
||||
float acosf(float);
|
||||
float asinf(float);
|
||||
float atanf(float);
|
||||
float atan2f(float, float);
|
||||
float cosf(float);
|
||||
float sinf(float);
|
||||
float tanf(float);
|
||||
|
||||
long double acosl(long double);
|
||||
long double asinl(long double);
|
||||
long double atanl(long double);
|
||||
long double atan2l(long double, long double);
|
||||
long double cosl(long double);
|
||||
long double sinl(long double);
|
||||
long double tanl(long double);
|
||||
|
||||
/* 7.12.5 hyperbolic */
|
||||
|
||||
float acoshf(float);
|
||||
float asinhf(float);
|
||||
float atanhf(float);
|
||||
float coshf(float);
|
||||
float sinhf(float);
|
||||
float tanhf(float);
|
||||
long double acoshl(long double);
|
||||
long double asinhl(long double);
|
||||
long double atanhl(long double);
|
||||
long double coshl(long double);
|
||||
long double sinhl(long double);
|
||||
long double tanhl(long double);
|
||||
|
||||
/* 7.12.6 exp / log */
|
||||
|
||||
float expf(float);
|
||||
float exp2f(float);
|
||||
float expm1f(float);
|
||||
float frexpf(float, int *);
|
||||
int ilogbf(float);
|
||||
float ldexpf(float, int);
|
||||
float logf(float);
|
||||
float log2f(float);
|
||||
float log10f(float);
|
||||
float log1pf(float);
|
||||
float logbf(float);
|
||||
float modff(float, float *);
|
||||
float scalbnf(float, int);
|
||||
float scalblnf(float, long);
|
||||
|
||||
long double expl(long double);
|
||||
long double exp2l(long double);
|
||||
long double expm1l(long double);
|
||||
long double frexpl(long double, int *);
|
||||
int ilogbl(long double);
|
||||
long double ldexpl(long double, int);
|
||||
long double logl(long double);
|
||||
long double log2l(long double);
|
||||
long double log10l(long double);
|
||||
long double log1pl(long double);
|
||||
long double logbl(long double);
|
||||
long double modfl(long double, long double *);
|
||||
long double scalbnl(long double, int);
|
||||
long double scalblnl(long double, long);
|
||||
|
||||
|
||||
/* 7.12.7 power / absolute */
|
||||
|
||||
float cbrtf(float);
|
||||
float fabsf(float);
|
||||
float hypotf(float, float);
|
||||
float powf(float, float);
|
||||
float sqrtf(float);
|
||||
long double cbrtl(long double);
|
||||
long double fabsl(long double);
|
||||
long double hypotl(long double, long double);
|
||||
long double powl(long double, long double);
|
||||
long double sqrtl(long double);
|
||||
|
||||
/* 7.12.8 error / gamma */
|
||||
|
||||
double tgamma(double);
|
||||
float erff(float);
|
||||
float erfcf(float);
|
||||
float lgammaf(float);
|
||||
float tgammaf(float);
|
||||
long double erfl(long double);
|
||||
long double erfcl(long double);
|
||||
long double lgammal(long double);
|
||||
long double tgammal(long double);
|
||||
|
||||
/* 7.12.9 nearest integer */
|
||||
|
||||
/* LONGLONG */
|
||||
long long int llrint(double);
|
||||
long int lround(double);
|
||||
/* LONGLONG */
|
||||
long long int llround(double);
|
||||
long int lrint(double);
|
||||
double round(double);
|
||||
double trunc(double);
|
||||
|
||||
float ceilf(float);
|
||||
float floorf(float);
|
||||
/* LONGLONG */
|
||||
long long int llrintf(float);
|
||||
long int lroundf(float);
|
||||
/* LONGLONG */
|
||||
long long int llroundf(float);
|
||||
long int lrintf(float);
|
||||
float rintf(float);
|
||||
float roundf(float);
|
||||
float truncf(float);
|
||||
long double ceill(long double);
|
||||
long double floorl(long double);
|
||||
/* LONGLONG */
|
||||
long long int llrintl(long double);
|
||||
long int lroundl(long double);
|
||||
/* LONGLONG */
|
||||
long long int llroundl(long double);
|
||||
long int lrintl(long double);
|
||||
long double rintl(long double);
|
||||
long double roundl(long double);
|
||||
long double truncl(long double);
|
||||
|
||||
/* 7.12.10 remainder */
|
||||
|
||||
float fmodf(float, float);
|
||||
float remainderf(float, float);
|
||||
long double fmodl(long double, long double);
|
||||
long double remainderl(long double, long double);
|
||||
|
||||
/* 7.12.10.3 The remquo functions */
|
||||
double remquo(double, double, int *);
|
||||
float remquof(float, float, int *);
|
||||
long double remquol(long double, long double, int *);
|
||||
|
||||
/* 7.12.11 manipulation */
|
||||
|
||||
double nan(const char *);
|
||||
double nearbyint(double);
|
||||
double nexttoward(double, long double);
|
||||
float copysignf(float, float);
|
||||
float nanf(const char *);
|
||||
float nearbyintf(float);
|
||||
float nextafterf(float, float);
|
||||
float nexttowardf(float, long double);
|
||||
long double copysignl(long double, long double);
|
||||
long double nanl(const char *);
|
||||
long double nearbyintl(long double);
|
||||
long double nextafterl(long double, long double);
|
||||
long double nexttowardl(long double, long double);
|
||||
|
||||
/* 7.12.14 comparison */
|
||||
|
||||
#define isunordered(x, y) (isnan(x) || isnan(y))
|
||||
#define isgreater(x, y) (!isunordered((x), (y)) && (x) > (y))
|
||||
#define isgreaterequal(x, y) (!isunordered((x), (y)) && (x) >= (y))
|
||||
#define isless(x, y) (!isunordered((x), (y)) && (x) < (y))
|
||||
#define islessequal(x, y) (!isunordered((x), (y)) && (x) <= (y))
|
||||
#define islessgreater(x, y) (!isunordered((x), (y)) && \
|
||||
((x) > (y) || (y) > (x)))
|
||||
double fdim(double, double);
|
||||
double fma(double, double, double);
|
||||
double fmax(double, double);
|
||||
double fmin(double, double);
|
||||
float fdimf(float, float);
|
||||
float fmaf(float, float, float);
|
||||
float fmaxf(float, float);
|
||||
float fminf(float, float);
|
||||
long double fdiml(long double, long double);
|
||||
long double fmal(long double, long double, long double);
|
||||
long double fmaxl(long double, long double);
|
||||
long double fminl(long double, long double);
|
||||
|
||||
#endif /* !_ANSI_SOURCE && ... */
|
||||
|
||||
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) || \
|
||||
!defined(_XOPEN_SOURCE) || \
|
||||
((__STDC_VERSION__ - 0) >= 199901L) || \
|
||||
((_POSIX_C_SOURCE - 0) >= 200112L) || \
|
||||
defined(_ISOC99_SOURCE) || defined(_NETBSD_SOURCE)
|
||||
/* 7.12.3.3 int isinf(real-floating x) */
|
||||
#if defined(__isinf) || defined(__HAVE_INLINE___ISINF)
|
||||
#define isinf(__x) __isinf(__x)
|
||||
#else
|
||||
#define isinf(__x) __fpmacro_unary_floating(isinf, __x)
|
||||
#endif
|
||||
|
||||
/* 7.12.3.4 int isnan(real-floating x) */
|
||||
#if defined(__isnan) || defined(__HAVE_INLINE___ISNAN)
|
||||
#define isnan(__x) __isnan(__x)
|
||||
#else
|
||||
#define isnan(__x) __fpmacro_unary_floating(isnan, __x)
|
||||
#endif
|
||||
#endif /* !_ANSI_SOURCE && ... */
|
||||
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
#ifndef __cplusplus
|
||||
int matherr(struct exception *);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IEEE Test Vector
|
||||
*/
|
||||
double significand(double);
|
||||
|
||||
/*
|
||||
* Functions callable from C, intended to support IEEE arithmetic.
|
||||
*/
|
||||
double copysign(double, double);
|
||||
double scalbn(double, int);
|
||||
double scalbln(double, long);
|
||||
|
||||
/*
|
||||
* BSD math library entry points
|
||||
*/
|
||||
double drem(double, double);
|
||||
|
||||
#endif /* _NETBSD_SOURCE */
|
||||
|
||||
#if defined(_NETBSD_SOURCE) || defined(_REENTRANT)
|
||||
/*
|
||||
* Reentrant version of gamma & lgamma; passes signgam back by reference
|
||||
* as the second argument; user must allocate space for signgam.
|
||||
*/
|
||||
double gamma_r(double, int *);
|
||||
double lgamma_r(double, int *);
|
||||
#endif /* _NETBSD_SOURCE || _REENTRANT */
|
||||
|
||||
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
|
||||
/* float versions of ANSI/POSIX functions */
|
||||
|
||||
float gammaf(float);
|
||||
int isinff(float);
|
||||
int isnanf(float);
|
||||
int finitef(float);
|
||||
float j0f(float);
|
||||
float j1f(float);
|
||||
float jnf(int, float);
|
||||
float y0f(float);
|
||||
float y1f(float);
|
||||
float ynf(int, float);
|
||||
|
||||
float scalbf(float, float);
|
||||
|
||||
/*
|
||||
* float version of IEEE Test Vector
|
||||
*/
|
||||
float significandf(float);
|
||||
|
||||
/*
|
||||
* float versions of BSD math library entry points
|
||||
*/
|
||||
float dremf(float, float);
|
||||
#endif /* _NETBSD_SOURCE */
|
||||
|
||||
#if defined(_NETBSD_SOURCE) || defined(_REENTRANT)
|
||||
/*
|
||||
* Float versions of reentrant version of gamma & lgamma; passes
|
||||
* signgam back by reference as the second argument; user must
|
||||
* allocate space for signgam.
|
||||
*/
|
||||
float gammaf_r(float, int *);
|
||||
float lgammaf_r(float, int *);
|
||||
#endif /* !... || _REENTRANT */
|
||||
|
||||
/*
|
||||
* Library implementation
|
||||
*/
|
||||
int __fpclassifyf(float);
|
||||
int __fpclassifyd(double);
|
||||
int __isfinitef(float);
|
||||
int __isfinited(double);
|
||||
int __isinff(float);
|
||||
int __isinfd(double);
|
||||
int __isnanf(float);
|
||||
int __isnand(double);
|
||||
int __signbitf(float);
|
||||
int __signbitd(double);
|
||||
|
||||
#ifdef __HAVE_LONG_DOUBLE
|
||||
int __fpclassifyl(long double);
|
||||
int __isfinitel(long double);
|
||||
int __isinfl(long double);
|
||||
int __isnanl(long double);
|
||||
int __signbitl(long double);
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _MATH_H_ */
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
/* $NetBSD: md2.h,v 1.6 2005/12/26 19:01:47 perry Exp $ */
|
||||
|
||||
#ifndef _MD2_H_
|
||||
#define _MD2_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#define MD2_DIGEST_LENGTH 16
|
||||
#define MD2_DIGEST_STRING_LENGTH 33
|
||||
|
||||
/* MD2 context. */
|
||||
typedef struct MD2Context {
|
||||
uint32_t i;
|
||||
unsigned char C[16]; /* checksum */
|
||||
unsigned char X[48]; /* input buffer */
|
||||
} MD2_CTX;
|
||||
|
||||
__BEGIN_DECLS
|
||||
void MD2Init(MD2_CTX *);
|
||||
void MD2Update(MD2_CTX *, const unsigned char *, unsigned int);
|
||||
void MD2Final(unsigned char[16], MD2_CTX *);
|
||||
char *MD2End(MD2_CTX *, char *);
|
||||
char *MD2File(const char *, char *);
|
||||
char *MD2FileChunk(const char *, char *, off_t, off_t);
|
||||
char *MD2Data(const unsigned char *, size_t, char *);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _MD2_H_ */
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
/* $NetBSD: memory.h,v 1.5 2003/08/07 09:44:10 agc Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)memory.h 8.1 (Berkeley) 6/2/93
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
|
@ -1,108 +0,0 @@
|
|||
/* $NetBSD: mntopts.h,v 1.15 2012/10/19 17:09:06 drochner Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1994
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)mntopts.h 8.7 (Berkeley) 3/29/95
|
||||
*/
|
||||
#ifndef _MNTOPTS_H_
|
||||
#define _MNTOPTS_H_
|
||||
|
||||
struct mntopt {
|
||||
const char *m_option; /* option name */
|
||||
int m_inverse; /* if a negative option, eg "dev" */
|
||||
int m_flag; /* bit to set, eg. MNT_RDONLY */
|
||||
int m_altloc; /* 1 => set bit in altflags */
|
||||
};
|
||||
|
||||
/* User-visible MNT_ flags. */
|
||||
#define MOPT_ASYNC { "async", 0, MNT_ASYNC, 0 }
|
||||
#define MOPT_NOCOREDUMP { "coredump", 1, MNT_NOCOREDUMP, 0 }
|
||||
#define MOPT_NODEV { "dev", 1, MNT_NODEV, 0 }
|
||||
#define MOPT_NODEVMTIME { "devmtime", 1, MNT_NODEVMTIME, 0 }
|
||||
#define MOPT_NOEXEC { "exec", 1, MNT_NOEXEC, 0 }
|
||||
#define MOPT_NOSUID { "suid", 1, MNT_NOSUID, 0 }
|
||||
#define MOPT_RDONLY { "rdonly", 0, MNT_RDONLY, 0 }
|
||||
#define MOPT_SYNC { "sync", 0, MNT_SYNCHRONOUS, 0 }
|
||||
#define MOPT_UNION { "union", 0, MNT_UNION, 0 }
|
||||
#define MOPT_USERQUOTA { "userquota", 0, 0, 0 }
|
||||
#define MOPT_GROUPQUOTA { "groupquota", 0, 0, 0 }
|
||||
#define MOPT_NOATIME { "atime", 1, MNT_NOATIME, 0 }
|
||||
#define MOPT_SYMPERM { "symperm", 0, MNT_SYMPERM, 0 }
|
||||
#define MOPT_SOFTDEP { "softdep", 0, MNT_SOFTDEP, 0 }
|
||||
#define MOPT_LOG { "log", 0, MNT_LOG, 0 }
|
||||
#define MOPT_IGNORE { "hidden", 0, MNT_IGNORE, 0 }
|
||||
#define MOPT_EXTATTR { "extattr", 0, MNT_EXTATTR, 0 }
|
||||
#define MOPT_DISCARD { "discard", 0, MNT_DISCARD, 0 }
|
||||
|
||||
/* Control flags. */
|
||||
#define MOPT_FORCE { "force", 0, MNT_FORCE, 0 }
|
||||
#define MOPT_UPDATE { "update", 0, MNT_UPDATE, 0 }
|
||||
#define MOPT_RELOAD { "reload", 0, MNT_RELOAD, 0 }
|
||||
#define MOPT_GETARGS { "getargs", 0, MNT_GETARGS, 0 }
|
||||
|
||||
/* Support for old-style "ro", "rw" flags. */
|
||||
#define MOPT_RO { "ro", 0, MNT_RDONLY, 0 }
|
||||
#define MOPT_RW { "rw", 1, MNT_RDONLY, 0 }
|
||||
|
||||
/* This is parsed by mount(8), but is ignored by specific mount_*(8)s. */
|
||||
#define MOPT_AUTO { "auto", 0, 0, 0 }
|
||||
#define MOPT_RUMP { "rump", 0, 0, 0 }
|
||||
#define MOPT_NULL { NULL, 0, 0, 0 }
|
||||
|
||||
#define MOPT_FSTAB_COMPAT \
|
||||
MOPT_RO, \
|
||||
MOPT_RW, \
|
||||
MOPT_AUTO
|
||||
|
||||
/* Standard options which all mounts can understand. */
|
||||
#define MOPT_STDOPTS \
|
||||
MOPT_USERQUOTA, \
|
||||
MOPT_GROUPQUOTA, \
|
||||
MOPT_FSTAB_COMPAT, \
|
||||
MOPT_NOCOREDUMP, \
|
||||
MOPT_NODEV, \
|
||||
MOPT_NOEXEC, \
|
||||
MOPT_NOSUID, \
|
||||
MOPT_RDONLY, \
|
||||
MOPT_UNION, \
|
||||
MOPT_IGNORE, \
|
||||
MOPT_SYMPERM, \
|
||||
MOPT_RUMP
|
||||
|
||||
__BEGIN_DECLS
|
||||
typedef struct mntoptparse *mntoptparse_t;
|
||||
mntoptparse_t getmntopts(const char *, const struct mntopt *, int *, int *);
|
||||
const char *getmntoptstr(mntoptparse_t, const char *);
|
||||
long getmntoptnum(mntoptparse_t, const char *);
|
||||
void freemntopts(mntoptparse_t);
|
||||
|
||||
extern int getmnt_silent;
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _MNTOPTS_H_ */
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
/* $NetBSD: monetary.h,v 1.2 2008/09/21 16:59:46 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 Alexey Zelkin <phantom@FreeBSD.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD: src/include/monetary.h,v 1.7 2002/09/20 08:22:48 mike Exp $
|
||||
*/
|
||||
|
||||
#ifndef _MONETARY_H_
|
||||
#define _MONETARY_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <machine/ansi.h>
|
||||
|
||||
#ifdef _BSD_SIZE_T_
|
||||
typedef _BSD_SIZE_T_ size_t;
|
||||
#undef _BSD_SIZE_T_
|
||||
#endif
|
||||
|
||||
#ifdef _BSD_SSIZE_T_
|
||||
typedef _BSD_SSIZE_T_ ssize_t;
|
||||
#undef _BSD_SSIZE_T_
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
ssize_t strfmon(char * __restrict, size_t, const char * __restrict, ...)
|
||||
__attribute__((__format__(__strfmon__, 3, 4)));
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_MONETARY_H_ */
|
||||
103
include/mpool.h
103
include/mpool.h
|
|
@ -1,103 +0,0 @@
|
|||
/* $NetBSD: mpool.h,v 1.14 2013/11/22 16:25:01 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1991, 1993, 1994
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)mpool.h 8.2 (Berkeley) 7/14/94
|
||||
*/
|
||||
|
||||
#ifndef _MPOOL_H_
|
||||
#define _MPOOL_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/queue.h>
|
||||
|
||||
/*
|
||||
* The memory pool scheme is a simple one. Each in-memory page is referenced
|
||||
* by a bucket which is threaded in up to two of three ways. All active pages
|
||||
* are threaded on a hash chain (hashed by page number) and an lru chain.
|
||||
* Inactive pages are threaded on a free chain. Each reference to a memory
|
||||
* pool is handed an opaque MPOOL cookie which stores all of this information.
|
||||
*/
|
||||
#define HASHSIZE 128
|
||||
#define HASHKEY(pgno) ((pgno - 1) % HASHSIZE)
|
||||
|
||||
/* The BKT structures are the elements of the queues. */
|
||||
typedef struct _bkt {
|
||||
TAILQ_ENTRY(_bkt) hq; /* hash queue */
|
||||
TAILQ_ENTRY(_bkt) q; /* lru queue */
|
||||
void *page; /* page */
|
||||
pgno_t pgno; /* page number */
|
||||
|
||||
#define MPOOL_DIRTY 0x01 /* page needs to be written */
|
||||
#define MPOOL_PINNED 0x02 /* page is pinned into memory */
|
||||
uint8_t flags; /* flags */
|
||||
} BKT;
|
||||
|
||||
typedef struct MPOOL {
|
||||
TAILQ_HEAD(_lqh, _bkt) lqh; /* lru queue head */
|
||||
/* hash queue array */
|
||||
TAILQ_HEAD(_hqh, _bkt) hqh[HASHSIZE];
|
||||
pgno_t curcache; /* current number of cached pages */
|
||||
pgno_t maxcache; /* max number of cached pages */
|
||||
pgno_t npages; /* number of pages in the file */
|
||||
unsigned long pagesize; /* file page size */
|
||||
int fd; /* file descriptor */
|
||||
/* page in conversion routine */
|
||||
void (*pgin)(void *, pgno_t, void *);
|
||||
/* page out conversion routine */
|
||||
void (*pgout)(void *, pgno_t, void *);
|
||||
void *pgcookie; /* cookie for page in/out routines */
|
||||
#ifdef STATISTICS
|
||||
unsigned long cachehit;
|
||||
unsigned long cachemiss;
|
||||
unsigned long pagealloc;
|
||||
unsigned long pageflush;
|
||||
unsigned long pageget;
|
||||
unsigned long pagenew;
|
||||
unsigned long pageput;
|
||||
unsigned long pageread;
|
||||
unsigned long pagewrite;
|
||||
#endif
|
||||
} MPOOL;
|
||||
|
||||
__BEGIN_DECLS
|
||||
MPOOL *mpool_open(void *, int, pgno_t, pgno_t);
|
||||
void mpool_filter(MPOOL *, void (*)(void *, pgno_t, void *),
|
||||
void (*)(void *, pgno_t, void *), void *);
|
||||
void *mpool_new(MPOOL *, pgno_t *);
|
||||
void *mpool_get(MPOOL *, pgno_t, unsigned int);
|
||||
int mpool_put(MPOOL *, void *, unsigned int);
|
||||
int mpool_sync(MPOOL *);
|
||||
int mpool_close(MPOOL *);
|
||||
#ifdef STATISTICS
|
||||
void mpool_stat(MPOOL *);
|
||||
#endif
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _MPOOL_H_ */
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
/* $NetBSD: mqueue.h,v 1.4 2009/01/11 03:04:12 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007, Mindaugas Rasiukevicius <rmind at NetBSD org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _MQUEUE_H_
|
||||
#define _MQUEUE_H_
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <signal.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <sys/mqueue.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
int mq_close(mqd_t);
|
||||
int mq_getattr(mqd_t, struct mq_attr *);
|
||||
int mq_notify(mqd_t, const struct sigevent *);
|
||||
mqd_t mq_open(const char *, int, ...);
|
||||
ssize_t mq_receive(mqd_t, char *, size_t, unsigned *);
|
||||
int mq_send(mqd_t, const char *, size_t, unsigned);
|
||||
int mq_setattr(mqd_t, const struct mq_attr * __restrict,
|
||||
struct mq_attr * __restrict);
|
||||
#ifndef __LIBC12_SOURCE__
|
||||
ssize_t mq_timedreceive(mqd_t, char * __restrict, size_t,
|
||||
unsigned * __restrict, const struct timespec * __restrict)
|
||||
__RENAME(__mq_timedreceive50);
|
||||
int mq_timedsend(mqd_t, const char *, size_t, unsigned,
|
||||
const struct timespec *) __RENAME(__mq_timedsend50);
|
||||
#endif
|
||||
int mq_unlink(const char *);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _MQUEUE_H_ */
|
||||
|
|
@ -1,89 +0,0 @@
|
|||
/* $NetBSD: ndbm.h,v 1.15 2010/02/03 15:34:40 roy Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Margo Seltzer.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)ndbm.h 8.1 (Berkeley) 6/2/93
|
||||
*/
|
||||
|
||||
#ifndef _NDBM_H_
|
||||
#define _NDBM_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/featuretest.h>
|
||||
#include <stdint.h>
|
||||
#include <db.h>
|
||||
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
/* Map dbm interface onto db(3). */
|
||||
#define DBM_RDONLY O_RDONLY
|
||||
#endif
|
||||
|
||||
/* Flags to dbm_store(). */
|
||||
#define DBM_INSERT 0
|
||||
#define DBM_REPLACE 1
|
||||
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
/*
|
||||
* The db(3) support for ndbm(3) always appends this suffix to the
|
||||
* file name to avoid overwriting the user's original database.
|
||||
*/
|
||||
#define DBM_SUFFIX ".db"
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
void *dptr;
|
||||
size_t dsize; /* XPG4.2 */
|
||||
} datum;
|
||||
|
||||
typedef DB DBM;
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
#define dbm_pagfno(a) DBM_PAGFNO_NOT_AVAILABLE
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
void dbm_close(DBM *);
|
||||
DBM *dbm_open(const char *, int, mode_t);
|
||||
int dbm_error(DBM *);
|
||||
int dbm_clearerr(DBM *);
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
int dbm_dirfno(DBM *);
|
||||
#endif
|
||||
#ifndef __LIBC12_SOURCE__
|
||||
int dbm_delete(DBM *, datum) __RENAME(__dbm_delete13);
|
||||
datum dbm_fetch(DBM *, datum) __RENAME(__dbm_fetch13);
|
||||
datum dbm_firstkey(DBM *) __RENAME(__dbm_firstkey13);
|
||||
datum dbm_nextkey(DBM *) __RENAME(__dbm_nextkey13);
|
||||
int dbm_store(DBM *, datum, datum, int) __RENAME(__dbm_store13);
|
||||
#endif
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_NDBM_H_ */
|
||||
|
|
@ -1,123 +0,0 @@
|
|||
/* $NetBSD: netconfig.h,v 1.6 2008/04/28 20:22:54 martin Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2004 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Frank van der Linden.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _NETCONFIG_H_
|
||||
#define _NETCONFIG_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#define NETCONFIG "/etc/netconfig"
|
||||
#define NETPATH "NETPATH"
|
||||
|
||||
struct netconfig {
|
||||
char *nc_netid; /* Network ID */
|
||||
unsigned long nc_semantics; /* Semantics (see below) */
|
||||
unsigned long nc_flag; /* Flags (see below) */
|
||||
char *nc_protofmly; /* Protocol family */
|
||||
char *nc_proto; /* Protocol name */
|
||||
char *nc_device; /* Network device pathname */
|
||||
unsigned long nc_nlookups; /* Number of directory lookup libs */
|
||||
char **nc_lookups; /* Names of the libraries */
|
||||
unsigned long nc_unused[9]; /* reserved */
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct netconfig **nc_head;
|
||||
struct netconfig **nc_curr;
|
||||
} NCONF_HANDLE;
|
||||
|
||||
/*
|
||||
* nc_semantics values
|
||||
*/
|
||||
#define NC_TPI_CLTS 1 /* Connectionless transport */
|
||||
#define NC_TPI_COTS 2 /* Connection oriented transport */
|
||||
#define NC_TPI_COTS_ORD 3 /* Connection oriented, ordered transport */
|
||||
#define NC_TPI_RAW 4 /* Raw connection */
|
||||
|
||||
/*
|
||||
* nc_flag values
|
||||
*/
|
||||
#define NC_NOFLAG 0x00
|
||||
#define NC_VISIBLE 0x01
|
||||
#define NC_BROADCAST 0x02
|
||||
|
||||
/*
|
||||
* nc_protofmly values
|
||||
*/
|
||||
#define NC_NOPROTOFMLY "-"
|
||||
#define NC_LOOPBACK "loopback"
|
||||
#define NC_INET "inet"
|
||||
#define NC_INET6 "inet6"
|
||||
#define NC_IMPLINK "implink"
|
||||
#define NC_PUP "pup"
|
||||
#define NC_CHAOS "chaos"
|
||||
#define NC_NS "ns"
|
||||
#define NC_NBS "nbs"
|
||||
#define NC_ECMA "ecma"
|
||||
#define NC_DATAKIT "datakit"
|
||||
#define NC_CCITT "ccitt"
|
||||
#define NC_SNA "sna"
|
||||
#define NC_DECNET "decnet"
|
||||
#define NC_DLI "dli"
|
||||
#define NC_LAT "lat"
|
||||
#define NC_HYLINK "hylink"
|
||||
#define NC_APPLETALK "appletalk"
|
||||
#define NC_NIT "nit"
|
||||
#define NC_IEEE802 "ieee802"
|
||||
#define NC_OSI "osi"
|
||||
#define NC_X25 "x25"
|
||||
#define NC_OSINET "osinet"
|
||||
#define NC_GOSIP "gosip"
|
||||
|
||||
/*
|
||||
* nc_proto values
|
||||
*/
|
||||
#define NC_NOPROTO "-"
|
||||
#define NC_TCP "tcp"
|
||||
#define NC_UDP "udp"
|
||||
#define NC_ICMP "icmp"
|
||||
|
||||
__BEGIN_DECLS
|
||||
void *setnetconfig(void);
|
||||
struct netconfig *getnetconfig(void *);
|
||||
struct netconfig *getnetconfigent(const char *);
|
||||
void freenetconfigent(struct netconfig *);
|
||||
int endnetconfig(void *);
|
||||
|
||||
void *setnetpath(void);
|
||||
struct netconfig *getnetpath(void *);
|
||||
int endnetpath(void *);
|
||||
|
||||
void nc_perror(const char *);
|
||||
char *nc_sperror(void);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _NETCONFIG_H_ */
|
||||
363
include/netdb.h
363
include/netdb.h
|
|
@ -1,363 +0,0 @@
|
|||
/* $NetBSD: netdb.h,v 1.69 2013/08/19 07:18:42 christos Exp $ */
|
||||
|
||||
/*
|
||||
* ++Copyright++ 1980, 1983, 1988, 1993
|
||||
* -
|
||||
* Copyright (c) 1980, 1983, 1988, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
* -
|
||||
* Portions Copyright (c) 1993 by Digital Equipment Corporation.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies, and that
|
||||
* the name of Digital Equipment Corporation not be used in advertising or
|
||||
* publicity pertaining to distribution of the document or software without
|
||||
* specific, written prior permission.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
|
||||
* CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
||||
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
* SOFTWARE.
|
||||
* -
|
||||
* Portions Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by WIDE Project and
|
||||
* its contributors.
|
||||
* 4. Neither the name of the project nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
* -
|
||||
* --Copyright--
|
||||
*/
|
||||
|
||||
/*
|
||||
* @(#)netdb.h 8.1 (Berkeley) 6/2/93
|
||||
* Id: netdb.h,v 1.22 2008/02/28 05:34:17 marka Exp
|
||||
*/
|
||||
|
||||
#ifndef _NETDB_H_
|
||||
#define _NETDB_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <machine/endian_machdep.h>
|
||||
#include <sys/ansi.h>
|
||||
#include <sys/featuretest.h>
|
||||
#include <inttypes.h>
|
||||
/*
|
||||
* Data types
|
||||
*/
|
||||
#ifndef socklen_t
|
||||
typedef __socklen_t socklen_t;
|
||||
#define socklen_t __socklen_t
|
||||
#endif
|
||||
|
||||
#ifdef _BSD_SIZE_T_
|
||||
typedef _BSD_SIZE_T_ size_t;
|
||||
#undef _BSD_SIZE_T_
|
||||
#endif
|
||||
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
#ifndef _PATH_HEQUIV
|
||||
#define _PATH_HEQUIV "/etc/hosts.equiv"
|
||||
#endif
|
||||
#ifndef _PATH_HOSTS
|
||||
#define _PATH_HOSTS "/etc/hosts"
|
||||
#endif
|
||||
#ifndef _PATH_NETWORKS
|
||||
#define _PATH_NETWORKS "/etc/networks"
|
||||
#endif
|
||||
#ifndef _PATH_PROTOCOLS
|
||||
#define _PATH_PROTOCOLS "/etc/protocols"
|
||||
#endif
|
||||
#ifndef _PATH_SERVICES
|
||||
#define _PATH_SERVICES "/etc/services"
|
||||
#endif
|
||||
#ifndef _PATH_SERVICES_CDB
|
||||
#define _PATH_SERVICES_CDB "/var/db/services.cdb"
|
||||
#endif
|
||||
#ifndef _PATH_SERVICES_DB
|
||||
#define _PATH_SERVICES_DB "/var/db/services.db"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
extern int h_errno;
|
||||
extern int * __h_errno(void);
|
||||
#ifdef _REENTRANT
|
||||
#define h_errno (*__h_errno())
|
||||
#endif
|
||||
__END_DECLS
|
||||
|
||||
/*%
|
||||
* Structures returned by network data base library. All addresses are
|
||||
* supplied in host order, and returned in network order (suitable for
|
||||
* use in system calls).
|
||||
*/
|
||||
struct hostent {
|
||||
char *h_name; /*%< official name of host */
|
||||
char **h_aliases; /*%< alias list */
|
||||
int h_addrtype; /*%< host address type */
|
||||
int h_length; /*%< length of address */
|
||||
char **h_addr_list; /*%< list of addresses from name server */
|
||||
#define h_addr h_addr_list[0] /*%< address, for backward compatiblity */
|
||||
};
|
||||
|
||||
/*%
|
||||
* Assumption here is that a network number
|
||||
* fits in an unsigned long -- probably a poor one.
|
||||
*/
|
||||
struct netent {
|
||||
char *n_name; /*%< official name of net */
|
||||
char **n_aliases; /*%< alias list */
|
||||
int n_addrtype; /*%< net address type */
|
||||
#if (defined(__sparc__) && defined(_LP64)) || \
|
||||
(defined(__sh__) && defined(_LP64) && (_BYTE_ORDER == _BIG_ENDIAN))
|
||||
int __n_pad0; /* ABI compatibility */
|
||||
#endif
|
||||
uint32_t n_net; /*%< network # */
|
||||
#if defined(__alpha__) || (defined(__i386__) && defined(_LP64)) || \
|
||||
(defined(__sh__) && defined(_LP64) && (_BYTE_ORDER == _LITTLE_ENDIAN))
|
||||
int __n_pad0; /* ABI compatibility */
|
||||
#endif
|
||||
};
|
||||
|
||||
struct servent {
|
||||
char *s_name; /*%< official service name */
|
||||
char **s_aliases; /*%< alias list */
|
||||
int s_port; /*%< port # */
|
||||
char *s_proto; /*%< protocol to use */
|
||||
};
|
||||
|
||||
struct protoent {
|
||||
char *p_name; /*%< official protocol name */
|
||||
char **p_aliases; /*%< alias list */
|
||||
int p_proto; /*%< protocol # */
|
||||
};
|
||||
|
||||
/*
|
||||
* Note: ai_addrlen used to be a size_t, per RFC 2553.
|
||||
* In XNS5.2, and subsequently in POSIX-2001 and
|
||||
* draft-ietf-ipngwg-rfc2553bis-02.txt it was changed to a socklen_t.
|
||||
* To accommodate for this while preserving binary compatibility with the
|
||||
* old interface, we prepend or append 32 bits of padding, depending on
|
||||
* the (LP64) architecture's endianness.
|
||||
*
|
||||
* This should be deleted the next time the libc major number is
|
||||
* incremented.
|
||||
*/
|
||||
#if (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 520 || \
|
||||
defined(_NETBSD_SOURCE)
|
||||
struct addrinfo {
|
||||
int ai_flags; /*%< AI_PASSIVE, AI_CANONNAME */
|
||||
int ai_family; /*%< PF_xxx */
|
||||
int ai_socktype; /*%< SOCK_xxx */
|
||||
int ai_protocol; /*%< 0 or IPPROTO_xxx for IPv4 and IPv6 */
|
||||
#if defined(__sparc__) && defined(_LP64)
|
||||
int __ai_pad0; /* ABI compatibility */
|
||||
#endif
|
||||
socklen_t ai_addrlen; /*%< length of ai_addr */
|
||||
#if defined(__alpha__) || (defined(__i386__) && defined(_LP64))
|
||||
int __ai_pad0; /* ABI compatibility */
|
||||
#endif
|
||||
char *ai_canonname; /*%< canonical name for hostname */
|
||||
struct sockaddr *ai_addr; /*%< binary address */
|
||||
struct addrinfo *ai_next; /*%< next structure in linked list */
|
||||
};
|
||||
#endif
|
||||
|
||||
/*%
|
||||
* Error return codes from gethostbyname() and gethostbyaddr()
|
||||
* (left in extern int h_errno).
|
||||
*/
|
||||
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
#define NETDB_INTERNAL -1 /*%< see errno */
|
||||
#define NETDB_SUCCESS 0 /*%< no problem */
|
||||
#endif
|
||||
#define NO_ADDRESS NO_DATA /* no address, look for MX record */
|
||||
#define HOST_NOT_FOUND 1 /*%< Authoritative Answer Host not found */
|
||||
#define TRY_AGAIN 2 /*%< Non-Authoritive Host not found, or SERVERFAIL */
|
||||
#define NO_RECOVERY 3 /*%< Non recoverable errors, FORMERR, REFUSED, NOTIMP */
|
||||
#define NO_DATA 4 /*%< Valid name, no data record of requested type */
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
#define NO_ADDRESS NO_DATA /*%< no address, look for MX record */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Error return codes from getaddrinfo()
|
||||
*/
|
||||
#if (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 520 || \
|
||||
defined(_NETBSD_SOURCE)
|
||||
#define EAI_ADDRFAMILY 1 /*%< address family for hostname not supported */
|
||||
#define EAI_AGAIN 2 /*%< temporary failure in name resolution */
|
||||
#define EAI_BADFLAGS 3 /*%< invalid value for ai_flags */
|
||||
#define EAI_FAIL 4 /*%< non-recoverable failure in name resolution */
|
||||
#define EAI_FAMILY 5 /*%< ai_family not supported */
|
||||
#define EAI_MEMORY 6 /*%< memory allocation failure */
|
||||
#define EAI_NODATA 7 /*%< no address associated with hostname */
|
||||
#define EAI_NONAME 8 /*%< hostname nor servname provided, or not known */
|
||||
#define EAI_SERVICE 9 /*%< servname not supported for ai_socktype */
|
||||
#define EAI_SOCKTYPE 10 /*%< ai_socktype not supported */
|
||||
#define EAI_SYSTEM 11 /*%< system error returned in errno */
|
||||
#define EAI_BADHINTS 12 /* invalid value for hints */
|
||||
#define EAI_PROTOCOL 13 /* resolved protocol is unknown */
|
||||
#define EAI_OVERFLOW 14 /* argument buffer overflow */
|
||||
#define EAI_MAX 15
|
||||
#endif /* _POSIX_C_SOURCE >= 200112 || _XOPEN_SOURCE >= 520 || _NETBSD_SOURCE */
|
||||
|
||||
/*%
|
||||
* Flag values for getaddrinfo()
|
||||
*/
|
||||
#if (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 520 || \
|
||||
defined(_NETBSD_SOURCE)
|
||||
#define AI_PASSIVE 0x00000001 /* get address to use bind() */
|
||||
#define AI_CANONNAME 0x00000002 /* fill ai_canonname */
|
||||
#define AI_NUMERICHOST 0x00000004 /* prevent host name resolution */
|
||||
#define AI_NUMERICSERV 0x00000008 /* prevent service name resolution */
|
||||
#define AI_ADDRCONFIG 0x00000400 /* only if any address is assigned */
|
||||
/* valid flags for addrinfo (not a standard def, apps should not use it) */
|
||||
#ifdef _NETBSD_SOURCE
|
||||
#define AI_SRV 0x00000800 /* do _srv lookups */
|
||||
#define AI_MASK \
|
||||
(AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | \
|
||||
AI_ADDRCONFIG | AI_SRV)
|
||||
#else
|
||||
#define AI_MASK \
|
||||
(AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | \
|
||||
AI_ADDRCONFIG)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 520 || \
|
||||
defined(_NETBSD_SOURCE)
|
||||
/*%
|
||||
* Constants for getnameinfo()
|
||||
*/
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
#define NI_MAXHOST 1025
|
||||
#define NI_MAXSERV 32
|
||||
#endif
|
||||
|
||||
/*%
|
||||
* Flag values for getnameinfo()
|
||||
*/
|
||||
#define NI_NOFQDN 0x00000001
|
||||
#define NI_NUMERICHOST 0x00000002
|
||||
#define NI_NAMEREQD 0x00000004
|
||||
#define NI_NUMERICSERV 0x00000008
|
||||
#define NI_DGRAM 0x00000010
|
||||
#define NI_WITHSCOPEID 0x00000020
|
||||
#define NI_NUMERICSCOPE 0x00000040
|
||||
|
||||
/*%
|
||||
* Scope delimit character
|
||||
*/
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
#define SCOPE_DELIMITER '%'
|
||||
#endif
|
||||
#endif /* (_POSIX_C_SOURCE - 0) >= 200112L || ... */
|
||||
|
||||
__BEGIN_DECLS
|
||||
void endhostent(void);
|
||||
void endnetent(void);
|
||||
void endprotoent(void);
|
||||
void endservent(void);
|
||||
#if (_XOPEN_SOURCE - 0) >= 520 && (_XOPEN_SOURCE - 0) < 600 || \
|
||||
defined(_NETBSD_SOURCE)
|
||||
#if 0 /* we do not ship this */
|
||||
void freehostent(struct hostent *);
|
||||
#endif
|
||||
#endif
|
||||
struct hostent *gethostbyaddr(const void *, socklen_t, int);
|
||||
struct hostent *gethostbyname(const char *);
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
struct hostent *gethostbyname2(const char *, int);
|
||||
#endif
|
||||
struct hostent *gethostent(void);
|
||||
struct netent *getnetbyaddr(uint32_t, int);
|
||||
struct netent *getnetbyname(const char *);
|
||||
struct netent *getnetent(void);
|
||||
struct protoent *getprotobyname(const char *);
|
||||
struct protoent *getprotobynumber(int);
|
||||
struct protoent *getprotoent(void);
|
||||
struct servent *getservbyname(const char *, const char *);
|
||||
struct servent *getservbyport(int, const char *);
|
||||
struct servent *getservent(void);
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
void herror(const char *);
|
||||
const char *hstrerror(int);
|
||||
#endif
|
||||
void sethostent(int);
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
/* void sethostfile(const char *); */
|
||||
#endif
|
||||
void setnetent(int);
|
||||
void setprotoent(int);
|
||||
void setservent(int);
|
||||
#if (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 520 || \
|
||||
defined(_NETBSD_SOURCE)
|
||||
int getaddrinfo(const char * __restrict, const char * __restrict,
|
||||
const struct addrinfo * __restrict,
|
||||
struct addrinfo ** __restrict);
|
||||
int getnameinfo(const struct sockaddr * __restrict, socklen_t,
|
||||
char * __restrict, socklen_t,
|
||||
char * __restrict, socklen_t, int);
|
||||
struct addrinfo *allocaddrinfo(socklen_t);
|
||||
void freeaddrinfo(struct addrinfo *);
|
||||
const char *gai_strerror(int);
|
||||
#endif
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_NETDB_H_ */
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
/* $NetBSD: netgroup.h,v 1.10 2009/10/21 01:07:45 snj Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Christos Zoulas
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
|
||||
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _NETGROUP_H_
|
||||
#define _NETGROUP_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#define _PATH_NETGROUP "/etc/netgroup"
|
||||
|
||||
#define _PATH_NETGROUP_DB "/var/db/netgroup.db"
|
||||
|
||||
#define _PATH_NETGROUP_MKDB "/usr/sbin/netgroup_mkdb"
|
||||
|
||||
#define _NG_KEYBYNAME '1' /* stored by name */
|
||||
#define _NG_KEYBYUSER '2' /* stored by user */
|
||||
#define _NG_KEYBYHOST '3' /* stored by host */
|
||||
|
||||
#define _NG_ERROR -1
|
||||
#define _NG_NONE 0
|
||||
#define _NG_NAME 1
|
||||
#define _NG_GROUP 2
|
||||
|
||||
struct netgroup {
|
||||
__aconst char *ng_host; /* host name */
|
||||
__aconst char *ng_user; /* user name */
|
||||
__aconst char *ng_domain; /* domain name */
|
||||
struct netgroup *ng_next; /* thread */
|
||||
};
|
||||
|
||||
__BEGIN_DECLS
|
||||
void setnetgrent (const char *);
|
||||
int getnetgrent (const char **, const char **, const char **);
|
||||
void endnetgrent (void);
|
||||
int innetgr (const char *, const char *, const char *,
|
||||
const char *);
|
||||
#ifdef _NETGROUP_PRIVATE
|
||||
char *_ng_makekey(const char *, const char *, size_t);
|
||||
int _ng_parse(char **, char **, struct netgroup **);
|
||||
void _ng_print(char *, size_t, const struct netgroup *);
|
||||
void _ng_cycle(const char *, const StringList *);
|
||||
#endif /* _NETGROUP_PRIVATE */
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_NETGROUP_H_ */
|
||||
|
|
@ -1,100 +0,0 @@
|
|||
/* $NetBSD: nl_types.h,v 1.13 2013/08/19 08:03:33 joerg Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by J.T. Conklin.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _NL_TYPES_H_
|
||||
#define _NL_TYPES_H_
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#ifdef _NLS_PRIVATE
|
||||
/*
|
||||
* MESSAGE CATALOG FILE FORMAT.
|
||||
*
|
||||
* The NetBSD message catalog format is similar to the format used by
|
||||
* Svr4 systems. The differences are:
|
||||
* * fixed byte order (big endian)
|
||||
* * fixed data field sizes
|
||||
*
|
||||
* A message catalog contains four data types: a catalog header, one
|
||||
* or more set headers, one or more message headers, and one or more
|
||||
* text strings.
|
||||
*/
|
||||
|
||||
#define _NLS_MAGIC 0xff88ff89
|
||||
|
||||
struct _nls_cat_hdr {
|
||||
int32_t __magic;
|
||||
int32_t __nsets;
|
||||
int32_t __mem;
|
||||
int32_t __msg_hdr_offset;
|
||||
int32_t __msg_txt_offset;
|
||||
} ;
|
||||
|
||||
struct _nls_set_hdr {
|
||||
int32_t __setno; /* set number: 0 < x <= NL_SETMAX */
|
||||
int32_t __nmsgs; /* number of messages in the set */
|
||||
int32_t __index; /* index of first msg_hdr in msg_hdr table */
|
||||
} ;
|
||||
|
||||
struct _nls_msg_hdr {
|
||||
int32_t __msgno; /* msg number: 0 < x <= NL_MSGMAX */
|
||||
int32_t __msglen;
|
||||
int32_t __offset;
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
||||
#define NL_SETD 1
|
||||
#define NL_CAT_LOCALE 1
|
||||
|
||||
typedef struct __nl_cat_d {
|
||||
void *__data;
|
||||
int __size;
|
||||
} *nl_catd;
|
||||
|
||||
typedef long nl_item;
|
||||
|
||||
__BEGIN_DECLS
|
||||
nl_catd catopen(const char *, int);
|
||||
char *catgets(nl_catd, int, int, const char *) __format_arg(4);
|
||||
int catclose(nl_catd);
|
||||
__END_DECLS
|
||||
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
# ifndef __LOCALE_T_DECLARED
|
||||
typedef struct _locale *locale_t;
|
||||
# define __LOCALE_T_DECLARED
|
||||
# endif
|
||||
__BEGIN_DECLS
|
||||
nl_catd catopen_l(const char *, int, locale_t);
|
||||
__END_DECLS
|
||||
#endif
|
||||
|
||||
#endif /* _NL_TYPES_H_ */
|
||||
|
|
@ -1,94 +0,0 @@
|
|||
/* $NetBSD: nlist.h,v 1.14 2009/08/21 08:42:02 he Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1991, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
* (c) UNIX System Laboratories, Inc.
|
||||
* All or some portions of this file are derived from material licensed
|
||||
* to the University of California by American Telephone and Telegraph
|
||||
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
|
||||
* the permission of UNIX System Laboratories, Inc.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nlist.h 8.2 (Berkeley) 1/21/94
|
||||
*/
|
||||
|
||||
#ifndef _NLIST_H_
|
||||
#define _NLIST_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
/*
|
||||
* Symbol table entry format. The #ifdef's are so that programs including
|
||||
* nlist.h can initialize nlist structures statically.
|
||||
*/
|
||||
struct nlist {
|
||||
#ifdef _AOUT_INCLUDE_
|
||||
union {
|
||||
__aconst char *n_name; /* symbol name (in memory) */
|
||||
long n_strx; /* file string table offset (on disk) */
|
||||
} n_un;
|
||||
# define N_NAME(nlp) ((nlp)->n_un.n_name)
|
||||
#else
|
||||
const char *n_name; /* symbol name (in memory) */
|
||||
# define N_NAME(nlp) ((nlp)->n_name)
|
||||
#endif
|
||||
|
||||
#define N_UNDF 0x00 /* undefined */
|
||||
#define N_ABS 0x02 /* absolute address */
|
||||
#define N_TEXT 0x04 /* text segment */
|
||||
#define N_DATA 0x06 /* data segment */
|
||||
#define N_BSS 0x08 /* bss segment */
|
||||
#define N_INDR 0x0a /* alias definition */
|
||||
#define N_SIZE 0x0c /* pseudo type, defines a symbol's size */
|
||||
#define N_COMM 0x12 /* common reference */
|
||||
#define N_SETA 0x14 /* absolute set element symbol */
|
||||
#define N_SETT 0x16 /* text set element symbol */
|
||||
#define N_SETD 0x18 /* data set element symbol */
|
||||
#define N_SETB 0x1a /* bss set element symbol */
|
||||
#define N_SETV 0x1c /* set vector symbol */
|
||||
#define N_FN 0x1e /* file name (N_EXT on) */
|
||||
#define N_WARN 0x1e /* warning message (N_EXT off) */
|
||||
|
||||
#define N_EXT 0x01 /* external (global) bit, OR'ed in */
|
||||
#define N_TYPE 0x1e /* mask for all the type bits */
|
||||
unsigned char n_type; /* type defines */
|
||||
|
||||
char n_other; /* spare */
|
||||
#define n_hash n_desc /* used internally by ld(1); XXX */
|
||||
short n_desc; /* used by stab entries */
|
||||
unsigned long n_value; /* address/value of the symbol */
|
||||
};
|
||||
|
||||
#define N_FORMAT "%08x" /* namelist value format; XXX */
|
||||
#define N_STAB 0x0e0 /* mask for debugger symbols -- stab(5) */
|
||||
|
||||
__BEGIN_DECLS
|
||||
int nlist(const char *, struct nlist *);
|
||||
int __fdnlist(int, struct nlist *); /* XXX for libkvm */
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_NLIST_H_ */
|
||||
|
|
@ -1,230 +0,0 @@
|
|||
/* $NetBSD: nsswitch.h,v 1.21 2011/07/17 20:54:34 joerg Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997, 1998, 1999, 2004 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Luke Mewburn.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _NSSWITCH_H
|
||||
#define _NSSWITCH_H 1
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#define NSS_MODULE_INTERFACE_VERSION 0
|
||||
|
||||
#ifndef _PATH_NS_CONF
|
||||
#define _PATH_NS_CONF "/etc/nsswitch.conf"
|
||||
#endif
|
||||
|
||||
#define NS_CONTINUE 0
|
||||
#define NS_RETURN 1
|
||||
|
||||
/*
|
||||
* Layout of:
|
||||
* uint32_t ns_src.flags
|
||||
*/
|
||||
/* nsswitch.conf status codes and nsdispatch(3) return values */
|
||||
#define NS_SUCCESS (1<<0) /* entry was found */
|
||||
#define NS_UNAVAIL (1<<1) /* source not responding, or corrupt */
|
||||
#define NS_NOTFOUND (1<<2) /* source responded 'no such entry' */
|
||||
#define NS_TRYAGAIN (1<<3) /* source busy, may respond to retrys */
|
||||
#define NS_STATUSMASK 0x000000ff /* bitmask to get the status flags */
|
||||
|
||||
/* internal nsdispatch(3) flags; not settable in nsswitch.conf(5) */
|
||||
#define NS_FORCEALL (1<<8) /* force all methods to be invoked; */
|
||||
|
||||
/*
|
||||
* Currently implemented sources.
|
||||
*/
|
||||
#define NSSRC_FILES "files" /* local files */
|
||||
#define NSSRC_DNS "dns" /* DNS; IN for hosts, HS for others */
|
||||
#define NSSRC_NIS "nis" /* YP/NIS */
|
||||
#define NSSRC_COMPAT "compat" /* passwd,group in YP compat mode */
|
||||
|
||||
/*
|
||||
* Currently implemented databases.
|
||||
*/
|
||||
#define NSDB_HOSTS "hosts"
|
||||
#define NSDB_GROUP "group"
|
||||
#define NSDB_GROUP_COMPAT "group_compat"
|
||||
#define NSDB_NETGROUP "netgroup"
|
||||
#define NSDB_NETWORKS "networks"
|
||||
#define NSDB_PASSWD "passwd"
|
||||
#define NSDB_PASSWD_COMPAT "passwd_compat"
|
||||
#define NSDB_SHELLS "shells"
|
||||
|
||||
/*
|
||||
* Suggested databases to implement.
|
||||
*/
|
||||
#define NSDB_ALIASES "aliases"
|
||||
#define NSDB_AUTH "auth"
|
||||
#define NSDB_AUTOMOUNT "automount"
|
||||
#define NSDB_BOOTPARAMS "bootparams"
|
||||
#define NSDB_ETHERS "ethers"
|
||||
#define NSDB_EXPORTS "exports"
|
||||
#define NSDB_NETMASKS "netmasks"
|
||||
#define NSDB_PHONES "phones"
|
||||
#define NSDB_PRINTCAP "printcap"
|
||||
#define NSDB_PROTOCOLS "protocols"
|
||||
#define NSDB_REMOTE "remote"
|
||||
#define NSDB_RPC "rpc"
|
||||
#define NSDB_SENDMAILVARS "sendmailvars"
|
||||
#define NSDB_SERVICES "services"
|
||||
#define NSDB_TERMCAP "termcap"
|
||||
#define NSDB_TTYS "ttys"
|
||||
|
||||
/*
|
||||
* ns_dtab `callback' function signature.
|
||||
*/
|
||||
typedef int (*nss_method)(void *, void *, va_list);
|
||||
|
||||
/*
|
||||
* ns_dtab - `nsswitch dispatch table'
|
||||
* Contains an entry for each source and the appropriate function to call.
|
||||
*/
|
||||
typedef struct {
|
||||
const char *src;
|
||||
nss_method callback;
|
||||
void *cb_data;
|
||||
} ns_dtab;
|
||||
|
||||
/*
|
||||
* Macros to help build an ns_dtab[]
|
||||
*/
|
||||
#define NS_FILES_CB(F,C) { NSSRC_FILES, F, __UNCONST(C) },
|
||||
#define NS_COMPAT_CB(F,C) { NSSRC_COMPAT, F, __UNCONST(C) },
|
||||
|
||||
#ifdef HESIOD
|
||||
# define NS_DNS_CB(F,C) { NSSRC_DNS, F, __UNCONST(C) },
|
||||
#else
|
||||
# define NS_DNS_CB(F,C)
|
||||
#endif
|
||||
|
||||
#ifdef YP
|
||||
# define NS_NIS_CB(F,C) { NSSRC_NIS, F, __UNCONST(C) },
|
||||
#else
|
||||
# define NS_NIS_CB(F,C)
|
||||
#endif
|
||||
#define NS_NULL_CB { .src = NULL },
|
||||
|
||||
/*
|
||||
* ns_src - `nsswitch source'
|
||||
* Used by the nsparser routines to store a mapping between a source
|
||||
* and its dispatch control flags for a given database.
|
||||
*/
|
||||
typedef struct {
|
||||
const char *name;
|
||||
uint32_t flags;
|
||||
} ns_src;
|
||||
|
||||
|
||||
/*
|
||||
* Default sourcelists (if nsswitch.conf is missing, corrupt,
|
||||
* or the requested database doesn't have an entry)
|
||||
*/
|
||||
extern const ns_src __nsdefaultsrc[];
|
||||
extern const ns_src __nsdefaultcompat[];
|
||||
extern const ns_src __nsdefaultcompat_forceall[];
|
||||
extern const ns_src __nsdefaultfiles[];
|
||||
extern const ns_src __nsdefaultfiles_forceall[];
|
||||
extern const ns_src __nsdefaultnis[];
|
||||
extern const ns_src __nsdefaultnis_forceall[];
|
||||
|
||||
|
||||
/*
|
||||
* ns_mtab - `nsswitch method table'
|
||||
* An nsswitch module provides a mapping from (database name, method name)
|
||||
* tuples to the nss_method and associated callback data. Effectively,
|
||||
* ns_dtab, but used for dynamically loaded modules.
|
||||
*/
|
||||
typedef struct {
|
||||
const char *database;
|
||||
const char *name;
|
||||
nss_method method;
|
||||
void *mdata;
|
||||
} ns_mtab;
|
||||
|
||||
/*
|
||||
* nss_module_register_fn - module registration function
|
||||
* called at module load
|
||||
* nss_module_unregister_fn - module un-registration function
|
||||
* called at module unload
|
||||
*/
|
||||
typedef void (*nss_module_unregister_fn)(ns_mtab *, u_int);
|
||||
typedef ns_mtab *(*nss_module_register_fn)(const char *, u_int *,
|
||||
nss_module_unregister_fn *);
|
||||
|
||||
#ifdef _NS_PRIVATE
|
||||
|
||||
/*
|
||||
* Private data structures for back-end nsswitch implementation.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ns_dbt - `nsswitch database thang'
|
||||
* For each database in /etc/nsswitch.conf there is a ns_dbt, with its
|
||||
* name and a list of ns_src's containing the source information.
|
||||
*/
|
||||
typedef struct {
|
||||
const char *name; /* name of database */
|
||||
ns_src *srclist; /* list of sources */
|
||||
u_int srclistsize; /* size of srclist */
|
||||
} ns_dbt;
|
||||
|
||||
/*
|
||||
* ns_mod - `nsswitch module'
|
||||
*/
|
||||
typedef struct {
|
||||
const char *name; /* module name */
|
||||
void *handle; /* handle from dlopen() */
|
||||
ns_mtab *mtab; /* method table */
|
||||
u_int mtabsize; /* size of mtab */
|
||||
/* called to unload module */
|
||||
nss_module_unregister_fn unregister;
|
||||
} ns_mod;
|
||||
|
||||
#endif /* _NS_PRIVATE */
|
||||
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
int nsdispatch(void *, const ns_dtab [], const char *,
|
||||
const char *, const ns_src [], ...);
|
||||
|
||||
#ifdef _NS_PRIVATE
|
||||
int _nsdbtaddsrc(ns_dbt *, const ns_src *);
|
||||
void _nsdbtdump(const ns_dbt *);
|
||||
int _nsdbtput(const ns_dbt *);
|
||||
void _nsyyerror(const char *);
|
||||
int _nsyylex(void);
|
||||
#endif /* _NS_PRIVATE */
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_NSSWITCH_H */
|
||||
|
|
@ -1,159 +0,0 @@
|
|||
/* $NetBSD: dumprestore.h,v 1.16 2009/01/11 03:04:12 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
* (c) UNIX System Laboratories, Inc.
|
||||
* All or some portions of this file are derived from material licensed
|
||||
* to the University of California by American Telephone and Telegraph
|
||||
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
|
||||
* the permission of UNIX System Laboratories, Inc.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)dumprestore.h 8.2 (Berkeley) 1/21/94
|
||||
*/
|
||||
|
||||
#ifndef _PROTOCOLS_DUMPRESTORE_H_
|
||||
#define _PROTOCOLS_DUMPRESTORE_H_
|
||||
|
||||
/*
|
||||
* TP_BSIZE is the size of file blocks on the dump tapes.
|
||||
* Note that TP_BSIZE must be a multiple of DEV_BSIZE.
|
||||
*
|
||||
* NTREC is the number of TP_BSIZE blocks that are written
|
||||
* in each tape record. HIGHDENSITYTREC is the number of
|
||||
* TP_BSIZE blocks that are written in each tape record on
|
||||
* 6250 BPI or higher density tapes.
|
||||
*
|
||||
* TP_NINDIR is the number of indirect pointers in a TS_INODE
|
||||
* or TS_ADDR record. Note that it must be a power of two.
|
||||
*/
|
||||
#define TP_BSIZE 1024
|
||||
#define NTREC 10
|
||||
#define HIGHDENSITYTREC 32
|
||||
#define TP_NINDIR (TP_BSIZE/2)
|
||||
#define LBLSIZE 16
|
||||
#define NAMELEN 64
|
||||
|
||||
#define OFS_MAGIC (int)60011
|
||||
#define NFS_MAGIC (int)60012
|
||||
#ifndef FS_UFS2_MAGIC
|
||||
#define FS_UFS2_MAGIC (int)0x19540119
|
||||
#endif
|
||||
#define CHECKSUM (int)84446
|
||||
|
||||
union u_spcl {
|
||||
char dummy[TP_BSIZE];
|
||||
struct s_spcl {
|
||||
int32_t c_type; /* record type (see below) */
|
||||
int32_t c_old_date; /* date of this dump */
|
||||
int32_t c_old_ddate; /* date of previous dump */
|
||||
int32_t c_volume; /* dump volume number */
|
||||
int32_t c_old_tapea; /* logical block of this record */
|
||||
uint32_t c_inumber; /* number of inode */
|
||||
int32_t c_magic; /* magic number (see above) */
|
||||
int32_t c_checksum; /* record checksum */
|
||||
union {
|
||||
struct ufs1_dinode __uc_dinode;
|
||||
struct {
|
||||
uint16_t __uc_mode;
|
||||
int16_t __uc_spare1[3];
|
||||
uint64_t __uc_size;
|
||||
int32_t __uc_old_atime;
|
||||
int32_t __uc_atimensec;
|
||||
int32_t __uc_old_mtime;
|
||||
int32_t __uc_mtimensec;
|
||||
int32_t __uc_spare2[2];
|
||||
int32_t __uc_rdev;
|
||||
int32_t __uc_birthtimensec;
|
||||
int64_t __uc_birthtime;
|
||||
int64_t __uc_atime;
|
||||
int64_t __uc_mtime;
|
||||
int32_t __uc_spare4[7];
|
||||
uint32_t __uc_file_flags;
|
||||
int32_t __uc_spare5[2];
|
||||
uint32_t __uc_uid;
|
||||
uint32_t __uc_gid;
|
||||
int32_t __uc_spare6[2];
|
||||
} __uc_ino;
|
||||
} __c_ino;
|
||||
int32_t c_count; /* number of valid c_addr entries */
|
||||
char c_addr[TP_NINDIR]; /* 1 => data; 0 => hole in inode */
|
||||
char c_label[LBLSIZE]; /* dump label */
|
||||
int32_t c_level; /* level of this dump */
|
||||
char c_filesys[NAMELEN]; /* name of dumpped file system */
|
||||
char c_dev[NAMELEN]; /* name of dumpped device */
|
||||
char c_host[NAMELEN]; /* name of dumpped host */
|
||||
int32_t c_flags; /* additional information */
|
||||
int32_t c_old_firstrec; /* first record on volume */
|
||||
int64_t c_date; /* date of this dump */
|
||||
int64_t c_ddate; /* date of previous dump */
|
||||
int64_t c_tapea; /* logical block of this record */
|
||||
int64_t c_firstrec; /* first record on volume */
|
||||
int32_t c_spare[24]; /* reserved for future uses */
|
||||
} s_spcl;
|
||||
} u_spcl;
|
||||
#define spcl u_spcl.s_spcl
|
||||
|
||||
#define c_dinode __c_ino.__uc_dinode
|
||||
#define c_mode __c_ino.__uc_ino.__uc_mode
|
||||
#define c_spare1 __c_ino.__uc_ino.__uc_spare1
|
||||
#define c_size __c_ino.__uc_ino.__uc_size
|
||||
#define c_old_atime __c_ino.__uc_ino.__uc_old_atime
|
||||
#define c_atime __c_ino.__uc_ino.__uc_atime
|
||||
#define c_atimensec __c_ino.__uc_ino.__uc_atimensec
|
||||
#define c_mtime __c_ino.__uc_ino.__uc_mtime
|
||||
#define c_mtimensec __c_ino.__uc_ino.__uc_mtimensec
|
||||
#define c_birthtime __c_ino.__uc_ino.__uc_birthtime
|
||||
#define c_birthtimensec __c_ino.__uc_ino.__uc_birthtimensec
|
||||
#define c_old_mtime __c_ino.__uc_ino.__uc_old_mtime
|
||||
#define c_rdev __c_ino.__uc_ino.__uc_rdev
|
||||
#define c_file_flags __c_ino.__uc_ino.__uc_file_flags
|
||||
#define c_uid __c_ino.__uc_ino.__uc_uid
|
||||
#define c_gid __c_ino.__uc_ino.__uc_gid
|
||||
|
||||
/*
|
||||
* special record types
|
||||
*/
|
||||
#define TS_TAPE 1 /* dump tape header */
|
||||
#define TS_INODE 2 /* beginning of file record */
|
||||
#define TS_ADDR 4 /* continuation of file record */
|
||||
#define TS_BITS 3 /* map of inodes on tape */
|
||||
#define TS_CLRI 6 /* map of inodes deleted since last dump */
|
||||
#define TS_END 5 /* end of volume marker */
|
||||
|
||||
/*
|
||||
* flag values
|
||||
*/
|
||||
#define DR_NEWHEADER 0x0001 /* new format tape header */
|
||||
#define DR_NEWINODEFMT 0x0002 /* new format inodes on tape */
|
||||
#define DR_EXTATTRIBUTES 0x8000 /* linux: extended attributes */
|
||||
|
||||
#define DUMPOUTFMT "%-16s %c %s" /* for printf */
|
||||
/* name, level, ctime(date) */
|
||||
#define DUMPINFMT "%16s %c %[^\n]\n" /* inverse for scanf */
|
||||
|
||||
#endif /* !_PROTOCOLS_DUMPRESTORE_H_ */
|
||||
|
|
@ -1,175 +0,0 @@
|
|||
/* $NetBSD: routed.h,v 1.14 2005/12/26 19:01:47 perry Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1983, 1989, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)routed.h 8.1 (Berkeley) 6/2/93
|
||||
*/
|
||||
|
||||
#ifndef _PROTOCOLS_ROUTED_H_
|
||||
#define _PROTOCOLS_ROUTED_H_
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Routing Information Protocol
|
||||
*
|
||||
* Derived from Xerox NS Routing Information Protocol
|
||||
* by changing 32-bit net numbers to sockaddr's and
|
||||
* padding stuff to 32-bit boundaries.
|
||||
*/
|
||||
|
||||
#define RIP_VERSION_0 0
|
||||
#define RIP_VERSION_1 1
|
||||
#define RIP_VERSION_2 2
|
||||
|
||||
#define RIPv1 RIP_VERSION_1
|
||||
#define RIPv2 RIP_VERSION_2
|
||||
#ifndef RIPVERSION
|
||||
#define RIPVERSION RIPv1
|
||||
#endif
|
||||
|
||||
#define RIP_PORT 520
|
||||
|
||||
#if RIPVERSION == 1
|
||||
/* We include the V2 fields to get the right size */
|
||||
struct netinfo {
|
||||
uint16_t rip_family;
|
||||
uint16_t rip_tag;
|
||||
uint32_t rip_dst; /* destination net/host */
|
||||
uint32_t rip_dst_mask; /* destination mask (V2 only) */
|
||||
uint32_t rip_router; /* next host (V2 only) */
|
||||
uint32_t rip_metric; /* cost of route */
|
||||
};
|
||||
#else
|
||||
struct netinfo {
|
||||
uint16_t n_family;
|
||||
#define RIP_AF_INET htons(AF_INET)
|
||||
#define RIP_AF_UNSPEC 0
|
||||
#define RIP_AF_AUTH 0xffff
|
||||
uint16_t n_tag; /* optional in RIPv2 */
|
||||
uint32_t n_dst; /* destination net or host */
|
||||
#define RIP_DEFAULT 0
|
||||
uint32_t n_mask; /* netmask in RIPv2 */
|
||||
uint32_t n_nhop; /* optional next hop in RIPv2 */
|
||||
uint32_t n_metric; /* cost of route */
|
||||
};
|
||||
#endif
|
||||
|
||||
/* RIPv2 authentication */
|
||||
struct netauth {
|
||||
uint16_t a_family; /* always RIP_AF_AUTH */
|
||||
uint16_t a_type;
|
||||
#define RIP_AUTH_NONE 0
|
||||
#define RIP_AUTH_PW htons(2) /* password type */
|
||||
#define RIP_AUTH_MD5 htons(3) /* Keyed MD5 */
|
||||
union {
|
||||
#define RIP_AUTH_PW_LEN 16
|
||||
uint8_t au_pw[RIP_AUTH_PW_LEN];
|
||||
struct a_md5 {
|
||||
int16_t md5_pkt_len; /* RIP-II packet length */
|
||||
int8_t md5_keyid; /* key ID and auth data len */
|
||||
int8_t md5_auth_len; /* 16 */
|
||||
uint32_t md5_seqno; /* sequence number */
|
||||
uint32_t rsvd[2]; /* must be 0 */
|
||||
#define RIP_AUTH_MD5_KEY_LEN RIP_AUTH_PW_LEN
|
||||
#define RIP_AUTH_MD5_HASH_XTRA (sizeof(struct netauth)-sizeof(struct a_md5))
|
||||
#define RIP_AUTH_MD5_HASH_LEN (RIP_AUTH_MD5_KEY_LEN+RIP_AUTH_MD5_HASH_XTRA)
|
||||
} a_md5;
|
||||
} au;
|
||||
};
|
||||
|
||||
struct rip {
|
||||
uint8_t rip_cmd; /* request/response */
|
||||
uint8_t rip_vers; /* protocol version # */
|
||||
uint16_t rip_res1; /* pad to 32-bit boundary */
|
||||
union { /* variable length... */
|
||||
struct netinfo ru_nets[1];
|
||||
int8_t ru_tracefile[1];
|
||||
struct netauth ru_auth[1];
|
||||
} ripun;
|
||||
#define rip_nets ripun.ru_nets
|
||||
#define rip_auths ripun.ru_auth
|
||||
#define rip_tracefile ripun.ru_tracefile
|
||||
};
|
||||
|
||||
/* Packet types.
|
||||
*/
|
||||
#define RIPCMD_REQUEST 1 /* want info */
|
||||
#define RIPCMD_RESPONSE 2 /* responding to request */
|
||||
#define RIPCMD_TRACEON 3 /* turn tracing on */
|
||||
#define RIPCMD_TRACEOFF 4 /* turn it off */
|
||||
|
||||
/* Gated extended RIP to include a "poll" command instead of using
|
||||
* RIPCMD_REQUEST with (RIP_AF_UNSPEC, RIP_DEFAULT). RFC 1058 says
|
||||
* command 5 is used by Sun Microsystems for its own purposes.
|
||||
*/
|
||||
#define RIPCMD_POLL 5
|
||||
|
||||
#define RIPCMD_MAX 6
|
||||
|
||||
#ifdef RIPCMDS
|
||||
const char *ripcmds[RIPCMD_MAX] = {
|
||||
"#0", "REQUEST", "RESPONSE", "TRACEON", "TRACEOFF"
|
||||
};
|
||||
#endif
|
||||
|
||||
#define HOPCNT_INFINITY 16
|
||||
#define MAXPACKETSIZE 512 /* max broadcast size */
|
||||
#define NETS_LEN ((MAXPACKETSIZE-sizeof(struct rip)) \
|
||||
/ sizeof(struct netinfo) +1)
|
||||
|
||||
#define INADDR_RIP_GROUP (uint32_t)0xe0000009 /* 224.0.0.9 */
|
||||
|
||||
|
||||
/* Timer values used in managing the routing table.
|
||||
*
|
||||
* Complete tables are broadcast every SUPPLY_INTERVAL seconds.
|
||||
* If changes occur between updates, dynamic updates containing only changes
|
||||
* may be sent. When these are sent, a timer is set for a random value
|
||||
* between MIN_WAITTIME and MAX_WAITTIME, and no additional dynamic updates
|
||||
* are sent until the timer expires.
|
||||
*
|
||||
* Every update of a routing entry forces an entry's timer to be reset.
|
||||
* After EXPIRE_TIME without updates, the entry is marked invalid,
|
||||
* but held onto until GARBAGE_TIME so that others may see it, to
|
||||
* "poison" the bad route.
|
||||
*/
|
||||
#define SUPPLY_INTERVAL 30 /* time to supply tables */
|
||||
#define MIN_WAITTIME 2 /* min sec until next flash updates */
|
||||
#define MAX_WAITTIME 5 /* max sec until flash update */
|
||||
|
||||
#define STALE_TIME 90 /* switch to a new gateway */
|
||||
#define EXPIRE_TIME 180 /* time to mark entry invalid */
|
||||
#define GARBAGE_TIME 240 /* time to garbage collect */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* !_PROTOCOLS_ROUTED_H_ */
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
/* $NetBSD: rwhod.h,v 1.7 2003/08/07 09:44:13 agc Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)rwhod.h 8.1 (Berkeley) 6/2/93
|
||||
*/
|
||||
|
||||
#ifndef _PROTOCOLS_RWHOD_H_
|
||||
#define _PROTOCOLS_RWHOD_H_
|
||||
|
||||
/*
|
||||
* rwho protocol packet format.
|
||||
*/
|
||||
struct outmp {
|
||||
char out_line[8]; /* tty name */
|
||||
char out_name[8]; /* user id */
|
||||
int32_t out_time; /* time on */
|
||||
};
|
||||
|
||||
struct whod {
|
||||
char wd_vers; /* protocol version # */
|
||||
char wd_type; /* packet type, see below */
|
||||
char wd_pad[2];
|
||||
int32_t wd_sendtime; /* time stamp by sender */
|
||||
int32_t wd_recvtime; /* time stamp applied by receiver */
|
||||
char wd_hostname[32]; /* hosts's name */
|
||||
int32_t wd_loadav[3]; /* load average as in uptime */
|
||||
int32_t wd_boottime; /* time system booted */
|
||||
struct whoent {
|
||||
struct outmp we_utmp; /* active tty info */
|
||||
int32_t we_idle; /* tty idle time */
|
||||
} wd_we[1024 / sizeof (struct whoent)];
|
||||
};
|
||||
|
||||
#define WHODVERSION 1
|
||||
#define WHODTYPE_STATUS 1 /* host status */
|
||||
|
||||
#define _PATH_RWHODIR "/var/rwho"
|
||||
|
||||
#endif /* !_PROTOCOLS_RWHOD_H_ */
|
||||
|
|
@ -1,120 +0,0 @@
|
|||
/* $NetBSD: talkd.h,v 1.10 2005/12/26 19:01:47 perry Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)talkd.h 8.1 (Berkeley) 6/2/93
|
||||
*/
|
||||
|
||||
#ifndef _PROTOCOLS_TALKD_H_
|
||||
#define _PROTOCOLS_TALKD_H_
|
||||
|
||||
/*
|
||||
* This describes the protocol used by the talk server and clients.
|
||||
*
|
||||
* The talk server acts a repository of invitations, responding to
|
||||
* requests by clients wishing to rendezvous for the purpose of
|
||||
* holding a conversation. In normal operation, a client, the caller,
|
||||
* initiates a rendezvous by sending a CTL_MSG to the server of
|
||||
* type LOOK_UP. This causes the server to search its invitation
|
||||
* tables to check if an invitation currently exists for the caller
|
||||
* (to speak to the callee specified in the message). If the lookup
|
||||
* fails, the caller then sends an ANNOUNCE message causing the server
|
||||
* to broadcast an announcement on the callee's login ports requesting
|
||||
* contact. When the callee responds, the local server uses the
|
||||
* recorded invitation to respond with the appropriate rendezvous
|
||||
* address and the caller and callee client programs establish a
|
||||
* stream connection through which the conversation takes place.
|
||||
*/
|
||||
|
||||
/*
|
||||
* 4.3 compat sockaddr
|
||||
*/
|
||||
struct talkd_sockaddr {
|
||||
uint16_t sa_family; /* address family */
|
||||
char sa_data[14]; /* up to 14 bytes of direct address */
|
||||
};
|
||||
|
||||
/*
|
||||
* Client->server request message format.
|
||||
*/
|
||||
typedef struct {
|
||||
u_char vers; /* protocol version */
|
||||
u_char type; /* request type, see below */
|
||||
u_char answer; /* not used */
|
||||
u_char pad;
|
||||
uint32_t id_num; /* message id */
|
||||
struct talkd_sockaddr addr; /* old (4.3) style */
|
||||
struct talkd_sockaddr ctl_addr;/* old (4.3) style */
|
||||
int32_t pid; /* caller's process id */
|
||||
#define NAME_SIZE 12
|
||||
char l_name[NAME_SIZE]; /* caller's name */
|
||||
char r_name[NAME_SIZE]; /* callee's name */
|
||||
#define TTY_SIZE 16
|
||||
char r_tty[TTY_SIZE]; /* callee's tty name */
|
||||
} CTL_MSG;
|
||||
|
||||
/*
|
||||
* Server->client response message format.
|
||||
*/
|
||||
typedef struct {
|
||||
u_char vers; /* protocol version */
|
||||
u_char type; /* type of request message, see below */
|
||||
u_char answer; /* respose to request message, see below */
|
||||
u_char pad;
|
||||
uint32_t id_num; /* message id */
|
||||
struct talkd_sockaddr addr; /* address for establishing conversation */
|
||||
} CTL_RESPONSE;
|
||||
|
||||
#define TALK_VERSION 1 /* protocol version */
|
||||
|
||||
/* message type values */
|
||||
#define LEAVE_INVITE 0 /* leave invitation with server */
|
||||
#define LOOK_UP 1 /* check for invitation by callee */
|
||||
#define DELETE 2 /* delete invitation by caller */
|
||||
#define ANNOUNCE 3 /* announce invitation by caller */
|
||||
|
||||
/* answer values */
|
||||
#define SUCCESS 0 /* operation completed properly */
|
||||
#define NOT_HERE 1 /* callee not logged in */
|
||||
#define FAILED 2 /* operation failed for unexplained reason */
|
||||
#define MACHINE_UNKNOWN 3 /* caller's machine name unknown */
|
||||
#define PERMISSION_DENIED 4 /* callee's tty doesn't permit announce */
|
||||
#define UNKNOWN_REQUEST 5 /* request has invalid type value */
|
||||
#define BADVERSION 6 /* request has invalid protocol version */
|
||||
#define BADADDR 7 /* request has invalid addr value */
|
||||
#define BADCTLADDR 8 /* request has invalid ctl_addr value */
|
||||
|
||||
/*
|
||||
* Operational parameters.
|
||||
*/
|
||||
#define MAX_LIFE 60 /* max time daemon saves invitations */
|
||||
/* RING_WAIT should be 10's of seconds less than MAX_LIFE */
|
||||
#define RING_WAIT 30 /* time to wait before resending invitation */
|
||||
|
||||
#endif /* !_PROTOCOLS_TALKD_H_ */
|
||||
|
|
@ -1,100 +0,0 @@
|
|||
/* $NetBSD: timed.h,v 1.11 2008/02/16 07:30:15 matt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)timed.h 8.1 (Berkeley) 6/2/93
|
||||
*/
|
||||
|
||||
#ifndef _PROTOCOLS_TIMED_H_
|
||||
#define _PROTOCOLS_TIMED_H_
|
||||
|
||||
/*
|
||||
* Time Synchronization Protocol
|
||||
*/
|
||||
|
||||
#define TSPVERSION 1
|
||||
#define ANYADDR NULL
|
||||
|
||||
struct tsp {
|
||||
uint8_t tsp_type;
|
||||
uint8_t tsp_vers;
|
||||
uint16_t tsp_seq;
|
||||
union {
|
||||
struct {
|
||||
int32_t tv_sec;
|
||||
int32_t tv_usec;
|
||||
} tspu_time;
|
||||
char tspu_hopcnt;
|
||||
} tsp_u;
|
||||
char tsp_name[MAXHOSTNAMELEN];
|
||||
};
|
||||
|
||||
#define tsp_time tsp_u.tspu_time
|
||||
#define tsp_hopcnt tsp_u.tspu_hopcnt
|
||||
|
||||
/*
|
||||
* Command types.
|
||||
*/
|
||||
#define TSP_ANY 0 /* match any types */
|
||||
#define TSP_ADJTIME 1 /* send adjtime */
|
||||
#define TSP_ACK 2 /* generic acknowledgement */
|
||||
#define TSP_MASTERREQ 3 /* ask for master's name */
|
||||
#define TSP_MASTERACK 4 /* acknowledge master request */
|
||||
#define TSP_SETTIME 5 /* send network time */
|
||||
#define TSP_MASTERUP 6 /* inform slaves that master is up */
|
||||
#define TSP_SLAVEUP 7 /* slave is up but not polled */
|
||||
#define TSP_ELECTION 8 /* advance candidature for master */
|
||||
#define TSP_ACCEPT 9 /* support candidature of master */
|
||||
#define TSP_REFUSE 10 /* reject candidature of master */
|
||||
#define TSP_CONFLICT 11 /* two or more masters present */
|
||||
#define TSP_RESOLVE 12 /* masters' conflict resolution */
|
||||
#define TSP_QUIT 13 /* reject candidature if master is up */
|
||||
#define TSP_DATE 14 /* reset the time (date command) */
|
||||
#define TSP_DATEREQ 15 /* remote request to reset the time */
|
||||
#define TSP_DATEACK 16 /* acknowledge time setting */
|
||||
#define TSP_TRACEON 17 /* turn tracing on */
|
||||
#define TSP_TRACEOFF 18 /* turn tracing off */
|
||||
#define TSP_MSITE 19 /* find out master's site */
|
||||
#define TSP_MSITEREQ 20 /* remote master's site request */
|
||||
#define TSP_TEST 21 /* for testing election algo */
|
||||
#define TSP_SETDATE 22 /* New from date command */
|
||||
#define TSP_SETDATEREQ 23 /* New remote for above */
|
||||
#define TSP_LOOP 24 /* loop detection packet */
|
||||
|
||||
#define TSPTYPENUMBER 25
|
||||
|
||||
#ifdef TSPTYPES
|
||||
const char * const tsptype[TSPTYPENUMBER] =
|
||||
{ "ANY", "ADJTIME", "ACK", "MASTERREQ", "MASTERACK", "SETTIME", "MASTERUP",
|
||||
"SLAVEUP", "ELECTION", "ACCEPT", "REFUSE", "CONFLICT", "RESOLVE", "QUIT",
|
||||
"DATE", "DATEREQ", "DATEACK", "TRACEON", "TRACEOFF", "MSITE", "MSITEREQ",
|
||||
"TEST", "SETDATE", "SETDATEREQ", "LOOP" };
|
||||
#endif
|
||||
|
||||
#endif /* !_PROTOCOLS_TIMED_H_ */
|
||||
159
include/pwd.h
159
include/pwd.h
|
|
@ -1,159 +0,0 @@
|
|||
/* $NetBSD: pwd.h,v 1.44 2012/11/26 19:53:41 pooka Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1989, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
* (c) UNIX System Laboratories, Inc.
|
||||
* All or some portions of this file are derived from material licensed
|
||||
* to the University of California by American Telephone and Telegraph
|
||||
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
|
||||
* the permission of UNIX System Laboratories, Inc.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)pwd.h 8.2 (Berkeley) 1/21/94
|
||||
*/
|
||||
|
||||
/*-
|
||||
* Portions Copyright(C) 1995, Jason Downs. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS
|
||||
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _PWD_H_
|
||||
#define _PWD_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/featuretest.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#if defined(_NETBSD_SOURCE) || defined(HAVE_NBTOOL_CONFIG_H)
|
||||
#define _PATH_PASSWD "/etc/passwd"
|
||||
#define _PATH_MASTERPASSWD "/etc/master.passwd"
|
||||
#define _PATH_MASTERPASSWD_LOCK "/etc/ptmp"
|
||||
|
||||
#define _PATH_PASSWD_CONF "/etc/passwd.conf"
|
||||
#define _PATH_PASSWDCONF _PATH_PASSWD_CONF /* XXX: compat */
|
||||
#define _PATH_USERMGMT_CONF "/etc/usermgmt.conf"
|
||||
|
||||
#define _PATH_MP_DB "/etc/pwd.db"
|
||||
#define _PATH_SMP_DB "/etc/spwd.db"
|
||||
|
||||
#define _PATH_PWD_MKDB "/usr/sbin/pwd_mkdb"
|
||||
|
||||
#define _PW_KEYBYNAME '1' /* stored by name */
|
||||
#define _PW_KEYBYNUM '2' /* stored by entry in the "file" */
|
||||
#define _PW_KEYBYUID '3' /* stored by uid */
|
||||
|
||||
#define _PASSWORD_EFMT1 '_' /* extended DES encryption format */
|
||||
#define _PASSWORD_NONDES '$' /* non-DES encryption formats */
|
||||
|
||||
#define _PASSWORD_LEN 128 /* max length, not counting NUL */
|
||||
|
||||
#define _PASSWORD_NOUID 0x01 /* flag for no specified uid. */
|
||||
#define _PASSWORD_NOGID 0x02 /* flag for no specified gid. */
|
||||
#define _PASSWORD_NOCHG 0x04 /* flag for no specified change. */
|
||||
#define _PASSWORD_NOEXP 0x08 /* flag for no specified expire. */
|
||||
|
||||
#define _PASSWORD_OLDFMT 0x10 /* flag to expect an old style entry */
|
||||
#define _PASSWORD_NOWARN 0x20 /* no warnings for bad entries */
|
||||
|
||||
#define _PASSWORD_WARNDAYS 14 /* days to warn about expiry */
|
||||
#define _PASSWORD_CHGNOW -1 /* special day to force password
|
||||
* change at next login */
|
||||
#endif
|
||||
|
||||
struct passwd {
|
||||
__aconst char *pw_name; /* user name */
|
||||
__aconst char *pw_passwd; /* encrypted password */
|
||||
uid_t pw_uid; /* user uid */
|
||||
gid_t pw_gid; /* user gid */
|
||||
time_t pw_change; /* password change time */
|
||||
__aconst char *pw_class; /* user login class */
|
||||
__aconst char *pw_gecos; /* general information */
|
||||
__aconst char *pw_dir; /* home directory */
|
||||
__aconst char *pw_shell; /* default shell */
|
||||
time_t pw_expire; /* account expiration */
|
||||
};
|
||||
|
||||
__BEGIN_DECLS
|
||||
#ifndef __LIBC12_SOURCE__
|
||||
struct passwd *getpwuid(uid_t) __RENAME(__getpwuid50);
|
||||
struct passwd *getpwnam(const char *) __RENAME(__getpwnam50);
|
||||
#endif
|
||||
#if (_POSIX_C_SOURCE - 0) >= 199506L || (_XOPEN_SOURCE - 0) >= 500 || \
|
||||
defined(_REENTRANT) || defined(_NETBSD_SOURCE)
|
||||
#ifndef __LIBC12_SOURCE__
|
||||
int getpwnam_r(const char *, struct passwd *, char *, size_t,
|
||||
struct passwd **) __RENAME(__getpwnam_r50);
|
||||
int getpwuid_r(uid_t, struct passwd *, char *, size_t,
|
||||
struct passwd **) __RENAME(__getpwuid_r50);
|
||||
#endif
|
||||
#endif
|
||||
#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
|
||||
#ifndef __LIBC12_SOURCE__
|
||||
struct passwd *getpwent(void) __RENAME(__getpwent50);
|
||||
#endif
|
||||
void setpwent(void);
|
||||
void endpwent(void);
|
||||
#endif
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
int pw_gensalt(char *, size_t, const char *, const char *);
|
||||
#ifndef __LIBC12_SOURCE__
|
||||
int pw_scan(char *, struct passwd *, int *) __RENAME(__pw_scan50);
|
||||
int getpwent_r(struct passwd *, char *, size_t, struct passwd **)
|
||||
__RENAME(__getpwent_r50);
|
||||
#endif
|
||||
int setpassent(int);
|
||||
const char *user_from_uid(uid_t, int);
|
||||
int uid_from_user(const char *, uid_t *);
|
||||
#ifndef __LIBC12_SOURCE__
|
||||
int pwcache_userdb(int (*)(int), void (*)(void),
|
||||
struct passwd * (*)(const char *), struct passwd * (*)(uid_t))
|
||||
__RENAME(__pwcache_userdb50);
|
||||
#endif
|
||||
#endif
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_PWD_H_ */
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
/*-
|
||||
* Copyright (c) 2011 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by David A. Holland.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _QUOTA_H_
|
||||
#define _QUOTA_H_
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/quota.h>
|
||||
|
||||
struct quotahandle; /* Opaque. */
|
||||
struct quotacursor; /* Opaque. */
|
||||
|
||||
|
||||
void quotaval_clear(struct quotaval *);
|
||||
|
||||
struct quotahandle *quota_open(const char *);
|
||||
void quota_close(struct quotahandle *);
|
||||
|
||||
const char *quota_getmountpoint(struct quotahandle *);
|
||||
const char *quota_getmountdevice(struct quotahandle *);
|
||||
|
||||
const char *quota_getimplname(struct quotahandle *);
|
||||
unsigned quota_getrestrictions(struct quotahandle *);
|
||||
|
||||
int quota_getnumidtypes(struct quotahandle *);
|
||||
const char *quota_idtype_getname(struct quotahandle *, int /*idtype*/);
|
||||
|
||||
int quota_getnumobjtypes(struct quotahandle *);
|
||||
const char *quota_objtype_getname(struct quotahandle *, int /*objtype*/);
|
||||
int quota_objtype_isbytes(struct quotahandle *, int /*objtype*/);
|
||||
|
||||
int quota_quotaon(struct quotahandle *, int /*idtype*/);
|
||||
int quota_quotaoff(struct quotahandle *, int /*idtype*/);
|
||||
|
||||
int quota_get(struct quotahandle *, const struct quotakey *,
|
||||
struct quotaval *);
|
||||
|
||||
int quota_put(struct quotahandle *, const struct quotakey *,
|
||||
const struct quotaval *);
|
||||
|
||||
int quota_delete(struct quotahandle *, const struct quotakey *);
|
||||
|
||||
struct quotacursor *quota_opencursor(struct quotahandle *);
|
||||
void quotacursor_close(struct quotacursor *);
|
||||
|
||||
int quotacursor_skipidtype(struct quotacursor *, int /*idtype*/);
|
||||
|
||||
int quotacursor_get(struct quotacursor *, struct quotakey *,
|
||||
struct quotaval *);
|
||||
|
||||
int quotacursor_getn(struct quotacursor *, struct quotakey *,
|
||||
struct quotaval *, unsigned /*maxnum*/);
|
||||
|
||||
int quotacursor_atend(struct quotacursor *);
|
||||
int quotacursor_rewind(struct quotacursor *);
|
||||
|
||||
#endif /* _QUOTA_H_ */
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
/* $NetBSD: randomid.h,v 1.2 2005/12/26 19:01:47 perry Exp $ */
|
||||
/* $KAME: ip6_id.c,v 1.8 2003/09/06 13:41:06 itojun Exp $ */
|
||||
/* $OpenBSD: ip_id.c,v 1.6 2002/03/15 18:19:52 millert Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2003 WIDE Project.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the project nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright 1998 Niels Provos <provos@citi.umich.edu>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Theo de Raadt <deraadt@openbsd.org> came up with the idea of using
|
||||
* such a mathematical system to generate more random (yet non-repeating)
|
||||
* ids to solve the resolver/named problem. But Niels designed the
|
||||
* actual system based on the constraints.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Niels Provos.
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _RANDOMID_H_
|
||||
#define _RANDOMID_H_
|
||||
|
||||
struct randomid_ctx;
|
||||
|
||||
typedef struct randomid_ctx *randomid_t;
|
||||
|
||||
extern uint32_t randomid(randomid_t);
|
||||
extern randomid_t randomid_new(int, long);
|
||||
extern void randomid_delete(randomid_t);
|
||||
|
||||
#define RANDOMID_TIMEO_MIN ((long)60)
|
||||
#define RANDOMID_TIMEO_DEFAULT ((long)180)
|
||||
|
||||
#endif /*_RANDOMID_H_*/
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
/* $NetBSD: ranlib.h,v 1.6 2003/08/07 09:44:11 agc Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)ranlib.h 8.1 (Berkeley) 6/2/93
|
||||
*/
|
||||
|
||||
#ifndef _RANLIB_H_
|
||||
#define _RANLIB_H_
|
||||
|
||||
#define RANLIBMAG "__.SYMDEF" /* archive file name */
|
||||
#define RANLIBSKEW 3 /* creation time offset */
|
||||
|
||||
struct ranlib {
|
||||
union {
|
||||
long ran_strx; /* string table index */
|
||||
char *ran_name; /* in memory symbol name */
|
||||
} ran_un;
|
||||
long ran_off; /* archive file offset */
|
||||
};
|
||||
|
||||
#endif /* !_RANLIB_H_ */
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
/* $NetBSD: re_comp.h,v 1.4 2008/04/28 20:22:54 martin Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by J.T. Conklin.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _RE_COMP_H_
|
||||
#define _RE_COMP_H_
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
char *re_comp(const char *);
|
||||
int re_exec(const char *);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _RE_COMP_H_ */
|
||||
142
include/regex.h
142
include/regex.h
|
|
@ -1,142 +0,0 @@
|
|||
/* $NetBSD: regex.h,v 1.13 2005/09/13 01:44:32 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Henry Spencer of the University of Toronto.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)regex.h 8.2 (Berkeley) 1/3/94
|
||||
*/
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992 Henry Spencer.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Henry Spencer of the University of Toronto.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)regex.h 8.2 (Berkeley) 1/3/94
|
||||
*/
|
||||
|
||||
#ifndef _REGEX_H_
|
||||
#define _REGEX_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
/* types */
|
||||
typedef off_t regoff_t;
|
||||
|
||||
typedef struct {
|
||||
int re_magic;
|
||||
size_t re_nsub; /* number of parenthesized subexpressions */
|
||||
const char *re_endp; /* end pointer for REG_PEND */
|
||||
struct re_guts *re_g; /* none of your business :-) */
|
||||
} regex_t;
|
||||
|
||||
typedef struct {
|
||||
regoff_t rm_so; /* start of match */
|
||||
regoff_t rm_eo; /* end of match */
|
||||
} regmatch_t;
|
||||
|
||||
/* regcomp() flags */
|
||||
#define REG_BASIC 0000
|
||||
#define REG_EXTENDED 0001
|
||||
#define REG_ICASE 0002
|
||||
#define REG_NOSUB 0004
|
||||
#define REG_NEWLINE 0010
|
||||
#define REG_NOSPEC 0020
|
||||
#define REG_PEND 0040
|
||||
#define REG_DUMP 0200
|
||||
|
||||
/* regerror() flags */
|
||||
#define REG_NOMATCH 1
|
||||
#define REG_BADPAT 2
|
||||
#define REG_ECOLLATE 3
|
||||
#define REG_ECTYPE 4
|
||||
#define REG_EESCAPE 5
|
||||
#define REG_ESUBREG 6
|
||||
#define REG_EBRACK 7
|
||||
#define REG_EPAREN 8
|
||||
#define REG_EBRACE 9
|
||||
#define REG_BADBR 10
|
||||
#define REG_ERANGE 11
|
||||
#define REG_ESPACE 12
|
||||
#define REG_BADRPT 13
|
||||
#define REG_EMPTY 14
|
||||
#define REG_ASSERT 15
|
||||
#define REG_INVARG 16
|
||||
#define REG_ENOSYS 17
|
||||
#define REG_ATOI 255 /* convert name to number (!) */
|
||||
#define REG_ITOA 0400 /* convert number to name (!) */
|
||||
|
||||
/* regexec() flags */
|
||||
#define REG_NOTBOL 00001
|
||||
#define REG_NOTEOL 00002
|
||||
#define REG_STARTEND 00004
|
||||
#define REG_TRACE 00400 /* tracing of execution */
|
||||
#define REG_LARGE 01000 /* force large representation */
|
||||
#define REG_BACKR 02000 /* force use of backref code */
|
||||
|
||||
__BEGIN_DECLS
|
||||
int regcomp(regex_t * __restrict, const char * __restrict, int);
|
||||
size_t regerror(int, const regex_t * __restrict, char * __restrict, size_t);
|
||||
int regexec(const regex_t * __restrict,
|
||||
const char * __restrict, size_t, regmatch_t [], int);
|
||||
void regfree(regex_t *);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_REGEX_H_ */
|
||||
109
include/regexp.h
109
include/regexp.h
|
|
@ -1,109 +0,0 @@
|
|||
/* $NetBSD: regexp.h,v 1.7 2005/02/03 04:39:32 perry Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley
|
||||
* by Henry Spencer.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)regexp.h 8.1 (Berkeley) 6/2/93
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1986 by University of Toronto.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley
|
||||
* by Henry Spencer.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)regexp.h 8.1 (Berkeley) 6/2/93
|
||||
*/
|
||||
|
||||
#ifndef _REGEXP_H_
|
||||
#define _REGEXP_H_
|
||||
|
||||
/*
|
||||
* Definitions etc. for regexp(3) routines.
|
||||
*
|
||||
* Caveat: this is V8 regexp(3) [actually, a reimplementation thereof],
|
||||
* not the System V one.
|
||||
*/
|
||||
#define NSUBEXP 10
|
||||
typedef struct regexp {
|
||||
char *startp[NSUBEXP];
|
||||
char *endp[NSUBEXP];
|
||||
char regstart; /* Internal use only. */
|
||||
char reganch; /* Internal use only. */
|
||||
char *regmust; /* Internal use only. */
|
||||
int regmlen; /* Internal use only. */
|
||||
char program[1]; /* Unwarranted chumminess with compiler. */
|
||||
} regexp;
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
#ifdef __LIBCOMPAT_SOURCE__
|
||||
regexp *__compat_regcomp(const char *);
|
||||
int __compat_regexec(const regexp *, const char *);
|
||||
void __compat_regsub(const regexp *, const char *, char *);
|
||||
void __compat_regerror(const char *);
|
||||
#endif
|
||||
regexp *regcomp(const char *) __RENAME(__compat_regcomp);
|
||||
int regexec(const regexp *, const char *) __RENAME(__compat_regexec);
|
||||
void regsub(const regexp *, const char *, char *) __RENAME(__compat_regsub);
|
||||
void regerror(const char *) __RENAME(__compat_regerror);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_REGEXP_H_ */
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
/* $NetBSD: res_update.h,v 1.8 2012/11/15 18:49:37 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (c) 1999 by Internet Software Consortium, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
||||
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Id: res_update.h,v 1.3 2005/04/27 04:56:15 sra Exp
|
||||
*/
|
||||
|
||||
#ifndef __RES_UPDATE_H
|
||||
#define __RES_UPDATE_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <arpa/nameser.h>
|
||||
#include <sys/queue.h>
|
||||
#include <resolv.h>
|
||||
|
||||
/*%
|
||||
* This RR-like structure is particular to UPDATE.
|
||||
*/
|
||||
struct ns_updrec {
|
||||
TAILQ_ENTRY(ns_updrec) r_link, r_glink;
|
||||
ns_sect r_section; /*%< ZONE/PREREQUISITE/UPDATE */
|
||||
char * r_dname; /*%< owner of the RR */
|
||||
ns_class r_class; /*%< class number */
|
||||
ns_type r_type; /*%< type number */
|
||||
uint32_t r_ttl; /*%< time to live */
|
||||
u_char * r_data; /*%< rdata fields as text string */
|
||||
u_int r_size; /*%< size of r_data field */
|
||||
int r_opcode; /*%< type of operation */
|
||||
/* following fields for private use by the resolver/server routines */
|
||||
struct databuf *r_dp; /*%< databuf to process */
|
||||
struct databuf *r_deldp; /*%< databuf's deleted/overwritten */
|
||||
u_int r_zone; /*%< zone number on server */
|
||||
};
|
||||
typedef struct ns_updrec ns_updrec;
|
||||
typedef TAILQ_HEAD(ns_updqueu, ns_updrec) ns_updque;
|
||||
|
||||
#define res_mkupdate __res_mkupdate
|
||||
#define res_update __res_update
|
||||
#define res_mkupdrec __res_mkupdrec
|
||||
#define res_freeupdrec __res_freeupdrec
|
||||
#define res_nmkupdate __res_nmkupdate
|
||||
#define res_nupdate __res_nupdate
|
||||
|
||||
int res_mkupdate(ns_updrec *, u_char *, int);
|
||||
int res_update(ns_updrec *);
|
||||
ns_updrec * res_mkupdrec(int, const char *, u_int, u_int, u_long);
|
||||
void res_freeupdrec(ns_updrec *);
|
||||
int res_nmkupdate(res_state, ns_updrec *, u_char *, int);
|
||||
int res_nupdate(res_state, ns_updrec *, ns_tsig_key *);
|
||||
|
||||
#endif /*__RES_UPDATE_H*/
|
||||
510
include/resolv.h
510
include/resolv.h
|
|
@ -1,510 +0,0 @@
|
|||
/* $NetBSD: resolv.h,v 1.40 2012/11/07 15:45:24 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Portions Copyright (C) 2004, 2005, 2008, 2009 Internet Systems Consortium, Inc. ("ISC")
|
||||
* Portions Copyright (C) 1995-2003 Internet Software Consortium.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
|
||||
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1987, 1989
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*%
|
||||
* @(#)resolv.h 8.1 (Berkeley) 6/2/93
|
||||
* Id: resolv.h,v 1.30 2009/03/03 01:52:48 each Exp
|
||||
*/
|
||||
|
||||
#ifndef _RESOLV_H_
|
||||
#define _RESOLV_H_
|
||||
|
||||
#include <sys/param.h>
|
||||
#if (!defined(BSD)) || (BSD < 199306)
|
||||
# include <sys/bitypes.h>
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/socket.h>
|
||||
#include <stdio.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/nameser.h>
|
||||
|
||||
/*%
|
||||
* Revision information. This is the release date in YYYYMMDD format.
|
||||
* It can change every day so the right thing to do with it is use it
|
||||
* in preprocessor commands such as "#if (__RES > 19931104)". Do not
|
||||
* compare for equality; rather, use it to determine whether your resolver
|
||||
* is new enough to contain a certain feature.
|
||||
*/
|
||||
|
||||
#define __RES 20090302
|
||||
|
||||
/*%
|
||||
* This used to be defined in res_query.c, now it's in herror.c.
|
||||
* [XXX no it's not. It's in irs/irs_data.c]
|
||||
* It was
|
||||
* never extern'd by any *.h file before it was placed here. For thread
|
||||
* aware programs, the last h_errno value set is stored in res->h_errno.
|
||||
*
|
||||
* XXX: There doesn't seem to be a good reason for exposing RES_SET_H_ERRNO
|
||||
* (and __h_errno_set) to the public via <resolv.h>.
|
||||
* XXX: __h_errno_set is really part of IRS, not part of the resolver.
|
||||
* If somebody wants to build and use a resolver that doesn't use IRS,
|
||||
* what do they do? Perhaps something like
|
||||
* #ifdef WANT_IRS
|
||||
* # define RES_SET_H_ERRNO(r,x) __h_errno_set(r,x)
|
||||
* #else
|
||||
* # define RES_SET_H_ERRNO(r,x) (h_errno = (r)->res_h_errno = (x))
|
||||
* #endif
|
||||
*/
|
||||
|
||||
#define RES_SET_H_ERRNO(r,x) __h_errno_set(r,x)
|
||||
struct __res_state; /*%< forward */
|
||||
__BEGIN_DECLS
|
||||
void __h_errno_set(struct __res_state *, int);
|
||||
__END_DECLS
|
||||
|
||||
/*%
|
||||
* Resolver configuration file.
|
||||
* Normally not present, but may contain the address of the
|
||||
* initial name server(s) to query and the domain search list.
|
||||
*/
|
||||
|
||||
#ifndef _PATH_RESCONF
|
||||
#define _PATH_RESCONF "/etc/resolv.conf"
|
||||
#endif
|
||||
|
||||
typedef enum { res_goahead, res_nextns, res_modified, res_done, res_error }
|
||||
res_sendhookact;
|
||||
|
||||
typedef res_sendhookact (*res_send_qhook)(struct sockaddr * const *,
|
||||
const u_char **, int *,
|
||||
u_char *, int, int *);
|
||||
|
||||
typedef res_sendhookact (*res_send_rhook)(const struct sockaddr *,
|
||||
const u_char *, int, u_char *,
|
||||
int, int *);
|
||||
|
||||
struct res_sym {
|
||||
int number; /*%< Identifying number, like T_MX */
|
||||
const char * name; /*%< Its symbolic name, like "MX" */
|
||||
const char * humanname; /*%< Its fun name, like "mail exchanger" */
|
||||
};
|
||||
|
||||
/*%
|
||||
* Global defines and variables for resolver stub.
|
||||
*/
|
||||
#define MAXNS 3 /*%< max # name servers we'll track */
|
||||
#define MAXDFLSRCH 3 /*%< # default domain levels to try */
|
||||
#define MAXDNSRCH 6 /*%< max # domains in search path */
|
||||
#define LOCALDOMAINPARTS 2 /*%< min levels in name that is "local" */
|
||||
#define RES_TIMEOUT 5 /*%< min. seconds between retries */
|
||||
#define MAXRESOLVSORT 10 /*%< number of net to sort on */
|
||||
#define RES_MAXNDOTS 15 /*%< should reflect bit field size */
|
||||
#define RES_MAXRETRANS 30 /*%< only for resolv.conf/RES_OPTIONS */
|
||||
#define RES_MAXRETRY 5 /*%< only for resolv.conf/RES_OPTIONS */
|
||||
#define RES_DFLRETRY 2 /*%< Default #/tries. */
|
||||
#define RES_MAXTIME 65535 /*%< Infinity, in milliseconds. */
|
||||
|
||||
struct __res_state_ext;
|
||||
|
||||
struct __res_state {
|
||||
int retrans; /*%< retransmission time interval */
|
||||
int retry; /*%< number of times to retransmit */
|
||||
#ifdef sun
|
||||
u_int options; /*%< option flags - see below. */
|
||||
#else
|
||||
u_long options; /*%< option flags - see below. */
|
||||
#endif
|
||||
int nscount; /*%< number of name servers */
|
||||
struct sockaddr_in
|
||||
nsaddr_list[MAXNS]; /*%< address of name server */
|
||||
#define nsaddr nsaddr_list[0] /*%< for backward compatibility */
|
||||
u_short id; /*%< current message id */
|
||||
char *dnsrch[MAXDNSRCH+1]; /*%< components of domain to search */
|
||||
char defdname[256]; /*%< default domain (deprecated) */
|
||||
#ifdef sun
|
||||
u_int pfcode; /*%< RES_PRF_ flags - see below. */
|
||||
#else
|
||||
u_long pfcode; /*%< RES_PRF_ flags - see below. */
|
||||
#endif
|
||||
unsigned ndots:4; /*%< threshold for initial abs. query */
|
||||
unsigned nsort:4; /*%< number of elements in sort_list[] */
|
||||
char unused[3];
|
||||
struct {
|
||||
struct in_addr addr;
|
||||
uint32_t mask;
|
||||
} sort_list[MAXRESOLVSORT];
|
||||
#ifdef __OLD_RES_STATE
|
||||
char lookups[4];
|
||||
#else
|
||||
res_send_qhook qhook; /*%< query hook */
|
||||
res_send_rhook rhook; /*%< response hook */
|
||||
int res_h_errno; /*%< last one set for this context */
|
||||
int _vcsock; /*%< PRIVATE: for res_send VC i/o */
|
||||
u_int _flags; /*%< PRIVATE: see below */
|
||||
u_int _pad; /*%< make _u 64 bit aligned */
|
||||
union {
|
||||
/* On an 32-bit arch this means 512b total. */
|
||||
char pad[56 - 4*sizeof (int) - 3*sizeof (void *)];
|
||||
struct {
|
||||
uint16_t nscount;
|
||||
uint16_t nstimes[MAXNS]; /*%< ms. */
|
||||
int nssocks[MAXNS];
|
||||
struct __res_state_ext *ext; /*%< extention for IPv6 */
|
||||
} _ext;
|
||||
} _u;
|
||||
u_char *_rnd; /*%< PRIVATE: random state */
|
||||
#endif
|
||||
};
|
||||
|
||||
typedef struct __res_state *res_state;
|
||||
|
||||
union res_sockaddr_union {
|
||||
struct sockaddr_in sin;
|
||||
#ifdef IN6ADDR_ANY_INIT
|
||||
struct sockaddr_in6 sin6;
|
||||
#endif
|
||||
#ifdef ISC_ALIGN64
|
||||
int64_t __align64; /*%< 64bit alignment */
|
||||
#else
|
||||
int32_t __align32; /*%< 32bit alignment */
|
||||
#endif
|
||||
char __space[128]; /* max size */
|
||||
};
|
||||
|
||||
/*%
|
||||
* Resolver flags (used to be discrete per-module statics ints).
|
||||
*/
|
||||
#define RES_F_VC 0x00000001 /*%< socket is TCP */
|
||||
#define RES_F_CONN 0x00000002 /*%< socket is connected */
|
||||
#define RES_F_EDNS0ERR 0x00000004 /*%< EDNS0 caused errors */
|
||||
#define RES_F__UNUSED 0x00000008 /*%< (unused) */
|
||||
#define RES_F_LASTMASK 0x000000F0 /*%< ordinal server of last res_nsend */
|
||||
#define RES_F_LASTSHIFT 4 /*%< bit position of LASTMASK "flag" */
|
||||
#define RES_GETLAST(res) (((res)._flags & RES_F_LASTMASK) >> RES_F_LASTSHIFT)
|
||||
|
||||
/* res_findzonecut2() options */
|
||||
#define RES_EXHAUSTIVE 0x00000001 /*%< always do all queries */
|
||||
#define RES_IPV4ONLY 0x00000002 /*%< IPv4 only */
|
||||
#define RES_IPV6ONLY 0x00000004 /*%< IPv6 only */
|
||||
|
||||
/*%
|
||||
* Resolver options (keep these in synch with res_debug.c, please)
|
||||
*/
|
||||
#define RES_INIT 0x00000001 /*%< address initialized */
|
||||
#define RES_DEBUG 0x00000002 /*%< print debug messages */
|
||||
#define RES_AAONLY 0x00000004 /*%< authoritative answers only (!IMPL)*/
|
||||
#define RES_USEVC 0x00000008 /*%< use virtual circuit */
|
||||
#define RES_PRIMARY 0x00000010 /*%< query primary server only (!IMPL) */
|
||||
#define RES_IGNTC 0x00000020 /*%< ignore trucation errors */
|
||||
#define RES_RECURSE 0x00000040 /*%< recursion desired */
|
||||
#define RES_DEFNAMES 0x00000080 /*%< use default domain name */
|
||||
#define RES_STAYOPEN 0x00000100 /*%< Keep TCP socket open */
|
||||
#define RES_DNSRCH 0x00000200 /*%< search up local domain tree */
|
||||
#define RES_INSECURE1 0x00000400 /*%< type 1 security disabled */
|
||||
#define RES_INSECURE2 0x00000800 /*%< type 2 security disabled */
|
||||
#define RES_NOALIASES 0x00001000 /*%< shuts off HOSTALIASES feature */
|
||||
#define RES_USE_INET6 0x00002000 /*%< use/map IPv6 in gethostbyname() */
|
||||
#define RES_ROTATE 0x00004000 /*%< rotate ns list after each query */
|
||||
#define RES_NOCHECKNAME 0x00008000 /*%< do not check names for sanity. */
|
||||
#define RES_KEEPTSIG 0x00010000 /*%< do not strip TSIG records */
|
||||
#define RES_BLAST 0x00020000 /*%< blast all recursive servers */
|
||||
#define RES_NSID 0x00040000 /*%< request name server ID */
|
||||
#define RES_NOTLDQUERY 0x00100000 /*%< don't unqualified name as a tld */
|
||||
#define RES_USE_DNSSEC 0x00200000 /*%< use DNSSEC using OK bit in OPT */
|
||||
/* #define RES_DEBUG2 0x00400000 */ /* nslookup internal */
|
||||
/* KAME extensions: use higher bit to avoid conflict with ISC use */
|
||||
#define RES_USE_DNAME 0x10000000 /*%< use DNAME */
|
||||
#define RES_USE_EDNS0 0x40000000 /*%< use EDNS0 if configured */
|
||||
#define RES_NO_NIBBLE2 0x80000000 /*%< disable alternate nibble lookup */
|
||||
|
||||
#define RES_DEFAULT (RES_RECURSE | RES_DEFNAMES | \
|
||||
RES_DNSRCH | RES_NO_NIBBLE2 | RES_NOCHECKNAME)
|
||||
|
||||
/*%
|
||||
* Resolver "pfcode" values. Used by dig.
|
||||
*/
|
||||
#define RES_PRF_STATS 0x00000001
|
||||
#define RES_PRF_UPDATE 0x00000002
|
||||
#define RES_PRF_CLASS 0x00000004
|
||||
#define RES_PRF_CMD 0x00000008
|
||||
#define RES_PRF_QUES 0x00000010
|
||||
#define RES_PRF_ANS 0x00000020
|
||||
#define RES_PRF_AUTH 0x00000040
|
||||
#define RES_PRF_ADD 0x00000080
|
||||
#define RES_PRF_HEAD1 0x00000100
|
||||
#define RES_PRF_HEAD2 0x00000200
|
||||
#define RES_PRF_TTLID 0x00000400
|
||||
#define RES_PRF_HEADX 0x00000800
|
||||
#define RES_PRF_QUERY 0x00001000
|
||||
#define RES_PRF_REPLY 0x00002000
|
||||
#define RES_PRF_INIT 0x00004000
|
||||
#define RES_PRF_TRUNC 0x00008000
|
||||
/* 0x00010000 */
|
||||
|
||||
/* Things involving an internal (static) resolver context. */
|
||||
__BEGIN_DECLS
|
||||
extern struct __res_state *__res_get_state(void);
|
||||
extern void __res_put_state(struct __res_state *);
|
||||
|
||||
/*
|
||||
* Source and Binary compatibility; _res will not work properly
|
||||
* with multi-threaded programs.
|
||||
*/
|
||||
extern struct __res_state *__res_state(void);
|
||||
#define _res (*__res_state())
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#ifndef __BIND_NOSTATIC
|
||||
#define fp_nquery __fp_nquery
|
||||
#define fp_query __fp_query
|
||||
#define hostalias __hostalias
|
||||
#define p_query __p_query
|
||||
#define res_close __res_close
|
||||
#define res_isourserver __res_isourserver
|
||||
#define res_opt __res_opt
|
||||
#define res_querydomain __res_querydomain
|
||||
#define res_send __res_send
|
||||
#define res_sendsigned __res_sendsigned
|
||||
|
||||
#ifdef notdef
|
||||
/* NetBSD protects these via weak symbols. */
|
||||
#define res_init __res_init
|
||||
#define res_query __res_query
|
||||
#define res_mkquery __res_mkquery
|
||||
#define dn_expand __dn_expand
|
||||
#define res_search __res_search
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
void fp_nquery(const u_char *, int, FILE *);
|
||||
void fp_query(const u_char *, FILE *);
|
||||
const char * hostalias(const char *);
|
||||
void p_query(const u_char *);
|
||||
void res_close(void);
|
||||
int res_init(void);
|
||||
int res_opt(int, u_char *, int, int);
|
||||
int res_isourserver(const struct sockaddr_in *);
|
||||
int res_mkquery(int, const char *, int, int, const u_char *,
|
||||
int, const u_char *, u_char *, int);
|
||||
int res_query(const char *, int, int, u_char *, int);
|
||||
int res_querydomain(const char *, const char *, int, int,
|
||||
u_char *, int);
|
||||
int res_search(const char *, int, int, u_char *, int);
|
||||
int res_send(const u_char *, int, u_char *, int);
|
||||
int res_sendsigned(const u_char *, int, ns_tsig_key *,
|
||||
u_char *, int);
|
||||
__END_DECLS
|
||||
#endif
|
||||
|
||||
#if !defined(SHARED_LIBBIND) || defined(LIB)
|
||||
/*
|
||||
* If libbind is a shared object (well, DLL anyway)
|
||||
* these externs break the linker when resolv.h is
|
||||
* included by a lib client (like named)
|
||||
* Make them go away if a client is including this
|
||||
*
|
||||
*/
|
||||
extern const struct res_sym __p_key_syms[];
|
||||
extern const struct res_sym __p_cert_syms[];
|
||||
extern const struct res_sym __p_class_syms[];
|
||||
extern const struct res_sym __p_type_syms[];
|
||||
extern const struct res_sym __p_rcode_syms[];
|
||||
#endif /* SHARED_LIBBIND */
|
||||
|
||||
#define b64_ntop __b64_ntop
|
||||
#define b64_pton __b64_pton
|
||||
#define dn_comp __dn_comp
|
||||
#define dn_count_labels __dn_count_labels
|
||||
#define dn_skipname __dn_skipname
|
||||
#define fp_resstat __fp_resstat
|
||||
#define loc_aton __loc_aton
|
||||
#define loc_ntoa __loc_ntoa
|
||||
#define p_cdname __p_cdname
|
||||
#define p_cdnname __p_cdnname
|
||||
#define p_class __p_class
|
||||
#define p_fqname __p_fqname
|
||||
#define p_fqnname __p_fqnname
|
||||
#define p_option __p_option
|
||||
#define p_secstodate __p_secstodate
|
||||
#define p_section __p_section
|
||||
#define p_time __p_time
|
||||
#define p_type __p_type
|
||||
#define p_rcode __p_rcode
|
||||
#define p_sockun __p_sockun
|
||||
#define putlong __putlong
|
||||
#define putshort __putshort
|
||||
#define res_check __res_check
|
||||
#define res_dnok __res_dnok
|
||||
#define res_findzonecut __res_findzonecut
|
||||
#define res_findzonecut2 __res_findzonecut2
|
||||
#define res_hnok __res_hnok
|
||||
#define res_hostalias __res_hostalias
|
||||
#define res_mailok __res_mailok
|
||||
#define res_nameinquery __res_nameinquery
|
||||
#define res_nclose __res_nclose
|
||||
#define res_ninit __res_ninit
|
||||
#define res_nmkquery __res_nmkquery
|
||||
#define res_pquery __res_pquery
|
||||
#define res_nquery __res_nquery
|
||||
#define res_nquerydomain __res_nquerydomain
|
||||
#define res_nsearch __res_nsearch
|
||||
#define res_nsend __res_nsend
|
||||
#define res_nsendsigned __res_nsendsigned
|
||||
#define res_nisourserver __res_nisourserver
|
||||
#define res_ownok __res_ownok
|
||||
#define res_queriesmatch __res_queriesmatch
|
||||
#define res_rndinit __res_rndinit
|
||||
#define res_randomid __res_randomid
|
||||
#define res_nrandomid __res_nrandomid
|
||||
#define sym_ntop __sym_ntop
|
||||
#define sym_ntos __sym_ntos
|
||||
#define sym_ston __sym_ston
|
||||
#define res_nopt __res_nopt
|
||||
#define res_nopt_rdata __res_nopt_rdata
|
||||
#define res_ndestroy __res_ndestroy
|
||||
#define res_nametoclass __res_nametoclass
|
||||
#define res_nametotype __res_nametotype
|
||||
#define res_setservers __res_setservers
|
||||
#define res_getservers __res_getservers
|
||||
#define res_buildprotolist __res_buildprotolist
|
||||
#define res_destroyprotolist __res_destroyprotolist
|
||||
#define res_destroyservicelist __res_destroyservicelist
|
||||
#define res_get_nibblesuffix __res_get_nibblesuffix
|
||||
#define res_get_nibblesuffix2 __res_get_nibblesuffix2
|
||||
#define res_ourserver_p __res_ourserver_p
|
||||
#define res_protocolname __res_protocolname
|
||||
#define res_protocolnumber __res_protocolnumber
|
||||
#define res_send_setqhook __res_send_setqhook
|
||||
#define res_send_setrhook __res_send_setrhook
|
||||
#define res_servicename __res_servicename
|
||||
#define res_servicenumber __res_servicenumber
|
||||
__BEGIN_DECLS
|
||||
int res_hnok(const char *);
|
||||
int res_ownok(const char *);
|
||||
int res_mailok(const char *);
|
||||
struct timespec;
|
||||
int res_check(res_state, struct timespec *);
|
||||
int res_dnok(const char *);
|
||||
int sym_ston(const struct res_sym *, const char *, int *);
|
||||
const char * sym_ntos(const struct res_sym *, int, int *);
|
||||
const char * sym_ntop(const struct res_sym *, int, int *);
|
||||
int b64_ntop(u_char const *, size_t, char *, size_t);
|
||||
int b64_pton(char const *, u_char *, size_t);
|
||||
int loc_aton(const char *, u_char *);
|
||||
const char * loc_ntoa(const u_char *, char *);
|
||||
int dn_skipname(const u_char *, const u_char *);
|
||||
void putlong(uint32_t, u_char *);
|
||||
void putshort(uint16_t, u_char *);
|
||||
#ifndef __ultrix__
|
||||
uint16_t _getshort(const u_char *);
|
||||
uint32_t _getlong(const u_char *);
|
||||
#endif
|
||||
const char * p_class(int);
|
||||
const char * p_time(uint32_t);
|
||||
const char * p_type(int);
|
||||
const char * p_rcode(int);
|
||||
const char * p_sockun(union res_sockaddr_union, char *, size_t);
|
||||
const u_char * p_cdnname(const u_char *, const u_char *, int, FILE *);
|
||||
const u_char * p_cdname(const u_char *, const u_char *, FILE *);
|
||||
const u_char * p_fqnname(const u_char *, const u_char *,
|
||||
int, char *, int);
|
||||
const u_char * p_fqname(const u_char *, const u_char *, FILE *);
|
||||
const char * p_option(u_long);
|
||||
char * p_secstodate(u_long);
|
||||
int dn_count_labels(const char *);
|
||||
int dn_comp(const char *, u_char *, int, u_char **, u_char **);
|
||||
int dn_expand(const u_char *, const u_char *, const u_char *,
|
||||
char *, int);
|
||||
void res_rndinit(res_state);
|
||||
u_int res_randomid(void);
|
||||
u_int res_nrandomid(res_state);
|
||||
int res_nameinquery(const char *, int, int, const u_char *,
|
||||
const u_char *);
|
||||
int res_queriesmatch(const u_char *, const u_char *,
|
||||
const u_char *, const u_char *);
|
||||
const char * p_section(int, int);
|
||||
/* Things involving a resolver context. */
|
||||
int res_ninit(res_state);
|
||||
int res_nisourserver(const res_state, const struct sockaddr_in *);
|
||||
void fp_resstat(const res_state, FILE *);
|
||||
void res_pquery(const res_state, const u_char *, int, FILE *);
|
||||
const char * res_hostalias(const res_state, const char *, char *, size_t);
|
||||
int res_nquery(res_state, const char *, int, int, u_char *, int);
|
||||
int res_nsearch(res_state, const char *, int, int, u_char *, int);
|
||||
int res_nquerydomain(res_state, const char *, const char *,
|
||||
int, int, u_char *, int);
|
||||
int res_nmkquery(res_state, int, const char *, int, int,
|
||||
const u_char *, int, const u_char *,
|
||||
u_char *, int);
|
||||
int res_nsend(res_state, const u_char *, int, u_char *, int);
|
||||
int res_nsendsigned(res_state, const u_char *, int,
|
||||
ns_tsig_key *, u_char *, int);
|
||||
int res_findzonecut(res_state, const char *, ns_class, int,
|
||||
char *, size_t, struct in_addr *, int);
|
||||
int res_findzonecut2(res_state, const char *, ns_class, int,
|
||||
char *, size_t,
|
||||
union res_sockaddr_union *, int);
|
||||
void res_nclose(res_state);
|
||||
int res_nopt(res_state, int, u_char *, int, int);
|
||||
int res_nopt_rdata(res_state, int, u_char *, int, u_char *,
|
||||
u_short, u_short, u_char *);
|
||||
void res_send_setqhook(res_send_qhook);
|
||||
void res_send_setrhook(res_send_rhook);
|
||||
int __res_vinit(res_state, int);
|
||||
void res_destroyservicelist(void);
|
||||
const char * res_servicename(uint16_t, const char *);
|
||||
const char * res_protocolname(int);
|
||||
void res_destroyprotolist(void);
|
||||
void res_buildprotolist(void);
|
||||
const char * res_get_nibblesuffix(res_state);
|
||||
const char * res_get_nibblesuffix2(res_state);
|
||||
void res_ndestroy(res_state);
|
||||
uint16_t res_nametoclass(const char *, int *);
|
||||
uint16_t res_nametotype(const char *, int *);
|
||||
void res_setservers(res_state,
|
||||
const union res_sockaddr_union *, int);
|
||||
int res_getservers(res_state,
|
||||
union res_sockaddr_union *, int);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_RESOLV_H_ */
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
/* $NetBSD: rmt.h,v 1.7 2011/02/16 19:29:35 christos Exp $ */
|
||||
|
||||
/*
|
||||
* rmt.h
|
||||
*
|
||||
* Added routines to replace open(), close(), lseek(), ioctl(), etc.
|
||||
* The preprocessor can be used to remap these the rmtopen(), etc
|
||||
* thus minimizing source changes.
|
||||
*
|
||||
* This file must be included before <sys/stat.h>, since it redefines
|
||||
* stat to be rmtstat, so that struct stat xyzzy; declarations work
|
||||
* properly.
|
||||
*
|
||||
* -- Fred Fish (w/some changes by Arnold Robbins)
|
||||
*/
|
||||
|
||||
#ifndef _RMT_H_
|
||||
#define _RMT_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#if _FORTIFY_SOURCE > 0
|
||||
#define __ssp_weak_name(x) rmt ## x
|
||||
#include <ssp/unistd.h>
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
int isrmt(int);
|
||||
int rmtaccess(const char *, int);
|
||||
int rmtclose(int);
|
||||
int rmtcreat(const char *, mode_t);
|
||||
int rmtdup(int);
|
||||
int rmtfcntl(int, int, ...);
|
||||
int rmtfstat(int, struct stat *);
|
||||
int rmtioctl(int, unsigned long, ...);
|
||||
int rmtisatty(int);
|
||||
off_t rmtlseek(int, off_t, int);
|
||||
int rmtlstat(const char *, struct stat *);
|
||||
int rmtopen(const char *, int, ...);
|
||||
ssize_t rmtread(int, void *, size_t);
|
||||
int rmtstat(const char *, struct stat *);
|
||||
ssize_t rmtwrite(int, const void *, size_t);
|
||||
__END_DECLS
|
||||
|
||||
#ifndef __RMTLIB_PRIVATE /* don't remap if building librmt */
|
||||
#define access rmtaccess
|
||||
#define close rmtclose
|
||||
#define creat rmtcreat
|
||||
#define dup rmtdup
|
||||
#define fcntl rmtfcntl
|
||||
#define fstat rmtfstat
|
||||
#define ioctl rmtioctl
|
||||
#define isatty rmtisatty
|
||||
#define lseek rmtlseek
|
||||
#define lstat rmtlstat
|
||||
#define open rmtopen
|
||||
#if __SSP_FORTIFY_LEVEL == 0
|
||||
#define read rmtread
|
||||
#endif
|
||||
#define stat rmtstat
|
||||
#define write rmtwrite
|
||||
#endif /* __RMTLIB_PRIVATE */
|
||||
|
||||
#endif /* _RMT_H_ */
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# $NetBSD: Makefile,v 1.12 2003/01/11 13:28:43 tron Exp $
|
||||
#
|
||||
|
||||
INCS= auth.h auth_unix.h clnt.h clnt_soc.h nettype.h \
|
||||
pmap_clnt.h pmap_prot.h pmap_rmt.h raw.h rpc.h \
|
||||
rpc_com.h rpc_msg.h rpcb_clnt.h rpcb_prot.h rpcent.h \
|
||||
svc.h svc_auth.h svc_soc.h types.h xdr.h
|
||||
RPC_INCS= rpcb_prot.h
|
||||
|
||||
INCSDIR= /usr/include/rpc
|
||||
|
||||
.include <bsd.rpc.mk>
|
||||
.include <bsd.prog.mk>
|
||||
|
|
@ -1,193 +0,0 @@
|
|||
/* $NetBSD: auth.h,v 1.17 2005/12/26 19:01:47 perry Exp $ */
|
||||
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
* unrestricted use provided that this legend is included on all tape
|
||||
* media and as a part of the software program in whole or part. Users
|
||||
* may copy or modify Sun RPC without charge, but are not authorized
|
||||
* to license or distribute it to anyone else except as part of a product or
|
||||
* program developed by the user.
|
||||
*
|
||||
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
||||
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
|
||||
*
|
||||
* Sun RPC is provided with no support and without any obligation on the
|
||||
* part of Sun Microsystems, Inc. to assist in its use, correction,
|
||||
* modification or enhancement.
|
||||
*
|
||||
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
|
||||
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
|
||||
* OR ANY PART THEREOF.
|
||||
*
|
||||
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
|
||||
* or profits or other special, indirect and consequential damages, even if
|
||||
* Sun has been advised of the possibility of such damages.
|
||||
*
|
||||
* Sun Microsystems, Inc.
|
||||
* 2550 Garcia Avenue
|
||||
* Mountain View, California 94043
|
||||
*
|
||||
* from: @(#)auth.h 1.17 88/02/08 SMI
|
||||
* @(#)auth.h 2.3 88/08/07 4.0 RPCSRC
|
||||
*/
|
||||
|
||||
/*
|
||||
* auth.h, Authentication interface.
|
||||
*
|
||||
* Copyright (C) 1984, Sun Microsystems, Inc.
|
||||
*
|
||||
* The data structures are completely opaque to the client. The client
|
||||
* is required to pass a AUTH * to routines that create rpc
|
||||
* "sessions".
|
||||
*/
|
||||
|
||||
#ifndef _RPC_AUTH_H_
|
||||
#define _RPC_AUTH_H_
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#define MAX_AUTH_BYTES 400
|
||||
#define MAXNETNAMELEN 255 /* maximum length of network user's name */
|
||||
|
||||
/*
|
||||
* Status returned from authentication check
|
||||
*/
|
||||
enum auth_stat {
|
||||
AUTH_OK=0,
|
||||
/*
|
||||
* failed at remote end
|
||||
*/
|
||||
AUTH_BADCRED=1, /* bogus credentials (seal broken) */
|
||||
AUTH_REJECTEDCRED=2, /* client should begin new session */
|
||||
AUTH_BADVERF=3, /* bogus verifier (seal broken) */
|
||||
AUTH_REJECTEDVERF=4, /* verifier expired or was replayed */
|
||||
AUTH_TOOWEAK=5, /* rejected due to security reasons */
|
||||
/*
|
||||
* failed locally
|
||||
*/
|
||||
AUTH_INVALIDRESP=6, /* bogus response verifier */
|
||||
AUTH_FAILED=7 /* some unknown reason */
|
||||
};
|
||||
|
||||
union des_block {
|
||||
struct {
|
||||
uint32_t high;
|
||||
uint32_t low;
|
||||
} key;
|
||||
char c[8];
|
||||
};
|
||||
typedef union des_block des_block;
|
||||
__BEGIN_DECLS
|
||||
extern bool_t xdr_des_block(XDR *, des_block *);
|
||||
__END_DECLS
|
||||
|
||||
/*
|
||||
* Authentication info. Opaque to client.
|
||||
*/
|
||||
struct opaque_auth {
|
||||
enum_t oa_flavor; /* flavor of auth */
|
||||
caddr_t oa_base; /* address of more auth stuff */
|
||||
u_int oa_length; /* not to exceed MAX_AUTH_BYTES */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Auth handle, interface to client side authenticators.
|
||||
*/
|
||||
typedef struct __rpc_auth {
|
||||
struct opaque_auth ah_cred;
|
||||
struct opaque_auth ah_verf;
|
||||
union des_block ah_key;
|
||||
const struct auth_ops {
|
||||
void (*ah_nextverf)(struct __rpc_auth *);
|
||||
/* nextverf & serialize */
|
||||
int (*ah_marshal)(struct __rpc_auth *, XDR *);
|
||||
/* validate varifier */
|
||||
int (*ah_validate)(struct __rpc_auth *,
|
||||
struct opaque_auth *);
|
||||
/* refresh credentials */
|
||||
int (*ah_refresh)(struct __rpc_auth *);
|
||||
/* destroy this structure */
|
||||
void (*ah_destroy)(struct __rpc_auth *);
|
||||
} *ah_ops;
|
||||
void *ah_private;
|
||||
} AUTH;
|
||||
|
||||
|
||||
/*
|
||||
* Authentication ops.
|
||||
* The ops and the auth handle provide the interface to the authenticators.
|
||||
*
|
||||
* AUTH *auth;
|
||||
* XDR *xdrs;
|
||||
* struct opaque_auth verf;
|
||||
*/
|
||||
#define AUTH_NEXTVERF(auth) \
|
||||
((*((auth)->ah_ops->ah_nextverf))(auth))
|
||||
#define auth_nextverf(auth) \
|
||||
((*((auth)->ah_ops->ah_nextverf))(auth))
|
||||
|
||||
#define AUTH_MARSHALL(auth, xdrs) \
|
||||
((*((auth)->ah_ops->ah_marshal))(auth, xdrs))
|
||||
#define auth_marshall(auth, xdrs) \
|
||||
((*((auth)->ah_ops->ah_marshal))(auth, xdrs))
|
||||
|
||||
#define AUTH_VALIDATE(auth, verfp) \
|
||||
((*((auth)->ah_ops->ah_validate))((auth), verfp))
|
||||
#define auth_validate(auth, verfp) \
|
||||
((*((auth)->ah_ops->ah_validate))((auth), verfp))
|
||||
|
||||
#define AUTH_REFRESH(auth) \
|
||||
((*((auth)->ah_ops->ah_refresh))(auth))
|
||||
#define auth_refresh(auth) \
|
||||
((*((auth)->ah_ops->ah_refresh))(auth))
|
||||
|
||||
#define AUTH_DESTROY(auth) \
|
||||
((*((auth)->ah_ops->ah_destroy))(auth))
|
||||
#define auth_destroy(auth) \
|
||||
((*((auth)->ah_ops->ah_destroy))(auth))
|
||||
|
||||
|
||||
extern struct opaque_auth _null_auth;
|
||||
|
||||
|
||||
/*
|
||||
* These are the various implementations of client side authenticators.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Unix style authentication
|
||||
* AUTH *authunix_create(machname, uid, gid, len, aup_gids)
|
||||
* char *machname;
|
||||
* int uid;
|
||||
* int gid;
|
||||
* int len;
|
||||
* int *aup_gids;
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
struct sockaddr_in;
|
||||
extern AUTH *authunix_create (char *, int, int, int, int *);
|
||||
extern AUTH *authunix_create_default (void);
|
||||
extern AUTH *authnone_create (void);
|
||||
extern AUTH *authdes_create (char *, u_int,
|
||||
struct sockaddr_in *, des_block *);
|
||||
extern bool_t xdr_opaque_auth (XDR *, struct opaque_auth *);
|
||||
|
||||
#define authsys_create(c,i1,i2,i3,ip) authunix_create((c),(i1),(i2),(i3),(ip))
|
||||
#define authsys_create_default() authunix_create_default()
|
||||
|
||||
struct svc_req;
|
||||
struct rpc_msg;
|
||||
enum auth_stat _svcauth_null(struct svc_req *, struct rpc_msg *);
|
||||
enum auth_stat _svcauth_short(struct svc_req *, struct rpc_msg *);
|
||||
enum auth_stat _svcauth_unix(struct svc_req *, struct rpc_msg *);
|
||||
__END_DECLS
|
||||
|
||||
#define AUTH_NONE 0 /* no authentication */
|
||||
#define AUTH_NULL 0 /* backward compatibility */
|
||||
#define AUTH_SYS 1 /* unix style (uid, gids) */
|
||||
#define AUTH_UNIX AUTH_SYS /* backward compatibility */
|
||||
#define AUTH_SHORT 2 /* short hand unix style */
|
||||
#define AUTH_DES 3 /* des style (encrypted timestamps) */
|
||||
|
||||
#endif /* !_RPC_AUTH_H_ */
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
/* $NetBSD: auth_unix.h,v 1.8 2005/02/03 04:39:32 perry Exp $ */
|
||||
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
* unrestricted use provided that this legend is included on all tape
|
||||
* media and as a part of the software program in whole or part. Users
|
||||
* may copy or modify Sun RPC without charge, but are not authorized
|
||||
* to license or distribute it to anyone else except as part of a product or
|
||||
* program developed by the user.
|
||||
*
|
||||
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
||||
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
|
||||
*
|
||||
* Sun RPC is provided with no support and without any obligation on the
|
||||
* part of Sun Microsystems, Inc. to assist in its use, correction,
|
||||
* modification or enhancement.
|
||||
*
|
||||
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
|
||||
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
|
||||
* OR ANY PART THEREOF.
|
||||
*
|
||||
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
|
||||
* or profits or other special, indirect and consequential damages, even if
|
||||
* Sun has been advised of the possibility of such damages.
|
||||
*
|
||||
* Sun Microsystems, Inc.
|
||||
* 2550 Garcia Avenue
|
||||
* Mountain View, California 94043
|
||||
*
|
||||
* from: @(#)auth_unix.h 1.8 88/02/08 SMI
|
||||
* @(#)auth_unix.h 2.2 88/07/29 4.0 RPCSRC
|
||||
*/
|
||||
|
||||
/*
|
||||
* auth_unix.h, Protocol for UNIX style authentication parameters for RPC
|
||||
*
|
||||
* Copyright (C) 1984, Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The system is very weak. The client uses no encryption for it
|
||||
* credentials and only sends null verifiers. The server sends backs
|
||||
* null verifiers or optionally a verifier that suggests a new short hand
|
||||
* for the credentials.
|
||||
*/
|
||||
|
||||
#ifndef _RPC_AUTH_UNIX_H_
|
||||
#define _RPC_AUTH_UNIX_H_
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
/* The machine name is part of a credential; it may not exceed 255 bytes */
|
||||
#define MAX_MACHINE_NAME 255
|
||||
|
||||
/* gids compose part of a credential; there may not be more than 16 of them */
|
||||
#define NGRPS 16
|
||||
|
||||
/*
|
||||
* Unix style credentials.
|
||||
*/
|
||||
struct authunix_parms {
|
||||
u_long aup_time;
|
||||
char *aup_machname;
|
||||
int aup_uid;
|
||||
int aup_gid;
|
||||
u_int aup_len;
|
||||
int *aup_gids;
|
||||
};
|
||||
|
||||
__BEGIN_DECLS
|
||||
extern bool_t xdr_authunix_parms(XDR *, struct authunix_parms *);
|
||||
__END_DECLS
|
||||
|
||||
/*
|
||||
* If a response verifier has flavor AUTH_SHORT,
|
||||
* then the body of the response verifier encapsulates the following structure;
|
||||
* again it is serialized in the obvious fashion.
|
||||
*/
|
||||
struct short_hand_verf {
|
||||
struct opaque_auth new_cred;
|
||||
};
|
||||
|
||||
#endif /* !_RPC_AUTH_UNIX_H_ */
|
||||
|
|
@ -1,537 +0,0 @@
|
|||
/* $NetBSD: clnt.h,v 1.22 2014/06/06 14:31:24 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
* unrestricted use provided that this legend is included on all tape
|
||||
* media and as a part of the software program in whole or part. Users
|
||||
* may copy or modify Sun RPC without charge, but are not authorized
|
||||
* to license or distribute it to anyone else except as part of a product or
|
||||
* program developed by the user.
|
||||
*
|
||||
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
||||
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
|
||||
*
|
||||
* Sun RPC is provided with no support and without any obligation on the
|
||||
* part of Sun Microsystems, Inc. to assist in its use, correction,
|
||||
* modification or enhancement.
|
||||
*
|
||||
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
|
||||
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
|
||||
* OR ANY PART THEREOF.
|
||||
*
|
||||
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
|
||||
* or profits or other special, indirect and consequential damages, even if
|
||||
* Sun has been advised of the possibility of such damages.
|
||||
*
|
||||
* Sun Microsystems, Inc.
|
||||
* 2550 Garcia Avenue
|
||||
* Mountain View, California 94043
|
||||
*
|
||||
* from: @(#)clnt.h 1.31 94/04/29 SMI
|
||||
* @(#)clnt.h 2.1 88/07/29 4.0 RPCSRC
|
||||
*/
|
||||
|
||||
/*
|
||||
* clnt.h - Client side remote procedure call interface.
|
||||
*
|
||||
* Copyright (C) 1984, Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#ifndef _RPC_CLNT_H_
|
||||
#define _RPC_CLNT_H_
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#include <rpc/rpc_com.h>
|
||||
|
||||
/*
|
||||
* Well-known IPV6 RPC broadcast address.
|
||||
*/
|
||||
#define RPCB_MULTICAST_ADDR "ff02::202"
|
||||
|
||||
/*
|
||||
* Rpc calls return an enum clnt_stat. This should be looked at more,
|
||||
* since each implementation is required to live with this (implementation
|
||||
* independent) list of errors.
|
||||
*/
|
||||
enum clnt_stat {
|
||||
RPC_SUCCESS=0, /* call succeeded */
|
||||
/*
|
||||
* local errors
|
||||
*/
|
||||
RPC_CANTENCODEARGS=1, /* can't encode arguments */
|
||||
RPC_CANTDECODERES=2, /* can't decode results */
|
||||
RPC_CANTSEND=3, /* failure in sending call */
|
||||
RPC_CANTRECV=4, /* failure in receiving result */
|
||||
RPC_TIMEDOUT=5, /* call timed out */
|
||||
/*
|
||||
* remote errors
|
||||
*/
|
||||
RPC_VERSMISMATCH=6, /* rpc versions not compatible */
|
||||
RPC_AUTHERROR=7, /* authentication error */
|
||||
RPC_PROGUNAVAIL=8, /* program not available */
|
||||
RPC_PROGVERSMISMATCH=9, /* program version mismatched */
|
||||
RPC_PROCUNAVAIL=10, /* procedure unavailable */
|
||||
RPC_CANTDECODEARGS=11, /* decode arguments error */
|
||||
RPC_SYSTEMERROR=12, /* generic "other problem" */
|
||||
|
||||
/*
|
||||
* rpc_call & clnt_create errors
|
||||
*/
|
||||
RPC_UNKNOWNHOST=13, /* unknown host name */
|
||||
RPC_UNKNOWNPROTO=17, /* unknown protocol */
|
||||
RPC_UNKNOWNADDR = 19, /* Remote address unknown */
|
||||
RPC_NOBROADCAST = 21, /* Broadcasting not supported */
|
||||
|
||||
/*
|
||||
* rpcbind errors
|
||||
*/
|
||||
RPC_RPCBFAILURE=14, /* the pmapper failed in its call */
|
||||
#define RPC_PMAPFAILURE RPC_RPCBFAILURE
|
||||
RPC_PROGNOTREGISTERED=15, /* remote program is not registered */
|
||||
RPC_N2AXLATEFAILURE = 22, /* name -> addr translation failed */
|
||||
|
||||
/*
|
||||
* Misc error in the TLI library (provided for compatibility)
|
||||
*/
|
||||
RPC_TLIERROR = 20,
|
||||
|
||||
/*
|
||||
* unspecified error
|
||||
*/
|
||||
RPC_FAILED=16,
|
||||
|
||||
/*
|
||||
* asynchronous errors
|
||||
*/
|
||||
RPC_INPROGRESS = 24,
|
||||
RPC_STALERACHANDLE = 25
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Error info.
|
||||
*/
|
||||
struct rpc_err {
|
||||
enum clnt_stat re_status;
|
||||
union {
|
||||
int RE_errno; /* related system error */
|
||||
enum auth_stat RE_why; /* why the auth error occurred */
|
||||
struct {
|
||||
rpcvers_t low; /* lowest version supported */
|
||||
rpcvers_t high; /* highest version supported */
|
||||
} RE_vers;
|
||||
struct { /* maybe meaningful if RPC_FAILED */
|
||||
int32_t s1;
|
||||
int32_t s2;
|
||||
} RE_lb; /* life boot & debugging only */
|
||||
} ru;
|
||||
#define re_errno ru.RE_errno
|
||||
#define re_why ru.RE_why
|
||||
#define re_vers ru.RE_vers
|
||||
#define re_lb ru.RE_lb
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Client rpc handle.
|
||||
* Created by individual implementations
|
||||
* Client is responsible for initializing auth, see e.g. auth_none.c.
|
||||
*/
|
||||
typedef struct __rpc_client {
|
||||
AUTH *cl_auth; /* authenticator */
|
||||
const struct clnt_ops {
|
||||
/* call remote procedure */
|
||||
enum clnt_stat (*cl_call)(struct __rpc_client *,
|
||||
rpcproc_t, xdrproc_t, const char *,
|
||||
xdrproc_t, caddr_t, struct timeval);
|
||||
/* abort a call */
|
||||
void (*cl_abort)(struct __rpc_client *);
|
||||
/* get specific error code */
|
||||
void (*cl_geterr)(struct __rpc_client *,
|
||||
struct rpc_err *);
|
||||
/* frees results */
|
||||
bool_t (*cl_freeres)(struct __rpc_client *,
|
||||
xdrproc_t, caddr_t);
|
||||
/* destroy this structure */
|
||||
void (*cl_destroy)(struct __rpc_client *);
|
||||
/* the ioctl() of rpc */
|
||||
bool_t (*cl_control)(struct __rpc_client *, u_int,
|
||||
char *);
|
||||
} *cl_ops;
|
||||
void *cl_private; /* private stuff */
|
||||
char *cl_netid; /* network token */
|
||||
char *cl_tp; /* device name */
|
||||
} CLIENT;
|
||||
|
||||
|
||||
/*
|
||||
* Timers used for the pseudo-transport protocol when using datagrams
|
||||
*/
|
||||
struct rpc_timers {
|
||||
u_short rt_srtt; /* smoothed round-trip time */
|
||||
u_short rt_deviate; /* estimated deviation */
|
||||
u_long rt_rtxcur; /* current (backed-off) rto */
|
||||
};
|
||||
|
||||
/*
|
||||
* Feedback values used for possible congestion and rate control
|
||||
*/
|
||||
#define FEEDBACK_REXMIT1 1 /* first retransmit */
|
||||
#define FEEDBACK_OK 2 /* no retransmits */
|
||||
|
||||
/* Used to set version of portmapper used in broadcast */
|
||||
|
||||
#define CLCR_SET_LOWVERS 3
|
||||
#define CLCR_GET_LOWVERS 4
|
||||
|
||||
#define RPCSMALLMSGSIZE 400 /* a more reasonable packet size */
|
||||
|
||||
/*
|
||||
* client side rpc interface ops
|
||||
*
|
||||
* Parameter types are:
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* enum clnt_stat
|
||||
* CLNT_CALL(rh, proc, xargs, argsp, xres, resp, timeout)
|
||||
* CLIENT *rh;
|
||||
* rpcproc_t proc;
|
||||
* xdrproc_t xargs;
|
||||
* caddr_t argsp;
|
||||
* xdrproc_t xres;
|
||||
* caddr_t resp;
|
||||
* struct timeval timeout;
|
||||
*/
|
||||
#define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs) \
|
||||
((*(rh)->cl_ops->cl_call)(rh, proc, (xdrproc_t)xargs, \
|
||||
(const char *)(const void *)(argsp), (xdrproc_t)xres, \
|
||||
(caddr_t)(void *)resp, secs))
|
||||
#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \
|
||||
((*(rh)->cl_ops->cl_call)(rh, proc, (xdrproc_t)xargs, \
|
||||
(const char *)(const void *)(argsp), (xdrproc_t)xres, \
|
||||
(caddr_t)(void *)resp, secs))
|
||||
|
||||
/*
|
||||
* void
|
||||
* CLNT_ABORT(rh);
|
||||
* CLIENT *rh;
|
||||
*/
|
||||
#define CLNT_ABORT(rh) ((*(rh)->cl_ops->cl_abort)(rh))
|
||||
#define clnt_abort(rh) ((*(rh)->cl_ops->cl_abort)(rh))
|
||||
|
||||
/*
|
||||
* struct rpc_err
|
||||
* CLNT_GETERR(rh);
|
||||
* CLIENT *rh;
|
||||
*/
|
||||
#define CLNT_GETERR(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp))
|
||||
#define clnt_geterr(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp))
|
||||
|
||||
|
||||
/*
|
||||
* bool_t
|
||||
* CLNT_FREERES(rh, xres, resp);
|
||||
* CLIENT *rh;
|
||||
* xdrproc_t xres;
|
||||
* caddr_t resp;
|
||||
*/
|
||||
#define CLNT_FREERES(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
|
||||
#define clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
|
||||
|
||||
/*
|
||||
* bool_t
|
||||
* CLNT_CONTROL(cl, request, info)
|
||||
* CLIENT *cl;
|
||||
* u_int request;
|
||||
* char *info;
|
||||
*/
|
||||
#define CLNT_CONTROL(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in))
|
||||
#define clnt_control(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in))
|
||||
|
||||
/*
|
||||
* control operations that apply to both udp and tcp transports
|
||||
*/
|
||||
#define CLSET_TIMEOUT 1 /* set timeout (timeval) */
|
||||
#define CLGET_TIMEOUT 2 /* get timeout (timeval) */
|
||||
#define CLGET_SERVER_ADDR 3 /* get server's address (sockaddr) */
|
||||
#define CLGET_FD 6 /* get connections file descriptor */
|
||||
#define CLGET_SVC_ADDR 7 /* get server's address (netbuf) */
|
||||
#define CLSET_FD_CLOSE 8 /* close fd while clnt_destroy */
|
||||
#define CLSET_FD_NCLOSE 9 /* Do not close fd while clnt_destroy */
|
||||
#define CLGET_XID 10 /* Get xid */
|
||||
#define CLSET_XID 11 /* Set xid */
|
||||
#define CLGET_VERS 12 /* Get version number */
|
||||
#define CLSET_VERS 13 /* Set version number */
|
||||
#define CLGET_PROG 14 /* Get program number */
|
||||
#define CLSET_PROG 15 /* Set program number */
|
||||
#define CLSET_SVC_ADDR 16 /* get server's address (netbuf) */
|
||||
#define CLSET_PUSH_TIMOD 17 /* push timod if not already present */
|
||||
#define CLSET_POP_TIMOD 18 /* pop timod */
|
||||
/*
|
||||
* Connectionless only control operations
|
||||
*/
|
||||
#define CLSET_RETRY_TIMEOUT 4 /* set retry timeout (timeval) */
|
||||
#define CLGET_RETRY_TIMEOUT 5 /* get retry timeout (timeval) */
|
||||
|
||||
/*
|
||||
* void
|
||||
* CLNT_DESTROY(rh);
|
||||
* CLIENT *rh;
|
||||
*/
|
||||
#define CLNT_DESTROY(rh) ((*(rh)->cl_ops->cl_destroy)(rh))
|
||||
#define clnt_destroy(rh) ((*(rh)->cl_ops->cl_destroy)(rh))
|
||||
|
||||
|
||||
/*
|
||||
* RPCTEST is a test program which is accessible on every rpc
|
||||
* transport/port. It is used for testing, performance evaluation,
|
||||
* and network administration.
|
||||
*/
|
||||
|
||||
#define RPCTEST_PROGRAM ((rpcprog_t)1)
|
||||
#define RPCTEST_VERSION ((rpcvers_t)1)
|
||||
#define RPCTEST_NULL_PROC ((rpcproc_t)2)
|
||||
#define RPCTEST_NULL_BATCH_PROC ((rpcproc_t)3)
|
||||
|
||||
/*
|
||||
* By convention, procedure 0 takes null arguments and returns them
|
||||
*/
|
||||
|
||||
#define NULLPROC ((rpcproc_t)0)
|
||||
|
||||
/*
|
||||
* Below are the client handle creation routines for the various
|
||||
* implementations of client side rpc. They can return NULL if a
|
||||
* creation failure occurs.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Generic client creation routine. Supported protocols are those that
|
||||
* belong to the nettype namespace (/etc/netconfig).
|
||||
* CLIENT *
|
||||
* clnt_create(host, prog, vers, prot);
|
||||
* const char *host; -- hostname
|
||||
* const rpcprog_t prog; -- program number
|
||||
* const rpcvers_t vers; -- version number
|
||||
* const char *prot; -- protocol
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern CLIENT *clnt_create(const char *, const rpcprog_t, const rpcvers_t,
|
||||
const char *);
|
||||
/*
|
||||
*
|
||||
* const char *hostname; -- hostname
|
||||
* const rpcprog_t prog; -- program number
|
||||
* const rpcvers_t vers; -- version number
|
||||
* const char *nettype; -- network type
|
||||
*/
|
||||
|
||||
/*
|
||||
* Generic client creation routine. Supported protocols are which belong
|
||||
* to the nettype name space.
|
||||
*/
|
||||
extern CLIENT *clnt_create_vers(const char *, const rpcprog_t, rpcvers_t *,
|
||||
const rpcvers_t, const rpcvers_t,
|
||||
const char *);
|
||||
/*
|
||||
* const char *host; -- hostname
|
||||
* const rpcprog_t prog; -- program number
|
||||
* rpcvers_t *vers_out; -- servers highest available version
|
||||
* const rpcvers_t vers_low; -- low version number
|
||||
* const rpcvers_t vers_high; -- high version number
|
||||
* const char *nettype; -- network type
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Generic client creation routine. It takes a netconfig structure
|
||||
* instead of nettype
|
||||
*/
|
||||
extern CLIENT *clnt_tp_create(const char *, const rpcprog_t,
|
||||
const rpcvers_t, const struct netconfig *);
|
||||
/*
|
||||
* const char *hostname; -- hostname
|
||||
* const rpcprog_t prog; -- program number
|
||||
* const rpcvers_t vers; -- version number
|
||||
* const struct netconfig *netconf; -- network config structure
|
||||
*/
|
||||
|
||||
/*
|
||||
* Generic TLI create routine. Only provided for compatibility.
|
||||
*/
|
||||
|
||||
extern CLIENT *clnt_tli_create(const int, const struct netconfig *,
|
||||
const struct netbuf *, const rpcprog_t,
|
||||
const rpcvers_t, const u_int, const u_int);
|
||||
/*
|
||||
* const register int fd; -- fd
|
||||
* const struct netconfig *nconf; -- netconfig structure
|
||||
* const struct netbuf *svcaddr; -- servers address
|
||||
* const u_long prog; -- program number
|
||||
* const u_long vers; -- version number
|
||||
* const u_int sendsz; -- send size
|
||||
* const u_int recvsz; -- recv size
|
||||
*/
|
||||
|
||||
/*
|
||||
* Low level clnt create routine for connectionful transports, e.g. tcp.
|
||||
*/
|
||||
extern CLIENT *clnt_vc_create(const int, const struct netbuf *,
|
||||
const rpcprog_t, const rpcvers_t,
|
||||
const u_int, const u_int);
|
||||
/*
|
||||
* const int fd; -- open file descriptor
|
||||
* const struct netbuf *svcaddr; -- servers address
|
||||
* const rpcprog_t prog; -- program number
|
||||
* const rpcvers_t vers; -- version number
|
||||
* const u_int sendsz; -- buffer recv size
|
||||
* const u_int recvsz; -- buffer send size
|
||||
*/
|
||||
|
||||
/*
|
||||
* Low level clnt create routine for connectionless transports, e.g. udp.
|
||||
*/
|
||||
extern CLIENT *clnt_dg_create(const int, const struct netbuf *,
|
||||
const rpcprog_t, const rpcvers_t,
|
||||
const u_int, const u_int);
|
||||
/*
|
||||
* const int fd; -- open file descriptor
|
||||
* const struct netbuf *svcaddr; -- servers address
|
||||
* const rpcprog_t program; -- program number
|
||||
* const rpcvers_t version; -- version number
|
||||
* const u_int sendsz; -- buffer recv size
|
||||
* const u_int recvsz; -- buffer send size
|
||||
*/
|
||||
|
||||
/*
|
||||
* Memory based rpc (for speed check and testing)
|
||||
* CLIENT *
|
||||
* clnt_raw_create(prog, vers)
|
||||
* u_long prog;
|
||||
* u_long vers;
|
||||
*/
|
||||
extern CLIENT *clnt_raw_create (rpcprog_t, rpcvers_t);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
||||
/*
|
||||
* Print why creation failed
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern void clnt_pcreateerror (const char *); /* stderr */
|
||||
extern char *clnt_spcreateerror (const char *); /* string */
|
||||
__END_DECLS
|
||||
|
||||
/*
|
||||
* Like clnt_perror(), but is more verbose in its output
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern void clnt_perrno (enum clnt_stat); /* stderr */
|
||||
extern char *clnt_sperrno (enum clnt_stat); /* string */
|
||||
__END_DECLS
|
||||
|
||||
/*
|
||||
* Print an English error message, given the client error code
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern void clnt_perror (CLIENT *, const char *); /* stderr */
|
||||
extern char *clnt_sperror (CLIENT *, const char *); /* string */
|
||||
__END_DECLS
|
||||
|
||||
|
||||
/*
|
||||
* If a creation fails, the following allows the user to figure out why.
|
||||
*/
|
||||
struct rpc_createerr {
|
||||
enum clnt_stat cf_stat;
|
||||
struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */
|
||||
};
|
||||
|
||||
__BEGIN_DECLS
|
||||
extern struct rpc_createerr *__rpc_createerr(void);
|
||||
__END_DECLS
|
||||
#define rpc_createerr (*(__rpc_createerr()))
|
||||
|
||||
/*
|
||||
* The simplified interface:
|
||||
* enum clnt_stat
|
||||
* rpc_call(host, prognum, versnum, procnum, inproc, in, outproc, out, nettype)
|
||||
* const char *host;
|
||||
* const rpcprog_t prognum;
|
||||
* const rpcvers_t versnum;
|
||||
* const rpcproc_t procnum;
|
||||
* const xdrproc_t inproc, outproc;
|
||||
* const char *in;
|
||||
* char *out;
|
||||
* const char *nettype;
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern enum clnt_stat rpc_call(const char *, const rpcprog_t,
|
||||
const rpcvers_t, const rpcproc_t,
|
||||
const xdrproc_t, const char *,
|
||||
const xdrproc_t, char *, const char *);
|
||||
__END_DECLS
|
||||
|
||||
/*
|
||||
* RPC broadcast interface
|
||||
* The call is broadcasted to all locally connected nets.
|
||||
*
|
||||
* extern enum clnt_stat
|
||||
* rpc_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp,
|
||||
* eachresult, nettype)
|
||||
* const rpcprog_t prog; -- program number
|
||||
* const rpcvers_t vers; -- version number
|
||||
* const rpcproc_t proc; -- procedure number
|
||||
* const xdrproc_t xargs; -- xdr routine for args
|
||||
* caddr_t argsp; -- pointer to args
|
||||
* const xdrproc_t xresults; -- xdr routine for results
|
||||
* caddr_t resultsp; -- pointer to results
|
||||
* const resultproc_t eachresult; -- call with each result
|
||||
* const char *nettype; -- Transport type
|
||||
*
|
||||
* For each valid response received, the procedure eachresult is called.
|
||||
* Its form is:
|
||||
* done = eachresult(resp, raddr, nconf)
|
||||
* bool_t done;
|
||||
* caddr_t resp;
|
||||
* struct netbuf *raddr;
|
||||
* struct netconfig *nconf;
|
||||
* where resp points to the results of the call and raddr is the
|
||||
* address if the responder to the broadcast. nconf is the transport
|
||||
* on which the response was received.
|
||||
*
|
||||
* extern enum clnt_stat
|
||||
* rpc_broadcast_exp(prog, vers, proc, xargs, argsp, xresults, resultsp,
|
||||
* eachresult, inittime, waittime, nettype)
|
||||
* const rpcprog_t prog; -- program number
|
||||
* const rpcvers_t vers; -- version number
|
||||
* const rpcproc_t proc; -- procedure number
|
||||
* const xdrproc_t xargs; -- xdr routine for args
|
||||
* caddr_t argsp; -- pointer to args
|
||||
* const xdrproc_t xresults; -- xdr routine for results
|
||||
* caddr_t resultsp; -- pointer to results
|
||||
* const resultproc_t eachresult; -- call with each result
|
||||
* const int inittime; -- how long to wait initially
|
||||
* const int waittime; -- maximum time to wait
|
||||
* const char *nettype; -- Transport type
|
||||
*/
|
||||
|
||||
typedef bool_t (*resultproc_t)(caddr_t, ...);
|
||||
|
||||
__BEGIN_DECLS
|
||||
extern enum clnt_stat rpc_broadcast(const rpcprog_t, const rpcvers_t,
|
||||
const rpcproc_t, const xdrproc_t, const char *, const xdrproc_t, caddr_t,
|
||||
const resultproc_t, const char *);
|
||||
extern enum clnt_stat rpc_broadcast_exp(const rpcprog_t, const rpcvers_t,
|
||||
const rpcproc_t, const xdrproc_t, const char *, const xdrproc_t, caddr_t,
|
||||
const resultproc_t, const int, const int, const char *);
|
||||
__END_DECLS
|
||||
|
||||
/* For backward compatibility */
|
||||
#include <rpc/clnt_soc.h>
|
||||
|
||||
#endif /* !_RPC_CLNT_H_ */
|
||||
|
|
@ -1,117 +0,0 @@
|
|||
/* $NetBSD: clnt_soc.h,v 1.3 2005/02/06 04:40:51 perry Exp $ */
|
||||
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
* unrestricted use provided that this legend is included on all tape
|
||||
* media and as a part of the software program in whole or part. Users
|
||||
* may copy or modify Sun RPC without charge, but are not authorized
|
||||
* to license or distribute it to anyone else except as part of a product or
|
||||
* program developed by the user.
|
||||
*
|
||||
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
||||
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
|
||||
*
|
||||
* Sun RPC is provided with no support and without any obligation on the
|
||||
* part of Sun Microsystems, Inc. to assist in its use, correction,
|
||||
* modification or enhancement.
|
||||
*
|
||||
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
|
||||
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
|
||||
* OR ANY PART THEREOF.
|
||||
*
|
||||
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
|
||||
* or profits or other special, indirect and consequential damages, even if
|
||||
* Sun has been advised of the possibility of such damages.
|
||||
*
|
||||
* Sun Microsystems, Inc.
|
||||
* 2550 Garcia Avenue
|
||||
* Mountain View, California 94043
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 1984 - 1991 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
/*
|
||||
* clnt.h - Client side remote procedure call interface.
|
||||
*/
|
||||
|
||||
#ifndef _RPC_CLNT_SOC_H
|
||||
#define _RPC_CLNT_SOC_H
|
||||
|
||||
/* derived from clnt_soc.h 1.3 88/12/17 SMI */
|
||||
|
||||
/*
|
||||
* All the following declarations are only for backward compatibility
|
||||
* with TS-RPC.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#define UDPMSGSIZE 8800 /* rpc imposed limit on udp msg size */
|
||||
|
||||
/*
|
||||
* TCP based rpc
|
||||
* CLIENT *
|
||||
* clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
|
||||
* struct sockaddr_in *raddr;
|
||||
* u_long prog;
|
||||
* u_long version;
|
||||
* int *sockp;
|
||||
* u_int sendsz;
|
||||
* u_int recvsz;
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern CLIENT *clnttcp_create(struct sockaddr_in *,
|
||||
u_long,
|
||||
u_long,
|
||||
int *,
|
||||
u_int,
|
||||
u_int);
|
||||
__END_DECLS
|
||||
|
||||
/*
|
||||
* Raw (memory) rpc.
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern CLIENT *clntraw_create (u_long, u_long);
|
||||
__END_DECLS
|
||||
|
||||
|
||||
/*
|
||||
* UDP based rpc.
|
||||
* CLIENT *
|
||||
* clntudp_create(raddr, program, version, wait, sockp)
|
||||
* struct sockaddr_in *raddr;
|
||||
* u_long program;
|
||||
* u_long version;
|
||||
* struct timeval wait;
|
||||
* int *sockp;
|
||||
*
|
||||
* Same as above, but you specify max packet sizes.
|
||||
* CLIENT *
|
||||
* clntudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz)
|
||||
* struct sockaddr_in *raddr;
|
||||
* u_long program;
|
||||
* u_long version;
|
||||
* struct timeval wait;
|
||||
* int *sockp;
|
||||
* u_int sendsz;
|
||||
* u_int recvsz;
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern CLIENT *clntudp_create(struct sockaddr_in *,
|
||||
u_long,
|
||||
u_long,
|
||||
struct timeval,
|
||||
int *);
|
||||
extern CLIENT *clntudp_bufcreate(struct sockaddr_in *,
|
||||
u_long,
|
||||
u_long,
|
||||
struct timeval,
|
||||
int *,
|
||||
u_int,
|
||||
u_int);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _RPC_CLNT_SOC_H */
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
/* $NetBSD: nettype.h,v 1.3 2005/02/03 04:39:32 perry Exp $ */
|
||||
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
* unrestricted use provided that this legend is included on all tape
|
||||
* media and as a part of the software program in whole or part. Users
|
||||
* may copy or modify Sun RPC without charge, but are not authorized
|
||||
* to license or distribute it to anyone else except as part of a product or
|
||||
* program developed by the user.
|
||||
*
|
||||
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
||||
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
|
||||
*
|
||||
* Sun RPC is provided with no support and without any obligation on the
|
||||
* part of Sun Microsystems, Inc. to assist in its use, correction,
|
||||
* modification or enhancement.
|
||||
*
|
||||
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
|
||||
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
|
||||
* OR ANY PART THEREOF.
|
||||
*
|
||||
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
|
||||
* or profits or other special, indirect and consequential damages, even if
|
||||
* Sun has been advised of the possibility of such damages.
|
||||
*
|
||||
* Sun Microsystems, Inc.
|
||||
* 2550 Garcia Avenue
|
||||
* Mountain View, California 94043
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 1986 - 1991 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
/*
|
||||
* nettype.h, Nettype definitions.
|
||||
* All for the topmost layer of rpc
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _RPC_NETTYPE_H
|
||||
#define _RPC_NETTYPE_H
|
||||
|
||||
#include <netconfig.h>
|
||||
|
||||
#define _RPC_NONE 0
|
||||
#define _RPC_NETPATH 1
|
||||
#define _RPC_VISIBLE 2
|
||||
#define _RPC_CIRCUIT_V 3
|
||||
#define _RPC_DATAGRAM_V 4
|
||||
#define _RPC_CIRCUIT_N 5
|
||||
#define _RPC_DATAGRAM_N 6
|
||||
#define _RPC_TCP 7
|
||||
#define _RPC_UDP 8
|
||||
|
||||
__BEGIN_DECLS
|
||||
extern void *__rpc_setconf(const char *);
|
||||
extern void __rpc_endconf(void *);
|
||||
extern struct netconfig *__rpc_getconf(void *);
|
||||
extern struct netconfig *__rpc_getconfip(const char *);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_RPC_NETTYPE_H */
|
||||
|
|
@ -1,88 +0,0 @@
|
|||
/* $NetBSD: pmap_clnt.h,v 1.11 2009/01/11 03:04:12 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
* unrestricted use provided that this legend is included on all tape
|
||||
* media and as a part of the software program in whole or part. Users
|
||||
* may copy or modify Sun RPC without charge, but are not authorized
|
||||
* to license or distribute it to anyone else except as part of a product or
|
||||
* program developed by the user.
|
||||
*
|
||||
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
||||
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
|
||||
*
|
||||
* Sun RPC is provided with no support and without any obligation on the
|
||||
* part of Sun Microsystems, Inc. to assist in its use, correction,
|
||||
* modification or enhancement.
|
||||
*
|
||||
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
|
||||
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
|
||||
* OR ANY PART THEREOF.
|
||||
*
|
||||
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
|
||||
* or profits or other special, indirect and consequential damages, even if
|
||||
* Sun has been advised of the possibility of such damages.
|
||||
*
|
||||
* Sun Microsystems, Inc.
|
||||
* 2550 Garcia Avenue
|
||||
* Mountain View, California 94043
|
||||
*
|
||||
* from: @(#)pmap_clnt.h 1.11 88/02/08 SMI
|
||||
* @(#)pmap_clnt.h 2.1 88/07/29 4.0 RPCSRC
|
||||
*/
|
||||
|
||||
/*
|
||||
* pmap_clnt.h
|
||||
* Supplies C routines to get to portmap services.
|
||||
*
|
||||
* Copyright (C) 1984, Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Usage:
|
||||
* success = pmap_set(program, version, protocol, port);
|
||||
* success = pmap_unset(program, version);
|
||||
* port = pmap_getport(address, program, version, protocol);
|
||||
* head = pmap_getmaps(address);
|
||||
* clnt_stat = pmap_rmtcall(address, program, version, procedure,
|
||||
* xdrargs, argsp, xdrres, resp, tout, port_ptr)
|
||||
* (works for udp only.)
|
||||
* clnt_stat = clnt_broadcast(program, version, procedure,
|
||||
* xdrargs, argsp, xdrres, resp, eachresult)
|
||||
* (like pmap_rmtcall, except the call is broadcasted to all
|
||||
* locally connected nets. For each valid response received,
|
||||
* the procedure eachresult is called. Its form is:
|
||||
* done = eachresult(resp, raddr)
|
||||
* bool_t done;
|
||||
* caddr_t resp;
|
||||
* struct sockaddr_in raddr;
|
||||
* where resp points to the results of the call and raddr is the
|
||||
* address if the responder to the broadcast.
|
||||
*/
|
||||
|
||||
#ifndef _RPC_PMAP_CLNT_H_
|
||||
#define _RPC_PMAP_CLNT_H_
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
extern bool_t pmap_set(u_long, u_long, int, int);
|
||||
extern bool_t pmap_unset(u_long, u_long);
|
||||
extern struct pmaplist *pmap_getmaps(struct sockaddr_in *);
|
||||
#ifndef __LIBC12_SOURCE__
|
||||
extern enum clnt_stat pmap_rmtcall(struct sockaddr_in *,
|
||||
u_long, u_long, u_long,
|
||||
xdrproc_t, caddr_t,
|
||||
xdrproc_t, caddr_t,
|
||||
struct timeval, u_long *)
|
||||
__RENAME(__pmap_rmtcall50);
|
||||
#endif
|
||||
extern enum clnt_stat clnt_broadcast(u_long, u_long, u_long,
|
||||
xdrproc_t, char *,
|
||||
xdrproc_t, char *,
|
||||
resultproc_t);
|
||||
extern u_short pmap_getport(struct sockaddr_in *,
|
||||
u_long, u_long, u_int);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_RPC_PMAP_CLNT_H_ */
|
||||
|
|
@ -1,106 +0,0 @@
|
|||
/* $NetBSD: pmap_prot.h,v 1.9 2005/02/03 04:39:32 perry Exp $ */
|
||||
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
* unrestricted use provided that this legend is included on all tape
|
||||
* media and as a part of the software program in whole or part. Users
|
||||
* may copy or modify Sun RPC without charge, but are not authorized
|
||||
* to license or distribute it to anyone else except as part of a product or
|
||||
* program developed by the user.
|
||||
*
|
||||
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
||||
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
|
||||
*
|
||||
* Sun RPC is provided with no support and without any obligation on the
|
||||
* part of Sun Microsystems, Inc. to assist in its use, correction,
|
||||
* modification or enhancement.
|
||||
*
|
||||
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
|
||||
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
|
||||
* OR ANY PART THEREOF.
|
||||
*
|
||||
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
|
||||
* or profits or other special, indirect and consequential damages, even if
|
||||
* Sun has been advised of the possibility of such damages.
|
||||
*
|
||||
* Sun Microsystems, Inc.
|
||||
* 2550 Garcia Avenue
|
||||
* Mountain View, California 94043
|
||||
*
|
||||
* from: @(#)pmap_prot.h 1.14 88/02/08 SMI
|
||||
* @(#)pmap_prot.h 2.1 88/07/29 4.0 RPCSRC
|
||||
*/
|
||||
|
||||
/*
|
||||
* pmap_prot.h
|
||||
* Protocol for the local binder service, or pmap.
|
||||
*
|
||||
* Copyright (C) 1984, Sun Microsystems, Inc.
|
||||
*
|
||||
* The following procedures are supported by the protocol:
|
||||
*
|
||||
* PMAPPROC_NULL() returns ()
|
||||
* takes nothing, returns nothing
|
||||
*
|
||||
* PMAPPROC_SET(struct pmap) returns (bool_t)
|
||||
* TRUE is success, FALSE is failure. Registers the tuple
|
||||
* [prog, vers, prot, port].
|
||||
*
|
||||
* PMAPPROC_UNSET(struct pmap) returns (bool_t)
|
||||
* TRUE is success, FALSE is failure. Un-registers pair
|
||||
* [prog, vers]. prot and port are ignored.
|
||||
*
|
||||
* PMAPPROC_GETPORT(struct pmap) returns (long unsigned).
|
||||
* 0 is failure. Otherwise returns the port number where the pair
|
||||
* [prog, vers] is registered. It may lie!
|
||||
*
|
||||
* PMAPPROC_DUMP() RETURNS (struct pmaplist *)
|
||||
*
|
||||
* PMAPPROC_CALLIT(unsigned, unsigned, unsigned, string<>)
|
||||
* RETURNS (port, string<>);
|
||||
* usage: encapsulatedresults = PMAPPROC_CALLIT(prog, vers, proc, encapsulatedargs);
|
||||
* Calls the procedure on the local machine. If it is not registered,
|
||||
* this procedure is quite; ie it does not return error information!!!
|
||||
* This procedure only is supported on rpc/udp and calls via
|
||||
* rpc/udp. This routine only passes null authentication parameters.
|
||||
* This file has no interface to xdr routines for PMAPPROC_CALLIT.
|
||||
*
|
||||
* The service supports remote procedure calls on udp/ip or tcp/ip socket 111.
|
||||
*/
|
||||
|
||||
#ifndef _RPC_PMAP_PROT_H_
|
||||
#define _RPC_PMAP_PROT_H_
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#define PMAPPORT ((u_short)111)
|
||||
#define PMAPPROG ((u_long)100000)
|
||||
#define PMAPVERS ((u_long)2)
|
||||
#define PMAPVERS_PROTO ((u_long)2)
|
||||
#define PMAPVERS_ORIG ((u_long)1)
|
||||
#define PMAPPROC_NULL ((u_long)0)
|
||||
#define PMAPPROC_SET ((u_long)1)
|
||||
#define PMAPPROC_UNSET ((u_long)2)
|
||||
#define PMAPPROC_GETPORT ((u_long)3)
|
||||
#define PMAPPROC_DUMP ((u_long)4)
|
||||
#define PMAPPROC_CALLIT ((u_long)5)
|
||||
|
||||
struct pmap {
|
||||
long unsigned pm_prog;
|
||||
long unsigned pm_vers;
|
||||
long unsigned pm_prot;
|
||||
long unsigned pm_port;
|
||||
};
|
||||
|
||||
struct pmaplist {
|
||||
struct pmap pml_map;
|
||||
struct pmaplist *pml_next;
|
||||
};
|
||||
|
||||
__BEGIN_DECLS
|
||||
extern bool_t xdr_pmap (XDR *, struct pmap *);
|
||||
extern bool_t xdr_pmaplist (XDR *, struct pmaplist **);
|
||||
extern bool_t xdr_pmaplist_ptr (XDR *, struct pmaplist *);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_RPC_PMAP_PROT_H_ */
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
/* $NetBSD: pmap_rmt.h,v 1.9 2005/12/03 15:16:19 yamt Exp $ */
|
||||
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
* unrestricted use provided that this legend is included on all tape
|
||||
* media and as a part of the software program in whole or part. Users
|
||||
* may copy or modify Sun RPC without charge, but are not authorized
|
||||
* to license or distribute it to anyone else except as part of a product or
|
||||
* program developed by the user.
|
||||
*
|
||||
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
||||
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
|
||||
*
|
||||
* Sun RPC is provided with no support and without any obligation on the
|
||||
* part of Sun Microsystems, Inc. to assist in its use, correction,
|
||||
* modification or enhancement.
|
||||
*
|
||||
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
|
||||
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
|
||||
* OR ANY PART THEREOF.
|
||||
*
|
||||
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
|
||||
* or profits or other special, indirect and consequential damages, even if
|
||||
* Sun has been advised of the possibility of such damages.
|
||||
*
|
||||
* Sun Microsystems, Inc.
|
||||
* 2550 Garcia Avenue
|
||||
* Mountain View, California 94043
|
||||
*
|
||||
* from: @(#)pmap_rmt.h 1.2 88/02/08 SMI
|
||||
* @(#)pmap_rmt.h 2.1 88/07/29 4.0 RPCSRC
|
||||
*/
|
||||
|
||||
/*
|
||||
* Structures and XDR routines for parameters to and replies from
|
||||
* the portmapper remote-call-service.
|
||||
*
|
||||
* Copyright (C) 1986, Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#ifndef _RPC_PMAP_RMT_H_
|
||||
#define _RPC_PMAP_RMT_H_
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
struct rmtcallargs {
|
||||
u_long prog, vers, proc, arglen;
|
||||
const char *args_ptr;
|
||||
xdrproc_t xdr_args;
|
||||
};
|
||||
|
||||
struct rmtcallres {
|
||||
u_long *port_ptr;
|
||||
u_long resultslen;
|
||||
caddr_t results_ptr;
|
||||
xdrproc_t xdr_results;
|
||||
};
|
||||
|
||||
__BEGIN_DECLS
|
||||
extern bool_t xdr_rmtcall_args (XDR *, struct rmtcallargs *);
|
||||
extern bool_t xdr_rmtcallres (XDR *, struct rmtcallres *);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_RPC_PMAP_RMT_H_ */
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
/* $NetBSD: raw.h,v 1.1 2000/06/02 22:57:56 fvdl Exp $ */
|
||||
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
* unrestricted use provided that this legend is included on all tape
|
||||
* media and as a part of the software program in whole or part. Users
|
||||
* may copy or modify Sun RPC without charge, but are not authorized
|
||||
* to license or distribute it to anyone else except as part of a product or
|
||||
* program developed by the user.
|
||||
*
|
||||
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
||||
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
|
||||
*
|
||||
* Sun RPC is provided with no support and without any obligation on the
|
||||
* part of Sun Microsystems, Inc. to assist in its use, correction,
|
||||
* modification or enhancement.
|
||||
*
|
||||
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
|
||||
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
|
||||
* OR ANY PART THEREOF.
|
||||
*
|
||||
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
|
||||
* or profits or other special, indirect and consequential damages, even if
|
||||
* Sun has been advised of the possibility of such damages.
|
||||
*
|
||||
* Sun Microsystems, Inc.
|
||||
* 2550 Garcia Avenue
|
||||
* Mountain View, California 94043
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 1986 - 1991 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#ifndef _RPC_RAW_H
|
||||
#define _RPC_RAW_H
|
||||
|
||||
/* #pragma ident "@(#)raw.h 1.11 94/04/25 SMI" */
|
||||
/* @(#)raw.h 1.2 88/10/25 SMI */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* raw.h
|
||||
*
|
||||
* Raw interface
|
||||
* The common memory area over which they will communicate
|
||||
*/
|
||||
extern char *__rpc_rawcombuf;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _RPC_RAW_H */
|
||||
|
|
@ -1,108 +0,0 @@
|
|||
/* $NetBSD: rpc.h,v 1.15 2006/06/22 19:35:34 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
* unrestricted use provided that this legend is included on all tape
|
||||
* media and as a part of the software program in whole or part. Users
|
||||
* may copy or modify Sun RPC without charge, but are not authorized
|
||||
* to license or distribute it to anyone else except as part of a product or
|
||||
* program developed by the user.
|
||||
*
|
||||
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
||||
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
|
||||
*
|
||||
* Sun RPC is provided with no support and without any obligation on the
|
||||
* part of Sun Microsystems, Inc. to assist in its use, correction,
|
||||
* modification or enhancement.
|
||||
*
|
||||
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
|
||||
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
|
||||
* OR ANY PART THEREOF.
|
||||
*
|
||||
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
|
||||
* or profits or other special, indirect and consequential damages, even if
|
||||
* Sun has been advised of the possibility of such damages.
|
||||
*
|
||||
* Sun Microsystems, Inc.
|
||||
* 2550 Garcia Avenue
|
||||
* Mountain View, California 94043
|
||||
*
|
||||
* from: @(#)rpc.h 1.9 88/02/08 SMI
|
||||
* @(#)rpc.h 2.4 89/07/11 4.0 RPCSRC
|
||||
*/
|
||||
|
||||
/*
|
||||
* rpc.h, Just includes the billions of rpc header files necessary to
|
||||
* do remote procedure calling.
|
||||
*
|
||||
* Copyright (C) 1984, Sun Microsystems, Inc.
|
||||
*/
|
||||
#ifndef _RPC_RPC_H_
|
||||
#define _RPC_RPC_H_
|
||||
|
||||
#include <rpc/types.h> /* some typedefs */
|
||||
#include <netinet/in.h>
|
||||
|
||||
/* external data representation interfaces */
|
||||
#include <rpc/xdr.h> /* generic (de)serializer */
|
||||
|
||||
/* Client side only authentication */
|
||||
#include <rpc/auth.h> /* generic authenticator (client side) */
|
||||
|
||||
/* Client side (mostly) remote procedure call */
|
||||
#include <rpc/clnt.h> /* generic rpc stuff */
|
||||
|
||||
/* semi-private protocol headers */
|
||||
#include <rpc/rpc_msg.h> /* protocol for rpc messages */
|
||||
#include <rpc/auth_unix.h> /* protocol for unix style cred */
|
||||
/*
|
||||
* Uncomment-out the next line if you are building the rpc library with
|
||||
* DES Authentication (see the README file in the secure_rpc/ directory).
|
||||
*/
|
||||
#ifdef notdef
|
||||
#include <rpc/auth_des.h> /* protocol for des style cred */
|
||||
#endif
|
||||
|
||||
/* Server side only remote procedure callee */
|
||||
#include <rpc/svc.h> /* service manager and multiplexer */
|
||||
#include <rpc/svc_auth.h> /* service side authenticator */
|
||||
|
||||
/* Portmapper client, server, and protocol headers */
|
||||
#include <rpc/pmap_clnt.h>
|
||||
#include <rpc/pmap_prot.h>
|
||||
|
||||
#include <rpc/rpcb_clnt.h> /* rpcbind interface functions */
|
||||
|
||||
#include <rpc/rpcent.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
extern int get_myaddress(struct sockaddr_in *);
|
||||
extern int bindresvport(int, struct sockaddr_in *);
|
||||
extern int registerrpc(int, int, int, char *(*)(char [UDPMSGSIZE]),
|
||||
xdrproc_t, xdrproc_t);
|
||||
extern int callrpc(char *, int, int, int, xdrproc_t, char *,
|
||||
xdrproc_t , char *);
|
||||
extern int getrpcport(char *, int, int, int);
|
||||
|
||||
char *taddr2uaddr(const struct netconfig *, const struct netbuf *);
|
||||
struct netbuf *uaddr2taddr(const struct netconfig *, const char *);
|
||||
|
||||
struct sockaddr;
|
||||
extern int bindresvport_sa(int, struct sockaddr *);
|
||||
__END_DECLS
|
||||
|
||||
/*
|
||||
* The following are not exported interfaces, they are for internal library
|
||||
* and rpcbind use only. Do not use, they may change without notice.
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
int __rpc_nconf2fd(const struct netconfig *);
|
||||
int __rpc_nconf2sockinfo(const struct netconfig *,
|
||||
struct __rpc_sockinfo *);
|
||||
int __rpc_fd2sockinfo(int, struct __rpc_sockinfo *);
|
||||
int __rpc_setnodelay(int, const struct __rpc_sockinfo *);
|
||||
u_int __rpc_get_t_size(int, int, int);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_RPC_RPC_H_ */
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
/* $NetBSD: rpc_com.h,v 1.2 2005/02/03 04:39:32 perry Exp $ */
|
||||
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
* unrestricted use provided that this legend is included on all tape
|
||||
* media and as a part of the software program in whole or part. Users
|
||||
* may copy or modify Sun RPC without charge, but are not authorized
|
||||
* to license or distribute it to anyone else except as part of a product or
|
||||
* program developed by the user.
|
||||
*
|
||||
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
||||
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
|
||||
*
|
||||
* Sun RPC is provided with no support and without any obligation on the
|
||||
* part of Sun Microsystems, Inc. to assist in its use, correction,
|
||||
* modification or enhancement.
|
||||
*
|
||||
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
|
||||
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
|
||||
* OR ANY PART THEREOF.
|
||||
*
|
||||
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
|
||||
* or profits or other special, indirect and consequential damages, even if
|
||||
* Sun has been advised of the possibility of such damages.
|
||||
*
|
||||
* Sun Microsystems, Inc.
|
||||
* 2550 Garcia Avenue
|
||||
* Mountain View, California 94043
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 1986 - 1991 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
/*
|
||||
* rpc_com.h, Common definitions for both the server and client side.
|
||||
* All for the topmost layer of rpc
|
||||
*/
|
||||
|
||||
#ifndef _RPC_RPCCOM_H
|
||||
#define _RPC_RPCCOM_H
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
/* #pragma ident "@(#)rpc_com.h 1.11 93/07/05 SMI" */
|
||||
|
||||
/*
|
||||
* The max size of the transport, if the size cannot be determined
|
||||
* by other means.
|
||||
*/
|
||||
#define RPC_MAXDATASIZE 9000
|
||||
#define RPC_MAXADDRSIZE 1024
|
||||
|
||||
__BEGIN_DECLS
|
||||
bool_t rpc_control(int, void *);
|
||||
__END_DECLS
|
||||
|
||||
/*
|
||||
* Operations for rpc_control().
|
||||
*/
|
||||
#define RPC_SVC_CONNMAXREC_SET 0 /* set max rec size, enable nonblock */
|
||||
#define RPC_SVC_CONNMAXREC_GET 1
|
||||
|
||||
#endif /* _RPC_RPCCOM_H */
|
||||
|
|
@ -1,213 +0,0 @@
|
|||
/* $NetBSD: rpc_msg.h,v 1.15 2006/02/25 00:58:34 wiz Exp $ */
|
||||
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
* unrestricted use provided that this legend is included on all tape
|
||||
* media and as a part of the software program in whole or part. Users
|
||||
* may copy or modify Sun RPC without charge, but are not authorized
|
||||
* to license or distribute it to anyone else except as part of a product or
|
||||
* program developed by the user.
|
||||
*
|
||||
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
||||
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
|
||||
*
|
||||
* Sun RPC is provided with no support and without any obligation on the
|
||||
* part of Sun Microsystems, Inc. to assist in its use, correction,
|
||||
* modification or enhancement.
|
||||
*
|
||||
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
|
||||
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
|
||||
* OR ANY PART THEREOF.
|
||||
*
|
||||
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
|
||||
* or profits or other special, indirect and consequential damages, even if
|
||||
* Sun has been advised of the possibility of such damages.
|
||||
*
|
||||
* Sun Microsystems, Inc.
|
||||
* 2550 Garcia Avenue
|
||||
* Mountain View, California 94043
|
||||
*
|
||||
* from: @(#)rpc_msg.h 1.7 86/07/16 SMI
|
||||
* @(#)rpc_msg.h 2.1 88/07/29 4.0 RPCSRC
|
||||
*/
|
||||
|
||||
/*
|
||||
* rpc_msg.h
|
||||
* rpc message definition
|
||||
*
|
||||
* Copyright (C) 1984, Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#ifndef _RPC_RPC_MSG_H_
|
||||
#define _RPC_RPC_MSG_H_
|
||||
|
||||
#define RPC_MSG_VERSION ((uint32_t) 2)
|
||||
#define RPC_SERVICE_PORT ((u_short) 2048)
|
||||
|
||||
/*
|
||||
* Bottom up definition of an rpc message.
|
||||
* NOTE: call and reply use the same overall struct but
|
||||
* different parts of unions within it.
|
||||
*/
|
||||
|
||||
enum msg_type {
|
||||
CALL=0,
|
||||
REPLY=1
|
||||
};
|
||||
|
||||
enum reply_stat {
|
||||
MSG_ACCEPTED=0,
|
||||
MSG_DENIED=1
|
||||
};
|
||||
|
||||
enum accept_stat {
|
||||
SUCCESS=0,
|
||||
PROG_UNAVAIL=1,
|
||||
PROG_MISMATCH=2,
|
||||
PROC_UNAVAIL=3,
|
||||
GARBAGE_ARGS=4,
|
||||
SYSTEM_ERR=5
|
||||
};
|
||||
|
||||
enum reject_stat {
|
||||
RPC_MISMATCH=0,
|
||||
AUTH_ERROR=1
|
||||
};
|
||||
|
||||
/*
|
||||
* Reply part of an rpc exchange
|
||||
*/
|
||||
|
||||
/*
|
||||
* Reply to an rpc request that was accepted by the server.
|
||||
* Note: there could be an error even though the request was
|
||||
* accepted.
|
||||
*/
|
||||
struct accepted_reply {
|
||||
struct opaque_auth ar_verf;
|
||||
enum accept_stat ar_stat;
|
||||
union {
|
||||
struct {
|
||||
rpcvers_t low;
|
||||
rpcvers_t high;
|
||||
} AR_versions;
|
||||
struct {
|
||||
const char *where;
|
||||
xdrproc_t proc;
|
||||
} AR_results;
|
||||
/* and many other null cases */
|
||||
} ru;
|
||||
#define ar_results ru.AR_results
|
||||
#define ar_vers ru.AR_versions
|
||||
};
|
||||
|
||||
/*
|
||||
* Reply to an rpc request that was rejected by the server.
|
||||
*/
|
||||
struct rejected_reply {
|
||||
enum reject_stat rj_stat;
|
||||
union {
|
||||
struct {
|
||||
rpcvers_t low;
|
||||
rpcvers_t high;
|
||||
} RJ_versions;
|
||||
enum auth_stat RJ_why; /* why authentication did not work */
|
||||
} ru;
|
||||
#define rj_vers ru.RJ_versions
|
||||
#define rj_why ru.RJ_why
|
||||
};
|
||||
|
||||
/*
|
||||
* Body of a reply to an rpc request.
|
||||
*/
|
||||
struct reply_body {
|
||||
enum reply_stat rp_stat;
|
||||
union {
|
||||
struct accepted_reply RP_ar;
|
||||
struct rejected_reply RP_dr;
|
||||
} ru;
|
||||
#define rp_acpt ru.RP_ar
|
||||
#define rp_rjct ru.RP_dr
|
||||
};
|
||||
|
||||
/*
|
||||
* Body of an rpc request call.
|
||||
*/
|
||||
struct call_body {
|
||||
rpcvers_t cb_rpcvers; /* must be equal to two */
|
||||
rpcprog_t cb_prog;
|
||||
rpcvers_t cb_vers;
|
||||
rpcproc_t cb_proc;
|
||||
struct opaque_auth cb_cred;
|
||||
struct opaque_auth cb_verf; /* protocol specific - provided by client */
|
||||
};
|
||||
|
||||
/*
|
||||
* The rpc message
|
||||
*/
|
||||
struct rpc_msg {
|
||||
uint32_t rm_xid;
|
||||
enum msg_type rm_direction;
|
||||
union {
|
||||
struct call_body RM_cmb;
|
||||
struct reply_body RM_rmb;
|
||||
} ru;
|
||||
#define rm_call ru.RM_cmb
|
||||
#define rm_reply ru.RM_rmb
|
||||
};
|
||||
#define acpted_rply ru.RM_rmb.ru.RP_ar
|
||||
#define rjcted_rply ru.RM_rmb.ru.RP_dr
|
||||
|
||||
__BEGIN_DECLS
|
||||
/*
|
||||
* XDR routine to handle an rpc message.
|
||||
* xdr_callmsg(xdrs, cmsg)
|
||||
* XDR *xdrs;
|
||||
* struct rpc_msg *cmsg;
|
||||
*/
|
||||
extern bool_t xdr_callmsg (XDR *, struct rpc_msg *);
|
||||
|
||||
/*
|
||||
* XDR routine to pre-serialize the static part of an rpc message.
|
||||
* xdr_callhdr(xdrs, cmsg)
|
||||
* XDR *xdrs;
|
||||
* struct rpc_msg *cmsg;
|
||||
*/
|
||||
extern bool_t xdr_callhdr (XDR *, struct rpc_msg *);
|
||||
|
||||
/*
|
||||
* XDR routine to handle an rpc reply.
|
||||
* xdr_replymsg(xdrs, rmsg)
|
||||
* XDR *xdrs;
|
||||
* struct rpc_msg *rmsg;
|
||||
*/
|
||||
extern bool_t xdr_replymsg (XDR *, struct rpc_msg *);
|
||||
|
||||
|
||||
/*
|
||||
* XDR routine to handle a accepted rpc reply.
|
||||
* xdr_accepted_reply(xdrs, rej)
|
||||
* XDR *xdrs;
|
||||
* struct accepted_reply *rej;
|
||||
*/
|
||||
extern bool_t xdr_accepted_reply (XDR *, struct accepted_reply *);
|
||||
|
||||
/*
|
||||
* XDR routine to handle a rejected rpc reply.
|
||||
* xdr_rejected_reply(xdrs, rej)
|
||||
* XDR *xdrs;
|
||||
* struct rejected_reply *rej;
|
||||
*/
|
||||
extern bool_t xdr_rejected_reply (XDR *, struct rejected_reply *);
|
||||
|
||||
/*
|
||||
* Fills in the error part of a reply message.
|
||||
* _seterr_reply(msg, error)
|
||||
* struct rpc_msg *msg;
|
||||
* struct rpc_err *error;
|
||||
*/
|
||||
extern void _seterr_reply (struct rpc_msg *, struct rpc_err *);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_RPC_RPC_MSG_H_ */
|
||||
|
|
@ -1,90 +0,0 @@
|
|||
/* $NetBSD: rpcb_clnt.h,v 1.4 2009/01/11 03:04:12 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
* unrestricted use provided that this legend is included on all tape
|
||||
* media and as a part of the software program in whole or part. Users
|
||||
* may copy or modify Sun RPC without charge, but are not authorized
|
||||
* to license or distribute it to anyone else except as part of a product or
|
||||
* program developed by the user.
|
||||
*
|
||||
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
||||
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
|
||||
*
|
||||
* Sun RPC is provided with no support and without any obligation on the
|
||||
* part of Sun Microsystems, Inc. to assist in its use, correction,
|
||||
* modification or enhancement.
|
||||
*
|
||||
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
|
||||
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
|
||||
* OR ANY PART THEREOF.
|
||||
*
|
||||
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
|
||||
* or profits or other special, indirect and consequential damages, even if
|
||||
* Sun has been advised of the possibility of such damages.
|
||||
*
|
||||
* Sun Microsystems, Inc.
|
||||
* 2550 Garcia Avenue
|
||||
* Mountain View, California 94043
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 1986 - 1991 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
/*
|
||||
* rpcb_clnt.h
|
||||
* Supplies C routines to get to rpcbid services.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Usage:
|
||||
* success = rpcb_set(program, version, nconf, address);
|
||||
* success = rpcb_unset(program, version, nconf);
|
||||
* success = rpcb_getaddr(program, version, nconf, host);
|
||||
* head = rpcb_getmaps(nconf, host);
|
||||
* clnt_stat = rpcb_rmtcall(nconf, host, program, version, procedure,
|
||||
* xdrargs, argsp, xdrres, resp, tout, addr_ptr)
|
||||
* success = rpcb_gettime(host, timep)
|
||||
* uaddr = rpcb_taddr2uaddr(nconf, taddr);
|
||||
* taddr = rpcb_uaddr2uaddr(nconf, uaddr);
|
||||
*/
|
||||
|
||||
#ifndef _RPC_RPCB_CLNT_H
|
||||
#define _RPC_RPCB_CLNT_H
|
||||
|
||||
/* #pragma ident "@(#)rpcb_clnt.h 1.13 94/04/25 SMI" */
|
||||
/* rpcb_clnt.h 1.3 88/12/05 SMI */
|
||||
|
||||
#include <rpc/types.h>
|
||||
#include <rpc/rpcb_prot.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
extern bool_t rpcb_set(const rpcprog_t, const rpcvers_t,
|
||||
const struct netconfig *, const struct netbuf *);
|
||||
extern bool_t rpcb_unset(const rpcprog_t, const rpcvers_t,
|
||||
const struct netconfig *);
|
||||
extern rpcblist *rpcb_getmaps(const struct netconfig *, const char *);
|
||||
#ifndef __LIBC12_SOURCE__
|
||||
extern enum clnt_stat rpcb_rmtcall(const struct netconfig *,
|
||||
const char *, const rpcprog_t,
|
||||
const rpcvers_t, const rpcproc_t,
|
||||
const xdrproc_t, const char *,
|
||||
const xdrproc_t, caddr_t,
|
||||
const struct timeval,
|
||||
const struct netbuf *)
|
||||
__RENAME(__rpcb_rmtcall50);
|
||||
#endif
|
||||
extern bool_t rpcb_getaddr(const rpcprog_t, const rpcvers_t,
|
||||
const struct netconfig *, struct netbuf *,
|
||||
const char *);
|
||||
#ifndef __LIBC12_SOURCE__
|
||||
extern bool_t rpcb_gettime(const char *, time_t *)
|
||||
__RENAME(__rpcb_gettime50);
|
||||
#endif
|
||||
extern char *rpcb_taddr2uaddr(struct netconfig *, struct netbuf *);
|
||||
extern struct netbuf *rpcb_uaddr2taddr(struct netconfig *, char *);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_RPC_RPCB_CLNT_H */
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
/* $NetBSD: rpcent.h,v 1.3 2005/02/03 04:39:32 perry Exp $ */
|
||||
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
* unrestricted use provided that this legend is included on all tape
|
||||
* media and as a part of the software program in whole or part. Users
|
||||
* may copy or modify Sun RPC without charge, but are not authorized
|
||||
* to license or distribute it to anyone else except as part of a product or
|
||||
* program developed by the user.
|
||||
*
|
||||
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
||||
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
|
||||
*
|
||||
* Sun RPC is provided with no support and without any obligation on the
|
||||
* part of Sun Microsystems, Inc. to assist in its use, correction,
|
||||
* modification or enhancement.
|
||||
*
|
||||
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
|
||||
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
|
||||
* OR ANY PART THEREOF.
|
||||
*
|
||||
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
|
||||
* or profits or other special, indirect and consequential damages, even if
|
||||
* Sun has been advised of the possibility of such damages.
|
||||
*
|
||||
* Sun Microsystems, Inc.
|
||||
* 2550 Garcia Avenue
|
||||
* Mountain View, California 94043
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 1986 - 1991 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
/*
|
||||
* rpcent.h,
|
||||
* For converting rpc program numbers to names etc.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _RPC_RPCENT_H
|
||||
#define _RPC_RPCENT_H
|
||||
|
||||
/* #pragma ident "@(#)rpcent.h 1.13 94/04/25 SMI" */
|
||||
/* @(#)rpcent.h 1.1 88/12/06 SMI */
|
||||
|
||||
|
||||
struct rpcent {
|
||||
char *r_name; /* name of server for this rpc program */
|
||||
char **r_aliases; /* alias list */
|
||||
int r_number; /* rpc program number */
|
||||
};
|
||||
|
||||
__BEGIN_DECLS
|
||||
extern struct rpcent *getrpcbyname_r(const char *, struct rpcent *,
|
||||
char *, int);
|
||||
extern struct rpcent *getrpcbynumber_r(int, struct rpcent *, char *, int);
|
||||
extern struct rpcent *getrpcent_r(struct rpcent *, char *, int);
|
||||
|
||||
/* Old interfaces that return a pointer to a static area; MT-unsafe */
|
||||
extern struct rpcent *getrpcbyname(const char *);
|
||||
extern struct rpcent *getrpcbynumber(int);
|
||||
extern struct rpcent *getrpcent(void);
|
||||
extern void setrpcent(int);
|
||||
extern void endrpcent(void);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_RPC_ENT_H_ */
|
||||
|
|
@ -1,420 +0,0 @@
|
|||
/* $NetBSD: svc.h,v 1.25 2013/03/04 17:29:03 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
* unrestricted use provided that this legend is included on all tape
|
||||
* media and as a part of the software program in whole or part. Users
|
||||
* may copy or modify Sun RPC without charge, but are not authorized
|
||||
* to license or distribute it to anyone else except as part of a product or
|
||||
* program developed by the user.
|
||||
*
|
||||
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
||||
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
|
||||
*
|
||||
* Sun RPC is provided with no support and without any obligation on the
|
||||
* part of Sun Microsystems, Inc. to assist in its use, correction,
|
||||
* modification or enhancement.
|
||||
*
|
||||
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
|
||||
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
|
||||
* OR ANY PART THEREOF.
|
||||
*
|
||||
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
|
||||
* or profits or other special, indirect and consequential damages, even if
|
||||
* Sun has been advised of the possibility of such damages.
|
||||
*
|
||||
* Sun Microsystems, Inc.
|
||||
* 2550 Garcia Avenue
|
||||
* Mountain View, California 94043
|
||||
*
|
||||
* from: @(#)svc.h 1.35 88/12/17 SMI
|
||||
* @(#)svc.h 1.27 94/04/25 SMI
|
||||
*/
|
||||
|
||||
/*
|
||||
* svc.h, Server-side remote procedure call interface.
|
||||
*
|
||||
* Copyright (C) 1986-1993 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#ifndef _RPC_SVC_H_
|
||||
#define _RPC_SVC_H_
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#include <rpc/rpc_com.h>
|
||||
|
||||
/*
|
||||
* This interface must manage two items concerning remote procedure calling:
|
||||
*
|
||||
* 1) An arbitrary number of transport connections upon which rpc requests
|
||||
* are received. The two most notable transports are TCP and UDP; they are
|
||||
* created and registered by routines in svc_tcp.c and svc_udp.c, respectively;
|
||||
* they in turn call xprt_register and xprt_unregister.
|
||||
*
|
||||
* 2) An arbitrary number of locally registered services. Services are
|
||||
* described by the following four data: program number, version number,
|
||||
* "service dispatch" function, a transport handle, and a boolean that
|
||||
* indicates whether or not the exported program should be registered with a
|
||||
* local binder service; if true the program's number and version and the
|
||||
* port number from the transport handle are registered with the binder.
|
||||
* These data are registered with the rpc svc system via svc_register.
|
||||
*
|
||||
* A service's dispatch function is called whenever an rpc request comes in
|
||||
* on a transport. The request's program and version numbers must match
|
||||
* those of the registered service. The dispatch function is passed two
|
||||
* parameters, struct svc_req * and SVCXPRT *, defined below.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Service control requests
|
||||
*/
|
||||
#define SVCGET_VERSQUIET 1
|
||||
#define SVCSET_VERSQUIET 2
|
||||
#define SVCGET_CONNMAXREC 3
|
||||
#define SVCSET_CONNMAXREC 4
|
||||
|
||||
|
||||
enum xprt_stat {
|
||||
XPRT_DIED,
|
||||
XPRT_MOREREQS,
|
||||
XPRT_IDLE
|
||||
};
|
||||
|
||||
/*
|
||||
* Server side transport handle
|
||||
*/
|
||||
typedef struct __rpc_svcxprt {
|
||||
int xp_fd;
|
||||
u_short xp_port; /* associated port number */
|
||||
const struct xp_ops {
|
||||
/* receive incomming requests */
|
||||
bool_t (*xp_recv)(struct __rpc_svcxprt *, struct rpc_msg *);
|
||||
/* get transport status */
|
||||
enum xprt_stat (*xp_stat)(struct __rpc_svcxprt *);
|
||||
/* get arguments */
|
||||
bool_t (*xp_getargs)(struct __rpc_svcxprt *, xdrproc_t,
|
||||
caddr_t);
|
||||
/* send reply */
|
||||
bool_t (*xp_reply)(struct __rpc_svcxprt *, struct rpc_msg *);
|
||||
/* free mem allocated for args */
|
||||
bool_t (*xp_freeargs)(struct __rpc_svcxprt *, xdrproc_t,
|
||||
caddr_t);
|
||||
/* destroy this struct */
|
||||
void (*xp_destroy)(struct __rpc_svcxprt *);
|
||||
} *xp_ops;
|
||||
int xp_addrlen; /* length of remote address */
|
||||
struct sockaddr_in xp_raddr; /* rem. addr. (backward ABI compat) */
|
||||
/* XXX - fvdl stick this here for ABI backward compat reasons */
|
||||
const struct xp_ops2 {
|
||||
/* catch-all function */
|
||||
bool_t (*xp_control)(struct __rpc_svcxprt *, const u_int,
|
||||
void *);
|
||||
} *xp_ops2;
|
||||
char *xp_tp; /* transport provider device name */
|
||||
char *xp_netid; /* network token */
|
||||
struct netbuf xp_ltaddr; /* local transport address */
|
||||
struct netbuf xp_rtaddr; /* remote transport address */
|
||||
struct opaque_auth xp_verf; /* raw response verifier */
|
||||
void *xp_p1; /* private: for use by svc ops */
|
||||
void *xp_p2; /* private: for use by svc ops */
|
||||
void *xp_p3; /* private: for use by svc lib */
|
||||
int xp_type; /* transport type */
|
||||
} SVCXPRT;
|
||||
|
||||
/*
|
||||
* Service request
|
||||
*/
|
||||
struct svc_req {
|
||||
uint32_t rq_prog; /* service program number */
|
||||
uint32_t rq_vers; /* service protocol version */
|
||||
uint32_t rq_proc; /* the desired procedure */
|
||||
struct opaque_auth rq_cred; /* raw creds from the wire */
|
||||
void *rq_clntcred; /* read only cooked cred */
|
||||
SVCXPRT *rq_xprt; /* associated transport */
|
||||
};
|
||||
|
||||
/*
|
||||
* Approved way of getting address of caller
|
||||
*/
|
||||
#define svc_getrpccaller(x) (&(x)->xp_rtaddr)
|
||||
|
||||
/*
|
||||
* NetBSD-only definition to get the creds of the caller (AF_LOCAL).
|
||||
*/
|
||||
#define __svc_getcallercreds(x) ((struct sockcred *)(x)->xp_p2)
|
||||
|
||||
/*
|
||||
* Operations defined on an SVCXPRT handle
|
||||
*
|
||||
* SVCXPRT *xprt;
|
||||
* struct rpc_msg *msg;
|
||||
* xdrproc_t xargs;
|
||||
* caddr_t argsp;
|
||||
*/
|
||||
#define SVC_RECV(xprt, msg) \
|
||||
(*(xprt)->xp_ops->xp_recv)((xprt), (msg))
|
||||
#define svc_recv(xprt, msg) \
|
||||
(*(xprt)->xp_ops->xp_recv)((xprt), (msg))
|
||||
|
||||
#define SVC_STAT(xprt) \
|
||||
(*(xprt)->xp_ops->xp_stat)(xprt)
|
||||
#define svc_stat(xprt) \
|
||||
(*(xprt)->xp_ops->xp_stat)(xprt)
|
||||
|
||||
#define SVC_GETARGS(xprt, xargs, argsp) \
|
||||
(*(xprt)->xp_ops->xp_getargs)((xprt), ((xdrproc_t)(xargs)), (argsp))
|
||||
#define svc_getargs(xprt, xargs, argsp) \
|
||||
(*(xprt)->xp_ops->xp_getargs)((xprt), ((xdrproc_t)(xargs)), (argsp))
|
||||
|
||||
#define SVC_REPLY(xprt, msg) \
|
||||
(*(xprt)->xp_ops->xp_reply) ((xprt), (msg))
|
||||
#define svc_reply(xprt, msg) \
|
||||
(*(xprt)->xp_ops->xp_reply) ((xprt), (msg))
|
||||
|
||||
#define SVC_FREEARGS(xprt, xargs, argsp) \
|
||||
(*(xprt)->xp_ops->xp_freeargs)((xprt), ((xdrproc_t)(xargs)), (argsp))
|
||||
#define svc_freeargs(xprt, xargs, argsp) \
|
||||
(*(xprt)->xp_ops->xp_freeargs)((xprt), ((xdrproc_t)(xargs)), (argsp))
|
||||
|
||||
#define SVC_DESTROY(xprt) \
|
||||
(*(xprt)->xp_ops->xp_destroy)(xprt)
|
||||
#define svc_destroy(xprt) \
|
||||
(*(xprt)->xp_ops->xp_destroy)(xprt)
|
||||
|
||||
#define SVC_CONTROL(xprt, rq, in) \
|
||||
(*(xprt)->xp_ops2->xp_control)((xprt), (rq), (in))
|
||||
|
||||
/*
|
||||
* Service registration
|
||||
*
|
||||
* svc_reg(xprt, prog, vers, dispatch, nconf)
|
||||
* const SVCXPRT *xprt;
|
||||
* const rpcprog_t prog;
|
||||
* const rpcvers_t vers;
|
||||
* const void (*dispatch)(...);
|
||||
* const struct netconfig *nconf;
|
||||
*/
|
||||
|
||||
__BEGIN_DECLS
|
||||
extern bool_t svc_reg(SVCXPRT *, const rpcprog_t, const rpcvers_t,
|
||||
void (*)(struct svc_req *, SVCXPRT *),
|
||||
const struct netconfig *);
|
||||
__END_DECLS
|
||||
|
||||
/*
|
||||
* Service un-registration
|
||||
*
|
||||
* svc_unreg(prog, vers)
|
||||
* const rpcprog_t prog;
|
||||
* const rpcvers_t vers;
|
||||
*/
|
||||
|
||||
__BEGIN_DECLS
|
||||
extern void svc_unreg(const rpcprog_t, const rpcvers_t);
|
||||
__END_DECLS
|
||||
|
||||
/*
|
||||
* Transport registration.
|
||||
*
|
||||
* xprt_register(xprt)
|
||||
* SVCXPRT *xprt;
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern bool_t xprt_register (SVCXPRT *);
|
||||
__END_DECLS
|
||||
|
||||
/*
|
||||
* Transport un-register
|
||||
*
|
||||
* xprt_unregister(xprt)
|
||||
* SVCXPRT *xprt;
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern void xprt_unregister (SVCXPRT *);
|
||||
__END_DECLS
|
||||
|
||||
|
||||
/*
|
||||
* When the service routine is called, it must first check to see if it
|
||||
* knows about the procedure; if not, it should call svcerr_noproc
|
||||
* and return. If so, it should deserialize its arguments via
|
||||
* SVC_GETARGS (defined above). If the deserialization does not work,
|
||||
* svcerr_decode should be called followed by a return. Successful
|
||||
* decoding of the arguments should be followed the execution of the
|
||||
* procedure's code and a call to svc_sendreply.
|
||||
*
|
||||
* Also, if the service refuses to execute the procedure due to too-
|
||||
* weak authentication parameters, svcerr_weakauth should be called.
|
||||
* Note: do not confuse access-control failure with weak authentication!
|
||||
*
|
||||
* NB: In pure implementations of rpc, the caller always waits for a reply
|
||||
* msg. This message is sent when svc_sendreply is called.
|
||||
* Therefore pure service implementations should always call
|
||||
* svc_sendreply even if the function logically returns void; use
|
||||
* xdr.h - xdr_void for the xdr routine. HOWEVER, tcp based rpc allows
|
||||
* for the abuse of pure rpc via batched calling or pipelining. In the
|
||||
* case of a batched call, svc_sendreply should NOT be called since
|
||||
* this would send a return message, which is what batching tries to avoid.
|
||||
* It is the service/protocol writer's responsibility to know which calls are
|
||||
* batched and which are not. Warning: responding to batch calls may
|
||||
* deadlock the caller and server processes!
|
||||
*/
|
||||
|
||||
__BEGIN_DECLS
|
||||
extern bool_t svc_sendreply (SVCXPRT *, xdrproc_t, const char *);
|
||||
extern void svcerr_decode (SVCXPRT *);
|
||||
extern void svcerr_weakauth (SVCXPRT *);
|
||||
extern void svcerr_noproc (SVCXPRT *);
|
||||
extern void svcerr_progvers (SVCXPRT *, rpcvers_t, rpcvers_t);
|
||||
extern void svcerr_auth (SVCXPRT *, enum auth_stat);
|
||||
extern void svcerr_noprog (SVCXPRT *);
|
||||
extern void svcerr_systemerr(SVCXPRT *);
|
||||
extern int rpc_reg(rpcprog_t, rpcvers_t, rpcproc_t,
|
||||
char *(*)(char *), xdrproc_t, xdrproc_t,
|
||||
char *);
|
||||
__END_DECLS
|
||||
|
||||
/*
|
||||
* Lowest level dispatching -OR- who owns this process anyway.
|
||||
* Somebody has to wait for incoming requests and then call the correct
|
||||
* service routine. The routine svc_run does infinite waiting; i.e.,
|
||||
* svc_run never returns.
|
||||
* Since another (co-existent) package may wish to selectively wait for
|
||||
* incoming calls or other events outside of the rpc architecture, the
|
||||
* routine svc_getreq is provided. It must be passed readfds, the
|
||||
* "in-place" results of a select system call (see select, section 2).
|
||||
*/
|
||||
|
||||
/*
|
||||
* Global keeper of rpc service descriptors in use
|
||||
* dynamic; must be inspected before each call to select
|
||||
*/
|
||||
extern int svc_maxfd;
|
||||
#ifdef FD_SETSIZE
|
||||
extern fd_set svc_fdset;
|
||||
#define svc_fds svc_fdset.fds_bits[0] /* compatibility */
|
||||
#else
|
||||
extern int svc_fds;
|
||||
#endif /* def FD_SETSIZE */
|
||||
|
||||
/*
|
||||
* a small program implemented by the svc_rpc implementation itself;
|
||||
* also see clnt.h for protocol numbers.
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern void rpctest_service(void);
|
||||
__END_DECLS
|
||||
|
||||
__BEGIN_DECLS
|
||||
extern void svc_getreq (int);
|
||||
extern void svc_getreqset (fd_set *);
|
||||
extern void svc_getreq_common (int);
|
||||
struct pollfd;
|
||||
extern void svc_getreq_poll(struct pollfd *, int);
|
||||
|
||||
extern void svc_run (void);
|
||||
extern void svc_exit (void);
|
||||
__END_DECLS
|
||||
|
||||
/*
|
||||
* Socket to use on svcxxx_create call to get default socket
|
||||
*/
|
||||
#define RPC_ANYSOCK -1
|
||||
#define RPC_ANYFD RPC_ANYSOCK
|
||||
|
||||
/*
|
||||
* These are the existing service side transport implementations
|
||||
*/
|
||||
|
||||
__BEGIN_DECLS
|
||||
/*
|
||||
* Transport independent svc_create routine.
|
||||
*/
|
||||
extern int svc_create(void (*)(struct svc_req *, SVCXPRT *),
|
||||
const rpcprog_t, const rpcvers_t, const char *);
|
||||
/*
|
||||
* void (*dispatch)(...); -- dispatch routine
|
||||
* const rpcprog_t prognum; -- program number
|
||||
* const rpcvers_t versnum; -- version number
|
||||
* const char *nettype; -- network type
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Generic server creation routine. It takes a netconfig structure
|
||||
* instead of a nettype.
|
||||
*/
|
||||
|
||||
extern SVCXPRT *svc_tp_create(void (*)(struct svc_req *, SVCXPRT *),
|
||||
const rpcprog_t, const rpcvers_t,
|
||||
const struct netconfig *);
|
||||
/*
|
||||
* void (*dispatch)(...); -- dispatch routine
|
||||
* const rpcprog_t prognum; -- program number
|
||||
* const rpcvers_t versnum; -- version number
|
||||
* const struct netconfig *nconf; -- netconfig structure
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Generic TLI create routine
|
||||
*/
|
||||
extern SVCXPRT *svc_tli_create(const int, const struct netconfig *,
|
||||
const struct t_bind *, const u_int,
|
||||
const u_int);
|
||||
/*
|
||||
* const int fd; -- connection end point
|
||||
* const struct netconfig *nconf; -- netconfig structure for network
|
||||
* const struct t_bind *bindaddr; -- local bind address
|
||||
* const u_int sendsz; -- max sendsize
|
||||
* const u_int recvsz; -- max recvsize
|
||||
*/
|
||||
|
||||
/*
|
||||
* Connectionless and connectionful create routines
|
||||
*/
|
||||
|
||||
extern SVCXPRT *svc_vc_create(const int, const u_int, const u_int);
|
||||
/*
|
||||
* const int fd; -- open connection end point
|
||||
* const u_int sendsize; -- max send size
|
||||
* const u_int recvsize; -- max recv size
|
||||
*/
|
||||
|
||||
extern SVCXPRT *svc_dg_create(const int, const u_int, const u_int);
|
||||
/*
|
||||
* const int fd; -- open connection
|
||||
* const u_int sendsize; -- max send size
|
||||
* const u_int recvsize; -- max recv size
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* the routine takes any *open* connection
|
||||
* descriptor as its first input and is used for open connections.
|
||||
*/
|
||||
extern SVCXPRT *svc_fd_create(const int, const u_int, const u_int);
|
||||
/*
|
||||
* const int fd; -- open connection end point
|
||||
* const u_int sendsize; -- max send size
|
||||
* const u_int recvsize; -- max recv size
|
||||
*/
|
||||
|
||||
/*
|
||||
* Memory based rpc (for speed check and testing)
|
||||
*/
|
||||
extern SVCXPRT *svc_raw_create(void);
|
||||
|
||||
/*
|
||||
* svc_dg_enable_cache() enables the cache on dg transports.
|
||||
*/
|
||||
int svc_dg_enablecache(SVCXPRT *, const u_int);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
||||
/* for backward compatibility */
|
||||
#include <rpc/svc_soc.h>
|
||||
|
||||
#endif /* !_RPC_SVC_H_ */
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
/* $NetBSD: svc_auth.h,v 1.9 2005/02/03 04:39:32 perry Exp $ */
|
||||
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
* unrestricted use provided that this legend is included on all tape
|
||||
* media and as a part of the software program in whole or part. Users
|
||||
* may copy or modify Sun RPC without charge, but are not authorized
|
||||
* to license or distribute it to anyone else except as part of a product or
|
||||
* program developed by the user.
|
||||
*
|
||||
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
||||
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
|
||||
*
|
||||
* Sun RPC is provided with no support and without any obligation on the
|
||||
* part of Sun Microsystems, Inc. to assist in its use, correction,
|
||||
* modification or enhancement.
|
||||
*
|
||||
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
|
||||
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
|
||||
* OR ANY PART THEREOF.
|
||||
*
|
||||
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
|
||||
* or profits or other special, indirect and consequential damages, even if
|
||||
* Sun has been advised of the possibility of such damages.
|
||||
*
|
||||
* Sun Microsystems, Inc.
|
||||
* 2550 Garcia Avenue
|
||||
* Mountain View, California 94043
|
||||
*
|
||||
* from: @(#)svc_auth.h 1.6 86/07/16 SMI
|
||||
* @(#)svc_auth.h 2.1 88/07/29 4.0 RPCSRC
|
||||
*/
|
||||
|
||||
/*
|
||||
* svc_auth.h, Service side of rpc authentication.
|
||||
*
|
||||
* Copyright (C) 1984, Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#ifndef _RPC_SVC_AUTH_H_
|
||||
#define _RPC_SVC_AUTH_H_
|
||||
|
||||
/*
|
||||
* Server side authenticator
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern enum auth_stat _authenticate(struct svc_req *, struct rpc_msg *);
|
||||
extern int svc_auth_reg(int, enum auth_stat (*)(struct svc_req *,
|
||||
struct rpc_msg *));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_RPC_SVC_AUTH_H_ */
|
||||
|
|
@ -1,115 +0,0 @@
|
|||
/* $NetBSD: svc_soc.h,v 1.2 2005/02/03 04:39:33 perry Exp $ */
|
||||
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
* unrestricted use provided that this legend is included on all tape
|
||||
* media and as a part of the software program in whole or part. Users
|
||||
* may copy or modify Sun RPC without charge, but are not authorized
|
||||
* to license or distribute it to anyone else except as part of a product or
|
||||
* program developed by the user.
|
||||
*
|
||||
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
||||
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
|
||||
*
|
||||
* Sun RPC is provided with no support and without any obligation on the
|
||||
* part of Sun Microsystems, Inc. to assist in its use, correction,
|
||||
* modification or enhancement.
|
||||
*
|
||||
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
|
||||
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
|
||||
* OR ANY PART THEREOF.
|
||||
*
|
||||
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
|
||||
* or profits or other special, indirect and consequential damages, even if
|
||||
* Sun has been advised of the possibility of such damages.
|
||||
*
|
||||
* Sun Microsystems, Inc.
|
||||
* 2550 Garcia Avenue
|
||||
* Mountain View, California 94043
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 1986 - 1991 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
/*
|
||||
* svc.h, Server-side remote procedure call interface.
|
||||
*/
|
||||
|
||||
#ifndef _RPC_SVC_SOC_H
|
||||
#define _RPC_SVC_SOC_H
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
/* #pragma ident "@(#)svc_soc.h 1.11 94/04/25 SMI" */
|
||||
/* svc_soc.h 1.8 89/05/01 SMI */
|
||||
|
||||
/*
|
||||
* All the following declarations are only for backward compatibility
|
||||
* with TS-RPC
|
||||
*/
|
||||
|
||||
/*
|
||||
* Approved way of getting address of caller
|
||||
*/
|
||||
#define svc_getcaller(x) (&(x)->xp_raddr)
|
||||
|
||||
/*
|
||||
* Service registration
|
||||
*
|
||||
* svc_register(xprt, prog, vers, dispatch, protocol)
|
||||
* SVCXPRT *xprt;
|
||||
* u_long prog;
|
||||
* u_long vers;
|
||||
* void (*dispatch)();
|
||||
* int protocol; like TCP or UDP, zero means do not register
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern bool_t svc_register(SVCXPRT *, u_long, u_long,
|
||||
void (*)(struct svc_req *, SVCXPRT *), int);
|
||||
__END_DECLS
|
||||
|
||||
/*
|
||||
* Service un-registration
|
||||
*
|
||||
* svc_unregister(prog, vers)
|
||||
* u_long prog;
|
||||
* u_long vers;
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern void svc_unregister(u_long, u_long);
|
||||
__END_DECLS
|
||||
|
||||
|
||||
/*
|
||||
* Memory based rpc for testing and timing.
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern SVCXPRT *svcraw_create(void);
|
||||
__END_DECLS
|
||||
|
||||
|
||||
/*
|
||||
* Udp based rpc.
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern SVCXPRT *svcudp_create(int);
|
||||
extern SVCXPRT *svcudp_bufcreate(int, u_int, u_int);
|
||||
extern int svcudp_enablecache(SVCXPRT *, u_long);
|
||||
__END_DECLS
|
||||
|
||||
|
||||
/*
|
||||
* Tcp based rpc.
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern SVCXPRT *svctcp_create(int, u_int, u_int);
|
||||
__END_DECLS
|
||||
|
||||
/*
|
||||
* Fd based rpc.
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern SVCXPRT *svcfd_create(int, u_int, u_int);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_RPC_SVC_SOC_H */
|
||||
|
|
@ -1,107 +0,0 @@
|
|||
/* $NetBSD: types.h,v 1.15 2005/12/26 19:01:47 perry Exp $ */
|
||||
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
* unrestricted use provided that this legend is included on all tape
|
||||
* media and as a part of the software program in whole or part. Users
|
||||
* may copy or modify Sun RPC without charge, but are not authorized
|
||||
* to license or distribute it to anyone else except as part of a product or
|
||||
* program developed by the user.
|
||||
*
|
||||
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
||||
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
|
||||
*
|
||||
* Sun RPC is provided with no support and without any obligation on the
|
||||
* part of Sun Microsystems, Inc. to assist in its use, correction,
|
||||
* modification or enhancement.
|
||||
*
|
||||
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
|
||||
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
|
||||
* OR ANY PART THEREOF.
|
||||
*
|
||||
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
|
||||
* or profits or other special, indirect and consequential damages, even if
|
||||
* Sun has been advised of the possibility of such damages.
|
||||
*
|
||||
* Sun Microsystems, Inc.
|
||||
* 2550 Garcia Avenue
|
||||
* Mountain View, California 94043
|
||||
*
|
||||
* from: @(#)types.h 1.18 87/07/24 SMI
|
||||
* @(#)types.h 2.3 88/08/15 4.0 RPCSRC
|
||||
*/
|
||||
|
||||
/*
|
||||
* Rpc additions to <sys/types.h>
|
||||
*/
|
||||
#ifndef _RPC_TYPES_H_
|
||||
#define _RPC_TYPES_H_
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
typedef int32_t bool_t;
|
||||
typedef int32_t enum_t;
|
||||
|
||||
typedef uint32_t rpcprog_t;
|
||||
typedef uint32_t rpcvers_t;
|
||||
typedef uint32_t rpcproc_t;
|
||||
typedef uint32_t rpcprot_t;
|
||||
typedef uint32_t rpcport_t;
|
||||
typedef int32_t rpc_inline_t;
|
||||
|
||||
#define __dontcare__ -1
|
||||
|
||||
#ifndef FALSE
|
||||
# define FALSE (0)
|
||||
#endif
|
||||
#ifndef TRUE
|
||||
# define TRUE (1)
|
||||
#endif
|
||||
#ifndef NULL
|
||||
# define NULL 0
|
||||
#endif
|
||||
|
||||
#define mem_alloc(bsize) calloc((size_t)1, bsize)
|
||||
#define mem_free(ptr, bsize) free(ptr)
|
||||
|
||||
#include <sys/time.h>
|
||||
#include <netconfig.h>
|
||||
|
||||
/*
|
||||
* The netbuf structure is defined here, because NetBSD only uses it inside
|
||||
* the RPC code. It's in <xti.h> on SVR4, but it would be confusing to
|
||||
* have an xti.h, since NetBSD does not support XTI/TLI.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The netbuf structure is used for transport-independent address storage.
|
||||
*/
|
||||
struct netbuf {
|
||||
unsigned int maxlen;
|
||||
unsigned int len;
|
||||
void *buf;
|
||||
};
|
||||
|
||||
/*
|
||||
* The format of the addres and options arguments of the XTI t_bind call.
|
||||
* Only provided for compatibility, it should not be used.
|
||||
*/
|
||||
|
||||
struct t_bind {
|
||||
struct netbuf addr;
|
||||
unsigned int qlen;
|
||||
};
|
||||
|
||||
/*
|
||||
* Internal library and rpcbind use. This is not an exported interface, do
|
||||
* not use.
|
||||
*/
|
||||
struct __rpc_sockinfo {
|
||||
int si_af;
|
||||
int si_proto;
|
||||
int si_socktype;
|
||||
int si_alen;
|
||||
};
|
||||
|
||||
#endif /* !_RPC_TYPES_H_ */
|
||||
|
|
@ -1,358 +0,0 @@
|
|||
/* $NetBSD: xdr.h,v 1.27 2011/08/30 17:09:51 plunky Exp $ */
|
||||
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
* unrestricted use provided that this legend is included on all tape
|
||||
* media and as a part of the software program in whole or part. Users
|
||||
* may copy or modify Sun RPC without charge, but are not authorized
|
||||
* to license or distribute it to anyone else except as part of a product or
|
||||
* program developed by the user.
|
||||
*
|
||||
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
||||
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
|
||||
*
|
||||
* Sun RPC is provided with no support and without any obligation on the
|
||||
* part of Sun Microsystems, Inc. to assist in its use, correction,
|
||||
* modification or enhancement.
|
||||
*
|
||||
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
|
||||
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
|
||||
* OR ANY PART THEREOF.
|
||||
*
|
||||
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
|
||||
* or profits or other special, indirect and consequential damages, even if
|
||||
* Sun has been advised of the possibility of such damages.
|
||||
*
|
||||
* Sun Microsystems, Inc.
|
||||
* 2550 Garcia Avenue
|
||||
* Mountain View, California 94043
|
||||
*
|
||||
* from: @(#)xdr.h 1.19 87/04/22 SMI
|
||||
* @(#)xdr.h 2.2 88/07/29 4.0 RPCSRC
|
||||
*/
|
||||
|
||||
/*
|
||||
* xdr.h, External Data Representation Serialization Routines.
|
||||
*
|
||||
* Copyright (C) 1984, Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#ifndef _RPC_XDR_H_
|
||||
#define _RPC_XDR_H_
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
/*
|
||||
* XDR provides a conventional way for converting between C data
|
||||
* types and an external bit-string representation. Library supplied
|
||||
* routines provide for the conversion on built-in C data types. These
|
||||
* routines and utility routines defined here are used to help implement
|
||||
* a type encode/decode routine for each user-defined type.
|
||||
*
|
||||
* Each data type provides a single procedure which takes two arguments:
|
||||
*
|
||||
* bool_t
|
||||
* xdrproc(xdrs, argresp)
|
||||
* XDR *xdrs;
|
||||
* <type> *argresp;
|
||||
*
|
||||
* xdrs is an instance of a XDR handle, to which or from which the data
|
||||
* type is to be converted. argresp is a pointer to the structure to be
|
||||
* converted. The XDR handle contains an operation field which indicates
|
||||
* which of the operations (ENCODE, DECODE * or FREE) is to be performed.
|
||||
*
|
||||
* XDR_DECODE may allocate space if the pointer argresp is null. This
|
||||
* data can be freed with the XDR_FREE operation.
|
||||
*
|
||||
* We write only one procedure per data type to make it easy
|
||||
* to keep the encode and decode procedures for a data type consistent.
|
||||
* In many cases the same code performs all operations on a user defined type,
|
||||
* because all the hard work is done in the component type routines.
|
||||
* decode as a series of calls on the nested data types.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Xdr operations. XDR_ENCODE causes the type to be encoded into the
|
||||
* stream. XDR_DECODE causes the type to be extracted from the stream.
|
||||
* XDR_FREE can be used to release the space allocated by an XDR_DECODE
|
||||
* request.
|
||||
*/
|
||||
enum xdr_op {
|
||||
XDR_ENCODE=0,
|
||||
XDR_DECODE=1,
|
||||
XDR_FREE=2
|
||||
};
|
||||
|
||||
/*
|
||||
* This is the number of bytes per unit of external data.
|
||||
*/
|
||||
#define BYTES_PER_XDR_UNIT (4)
|
||||
#define RNDUP(x) ((((x) + BYTES_PER_XDR_UNIT - 1) / BYTES_PER_XDR_UNIT) \
|
||||
* BYTES_PER_XDR_UNIT)
|
||||
|
||||
/*
|
||||
* The XDR handle.
|
||||
* Contains operation which is being applied to the stream,
|
||||
* an operations vector for the paticular implementation (e.g. see xdr_mem.c),
|
||||
* and two private fields for the use of the particular impelementation.
|
||||
*/
|
||||
typedef struct __rpc_xdr {
|
||||
enum xdr_op x_op; /* operation; fast additional param */
|
||||
const struct xdr_ops {
|
||||
/* get a long from underlying stream */
|
||||
bool_t (*x_getlong)(struct __rpc_xdr *, long *);
|
||||
/* put a long to " */
|
||||
bool_t (*x_putlong)(struct __rpc_xdr *, const long *);
|
||||
/* get some bytes from " */
|
||||
bool_t (*x_getbytes)(struct __rpc_xdr *, char *, u_int);
|
||||
/* put some bytes to " */
|
||||
bool_t (*x_putbytes)(struct __rpc_xdr *, const char *, u_int);
|
||||
/* returns bytes off from beginning */
|
||||
u_int (*x_getpostn)(struct __rpc_xdr *);
|
||||
/* lets you reposition the stream */
|
||||
bool_t (*x_setpostn)(struct __rpc_xdr *, u_int);
|
||||
/* buf quick ptr to buffered data */
|
||||
int32_t *(*x_inline)(struct __rpc_xdr *, u_int);
|
||||
/* free privates of this xdr_stream */
|
||||
void (*x_destroy)(struct __rpc_xdr *);
|
||||
bool_t (*x_control)(struct __rpc_xdr *, int, void *);
|
||||
} *x_ops;
|
||||
char * x_public; /* users' data */
|
||||
void * x_private; /* pointer to private data */
|
||||
char * x_base; /* private used for position info */
|
||||
u_int x_handy; /* extra private word */
|
||||
} XDR;
|
||||
|
||||
/*
|
||||
* A xdrproc_t exists for each data type which is to be encoded or decoded.
|
||||
*
|
||||
* The second argument to the xdrproc_t is a pointer to an opaque pointer.
|
||||
* The opaque pointer generally points to a structure of the data type
|
||||
* to be decoded. If this pointer is 0, then the type routines should
|
||||
* allocate dynamic storage of the appropriate size and return it.
|
||||
*/
|
||||
typedef bool_t (*xdrproc_t)(XDR *, const void *);
|
||||
|
||||
/*
|
||||
* Operations defined on a XDR handle
|
||||
*
|
||||
* XDR *xdrs;
|
||||
* long *longp;
|
||||
* char * addr;
|
||||
* u_int len;
|
||||
* u_int pos;
|
||||
*/
|
||||
#define XDR_GETLONG(xdrs, longp) \
|
||||
(*(xdrs)->x_ops->x_getlong)(xdrs, longp)
|
||||
#define xdr_getlong(xdrs, longp) \
|
||||
(*(xdrs)->x_ops->x_getlong)(xdrs, longp)
|
||||
|
||||
#define XDR_PUTLONG(xdrs, longp) \
|
||||
(*(xdrs)->x_ops->x_putlong)(xdrs, longp)
|
||||
#define xdr_putlong(xdrs, longp) \
|
||||
(*(xdrs)->x_ops->x_putlong)(xdrs, longp)
|
||||
|
||||
static __inline int
|
||||
xdr_getint32(XDR *xdrs, int32_t *ip)
|
||||
{
|
||||
long l;
|
||||
|
||||
if (!xdr_getlong(xdrs, &l))
|
||||
return 0;
|
||||
*ip = (int32_t)l;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static __inline int
|
||||
xdr_putint32(XDR *xdrs, int32_t *ip)
|
||||
{
|
||||
long l;
|
||||
|
||||
l = (long)*ip;
|
||||
return xdr_putlong(xdrs, &l);
|
||||
}
|
||||
|
||||
#define XDR_GETINT32(xdrs, int32p) xdr_getint32(xdrs, int32p)
|
||||
#define XDR_PUTINT32(xdrs, int32p) xdr_putint32(xdrs, int32p)
|
||||
|
||||
#define XDR_GETBYTES(xdrs, addr, len) \
|
||||
(*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len)
|
||||
#define xdr_getbytes(xdrs, addr, len) \
|
||||
(*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len)
|
||||
|
||||
#define XDR_PUTBYTES(xdrs, addr, len) \
|
||||
(*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len)
|
||||
#define xdr_putbytes(xdrs, addr, len) \
|
||||
(*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len)
|
||||
|
||||
#define XDR_GETPOS(xdrs) \
|
||||
(*(xdrs)->x_ops->x_getpostn)(xdrs)
|
||||
#define xdr_getpos(xdrs) \
|
||||
(*(xdrs)->x_ops->x_getpostn)(xdrs)
|
||||
|
||||
#define XDR_SETPOS(xdrs, pos) \
|
||||
(*(xdrs)->x_ops->x_setpostn)(xdrs, pos)
|
||||
#define xdr_setpos(xdrs, pos) \
|
||||
(*(xdrs)->x_ops->x_setpostn)(xdrs, pos)
|
||||
|
||||
#define XDR_INLINE(xdrs, len) \
|
||||
(*(xdrs)->x_ops->x_inline)(xdrs, len)
|
||||
#define xdr_inline(xdrs, len) \
|
||||
(*(xdrs)->x_ops->x_inline)(xdrs, len)
|
||||
|
||||
#define XDR_DESTROY(xdrs) \
|
||||
if ((xdrs)->x_ops->x_destroy) \
|
||||
(*(xdrs)->x_ops->x_destroy)(xdrs)
|
||||
#define xdr_destroy(xdrs) \
|
||||
if ((xdrs)->x_ops->x_destroy) \
|
||||
(*(xdrs)->x_ops->x_destroy)(xdrs)
|
||||
|
||||
#define XDR_CONTROL(xdrs, req, op) \
|
||||
if ((xdrs)->x_ops->x_control) \
|
||||
(*(xdrs)->x_ops->x_control)(xdrs, req, op)
|
||||
#define xdr_control(xdrs, req, op) XDR_CONTROL(xdrs, req, op)
|
||||
|
||||
/*
|
||||
* Solaris strips the '_t' from these types -- not sure why.
|
||||
* But, let's be compatible.
|
||||
*/
|
||||
#define xdr_rpcvers(xdrs, versp) xdr_u_int32(xdrs, versp)
|
||||
#define xdr_rpcprog(xdrs, progp) xdr_u_int32(xdrs, progp)
|
||||
#define xdr_rpcproc(xdrs, procp) xdr_u_int32(xdrs, procp)
|
||||
#define xdr_rpcprot(xdrs, protp) xdr_u_int32(xdrs, protp)
|
||||
#define xdr_rpcport(xdrs, portp) xdr_u_int32(xdrs, portp)
|
||||
|
||||
/*
|
||||
* Support struct for discriminated unions.
|
||||
* You create an array of xdrdiscrim structures, terminated with
|
||||
* a entry with a null procedure pointer. The xdr_union routine gets
|
||||
* the discriminant value and then searches the array of structures
|
||||
* for a matching value. If a match is found the associated xdr routine
|
||||
* is called to handle that part of the union. If there is
|
||||
* no match, then a default routine may be called.
|
||||
* If there is no match and no default routine it is an error.
|
||||
*/
|
||||
#define NULL_xdrproc_t ((xdrproc_t)0)
|
||||
struct xdr_discrim {
|
||||
int value;
|
||||
xdrproc_t proc;
|
||||
};
|
||||
|
||||
/*
|
||||
* In-line routines for fast encode/decode of primitive data types.
|
||||
* Caveat emptor: these use single memory cycles to get the
|
||||
* data from the underlying buffer, and will fail to operate
|
||||
* properly if the data is not aligned. The standard way to use these
|
||||
* is to say:
|
||||
* if ((buf = XDR_INLINE(xdrs, count)) == NULL)
|
||||
* return (0);
|
||||
* <<< macro calls >>>
|
||||
* where ``count'' is the number of bytes of data occupied
|
||||
* by the primitive data types.
|
||||
*
|
||||
* N.B. and frozen for all time: each data type here uses 4 bytes
|
||||
* of external representation.
|
||||
*/
|
||||
#define IXDR_GET_INT32(buf) ((int32_t)ntohl((uint32_t)*(buf)++))
|
||||
#define IXDR_PUT_INT32(buf, v) (*(buf)++ =(int32_t)htonl((uint32_t)v))
|
||||
#define IXDR_GET_U_INT32(buf) ((uint32_t)IXDR_GET_INT32(buf))
|
||||
#define IXDR_PUT_U_INT32(buf, v) IXDR_PUT_INT32((buf), ((int32_t)(v)))
|
||||
|
||||
#define IXDR_GET_LONG(buf) ((long)ntohl((uint32_t)*(buf)++))
|
||||
#define IXDR_PUT_LONG(buf, v) (*(buf)++ =(int32_t)htonl((uint32_t)v))
|
||||
|
||||
#define IXDR_GET_BOOL(buf) ((bool_t)IXDR_GET_LONG(buf))
|
||||
#define IXDR_GET_ENUM(buf, t) ((t)IXDR_GET_LONG(buf))
|
||||
#define IXDR_GET_U_LONG(buf) ((u_long)IXDR_GET_LONG(buf))
|
||||
#define IXDR_GET_SHORT(buf) ((short)IXDR_GET_LONG(buf))
|
||||
#define IXDR_GET_U_SHORT(buf) ((u_short)IXDR_GET_LONG(buf))
|
||||
|
||||
#define IXDR_PUT_BOOL(buf, v) IXDR_PUT_LONG((buf), (v))
|
||||
#define IXDR_PUT_ENUM(buf, v) IXDR_PUT_LONG((buf), (v))
|
||||
#define IXDR_PUT_U_LONG(buf, v) IXDR_PUT_LONG((buf), (v))
|
||||
#define IXDR_PUT_SHORT(buf, v) IXDR_PUT_LONG((buf), (v))
|
||||
#define IXDR_PUT_U_SHORT(buf, v) IXDR_PUT_LONG((buf), (v))
|
||||
|
||||
/*
|
||||
* These are the "generic" xdr routines.
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern bool_t xdr_void(void);
|
||||
extern bool_t xdr_int(XDR *, int *);
|
||||
extern bool_t xdr_u_int(XDR *, u_int *);
|
||||
extern bool_t xdr_long(XDR *, long *);
|
||||
extern bool_t xdr_u_long(XDR *, u_long *);
|
||||
extern bool_t xdr_short(XDR *, short *);
|
||||
extern bool_t xdr_u_short(XDR *, u_short *);
|
||||
extern bool_t xdr_int16_t(XDR *, int16_t *);
|
||||
extern bool_t xdr_u_int16_t(XDR *, uint16_t *);
|
||||
extern bool_t xdr_int32_t(XDR *, int32_t *);
|
||||
extern bool_t xdr_u_int32_t(XDR *, uint32_t *);
|
||||
extern bool_t xdr_int64_t(XDR *, int64_t *);
|
||||
extern bool_t xdr_u_int64_t(XDR *, uint64_t *);
|
||||
extern bool_t xdr_bool(XDR *, bool_t *);
|
||||
extern bool_t xdr_enum(XDR *, enum_t *);
|
||||
extern bool_t xdr_array(XDR *, char **, u_int *, u_int, u_int, xdrproc_t);
|
||||
extern bool_t xdr_bytes(XDR *, char **, u_int *, u_int);
|
||||
extern bool_t xdr_opaque(XDR *, char *, u_int);
|
||||
extern bool_t xdr_string(XDR *, char **, u_int);
|
||||
extern bool_t xdr_union(XDR *, enum_t *, char *, const struct xdr_discrim *, xdrproc_t);
|
||||
extern bool_t xdr_char(XDR *, char *);
|
||||
extern bool_t xdr_u_char(XDR *, u_char *);
|
||||
extern bool_t xdr_vector(XDR *, char *, u_int, u_int, xdrproc_t);
|
||||
extern bool_t xdr_float(XDR *, float *);
|
||||
extern bool_t xdr_double(XDR *, double *);
|
||||
extern bool_t xdr_quadruple(XDR *, long double *);
|
||||
extern bool_t xdr_reference(XDR *, char **, u_int, xdrproc_t);
|
||||
extern bool_t xdr_pointer(XDR *, char **, u_int, xdrproc_t);
|
||||
extern bool_t xdr_wrapstring(XDR *, char **);
|
||||
extern void xdr_free(xdrproc_t, char *);
|
||||
extern bool_t xdr_hyper(XDR *, longlong_t *);
|
||||
extern bool_t xdr_u_hyper(XDR *, u_longlong_t *);
|
||||
extern bool_t xdr_longlong_t(XDR *, longlong_t *);
|
||||
extern bool_t xdr_u_longlong_t(XDR *, u_longlong_t *);
|
||||
extern unsigned long xdr_sizeof(xdrproc_t, void *);
|
||||
__END_DECLS
|
||||
|
||||
/*
|
||||
* Common opaque bytes objects used by many rpc protocols;
|
||||
* declared here due to commonality.
|
||||
*/
|
||||
#define MAX_NETOBJ_SZ 1024
|
||||
struct netobj {
|
||||
u_int n_len;
|
||||
char *n_bytes;
|
||||
};
|
||||
typedef struct netobj netobj;
|
||||
extern bool_t xdr_netobj(XDR *, struct netobj *);
|
||||
|
||||
/*
|
||||
* These are the public routines for the various implementations of
|
||||
* xdr streams.
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
/* XDR using memory buffers */
|
||||
extern void xdrmem_create(XDR *, char *, u_int, enum xdr_op);
|
||||
|
||||
/* XDR using stdio library */
|
||||
#ifdef _STDIO_H_
|
||||
extern void xdrstdio_create(XDR *, FILE *, enum xdr_op);
|
||||
#endif
|
||||
|
||||
/* XDR pseudo records for tcp */
|
||||
extern void xdrrec_create(XDR *, u_int, u_int, char *,
|
||||
int (*)(char *, char *, int),
|
||||
int (*)(char *, char *, int));
|
||||
|
||||
/* make end of xdr record */
|
||||
extern bool_t xdrrec_endofrecord(XDR *, int);
|
||||
|
||||
/* move to beginning of next record */
|
||||
extern bool_t xdrrec_skiprecord(XDR *);
|
||||
|
||||
/* true if no more input */
|
||||
extern bool_t xdrrec_eof(XDR *);
|
||||
extern u_int xdrrec_readbytes(XDR *, caddr_t, u_int);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_RPC_XDR_H_ */
|
||||
|
|
@ -1,330 +0,0 @@
|
|||
/* $NetBSD: yp_prot.h,v 1.18 2013/01/23 17:27:35 mbalmer Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@fsa.ca>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
|
||||
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _RPCSVC_YP_PROT_H_
|
||||
#define _RPCSVC_YP_PROT_H_
|
||||
|
||||
/*
|
||||
* YPSERV PROTOCOL:
|
||||
*
|
||||
* ypserv supports the following procedures:
|
||||
*
|
||||
* YPPROC_NULL takes (void), returns (void).
|
||||
* called to check if server is alive.
|
||||
* YPPROC_DOMAIN takes (char *), returns (bool_t).
|
||||
* true if ypserv serves the named domain.
|
||||
* YPPROC_DOMAIN_NOACK takes (char *), returns (bool_t).
|
||||
* true if ypserv serves the named domain.
|
||||
* used for broadcasts, does not ack if ypserv
|
||||
* doesn't handle named domain.
|
||||
* YPPROC_MATCH takes (struct ypreq_key), returns (struct ypresp_val)
|
||||
* does a lookup.
|
||||
* YPPROC_FIRST takes (struct ypreq_nokey) returns (ypresp_key_val).
|
||||
* gets the first key/datum from the map.
|
||||
* YPPROC_NEXT takes (struct ypreq_key) returns (ypresp_key_val).
|
||||
* gets the next key/datum from the map.
|
||||
* YPPROC_XFR takes (struct ypreq_xfr), returns (void).
|
||||
* tells ypserv to check if there is a new version of
|
||||
* the map.
|
||||
* YPPROC_CLEAR takes (void), returns (void).
|
||||
* tells ypserv to flush its file cache, so that
|
||||
* newly transferred files will get read.
|
||||
* YPPROC_ALL takes (struct ypreq_nokey), returns (bool_t and
|
||||
* struct ypresp_key_val).
|
||||
* returns an array of data, with the bool_t being
|
||||
* false on the last datum. read the source, it's
|
||||
* convoluted.
|
||||
* YPPROC_MASTER takes (struct ypreq_nokey), returns (ypresp_master).
|
||||
* YPPROC_ORDER takes (struct ypreq_nokey), returns (ypresp_order).
|
||||
* YPPROC_MAPLIST takes (char *), returns (struct ypmaplist *).
|
||||
*/
|
||||
|
||||
/* Program and version symbols, magic numbers */
|
||||
#define YPPROG ((unsigned long)100004)
|
||||
#define YPVERS ((unsigned long)2)
|
||||
#define YPVERS_ORIG ((unsigned long)1)
|
||||
|
||||
#define YPMAXRECORD 1024
|
||||
#define YPMAXDOMAIN 64
|
||||
#define YPMAXMAP 64
|
||||
#define YPMAXPEER 256
|
||||
|
||||
/*
|
||||
* I don't know if anything of sun's depends on this, or if they
|
||||
* simply defined it so that their own code wouldn't try to send
|
||||
* packets over the ethernet MTU. This YP code doesn't use it.
|
||||
*/
|
||||
#define YPMSGSZ 1600
|
||||
|
||||
#ifndef DATUM
|
||||
typedef struct {
|
||||
const char *dptr;
|
||||
int dsize;
|
||||
} datum;
|
||||
#define DATUM
|
||||
#endif
|
||||
|
||||
struct ypmap_parms {
|
||||
const char *domain;
|
||||
const char *map;
|
||||
unsigned int ordernum;
|
||||
char *owner;
|
||||
};
|
||||
|
||||
struct ypreq_key {
|
||||
const char *domain;
|
||||
const char *map;
|
||||
datum keydat;
|
||||
};
|
||||
|
||||
struct ypreq_nokey {
|
||||
const char *domain;
|
||||
const char *map;
|
||||
};
|
||||
|
||||
struct ypreq_xfr {
|
||||
struct ypmap_parms map_parms;
|
||||
unsigned int transid;
|
||||
unsigned int proto;
|
||||
unsigned int port;
|
||||
};
|
||||
#define ypxfr_domain map_parms.domain
|
||||
#define ypxfr_map map_parms.map
|
||||
#define ypxfr_ordernum map_parms.ordernum
|
||||
#define ypxfr_owner map_parms.owner
|
||||
|
||||
struct ypresp_val {
|
||||
unsigned int status;
|
||||
datum valdat;
|
||||
};
|
||||
|
||||
struct ypresp_key_val {
|
||||
unsigned int status;
|
||||
datum keydat;
|
||||
datum valdat;
|
||||
};
|
||||
|
||||
struct ypresp_master {
|
||||
unsigned int status;
|
||||
char *master;
|
||||
};
|
||||
|
||||
struct ypresp_order {
|
||||
unsigned int status;
|
||||
unsigned int ordernum;
|
||||
};
|
||||
|
||||
struct ypmaplist {
|
||||
char ypml_name[YPMAXMAP + 1];
|
||||
struct ypmaplist *ypml_next;
|
||||
};
|
||||
|
||||
struct ypresp_maplist {
|
||||
unsigned int status;
|
||||
struct ypmaplist *list;
|
||||
};
|
||||
|
||||
/* ypserv procedure numbers */
|
||||
#define YPPROC_NULL ((unsigned long)0)
|
||||
#define YPPROC_DOMAIN ((unsigned long)1)
|
||||
#define YPPROC_DOMAIN_NONACK ((unsigned long)2)
|
||||
#define YPPROC_MATCH ((unsigned long)3)
|
||||
#define YPPROC_FIRST ((unsigned long)4)
|
||||
#define YPPROC_NEXT ((unsigned long)5)
|
||||
#define YPPROC_XFR ((unsigned long)6)
|
||||
#define YPPROC_CLEAR ((unsigned long)7)
|
||||
#define YPPROC_ALL ((unsigned long)8)
|
||||
#define YPPROC_MASTER ((unsigned long)9)
|
||||
#define YPPROC_ORDER ((unsigned long)10)
|
||||
#define YPPROC_MAPLIST ((unsigned long)11)
|
||||
|
||||
/* ypserv procedure return status values */
|
||||
#define YP_TRUE ((unsigned int)1) /* general purpose success code */
|
||||
#define YP_NOMORE ((unsigned int)2) /* no more entries in map */
|
||||
#define YP_FALSE ((unsigned int)0) /* general purpose failure code */
|
||||
#define YP_NOMAP ((unsigned int)-1) /* no such map in domain */
|
||||
#define YP_NODOM ((unsigned int)-2) /* domain not supported */
|
||||
#define YP_NOKEY ((unsigned int)-3) /* no such key in map */
|
||||
#define YP_BADOP ((unsigned int)-4) /* invalid operation */
|
||||
#define YP_BADDB ((unsigned int)-5) /* server data base is bad */
|
||||
#define YP_YPERR ((unsigned int)-6) /* YP server error */
|
||||
#define YP_BADARGS ((unsigned int)-7) /* request arguments bad */
|
||||
#define YP_VERS ((unsigned int)-8) /* YP server version mismatch */
|
||||
|
||||
/*
|
||||
* Sun's header file says:
|
||||
* "Domain binding data structure, used by ypclnt package and ypserv modules.
|
||||
* Users of the ypclnt package (or of this protocol) don't HAVE to know about
|
||||
* it, but it must be available to users because _yp_dobind is a public
|
||||
* interface."
|
||||
*
|
||||
* This is totally bogus! Nowhere else does Sun state that _yp_dobind() is
|
||||
* a public interface, and I don't know any reason anyone would want to call
|
||||
* it. But, just in case anyone does actually expect it to be available..
|
||||
* we provide this.. exactly as Sun wants it.
|
||||
*/
|
||||
struct dom_binding {
|
||||
struct dom_binding *dom_pnext;
|
||||
char dom_domain[YPMAXDOMAIN + 1];
|
||||
struct sockaddr_in dom_server_addr;
|
||||
u_short dom_server_port;
|
||||
int dom_socket;
|
||||
CLIENT *dom_client;
|
||||
u_short dom_local_port;
|
||||
long dom_vers;
|
||||
};
|
||||
|
||||
/*
|
||||
* YPBIND PROTOCOL:
|
||||
*
|
||||
* ypbind supports the following procedures:
|
||||
*
|
||||
* YPBINDPROC_NULL takes (void), returns (void).
|
||||
* to check if ypbind is running.
|
||||
* YPBINDPROC_DOMAIN takes (char *), returns (struct ypbind_resp).
|
||||
* requests that ypbind start to serve the
|
||||
* named domain (if it doesn't already)
|
||||
* YPBINDPROC_SETDOM takes (struct ypbind_setdom), returns (void).
|
||||
* used by ypset.
|
||||
*/
|
||||
|
||||
#define YPBINDPROG ((unsigned long)100007)
|
||||
#define YPBINDVERS ((unsigned long)2)
|
||||
#define YPBINDVERS_ORIG ((unsigned long)1)
|
||||
|
||||
/* ypbind procedure numbers */
|
||||
#define YPBINDPROC_NULL ((unsigned long)0)
|
||||
#define YPBINDPROC_DOMAIN ((unsigned long)1)
|
||||
#define YPBINDPROC_SETDOM ((unsigned long)2)
|
||||
|
||||
/* error code in ypbind_resp.ypbind_status */
|
||||
enum ypbind_resptype {
|
||||
YPBIND_SUCC_VAL = 1,
|
||||
YPBIND_FAIL_VAL = 2
|
||||
};
|
||||
|
||||
/* network order, of course */
|
||||
struct ypbind_binding {
|
||||
struct in_addr ypbind_binding_addr;
|
||||
uint16_t ypbind_binding_port;
|
||||
};
|
||||
|
||||
struct ypbind_resp {
|
||||
enum ypbind_resptype ypbind_status;
|
||||
union {
|
||||
unsigned int ypbind_error;
|
||||
struct ypbind_binding ypbind_bindinfo;
|
||||
} ypbind_respbody;
|
||||
};
|
||||
|
||||
/* error code in ypbind_resp.ypbind_respbody.ypbind_error */
|
||||
#define YPBIND_ERR_ERR 1 /* internal error */
|
||||
#define YPBIND_ERR_NOSERV 2 /* no bound server for passed domain */
|
||||
#define YPBIND_ERR_RESC 3 /* system resource allocation failure */
|
||||
|
||||
/*
|
||||
* Request data structure for ypbind "Set domain" procedure.
|
||||
*/
|
||||
struct ypbind_setdom {
|
||||
char ypsetdom_domain[YPMAXDOMAIN + 1];
|
||||
struct ypbind_binding ypsetdom_binding;
|
||||
unsigned int ypsetdom_vers;
|
||||
};
|
||||
#define ypsetdom_addr ypsetdom_binding.ypbind_binding_addr
|
||||
#define ypsetdom_port ypsetdom_binding.ypbind_binding_port
|
||||
|
||||
/*
|
||||
* YPPUSH PROTOCOL:
|
||||
*
|
||||
* Sun says:
|
||||
* "Protocol between clients (ypxfr, only) and yppush
|
||||
* yppush speaks a protocol in the transient range, which
|
||||
* is supplied to ypxfr as a command-line parameter when it
|
||||
* is activated by ypserv."
|
||||
*
|
||||
* This protocol is not implimented, naturally, because this YP
|
||||
* implimentation only does the client side.
|
||||
*/
|
||||
#define YPPUSHVERS ((unsigned long)1)
|
||||
#define YPPUSHVERS_ORIG ((unsigned long)1)
|
||||
|
||||
/* yppush procedure numbers */
|
||||
#define YPPUSHPROC_NULL ((unsigned long)0)
|
||||
#define YPPUSHPROC_XFRRESP ((unsigned long)1)
|
||||
|
||||
struct yppushresp_xfr {
|
||||
unsigned int transid;
|
||||
unsigned int status;
|
||||
};
|
||||
|
||||
/* yppush status value in yppushresp_xfr.status */
|
||||
#define YPPUSH_SUCC ((unsigned int)1) /* Success */
|
||||
#define YPPUSH_AGE ((unsigned int)2) /* Master's version not newer */
|
||||
#define YPPUSH_NOMAP ((unsigned int)-1) /* Can't find server for map */
|
||||
#define YPPUSH_NODOM ((unsigned int)-2) /* Domain not supported */
|
||||
#define YPPUSH_RSRC ((unsigned int)-3) /* Local resource alloc failure */
|
||||
#define YPPUSH_RPC ((unsigned int)-4) /* RPC failure talking to server */
|
||||
#define YPPUSH_MADDR ((unsigned int)-5) /* Can't get master address */
|
||||
#define YPPUSH_YPERR ((unsigned int)-6) /* YP server/map db error */
|
||||
#define YPPUSH_BADARGS ((unsigned int)-7) /* Request arguments bad */
|
||||
#define YPPUSH_DBM ((unsigned int)-8) /* Local dbm operation failed */
|
||||
#define YPPUSH_FILE ((unsigned int)-9) /* Local file I/O operation failed */
|
||||
#define YPPUSH_SKEW ((unsigned int)-10) /* Map version skew during transfer */
|
||||
#define YPPUSH_CLEAR ((unsigned int)-11) /* Can't send "Clear" req to local ypserv */
|
||||
#define YPPUSH_FORCE ((unsigned int)-12) /* No local order number in map - use -f */
|
||||
#define YPPUSH_XFRERR ((unsigned int)-13) /* ypxfr error */
|
||||
#define YPPUSH_REFUSED ((unsigned int)-14) /* Transfer request refused by ypserv */
|
||||
|
||||
struct ypall_callback;
|
||||
|
||||
__BEGIN_DECLS
|
||||
bool_t xdr_domainname(XDR *, char *); /* obsolete */
|
||||
bool_t xdr_peername(XDR *, char *); /* obsolete */
|
||||
bool_t xdr_mapname(XDR *, char *); /* obsolete */
|
||||
bool_t xdr_datum(XDR *, datum *);
|
||||
bool_t xdr_ypdomain_wrap_string(XDR *, char **);
|
||||
bool_t xdr_ypmap_wrap_string(XDR *, char **);
|
||||
bool_t xdr_ypreq_key(XDR *, struct ypreq_key *);
|
||||
bool_t xdr_ypreq_nokey(XDR *, struct ypreq_nokey *);
|
||||
bool_t xdr_ypreq_xfr(XDR *, struct ypreq_xfr *);
|
||||
bool_t xdr_ypresp_val(XDR *, struct ypresp_val *);
|
||||
bool_t xdr_ypresp_key_val(XDR *, struct ypresp_key_val *);
|
||||
bool_t xdr_ypmap_parms(XDR *, struct ypmap_parms *);
|
||||
bool_t xdr_ypowner_wrap_string(XDR *, char **);
|
||||
bool_t xdr_yppushresp_xfr(XDR *, struct yppushresp_xfr *);
|
||||
bool_t xdr_ypresp_order(XDR *, struct ypresp_order *);
|
||||
bool_t xdr_ypresp_master(XDR *, struct ypresp_master *);
|
||||
bool_t xdr_ypall(XDR *, struct ypall_callback *);
|
||||
bool_t xdr_ypresp_maplist(XDR *, struct ypresp_maplist *);
|
||||
bool_t xdr_ypbind_resp(XDR *, struct ypbind_resp *);
|
||||
bool_t xdr_ypbind_setdom(XDR *, struct ypbind_setdom *);
|
||||
bool_t xdr_ypmaplist(XDR *, struct ypmaplist *);
|
||||
bool_t xdr_yp_inaddr(XDR *, struct in_addr *);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _RPCSVC_YP_PROT_H_ */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user