summaryrefslogtreecommitdiff
path: root/util/module.h
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2020-05-21 05:01:52 +0000
committerCy Schubert <cy@FreeBSD.org>2020-05-21 05:01:52 +0000
commit6a53c00e64c4cf911eb00846733d9e6a47b2e7f4 (patch)
tree60a7720d2d4edfe62b094e2665743e8879ebb911 /util/module.h
parente2fe726866d062155f6b1aae749375475ef19191 (diff)
Diffstat (limited to 'util/module.h')
-rw-r--r--util/module.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/util/module.h b/util/module.h
index 1b9aed216c7b8..fa89c647e3700 100644
--- a/util/module.h
+++ b/util/module.h
@@ -307,6 +307,17 @@ typedef int inplace_cb_query_response_func_type(struct module_qstate* qstate,
struct dns_msg* response, int id, void* cb_args);
/**
+ * Function called when looking for (expired) cached answers during the serve
+ * expired logic.
+ * Called as func(qstate, lookup_qinfo)
+ * Where:
+ * qstate: the query state.
+ * lookup_qinfo: the qinfo to lookup for.
+ */
+typedef struct dns_msg* serve_expired_lookup_func_type(
+ struct module_qstate* qstate, struct query_info* lookup_qinfo);
+
+/**
* Module environment.
* Services and data provided to the module.
*/
@@ -572,6 +583,14 @@ struct sock_list {
struct respip_action_info;
/**
+ * Struct to hold relevant data for serve expired
+ */
+struct serve_expired_data {
+ struct comm_timer* timer;
+ serve_expired_lookup_func_type* get_cached_answer;
+};
+
+/**
* Module state, per query.
*/
struct module_qstate {
@@ -612,6 +631,8 @@ struct module_qstate {
struct mesh_state* mesh_info;
/** how many seconds before expiry is this prefetched (0 if not) */
time_t prefetch_leeway;
+ /** serve expired data */
+ struct serve_expired_data* serve_expired_data;
/** incoming edns options from the front end */
struct edns_option* edns_opts_front_in;