engine.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_ENGINE_H
#define DAEMON_ENGINE_H
#include "config.h"
#include <signal.h>
typedef struct engine_struct engine_type;
#include "daemon/cfg.h"
#include "cmdhandler.h"
#include "daemon/dnshandler.h"
#include "daemon/xfrhandler.h"
#include "scheduler/worker.h"
#include "scheduler/schedule.h"
#include "status.h"
#include "locks.h"
#include "signer/zonelist.h"
#include "wire/edns.h"
struct engine_struct {
engineconfig_type* config;
worker_type** workers;
schedule_type* taskq;
cmdhandler_type* cmdhandler;
pid_t pid;
uid_t uid;
gid_t gid;
int daemonize;
int need_to_exit;
int need_to_reload;
/* Main thread blocks on this condition when there is nothing to do */
pthread_cond_t signal_cond;
pthread_mutex_t signal_lock;
zonelist_type* zonelist;
dnshandler_type* dnshandler;
xfrhandler_type* xfrhandler;
edns_data_type edns;
};
extern int engine_start(const char* cfgfile, int cmdline_verbosity,
int daemonize, int info);
extern void engine_wakeup_workers(engine_type* engine);
extern void engine_update_zones(engine_type* engine, ods_status zl_changed);
extern void engine_cleanup(engine_type* engine);
#endif /* DAEMON_ENGINE_H */
cfg.h
engineconfig_type
struct engineconfig_struct engineconfig_type
Definition cfg.h:33
dnshandler.h
dnshandler_type
struct dnshandler_struct dnshandler_type
Definition dnshandler.h:38
edns.h
edns_data_type
struct edns_data_struct edns_data_type
Definition edns.h:53
engine_wakeup_workers
void engine_wakeup_workers(engine_type *engine)
Definition engine.c:291
engine_cleanup
void engine_cleanup(engine_type *engine)
Definition engine.c:889
engine_start
int engine_start(const char *cfgfile, int cmdline_verbosity, int daemonize, int info)
Definition engine.c:768
engine_update_zones
void engine_update_zones(engine_type *engine, ods_status zl_changed)
Definition engine.c:617
engine_type
struct engine_struct engine_type
Definition engine.h:38
engine_struct
Definition engine.h:51
engine_struct::edns
edns_data_type edns
Definition engine.h:72
engine_struct::zonelist
zonelist_type * zonelist
Definition engine.h:69
engine_struct::taskq
schedule_type * taskq
Definition engine.h:54
engine_struct::xfrhandler
xfrhandler_type * xfrhandler
Definition engine.h:71
engine_struct::signal_lock
pthread_mutex_t signal_lock
Definition engine.h:67
engine_struct::pid
pid_t pid
Definition engine.h:57
engine_struct::gid
gid_t gid
Definition engine.h:59
engine_struct::cmdhandler
cmdhandler_type * cmdhandler
Definition engine.h:55
engine_struct::signal_cond
pthread_cond_t signal_cond
Definition engine.h:66
engine_struct::need_to_reload
int need_to_reload
Definition engine.h:63
engine_struct::daemonize
int daemonize
Definition engine.h:61
engine_struct::uid
uid_t uid
Definition engine.h:58
engine_struct::need_to_exit
int need_to_exit
Definition engine.h:62
engine_struct::dnshandler
dnshandler_type * dnshandler
Definition engine.h:70
engine_struct::workers
worker_type ** workers
Definition engine.h:53
engine_struct::config
engineconfig_type * config
Definition engine.h:52
xfrhandler.h
xfrhandler_type
struct xfrhandler_struct xfrhandler_type
Definition xfrhandler.h:37
zonelist.h
zonelist_type
struct zonelist_struct zonelist_type
Definition zonelist.h:34