struct daemon_remote;
struct respip_set;
struct shm_main_info;
+ struct doq_table;
struct cookie_secrets;
+struct fast_reload_thread;
+struct fast_reload_printq;
#include "dnstap/dnstap_config.h"
#ifdef USE_DNSTAP
log_assert(0);
}
+void fast_reload_service_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
+ void* ATTR_UNUSED(arg))
+{
+ log_assert(0);
+}
+
+int fast_reload_client_callback(struct comm_point* ATTR_UNUSED(c),
+ void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
+ struct comm_reply* ATTR_UNUSED(repinfo))
+{
+ log_assert(0);
+ return 0;
+}
++
+ #ifdef HAVE_NGTCP2
+ void doq_client_event_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
+ void* ATTR_UNUSED(arg))
+ {
+ log_assert(0);
+ }
+ #endif
+
+ #ifdef HAVE_NGTCP2
+ void doq_client_timer_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
+ void* ATTR_UNUSED(arg))
+ {
+ log_assert(0);
+ }
+ #endif
void iterator_set_ip46_support(struct module_stack* mods,
struct module_env* env, struct outside_network* outnet);
+/**
+ * Read config string that represents the target fetch policy.
+ * @param target_fetch_policy: alloced on return.
+ * @param max_dependency_depth: set on return.
+ * @param str: the config string
+ * @return false on failure.
+ */
+int read_fetch_policy(int** target_fetch_policy, int* max_dependency_depth,
+ const char* str);
+
+/**
+ * Create caps exempt data structure.
+ * @return NULL on failure.
+ */
+struct rbtree_type* caps_white_create(void);
+
+/**
+ * Delete caps exempt data structure.
+ * @param caps_white: caps exempt tree.
+ */
+void caps_white_delete(struct rbtree_type* caps_white);
+
+/**
+ * Apply config caps whitelist items to name tree
+ * @param ntree: caps exempt tree.
+ * @param cfg: config with options.
+ */
+int caps_white_apply_cfg(struct rbtree_type* ntree, struct config_file* cfg);
+
+/**
+ * Apply config for nat64
+ * @param nat64: the nat64 state.
+ * @param cfg: config with options.
+ * @return false on failure.
+ */
+int nat64_apply_cfg(struct iter_nat64* nat64, struct config_file* cfg);
+
+ /**
+ * Limit NSEC and NSEC3 TTL in response, RFC9077
+ * @param msg: dns message, the SOA record ttl is used to restrict ttls
+ * of NSEC and NSEC3 RRsets. If no SOA record, nothing happens.
+ */
+ void limit_nsec_ttl(struct dns_msg* msg);
+
+ /**
+ * Make the response minimal. Removed authority and additional section,
+ * that works when there is an answer in the answer section.
+ * @param rep: reply to modify.
+ */
+ void iter_make_minimal(struct reply_info* rep);
+
#endif /* ITERATOR_ITER_UTILS_H */
}
#endif
+void fast_reload_service_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
+ void* ATTR_UNUSED(arg))
+{
+ log_assert(0);
+}
+
+int fast_reload_client_callback(struct comm_point* ATTR_UNUSED(c),
+ void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
+ struct comm_reply* ATTR_UNUSED(repinfo))
+{
+ log_assert(0);
+ return 0;
+}
++
+ #ifdef HAVE_NGTCP2
+ void doq_client_event_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
+ void* ATTR_UNUSED(arg))
+ {
+ log_assert(0);
+ }
+ #endif
+
+ #ifdef HAVE_NGTCP2
+ void doq_client_timer_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
+ void* ATTR_UNUSED(arg))
+ {
+ log_assert(0);
+ }
+ #endif
void infra_wait_limit_dec(struct infra_cache* infra, struct comm_reply* rep,
struct config_file* cfg);
+/** setup wait limits tree (0 on failure) */
+int setup_wait_limits(struct rbtree_type* wait_limits_netblock,
+ struct rbtree_type* wait_limits_cookie_netblock,
+ struct config_file* cfg);
+
+/** Free the wait limits and wait cookie limits tree. */
+void wait_limits_free(struct rbtree_type* wait_limits_tree);
+
+/** setup domain limits tree (0 on failure) */
+int setup_domain_limits(struct rbtree_type* domain_limits,
+ struct config_file* cfg);
+
+/** Free the domain limits tree. */
+void domain_limits_free(struct rbtree_type* domain_limits);
+
+ /** exported for unit test */
+ int still_useful_timeout();
+
#endif /* SERVICES_CACHE_INFRA_H */
}
#endif
+void fast_reload_service_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
+ void* ATTR_UNUSED(arg))
+{
+ log_assert(0);
+}
+
+int fast_reload_client_callback(struct comm_point* ATTR_UNUSED(c),
+ void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
+ struct comm_reply* ATTR_UNUSED(repinfo))
+{
+ log_assert(0);
+ return 0;
+}
++
+ #ifdef HAVE_NGTCP2
+ void doq_client_event_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
+ void* ATTR_UNUSED(arg))
+ {
+ log_assert(0);
+ }
+ #endif
+
+ #ifdef HAVE_NGTCP2
+ void doq_client_timer_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),
+ void* ATTR_UNUSED(arg))
+ {
+ log_assert(0);
+ }
+ #endif
{
char buf[24];
time_t t;
- snprintf(buf, sizeof(buf), "ublocktrace.%d", thr->num);
+ snprintf(buf, sizeof(buf), "%s.%d", output_name, thr->num);
- thr->order_info = fopen(buf, "w");
- if(!thr->order_info)
- fatal_exit("could not open %s: %s", buf, strerror(errno));
- thr->locks_created = 0;
+ thr->locks_created = thread_lockcount[thr->num];
+ if(thr->locks_created == 0) {
+ thr->order_info = fopen(buf, "w");
+ if(!thr->order_info)
+ fatal_exit("could not open %s: %s", buf, strerror(errno));
+ } else {
+ /* There is already a file to append on with the previous
+ * thread information. */
+ thr->order_info = fopen(buf, "a");
+ if(!thr->order_info)
+ fatal_exit("could not open for append %s: %s", buf, strerror(errno));
+ return;
+ }
+
t = time(NULL);
/* write: <time_stamp> <runpid> <thread_num> */
if(fwrite(&t, sizeof(t), 1, thr->order_info) != 1 ||
/* nothing */
}
+void fast_reload_printq_list_delete(
+ struct fast_reload_printq* ATTR_UNUSED(list))
+{
+ /* nothing */
+}
+
+void fast_reload_worker_pickup_changes(struct worker* ATTR_UNUSED(worker))
+{
+ /* nothing */
+}
++
+ #ifdef HAVE_NGTCP2
+ void* quic_sslctx_create(char* ATTR_UNUSED(key), char* ATTR_UNUSED(pem),
+ char* ATTR_UNUSED(verifypem))
+ {
+ return NULL;
+ }
+
+ void comm_point_doq_callback(int ATTR_UNUSED(fd), short ATTR_UNUSED(event),
+ void* ATTR_UNUSED(arg))
+ {
+ /* nothing */
+ }
+
+ int doq_conn_cmp(const void* ATTR_UNUSED(key1), const void* ATTR_UNUSED(key2))
+ {
+ return 0;
+ }
+
+ int doq_conid_cmp(const void* ATTR_UNUSED(key1), const void* ATTR_UNUSED(key2))
+ {
+ return 0;
+ }
+
+ int doq_timer_cmp(const void* ATTR_UNUSED(key1), const void* ATTR_UNUSED(key2))
+ {
+ return 0;
+ }
+
+ int doq_stream_cmp(const void* ATTR_UNUSED(key1), const void* ATTR_UNUSED(key2))
+ {
+ return 0;
+ }
+
+ struct doq_table* doq_table_create(struct config_file* ATTR_UNUSED(cfg),
+ struct ub_randstate* ATTR_UNUSED(rnd))
+ {
+ return calloc(1, sizeof(struct doq_table));
+ }
+
+ void doq_table_delete(struct doq_table* table)
+ {
+ free(table);
+ }
+
+ void doq_timer_cb(void* ATTR_UNUSED(arg))
+ {
+ /* nothing */
+ }
+
+ size_t doq_table_quic_size_get(struct doq_table* ATTR_UNUSED(table))
+ {
+ return 0;
+ }
+ #endif
#endif
}
+size_t
+getmem_str(char* str)
+{
+ if(!str) return 0;
+ return strlen(str)+1;
+}
++
+ int
+ if_is_quic(const char* ifname, int default_port, int quic_port)
+ {
+ #ifdef HAVE_NGTCP2
+ return if_listens_on(ifname, default_port, quic_port, NULL);
+ #else
+ (void)ifname;
+ (void)default_port;
+ (void)quic_port;
+ return 0;
+ #endif
+ }
+
+ int
+ cfg_has_https(struct config_file* cfg)
+ {
+ int i;
+ for(i = 0; i<cfg->num_ifs; i++) {
+ if(if_is_https(cfg->ifs[i], cfg->port, cfg->https_port))
+ return 1;
+ }
+ return 0;
+ }
+
+ int
+ cfg_has_quic(struct config_file* cfg)
+ {
+ #ifdef HAVE_NGTCP2
+ int i;
+ for(i = 0; i<cfg->num_ifs; i++) {
+ if(if_is_quic(cfg->ifs[i], cfg->port, cfg->quic_port))
+ return 1;
+ }
+ return 0;
+ #else
+ (void)cfg;
+ return 0;
+ #endif
+ }
else if(fptr == &tube_handle_signal) return 1;
else if(fptr == &comm_base_handle_slow_accept) return 1;
else if(fptr == &comm_point_http_handle_callback) return 1;
+ #ifdef HAVE_NGTCP2
+ else if(fptr == &comm_point_doq_callback) return 1;
+ #endif
+ else if(fptr == &fast_reload_service_cb) return 1;
#ifdef USE_DNSTAP
else if(fptr == &dtio_output_cb) return 1;
else if(fptr == &dtio_cmd_cb) return 1;
{
char* e;
int i;
- *keysize = (size_t*)calloc(sizeof(size_t), (size_t)c);
- *maxiter = (size_t*)calloc(sizeof(size_t), (size_t)c);
- free(ve->nsec3_keysize);
- free(ve->nsec3_maxiter);
- ve->nsec3_keysize = (size_t*)calloc((size_t)c, sizeof(size_t));
- ve->nsec3_maxiter = (size_t*)calloc((size_t)c, sizeof(size_t));
- if(!ve->nsec3_keysize || !ve->nsec3_maxiter) {
++ *keysize = (size_t*)calloc((size_t)c, sizeof(size_t));
++ *maxiter = (size_t*)calloc((size_t)c, sizeof(size_t));
+ if(!*keysize || !*maxiter) {
+ free(*keysize);
+ *keysize = NULL;
+ free(*maxiter);
+ *maxiter = NULL;
log_err("out of memory");
return 0;
}