6
* Copyright (C) 2013 mariuszbi@gmail.com
8
* This file is part of Kamailio, a free SIP server.
10
* Kamailio is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* (at your option) any later version
15
* Kamailio is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU General Public License for more details.
20
* You should have received a copy of the GNU General Public License
21
* along with this program; if not, write to the Free Software
22
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26
* 2013-03 initial implementation
36
#include "../../sr_module.h"
37
#include "../../error.h"
38
#include "../../dprint.h"
40
#include "../../dns_func.h"
42
#include "dnssec_func.h"
47
static int dnssec_init(void);
48
static int dnssec_exit(void);
52
static unsigned int flags=0;
54
/* global variables */
55
gen_lock_t* timer_lock=0;
56
struct list_link* timer = 0;
59
static cmd_export_t cmds[]={
63
static param_export_t params[]={
64
{"general_query_flags", INT_PARAM, &flags},
69
static mi_export_t mi_cmds [] = {
74
struct module_exports exports= {
76
DEFAULT_DLFLAGS, /* dlopen flags */
79
0, /* exported statistics */
80
mi_cmds, /* exported MI functions */
81
0, /* exported pseudo-variables */
82
0, /* extra processes */
83
dnssec_init, /* module initialization function */
85
(destroy_function) dnssec_exit, /* module exit function */
86
0 /* per-child init function */
90
static int load_dns(void)
92
struct dns_func_t *f = pkg_malloc(sizeof(struct dns_func_t));
96
memset(f, 0, sizeof(struct dns_func_t));
97
f->sr_res_init = dnssec_res_init;
98
f->sr_gethostbyname = dnssec_gethostbyname;
99
f->sr_gethostbyname2 = dnssec_gethostbyname2;
100
f->sr_res_search = dnssec_res_search;
106
static int dnssec_init(void)
108
LOG(L_INFO, "DNSSEC - initializing\n");
110
/* if(register_mi_mod(exports.name, mi_cmds)!=0)
112
LM_ERR("failed to register MI commands\n");
118
if(flags) set_context_flags(flags);
120
if(load_dns() != 0) {
121
LM_ERR("loaded dnssec wrappers failed\n");
123
/* load dnssec resolver wrappers */
129
static int dnssec_exit(void)
131
(void)dnssec_res_destroy();