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;
};
dnshandler_type* dnshandler_create(listener_type* interfaces);
ods_status dnshandler_listen(dnshandler_type* dnshandler);
void dnshandler_start(dnshandler_type* dnshandler);
void dnshandler_signal(dnshandler_type* dnshandler);
void dnshandler_fwd_notify(dnshandler_type* dnshandler,
uint8_t* pkt, size_t len);
void dnshandler_cleanup(dnshandler_type* dnshandler);
#endif /* DAEMON_DNSHANDLER_H */
dnshandler_start
void dnshandler_start(dnshandler_type *dnshandler)
Definition: dnshandler.c:125
dnshandler_struct::socklist
socklist_type * socklist
Definition: dnshandler.h:55
dnshandler_struct::query
query_type * query
Definition: dnshandler.h:57
dnshandler_fwd_notify
void dnshandler_fwd_notify(dnshandler_type *dnshandler, uint8_t *pkt, size_t len)
Definition: dnshandler.c:231
listener.h
dnshandler_struct::interfaces
listener_type * interfaces
Definition: dnshandler.h:54
dnshandler_cleanup
void dnshandler_cleanup(dnshandler_type *dnshandler)
Definition: dnshandler.c:277
dnshandler_struct::engine
engine_type * engine
Definition: dnshandler.h:53
dnshandler_struct::tcp_accept_handlers
netio_handler_type * tcp_accept_handlers
Definition: dnshandler.h:60
netio.h
query.h
query_struct
Definition: query.h:59
dnshandler_struct::thread_id
janitor_thread_t thread_id
Definition: dnshandler.h:52
dnshandler_struct
Definition: dnshandler.h:51
socklist_struct
Definition: sock.h:56
dnshandler_struct::need_to_exit
unsigned need_to_exit
Definition: dnshandler.h:59
dnshandler_listen
ods_status dnshandler_listen(dnshandler_type *dnshandler)
Definition: dnshandler.c:106
netio_handler_struct
Definition: netio.h:102
sock.h
netio_struct
Definition: netio.h:139
dnshandler_signal
void dnshandler_signal(dnshandler_type *dnshandler)
Definition: dnshandler.c:218
dnshandler_struct::xfrhandler
netio_handler_type xfrhandler
Definition: dnshandler.h:58
dnshandler_create
dnshandler_type * dnshandler_create(listener_type *interfaces)
Definition: dnshandler.c:51
engine_struct
Definition: engine.h:51
dnshandler_struct::netio
netio_type * netio
Definition: dnshandler.h:56
listener_struct
Definition: listener.h:81