unbound 0.1
outside_network Struct Reference

Send queries to outside servers and wait for answers from servers. More...

#include <outside_network.h>

Data Fields

struct comm_base * base
 Base for select calls.
time_t * now_secs
 pointer to time in seconds
struct timeval * now_tv
 pointer to time in microseconds
struct sldns_buffer * udp_buff
 buffer shared by UDP connections, since there is only one datagram at any time.
size_t svcd_overhead
 serviced_callbacks malloc overhead when processing multiple identical serviced queries to the same server.
int use_caps_for_id
 use x20 bits to encode additional ID random bits
int want_to_quit
 outside network wants to quit.
size_t unwanted_replies
 number of unwanted replies received (for statistics)
size_t unwanted_total
 cumulative total of unwanted replies (for defense)
size_t unwanted_threshold
 threshold when to take defensive action.
void(*) unwanted_action (void *)
 what action to take, called when defensive action is needed
void * unwanted_param
 user param for action
struct port_comm * unused_fds
 linked list of available commpoints, unused file descriptors, for use as outgoing UDP ports.
int do_udp
 if udp is done
int delayclose
 if udp is delay-closed (delayed answers do not meet closed port)
struct timeval delay_tv
 timeout for delayclose
int udp_connect
 if we perform udp-connect, connect() for UDP socket to mitigate ICMP side channel leakage
size_t num_udp_outgoing
 number of udp packets sent.
struct shared_ports * shared_ports
 the shared ports structure, with random ports numbers.
struct port_if * ip4_ifs
 array of outgoing IP4 interfaces
int num_ip4
 number of outgoing IP4 interfaces
struct port_if * ip6_ifs
 array of outgoing IP6 interfaces
int num_ip6
 number of outgoing IP6 interfaces
struct pending * udp_wait_first
 pending udp queries waiting to be sent out, waiting for fd
struct pending * udp_wait_last
 last pending udp query in list
rbtree_type * pending
 pending udp answers.
rbtree_type * serviced
 serviced queries, sorted by qbuf, addr, dnssec
struct infra_cache * infra
 host cache, pointer but not owned by outnet.
struct ub_randstate * rnd
 where to get random numbers
void * sslctx
 ssl context to create ssl wrapped TCP with DNS connections
int tls_use_sni
 if SNI will be used for TLS connections
int tcp_mss
 maximum segment size of tcp socket
int ip_dscp
 IP_TOS socket option requested on the sockets.
struct pending_tcp ** tcp_conns
 Array of tcp pending used for outgoing TCP connections.
size_t num_tcp
 number of tcp communication points.
size_t num_tcp_outgoing
 number of tcp communication points in use.
size_t max_reuse_tcp_queries
 max number of queries on a reuse connection
int tcp_reuse_timeout
 timeout for REUSE entries in milliseconds.
int tcp_auth_query_timeout
 timeout in milliseconds for TCP queries to auth servers.
rbtree_type tcp_reuse
 tree of still-open and waiting tcp connections for reuse.
size_t tcp_reuse_max
 max number of tcp_reuse entries we want to keep open
struct reuse_tcp * tcp_reuse_first
 first and last(oldest) in lru list of reuse connections.
struct reuse_tcp * tcp_reuse_last
struct pending_tcp * tcp_free
 list of tcp comm points that are free for use
struct waiting_tcp * tcp_wait_first
 list of tcp queries waiting for a buffer
struct waiting_tcp * tcp_wait_last
 last of waiting query list

Detailed Description

Send queries to outside servers and wait for answers from servers.

Contains answer-listen sockets.

Field Documentation

◆ base

◆ now_secs

time_t* outside_network::now_secs

◆ now_tv

struct timeval* outside_network::now_tv

◆ udp_buff

◆ svcd_overhead

size_t outside_network::svcd_overhead

serviced_callbacks malloc overhead when processing multiple identical serviced queries to the same server.

Referenced by outnet_get_mem(), outside_network_create(), and serviced_callbacks().

◆ use_caps_for_id

int outside_network::use_caps_for_id

use x20 bits to encode additional ID random bits

Referenced by fr_worker_pickup_outside_network(), outside_network_create(), serviced_callbacks(), and serviced_encode().

◆ want_to_quit

◆ unwanted_replies

size_t outside_network::unwanted_replies

number of unwanted replies received (for statistics)

Referenced by outnet_udp_cb(), server_stats_compile(), and worker_stats_clear().

◆ unwanted_total

size_t outside_network::unwanted_total

cumulative total of unwanted replies (for defense)

Referenced by outnet_udp_cb().

◆ unwanted_threshold

size_t outside_network::unwanted_threshold

threshold when to take defensive action.

If 0 then never.

Referenced by fr_worker_pickup_outside_network(), outnet_udp_cb(), and outside_network_create().

◆ unwanted_action

void(*) outside_network::unwanted_action(void *)

what action to take, called when defensive action is needed

Referenced by outnet_udp_cb(), and outside_network_create().

◆ unwanted_param

void* outside_network::unwanted_param

user param for action

Referenced by outnet_udp_cb(), and outside_network_create().

◆ unused_fds

struct port_comm* outside_network::unused_fds

linked list of available commpoints, unused file descriptors, for use as outgoing UDP ports.

cp.fd=-1 in them.

Referenced by outnet_get_mem(), outnet_send_wait_udp(), outside_network_create(), outside_network_delete(), pending_udp_query(), portcomm_loweruse(), and select_ifport().

◆ do_udp

int outside_network::do_udp

if udp is done

Referenced by outside_network_create(), and serviced_timer_cb().

◆ delayclose

int outside_network::delayclose

