dnshandler.h
Go to the documentation of this file.
/*
* Copyright (c) 2009 NLNet Labs. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef DAEMON_DNSHANDLER_H
#define DAEMON_DNSHANDLER_H
#include "config.h"
#include <stdint.h>
typedef struct dnshandler_struct dnshandler_type;
#include "status.h"
#include "locks.h"
#include "status.h"
#include "wire/listener.h"
#include "wire/netio.h"
#include "wire/query.h"
#include "wire/sock.h"
#define ODS_SE_NOTIFY_CMD "NOTIFY"
#define ODS_SE_MAX_HANDLERS 5
struct dnshandler_struct {
janitor_thread_t thread_id;
engine_type* engine;
listener_type* interfaces;
socklist_type* socklist;
netio_type* netio;
query_type* query;
netio_handler_type xfrhandler;
unsigned need_to_exit;
netio_handler_type *tcp_accept_handlers;
};
extern dnshandler_type* dnshandler_create(listener_type* interfaces);
extern ods_status dnshandler_listen(dnshandler_type* dnshandler);
extern void dnshandler_start(dnshandler_type* dnshandler);
extern void dnshandler_signal(dnshandler_type* dnshandler);
extern void dnshandler_fwd_notify(dnshandler_type* dnshandler,
uint8_t* pkt, size_t len);
extern void dnshandler_cleanup(dnshandler_type* dnshandler);
#endif /* DAEMON_DNSHANDLER_H */
dnshandler_signal
void dnshandler_signal(dnshandler_type *dnshandler)
Definition dnshandler.c:218
dnshandler_create
dnshandler_type * dnshandler_create(listener_type *interfaces)
Definition dnshandler.c:51
dnshandler_listen
ods_status dnshandler_listen(dnshandler_type *dnshandler)
Definition dnshandler.c:106
dnshandler_start
void dnshandler_start(dnshandler_type *dnshandler)
Definition dnshandler.c:125
dnshandler_cleanup
void dnshandler_cleanup(dnshandler_type *dnshandler)
Definition dnshandler.c:277
dnshandler_fwd_notify
void dnshandler_fwd_notify(dnshandler_type *dnshandler, uint8_t *pkt, size_t len)
Definition dnshandler.c:231
dnshandler_type
struct dnshandler_struct dnshandler_type
Definition dnshandler.h:38
engine_type
struct engine_struct engine_type
Definition engine.h:38
listener.h
listener_type
struct listener_struct listener_type
Definition listener.h:80
netio.h
netio_handler_type
struct netio_handler_struct netio_handler_type
Definition netio.h:79
netio_type
struct netio_struct netio_type
Definition netio.h:78
query.h
query_type
struct query_struct query_type
Definition query.h:58
sock.h
socklist_type
struct socklist_struct socklist_type
Definition sock.h:55
dnshandler_struct
Definition dnshandler.h:51
dnshandler_struct::xfrhandler
netio_handler_type xfrhandler
Definition dnshandler.h:58
dnshandler_struct::tcp_accept_handlers
netio_handler_type * tcp_accept_handlers
Definition dnshandler.h:60
dnshandler_struct::thread_id
janitor_thread_t thread_id
Definition dnshandler.h:52
dnshandler_struct::engine
engine_type * engine
Definition dnshandler.h:53
dnshandler_struct::socklist
socklist_type * socklist
Definition dnshandler.h:55
dnshandler_struct::need_to_exit
unsigned need_to_exit
Definition dnshandler.h:59
dnshandler_struct::interfaces
listener_type * interfaces
Definition dnshandler.h:54
dnshandler_struct::netio
netio_type * netio
Definition dnshandler.h:56
dnshandler_struct::query
query_type * query
Definition dnshandler.h:57