|
unbound 0.1
|
The context structure. More...
#include <context.h>
Data Fields | |
| lock_basic_type | qqpipe_lock |
| mutex on query write pipe | |
| struct tube * | qq_pipe |
| the query write pipe | |
| lock_basic_type | rrpipe_lock |
| mutex on result read pipe | |
| struct tube * | rr_pipe |
| the result read pipe | |
| lock_basic_type | cfglock |
| mutex for access to env.cfg, finalized and dothread | |
| int | finalized |
| The context has been finalized This is after config when the first resolve is done. | |
| int | created_bg |
| is bg worker created yet ? | |
| pid_t | bg_pid |
| pid of bg worker process | |
| ub_thread_type | bg_tid |
| tid of bg worker thread | |
| pid_t | pipe_pid |
| pid when pipes are created. | |
| struct libworker * | thread_worker |
| when threaded, the worker that exists in the created thread. | |
| int | dothread |
| do threading (instead of forking) for async resolution | |
| int | thr_next_num |
| next thread number for new threads | |
| int | logfile_override |
| if logfile is overridden | |
| FILE * | log_out |
| what logfile to use instead | |
| struct alloc_cache * | alloc_list |
| List of alloc-cache-id points per threadnum for notinuse threads. | |
| struct alloc_cache | superalloc |
| shared caches, and so on | |
| struct module_env * | env |
| module env master value | |
| struct module_stack | mods |
| module stack | |
| struct local_zones * | local_zones |
| local authority zones | |
| struct ub_randstate * | seed_rnd |
| random state used to seed new random state structures | |
| struct ub_event_base * | event_base |
| event base for event oriented interface | |
| int | event_base_malloced |
| true if the event_base is a pluggable base that is malloced with a user event base inside, if so, clean up the pluggable alloc | |
| struct libworker * | event_worker |
| libworker for event based interface | |
| int | next_querynum |
| next query number (to try) to use | |
| size_t | num_async |
| number of async queries outstanding | |
| rbtree_type | queries |
| Tree of outstanding queries. | |
The context structure.
Contains two pipes for async service qq : write queries to the async service pid/tid. rr : read results from the async service pid/tid.
| lock_basic_type ub_ctx::qqpipe_lock |
mutex on query write pipe
Referenced by ub_cancel(), ub_ctx_create_nopipe(), ub_ctx_delete(), ub_resolve_async(), and ub_stop_bg().
| struct tube* ub_ctx::qq_pipe |
the query write pipe
Referenced by libworker_bg(), libworker_dobg(), ub_cancel(), ub_ctx_create(), ub_ctx_delete(), ub_resolve_async(), and ub_stop_bg().
| lock_basic_type ub_ctx::rrpipe_lock |
mutex on result read pipe
Referenced by ub_ctx_create_nopipe(), ub_ctx_delete(), ub_process(), ub_stop_bg(), and ub_wait().
| struct tube* ub_ctx::rr_pipe |
the result read pipe
Referenced by add_bg_result(), libworker_bg(), libworker_dobg(), ub_ctx_create(), ub_ctx_delete(), ub_fd(), ub_poll(), ub_process(), ub_stop_bg(), and ub_wait().
| lock_basic_type ub_ctx::cfglock |
mutex for access to env.cfg, finalized and dothread
Referenced by add_bg_result(), context_new(), context_obtain_alloc(), context_release_alloc(), handle_cancel(), handle_newq(), libworker_bg(), libworker_bg_done_cb(), libworker_event_done_cb(), libworker_setup(), process_answer_detail(), ub_cancel(), ub_ctx_add_ta(), ub_ctx_add_ta_autr(), ub_ctx_add_ta_file(), ub_ctx_async(), ub_ctx_config(), ub_ctx_create_nopipe(), ub_ctx_debuglevel(), ub_ctx_debugout(), ub_ctx_delete(), ub_ctx_finalize(), ub_ctx_get_option(), ub_ctx_hosts(), ub_ctx_set_event(), ub_ctx_set_fwd(), ub_ctx_set_option(), ub_ctx_set_stub(), ub_ctx_set_tls(), ub_ctx_trustedkeys(), ub_resolve(), ub_resolve_async(), ub_resolve_event(), ub_stop_bg(), and ub_wait().
| int ub_ctx::finalized |
The context has been finalized This is after config when the first resolve is done.
The modules are inited (module-init()) and shared caches created.
Referenced by context_finalize(), ub_ctx_add_ta(), ub_ctx_add_ta_autr(), ub_ctx_add_ta_file(), ub_ctx_async(), ub_ctx_config(), ub_ctx_finalize(), ub_ctx_hosts(), ub_ctx_set_fwd(), ub_ctx_set_option(), ub_ctx_set_stub(), ub_ctx_set_tls(), ub_ctx_trustedkeys(), ub_resolve(), ub_resolve_async(), and ub_resolve_event().
| int ub_ctx::created_bg |
is bg worker created yet ?
Referenced by ub_ctx_create_event(), ub_ctx_create_ub_event(), ub_ctx_delete(), ub_ctx_set_event(), ub_resolve_async(), and ub_stop_bg().
| pid_t ub_ctx::bg_pid |
pid of bg worker process
Referenced by libworker_bg(), and ub_stop_bg().
| ub_thread_type ub_ctx::bg_tid |
tid of bg worker thread
Referenced by libworker_bg(), ub_ctx_delete(), and ub_stop_bg().
| pid_t ub_ctx::pipe_pid |
pid when pipes are created.
This was the process when the setup was called. Helps with clean up, so we can tell after a fork which side of the fork the delete is on.
Referenced by context_finalize(), and ub_ctx_delete().
| struct libworker* ub_ctx::thread_worker |
when threaded, the worker that exists in the created thread.
Referenced by libworker_bg(), and ub_ctx_delete().
| int ub_ctx::dothread |
do threading (instead of forking) for async resolution
Referenced by libworker_bg(), ub_cancel(), ub_ctx_async(), ub_ctx_create_event(), ub_ctx_create_ub_event(), ub_ctx_delete(), ub_ctx_set_event(), and ub_stop_bg().
| int ub_ctx::thr_next_num |
next thread number for new threads
Referenced by context_obtain_alloc().
| int ub_ctx::logfile_override |
if logfile is overridden
Referenced by context_finalize(), and ub_ctx_debugout().
| FILE* ub_ctx::log_out |
what logfile to use instead
Referenced by context_finalize(), and ub_ctx_debugout().
| struct alloc_cache* ub_ctx::alloc_list |
List of alloc-cache-id points per threadnum for notinuse threads.
Simply the entire struct alloc_cache with the 'super' member used to link a simply linked list. Reset super member to the superalloc before use.
Referenced by context_obtain_alloc(), context_release_alloc(), and ub_ctx_delete().
| struct alloc_cache ub_ctx::superalloc |
shared caches, and so on
Referenced by context_obtain_alloc(), ub_ctx_create_nopipe(), and ub_ctx_delete().
| struct module_env* ub_ctx::env |
module env master value
Referenced by context_finalize(), handle_newq(), libworker_attach_mesh(), libworker_fg(), libworker_setup(), ub_ctx_add_ta(), ub_ctx_add_ta_autr(), ub_ctx_add_ta_file(), ub_ctx_config(), ub_ctx_create(), ub_ctx_create_nopipe(), ub_ctx_debuglevel(), ub_ctx_delete(), ub_ctx_get_option(), ub_ctx_hosts(), ub_ctx_set_fwd(), ub_ctx_set_option(), ub_ctx_set_stub(), ub_ctx_set_tls(), and ub_ctx_trustedkeys().
| struct module_stack ub_ctx::mods |
module stack
Referenced by context_finalize(), libworker_setup(), ub_ctx_create(), ub_ctx_create_nopipe(), and ub_ctx_delete().
| struct local_zones* ub_ctx::local_zones |
local authority zones
Referenced by context_finalize(), handle_newq(), libworker_attach_mesh(), libworker_fg(), ub_ctx_data_add(), ub_ctx_data_remove(), ub_ctx_delete(), ub_ctx_print_local_zones(), ub_ctx_zone_add(), and ub_ctx_zone_remove().
| struct ub_randstate* ub_ctx::seed_rnd |
random state used to seed new random state structures
Referenced by libworker_setup(), ub_ctx_create(), ub_ctx_create_nopipe(), and ub_ctx_delete().
| struct ub_event_base* ub_ctx::event_base |
event base for event oriented interface
Referenced by ub_ctx_create_event(), ub_ctx_create_ub_event(), ub_ctx_delete(), ub_ctx_set_event(), ub_fd(), ub_poll(), ub_process(), ub_resolve_async(), ub_resolve_event(), and ub_wait().
| int ub_ctx::event_base_malloced |
true if the event_base is a pluggable base that is malloced with a user event base inside, if so, clean up the pluggable alloc
Referenced by ub_ctx_create_event(), and ub_ctx_delete().
| struct libworker* ub_ctx::event_worker |
libworker for event based interface
Referenced by libworker_attach_mesh(), ub_ctx_delete(), ub_ctx_set_event(), and ub_resolve_event().
| int ub_ctx::next_querynum |
next query number (to try) to use
Referenced by find_id().
| size_t ub_ctx::num_async |
number of async queries outstanding
Referenced by add_bg_result(), context_deserialize_new_query(), context_new(), libworker_bg_done_cb(), libworker_event_done_cb(), process_answer_detail(), ub_cancel(), ub_resolve_async(), and ub_wait().
| rbtree_type ub_ctx::queries |
Tree of outstanding queries.
Indexed by querynum Used when results come in for async to lookup. Used when cancel is done for lookup (and delete). Used to see if querynum is free for use. Content of type ctx_query.
Referenced by add_bg_result(), context_deserialize_answer(), context_deserialize_cancel(), context_deserialize_new_query(), context_lookup_new_query(), context_new(), find_id(), libworker_bg_done_cb(), libworker_event_done_cb(), process_answer_detail(), ub_cancel(), ub_ctx_create_nopipe(), ub_ctx_delete(), ub_resolve(), and ub_resolve_async().