if udp is delay-closed (delayed answers do not meet closed port)

Referenced by fr_worker_pickup_outside_network(), outside_network_create(), and pending_udp_timer_cb().

◆ delay_tv

struct timeval outside_network::delay_tv

◆ udp_connect

int outside_network::udp_connect

if we perform udp-connect, connect() for UDP socket to mitigate ICMP side channel leakage

Referenced by outside_network_create(), randomize_and_send_udp(), and select_ifport().

◆ num_udp_outgoing

size_t outside_network::num_udp_outgoing

◆ shared_ports

struct shared_ports* outside_network::shared_ports

the shared ports structure, with random ports numbers.

This is a reference to the member in the daemon structure.

Referenced by fd_for_dest(), outside_network_create(), portcomm_loweruse(), and select_ifport().

◆ ip4_ifs

struct port_if* outside_network::ip4_ifs

◆ num_ip4

◆ ip6_ifs

struct port_if* outside_network::ip6_ifs

◆ num_ip6

◆ udp_wait_first

struct pending* outside_network::udp_wait_first

pending udp queries waiting to be sent out, waiting for fd

Referenced by outnet_get_mem(), outnet_send_wait_udp(), outside_network_delete(), pending_delete(), pending_udp_query(), and pending_udp_timer_cb().

◆ udp_wait_last

struct pending* outside_network::udp_wait_last

last pending udp query in list

Referenced by outnet_send_wait_udp(), pending_delete(), and pending_udp_query().

◆ pending

◆ serviced

◆ infra

struct infra_cache* outside_network::infra

host cache, pointer but not owned by outnet.

Referenced by outside_network_create(), serviced_tcp_callback(), serviced_tcp_send(), serviced_udp_callback(), and serviced_udp_send().

◆ rnd

struct ub_randstate* outside_network::rnd

◆ sslctx

void* outside_network::sslctx

ssl context to create ssl wrapped TCP with DNS connections

Referenced by fr_worker_pickup_outside_network(), outnet_tcp_take_into_use(), outside_network_create(), and setup_comm_ssl().

◆ tls_use_sni

int outside_network::tls_use_sni

if SNI will be used for TLS connections

Referenced by fr_worker_pickup_outside_network(), outnet_tcp_take_into_use(), outside_network_create(), and setup_comm_ssl().

◆ tcp_mss

int outside_network::tcp_mss

◆ ip_dscp

◆ tcp_conns

struct pending_tcp** outside_network::tcp_conns

Array of tcp pending used for outgoing TCP connections.

Each can be used to establish a TCP connection with a server. The file descriptors are -1 if they are free, and need to be opened for the tcp connection. Can be used for ip4 and ip6.

Referenced by check_removal(), check_snip(), create_pending_tcp(), create_pending_tcp(), outnet_get_mem(), outside_network_delete(), and tcp_reuse_tree_list_test().

◆ num_tcp

size_t outside_network::num_tcp

◆ num_tcp_outgoing

size_t outside_network::num_tcp_outgoing

number of tcp communication points in use.

Referenced by outnet_tcp_take_into_use(), outside_network_create(), server_stats_compile(), and worker_stats_clear().

◆ max_reuse_tcp_queries

size_t outside_network::max_reuse_tcp_queries

max number of queries on a reuse connection

Referenced by fr_worker_pickup_outside_network(), outside_network_create(), and reuse_tcp_find().

◆ tcp_reuse_timeout

int outside_network::tcp_reuse_timeout

timeout for REUSE entries in milliseconds.

Referenced by fr_worker_pickup_outside_network(), outnet_tcp_cb(), outside_network_create(), and reuse_tcp_remove_serviced_keep().

◆ tcp_auth_query_timeout

int outside_network::tcp_auth_query_timeout

timeout in milliseconds for TCP queries to auth servers.

Referenced by fr_worker_pickup_outside_network(), outside_network_create(), serviced_tcp_initiate(), and serviced_tcp_send().

◆ tcp_reuse

rbtree_type outside_network::tcp_reuse

tree of still-open and waiting tcp connections for reuse.

can be closed and reopened to get a new tcp connection. or reused to the same destination again. with timeout to close. Entries are of type struct reuse_tcp. The entries are both active and empty connections.

Referenced by check_snip(), check_tree_and_list(), empty_tree(), outnet_tcp_cb(), outside_network_create(), outside_network_delete(), reuse_tcp_find(), reuse_tcp_insert(), reuse_tcp_remove_serviced_keep(), reuse_tcp_remove_tree_list(), and tcp_reuse_tree_list_test().

◆ tcp_reuse_max

size_t outside_network::tcp_reuse_max

max number of tcp_reuse entries we want to keep open

Referenced by outnet_tcp_cb(), outside_network_create(), reuse_tcp_remove_serviced_keep(), and tcp_reuse_tree_list_test().

◆ tcp_reuse_first

struct reuse_tcp* outside_network::tcp_reuse_first

first and last(oldest) in lru list of reuse connections.

the oldest can be closed to get a new free pending_tcp if needed The list contains empty connections, that wait for timeout or a new query that can use the existing connection.

Referenced by check_removal(), check_snip(), check_tree_and_list(), empty_tree(), outnet_waiting_tcp_list_add_first(), outside_network_delete(), reuse_tcp_insert(), reuse_tcp_lru_snip(), reuse_tcp_lru_touch(), reuse_tcp_remove_tree_list(), tcp_reuse_tree_list_test(), and use_free_buffer().

◆ tcp_free

struct pending_tcp* outside_network::tcp_free

◆ tcp_wait_first

◆ tcp_wait_last


The documentation for this struct was generated from the following file: