1 /*
2  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
3  *
4  * SPDX-License-Identifier: MPL-2.0
5  *
6  * This Source Code Form is subject to the terms of the Mozilla Public
7  * License, v. 2.0. If a copy of the MPL was not distributed with this
8  * file, you can obtain one at https://mozilla.org/MPL/2.0/.
9  *
10  * See the COPYRIGHT file distributed with this work for additional
11  * information regarding copyright ownership.
12  */
13 
14 #include <stdbool.h>
15 #include <stddef.h>
16 #include <stdint.h>
17 
18 #include <isc/lang.h>
19 #include <isc/mem.h>
20 #include <isc/once.h>
21 #include <isc/types.h>
22 #include <isc/util.h>
23 
24 #include <dst/dst.h>
25 
26 ISC_LANG_BEGINDECLS
27 
28 extern bool debug;
29 
30 int
31 LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
32 
33 static isc_mem_t *mctx = NULL;
34 
init(void)35 static void __attribute__((constructor)) init(void) {
36 	isc_mem_create(&mctx);
37 	RUNTIME_CHECK(dst_lib_init(mctx, NULL) == ISC_R_SUCCESS);
38 }
39 
deinit(void)40 static void __attribute__((destructor)) deinit(void) {
41 	dst_lib_destroy();
42 	isc_mem_destroy(&mctx);
43 }
44 
45 ISC_LANG_ENDDECLS
46