diff options
author | dougb <dougb@FreeBSD.org> | 2009-05-31 00:11:36 +0000 |
---|---|---|
committer | dougb <dougb@FreeBSD.org> | 2009-05-31 00:11:36 +0000 |
commit | fd553238c94c3abfef11bfdfc5cb05b32cbe5f76 (patch) | |
tree | 72d567a9bc3fb8adcfcbaa9baedc122d53071209 /lib/isc/include | |
parent | d342cb576b0154d48c90bc32e251331282264cd4 (diff) | |
download | FreeBSD-src-fd553238c94c3abfef11bfdfc5cb05b32cbe5f76.zip FreeBSD-src-fd553238c94c3abfef11bfdfc5cb05b32cbe5f76.tar.gz |
Vendor import of BIND 9.6.1rc1
Diffstat (limited to 'lib/isc/include')
74 files changed, 1409 insertions, 370 deletions
diff --git a/lib/isc/include/Makefile.in b/lib/isc/include/Makefile.in index ceb8eb6..04778d7 100644 --- a/lib/isc/include/Makefile.in +++ b/lib/isc/include/Makefile.in @@ -1,7 +1,7 @@ -# Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") # Copyright (C) 1998-2001 Internet Software Consortium. # -# Permission to use, copy, modify, and distribute this software for any +# 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. # @@ -13,7 +13,7 @@ # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -# $Id: Makefile.in,v 1.11 2004/03/05 05:10:53 marka Exp $ +# $Id: Makefile.in,v 1.13 2007/06/19 23:47:18 tbox Exp $ srcdir = @srcdir@ VPATH = @srcdir@ diff --git a/lib/isc/include/isc/Makefile.in b/lib/isc/include/isc/Makefile.in index 0f0e936..def1180 100644 --- a/lib/isc/include/isc/Makefile.in +++ b/lib/isc/include/isc/Makefile.in @@ -1,7 +1,7 @@ -# Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") # Copyright (C) 1998-2001, 2003 Internet Software Consortium. # -# Permission to use, copy, modify, and distribute this software for any +# 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. # @@ -13,7 +13,7 @@ # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -# $Id: Makefile.in,v 1.54.18.4 2006/01/27 23:57:45 marka Exp $ +# $Id: Makefile.in,v 1.64.12.2 2009/02/12 23:47:22 tbox Exp $ srcdir = @srcdir@ VPATH = @srcdir@ @@ -30,14 +30,18 @@ HEADERS = app.h assertions.h base64.h bitstring.h boolean.h buffer.h \ bufferlist.h commandline.h entropy.h error.h event.h \ eventclass.h file.h formatcheck.h fsaccess.h \ hash.h heap.h hex.h hmacmd5.h \ - interfaceiter.h @ISC_IPV6_H@ lang.h lex.h \ - lfsr.h lib.h list.h log.h magic.h md5.h mem.h msgcat.h msgs.h \ + httpd.h \ + interfaceiter.h @ISC_IPV6_H@ iterated_hash.h lang.h lex.h \ + lfsr.h lib.h list.h log.h \ + magic.h md5.h mem.h msgcat.h msgs.h \ mutexblock.h netaddr.h ondestroy.h os.h parseint.h \ - print.h quota.h random.h ratelimiter.h \ + print.h quota.h radix.h random.h ratelimiter.h \ refcount.h region.h resource.h \ result.h resultclass.h rwlock.h serial.h sha1.h sha2.h \ - sockaddr.h socket.h stdio.h stdlib.h string.h symtab.h \ - task.h taskpool.h timer.h types.h util.h version.h + sockaddr.h socket.h stdio.h stdlib.h string.h \ + symtab.h \ + task.h taskpool.h timer.h types.h util.h version.h \ + xml.h SUBDIRS = TARGETS = diff --git a/lib/isc/include/isc/app.h b/lib/isc/include/isc/app.h index f51aff7..c4d54cb 100644 --- a/lib/isc/include/isc/app.h +++ b/lib/isc/include/isc/app.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: app.h,v 1.2.18.2 2005/04/29 00:16:52 marka Exp $ */ +/* $Id: app.h,v 1.8 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_APP_H #define ISC_APP_H 1 @@ -24,7 +24,7 @@ ***** Module Info *****/ -/*! \file +/*! \file isc/app.h * \brief ISC Application Support * * Dealing with program termination can be difficult, especially in a diff --git a/lib/isc/include/isc/assertions.h b/lib/isc/include/isc/assertions.h index fcf0eb8..b031152 100644 --- a/lib/isc/include/isc/assertions.h +++ b/lib/isc/include/isc/assertions.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1997-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -16,9 +16,9 @@ */ /* - * $Id: assertions.h,v 1.18.18.4 2008/10/15 23:46:06 tbox Exp $ + * $Id: assertions.h,v 1.26 2008/10/15 23:47:31 tbox Exp $ */ -/*! \file assertions.h +/*! \file isc/assertions.h */ #ifndef ISC_ASSERTIONS_H diff --git a/lib/isc/include/isc/base32.h b/lib/isc/include/isc/base32.h new file mode 100644 index 0000000..978a8db --- /dev/null +++ b/lib/isc/include/isc/base32.h @@ -0,0 +1,128 @@ +/* + * Copyright (C) 2008 Internet Systems Consortium, Inc. ("ISC") + * + * 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. + */ + +/* $Id: base32.h,v 1.3 2008/09/25 04:02:39 tbox Exp $ */ + +#ifndef ISC_BASE32_H +#define ISC_BASE32_H 1 + +/*! \file */ + +/* + * Routines for manipulating base 32 and base 32 hex encoded data. + * Based on RFC 4648. + * + * Base 32 hex preserves the sort order of data when it is encoded / + * decoded. + */ + +#include <isc/lang.h> +#include <isc/types.h> + +ISC_LANG_BEGINDECLS + +/*** + *** Functions + ***/ + +isc_result_t +isc_base32_totext(isc_region_t *source, int wordlength, + const char *wordbreak, isc_buffer_t *target); +isc_result_t +isc_base32hex_totext(isc_region_t *source, int wordlength, + const char *wordbreak, isc_buffer_t *target); +/*!< + * \brief Convert data into base32 encoded text. + * + * Notes: + *\li The base32 encoded text in 'target' will be divided into + * words of at most 'wordlength' characters, separated by + * the 'wordbreak' string. No parentheses will surround + * the text. + * + * Requires: + *\li 'source' is a region containing binary data + *\li 'target' is a text buffer containing available space + *\li 'wordbreak' points to a null-terminated string of + * zero or more whitespace characters + * + * Ensures: + *\li target will contain the base32 encoded version of the data + * in source. The 'used' pointer in target will be advanced as + * necessary. + */ + +isc_result_t +isc_base32_decodestring(const char *cstr, isc_buffer_t *target); +isc_result_t +isc_base32hex_decodestring(const char *cstr, isc_buffer_t *target); +/*!< + * \brief Decode a null-terminated base32 string. + * + * Requires: + *\li 'cstr' is non-null. + *\li 'target' is a valid buffer. + * + * Returns: + *\li #ISC_R_SUCCESS -- the entire decoded representation of 'cstring' + * fit in 'target'. + *\li #ISC_R_BADBASE32 -- 'cstr' is not a valid base32 encoding. + * + * Other error returns are any possible error code from: + *\li isc_lex_create(), + *\li isc_lex_openbuffer(), + *\li isc_base32_tobuffer(). + */ + +isc_result_t +isc_base32_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length); +isc_result_t +isc_base32hex_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length); +/*!< + * \brief Convert base32 encoded text from a lexer context into data. + * + * Requires: + *\li 'lex' is a valid lexer context + *\li 'target' is a buffer containing binary data + *\li 'length' is an integer + * + * Ensures: + *\li target will contain the data represented by the base32 encoded + * string parsed by the lexer. No more than length bytes will be read, + * if length is positive. The 'used' pointer in target will be + * advanced as necessary. + */ + +isc_result_t +isc_base32_decoderegion(isc_region_t *source, isc_buffer_t *target); +isc_result_t +isc_base32hex_decoderegion(isc_region_t *source, isc_buffer_t *target); +/*!< + * \brief Decode a packed (no white space permitted) base32 region. + * + * Requires: + *\li 'source' is a valid region. + *\li 'target' is a valid buffer. + * + * Returns: + *\li #ISC_R_SUCCESS -- the entire decoded representation of 'cstring' + * fit in 'target'. + *\li #ISC_R_BADBASE32 -- 'source' is not a valid base32 encoding. + */ + +ISC_LANG_ENDDECLS + +#endif /* ISC_BASE32_H */ diff --git a/lib/isc/include/isc/base64.h b/lib/isc/include/isc/base64.h index 26ffa48..e48ef2a 100644 --- a/lib/isc/include/isc/base64.h +++ b/lib/isc/include/isc/base64.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,12 +15,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: base64.h,v 1.16.18.2 2005/04/29 00:16:53 marka Exp $ */ +/* $Id: base64.h,v 1.22 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_BASE64_H #define ISC_BASE64_H 1 -/*! \file */ +/*! \file isc/base64.h */ #include <isc/lang.h> #include <isc/types.h> diff --git a/lib/isc/include/isc/bitstring.h b/lib/isc/include/isc/bitstring.h index 3e626b8..252d111 100644 --- a/lib/isc/include/isc/bitstring.h +++ b/lib/isc/include/isc/bitstring.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: bitstring.h,v 1.8.18.2 2005/04/29 00:16:53 marka Exp $ */ +/* $Id: bitstring.h,v 1.14 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_BITSTRING_H #define ISC_BITSTRING_H 1 @@ -24,7 +24,7 @@ ***** Module Info *****/ -/*! \file bitstring.h +/*! \file isc/bitstring.h * * \brief Bitstring manipulation functions. * diff --git a/lib/isc/include/isc/boolean.h b/lib/isc/include/isc/boolean.h index ad736fe..348b096 100644 --- a/lib/isc/include/isc/boolean.h +++ b/lib/isc/include/isc/boolean.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,12 +15,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: boolean.h,v 1.13.18.2 2005/04/29 00:16:53 marka Exp $ */ +/* $Id: boolean.h,v 1.19 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_BOOLEAN_H #define ISC_BOOLEAN_H 1 -/*! \file */ +/*! \file isc/boolean.h */ typedef enum { isc_boolean_false = 0, isc_boolean_true = 1 } isc_boolean_t; diff --git a/lib/isc/include/isc/buffer.h b/lib/isc/include/isc/buffer.h index a285e27..2a02d88 100644 --- a/lib/isc/include/isc/buffer.h +++ b/lib/isc/include/isc/buffer.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2002 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: buffer.h,v 1.43.18.2 2005/04/29 00:16:53 marka Exp $ */ +/* $Id: buffer.h,v 1.53 2008/09/25 04:02:39 tbox Exp $ */ #ifndef ISC_BUFFER_H #define ISC_BUFFER_H 1 @@ -24,7 +24,7 @@ ***** Module Info *****/ -/*! \file buffer.h +/*! \file isc/buffer.h * * \brief A buffer is a region of memory, together with a set of related subregions. * Buffers are used for parsing and I/O operations. @@ -112,7 +112,7 @@ #include <isc/types.h> /*! - * To make many functions be inline macros (via #define) define this. + * To make many functions be inline macros (via \#define) define this. * If it is undefined, a function will be used. */ /* #define ISC_BUFFER_USEINLINE */ @@ -168,13 +168,13 @@ ISC_LANG_BEGINDECLS struct isc_buffer { unsigned int magic; void *base; - /*@{*/ + /*@{*/ /*! The following integers are byte offsets from 'base'. */ unsigned int length; unsigned int used; unsigned int current; unsigned int active; - /*@}*/ + /*@}*/ /*! linkable */ ISC_LINK(isc_buffer_t) link; /*! private internal elements */ @@ -235,6 +235,26 @@ isc__buffer_init(isc_buffer_t *b, const void *base, unsigned int length); */ void +isc__buffer_initnull(isc_buffer_t *b); +/*!< + *\brief Initialize a buffer 'b' with a null data and zero length/ + */ + +void +isc_buffer_reinit(isc_buffer_t *b, void *base, unsigned int length); +/*!< + * \brief Make 'b' refer to the 'length'-byte region starting at base. + * Any existing data will be copied. + * + * Requires: + * + *\li 'length' > 0 AND length >= previous length + * + *\li 'base' is a pointer to a sequence of 'length' bytes. + * + */ + +void isc__buffer_invalidate(isc_buffer_t *b); /*!< * \brief Make 'b' an invalid buffer. @@ -539,6 +559,57 @@ isc__buffer_putuint32(isc_buffer_t *b, isc_uint32_t val); *\li The used pointer in 'b' is advanced by 4. */ +isc_uint64_t +isc_buffer_getuint48(isc_buffer_t *b); +/*!< + * \brief Read an unsigned 48-bit integer in network byte order from 'b', + * convert it to host byte order, and return it. + * + * Requires: + * + *\li 'b' is a valid buffer. + * + *\li The length of the available region of 'b' is at least 6. + * + * Ensures: + * + *\li The current pointer in 'b' is advanced by 6. + * + * Returns: + * + *\li A 48-bit unsigned integer (stored in a 64-bit integer). + */ + +void +isc__buffer_putuint48(isc_buffer_t *b, isc_uint64_t val); +/*!< + * \brief Store an unsigned 48-bit integer in host byte order from 'val' + * into 'b' in network byte order. + * + * Requires: + *\li 'b' is a valid buffer. + * + *\li The length of the unused region of 'b' is at least 6. + * + * Ensures: + *\li The used pointer in 'b' is advanced by 6. + */ + +void +isc__buffer_putuint24(isc_buffer_t *b, isc_uint32_t val); +/*!< + * Store an unsigned 24-bit integer in host byte order from 'val' + * into 'b' in network byte order. + * + * Requires: + *\li 'b' is a valid buffer. + * + * The length of the unused region of 'b' is at least 3. + * + * Ensures: + *\li The used pointer in 'b' is advanced by 3. + */ + void isc__buffer_putmem(isc_buffer_t *b, const unsigned char *base, unsigned int length); @@ -625,6 +696,8 @@ ISC_LANG_ENDDECLS (_b)->magic = ISC_BUFFER_MAGIC; \ } while (0) +#define ISC__BUFFER_INITNULL(_b) ISC__BUFFER_INIT(_b, NULL, 0) + #define ISC__BUFFER_INVALIDATE(_b) \ do { \ (_b)->magic = 0; \ @@ -752,6 +825,17 @@ ISC_LANG_ENDDECLS _cp[1] = (unsigned char)(_val2 & 0x00ffU); \ } while (0) +#define ISC__BUFFER_PUTUINT24(_b, _val) \ + do { \ + unsigned char *_cp; \ + isc_uint32_t _val2 = (_val); \ + _cp = isc_buffer_used(_b); \ + (_b)->used += 3; \ + _cp[0] = (unsigned char)((_val2 & 0xff0000U) >> 16); \ + _cp[1] = (unsigned char)((_val2 & 0xff00U) >> 8); \ + _cp[2] = (unsigned char)(_val2 & 0x00ffU); \ + } while (0) + #define ISC__BUFFER_PUTUINT32(_b, _val) \ do { \ unsigned char *_cp; \ @@ -766,6 +850,7 @@ ISC_LANG_ENDDECLS #if defined(ISC_BUFFER_USEINLINE) #define isc_buffer_init ISC__BUFFER_INIT +#define isc_buffer_initnull ISC__BUFFER_INITNULL #define isc_buffer_invalidate ISC__BUFFER_INVALIDATE #define isc_buffer_region ISC__BUFFER_REGION #define isc_buffer_usedregion ISC__BUFFER_USEDREGION @@ -784,9 +869,11 @@ ISC_LANG_ENDDECLS #define isc_buffer_putstr ISC__BUFFER_PUTSTR #define isc_buffer_putuint8 ISC__BUFFER_PUTUINT8 #define isc_buffer_putuint16 ISC__BUFFER_PUTUINT16 +#define isc_buffer_putuint24 ISC__BUFFER_PUTUINT24 #define isc_buffer_putuint32 ISC__BUFFER_PUTUINT32 #else #define isc_buffer_init isc__buffer_init +#define isc_buffer_initnull isc__buffer_initnull #define isc_buffer_invalidate isc__buffer_invalidate #define isc_buffer_region isc__buffer_region #define isc_buffer_usedregion isc__buffer_usedregion @@ -805,7 +892,13 @@ ISC_LANG_ENDDECLS #define isc_buffer_putstr isc__buffer_putstr #define isc_buffer_putuint8 isc__buffer_putuint8 #define isc_buffer_putuint16 isc__buffer_putuint16 +#define isc_buffer_putuint24 isc__buffer_putuint24 #define isc_buffer_putuint32 isc__buffer_putuint32 #endif +/* + * No inline method for this one (yet). + */ +#define isc_buffer_putuint48 isc__buffer_putuint48 + #endif /* ISC_BUFFER_H */ diff --git a/lib/isc/include/isc/bufferlist.h b/lib/isc/include/isc/bufferlist.h index 7fc2ecc..54e00c7 100644 --- a/lib/isc/include/isc/bufferlist.h +++ b/lib/isc/include/isc/bufferlist.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: bufferlist.h,v 1.11.18.2 2005/04/29 00:16:53 marka Exp $ */ +/* $Id: bufferlist.h,v 1.17 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_BUFFERLIST_H #define ISC_BUFFERLIST_H 1 @@ -24,7 +24,7 @@ ***** Module Info *****/ -/*! \file bufferlist.h +/*! \file isc/bufferlist.h * * *\brief Buffer lists have no synchronization. Clients must ensure exclusive diff --git a/lib/isc/include/isc/commandline.h b/lib/isc/include/isc/commandline.h index 5ece26f..384640a 100644 --- a/lib/isc/include/isc/commandline.h +++ b/lib/isc/include/isc/commandline.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,12 +15,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: commandline.h,v 1.10.18.2 2005/04/29 00:16:53 marka Exp $ */ +/* $Id: commandline.h,v 1.16 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_COMMANDLINE_H #define ISC_COMMANDLINE_H 1 -/*! \file */ +/*! \file isc/commandline.h */ #include <isc/boolean.h> #include <isc/lang.h> diff --git a/lib/isc/include/isc/entropy.h b/lib/isc/include/isc/entropy.h index 2890f6c..e9e59c4 100644 --- a/lib/isc/include/isc/entropy.h +++ b/lib/isc/include/isc/entropy.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: entropy.h,v 1.25.18.2 2005/04/29 00:16:54 marka Exp $ */ +/* $Id: entropy.h,v 1.32.332.2 2009/01/18 23:47:41 tbox Exp $ */ #ifndef ISC_ENTROPY_H #define ISC_ENTROPY_H 1 @@ -24,7 +24,7 @@ ***** Module Info *****/ -/*! \file entropy.h +/*! \file isc/entropy.h * \brief The entropy API * * \li MP: @@ -74,7 +74,7 @@ typedef void (*isc_entropystop_t)(isc_entropysource_t *source, void *arg); ***/ /*! - * \brief + * \brief * Extract only "good" data; return failure if there is not enough * data available and there are no sources which we can poll to get * data, or those sources are empty. @@ -103,7 +103,7 @@ typedef void (*isc_entropystop_t)(isc_entropysource_t *source, void *arg); /*! * \brief * Estimate the amount of entropy contained in the sample pool. - * If this is not set, the source will be gathered and perodically + * If this is not set, the source will be gathered and periodically * mixed into the entropy pool, but no increment in contained entropy * will be assumed. This flag only makes sense on sample sources. */ @@ -113,12 +113,12 @@ typedef void (*isc_entropystop_t)(isc_entropysource_t *source, void *arg); * For use with isc_entropy_usebestsource(). */ /*! - * \brief + * \brief * Use the keyboard as the only entropy source. */ #define ISC_ENTROPY_KEYBOARDYES 1 /*! - * \brief + * \brief * Never use the keyboard as an entropy source. */ #define ISC_ENTROPY_KEYBOARDNO 2 @@ -194,7 +194,7 @@ isc_entropy_createcallbacksource(isc_entropy_t *ent, void *arg, isc_entropysource_t **sourcep); /*!< - * \brief Create an entropy source that is polled via a callback. + * \brief Create an entropy source that is polled via a callback. * * This would * be used when keyboard input is used, or a GUI input method. It can @@ -220,7 +220,7 @@ isc_result_t isc_entropy_addsample(isc_entropysource_t *source, isc_uint32_t sample, isc_uint32_t extra); /*!< - * \brief Add a sample to the sample source. + * \brief Add a sample to the sample source. * * The sample MUST be a timestamp * that increases over time, with the exception of wrap-around for @@ -267,6 +267,13 @@ isc_entropy_stats(isc_entropy_t *ent, FILE *out); * \brief Dump some (trivial) stats to the stdio stream "out". */ +unsigned int +isc_entropy_status(isc_entropy_t *end); +/* + * Returns the number of bits the pool currently contains. This is just + * an estimate. + */ + isc_result_t isc_entropy_usebestsource(isc_entropy_t *ectx, isc_entropysource_t **source, const char *randomfile, int use_keyboard); @@ -275,11 +282,11 @@ isc_entropy_usebestsource(isc_entropy_t *ectx, isc_entropysource_t **source, * * Notes: *\li If "randomfile" is not NULL, open it with - * isc_entropy_createfilesource(). + * isc_entropy_createfilesource(). * *\li If "randomfile" is NULL and the system's random device was detected * when the program was configured and built, open that device with - * isc_entropy_createfilesource(). + * isc_entropy_createfilesource(). * *\li If "use_keyboard" is #ISC_ENTROPY_KEYBOARDYES, then always open * the keyboard as an entropy source (possibly in addition to diff --git a/lib/isc/include/isc/error.h b/lib/isc/include/isc/error.h index 3320ae9..efb9b5f 100644 --- a/lib/isc/include/isc/error.h +++ b/lib/isc/include/isc/error.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,12 +15,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: error.h,v 1.14.18.2 2005/04/29 00:16:54 marka Exp $ */ +/* $Id: error.h,v 1.20 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_ERROR_H #define ISC_ERROR_H 1 -/*! \file */ +/*! \file isc/error.h */ #include <stdarg.h> diff --git a/lib/isc/include/isc/event.h b/lib/isc/include/isc/event.h index f1b1d61..68fabb2 100644 --- a/lib/isc/include/isc/event.h +++ b/lib/isc/include/isc/event.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2002 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,12 +15,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: event.h,v 1.27.18.3 2005/04/29 00:16:54 marka Exp $ */ +/* $Id: event.h,v 1.34 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_EVENT_H #define ISC_EVENT_H 1 -/*! \file */ +/*! \file isc/event.h */ #include <isc/lang.h> #include <isc/types.h> diff --git a/lib/isc/include/isc/eventclass.h b/lib/isc/include/isc/eventclass.h index 71de715..9e6c145 100644 --- a/lib/isc/include/isc/eventclass.h +++ b/lib/isc/include/isc/eventclass.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: eventclass.h,v 1.14.18.2 2005/04/29 00:16:54 marka Exp $ */ +/* $Id: eventclass.h,v 1.18 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_EVENTCLASS_H #define ISC_EVENTCLASS_H 1 diff --git a/lib/isc/include/isc/file.h b/lib/isc/include/isc/file.h index 16b0075..c945734 100644 --- a/lib/isc/include/isc/file.h +++ b/lib/isc/include/isc/file.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,12 +15,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: file.h,v 1.27.18.2 2005/04/29 00:16:54 marka Exp $ */ +/* $Id: file.h,v 1.33.332.2 2009/01/18 23:47:41 tbox Exp $ */ #ifndef ISC_FILE_H #define ISC_FILE_H 1 -/*! \file */ +/*! \file isc/file.h */ #include <stdio.h> @@ -35,7 +35,7 @@ isc_file_settime(const char *file, isc_time_t *time); isc_result_t isc_file_getmodtime(const char *file, isc_time_t *time); /*!< - * \brief Get the time of last modication of a file. + * \brief Get the time of last modification of a file. * * Notes: *\li The time that is set is relative to the (OS-specific) epoch, as are @@ -204,7 +204,7 @@ isc_result_t isc_file_progname(const char *filename, char *buf, size_t buflen); /*!< * \brief Given an operating system specific file name "filename" - * referring to a program, return the canonical program name. + * referring to a program, return the canonical program name. * * * Any directory prefix or executable file name extension (if diff --git a/lib/isc/include/isc/formatcheck.h b/lib/isc/include/isc/formatcheck.h index 93c6232..51ce3ca 100644 --- a/lib/isc/include/isc/formatcheck.h +++ b/lib/isc/include/isc/formatcheck.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,12 +15,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: formatcheck.h,v 1.7.18.2 2005/04/29 00:16:54 marka Exp $ */ +/* $Id: formatcheck.h,v 1.13 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_FORMATCHECK_H #define ISC_FORMATCHECK_H 1 -/*! \file */ +/*! \file isc/formatcheck.h */ /*% * ISC_FORMAT_PRINTF(). diff --git a/lib/isc/include/isc/fsaccess.h b/lib/isc/include/isc/fsaccess.h index 70c4d7c..3b455e5 100644 --- a/lib/isc/include/isc/fsaccess.h +++ b/lib/isc/include/isc/fsaccess.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,18 +15,18 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: fsaccess.h,v 1.8.18.2 2005/04/29 00:16:55 marka Exp $ */ +/* $Id: fsaccess.h,v 1.14.332.2 2009/01/18 23:47:41 tbox Exp $ */ #ifndef ISC_FSACCESS_H #define ISC_FSACCESS_H 1 -/*! \file +/*! \file isc/fsaccess.h * \brief The ISC filesystem access module encapsulates the setting of file * and directory access permissions into one API that is meant to be * portable to multiple operating systems. * - * The two primary operating system flavors that are initially accomodated are - * POSIX and Windows NT 4.0 and later. The Windows NT access model is + * The two primary operating system flavors that are initially accommodated + * are POSIX and Windows NT 4.0 and later. The Windows NT access model is * considerable more flexible than POSIX's model (as much as I am loathe to * admit it), and so the ISC API has a higher degree of complexity than would * be needed to simply address POSIX's needs. @@ -88,7 +88,7 @@ * * The rest of this comment discusses a few of the incompatibilities * between the two systems that need more thought if this API is to - * be extended to accomodate them. + * be extended to accommodate them. * * The Windows standard access right "DELETE" doesn't have a direct * equivalent in the Unix world, so it isn't clear what should be done @@ -98,18 +98,19 @@ * of allowing users to create files in a directory but not delete or * rename them, it does not have a concept of allowing them to be deleted * if they are owned by the user trying to delete/rename. While it is - * probable that something could be cobbled together in NT 5 with inheritence, + * probable that something could be cobbled together in NT 5 with inheritance, * it can't really be done in NT 4 as a single property that you could * set on a directory. You'd need to coordinate something with file creation * so that every file created had DELETE set for the owner but noone else. * * On Unix systems, setting #ISC_FSACCESS_LISTDIRECTORY sets READ. - * ... setting either of #ISC_FSACCESS_(CREATE|DELETE)CHILD sets WRITE. + * ... setting either #ISC_FSACCESS_CREATECHILD or #ISC_FSACCESS_DELETECHILD + * sets WRITE. * ... setting #ISC_FSACCESS_ACCESSCHILD sets EXECUTE. * * On NT systems, setting #ISC_FSACCESS_LISTDIRECTORY sets FILE_LIST_DIRECTORY. - * ... setting ISC_FSACCESS_(CREATE|DELETE)CHILD sets - * FILE_(CREATE|DELETE)_CHILD independently. + * ... setting #ISC_FSACCESS_CREATECHILD sets FILE_CREATE_CHILD independently. + * ... setting #ISC_FSACCESS_DELETECHILD sets FILE_DELETE_CHILD independently. * ... setting #ISC_FSACCESS_ACCESSCHILD sets FILE_TRAVERSE. * * Unresolved: XXXDCL @@ -155,7 +156,7 @@ * Adding any permission bits beyond 0x200 would mean typedef'ing * isc_fsaccess_t as isc_uint64_t, and redefining this value to * reflect the new range of permission types, Probably to 21 for - * maximum flexibility. The number of bits has to accomodate all of + * maximum flexibility. The number of bits has to accommodate all of * the permission types, and three full sets of them have to fit * within an isc_fsaccess_t. */ diff --git a/lib/isc/include/isc/hash.h b/lib/isc/include/isc/hash.h index cd29cdf..da30a19 100644 --- a/lib/isc/include/isc/hash.h +++ b/lib/isc/include/isc/hash.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2003 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: hash.h,v 1.4.18.2 2005/04/29 00:16:55 marka Exp $ */ +/* $Id: hash.h,v 1.10.332.2 2009/01/18 23:47:41 tbox Exp $ */ #ifndef ISC_HASH_H #define ISC_HASH_H 1 @@ -24,7 +24,7 @@ ***** Module Info *****/ -/*! \file +/*! \file isc/hash.h * * \brief The hash API * provides an unpredictable hash value for variable length data. @@ -36,7 +36,7 @@ * in the random vector are unpredictable, the probability of hash * collision between arbitrary two different values is at most 1/2^16. * - * Altough the API is generic about the hash keys, it mainly expects + * Although the API is generic about the hash keys, it mainly expects * DNS names (and sometimes IPv4/v6 addresses) as inputs. It has an * upper limit of the input length, and may run slow to calculate the * hash values for large inputs. @@ -135,7 +135,7 @@ isc_hash_ctxinit(isc_hash_t *hctx); void isc_hash_init(void); /*!< - * \brief Initialize a hash object. + * \brief Initialize a hash object. * * It fills in the random vector with a proper * source of entropy, which is typically from the entropy object specified diff --git a/lib/isc/include/isc/heap.h b/lib/isc/include/isc/heap.h index d54a8d5..82c5982 100644 --- a/lib/isc/include/isc/heap.h +++ b/lib/isc/include/isc/heap.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1997-2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,12 +15,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: heap.h,v 1.17.18.3 2006/04/17 18:27:33 explorer Exp $ */ +/* $Id: heap.h,v 1.24.332.2 2009/01/18 23:47:41 tbox Exp $ */ #ifndef ISC_HEAP_H #define ISC_HEAP_H 1 -/*! \file */ +/*! \file isc/heap.h */ #include <isc/lang.h> #include <isc/types.h> @@ -28,7 +28,7 @@ ISC_LANG_BEGINDECLS /*% - * The comparision function returns ISC_TRUE if the first argument has + * The comparison function returns ISC_TRUE if the first argument has * higher priority than the second argument, and ISC_FALSE otherwise. */ typedef isc_boolean_t (*isc_heapcompare_t)(void *, void *); diff --git a/lib/isc/include/isc/hex.h b/lib/isc/include/isc/hex.h index 9124a9b..a5e2f53 100644 --- a/lib/isc/include/isc/hex.h +++ b/lib/isc/include/isc/hex.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,12 +15,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: hex.h,v 1.5.18.2 2005/04/29 00:16:55 marka Exp $ */ +/* $Id: hex.h,v 1.13 2008/09/25 04:02:39 tbox Exp $ */ #ifndef ISC_HEX_H #define ISC_HEX_H 1 -/*! \file */ +/*! \file isc/hex.h */ #include <isc/lang.h> #include <isc/types.h> @@ -56,7 +56,7 @@ isc_hex_totext(isc_region_t *source, int wordlength, */ isc_result_t -isc_hex_decodestring(char *cstr, isc_buffer_t *target); +isc_hex_decodestring(const char *cstr, isc_buffer_t *target); /*!< * \brief Decode a null-terminated hex string. * diff --git a/lib/isc/include/isc/hmacmd5.h b/lib/isc/include/isc/hmacmd5.h index 5c05675..fab9c58 100644 --- a/lib/isc/include/isc/hmacmd5.h +++ b/lib/isc/include/isc/hmacmd5.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,9 +15,9 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: hmacmd5.h,v 1.5.18.4 2006/01/27 23:57:45 marka Exp $ */ +/* $Id: hmacmd5.h,v 1.12 2007/06/19 23:47:18 tbox Exp $ */ -/*! \file +/*! \file isc/hmacmd5.h * \brief This is the header file for the HMAC-MD5 keyed hash algorithm * described in RFC2104. */ diff --git a/lib/isc/include/isc/hmacsha.h b/lib/isc/include/isc/hmacsha.h index fce645c5..362b37f 100644 --- a/lib/isc/include/isc/hmacsha.h +++ b/lib/isc/include/isc/hmacsha.h @@ -1,7 +1,7 @@ /* - * Copyright (C) 2005, 2006 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2005-2007 Internet Systems Consortium, Inc. ("ISC") * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -14,9 +14,9 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: hmacsha.h,v 1.2.2.3 2006/08/16 03:18:14 marka Exp $ */ +/* $Id: hmacsha.h,v 1.7 2007/06/19 23:47:18 tbox Exp $ */ -/* +/*! \file isc/hmacsha.h * This is the header file for the HMAC-SHA1, HMAC-SHA224, HMAC-SHA256, * HMAC-SHA334 and HMAC-SHA512 hash algorithm described in RFC 2104. */ diff --git a/lib/isc/include/isc/httpd.h b/lib/isc/include/isc/httpd.h new file mode 100644 index 0000000..ba7f900 --- /dev/null +++ b/lib/isc/include/isc/httpd.h @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2006-2008 Internet Systems Consortium, Inc. ("ISC") + * + * 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. + */ + +/* $Id: httpd.h,v 1.9 2008/08/08 05:06:49 marka Exp $ */ + +#ifndef ISC_HTTPD_H +#define ISC_HTTPD_H 1 + +/*! \file */ + +#include <isc/event.h> +#include <isc/eventclass.h> +#include <isc/types.h> +#include <isc/mutex.h> +#include <isc/task.h> + +#define HTTPD_EVENTCLASS ISC_EVENTCLASS(4300) +#define HTTPD_SHUTDOWN (HTTPD_EVENTCLASS + 0x0001) + +#define ISC_HTTPDMGR_FLAGSHUTTINGDOWN 0x00000001 + +/* + * Create a new http daemon which will send, once every time period, + * a http-like header followed by HTTP data. + */ +isc_result_t +isc_httpdmgr_create(isc_mem_t *mctx, isc_socket_t *sock, isc_task_t *task, + isc_httpdclientok_t *client_ok, + isc_httpdondestroy_t *ondestory, void *cb_arg, + isc_timermgr_t *tmgr, isc_httpdmgr_t **httpdp); + +void +isc_httpdmgr_shutdown(isc_httpdmgr_t **httpdp); + +isc_result_t +isc_httpdmgr_addurl(isc_httpdmgr_t *httpdmgr, const char *url, + isc_httpdaction_t *func, void *arg); + +isc_result_t +isc_httpd_response(isc_httpd_t *httpd); + +isc_result_t +isc_httpd_addheader(isc_httpd_t *httpd, const char *name, + const char *val); + +isc_result_t +isc_httpd_addheaderuint(isc_httpd_t *httpd, const char *name, int val); + +isc_result_t isc_httpd_endheaders(isc_httpd_t *httpd); + +#endif /* ISC_HTTPD_H */ diff --git a/lib/isc/include/isc/interfaceiter.h b/lib/isc/include/isc/interfaceiter.h index 12ec188..26d5dfb 100644 --- a/lib/isc/include/isc/interfaceiter.h +++ b/lib/isc/include/isc/interfaceiter.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: interfaceiter.h,v 1.11.18.2 2005/04/29 00:16:55 marka Exp $ */ +/* $Id: interfaceiter.h,v 1.17 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_INTERFACEITER_H #define ISC_INTERFACEITER_H 1 @@ -24,7 +24,7 @@ ***** Module Info *****/ -/*! \file +/*! \file isc/interfaceiter.h * \brief Iterates over the list of network interfaces. * * Interfaces whose address family is not supported are ignored and never diff --git a/lib/isc/include/isc/ipv6.h b/lib/isc/include/isc/ipv6.h index 7c88f2b..8054c9e 100644 --- a/lib/isc/include/isc/ipv6.h +++ b/lib/isc/include/isc/ipv6.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2002 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: ipv6.h,v 1.20.18.2 2005/04/29 00:16:56 marka Exp $ */ +/* $Id: ipv6.h,v 1.24 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_IPV6_H #define ISC_IPV6_H 1 diff --git a/lib/isc/include/isc/iterated_hash.h b/lib/isc/include/isc/iterated_hash.h new file mode 100644 index 0000000..a8173f0 --- /dev/null +++ b/lib/isc/include/isc/iterated_hash.h @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2008 Internet Systems Consortium, Inc. ("ISC") + * + * 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. + */ + +/* $Id: iterated_hash.h,v 1.3 2008/09/25 04:02:39 tbox Exp $ */ + +#ifndef ISC_ITERATED_HASH_H +#define ISC_ITERATED_HASH_H 1 + +#include <isc/lang.h> +#include <isc/sha1.h> + +/* + * The maximal hash length that can be encoded it a name + * using base32hex. floor(255/8)*5 + */ +#define NSEC3_MAX_HASH_LENGTH 155 + +/* + * The maximum has that can be encoded in a single label using + * base32hex. floor(63/8)*5 + */ +#define NSEC3_MAX_LABEL_HASH 35 + +ISC_LANG_BEGINDECLS + +int isc_iterated_hash(unsigned char out[NSEC3_MAX_HASH_LENGTH], + unsigned int hashalg, int iterations, + const unsigned char *salt, int saltlength, + const unsigned char *in, int inlength); + + +ISC_LANG_ENDDECLS + +#endif /* ISC_ITERATED_HASH_H */ diff --git a/lib/isc/include/isc/lang.h b/lib/isc/include/isc/lang.h index abe16f5..8c60866 100644 --- a/lib/isc/include/isc/lang.h +++ b/lib/isc/include/isc/lang.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,12 +15,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: lang.h,v 1.7.18.2 2005/04/29 00:16:56 marka Exp $ */ +/* $Id: lang.h,v 1.13 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_LANG_H #define ISC_LANG_H 1 -/*! \file */ +/*! \file isc/lang.h */ #ifdef __cplusplus #define ISC_LANG_BEGINDECLS extern "C" { diff --git a/lib/isc/include/isc/lex.h b/lib/isc/include/isc/lex.h index cb9cc18..8612150 100644 --- a/lib/isc/include/isc/lex.h +++ b/lib/isc/include/isc/lex.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: lex.h,v 1.30.18.5 2008/05/30 23:46:01 tbox Exp $ */ +/* $Id: lex.h,v 1.37 2008/05/30 23:47:01 tbox Exp $ */ #ifndef ISC_LEX_H #define ISC_LEX_H 1 diff --git a/lib/isc/include/isc/lfsr.h b/lib/isc/include/isc/lfsr.h index 0c2e845..d4d9707 100644 --- a/lib/isc/include/isc/lfsr.h +++ b/lib/isc/include/isc/lfsr.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,12 +15,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: lfsr.h,v 1.11.18.2 2005/04/29 00:16:56 marka Exp $ */ +/* $Id: lfsr.h,v 1.17 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_LFSR_H #define ISC_LFSR_H 1 -/*! \file */ +/*! \file isc/lfsr.h */ #include <isc/lang.h> #include <isc/types.h> diff --git a/lib/isc/include/isc/lib.h b/lib/isc/include/isc/lib.h index 45c547c..765cdfa 100644 --- a/lib/isc/include/isc/lib.h +++ b/lib/isc/include/isc/lib.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,12 +15,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: lib.h,v 1.8.18.2 2005/04/29 00:16:58 marka Exp $ */ +/* $Id: lib.h,v 1.14 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_LIB_H #define ISC_LIB_H 1 -/*! \file */ +/*! \file isc/lib.h */ #include <isc/types.h> #include <isc/lang.h> diff --git a/lib/isc/include/isc/list.h b/lib/isc/include/isc/list.h index 2adc33f..9338275 100644 --- a/lib/isc/include/isc/list.h +++ b/lib/isc/include/isc/list.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2006 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2006, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1997-2002 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: list.h,v 1.20.18.2 2006/06/06 00:11:41 marka Exp $ */ +/* $Id: list.h,v 1.24 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_LIST_H #define ISC_LIST_H 1 diff --git a/lib/isc/include/isc/log.h b/lib/isc/include/isc/log.h index c381775..c9ba808 100644 --- a/lib/isc/include/isc/log.h +++ b/lib/isc/include/isc/log.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2002 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,12 +15,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: log.h,v 1.47.18.3 2005/04/29 00:16:58 marka Exp $ */ +/* $Id: log.h,v 1.54.332.5 2009/02/16 02:04:05 marka Exp $ */ #ifndef ISC_LOG_H #define ISC_LOG_H 1 -/*! \file */ +/*! \file isc/log.h */ #include <stdio.h> #include <stdarg.h> @@ -86,7 +86,7 @@ /*@}*/ /*! - * \brief Used to name the categories used by a library. + * \brief Used to name the categories used by a library. * * An array of isc_logcategory * structures names each category, and the id value is initialized by calling @@ -107,13 +107,13 @@ struct isc_logmodule { /*% * The isc_logfile structure is initialized as part of an isc_logdestination - * before calling isc_log_createchannel(). + * before calling isc_log_createchannel(). * * When defining an #ISC_LOG_TOFILE * channel the name, versions and maximum_size should be set before calling * isc_log_createchannel(). To define an #ISC_LOG_TOFILEDESC channel set only * the stream before the call. - * + * * Setting maximum_size to zero implies no maximum. */ typedef struct isc_logfile { @@ -166,6 +166,7 @@ LIBISC_EXTERNAL_DATA extern isc_logmodule_t isc_modules[]; #define ISC_LOGMODULE_TIME (&isc_modules[1]) #define ISC_LOGMODULE_INTERFACE (&isc_modules[2]) #define ISC_LOGMODULE_TIMER (&isc_modules[3]) +#define ISC_LOGMODULE_FILE (&isc_modules[4]) ISC_LANG_BEGINDECLS @@ -477,7 +478,7 @@ isc_log_usechannel(isc_logconfig_t *lcfg, const char *name, * number of named channels.) When multiple channels of the same * name are defined, the most recent definition is found. * - *\li Specifing a very large number of channels for a category will have + *\li Specifying a very large number of channels for a category will have * a moderate impact on performance in isc_log_write(), as each * call looks up the category for the start of a linked list, which * it follows all the way to the end to find matching modules. The @@ -527,7 +528,7 @@ isc_log_usechannel(isc_logconfig_t *lcfg, const char *name, */ /* Attention: next four comments PRECEED code */ -/*! +/*! * \brief * Write a message to the log channels. * @@ -546,7 +547,7 @@ isc_log_usechannel(isc_logconfig_t *lcfg, const char *name, *\li lctx is a valid logging context. * *\li The category and module arguments must have ids that are in the - * range of known ids, as estabished by isc_log_registercategories() + * range of known ids, as established by isc_log_registercategories() * and isc_log_registermodules(). * *\li level != #ISC_LOG_DYNAMIC. ISC_LOG_DYNAMIC is used only to define @@ -585,7 +586,7 @@ ISC_FORMAT_PRINTF(5, 6); *\li lctx is a valid logging context. * *\li The category and module arguments must have ids that are in the - * range of known ids, as estabished by isc_log_registercategories() + * range of known ids, as established by isc_log_registercategories() * and isc_log_registermodules(). * *\li level != #ISC_LOG_DYNAMIC. ISC_LOG_DYNAMIC is used only to define @@ -633,8 +634,8 @@ isc_log_vwrite1(isc_log_t *lctx, isc_logcategory_t *category, ISC_FORMAT_PRINTF(5, 0); /*% - * These are four internationalized versions of the the isc_log_[v]write[1] - * functions. + * These are four internationalized versions of the isc_log_[v]write[1] + * functions. * * The only difference is that they take arguments for a message * catalog, message set, and message number, all immediately preceding the @@ -824,7 +825,7 @@ isc_log_opensyslog(const char *tag, int options, int facility); * declared facility. * \endcode * - *\li Zero effort has been made (yet) to accomodate systems with openlog() + *\li Zero effort has been made (yet) to accommodate systems with openlog() * that only takes two arguments, or to identify valid syslog * facilities or options for any given architecture. * diff --git a/lib/isc/include/isc/magic.h b/lib/isc/include/isc/magic.h index 045b54f..073de90 100644 --- a/lib/isc/include/isc/magic.h +++ b/lib/isc/include/isc/magic.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,12 +15,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: magic.h,v 1.12.18.2 2005/04/29 00:16:59 marka Exp $ */ +/* $Id: magic.h,v 1.18 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_MAGIC_H #define ISC_MAGIC_H 1 -/*! \file */ +/*! \file isc/magic.h */ typedef struct { unsigned int magic; diff --git a/lib/isc/include/isc/md5.h b/lib/isc/include/isc/md5.h index 3f9667e..5b0d785 100644 --- a/lib/isc/include/isc/md5.h +++ b/lib/isc/include/isc/md5.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,9 +15,9 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: md5.h,v 1.9.18.4 2006/02/01 00:10:34 marka Exp $ */ +/* $Id: md5.h,v 1.16 2007/06/19 23:47:18 tbox Exp $ */ -/*! \file +/*! \file isc/md5.h * \brief This is the header file for the MD5 message-digest algorithm. * * The algorithm is due to Ron Rivest. This code was diff --git a/lib/isc/include/isc/mem.h b/lib/isc/include/isc/mem.h index 2c3c54e..480a934 100644 --- a/lib/isc/include/isc/mem.h +++ b/lib/isc/include/isc/mem.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2006, 2008 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1997-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,12 +15,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: mem.h,v 1.59.18.11 2008/02/07 23:45:56 tbox Exp $ */ +/* $Id: mem.h,v 1.78.120.3 2009/02/11 03:07:01 jinmei Exp $ */ #ifndef ISC_MEM_H #define ISC_MEM_H 1 -/*! \file */ +/*! \file isc/mem.h */ #include <stdio.h> @@ -28,6 +28,7 @@ #include <isc/mutex.h> #include <isc/platform.h> #include <isc/types.h> +#include <isc/xml.h> ISC_LANG_BEGINDECLS @@ -93,7 +94,7 @@ LIBISC_EXTERNAL_DATA extern unsigned int isc_mem_debugging; /*!< * The variable isc_mem_debugging holds a set of flags for * turning certain memory debugging options on or off at - * runtime. Its is intialized to the value ISC_MEM_DEGBUGGING, + * runtime. It is initialized to the value ISC_MEM_DEGBUGGING, * which is 0 by default but may be overridden at compile time. * The following flags can be specified: * @@ -105,7 +106,7 @@ LIBISC_EXTERNAL_DATA extern unsigned int isc_mem_debugging; * Crash if a free doesn't match an allocation. * * \li #ISC_MEM_DEBUGUSAGE - * If a hi_water mark is set, print the maximium inuse memory + * If a hi_water mark is set, print the maximum inuse memory * every time it is raised once it exceeds the hi_water mark. * * \li #ISC_MEM_DEBUGSIZE @@ -153,11 +154,12 @@ LIBISC_EXTERNAL_DATA extern unsigned int isc_mem_debugging; #define isc_mem_get(c, s) isc__mem_get((c), (s) _ISC_MEM_FILELINE) #define isc_mem_allocate(c, s) isc__mem_allocate((c), (s) _ISC_MEM_FILELINE) +#define isc_mem_reallocate(c, p, s) isc__mem_reallocate((c), (p), (s) _ISC_MEM_FILELINE) #define isc_mem_strdup(c, p) isc__mem_strdup((c), (p) _ISC_MEM_FILELINE) #define isc_mempool_get(c) isc__mempool_get((c) _ISC_MEM_FILELINE) /*% - * isc_mem_putanddetach() is a convienence function for use where you + * isc_mem_putanddetach() is a convenience function for use where you * have a structure with an attached memory context. * * Given: @@ -340,12 +342,12 @@ isc_mem_setwater(isc_mem_t *mctx, isc_mem_water_t water, void *water_arg, * * When the memory usage of 'mctx' exceeds 'hiwater', * '(water)(water_arg, #ISC_MEM_HIWATER)' will be called. 'water' needs to - * call isc_mem_waterack() with #ISC_MEM_HIWATER to acknowlege the state + * call isc_mem_waterack() with #ISC_MEM_HIWATER to acknowledge the state * change. 'water' may be called multiple times. * * When the usage drops below 'lowater', 'water' will again be called, this * time with #ISC_MEM_LOWATER. 'water' need to calls isc_mem_waterack() with - * #ISC_MEM_LOWATER to acknowlege the change. + * #ISC_MEM_LOWATER to acknowledge the change. * * static void * water(void *arg, int mark) { @@ -359,6 +361,7 @@ isc_mem_setwater(isc_mem_t *mctx, isc_mem_water_t water, void *water_arg, * } * UNLOCK(&foo->marklock); * } + * * If 'water' is NULL then 'water_arg', 'hi_water' and 'lo_water' are * ignored and the state is reset. * @@ -371,7 +374,7 @@ isc_mem_setwater(isc_mem_t *mctx, isc_mem_water_t water, void *water_arg, void isc_mem_waterack(isc_mem_t *ctx, int mark); /*%< - * Called to acknowledge changes in signalled by calls to 'water'. + * Called to acknowledge changes in signaled by calls to 'water'. */ void @@ -398,6 +401,65 @@ isc_mem_checkdestroyed(FILE *file); * Fatally fails if there are still active contexts. */ +unsigned int +isc_mem_references(isc_mem_t *ctx); +/*%< + * Return the current reference count. + */ + +void +isc_mem_setname(isc_mem_t *ctx, const char *name, void *tag); +/*%< + * Name 'ctx'. + * + * Notes: + * + *\li Only the first 15 characters of 'name' will be copied. + * + *\li 'tag' is for debugging purposes only. + * + * Requires: + * + *\li 'ctx' is a valid ctx. + */ + +const char * +isc_mem_getname(isc_mem_t *ctx); +/*%< + * Get the name of 'ctx', as previously set using isc_mem_setname(). + * + * Requires: + *\li 'ctx' is a valid ctx. + * + * Returns: + *\li A non-NULL pointer to a null-terminated string. + * If the ctx has not been named, the string is + * empty. + */ + +void * +isc_mem_gettag(isc_mem_t *ctx); +/*%< + * Get the tag value for 'task', as previously set using isc_mem_setname(). + * + * Requires: + *\li 'ctx' is a valid ctx. + * + * Notes: + *\li This function is for debugging purposes only. + * + * Requires: + *\li 'ctx' is a valid task. + */ + +#ifdef HAVE_LIBXML2 +void +isc_mem_renderxml(xmlTextWriterPtr writer); +/*%< + * Render all contexts' statistics and status in XML for writer. + */ +#endif /* HAVE_LIBXML2 */ + /* * Memory pools */ @@ -451,7 +513,7 @@ isc_mempool_associatelock(isc_mempool_t *mpctx, isc_mutex_t *lock); * and it is also used to set or get internal state via the isc_mempool_get*() * and isc_mempool_set*() set of functions. * - * Mutiple pools can each share a single lock. For instance, if "manager" + * Multiple pools can each share a single lock. For instance, if "manager" * type object contained pools for various sizes of events, and each of * these pools used a common lock. Note that this lock must NEVER be used * by other than mempool routines once it is given to a pool, since that can @@ -551,6 +613,8 @@ void isc__mem_put(isc_mem_t *, void *, size_t _ISC_MEM_FLARG); void * isc__mem_allocate(isc_mem_t *, size_t _ISC_MEM_FLARG); +void * +isc__mem_reallocate(isc_mem_t *, void *, size_t _ISC_MEM_FLARG); void isc__mem_free(isc_mem_t *, void * _ISC_MEM_FLARG); char * diff --git a/lib/isc/include/isc/msgcat.h b/lib/isc/include/isc/msgcat.h index 813b57c..fe3d336 100644 --- a/lib/isc/include/isc/msgcat.h +++ b/lib/isc/include/isc/msgcat.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: msgcat.h,v 1.9.18.2 2005/04/29 00:16:59 marka Exp $ */ +/* $Id: msgcat.h,v 1.13 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_MSGCAT_H #define ISC_MSGCAT_H 1 diff --git a/lib/isc/include/isc/msgs.h b/lib/isc/include/isc/msgs.h index 0970647..d8f2787 100644 --- a/lib/isc/include/isc/msgs.h +++ b/lib/isc/include/isc/msgs.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,12 +15,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: msgs.h,v 1.9.18.4 2008/08/08 06:27:56 tbox Exp $ */ +/* $Id: msgs.h,v 1.17 2008/08/08 06:28:59 tbox Exp $ */ #ifndef ISC_MSGS_H #define ISC_MSGS_H 1 -/*! \file */ +/*! \file isc/msgs.h */ #include <isc/lib.h> /* Provide isc_msgcat global variable. */ #include <isc/msgcat.h> /* Provide isc_msgcat_*() functions. */ diff --git a/lib/isc/include/isc/mutexblock.h b/lib/isc/include/isc/mutexblock.h index fa244c9..65bf2bf 100644 --- a/lib/isc/include/isc/mutexblock.h +++ b/lib/isc/include/isc/mutexblock.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,12 +15,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: mutexblock.h,v 1.11.18.2 2005/04/29 00:17:00 marka Exp $ */ +/* $Id: mutexblock.h,v 1.17 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_MUTEXBLOCK_H #define ISC_MUTEXBLOCK_H 1 -/*! \file */ +/*! \file isc/mutexblock.h */ #include <isc/lang.h> #include <isc/mutex.h> diff --git a/lib/isc/include/isc/netaddr.h b/lib/isc/include/isc/netaddr.h index 06d063e..8bfdbce 100644 --- a/lib/isc/include/isc/netaddr.h +++ b/lib/isc/include/isc/netaddr.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2002 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,12 +15,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: netaddr.h,v 1.25.18.5 2005/07/28 04:58:47 marka Exp $ */ +/* $Id: netaddr.h,v 1.35.332.2 2009/01/18 23:47:41 tbox Exp $ */ #ifndef ISC_NETADDR_H #define ISC_NETADDR_H 1 -/*! \file */ +/*! \file isc/netaddr.h */ #include <isc/lang.h> #include <isc/net.h> @@ -36,7 +36,7 @@ ISC_LANG_BEGINDECLS struct isc_netaddr { unsigned int family; union { - struct in_addr in; + struct in_addr in; struct in6_addr in6; #ifdef ISC_PLATFORM_HAVESYSUNH char un[sizeof(((struct sockaddr_un *)0)->sun_path)]; @@ -48,13 +48,18 @@ struct isc_netaddr { isc_boolean_t isc_netaddr_equal(const isc_netaddr_t *a, const isc_netaddr_t *b); +/*%< + * Compare network addresses 'a' and 'b'. Return #ISC_TRUE if + * they are equal, #ISC_FALSE if not. + */ + isc_boolean_t isc_netaddr_eqprefix(const isc_netaddr_t *a, const isc_netaddr_t *b, unsigned int prefixlen); /*%< * Compare the 'prefixlen' most significant bits of the network - * addresses 'a' and 'b'. Return #ISC_TRUE if they are equal, - * #ISC_FALSE if not. + * addresses 'a' and 'b'. If 'b''s scope is zero then 'a''s scope is + * ignored. Return #ISC_TRUE if they are equal, #ISC_FALSE if not. */ isc_result_t @@ -166,7 +171,7 @@ isc_netaddr_prefixok(const isc_netaddr_t *na, unsigned int prefixlen); * Returns: * ISC_R_SUCCESS * ISC_R_RANGE prefixlen out of range - * ISC_R_NOTIMPLENTED unsupported family + * ISC_R_NOTIMPLEMENTED unsupported family * ISC_R_FAILURE extra bits. */ diff --git a/lib/isc/include/isc/netscope.h b/lib/isc/include/isc/netscope.h index d9bea54..ba4e792 100644 --- a/lib/isc/include/isc/netscope.h +++ b/lib/isc/include/isc/netscope.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2002 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,12 +15,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: netscope.h,v 1.5.18.2 2005/04/29 00:17:00 marka Exp $ */ +/* $Id: netscope.h,v 1.11 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_NETSCOPE_H #define ISC_NETSCOPE_H 1 -/*! \file */ +/*! \file isc/netscope.h */ ISC_LANG_BEGINDECLS diff --git a/lib/isc/include/isc/ondestroy.h b/lib/isc/include/isc/ondestroy.h index 035873c..64bd643 100644 --- a/lib/isc/include/isc/ondestroy.h +++ b/lib/isc/include/isc/ondestroy.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: ondestroy.h,v 1.8.18.2 2005/04/29 00:17:00 marka Exp $ */ +/* $Id: ondestroy.h,v 1.14 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_ONDESTROY_H #define ISC_ONDESTROY_H 1 @@ -25,7 +25,7 @@ ISC_LANG_BEGINDECLS -/*! \file +/*! \file isc/ondestroy.h * ondestroy handling. * * Any class ``X'' of objects that wants to send out notifications diff --git a/lib/isc/include/isc/os.h b/lib/isc/include/isc/os.h index b2b76d5..3cf59e2 100644 --- a/lib/isc/include/isc/os.h +++ b/lib/isc/include/isc/os.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,12 +15,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: os.h,v 1.6.18.2 2005/04/29 00:17:00 marka Exp $ */ +/* $Id: os.h,v 1.12 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_OS_H #define ISC_OS_H 1 -/*! \file */ +/*! \file isc/os.h */ #include <isc/lang.h> diff --git a/lib/isc/include/isc/parseint.h b/lib/isc/include/isc/parseint.h index 6940add..5047676 100644 --- a/lib/isc/include/isc/parseint.h +++ b/lib/isc/include/isc/parseint.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2001, 2002 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: parseint.h,v 1.3.18.2 2005/04/29 00:17:00 marka Exp $ */ +/* $Id: parseint.h,v 1.9 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_PARSEINT_H #define ISC_PARSEINT_H 1 @@ -23,7 +23,7 @@ #include <isc/lang.h> #include <isc/types.h> -/*! \file +/*! \file isc/parseint.h * \brief Parse integers, in a saner way than atoi() or strtoul() do. */ diff --git a/lib/isc/include/isc/platform.h.in b/lib/isc/include/isc/platform.h.in index afcd4df..1ed76b8 100644 --- a/lib/isc/include/isc/platform.h.in +++ b/lib/isc/include/isc/platform.h.in @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: platform.h.in,v 1.34.18.11 2008/06/24 23:45:55 tbox Exp $ */ +/* $Id: platform.h.in,v 1.48.84.2 2009/02/16 23:47:15 tbox Exp $ */ #ifndef ISC_PLATFORM_H #define ISC_PLATFORM_H 1 @@ -26,11 +26,6 @@ ***** Platform-dependent defines. *****/ -/* - * Define if the platform has <strings.h>. - */ -@ISC_PLATFORM_HAVESTRINGSH@ - /*** *** Network. ***/ @@ -99,29 +94,26 @@ @ISC_PLATFORM_NEEDPTON@ /*! \brief - * If this system needs inet_aton(), ISC_PLATFORM_NEEDATON will be defined. - */ -@ISC_PLATFORM_NEEDATON@ - -/*! \brief * If this system needs in_port_t, ISC_PLATFORM_NEEDPORTT will be defined. */ @ISC_PLATFORM_NEEDPORTT@ /*! \brief - * If the system needs strsep(), ISC_PLATFORM_NEEDSTRSEP will be defined. + * Define if the system has struct lifconf which is a extended struct ifconf + * for IPv6. */ -@ISC_PLATFORM_NEEDSTRSEP@ +@ISC_PLATFORM_HAVELIFCONF@ /*! \brief - * If the system needs strlcpy(), ISC_PLATFORM_NEEDSTRLCPY will be defined. + * Define if the system has struct if_laddrconf which is a extended struct + * ifconf for IPv6. */ -@ISC_PLATFORM_NEEDSTRLCPY@ +@ISC_PLATFORM_HAVEIF_LADDRCONF@ /*! \brief - * If the system needs strlcat(), ISC_PLATFORM_NEEDSTRLCAT will be defined. + * Define if the system has struct if_laddrreq. */ -@ISC_PLATFORM_NEEDSTRLCAT@ +@ISC_PLATFORM_HAVEIF_LADDRREQ@ /*! \brief * Define either ISC_PLATFORM_BSD44MSGHDR or ISC_PLATFORM_BSD43MSGHDR. @@ -129,10 +121,9 @@ @ISC_PLATFORM_MSGHDRFLAVOR@ /*! \brief - * Define if PTHREAD_ONCE_INIT should be surrounded by braces to - * prevent compiler warnings (such as with gcc on Solaris 2.8). + * Define if the system supports if_nametoindex. */ -@ISC_PLATFORM_BRACEPTHREADONCEINIT@ +@ISC_PLATFORM_HAVEIFNAMETOINDEX@ /*! \brief * Define on some UnixWare systems to fix erroneous definitions of various @@ -175,62 +166,74 @@ */ @ISC_PLATFORM_QUADFORMAT@ -/*! \brief - * Defined if we are using threads. +/*** + *** String functions. + ***/ +/* + * If the system needs strsep(), ISC_PLATFORM_NEEDSTRSEP will be defined. */ -@ISC_PLATFORM_USETHREADS@ +@ISC_PLATFORM_NEEDSTRSEP@ -/*! \brief - * Defined if unistd.h does not cause fd_set to be delared. +/* + * If the system needs strlcpy(), ISC_PLATFORM_NEEDSTRLCPY will be defined. */ -@ISC_PLATFORM_NEEDSYSSELECTH@ +@ISC_PLATFORM_NEEDSTRLCPY@ -/*! \brief - * Type used for resource limits. +/* + * If the system needs strlcat(), ISC_PLATFORM_NEEDSTRLCAT will be defined. */ -@ISC_PLATFORM_RLIMITTYPE@ +@ISC_PLATFORM_NEEDSTRLCAT@ -/*! \brief - * Define if your compiler supports "long long int". +/* + * Define if this system needs strtoul. */ -@ISC_PLATFORM_HAVELONGLONG@ +@ISC_PLATFORM_NEEDSTRTOUL@ -/*! \brief - * Define if the system has struct lifconf which is a extended struct ifconf - * for IPv6. +/* + * Define if this system needs memmove. */ -@ISC_PLATFORM_HAVELIFCONF@ +@ISC_PLATFORM_NEEDMEMMOVE@ -/*! \brief - * Define if the system has struct if_laddrconf which is a extended struct - * ifconf for IPv6. +/*** + *** Miscellaneous. + ***/ + +/* + * Defined if we are using threads. */ -@ISC_PLATFORM_HAVEIF_LADDRCONF@ +@ISC_PLATFORM_USETHREADS@ -/*! \brief - * Define if the system has struct if_laddrreq. +/* + * Defined if unistd.h does not cause fd_set to be delared. */ -@ISC_PLATFORM_HAVEIF_LADDRREQ@ +@ISC_PLATFORM_NEEDSYSSELECTH@ -/*! \brief - * Used to control how extern data is linked; needed for Win32 platforms. +/* + * Defined to <gssapi.h> or <gssapi/gssapi.h> for how to include + * the GSSAPI header. */ -@ISC_PLATFORM_USEDECLSPEC@ +@ISC_PLATFORM_GSSAPIHEADER@ -/*! \brief - * Define if the system supports if_nametoindex. +/* + * Type used for resource limits. */ -@ISC_PLATFORM_HAVEIFNAMETOINDEX@ +@ISC_PLATFORM_RLIMITTYPE@ -/*! \brief - * Define if this system needs strtoul. +/* + * Define if your compiler supports "long long int". */ -@ISC_PLATFORM_NEEDSTRTOUL@ +@ISC_PLATFORM_HAVELONGLONG@ -/*! \brief - * Define if this system needs memmove. +/* + * Define if PTHREAD_ONCE_INIT should be surrounded by braces to + * prevent compiler warnings (such as with gcc on Solaris 2.8). */ -@ISC_PLATFORM_NEEDMEMMOVE@ +@ISC_PLATFORM_BRACEPTHREADONCEINIT@ + +/* + * Used to control how extern data is linked; needed for Win32 platforms. + */ +@ISC_PLATFORM_USEDECLSPEC@ /* * Define if the platform has <sys/un.h>. @@ -244,6 +247,12 @@ @ISC_PLATFORM_HAVEXADD@ /* + * If the "xaddq" operation (64bit xadd) is available on this architecture, + * ISC_PLATFORM_HAVEXADDQ will be defined. + */ +@ISC_PLATFORM_HAVEXADDQ@ + +/* * If the "atomic swap" operation is available on this architecture, * ISC_PLATFORM_HAVEATOMICSTORE" will be defined. */ @@ -271,6 +280,15 @@ @ISC_PLATFORM_USESTDASM@ /* + * Define if the platform has <strings.h>. + */ +@ISC_PLATFORM_HAVESTRINGSH@ + +/*** + *** Windows dll support. + ***/ + +/* * Define if MacOS style of PPC assembly must be used. * e.g. "r6", not "6", for register six. */ diff --git a/lib/isc/include/isc/portset.h b/lib/isc/include/isc/portset.h index 6396e5c..dc1f856 100644 --- a/lib/isc/include/isc/portset.h +++ b/lib/isc/include/isc/portset.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2008, 2009 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -14,10 +14,10 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: portset.h,v 1.3.4.1 2008/06/24 03:42:10 marka Exp $ */ +/* $Id: portset.h,v 1.3.90.2 2009/01/18 23:47:41 tbox Exp $ */ /*! \file isc/portset.h - * \brief Transport Protocol Port Manipuration Module + * \brief Transport Protocol Port Manipulation Module * * This module provides simple utilities to handle a set of transport protocol * (UDP or TCP) port numbers, e.g., for creating an ACL list. An isc_portset_t diff --git a/lib/isc/include/isc/print.h b/lib/isc/include/isc/print.h index 95c6b1c..cd1e38e 100644 --- a/lib/isc/include/isc/print.h +++ b/lib/isc/include/isc/print.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001, 2003 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,12 +15,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: print.h,v 1.19.18.3 2005/06/08 02:07:56 marka Exp $ */ +/* $Id: print.h,v 1.26 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_PRINT_H #define ISC_PRINT_H 1 -/*! \file */ +/*! \file isc/print.h */ /*** *** Imports diff --git a/lib/isc/include/isc/quota.h b/lib/isc/include/isc/quota.h index 6f95cd5..7b0d0d9 100644 --- a/lib/isc/include/isc/quota.h +++ b/lib/isc/include/isc/quota.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: quota.h,v 1.10.18.4 2005/08/11 15:01:54 marka Exp $ */ +/* $Id: quota.h,v 1.16 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_QUOTA_H #define ISC_QUOTA_H 1 diff --git a/lib/isc/include/isc/radix.h b/lib/isc/include/isc/radix.h new file mode 100644 index 0000000..fbb1893 --- /dev/null +++ b/lib/isc/include/isc/radix.h @@ -0,0 +1,240 @@ +/* + * Copyright (C) 2007, 2008 Internet Systems Consortium, Inc. ("ISC") + * + * 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. + */ + +/* $Id: radix.h,v 1.11.44.2 2008/12/24 23:47:02 tbox Exp $ */ + +/* + * This source was adapted from MRT's RCS Ids: + * Id: radix.h,v 1.6 1999/08/03 03:32:53 masaki Exp + * Id: mrt.h,v 1.57.2.6 1999/12/28 23:41:27 labovit Exp + * Id: defs.h,v 1.5.2.2 2000/01/15 14:19:16 masaki Exp + */ + +#include <isc/magic.h> +#include <isc/types.h> +#include <isc/mutex.h> +#include <isc/net.h> +#include <isc/refcount.h> + +#include <string.h> + +#ifndef _RADIX_H +#define _RADIX_H + +#define NETADDR_TO_PREFIX_T(na,pt,bits) \ + do { \ + memset(&(pt), 0, sizeof(pt)); \ + if((na) != NULL) { \ + (pt).family = (na)->family; \ + (pt).bitlen = (bits); \ + if ((pt).family == AF_INET6) { \ + memcpy(&(pt).add.sin6, &(na)->type.in6, \ + ((bits)+7)/8); \ + } else \ + memcpy(&(pt).add.sin, &(na)->type.in, \ + ((bits)+7)/8); \ + } else { \ + (pt).family = AF_UNSPEC; \ + (pt).bitlen = 0; \ + } \ + isc_refcount_init(&(pt).refcount, 0); \ + } while(0) + +typedef struct isc_prefix { + unsigned int family; /* AF_INET | AF_INET6, or AF_UNSPEC for "any" */ + unsigned int bitlen; /* 0 for "any" */ + isc_refcount_t refcount; + union { + struct in_addr sin; + struct in6_addr sin6; + } add; +} isc_prefix_t; + +typedef void (*isc_radix_destroyfunc_t)(void *); +typedef void (*isc_radix_processfunc_t)(isc_prefix_t *, void **); + +#define isc_prefix_tochar(prefix) ((char *)&(prefix)->add.sin) +#define isc_prefix_touchar(prefix) ((u_char *)&(prefix)->add.sin) + +#define BIT_TEST(f, b) ((f) & (b)) + +/* + * We need "first match" when we search the radix tree to preserve + * compatibility with the existing ACL implementation. Radix trees + * naturally lend themselves to "best match". In order to get "first match" + * behavior, we keep track of the order in which entries are added to the + * tree--and when a search is made, we find all matching entries, and + * return the one that was added first. + * + * An IPv4 prefix and an IPv6 prefix may share a radix tree node if they + * have the same length and bit pattern (e.g., 127/8 and 7f::/8). To + * disambiguate between them, node_num and data are two-element arrays; + * node_num[0] and data[0] are used for IPv4 addresses, node_num[1] + * and data[1] for IPv6 addresses. The only exception is a prefix of + * 0/0 (aka "any" or "none"), which is always stored as IPv4 but matches + * IPv6 addresses too. + */ + +#define ISC_IS6(family) ((family) == AF_INET6 ? 1 : 0) +typedef struct isc_radix_node { + isc_uint32_t bit; /* bit length of the prefix */ + isc_prefix_t *prefix; /* who we are in radix tree */ + struct isc_radix_node *l, *r; /* left and right children */ + struct isc_radix_node *parent; /* may be used */ + void *data[2]; /* pointers to IPv4 and IPV6 data */ + int node_num[2]; /* which node this was in the tree, + or -1 for glue nodes */ +} isc_radix_node_t; + +#define RADIX_TREE_MAGIC ISC_MAGIC('R','d','x','T'); +#define RADIX_TREE_VALID(a) ISC_MAGIC_VALID(a, RADIX_TREE_MAGIC); + +typedef struct isc_radix_tree { + unsigned int magic; + isc_mem_t *mctx; + isc_radix_node_t *head; + isc_uint32_t maxbits; /* for IP, 32 bit addresses */ + int num_active_node; /* for debugging purposes */ + int num_added_node; /* total number of nodes */ +} isc_radix_tree_t; + +isc_result_t +isc_radix_search(isc_radix_tree_t *radix, isc_radix_node_t **target, + isc_prefix_t *prefix); +/*%< + * Search 'radix' for the best match to 'prefix'. + * Return the node found in '*target'. + * + * Requires: + * \li 'radix' to be valid. + * \li 'target' is not NULL and "*target" is NULL. + * \li 'prefix' to be valid. + * + * Returns: + * \li ISC_R_NOTFOUND + * \li ISC_R_SUCCESS + */ + +isc_result_t +isc_radix_insert(isc_radix_tree_t *radix, isc_radix_node_t **target, + isc_radix_node_t *source, isc_prefix_t *prefix); +/*%< + * Insert 'source' or 'prefix' into the radix tree 'radix'. + * Return the node added in 'target'. + * + * Requires: + * \li 'radix' to be valid. + * \li 'target' is not NULL and "*target" is NULL. + * \li 'prefix' to be valid or 'source' to be non NULL and contain + * a valid prefix. + * + * Returns: + * \li ISC_R_NOMEMORY + * \li ISC_R_SUCCESS + */ + +void +isc_radix_remove(isc_radix_tree_t *radix, isc_radix_node_t *node); +/*%< + * Remove the node 'node' from the radix tree 'radix'. + * + * Requires: + * \li 'radix' to be valid. + * \li 'node' to be valid. + */ + +isc_result_t +isc_radix_create(isc_mem_t *mctx, isc_radix_tree_t **target, int maxbits); +/*%< + * Create a radix tree with a maximum depth of 'maxbits'; + * + * Requires: + * \li 'mctx' to be valid. + * \li 'target' to be non NULL and '*target' to be NULL. + * \li 'maxbits' to be less than or equal to RADIX_MAXBITS. + * + * Returns: + * \li ISC_R_NOMEMORY + * \li ISC_R_SUCCESS + */ + +void +isc_radix_destroy(isc_radix_tree_t *radix, isc_radix_destroyfunc_t func); +/*%< + * Destroy a radix tree optionally calling 'func' to clean up node data. + * + * Requires: + * \li 'radix' to be valid. + */ + +void +isc_radix_process(isc_radix_tree_t *radix, isc_radix_processfunc_t func); +/*%< + * Walk a radix tree calling 'func' to process node data. + * + * Requires: + * \li 'radix' to be valid. + * \li 'func' to point to a function. + */ + +#define RADIX_MAXBITS 128 +#define RADIX_NBIT(x) (0x80 >> ((x) & 0x7f)) +#define RADIX_NBYTE(x) ((x) >> 3) + +#define RADIX_DATA_GET(node, type) (type *)((node)->data) +#define RADIX_DATA_SET(node, value) ((node)->data = (void *)(value)) + +#define RADIX_WALK(Xhead, Xnode) \ + do { \ + isc_radix_node_t *Xstack[RADIX_MAXBITS+1]; \ + isc_radix_node_t **Xsp = Xstack; \ + isc_radix_node_t *Xrn = (Xhead); \ + while ((Xnode = Xrn)) { \ + if (Xnode->prefix) + +#define RADIX_WALK_ALL(Xhead, Xnode) \ +do { \ + isc_radix_node_t *Xstack[RADIX_MAXBITS+1]; \ + isc_radix_node_t **Xsp = Xstack; \ + isc_radix_node_t *Xrn = (Xhead); \ + while ((Xnode = Xrn)) { \ + if (1) + +#define RADIX_WALK_BREAK { \ + if (Xsp != Xstack) { \ + Xrn = *(--Xsp); \ + } else { \ + Xrn = (radix_node_t *) 0; \ + } \ + continue; } + +#define RADIX_WALK_END \ + if (Xrn->l) { \ + if (Xrn->r) { \ + *Xsp++ = Xrn->r; \ + } \ + Xrn = Xrn->l; \ + } else if (Xrn->r) { \ + Xrn = Xrn->r; \ + } else if (Xsp != Xstack) { \ + Xrn = *(--Xsp); \ + } else { \ + Xrn = (isc_radix_node_t *) 0; \ + } \ + } \ + } while (0) + +#endif /* _RADIX_H */ diff --git a/lib/isc/include/isc/random.h b/lib/isc/include/isc/random.h index c5cef8b..9b6ca64 100644 --- a/lib/isc/include/isc/random.h +++ b/lib/isc/include/isc/random.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: random.h,v 1.12.18.2 2005/04/29 00:17:01 marka Exp $ */ +/* $Id: random.h,v 1.18.332.2 2009/01/18 23:47:41 tbox Exp $ */ #ifndef ISC_RANDOM_H #define ISC_RANDOM_H 1 @@ -23,9 +23,9 @@ #include <isc/lang.h> #include <isc/types.h> -/*! \file +/*! \file isc/random.h * \brief Implements a random state pool which will let the caller return a - * series of possibly non-reproducable random values. + * series of possibly non-reproducible random values. * * Note that the * strength of these numbers is not all that high, and should not be diff --git a/lib/isc/include/isc/ratelimiter.h b/lib/isc/include/isc/ratelimiter.h index 1944754..d18cf25 100644 --- a/lib/isc/include/isc/ratelimiter.h +++ b/lib/isc/include/isc/ratelimiter.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2002 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: ratelimiter.h,v 1.15.18.2 2005/04/29 00:17:01 marka Exp $ */ +/* $Id: ratelimiter.h,v 1.21.332.2 2009/01/18 23:47:41 tbox Exp $ */ #ifndef ISC_RATELIMITER_H #define ISC_RATELIMITER_H 1 @@ -24,7 +24,7 @@ ***** Module Info *****/ -/*! \file +/*! \file isc/ratelimiter.h * \brief A rate limiter is a mechanism for dispatching events at a limited * rate. This is intended to be used when sending zone maintenance * SOA queries, NOTIFY messages, etc. @@ -53,7 +53,7 @@ isc_ratelimiter_create(isc_mem_t *mctx, isc_timermgr_t *timermgr, isc_result_t isc_ratelimiter_setinterval(isc_ratelimiter_t *rl, isc_interval_t *interval); /*!< - * Set the mininum interval between event executions. + * Set the minimum interval between event executions. * The interval value is copied, so the caller need not preserve it. * * Requires: @@ -71,7 +71,7 @@ isc_result_t isc_ratelimiter_enqueue(isc_ratelimiter_t *rl, isc_task_t *task, isc_event_t **eventp); /*%< - * Queue an event for rate-limited execution. + * Queue an event for rate-limited execution. * * This is similar * to doing an isc_task_send() to the 'task', except that the @@ -102,7 +102,7 @@ isc_ratelimiter_shutdown(isc_ratelimiter_t *ratelimiter); *\li Further attempts to enqueue events will fail with * #ISC_R_SHUTTINGDOWN. * - *\li The reatelimiter is no longer attached to its task. + *\li The rate limiter is no longer attached to its task. */ void diff --git a/lib/isc/include/isc/refcount.h b/lib/isc/include/isc/refcount.h index b930465..6ab14ae 100644 --- a/lib/isc/include/isc/refcount.h +++ b/lib/isc/include/isc/refcount.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2001, 2003 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: refcount.h,v 1.6.18.5 2005/07/12 01:22:31 marka Exp $ */ +/* $Id: refcount.h,v 1.15 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_REFCOUNT_H #define ISC_REFCOUNT_H 1 @@ -27,7 +27,7 @@ #include <isc/types.h> #include <isc/util.h> -/*! \file +/*! \file isc/refcount.h * \brief Implements a locked reference counter. * * These functions may actually be diff --git a/lib/isc/include/isc/region.h b/lib/isc/include/isc/region.h index 9b651fe..43d8f8f 100644 --- a/lib/isc/include/isc/region.h +++ b/lib/isc/include/isc/region.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2002 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,12 +15,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: region.h,v 1.19.18.2 2005/04/29 00:17:01 marka Exp $ */ +/* $Id: region.h,v 1.25 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_REGION_H #define ISC_REGION_H 1 -/*! \file */ +/*! \file isc/region.h */ #include <isc/types.h> diff --git a/lib/isc/include/isc/resource.h b/lib/isc/include/isc/resource.h index 8c33c89..747c9fd 100644 --- a/lib/isc/include/isc/resource.h +++ b/lib/isc/include/isc/resource.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,12 +15,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: resource.h,v 1.5.18.4 2008/08/01 23:45:58 tbox Exp $ */ +/* $Id: resource.h,v 1.13 2008/07/11 23:47:09 tbox Exp $ */ #ifndef ISC_RESOURCE_H #define ISC_RESOURCE_H 1 -/*! \file */ +/*! \file isc/resource.h */ #include <isc/lang.h> #include <isc/types.h> diff --git a/lib/isc/include/isc/result.h b/lib/isc/include/isc/result.h index 0de3493..56b4ca6 100644 --- a/lib/isc/include/isc/result.h +++ b/lib/isc/include/isc/result.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001, 2003 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,11 +15,13 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: result.h,v 1.62.18.4 2005/06/22 22:05:49 marka Exp $ */ +/* $Id: result.h,v 1.71 2008/09/25 04:02:39 tbox Exp $ */ #ifndef ISC_RESULT_H #define ISC_RESULT_H 1 +/*! \file isc/result.h */ + #include <isc/lang.h> #include <isc/types.h> @@ -83,9 +85,10 @@ #define ISC_R_DISABLED 57 /*%< disabled */ #define ISC_R_MAXSIZE 58 /*%< max size */ #define ISC_R_BADADDRESSFORM 59 /*%< invalid address format */ +#define ISC_R_BADBASE32 60 /*%< bad base32 encoding */ /*% Not a result code: the number of results. */ -#define ISC_R_NRESULTS 60 +#define ISC_R_NRESULTS 61 ISC_LANG_BEGINDECLS diff --git a/lib/isc/include/isc/resultclass.h b/lib/isc/include/isc/resultclass.h index 5e20800..b32426f 100644 --- a/lib/isc/include/isc/resultclass.h +++ b/lib/isc/include/isc/resultclass.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,13 +15,13 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: resultclass.h,v 1.12.18.2 2005/04/29 00:17:02 marka Exp $ */ +/* $Id: resultclass.h,v 1.18 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_RESULTCLASS_H #define ISC_RESULTCLASS_H 1 -/*! \file +/*! \file isc/resultclass.h * \brief Registry of Predefined Result Type Classes * * A result class number is an unsigned 16 bit number. Each class may diff --git a/lib/isc/include/isc/rwlock.h b/lib/isc/include/isc/rwlock.h index 404f93c..28052cd 100644 --- a/lib/isc/include/isc/rwlock.h +++ b/lib/isc/include/isc/rwlock.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001, 2003 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,12 +15,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rwlock.h,v 1.21.18.3 2005/06/04 06:23:44 jinmei Exp $ */ +/* $Id: rwlock.h,v 1.28 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_RWLOCK_H #define ISC_RWLOCK_H 1 -/*! \file */ +/*! \file isc/rwlock.h */ #include <isc/condition.h> #include <isc/lang.h> diff --git a/lib/isc/include/isc/serial.h b/lib/isc/include/isc/serial.h index 86d9b2f..f7e3049 100644 --- a/lib/isc/include/isc/serial.h +++ b/lib/isc/include/isc/serial.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: serial.h,v 1.10.18.2 2005/04/29 00:17:02 marka Exp $ */ +/* $Id: serial.h,v 1.16.332.2 2009/01/18 23:47:41 tbox Exp $ */ #ifndef ISC_SERIAL_H #define ISC_SERIAL_H 1 @@ -23,8 +23,8 @@ #include <isc/lang.h> #include <isc/types.h> -/*! \file - * \brief Implement 32 bit serial space arithmetic comparision functions. +/*! \file isc/serial.h + * \brief Implement 32 bit serial space arithmetic comparison functions. * Note: Undefined results are returned as ISC_FALSE. */ diff --git a/lib/isc/include/isc/sha1.h b/lib/isc/include/isc/sha1.h index bb22f06..63f12bb 100644 --- a/lib/isc/include/isc/sha1.h +++ b/lib/isc/include/isc/sha1.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -18,11 +18,11 @@ #ifndef ISC_SHA1_H #define ISC_SHA1_H 1 -/* $Id: sha1.h,v 1.9.18.5 2006/08/16 03:18:14 marka Exp $ */ +/* $Id: sha1.h,v 1.17 2007/06/19 23:47:18 tbox Exp $ */ /* $NetBSD: sha1.h,v 1.2 1998/05/29 22:55:44 thorpej Exp $ */ -/*! \file +/*! \file isc/sha1.h * \brief SHA-1 in C * \author By Steve Reid <steve@edmweb.com> * \note 100% Public Domain diff --git a/lib/isc/include/isc/sha2.h b/lib/isc/include/isc/sha2.h index e54c620..211e255 100644 --- a/lib/isc/include/isc/sha2.h +++ b/lib/isc/include/isc/sha2.h @@ -1,7 +1,7 @@ /* - * Copyright (C) 2005, 2006 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2005-2007 Internet Systems Consortium, Inc. ("ISC") * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: sha2.h,v 1.2.2.6 2006/08/16 03:18:14 marka Exp $ */ +/* $Id: sha2.h,v 1.9 2007/06/19 23:47:18 tbox Exp $ */ /* $FreeBSD$ */ /* $KAME: sha2.h,v 1.3 2001/03/12 08:27:48 itojun Exp $ */ diff --git a/lib/isc/include/isc/sockaddr.h b/lib/isc/include/isc/sockaddr.h index 83412d2..62cc773 100644 --- a/lib/isc/include/isc/sockaddr.h +++ b/lib/isc/include/isc/sockaddr.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2003 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,12 +15,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: sockaddr.h,v 1.42.18.8 2006/03/02 00:37:22 marka Exp $ */ +/* $Id: sockaddr.h,v 1.55.332.2 2009/01/18 23:47:41 tbox Exp $ */ #ifndef ISC_SOCKADDR_H #define ISC_SOCKADDR_H 1 -/*! \file */ +/*! \file isc/sockaddr.h */ #include <isc/lang.h> #include <isc/net.h> @@ -84,6 +84,7 @@ isc_sockaddr_eqaddrprefix(const isc_sockaddr_t *a, const isc_sockaddr_t *b, /*%< * Return ISC_TRUE iff the most significant 'prefixlen' bits of the * socket addresses 'a' and 'b' are equal, ignoring the ports. + * If 'b''s scope is zero then 'a''s scope will be ignored. */ unsigned int @@ -209,7 +210,7 @@ isc_sockaddr_isexperimental(const isc_sockaddr_t *sa); isc_boolean_t isc_sockaddr_islinklocal(const isc_sockaddr_t *sa); /*%< - * Returns ISC_TRUE if the address is a link local addresss. + * Returns ISC_TRUE if the address is a link local address. */ isc_boolean_t diff --git a/lib/isc/include/isc/socket.h b/lib/isc/include/isc/socket.h index a9a22c8..035c994 100644 --- a/lib/isc/include/isc/socket.h +++ b/lib/isc/include/isc/socket.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2006, 2008 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: socket.h,v 1.57.18.15 2008/09/04 08:03:08 marka Exp $ */ +/* $Id: socket.h,v 1.85.58.3 2009/01/29 22:40:35 jinmei Exp $ */ #ifndef ISC_SOCKET_H #define ISC_SOCKET_H 1 @@ -24,7 +24,7 @@ ***** Module Info *****/ -/*! \file +/*! \file isc/socket.h * \brief Provides TCP and UDP sockets for network I/O. The sockets are event * sources in the task system. * @@ -64,6 +64,7 @@ #include <isc/time.h> #include <isc/region.h> #include <isc/sockaddr.h> +#include <isc/xml.h> ISC_LANG_BEGINDECLS @@ -83,6 +84,75 @@ ISC_LANG_BEGINDECLS */ #define ISC_SOCKET_REUSEADDRESS 0x01U +/*% + * Statistics counters. Used as isc_statscounter_t values. + */ +enum { + isc_sockstatscounter_udp4open = 0, + isc_sockstatscounter_udp6open = 1, + isc_sockstatscounter_tcp4open = 2, + isc_sockstatscounter_tcp6open = 3, + isc_sockstatscounter_unixopen = 4, + + isc_sockstatscounter_udp4openfail = 5, + isc_sockstatscounter_udp6openfail = 6, + isc_sockstatscounter_tcp4openfail = 7, + isc_sockstatscounter_tcp6openfail = 8, + isc_sockstatscounter_unixopenfail = 9, + + isc_sockstatscounter_udp4close = 10, + isc_sockstatscounter_udp6close = 11, + isc_sockstatscounter_tcp4close = 12, + isc_sockstatscounter_tcp6close = 13, + isc_sockstatscounter_unixclose = 14, + isc_sockstatscounter_fdwatchclose = 15, + + isc_sockstatscounter_udp4bindfail = 16, + isc_sockstatscounter_udp6bindfail = 17, + isc_sockstatscounter_tcp4bindfail = 18, + isc_sockstatscounter_tcp6bindfail = 19, + isc_sockstatscounter_unixbindfail = 20, + isc_sockstatscounter_fdwatchbindfail = 21, + + isc_sockstatscounter_udp4connect = 22, + isc_sockstatscounter_udp6connect = 23, + isc_sockstatscounter_tcp4connect = 24, + isc_sockstatscounter_tcp6connect = 25, + isc_sockstatscounter_unixconnect = 26, + isc_sockstatscounter_fdwatchconnect = 27, + + isc_sockstatscounter_udp4connectfail = 28, + isc_sockstatscounter_udp6connectfail = 29, + isc_sockstatscounter_tcp4connectfail = 30, + isc_sockstatscounter_tcp6connectfail = 31, + isc_sockstatscounter_unixconnectfail = 32, + isc_sockstatscounter_fdwatchconnectfail = 33, + + isc_sockstatscounter_tcp4accept = 34, + isc_sockstatscounter_tcp6accept = 35, + isc_sockstatscounter_unixaccept = 36, + + isc_sockstatscounter_tcp4acceptfail = 37, + isc_sockstatscounter_tcp6acceptfail = 38, + isc_sockstatscounter_unixacceptfail = 39, + + isc_sockstatscounter_udp4sendfail = 40, + isc_sockstatscounter_udp6sendfail = 41, + isc_sockstatscounter_tcp4sendfail = 42, + isc_sockstatscounter_tcp6sendfail = 43, + isc_sockstatscounter_unixsendfail = 44, + isc_sockstatscounter_fdwatchsendfail = 45, + + isc_sockstatscounter_udp4recvfail = 46, + isc_sockstatscounter_udp6recvfail = 47, + isc_sockstatscounter_tcp4recvfail = 48, + isc_sockstatscounter_tcp6recvfail = 49, + isc_sockstatscounter_unixrecvfail = 50, + isc_sockstatscounter_fdwatchrecvfail = 51, + + isc_sockstatscounter_max = 52 +}; + /*** *** Types ***/ @@ -150,7 +220,8 @@ struct isc_socket_connev { typedef enum { isc_sockettype_udp = 1, isc_sockettype_tcp = 2, - isc_sockettype_unix = 3 + isc_sockettype_unix = 3, + isc_sockettype_fdwatch = 4 } isc_sockettype_t; /*@{*/ @@ -181,6 +252,14 @@ typedef enum { #define ISC_SOCKFLAG_NORETRY 0x00000002 /*%< drop failed UDP sends */ /*@}*/ +/*@{*/ +/*! + * Flags for fdwatchcreate. + */ +#define ISC_SOCKFDWATCH_READ 0x00000001 /*%< watch for readable */ +#define ISC_SOCKFDWATCH_WRITE 0x00000002 /*%< watch for writable */ +/*@}*/ + /*** *** Socket and Socket Manager Functions *** @@ -189,6 +268,45 @@ typedef enum { ***/ isc_result_t +isc_socket_fdwatchcreate(isc_socketmgr_t *manager, + int fd, + int flags, + isc_sockfdwatch_t callback, + void *cbarg, + isc_task_t *task, + isc_socket_t **socketp); +/*%< + * Create a new file descriptor watch socket managed by 'manager'. + * + * Note: + * + *\li 'fd' is the already-opened file descriptor. + *\li This function is not available on Windows. + *\li The callback function is called "in-line" - this means the function + * needs to return as fast as possible, as all other I/O will be suspended + * until the callback completes. + * + * Requires: + * + *\li 'manager' is a valid manager + * + *\li 'socketp' is a valid pointer, and *socketp == NULL + * + *\li 'fd' be opened. + * + * Ensures: + * + * '*socketp' is attached to the newly created fdwatch socket + * + * Returns: + * + *\li #ISC_R_SUCCESS + *\li #ISC_R_NOMEMORY + *\li #ISC_R_NORESOURCES + *\li #ISC_R_UNEXPECTED + */ + +isc_result_t isc_socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type, @@ -196,6 +314,9 @@ isc_socket_create(isc_socketmgr_t *manager, /*%< * Create a new 'type' socket managed by 'manager'. * + * For isc_sockettype_fdwatch sockets you should use isc_socket_fdwatchcreate() + * rather than isc_socket_create(). + * * Note: * *\li 'pf' is the desired protocol family, e.g. PF_INET or PF_INET6. @@ -206,6 +327,8 @@ isc_socket_create(isc_socketmgr_t *manager, * *\li 'socketp' is a valid pointer, and *socketp == NULL * + *\li 'type' is not isc_sockettype_fdwatch + * * Ensures: * * '*socketp' is attached to the newly created socket @@ -329,12 +452,17 @@ isc_socket_open(isc_socket_t *sock); * one. This optimization may not be available for some systems, in which * case this function will return ISC_R_NOTIMPLEMENTED and must not be used. * + * isc_socket_open() should not be called on sockets created by + * isc_socket_fdwatchcreate(). + * * Requires: * * \li there must be no other reference to this socket. * * \li 'socket' is a valid and previously closed by isc_socket_close() * + * \li 'sock->type' is not isc_sockettype_fdwatch + * * Returns: * Same as isc_socket_create(). * \li ISC_R_NOTIMPLEMENTED @@ -350,6 +478,9 @@ isc_socket_close(isc_socket_t *sock); * systems, in which case this function will return ISC_R_NOTIMPLEMENTED and * must not be used. * + * isc_socket_close() should not be called on sockets created by + * isc_socket_fdwatchcreate(). + * * Requires: * * \li The socket must have a valid descriptor. @@ -358,6 +489,8 @@ isc_socket_close(isc_socket_t *sock); * * \li There must be no pending I/O requests. * + * \li 'sock->type' is not isc_sockettype_fdwatch + * * Returns: * \li #ISC_R_NOTIMPLEMENTED */ @@ -738,6 +871,19 @@ isc_socketmgr_getmaxsockets(isc_socketmgr_t *manager, unsigned int *nsockp); */ void +isc_socketmgr_setstats(isc_socketmgr_t *manager, isc_stats_t *stats); +/*%< + * Set a general socket statistics counter set 'stats' for 'manager'. + * + * Requires: + * \li 'manager' is valid, hasn't opened any socket, and doesn't have + * stats already set. + * + *\li stats is a valid statistics supporting socket statistics counters + * (see above). + */ + +void isc_socketmgr_destroy(isc_socketmgr_t **managerp); /*%< * Destroy a socket manager. @@ -812,7 +958,7 @@ isc_socket_permunix(isc_sockaddr_t *sockaddr, isc_uint32_t perm, * Set ownership and file permissions on the UNIX domain socket. * * Note: On Solaris and SunOS this secures the directory containing - * the socket as Solaris and SunOS do not honour the filesytem + * the socket as Solaris and SunOS do not honour the filesystem * permissions on the socket. * * Requires: @@ -823,12 +969,39 @@ isc_socket_permunix(isc_sockaddr_t *sockaddr, isc_uint32_t perm, * \li #ISC_R_FAILURE */ +void isc_socket_setname(isc_socket_t *socket, const char *name, void *tag); +/*%< + * Set the name and optional tag for a socket. This allows tracking of the + * owner or purpose for this socket, and is useful for tracing and statistics + * reporting. + */ + +const char *isc_socket_getname(isc_socket_t *socket); +/*%< + * Get the name associated with a socket, if any. + */ + +void *isc_socket_gettag(isc_socket_t *socket); +/*%< + * Get the tag associated with a socket, if any. + */ + void isc__socketmgr_setreserved(isc_socketmgr_t *mgr, isc_uint32_t); /*%< * Temporary. For use by named only. */ +#ifdef HAVE_LIBXML2 + +void +isc_socketmgr_renderxml(isc_socketmgr_t *mgr, xmlTextWriterPtr writer); +/*%< + * Render internal statistics and other state into the XML document. + */ + +#endif /* HAVE_LIBXML2 */ + ISC_LANG_ENDDECLS #endif /* ISC_SOCKET_H */ diff --git a/lib/isc/include/isc/stats.h b/lib/isc/include/isc/stats.h new file mode 100644 index 0000000..a6156d8 --- /dev/null +++ b/lib/isc/include/isc/stats.h @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC") + * + * 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. + */ + +/* $Id: stats.h,v 1.4.2.2 2009/01/29 23:47:44 tbox Exp $ */ + +#ifndef ISC_STATS_H +#define ISC_STATS_H 1 + +/*! \file isc/stats.h */ + +#include <isc/types.h> + +ISC_LANG_BEGINDECLS + +/*%< + * Flag(s) for isc_stats_dump(). + */ +#define ISC_STATSDUMP_VERBOSE 0x00000001 /*%< dump 0-value counters */ + +/*%< + * Dump callback type. + */ +typedef void (*isc_stats_dumper_t)(isc_statscounter_t, isc_uint64_t, void *); + +isc_result_t +isc_stats_create(isc_mem_t *mctx, isc_stats_t **statsp, int ncounters); +/*%< + * Create a statistics counter structure of general type. It counts a general + * set of counters indexed by an ID between 0 and ncounters -1. + * + * Requires: + *\li 'mctx' must be a valid memory context. + * + *\li 'statsp' != NULL && '*statsp' == NULL. + * + * Returns: + *\li ISC_R_SUCCESS -- all ok + * + *\li anything else -- failure + */ + +void +isc_stats_attach(isc_stats_t *stats, isc_stats_t **statsp); +/*%< + * Attach to a statistics set. + * + * Requires: + *\li 'stats' is a valid isc_stats_t. + * + *\li 'statsp' != NULL && '*statsp' == NULL + */ + +void +isc_stats_detach(isc_stats_t **statsp); +/*%< + * Detaches from the statistics set. + * + * Requires: + *\li 'statsp' != NULL and '*statsp' is a valid isc_stats_t. + */ + +int +isc_stats_ncounters(isc_stats_t *stats); +/*%< + * Returns the number of counters contained in stats. + * + * Requires: + *\li 'stats' is a valid isc_stats_t. + * + */ + +void +isc_stats_increment(isc_stats_t *stats, isc_statscounter_t counter); +/*%< + * Increment the counter-th counter of stats. + * + * Requires: + *\li 'stats' is a valid isc_stats_t. + * + *\li counter is less than the maximum available ID for the stats specified + * on creation. + */ + +void +isc_stats_decrement(isc_stats_t *stats, isc_statscounter_t counter); +/*%< + * Decrement the counter-th counter of stats. + * + * Requires: + *\li 'stats' is a valid isc_stats_t. + */ + +void +isc_stats_dump(isc_stats_t *stats, isc_stats_dumper_t dump_fn, void *arg, + unsigned int options); +/*%< + * Dump the current statistics counters in a specified way. For each counter + * in stats, dump_fn is called with its current value and the given argument + * arg. By default counters that have a value of 0 is skipped; if options has + * the ISC_STATSDUMP_VERBOSE flag, even such counters are dumped. + * + * Requires: + *\li 'stats' is a valid isc_stats_t. + */ + +ISC_LANG_ENDDECLS + +#endif /* ISC_STATS_H */ diff --git a/lib/isc/include/isc/stdio.h b/lib/isc/include/isc/stdio.h index e3bf0cd..1a7ae64 100644 --- a/lib/isc/include/isc/stdio.h +++ b/lib/isc/include/isc/stdio.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,12 +15,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: stdio.h,v 1.7.18.2 2005/04/29 00:17:03 marka Exp $ */ +/* $Id: stdio.h,v 1.13 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_STDIO_H #define ISC_STDIO_H 1 -/*! \file */ +/*! \file isc/stdio.h */ /*% * These functions are wrappers around the corresponding stdio functions. diff --git a/lib/isc/include/isc/stdlib.h b/lib/isc/include/isc/stdlib.h index 0e2c697..02243f0 100644 --- a/lib/isc/include/isc/stdlib.h +++ b/lib/isc/include/isc/stdlib.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2003 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,12 +15,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: stdlib.h,v 1.2.18.2 2005/04/29 00:17:03 marka Exp $ */ +/* $Id: stdlib.h,v 1.8 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_STDLIB_H #define ISC_STDLIB_H 1 -/*! \file */ +/*! \file isc/stdlib.h */ #include <stdlib.h> diff --git a/lib/isc/include/isc/string.h b/lib/isc/include/isc/string.h index bda71f4..b49fdbc 100644 --- a/lib/isc/include/isc/string.h +++ b/lib/isc/include/isc/string.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001, 2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,12 +15,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: string.h,v 1.12.18.6 2007/09/13 05:04:01 each Exp $ */ +/* $Id: string.h,v 1.23 2007/09/13 04:48:16 each Exp $ */ #ifndef ISC_STRING_H #define ISC_STRING_H 1 -/*! \file */ +/*! \file isc/string.h */ #include <isc/formatcheck.h> #include <isc/int.h> diff --git a/lib/isc/include/isc/symtab.h b/lib/isc/include/isc/symtab.h index 94ea173..396d645 100644 --- a/lib/isc/include/isc/symtab.h +++ b/lib/isc/include/isc/symtab.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1996-2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: symtab.h,v 1.17.18.4 2006/03/02 00:37:22 marka Exp $ */ +/* $Id: symtab.h,v 1.24.332.2 2009/01/18 23:47:41 tbox Exp $ */ #ifndef ISC_SYMTAB_H #define ISC_SYMTAB_H 1 @@ -24,10 +24,10 @@ ***** Module Info *****/ -/*! \file +/*! \file isc/symtab.h * \brief Provides a simple memory-based symbol table. * - * Keys are C strings, and key comparisons are case-insenstive. A type may + * Keys are C strings, and key comparisons are case-insensitive. A type may * be specified when looking up, defining, or undefining. A type value of * 0 means "match any type"; any other value will only match the given * type. diff --git a/lib/isc/include/isc/task.h b/lib/isc/include/isc/task.h index f7d237c..8106571 100644 --- a/lib/isc/include/isc/task.h +++ b/lib/isc/include/isc/task.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001, 2003 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: task.h,v 1.51.18.2 2005/04/29 00:17:03 marka Exp $ */ +/* $Id: task.h,v 1.61.332.2 2009/01/18 23:47:41 tbox Exp $ */ #ifndef ISC_TASK_H #define ISC_TASK_H 1 @@ -24,9 +24,9 @@ ***** Module Info *****/ -/*! \file +/*! \file isc/task.h * \brief The task system provides a lightweight execution context, which is - * basically an event queue. + * basically an event queue. * When a task's event queue is non-empty, the * task is runnable. A small work crew of threads, typically one per CPU, @@ -67,7 +67,7 @@ * Consumers of events should purge, not unsend. * * Producers of events often want to remove events when the caller indicates - * it is no longer interested in the object, e.g. by cancelling a timer. + * it is no longer interested in the object, e.g. by canceling a timer. * Sometimes this can be done by purging, but for some event types, the * calls to isc_event_free() cause deadlock because the event free routine * wants to acquire a lock the caller is already holding. Unsending instead @@ -84,6 +84,7 @@ #include <isc/lang.h> #include <isc/stdtime.h> #include <isc/types.h> +#include <isc/xml.h> #define ISC_TASKEVENT_FIRSTEVENT (ISC_EVENTCLASS_TASK + 0) #define ISC_TASKEVENT_SHUTDOWN (ISC_EVENTCLASS_TASK + 1) @@ -497,7 +498,7 @@ isc_task_beginexclusive(isc_task_t *task); * current event, and prevents any new events from executing in any of the * tasks sharing a task manager with 'task'. * - * The exclusive access must be relinquished by calling + * The exclusive access must be relinquished by calling * isc_task_endexclusive() before returning from the current event handler. * * Requires: @@ -512,7 +513,7 @@ isc_task_beginexclusive(isc_task_t *task); void isc_task_endexclusive(isc_task_t *task); /*%< - * Relinquish the exclusive access obtained by isc_task_beginexclusive(), + * Relinquish the exclusive access obtained by isc_task_beginexclusive(), * allowing other tasks to execute. * * Requires: @@ -592,7 +593,7 @@ isc_taskmgr_destroy(isc_taskmgr_t **managerp); * because it would block forever waiting for the event action to * complete. An event action that wants to cause task manager shutdown * should request some non-event action thread of execution to do the - * shutdown, e.g. by signalling a condition variable or using + * shutdown, e.g. by signaling a condition variable or using * isc_app_shutdown(). * *\li Task manager references are not reference counted, so the caller @@ -611,6 +612,13 @@ isc_taskmgr_destroy(isc_taskmgr_t **managerp); * have been freed. */ +#ifdef HAVE_LIBXML2 + +void +isc_taskmgr_renderxml(isc_taskmgr_t *mgr, xmlTextWriterPtr writer); + +#endif + ISC_LANG_ENDDECLS #endif /* ISC_TASK_H */ diff --git a/lib/isc/include/isc/taskpool.h b/lib/isc/include/isc/taskpool.h index 6c97605..fd07bfd 100644 --- a/lib/isc/include/isc/taskpool.h +++ b/lib/isc/include/isc/taskpool.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: taskpool.h,v 1.9.18.2 2005/04/29 00:17:04 marka Exp $ */ +/* $Id: taskpool.h,v 1.15 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_TASKPOOL_H #define ISC_TASKPOOL_H 1 @@ -24,7 +24,7 @@ ***** Module Info *****/ -/*! \file +/*! \file isc/taskpool.h * \brief A task pool is a mechanism for sharing a small number of tasks * among a large number of objects such that each object is * assigned a unique task, but each task may be shared by several diff --git a/lib/isc/include/isc/timer.h b/lib/isc/include/isc/timer.h index 7a7f614..a4b2df7 100644 --- a/lib/isc/include/isc/timer.h +++ b/lib/isc/include/isc/timer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: timer.h,v 1.31.18.5 2008/06/24 23:45:55 tbox Exp $ */ +/* $Id: timer.h,v 1.40 2008/06/23 23:47:11 tbox Exp $ */ #ifndef ISC_TIMER_H #define ISC_TIMER_H 1 @@ -24,7 +24,7 @@ ***** Module Info *****/ -/*! \file +/*! \file isc/timer.h * \brief Provides timers which are event sources in the task system. * * Three types of timers are supported: diff --git a/lib/isc/include/isc/types.h b/lib/isc/include/isc/types.h index b501b2c..4dccbf9 100644 --- a/lib/isc/include/isc/types.h +++ b/lib/isc/include/isc/types.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,12 +15,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: types.h,v 1.35.18.4 2008/06/24 23:45:55 tbox Exp $ */ +/* $Id: types.h,v 1.46.84.2 2009/01/29 23:47:44 tbox Exp $ */ #ifndef ISC_TYPES_H #define ISC_TYPES_H 1 -/*! \file +/*! \file isc/types.h * \brief * OS-specific types, from the OS-specific include directories. */ @@ -52,6 +52,11 @@ typedef ISC_LIST(isc_event_t) isc_eventlist_t; /*%< Event List */ typedef unsigned int isc_eventtype_t; /*%< Event Type */ typedef isc_uint32_t isc_fsaccess_t; /*%< FS Access */ typedef struct isc_hash isc_hash_t; /*%< Hash */ +typedef struct isc_httpd isc_httpd_t; /*%< HTTP client */ +typedef void (isc_httpdfree_t)(isc_buffer_t *, void *); /*%< HTTP free function */ +typedef struct isc_httpdmgr isc_httpdmgr_t; /*%< HTTP manager */ +typedef struct isc_httpdurl isc_httpdurl_t; /*%< HTTP URL */ +typedef void (isc_httpdondestroy_t)(void *); /*%< Callback on destroying httpd */ typedef struct isc_interface isc_interface_t; /*%< Interface */ typedef struct isc_interfaceiter isc_interfaceiter_t; /*%< Interface Iterator */ typedef struct isc_interval isc_interval_t; /*%< Interval */ @@ -77,6 +82,8 @@ typedef struct isc_sockaddr isc_sockaddr_t; /*%< Socket Address */ typedef struct isc_socket isc_socket_t; /*%< Socket */ typedef struct isc_socketevent isc_socketevent_t; /*%< Socket Event */ typedef struct isc_socketmgr isc_socketmgr_t; /*%< Socket Manager */ +typedef struct isc_stats isc_stats_t; /*%< Statistics */ +typedef int isc_statscounter_t; /*%< Statistics Counter */ typedef struct isc_symtab isc_symtab_t; /*%< Symbol Table */ typedef struct isc_task isc_task_t; /*%< Task */ typedef ISC_LIST(isc_task_t) isc_tasklist_t; /*%< Task List */ @@ -87,6 +94,19 @@ typedef struct isc_timer isc_timer_t; /*%< Timer */ typedef struct isc_timermgr isc_timermgr_t; /*%< Timer Manager */ typedef void (*isc_taskaction_t)(isc_task_t *, isc_event_t *); +typedef int (*isc_sockfdwatch_t)(isc_task_t *, isc_socket_t *, void *); + +/* The following cannot be listed alphabetically due to forward reference */ +typedef isc_result_t (isc_httpdaction_t)(const char *url, + const char *querystring, + void *arg, + unsigned int *retcode, + const char **retmsg, + const char **mimetype, + isc_buffer_t *body, + isc_httpdfree_t **freecb, + void **freecb_args); +typedef isc_boolean_t (isc_httpdclientok_t)(const isc_sockaddr_t *, void *); /*% Resource */ typedef enum { diff --git a/lib/isc/include/isc/util.h b/lib/isc/include/isc/util.h index 95fe436..8a3b95d 100644 --- a/lib/isc/include/isc/util.h +++ b/lib/isc/include/isc/util.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,12 +15,12 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: util.h,v 1.24.18.2 2005/04/29 00:17:04 marka Exp $ */ +/* $Id: util.h,v 1.30 2007/06/19 23:47:18 tbox Exp $ */ #ifndef ISC_UTIL_H #define ISC_UTIL_H 1 -/*! \file util.h +/*! \file isc/util.h * NOTE: * * This file is not to be included from any <isc/???.h> (or other) library diff --git a/lib/isc/include/isc/version.h b/lib/isc/include/isc/version.h index 82d4617..ec00bde 100644 --- a/lib/isc/include/isc/version.h +++ b/lib/isc/include/isc/version.h @@ -1,8 +1,8 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2001 Internet Software Consortium. * - * Permission to use, copy, modify, and distribute this software for any + * 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. * @@ -15,9 +15,9 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: version.h,v 1.3.18.2 2005/04/29 00:17:04 marka Exp $ */ +/* $Id: version.h,v 1.9 2007/06/19 23:47:18 tbox Exp $ */ -/*! \file */ +/*! \file isc/version.h */ #include <isc/platform.h> diff --git a/lib/isc/include/isc/xml.h b/lib/isc/include/isc/xml.h new file mode 100644 index 0000000..d31a31a --- /dev/null +++ b/lib/isc/include/isc/xml.h @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2006, 2007 Internet Systems Consortium, Inc. ("ISC") + * + * 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. + */ + +/* $Id: xml.h,v 1.4 2007/06/19 23:47:18 tbox Exp $ */ + +#ifndef ISC_XML_H +#define ISC_XML_H 1 + +/* + * This file is here mostly to make it easy to add additional libxml header + * files as needed across all the users of this file. Rather than place + * these libxml includes in each file, one include makes it easy to handle + * the ifdef as well as adding the ability to add additional functions + * which may be useful. + */ + +#ifdef HAVE_LIBXML2 +#include <libxml/encoding.h> +#include <libxml/xmlwriter.h> +#endif + +#define ISC_XMLCHAR (const xmlChar *) + +#define ISC_XML_RENDERCONFIG 0x00000001 /* render config data */ +#define ISC_XML_RENDERSTATS 0x00000002 /* render stats */ +#define ISC_XML_RENDERALL 0x000000ff /* render everything */ + +#endif /* ISC_XML_H */ |