+++ /dev/null
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, you can obtain one at https://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-/*! \file */
-
-#include <stdbool.h>
-#include <stddef.h>
-
-#include <isc/hash.h>
-#include <isc/mem.h>
-#include <isc/mutex.h>
-#include <isc/once.h>
-#include <isc/refcount.h>
-#include <isc/util.h>
-
-#include <dns/db.h>
-#include <dns/lib.h>
-#include <dns/result.h>
-
-#include <dst/dst.h>
-
-/***
- *** Globals
- ***/
-
-unsigned int dns_pps = 0U;
-
-/***
- *** Functions
- ***/
-
-static isc_once_t init_once = ISC_ONCE_INIT;
-static isc_mem_t *dns_g_mctx = NULL;
-static bool initialize_done = false;
-static isc_refcount_t references;
-
-static void
-initialize(void) {
- isc_result_t result;
-
- REQUIRE(!initialize_done);
-
- isc_refcount_init(&references, 0);
-
- isc_mem_create(&dns_g_mctx);
- dns_result_register();
-
- result = dst_lib_init(dns_g_mctx, NULL);
- if (result != ISC_R_SUCCESS) {
- goto cleanup_mctx;
- }
-
- initialize_done = true;
- return;
-
-cleanup_mctx:
- if (dns_g_mctx != NULL) {
- isc_mem_detach(&dns_g_mctx);
- }
-}
-
-isc_result_t
-dns_lib_init(void) {
- isc_result_t result;
-
- /*
- * Since this routine is expected to be used by a normal application,
- * it should be better to return an error, instead of an emergency
- * abort, on any failure.
- */
- result = isc_once_do(&init_once, initialize);
- if (result != ISC_R_SUCCESS) {
- return (result);
- }
-
- if (!initialize_done) {
- return (ISC_R_FAILURE);
- }
-
- isc_refcount_increment0(&references);
-
- return (ISC_R_SUCCESS);
-}
-
-void
-dns_lib_shutdown(void) {
- if (isc_refcount_decrement(&references) == 1) {
- dst_lib_destroy();
-
- isc_refcount_destroy(&references);
-
- if (dns_g_mctx != NULL) {
- isc_mem_detach(&dns_g_mctx);
- }
- }
-}
./lib/dns/include/dns/keymgr.h C 2019,2020,2021
./lib/dns/include/dns/keytable.h C 2000,2001,2004,2005,2007,2009,2010,2014,2015,2016,2017,2018,2019,2020,2021
./lib/dns/include/dns/keyvalues.h C 1999,2000,2001,2003,2004,2005,2006,2007,2008,2009,2010,2012,2016,2017,2018,2019,2020,2021
-./lib/dns/include/dns/lib.h C 1999,2000,2001,2004,2005,2006,2007,2009,2016,2017,2018,2019,2020,2021
./lib/dns/include/dns/librpz.h C 2017,2018,2019,2020,2021
./lib/dns/include/dns/log.h C 1999,2000,2001,2003,2004,2005,2006,2007,2009,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021
./lib/dns/include/dns/lookup.h C 2000,2001,2004,2005,2006,2007,2009,2016,2018,2019,2020,2021
./lib/dns/keydata.c C 2009,2014,2016,2018,2019,2020,2021
./lib/dns/keymgr.c C 2019,2020,2021
./lib/dns/keytable.c C 2000,2001,2004,2005,2007,2009,2010,2013,2014,2015,2016,2017,2018,2019,2020,2021
-./lib/dns/lib.c C 1999,2000,2001,2004,2005,2007,2009,2013,2014,2015,2016,2017,2018,2019,2020,2021
./lib/dns/log.c C 1999,2000,2001,2003,2004,2005,2006,2007,2009,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021
./lib/dns/lookup.c C 2000,2001,2003,2004,2005,2007,2013,2016,2018,2019,2020,2021
./lib/dns/master.c C 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021