Commit f731b5d6 authored by Automatic Updater's avatar Automatic Updater

update copyright notice

parent 4cda4fd1
/*
* Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2001-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: config.c,v 1.83 2008/01/22 00:29:03 jinmei Exp $ */
/* $Id: config.c,v 1.84 2008/01/22 23:28:04 tbox Exp $ */
/*! \file */
......@@ -407,7 +407,7 @@ ns_config_putiplist(isc_mem_t *mctx, isc_sockaddr_t **addrsp,
static isc_result_t
get_masters_def(const cfg_obj_t *cctx, const char *name,
const cfg_obj_t **ret)
const cfg_obj_t **ret)
{
isc_result_t result;
const cfg_obj_t *masters = NULL;
......@@ -525,7 +525,7 @@ ns_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
tresult = get_masters_def(config, listname, &list);
if (tresult == ISC_R_NOTFOUND) {
cfg_obj_log(addr, ns_g_lctx, ISC_LOG_ERROR,
"masters \"%s\" not found", listname);
"masters \"%s\" not found", listname);
result = tresult;
goto cleanup;
......@@ -603,7 +603,7 @@ ns_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
if (keys[i] == NULL)
goto cleanup;
dns_name_init(keys[i], NULL);
keystr = cfg_obj_asstring(key);
isc_buffer_init(&b, keystr, strlen(keystr));
isc_buffer_add(&b, strlen(keystr));
......@@ -659,7 +659,7 @@ ns_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
isc_mem_put(mctx, lists, listcount * sizeof(*lists));
if (stack != NULL)
isc_mem_put(mctx, stack, stackcount * sizeof(*stack));
INSIST(keycount == addrcount);
*addrsp = addrs;
......
/*
* Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2004, 2005, 2007, 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,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: lwdnoop.c,v 1.12 2008/01/22 01:51:16 marka Exp $ */
/* $Id: lwdnoop.c,v 1.13 2008/01/22 23:28:04 tbox Exp $ */
/*! \file */
......
/*
* Portions Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
* Portions Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
* Portions Copyright (C) 1999-2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
......@@ -31,7 +31,7 @@
/*%
* Principal Author: Brian Wellington
* $Id: dst_parse.c,v 1.11 2008/01/22 01:34:15 marka Exp $
* $Id: dst_parse.c,v 1.12 2008/01/22 23:28:04 tbox Exp $
*/
#include <config.h>
......
/*
* Copyright (C) 2004-2007 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,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: gssapictx.c,v 1.9 2008/01/22 11:47:54 marka Exp $ */
/* $Id: gssapictx.c,v 1.10 2008/01/22 23:28:04 tbox Exp $ */
#include <config.h>
......@@ -129,7 +129,7 @@ name_to_gbuffer(dns_name_t *name, isc_buffer_t *buffer,
dns_name_getlabelsequence(name, 0, labels - 1, &tname);
namep = &tname;
}
result = dns_name_totext(namep, ISC_FALSE, buffer);
isc_buffer_putuint8(buffer, 0);
isc_buffer_usedregion(buffer, &r);
......@@ -433,7 +433,7 @@ dst_gssapi_releasecred(gss_cred_id_t *cred) {
char buf[1024];
REQUIRE(cred != NULL && *cred != NULL);
gret = gss_release_cred(&minor, cred);
if (gret != GSS_S_COMPLETE) {
/* Log the error, but still free the credential's memory */
......@@ -441,7 +441,7 @@ dst_gssapi_releasecred(gss_cred_id_t *cred) {
gss_error_tostring(gret, minor, buf, sizeof(buf)));
}
*cred = NULL;
return(ISC_R_SUCCESS);
#else
UNUSED(cred);
......@@ -467,7 +467,7 @@ dst_gssapi_initctx(dns_name_t *name, isc_buffer_t *intoken,
/* Client must pass us a valid gss_ctx_id_t here */
REQUIRE(gssctx != NULL);
isc_buffer_init(&namebuf, array, sizeof(array));
name_to_gbuffer(name, &namebuf, &gnamebuf);
......@@ -501,7 +501,7 @@ dst_gssapi_initctx(dns_name_t *name, isc_buffer_t *intoken,
result = ISC_R_FAILURE;
goto out;
}
/*
* XXXSRA Not handled yet: RFC 3645 3.1.1: check ret_flags
* MUTUAL and INTEG flags, fail if either not set.
......@@ -691,7 +691,7 @@ gss_error_tostring(isc_uint32_t major, isc_uint32_t minor,
/* Handle major status */
msg_ctx = 0;
(void)gss_display_status(&minor_stat, major, GSS_C_GSS_CODE,
GSS_C_NULL_OID, &msg_ctx, &msg_major);
GSS_C_NULL_OID, &msg_ctx, &msg_major);
/* Handle minor status */
msg_ctx = 0;
......@@ -700,14 +700,14 @@ gss_error_tostring(isc_uint32_t major, isc_uint32_t minor,
snprintf(buf, buflen, "GSSAPI error: Major = %s, Minor = %s.",
(char *)msg_major.value, (char *)msg_minor.value);
(void)gss_release_buffer(&minor_stat, &msg_major);
(void)gss_release_buffer(&minor_stat, &msg_minor);
return(buf);
#else
snprintf(buf, buflen, "GSSAPI error: Major = %u, Minor = %u.",
major, minor);
return (buf);
#endif
}
......
/*
* Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2004, 2005, 2007, 2008 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: rbt.c,v 1.139 2008/01/22 01:34:14 marka Exp $ */
/* $Id: rbt.c,v 1.140 2008/01/22 23:28:04 tbox Exp $ */
/*! \file */
......@@ -60,14 +60,14 @@
#endif
struct dns_rbt {
unsigned int magic;
isc_mem_t * mctx;
dns_rbtnode_t * root;
void (*data_deleter)(void *, void *);
void * deleter_arg;
unsigned int nodecount;
unsigned int hashsize;
dns_rbtnode_t ** hashtable;
unsigned int magic;
isc_mem_t * mctx;
dns_rbtnode_t * root;
void (*data_deleter)(void *, void *);
void * deleter_arg;
unsigned int nodecount;
unsigned int hashsize;
dns_rbtnode_t ** hashtable;
};
#define RED 0
......@@ -106,7 +106,7 @@ struct dns_rbt {
#define OFFSETS(node) (NAME(node) + NAMELEN(node))
#define NODE_SIZE(node) (sizeof(*node) + \
NAMELEN(node) + OFFSETLEN(node) + PADBYTES(node))
NAMELEN(node) + OFFSETLEN(node) + PADBYTES(node))
/*%
* Color management.
......@@ -124,7 +124,7 @@ struct dns_rbt {
* of memory concerns, when chains were first implemented).
*/
#define ADD_LEVEL(chain, node) \
(chain)->levels[(chain)->level_count++] = (node)
(chain)->levels[(chain)->level_count++] = (node)
/*%
* The following macros directly access normally private name variables.
......@@ -134,12 +134,12 @@ struct dns_rbt {
#define NODENAME(node, name) \
do { \
(name)->length = NAMELEN(node); \
(name)->labels = OFFSETLEN(node); \
(name)->ndata = NAME(node); \
(name)->offsets = OFFSETS(node); \
(name)->attributes = ATTRS(node); \
(name)->attributes |= DNS_NAMEATTR_READONLY; \
(name)->length = NAMELEN(node); \
(name)->labels = OFFSETLEN(node); \
(name)->ndata = NAME(node); \
(name)->offsets = OFFSETS(node); \
(name)->attributes = ATTRS(node); \
(name)->attributes |= DNS_NAMEATTR_READONLY; \
} while (0)
#ifdef DNS_RBT_USEHASH
......@@ -155,13 +155,13 @@ inithash(dns_rbt_t *rbt);
dns_name_t Name(dns_rbtnode_t *node);
dns_name_t
Name(dns_rbtnode_t *node) {
dns_name_t name;
dns_name_t name;
dns_name_init(&name, NULL);
if (node != NULL)
NODENAME(node, &name);
dns_name_init(&name, NULL);
if (node != NULL)
NODENAME(node, &name);
return (name);
return (name);
}
static void dns_rbt_printnodename(dns_rbtnode_t *node);
......@@ -169,17 +169,17 @@ static void dns_rbt_printnodename(dns_rbtnode_t *node);
static inline dns_rbtnode_t *
find_up(dns_rbtnode_t *node) {
dns_rbtnode_t *root;
dns_rbtnode_t *root;
/*
* Return the node in the level above the argument node that points
* to the level the argument node is in. If the argument node is in
* the top level, the return value is NULL.
*/
for (root = node; ! IS_ROOT(root); root = PARENT(root))
; /* Nothing. */
/*
* Return the node in the level above the argument node that points
* to the level the argument node is in. If the argument node is in
* the top level, the return value is NULL.
*/
for (root = node; ! IS_ROOT(root); root = PARENT(root))
; /* Nothing. */
return (PARENT(root));
return (PARENT(root));
}
/*
......@@ -205,7 +205,7 @@ rotate_right(dns_rbtnode_t *node, dns_rbtnode_t **rootp);
static void
dns_rbt_addonlevel(dns_rbtnode_t *node, dns_rbtnode_t *current, int order,
dns_rbtnode_t **rootp);
dns_rbtnode_t **rootp);
static void
dns_rbt_deletefromlevel(dns_rbtnode_t *delete, dns_rbtnode_t **rootp);
......@@ -215,50 +215,50 @@ dns_rbt_deletetree(dns_rbt_t *rbt, dns_rbtnode_t *node);
static void
dns_rbt_deletetreeflat(dns_rbt_t *rbt, unsigned int quantum,
dns_rbtnode_t **nodep);
dns_rbtnode_t **nodep);
/*
* Initialize a red/black tree of trees.
*/
isc_result_t
dns_rbt_create(isc_mem_t *mctx, void (*deleter)(void *, void *),
void *deleter_arg, dns_rbt_t **rbtp)
void *deleter_arg, dns_rbt_t **rbtp)
{
#ifdef DNS_RBT_USEHASH
isc_result_t result;
isc_result_t result;
#endif
dns_rbt_t *rbt;
dns_rbt_t *rbt;
REQUIRE(mctx != NULL);
REQUIRE(rbtp != NULL && *rbtp == NULL);
REQUIRE(deleter == NULL ? deleter_arg == NULL : 1);
REQUIRE(mctx != NULL);
REQUIRE(rbtp != NULL && *rbtp == NULL);
REQUIRE(deleter == NULL ? deleter_arg == NULL : 1);
rbt = (dns_rbt_t *)isc_mem_get(mctx, sizeof(*rbt));
if (rbt == NULL)
return (ISC_R_NOMEMORY);
rbt = (dns_rbt_t *)isc_mem_get(mctx, sizeof(*rbt));
if (rbt == NULL)
return (ISC_R_NOMEMORY);
rbt->mctx = mctx;
rbt->data_deleter = deleter;
rbt->deleter_arg = deleter_arg;
rbt->root = NULL;
rbt->nodecount = 0;
rbt->hashtable = NULL;
rbt->hashsize = 0;
rbt->mctx = mctx;
rbt->data_deleter = deleter;
rbt->deleter_arg = deleter_arg;
rbt->root = NULL;
rbt->nodecount = 0;
rbt->hashtable = NULL;
rbt->hashsize = 0;
#ifdef DNS_RBT_USEHASH
result = inithash(rbt);
if (result != ISC_R_SUCCESS) {
isc_mem_put(mctx, rbt, sizeof(*rbt));
return (result);
}
result = inithash(rbt);
if (result != ISC_R_SUCCESS) {
isc_mem_put(mctx, rbt, sizeof(*rbt));
return (result);
}
#endif
rbt->magic = RBT_MAGIC;
rbt->magic = RBT_MAGIC;
*rbtp = rbt;
*rbtp = rbt;
return (ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
}
/*
......@@ -266,88 +266,88 @@ dns_rbt_create(isc_mem_t *mctx, void (*deleter)(void *, void *),
*/
void
dns_rbt_destroy(dns_rbt_t **rbtp) {
RUNTIME_CHECK(dns_rbt_destroy2(rbtp, 0) == ISC_R_SUCCESS);
RUNTIME_CHECK(dns_rbt_destroy2(rbtp, 0) == ISC_R_SUCCESS);
}
isc_result_t
dns_rbt_destroy2(dns_rbt_t **rbtp, unsigned int quantum) {
dns_rbt_t *rbt;
dns_rbt_t *rbt;
REQUIRE(rbtp != NULL && VALID_RBT(*rbtp));
REQUIRE(rbtp != NULL && VALID_RBT(*rbtp));
rbt = *rbtp;
rbt = *rbtp;
dns_rbt_deletetreeflat(rbt, quantum, &rbt->root);
if (rbt->root != NULL)
return (ISC_R_QUOTA);
dns_rbt_deletetreeflat(rbt, quantum, &rbt->root);
if (rbt->root != NULL)
return (ISC_R_QUOTA);
INSIST(rbt->nodecount == 0);
INSIST(rbt->nodecount == 0);
if (rbt->hashtable != NULL)
isc_mem_put(rbt->mctx, rbt->hashtable,
rbt->hashsize * sizeof(dns_rbtnode_t *));
if (rbt->hashtable != NULL)
isc_mem_put(rbt->mctx, rbt->hashtable,
rbt->hashsize * sizeof(dns_rbtnode_t *));
rbt->magic = 0;
rbt->magic = 0;
isc_mem_put(rbt->mctx, rbt, sizeof(*rbt));
*rbtp = NULL;
return (ISC_R_SUCCESS);
isc_mem_put(rbt->mctx, rbt, sizeof(*rbt));
*rbtp = NULL;
return (ISC_R_SUCCESS);
}
unsigned int
dns_rbt_nodecount(dns_rbt_t *rbt) {
REQUIRE(VALID_RBT(rbt));
return (rbt->nodecount);
REQUIRE(VALID_RBT(rbt));
return (rbt->nodecount);
}
static inline isc_result_t
chain_name(dns_rbtnodechain_t *chain, dns_name_t *name,
isc_boolean_t include_chain_end)
isc_boolean_t include_chain_end)
{
dns_name_t nodename;
isc_result_t result = ISC_R_SUCCESS;
int i;
dns_name_init(&nodename, NULL);
if (include_chain_end && chain->end != NULL) {
NODENAME(chain->end, &nodename);
result = dns_name_copy(&nodename, name, NULL);
if (result != ISC_R_SUCCESS)
return (result);
} else
dns_name_reset(name);
for (i = (int)chain->level_count - 1; i >= 0; i--) {
NODENAME(chain->levels[i], &nodename);
result = dns_name_concatenate(name, &nodename, name, NULL);
if (result != ISC_R_SUCCESS)
return (result);
}
return (result);
dns_name_t nodename;
isc_result_t result = ISC_R_SUCCESS;
int i;
dns_name_init(&nodename, NULL);
if (include_chain_end && chain->end != NULL) {
NODENAME(chain->end, &nodename);
result = dns_name_copy(&nodename, name, NULL);
if (result != ISC_R_SUCCESS)
return (result);
} else
dns_name_reset(name);
for (i = (int)chain->level_count - 1; i >= 0; i--) {
NODENAME(chain->levels[i], &nodename);
result = dns_name_concatenate(name, &nodename, name, NULL);
if (result != ISC_R_SUCCESS)
return (result);
}
return (result);
}
static inline isc_result_t
move_chain_to_last(dns_rbtnodechain_t *chain, dns_rbtnode_t *node) {
do {
/*
* Go as far right and then down as much as possible,
* as long as the rightmost node has a down pointer.
*/
while (RIGHT(node) != NULL)
node = RIGHT(node);
do {
/*
* Go as far right and then down as much as possible,
* as long as the rightmost node has a down pointer.
*/
while (RIGHT(node) != NULL)
node = RIGHT(node);
if (DOWN(node) == NULL)
break;
if (DOWN(node) == NULL)
break;
ADD_LEVEL(chain, node);
node = DOWN(node);
} while (1);
ADD_LEVEL(chain, node);
node = DOWN(node);
} while (1);
chain->end = node;
chain->end = node;
return (ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
}
/*
......@@ -356,281 +356,281 @@ move_chain_to_last(dns_rbtnodechain_t *chain, dns_rbtnode_t *node) {
isc_result_t
dns_rbt_addnode(dns_rbt_t *rbt, dns_name_t *name, dns_rbtnode_t **nodep) {
/*
* Does this thing have too many variables or what?
*/
dns_rbtnode_t **root, *parent, *child, *current, *new_current;
dns_name_t *add_name, *new_name, current_name, *prefix, *suffix;
dns_fixedname_t fixedcopy, fixedprefix, fixedsuffix, fnewname;
dns_offsets_t current_offsets;
dns_namereln_t compared;
isc_result_t result = ISC_R_SUCCESS;
dns_rbtnodechain_t chain;
unsigned int common_labels;
unsigned int nlabels, hlabels;
int order;
REQUIRE(VALID_RBT(rbt));
REQUIRE(dns_name_isabsolute(name));
REQUIRE(nodep != NULL && *nodep == NULL);
/*
* Create a copy of the name so the original name structure is
* not modified.
*/
dns_fixedname_init(&fixedcopy);
add_name = dns_fixedname_name(&fixedcopy);
dns_name_clone(name, add_name);
if (rbt->root == NULL) {
result = create_node(rbt->mctx, add_name, &new_current);
if (result == ISC_R_SUCCESS) {
rbt->nodecount++;
new_current->is_root = 1;
rbt->root = new_current;
*nodep = new_current;
hash_node(rbt, new_current, name);
}
return (result);
}
dns_rbtnodechain_init(&chain, rbt->mctx);
dns_fixedname_init(&fixedprefix);
dns_fixedname_init(&fixedsuffix);
prefix = dns_fixedname_name(&fixedprefix);
suffix = dns_fixedname_name(&fixedsuffix);
root = &rbt->root;
INSIST(IS_ROOT(*root));
parent = NULL;
current = NULL;
child = *root;
dns_name_init(&current_name, current_offsets);
dns_fixedname_init(&fnewname);
new_name = dns_fixedname_name(&fnewname);
nlabels = dns_name_countlabels(name);
hlabels = 0;
do {
current = child;
NODENAME(current, &current_name);
compared = dns_name_fullcompare(add_name, &current_name,
&order, &common_labels);
if (compared == dns_namereln_equal) {
*nodep = current;
result = ISC_R_EXISTS;
break;
}
if (compared == dns_namereln_none) {
if (order < 0) {
parent = current;
child = LEFT(current);
} else if (order > 0) {
parent = current;
child = RIGHT(current);
}
} else {
/*
* This name has some suffix in common with the
* name at the current node. If the name at
* the current node is shorter, that means the
* new name should be in a subtree. If the
* name at the current node is longer, that means
* the down pointer to this tree should point
* to a new tree that has the common suffix, and
* the non-common parts of these two names should
* start a new tree.
*/
hlabels += common_labels;
if (compared == dns_namereln_subdomain) {
/*
* All of the existing labels are in common,
* so the new name is in a subtree.
* Whack off the common labels for the
* not-in-common part to be searched for
* in the next level.
*/
dns_name_split(add_name, common_labels,
add_name, NULL);
/*
* Follow the down pointer (possibly NULL).
*/
root = &DOWN(current);
INSIST(*root == NULL ||
(IS_ROOT(*root) &&
PARENT(*root) == current));
parent = NULL;
child = DOWN(current);
ADD_LEVEL(&chain, current);
} else {
/*
* The number of labels in common is fewer
* than the number of labels at the current
* node, so the current node must be adjusted
* to have just the common suffix, and a down
* pointer made to a new tree.
*/
INSIST(compared == dns_namereln_commonancestor
|| compared == dns_namereln_contains);
/*
* Ensure the number of levels in the tree
* does not exceed the number of logical
* levels allowed by DNSSEC.
*
* XXXDCL need a better error result?
*
* XXXDCL Since chain ancestors were removed,
* no longer used by dns_rbt_addonlevel(),
* this is the only real use of chains in the
* function. It could be done instead with
* a simple integer variable, but I am pressed
* for time.
*/
if (chain.level_count ==