31 #ifdef HAVE_SYS_STAT_H 32 # include <sys/stat.h> 289 #define DNS_MAX_RESULTS 50 370 char *
s2s_db_key(
pool_t p,
const char *secret,
const char *remote,
const char *
id);
374 int out_route(s2s_t s2s,
const char *route,
int routelen, conn_t *out,
int allow_bad);
375 int dns_select(s2s_t s2s,
char* ip,
int* port, time_t now, dnscache_t dns,
int allow_bad);
377 void out_resolve(s2s_t s2s,
const char *domain,
xht results, time_t expiry);
388 #define S2S_DB_HEADER (1<<10) 391 #define MAX_DOMAIN_LEN 1023 #define INET6_ADDRSTRLEN
maximum length of the string representation of an IPv6 address
int retry_init
connect retry
time_t last_invalid_check
unsigned int packet_count
sx_t router
router's conn
void out_dialback(s2s_t s2s, pkt_t pkt)
const char * local_ip
ip/port to listen on
time_t expiry
time that this entry expires
xht hosts
srv lookup results (key host/port)
int s2s_db_init(sx_env_t env, sx_plugin_t p, va_list args)
int started
this is true if we've connected to the router at least once
jqueue_t dead
list of sx_t on the way out
struct dnsres_st * dnsres_t
char ** whitelist_domains
const char * host_ciphers
list of TLS ciphers
const char * router_ip
how to connect to the router
xht in_accept
incoming conns prior to stream initiation (key is ip/port)
const char ** lookup_srv
srvs to lookup
int verify
number and last timestamp of outstanding db:verify requests
time_t expiry
time that all entries expire
char * host_private_key_password
private key password
void out_pkt_free(pkt_t pkt)
holder for the config hash and nad
int in_mio_callback(mio_t m, mio_action_t a, mio_fd_t fd, void *data, void *arg)
int srv_i
srv lookup index
xht states
states of outgoing dialbacks (key is local/remote)
mio_action_t
these are the actions and a handler type assigned by the applicaiton using mio
void out_flush_route_queue(s2s_t s2s, const char *rkey, int rkeylen)
int host_verify_mode
verify-mode
xht outq
queues of packets waiting to go out (key is route)
const char * packet_stats
time_t expiry
time that this entry expires
xht out_host
outgoing conns (key is ip/port)
long long int packet_count
packet counter
xht dnscache
dns resolution cache
int cur_port
current host lookup port
xht out_dest
outgoing conns (key is dest)
xht routes
routes that this conn handles (key is local/remote)
xht dns_bad
dns resolution bad host cache
char * s2s_route_key(pool_t p, const char *local, const char *remote)
generate a local/remote route key
sx_env_t sx_env
sx environment
int compression
enable Stream Compression
int etc_hosts_ttl
/etc/hosts ttl limits
int pending
set when we're waiting for a resolve response
int stanza_size_limit
maximum stanza size
holds the state for a single stream
int local_verify_mode
verify-mode
int online
true if we're bound in the router
const char * local_cachain
certificate chain
int out_bounce_domain_queues(s2s_t s2s, const char *domain, int err)
char * s2s_db_key(pool_t p, const char *secret, const char *remote, const char *id)
generate a dialback key
packet summary data wrapper
const char * log_facility
void out_flush_domain_queues(s2s_t s2s, const char *domain)
xht results
results (key ip/port)
const char * realm
our realm (SASL)
jqueue_t dead_conn
list of conn_t on the way out
int out_route(s2s_t s2s, const char *route, int routelen, conn_t *out, int allow_bad)
find/make a connection for a route
xht states_time
time of the last state change (key is local/remote)
time_t cur_expiry
current host max expiry
xht results
host lookup results (key ip/port)
const char * local_secret
dialback secret
const char * host_pemfile
starttls pemfile
const char * name
domain name
int out_reuse
reuse outgoing conns keyed by ip/port
const char * router_pemfile
const char * local_ciphers
list of TLS ciphers
int check_interval
time checks
mio_fd_t server_fd
listening sockets
sig_atomic_t s2s_lost_router
int cur_prio
current host priority
int io_max_fds
max file descriptors
int resolve_aaaa
if we resolve AAAA records
int s2s_route_key_match(char *local, const char *remote, const char *rkey, int rkeylen)
match route key - used for searching route hash
const char ** origin_ips
ip(s) to originate connections from
char * dns_make_ipport(const char *host, int port)
int s2s_domain_in_whitelist(s2s_t s2s, const char *in_domain)
struct dns_query * query
set when we're waiting for a resolve response
const char * router_ciphers
int s2s_router_sx_callback(sx_t s, sx_event_t e, void *data, void *arg)
our master callback
void dns_resolve_domain(s2s_t s2s, dnscache_t dns)
const char * router_private_key_password
const char * id
our id (hostname) with the router
log_type_t log_type
log data
const char * router_cachain
xht in
incoming conns (key is stream id)
void out_resolve(s2s_t s2s, const char *domain, xht results, time_t expiry)
responses from the resolver
const char * local_private_key_password
private key password for local pemfile, if encrypted
int require_tls
Apple security options.
one item in the dns resolution cache
sx_event_t
things that can happen
const char * cur_host
current host lookup name
pool - base node for a pool.
int cur_weight
current host weight
int dns_select(s2s_t s2s, char *ip, int *port, time_t now, dnscache_t dns, int allow_bad)
int out_bounce_route_queue(s2s_t s2s, const char *rkey, int rkeylen, int err)
int out_bounce_conn_queues(conn_t out, int err)
int out_packet(s2s_t s2s, pkt_t pkt)
send a packet out
const char * local_pemfile
pemfile for peer connections
struct dnscache_st * dnscache_t
struct dnsquery_st * dnsquery_t
int s2s_router_mio_callback(mio_t m, mio_action_t a, mio_fd_t fd, void *data, void *arg)
time_t last_activity
timestamps for idle timeouts
int dns_min_ttl
dns ttl limits
const char * host_cachain
certificate chain