|
Electroneum
|
#include "util/data/packed_rrset.h"
Go to the source code of this file.
Classes | |
| struct | libworker |
Functions | |
| int | libworker_bg (struct ub_ctx *ctx) |
| int | libworker_fg (struct ub_ctx *ctx, struct ctx_query *q) |
| struct libworker * | libworker_create_event (struct ub_ctx *ctx, struct ub_event_base *eb) |
| int | libworker_attach_mesh (struct ub_ctx *ctx, struct ctx_query *q, int *async_id) |
| void | libworker_delete_event (struct libworker *w) |
| void | libworker_alloc_cleanup (void *arg) |
| void | libworker_enter_result (struct ub_result *res, struct sldns_buffer *buf, struct regional *temp, enum sec_status msg_security) |
This file contains the worker process or thread that performs the DNS resolving and validation. The worker is called by a procedure and if in the background continues until exit, if in the foreground returns from the procedure when done.
Definition in file libworker.h.
| void libworker_alloc_cleanup | ( | void * | arg | ) |
cleanup the cache to remove all rrset IDs from it, arg is libworker
Attach context_query to mesh for callback in event-driven setup.
| ctx | context |
| q | context query entry |
| async_id | store query num if query takes long. |
| int libworker_bg | ( | struct ub_ctx * | ctx | ) |
Create a background worker
| ctx | is updated with pid/tid of the background worker. a new allocation cache is obtained from ctx. It contains the threadnumber and unique id for further (shared) cache insertions. |
| struct libworker* libworker_create_event | ( | struct ub_ctx * | ctx, |
| struct ub_event_base * | eb | ||
| ) |
create worker for event-based interface.
| ctx | context with config. |
| eb | event base. |
| void libworker_delete_event | ( | struct libworker * | w | ) |
delete worker for event-based interface. does not free the event_base.
| w | event-based worker to delete. |
| void libworker_enter_result | ( | struct ub_result * | res, |
| struct sldns_buffer * | buf, | ||
| struct regional * | temp, | ||
| enum sec_status | msg_security | ||
| ) |
fill result from parsed message, on error fills servfail
| res | is clear at start, filled in at end. |
| buf | contains DNS message. |
| temp | temporary buffer for parse. |
| msg_security | security status of the DNS message. On error, the res may contain a different status (out of memory is not secure, not bogus). |
Create a foreground worker. This worker will join the threadpool of resolver threads. It exits when the query answer has been obtained (or error). This routine blocks until the worker is finished.
| ctx | new allocation cache obtained and returned to it. |
| q | query (result is stored in here). |