int check_locking_order = 1;
/** the pid of this runset, reasonably unique. */
static pid_t check_lock_pid;
+/** the name of the output file */
+static const char* output_name = "ublocktrace";
+ /**
+ * Should checklocks print a trace of the lock and unlock calls.
+ * It uses fprintf for that because the log function uses a lock and that
+ * would loop otherwise.
+ */
+ static int verbose_locking = 0;
+ /**
+ * Assume lock 0 0 (create_thread, create_instance), is the log lock and
+ * do not print for that. Otherwise the output is full of log lock accesses.
+ */
+ static int verbose_locking_not_loglock = 1;
/** print all possible debug info on the state of the system */
static void total_debug_info(void);
void http2_stream_add_meshstate(struct http2_stream* h2_stream,
struct mesh_area* mesh, struct mesh_state* m);
+ /** Remove mesh state from stream. When the mesh state has been removed. */
+ void http2_stream_remove_mesh_state(struct http2_stream* h2_stream);
+
+/**
+ * DoQ socket address storage for IP4 or IP6 address. Smaller than
+ * the sockaddr_storage because not with af_unix pathnames.
+ */
+struct doq_addr_storage {
+ union {
+ struct sockaddr_in in;
+#ifdef AF_INET6
+ struct sockaddr_in6 in6;
+#endif
+ } sockaddr;
+};
+
+/**
+ * The DoQ server socket information, for DNS over QUIC.
+ */
+struct doq_server_socket {
+ /** the doq connection table */
+ struct doq_table* table;
+ /** random generator */
+ struct ub_randstate* rnd;
+ /** if address validation is enabled */
+ uint8_t validate_addr;
+ /** the ssl service key file */
+ char* ssl_service_key;
+ /** the ssl service pem file */
+ char* ssl_service_pem;
+ /** the ssl verify pem file */
+ char* ssl_verify_pem;
+ /** the server scid length */
+ int sv_scidlen;
+ /** the idle timeout in nanoseconds */
+ uint64_t idle_timeout;
+ /** the static secret for the server */
+ uint8_t* static_secret;
+ /** length of the static secret */
+ size_t static_secret_len;
+ /** ssl context, SSL_CTX* */
+ void* ctx;
+#ifndef HAVE_NGTCP2_CRYPTO_QUICTLS_CONFIGURE_SERVER_CONTEXT
+ /** quic method functions, SSL_QUIC_METHOD* */
+ void* quic_method;
+#endif
+ /** the comm point for this doq server socket */
+ struct comm_point* cp;
+ /** the buffer for packets, doq in and out */
+ struct sldns_buffer* pkt_buf;
+ /** the current doq connection when we are in callbacks to worker,
+ * so that we have the already locked structure at our disposal. */
+ struct doq_conn* current_conn;
+ /** if the callback event on the fd has write flags */
+ uint8_t event_has_write;
+ /** if there is a blocked packet in the blocked_pkt buffer */
+ int have_blocked_pkt;
+ /** store blocked packet, a packet that could not be send on the
+ * nonblocking socket. It has to be sent later, when the write on
+ * the udp socket unblocks. */
+ struct sldns_buffer* blocked_pkt;
+#ifdef HAVE_NGTCP2
+ /** the ecn info for the blocked packet, congestion information. */
+ struct ngtcp2_pkt_info blocked_pkt_pi;
+#endif
+ /** the packet destination for the blocked packet. */
+ struct doq_pkt_addr* blocked_paddr;
+ /** timer for this worker on this comm_point to wait on. */
+ struct comm_timer* timer;
+ /** the timer that is marked by the doq_socket as waited on. */
+ struct timeval marked_time;
+ /** the current time for use by time functions, time_t. */
+ time_t* now_tt;
+ /** the current time for use by time functions, timeval. */
+ struct timeval* now_tv;
+ /** config file for the worker. */
+ struct config_file* cfg;
+};
+
+/**
+ * DoQ packet address information. From pktinfo, stores local and remote
+ * address and ifindex, so the packet can be sent there.
+ */
+struct doq_pkt_addr {
+ /** the remote addr, and local addr */
+ struct doq_addr_storage addr, localaddr;
+ /** length of addr and length of localaddr */
+ socklen_t addrlen, localaddrlen;
+ /** interface index from pktinfo ancillary information */
+ int ifindex;
+};
+
+/** Initialize the pkt addr with lengths set to sizeof. That is ready for
+ * a call to recv. */
+void doq_pkt_addr_init(struct doq_pkt_addr* paddr);
+
+/** send doq packet over UDP. */
+void doq_send_pkt(struct comm_point* c, struct doq_pkt_addr* paddr,
+ uint32_t ecn);
+
+/** doq timer callback function. */
+void doq_timer_cb(void* arg);
+
/**
* This routine is published for checks and tests, and is only used internally.
* handle libevent callback for timer comm.