|
Electroneum
|
#include <module.h>

Public Attributes | |
| struct config_file * | cfg |
| struct slabhash * | msg_cache |
| struct rrset_cache * | rrset_cache |
| struct infra_cache * | infra_cache |
| struct key_cache * | key_cache |
| struct outbound_entry *(* | send_query )(struct query_info *qinfo, uint16_t flags, int dnssec, int want_dnssec, int nocaps, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *zone, size_t zonelen, int ssl_upstream, char *tls_auth_name, struct module_qstate *q) |
| void(* | detach_subs )(struct module_qstate *qstate) |
| int(* | attach_sub )(struct module_qstate *qstate, struct query_info *qinfo, uint16_t qflags, int prime, int valrec, struct module_qstate **newq) |
| int(* | add_sub )(struct module_qstate *qstate, struct query_info *qinfo, uint16_t qflags, int prime, int valrec, struct module_qstate **newq, struct mesh_state **sub) |
| void(* | kill_sub )(struct module_qstate *newq) |
| int(* | detect_cycle )(struct module_qstate *qstate, struct query_info *qinfo, uint16_t flags, int prime, int valrec) |
| struct regional * | scratch |
| struct sldns_buffer * | scratch_buffer |
| struct worker * | worker |
| struct comm_base * | worker_base |
| struct outside_network * | outnet |
| struct mesh_area * | mesh |
| struct alloc_cache * | alloc |
| struct ub_randstate * | rnd |
| time_t * | now |
| struct timeval * | now_tv |
| int | need_to_validate |
| struct val_anchors * | anchors |
| struct val_neg_cache * | neg_cache |
| struct comm_timer * | probe_timer |
| struct auth_zones * | auth_zones |
| struct iter_forwards * | fwds |
| struct iter_hints * | hints |
| void * | modinfo [MAX_MODULE] |
| struct inplace_cb * | inplace_cb_lists [inplace_cb_types_total] |
| struct edns_known_option * | edns_known_options |
| size_t | edns_known_options_num |
| int | unique_mesh |
Module environment. Services and data provided to the module.
| int(* module_env::add_sub) (struct module_qstate *qstate, struct query_info *qinfo, uint16_t qflags, int prime, int valrec, struct module_qstate **newq, struct mesh_state **sub) |
Add detached query. Creates it if it does not exist already. Does not make super/sub references. Performs a cycle detection - for double check - and fails if there is one. Updates stat items in mesh_area structure. Pass if it is priming query or not. return: o if error (malloc) happened. o need to initialise the new state (module init; it is a new state). so that the next run of the query with this module is successful. o no init needed, attachment successful. o added subquery, created if it did not exist already.
| qstate | the state to find mesh state, and that wants to receive the results from the new subquery. |
| qinfo | what to query for (copied). |
| qflags | what flags to use (RD / CD flag or not). |
| prime | if it is a (stub) priming query. |
| valrec | if it is a validation recursion query (lookup of key, DS). |
| newq | If the new subquery needs initialisation, it is returned, otherwise NULL is returned. |
| sub | The added mesh state, created if it did not exist already. |
| struct alloc_cache* module_env::alloc |
| struct val_anchors* module_env::anchors |
| int(* module_env::attach_sub) (struct module_qstate *qstate, struct query_info *qinfo, uint16_t qflags, int prime, int valrec, struct module_qstate **newq) |
Attach subquery. Creates it if it does not exist already. Keeps sub and super references correct. Updates stat items in mesh_area structure. Pass if it is priming query or not. return: o if error (malloc) happened. o need to initialise the new state (module init; it is a new state). so that the next run of the query with this module is successful. o no init needed, attachment successful.
| qstate | the state to find mesh state, and that wants to receive the results from the new subquery. |
| qinfo | what to query for (copied). |
| qflags | what flags to use (RD, CD flag or not). |
| prime | if it is a (stub) priming query. |
| valrec | validation lookup recursion, does not need validation |
| newq | If the new subquery needs initialisation, it is returned, otherwise NULL is returned. |
| struct auth_zones* module_env::auth_zones |
| struct config_file* module_env::cfg |
| void(* module_env::detach_subs) (struct module_qstate *qstate) |
| int(* module_env::detect_cycle) (struct module_qstate *qstate, struct query_info *qinfo, uint16_t flags, int prime, int valrec) |
Detect if adding a dependency for qstate on name,type,class will create a dependency cycle.
| qstate | given mesh querystate. |
| qinfo | query info for dependency. |
| flags | query flags of dependency, RD/CD flags. |
| prime | if dependency is a priming query or not. |
| valrec | validation lookup recursion, does not need validation |
| struct edns_known_option* module_env::edns_known_options |
| struct iter_forwards* module_env::fwds |
| struct iter_hints* module_env::hints |
iterator forwarder information. per-thread, created by worker. The hints – these aren't stored in the cache because they don't expire. The hints are always used to "prime" the cache. Note that both root hints and stub zone "hints" are stored in this data structure.
| struct infra_cache* module_env::infra_cache |
| struct inplace_cb* module_env::inplace_cb_lists[inplace_cb_types_total] |
| void(* module_env::kill_sub) (struct module_qstate *newq) |
| struct mesh_area* module_env::mesh |
| void* module_env::modinfo[MAX_MODULE] |
| struct slabhash* module_env::msg_cache |
| int module_env::need_to_validate |
| struct val_neg_cache* module_env::neg_cache |
| time_t* module_env::now |
| struct timeval* module_env::now_tv |
| struct outside_network* module_env::outnet |
| struct comm_timer* module_env::probe_timer |
| struct ub_randstate* module_env::rnd |
| struct rrset_cache* module_env::rrset_cache |
| struct regional* module_env::scratch |
| struct sldns_buffer* module_env::scratch_buffer |
| struct outbound_entry*(* module_env::send_query) (struct query_info *qinfo, uint16_t flags, int dnssec, int want_dnssec, int nocaps, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *zone, size_t zonelen, int ssl_upstream, char *tls_auth_name, struct module_qstate *q) |
Send serviced DNS query to server. UDP/TCP and EDNS is handled. operate() should return with wait_reply. Later on a callback will cause operate() to be called with event timeout or reply. The time until a timeout is calculated from roundtrip timing, several UDP retries are attempted.
| qinfo | query info. |
| flags | host order flags word, with opcode and CD bit. |
| dnssec | if set, EDNS record will have bits set. If EDNS_DO bit is set, DO bit is set in EDNS records. If BIT_CD is set, CD bit is set in queries with EDNS records. |
| want_dnssec | if set, the validator wants DNSSEC. Without EDNS, the answer is likely to be useless for this domain. |
| nocaps | do not use caps_for_id, use the qname as given. (ignored if caps_for_id is disabled). |
| addr | where to. |
| addrlen | length of addr. |
| zone | delegation point name. |
| zonelen | length of zone name. |
| ssl_upstream | use SSL for upstream queries. |
| tls_auth_name | if ssl_upstream, use this name with TLS authentication. |
| q | wich query state to reactivate upon return. |
| struct worker* module_env::worker |
| struct comm_base* module_env::worker_base |