Electroneum
daemon.h File Reference
#include "util/locks.h"
#include "util/alloc.h"
#include "services/modstack.h"
#include "dnstap/dnstap_config.h"
#include "dnscrypt/dnscrypt_config.h"
Include dependency graph for daemon.h:

Go to the source code of this file.

Classes

struct  daemon
 

Functions

struct daemondaemon_init (void)
 
int daemon_open_shared_ports (struct daemon *daemon)
 
void daemon_fork (struct daemon *daemon)
 
void daemon_cleanup (struct daemon *daemon)
 
void daemon_delete (struct daemon *daemon)
 
void daemon_apply_cfg (struct daemon *daemon, struct config_file *cfg)
 

Detailed Description

The daemon consists of global settings and a number of workers.

Definition in file daemon.h.

Function Documentation

◆ daemon_apply_cfg()

void daemon_apply_cfg ( struct daemon daemon,
struct config_file cfg 
)

Apply config settings.

Parameters
daemonthe daemon.
cfgnew config settings.

◆ daemon_cleanup()

void daemon_cleanup ( struct daemon daemon)

Close off the worker thread information. Bring the daemon back into state ready for daemon_fork again.

Parameters
daemonthe daemon.

◆ daemon_delete()

void daemon_delete ( struct daemon daemon)

Delete workers, close listening ports.

Parameters
daemonthe daemon.

◆ daemon_fork()

void daemon_fork ( struct daemon daemon)

Fork workers and start service. When the routine exits, it is no longer forked.

Parameters
daemonthe daemon.

◆ daemon_init()

struct daemon* daemon_init ( void  )

Initialize daemon structure.

Returns
: The daemon structure, or NULL on error.

◆ daemon_open_shared_ports()

int daemon_open_shared_ports ( struct daemon daemon)

Open shared listening ports (if needed). The cfg member pointer must have been set for the daemon.

Parameters
daemonthe daemon.
Returns
: false on error.