dbtable.c revision 92ef1a9b9dbd48ecb507b42ac62c15afefdaf838
/*
* Copyright (C) 1999-2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/*
* $Id: dbtable.c,v 1.25 2001/06/04 19:33:00 tale Exp $
*/
/*
* 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 **)&stored_data);
if (result == ISC_R_SUCCESS) {
}
}
void
}
void
}
void
}
{
unsigned int rbtoptions = 0;
if ((options & DNS_DBTABLEFIND_NOEXACT) != 0)
(void **)&stored_data);
} else
return (result);
}