Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/include Import selected changes from bind9. Follow the copyr...



details:   https://anonhg.NetBSD.org/src/rev/a213e05f76c1
branches:  trunk
changeset: 566801:a213e05f76c1
user:      christos <christos%NetBSD.org@localhost>
date:      Fri May 21 02:14:39 2004 +0000

description:
Import selected changes from bind9. Follow the copyright structure there.

diffstat:

 include/netdb.h |  111 ++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 68 insertions(+), 43 deletions(-)

diffs (219 lines):

diff -r d18fc32e70fc -r a213e05f76c1 include/netdb.h
--- a/include/netdb.h   Fri May 21 01:53:17 2004 +0000
+++ b/include/netdb.h   Fri May 21 02:14:39 2004 +0000
@@ -1,35 +1,6 @@
-/*     $NetBSD: netdb.h,v 1.38 2004/05/08 18:55:23 kleink Exp $        */
+/*     $NetBSD: netdb.h,v 1.39 2004/05/21 02:14:39 christos Exp $      */
 
 /*
- * 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. 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 (c) 1980, 1983, 1988, 1993
  *     The Regents of the University of California.  All rights reserved.
  *
@@ -56,19 +27,16 @@
  * 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.
- *
- *      @(#)netdb.h    8.1 (Berkeley) 6/2/93
- *     Id: netdb.h,v 4.9.1.2 1993/05/17 09:59:01 vixie Exp
  * -
  * 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
@@ -78,11 +46,47 @@
  * 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.12.2.1.4.4 2004/03/16 02:19:19 marka Exp
+ */
+
 #ifndef _NETDB_H_
-#define _NETDB_H_
+#define        _NETDB_H_
 
 #include <machine/ansi.h>
 #include <machine/endian_machdep.h>
@@ -90,13 +94,12 @@
 #include <sys/cdefs.h>
 #include <sys/featuretest.h>
 #include <inttypes.h>
-
 /*
  * Data types
  */
 #ifndef socklen_t
 typedef __socklen_t    socklen_t;
-#define socklen_t      __socklen_t
+#define        socklen_t       __socklen_t
 #endif
 
 #ifdef  _BSD_SIZE_T_
@@ -105,14 +108,26 @@
 #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
+#endif
 
+__BEGIN_DECLS
 extern int h_errno;
+__END_DECLS
 
 /*
  * Structures returned by network data base library.  All addresses are
@@ -125,7 +140,7 @@
        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 compatibility */
+#define        h_addr  h_addr_list[0]  /* address, for backward compatiblity */
 };
 
 /*
@@ -201,7 +216,7 @@
 #define        NETDB_SUCCESS   0       /* no problem */
 #endif
 #define        HOST_NOT_FOUND  1 /* Authoritative Answer Host not found */
-#define        TRY_AGAIN       2 /* Non-Authoritative Host not found, or SERVERFAIL */
+#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)
@@ -241,6 +256,14 @@
 /* valid flags for addrinfo (not a standard def, apps should not use it) */
 #define        AI_MASK \
     (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV)
+
+/*
+ * Flag values for getipnodebyname()
+ */
+#define        AI_V4MAPPED     0x00000008
+#define        AI_ALL          0x00000010
+#define        AI_ADDRCONFIG   0x00000020
+#define        AI_DEFAULT      (AI_V4MAPPED|AI_ADDRCONFIG)
 #endif
 
 #if (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 520 || \
@@ -262,14 +285,15 @@
 #define        NI_NUMERICSERV  0x00000008
 #define        NI_DGRAM        0x00000010
 #if defined(_NETBSD_SOURCE)
-#define        NI_WITHSCOPEID  0x00000020      /*KAME extension*/
+#define        NI_WITHSCOPEID  0x00000020
 #endif
+#define        NI_NUMERICSCOPE 0x00000040
 
 /*
  * Scope delimit character
  */
 #if defined(_NETBSD_SOURCE)
-#define        SCOPE_DELIMITER '%'             /*KAME extension*/
+#define        SCOPE_DELIMITER '%'
 #endif
 #endif /* (_POSIX_C_SOURCE - 0) >= 200112L || ... */
 
@@ -316,12 +340,13 @@
 void           setprotoent __P((int));
 #if (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 520 || \
     defined(_NETBSD_SOURCE)
+void           setservent __P((int));
 int            getaddrinfo __P((const char *, const char *,
                                 const struct addrinfo *, struct addrinfo **));
 int            getnameinfo __P((const struct sockaddr *, socklen_t, char *,
                                 socklen_t, char *, socklen_t, int));
 void           freeaddrinfo __P((struct addrinfo *));
-char           *gai_strerror __P((int));
+const char     *gai_strerror __P((int));
 #endif
 void           setservent __P((int));
 



Home | Main Index | Thread Index | Old Index