dbtable.c revision ec5347e2c775f027573ce5648b910361aa926c01
/*
* Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2001 Internet Software Consortium.
*
* 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: dbtable.c,v 1.32 2007/06/18 23:47:40 tbox Exp $
*/
/*! \file
* \author
* Principal Author: DCL
*/
#include <config.h>
struct dns_dbtable {
/* Unlocked. */
unsigned int magic;
/* Locked by lock. */
unsigned int references;
/* Locked by tree_lock. */
};
static void
dns_db_detach(&db);
}
{
return (ISC_R_NOMEMORY);
if (result != ISC_R_SUCCESS)
goto clean1;
if (result != ISC_R_SUCCESS)
goto clean2;
if (result != ISC_R_SUCCESS)
goto clean3;
return (ISC_R_SUCCESS);
return (result);
}
static inline void
/*
* Caller must ensure that it is safe to call.
*/
}
void
source->references++;
}
void
dbtable->references--;
if (dbtable->references == 0)
if (free_dbtable)
}
return (result);
}
void
/*
* There is a requirement that the association of name with db
* be verified. With the current rbt.c this is expensive to do,
* because effectively two find operations are being done, but
* deletion is relatively infrequent.
* XXXDCL ... this could be cheaper now with dns_rbt_deletenode.
*/
(void **) (void *)&stored_data);
if (result == ISC_R_SUCCESS) {
}
}
void
}
void
}
void
}
{
unsigned int rbtoptions = 0;
if ((options & DNS_DBTABLEFIND_NOEXACT) != 0)
(void **) (void *)&stored_data);
} else
return (result);
}