1 /* $NetBSD: instance.h,v 1.6 2024/02/21 22:51:27 christos Exp $ */ 2 3 /* 4 * Copyright (C) Internet Systems Consortium, Inc. ("ISC") 5 * 6 * SPDX-License-Identifier: MPL-2.0 AND ISC 7 * 8 * This Source Code Form is subject to the terms of the Mozilla Public 9 * License, v. 2.0. If a copy of the MPL was not distributed with this 10 * file, you can obtain one at https://mozilla.org/MPL/2.0/. 11 * 12 * See the COPYRIGHT file distributed with this work for additional 13 * information regarding copyright ownership. 14 */ 15 16 /* 17 * Copyright (C) 2009-2015 Red Hat 18 * 19 * Permission to use, copy, modify, and/or distribute this software for any 20 * purpose with or without fee is hereby granted, provided that the above 21 * copyright notice and this permission notice appear in all copies. 22 * 23 * THE SOFTWARE IS PROVIDED "AS IS" AND AUTHORS DISCLAIMS ALL WARRANTIES WITH 24 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 25 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 26 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 27 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 28 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 29 * PERFORMANCE OF THIS SOFTWARE. 30 */ 31 32 /** 33 * Driver instance object. 34 */ 35 36 #pragma once 37 38 #include <stdbool.h> 39 40 #include <dns/fixedname.h> 41 #include <dns/name.h> 42 #include <dns/types.h> 43 44 struct sample_instance { 45 isc_mem_t *mctx; 46 char *db_name; 47 dns_dbimplementation_t *db_imp; 48 49 /* These are needed for zone creation. */ 50 dns_view_t *view; 51 dns_zonemgr_t *zmgr; 52 isc_task_t *task; 53 bool exiting; 54 55 dns_zone_t *zone1; 56 dns_fixedname_t zone1_fn; 57 dns_name_t *zone1_name; 58 59 dns_zone_t *zone2; 60 dns_fixedname_t zone2_fn; 61 dns_name_t *zone2_name; 62 }; 63 64 typedef struct sample_instance sample_instance_t; 65 66 isc_result_t 67 new_sample_instance(isc_mem_t *mctx, const char *db_name, int argc, char **argv, 68 const dns_dyndbctx_t *dctx, 69 sample_instance_t **sample_instp); 70 71 isc_result_t 72 load_sample_instance_zones(sample_instance_t *inst); 73 74 void 75 destroy_sample_instance(sample_instance_t **sample_instp); 76