|
Electroneum
|
#include "libunbound/worker.h"#include "util/netevent.h"#include "util/locks.h"#include "util/alloc.h"#include "util/data/msgreply.h"#include "util/data/msgparse.h"#include "daemon/stats.h"#include "util/module.h"#include "dnstap/dnstap.h"
Go to the source code of this file.
Classes | |
| struct | worker |
Enumerations | |
| enum | worker_commands { worker_cmd_quit, worker_cmd_stats, worker_cmd_stats_noreset, worker_cmd_remote } |
Functions | |
| struct worker * | worker_create (struct daemon *daemon, int id, int *ports, int n) |
| int | worker_init (struct worker *worker, struct config_file *cfg, struct listen_port *ports, int do_sigs) |
| void | worker_work (struct worker *worker) |
| void | worker_delete (struct worker *worker) |
| void | worker_send_cmd (struct worker *worker, enum worker_commands cmd) |
| void | worker_stats_clear (struct worker *worker) |
This file describes the worker structure that holds a list of pending requests and handles them.
Definition in file worker.h.
| enum worker_commands |
worker commands
| Enumerator | |
|---|---|
| worker_cmd_quit | make the worker quit |
| worker_cmd_stats | obtain statistics |
| worker_cmd_stats_noreset | obtain statistics without statsclear |
| worker_cmd_remote | execute remote control command |
Create the worker structure. Bare bones version, zeroed struct, with backpointers only. Use worker_init on it later.
| daemon | the daemon that this worker thread is part of. |
| id | the thread number from 0.. numthreads-1. |
| ports | the ports it is allowed to use, array. |
| n | the number of ports. |
| void worker_delete | ( | struct worker * | worker | ) |
Delete worker.
| int worker_init | ( | struct worker * | worker, |
| struct config_file * | cfg, | ||
| struct listen_port * | ports, | ||
| int | do_sigs | ||
| ) |
Initialize worker. Allocates event base, listens to ports
| worker | worker to initialize, created with worker_create. |
| cfg | configuration settings. |
| ports | list of shared query ports. |
| do_sigs | if true, worker installs signal handlers. |
| void worker_send_cmd | ( | struct worker * | worker, |
| enum worker_commands | cmd | ||
| ) |
Send a command to a worker. Uses blocking writes.
| worker | worker to send command to. |
| cmd | command to send. |
| void worker_stats_clear | ( | struct worker * | worker | ) |
Init worker stats - includes server_stats_init, outside network and mesh.
| worker | the worker to init |
| void worker_work | ( | struct worker * | worker | ) |
Make worker work.