108 static void _dns_result_aaaa(
struct dns_ctx *ctx,
struct dns_rr_a6 *result,
void *data);
109 static void _dns_result_a(
struct dns_ctx *ctx,
struct dns_rr_a4 *result,
void *data);
117 log_debug(
ZONE,
"creating new out packet queue for '%s'", rkey);
131 char *c, *dbkey, *tmp;
134 int from_len, to_len;
139 c = memchr(rkey,
'/', rkeylen);
142 to_len = rkeylen - (c - rkey);
145 tmp = strndup(c, to_len);
158 log_debug(
ZONE,
"sending auth request for %.*s (key %s)", rkeylen, rkey, dbkey);
159 log_write(out->
s2s->
log, LOG_NOTICE,
"[%d] [%s, port=%d] sending dialback auth request for route '%.*s'", out->
fd->
fd, out->
ip, out->
port, rkeylen, rkey);
202 int s_reuse = 0, s_aaaa = 0, s_a = 0, s_bad = 0;
203 int p_reuse = 0, p_aaaa = 0, p_a = 0;
204 int wt_reuse = 0, wt_aaaa = 0, wt_a = 0;
205 int c_expired_good = 0;
238 if (now > res->expiry) {
245 }
else if (bad != NULL && !(now > bad->
expiry)) {
247 l_bad[s_bad++] = res;
253 if (s_reuse == 0 || p_reuse > res->prio) {
258 log_debug(
ZONE,
"reset prio list, using prio %d", res->prio);
260 if (res->prio <= p_reuse) {
261 l_reuse[s_reuse] = res;
263 rw_reuse[s_reuse] = wt_reuse;
266 log_debug(
ZONE,
"added host with weight %d (%d), running weight %d",
267 (res->weight >> 8), res->weight, wt_reuse);
271 }
else if (memchr(ipport,
':', ipport_len) != NULL) {
274 if (s_aaaa == 0 || p_aaaa > res->prio) {
279 log_debug(
ZONE,
"reset prio list, using prio %d", res->prio);
281 if (res->prio <= p_aaaa) {
282 l_aaaa[s_aaaa] = res;
284 rw_aaaa[s_aaaa] = wt_aaaa;
287 log_debug(
ZONE,
"added host with weight %d (%d), running weight %d",
288 (res->weight >> 8), res->weight, wt_aaaa);
295 if (s_a == 0 || p_a > res->prio) {
300 log_debug(
ZONE,
"reset prio list, using prio %d", res->prio);
302 if (res->prio <= p_a) {
308 log_debug(
ZONE,
"added host with weight %d (%d), running weight %d",
309 (res->weight >> 8), res->weight, wt_a);
325 log_debug(
ZONE,
"using existing hosts, total weight %d", wt_reuse);
326 assert((wt_reuse + 1) > 0);
328 r = rand() % (wt_reuse + 1);
331 for (i = 0; i < s_reuse; i++)
332 if (rw_reuse[i] >= r) {
334 l_reuse[i]->key, rw_reuse[i]);
336 ipport = l_reuse[i]->
key;
339 }
else if (s_aaaa > 0 && (s_a == 0 || p_aaaa <= p_a)) {
342 log_debug(
ZONE,
"using IPv6 hosts, total weight %d", wt_aaaa);
343 assert((wt_aaaa + 1) > 0);
345 r = rand() % (wt_aaaa + 1);
348 for (i = 0; i < s_aaaa; i++)
349 if (rw_aaaa[i] >= r) {
351 l_aaaa[i]->key, rw_aaaa[i]);
353 ipport = l_aaaa[i]->
key;
356 }
else if (s_a > 0) {
360 assert((wt_a + 1) > 0);
362 r = rand() % (wt_a + 1);
365 for (i = 0; i < s_a; i++)
368 l_a[i]->key, rw_a[i]);
370 ipport = l_a[i]->
key;
373 }
else if (s_bad > 0) {
374 ipport = l_bad[rand() % s_bad]->
key;
379 if (c_expired_good > 0) {
380 log_debug(
ZONE,
"expiring this DNS cache entry, %d expired hosts",
391 assert(ipport != NULL);
394 ipport_len = strlen(ipport);
395 c = strchr(ipport,
'/');
396 strncpy(ip, ipport, c-ipport);
399 c_len = ipport_len - (c - ipport);
400 tmp = strndup(c, c_len);
414 int port, c_len, from_len;
416 c = memchr(route,
'/', routelen);
417 from_len = c - route;
419 c_len = routelen - (c - route);
424 dkey = strndup(c, c_len);
435 log_debug(
ZONE,
"no dns for %s, preparing for resolution", dkey);
439 strcpy(dns->
name, dkey);
446 strcpy(dns->ip,
"127.0.0.1");
448 dns->
expiry = time(NULL) + 99999999;
474 if (
dns_select(s2s, ip, &port, now, dns, allow_bad)) {
502 log_write(s2s->
log, LOG_NOTICE,
"[%d] [%s, port=%d] using connection for '%s'", (*out)->fd->fd, (*out)->ip, (*out)->port, dkey);
514 (*out)->key = strdup(ipport);
520 strcpy((*out)->ip, ip);
528 (*out)->init_time = time(NULL);
541 if (strchr(ip,
':') != NULL)
546 if ((ip_is_v6 && (strchr(s2s->
origin_ips[i],
':') != NULL)) ||
547 (! ip_is_v6 && (strchr(s2s->
origin_ips[i],
':') == NULL))) {
550 if ((*out)->fd != NULL)
break;
556 if ((*out)->fd == NULL) {
558 if ((*out)->fd == NULL) {
563 if ((*out)->fd == NULL) {
564 log_write(s2s->
log, LOG_NOTICE,
"[%d] [%s, port=%d] unable to connect host", -1, (*out)->ip, (*out)->port);
577 free((
void*)(*out)->key);
578 free((
void*)(*out)->dkey);
583 return out_route(s2s, route, routelen, out, 0);
585 log_write(s2s->
log, LOG_NOTICE,
"[%d] [%s, port=%d] outgoing connection for '%s'", (*out)->fd->fd, (*out)->ip, (*out)->port, dkey);
604 log_debug(
ZONE,
"connection for '%s' found (%d %s/%d)", dkey, (*out)->fd->fd, (*out)->ip, (*out)->port);
608 if (!(*out)->online || reuse) {
609 if (
xhash_getx((*out)->routes, route, routelen) == NULL)
637 log_write(s2s->
log, LOG_NOTICE,
"sending a packet to domain not in the whitelist, dropping it");
648 rkeylen = strlen(rkey);
651 ret =
out_route(s2s, rkey, rkeylen, &out, 1);
742 assert(port > 0 && port < 65536);
744 c = (
char *) malloc(strlen(host) + 7);
745 sprintf(c,
"%s/%d", host, port);
754 if (prio < res->prio)
757 if (prio < res->prio) {
760 }
else if (prio == res->
prio) {
763 if (res->
weight > (65535 << 8))
764 res->
weight = (65535 << 8);
773 log_debug(
ZONE,
"dns result updated for %s@%p: %s (%d/%d/%d)", query->
name, query, ipport,
787 log_debug(
ZONE,
"dns result added for %s@%p: %s (%d/%d/%d)", query->
name, query, ipport,
790 log_debug(
ZONE,
"dns result ignored for %s@%p: %s (%d/%d/%d)", query->
name, query, ipport,
791 prio, (weight >> 8), ttl);
814 if (prio < res->prio)
817 if (prio < res->prio) {
820 }
else if (prio == res->
prio) {
823 if (res->
weight > (65535 << 8))
824 res->
weight = (65535 << 8);
830 log_debug(
ZONE,
"dns host updated for %s@%p: %s (%d/%d/%d)", query->
name, query, ipport,
841 log_debug(
ZONE,
"dns host added for %s@%p: %s (%d/%d/%d)", query->
name, query, ipport,
844 log_debug(
ZONE,
"dns host ignored for %s@%p: %s (%d/%d/%d)", query->
name, query, ipport,
845 prio, (weight >> 8), ttl);
852 static void _dns_result_srv(
struct dns_ctx *ctx,
struct dns_rr_srv *result,
void *data) {
854 assert(query != NULL);
857 if (ctx != NULL && result == NULL) {
860 }
else if (result != NULL) {
864 result->dnssrv_qname, result->dnssrv_nrr, result->dnssrv_ttl);
866 for (i = 0; i < result->dnssrv_nrr; i++) {
867 if (strlen(result->dnssrv_srv[i].name) > 0
868 && result->dnssrv_srv[i].port > 0
869 && result->dnssrv_srv[i].port < 65536) {
871 query, result->dnssrv_qname, i,
872 result->dnssrv_srv[i].
name, result->dnssrv_srv[i].port,
873 result->dnssrv_srv[i].priority, result->dnssrv_srv[i].weight);
876 result->dnssrv_srv[i].port, result->dnssrv_srv[i].priority,
877 result->dnssrv_srv[i].weight, result->dnssrv_ttl);
894 if (query->
query == NULL)
911 query->
query = dns_submit_a6(NULL, query->
name,
915 if (query->
query == NULL)
920 query->
query = dns_submit_a4(NULL, query->
name,
924 if (query->
query == NULL)
935 assert(query != NULL);
938 if (ctx != NULL && result == NULL) {
941 }
else if (result != NULL) {
943 result->dnsa6_qname, result->dnsa6_nrr, result->dnsa6_ttl);
948 for (i = 0; i < result->dnsa6_nrr; i++) {
951 query, result->dnsa6_qname, i, ip, query->
cur_port);
967 if (query->
query == NULL)
971 log_debug(
ZONE,
"dns result for %s@%p: AAAA host vanished...", query->
name, query);
980 #define EHL_LINE_LEN 260 984 char *pcStart, *pcEnd;
992 if ((cszName == NULL) || (szIP == NULL) || (ciMaxIPLen <= 0))
998 pcStart = getenv(
"WINDIR");
999 if (pcStart != NULL) {
1000 sprintf(szLine,
"%s\\system32\\drivers\\etc\\hosts", pcStart);
1002 strcpy(szLine,
"C:\\WINDOWS\\system32\\drivers\\etc\\hosts");
1005 strcpy(szLine,
"/etc/hosts");
1007 fHosts = fopen(szLine,
"r");
1014 pcStart = strchr (szLine,
'#');
1015 if (pcStart != NULL)
1017 strcat(szLine,
" ");
1020 iLen = strspn(szLine,
"1234567890.");
1021 if ((iLen < 7) || (iLen > 15))
1023 pcEnd = szLine + iLen;
1028 pcStart = pcEnd + strspn(pcEnd,
" \t\n");
1029 while (*pcStart != 0) {
1030 pcEnd = pcStart + strcspn(pcStart,
" \t\n");
1034 if (strcasecmp(pcStart, cszName) == 0) {
1035 strncpy(szIP, szLine, ciMaxIPLen - 1);
1036 szIP[ciMaxIPLen - 1] =
'\0';
1041 pcStart = pcEnd + strspn(pcEnd,
" \t\n");
1055 static void _dns_result_a(
struct dns_ctx *ctx,
struct dns_rr_a4 *result,
void *data) {
1057 assert(query != NULL);
1058 query->
query = NULL;
1060 if (ctx != NULL && result == NULL) {
1061 #define DRA_IP_LEN 16 1073 }
else if (result != NULL) {
1074 char ip[INET_ADDRSTRLEN];
1078 query, result->dnsa4_qname, result->dnsa4_nrr, result->dnsa4_ttl);
1083 for (i = 0; i < result->dnsa4_nrr; i++) {
1084 if (inet_ntop(AF_INET, &result->dnsa4_addr[i], ip, INET_ADDRSTRLEN) != NULL) {
1086 query, result->dnsa4_qname, i, ip, query->
cur_port);
1098 char *ipport, *c, *tmp;
1099 int ipport_len, ip_len, port_len;
1111 c = memchr(ipport,
'/', ipport_len);
1112 ip_len = c - ipport;
1114 port_len = ipport_len - (c - ipport);
1118 query->
cur_host = strndup(ipport, ip_len);
1119 tmp = strndup(c, port_len);
1133 if (query->
query == NULL)
1141 if (query->
query == NULL)
1147 time_t now = time(NULL);
1186 query->
hosts = NULL;
1187 if (idna_to_unicode_8z8z(query->
name, &domain, 0) != IDNA_SUCCESS) {
1192 query->
expiry = time(NULL) + 99999999;
1193 domain = strdup(query->
name);
1197 free((
void*)query->
name);
1208 if (idna_to_ascii_8z(dns->
name, &name, 0) != IDNA_SUCCESS) {
1211 query->
expiry = time(NULL) + 99999999;
1223 query->
query = NULL;
1252 log_write(s2s->
log, LOG_NOTICE,
"dns lookup for %s failed", domain);
1261 log_write(s2s->
log, LOG_NOTICE,
"dns lookup for %s returned %d result%s (ttl %d)",
1270 if (idna_to_ascii_8z(domain, &punydomain, 0) == IDNA_SUCCESS) {
1277 log_write(s2s->
log, LOG_ERR,
"weird, never requested %s resolution", domain);
1311 ioctl(fd->
fd, FIONREAD, &nbytes);
1351 c = memchr(rkey,
'/', rkeylen);
1353 c_len = rkeylen - (c - rkey);
1357 log_debug(
ZONE,
"removing dest entry for '%.*s'", c_len, c);
1375 log_write(out->
s2s->
log, LOG_NOTICE,
"[%d] [%s, port=%d] retry limit reached for '%.*s' queue", fd->
fd, out->
ip, out->
port, rkeylen, rkey);
1382 log_debug(
ZONE,
"retrying connection for '%.*s' queue", rkeylen, rkey);
1386 if (retry != NULL) {
1425 free((
void*)bad->
key);
1444 int len, ns, elem, starttls = 0;
1524 (strstr(sxe->
specific,
"host-gone") ||
1525 strstr(sxe->
specific,
"host-unknown") ||
1526 strstr(sxe->
specific,
"not-authorized") ||
1527 strstr(sxe->
specific,
"see-other-host") ||
1528 strstr(sxe->
specific,
"system-shutdown") ||
1529 strstr(sxe->
specific,
"policy-violation") ||
1530 strstr(sxe->
specific,
"remote-connection-failed") ||
1531 strstr(sxe->
specific,
"unsupported-encoding") ||
1532 strstr(sxe->
specific,
"undefined-condition") ||
1533 strstr(sxe->
specific,
"internal-server-error") ||
1534 strstr(sxe->
specific,
"unsupported-version")
1558 log_debug(
ZONE,
"no stream version, sending dialbacks for %s immediately", out->
key);
1562 log_debug(
ZONE,
"outgoing conn to %s - waiting for STREAM features", out->
key);
1594 log_write(out->
s2s->
log, LOG_ERR,
"unable to establish encrypted session with peer");
1606 log_debug(
ZONE,
"No STARTTLS, dialbacks disabled for non-TLS connections, cannot complete negotiation");
1620 log_debug(
ZONE,
"got a non-dialback packet on an outgoing conn, dropping it");
1627 if(strncmp(
"result",
NAD_ENAME(nad, 0), 6) == 0) {
1632 if(strncmp(
"verify",
NAD_ENAME(nad, 0), 6) == 0) {
1644 if (out->
fd != NULL) {
1663 log_debug(
ZONE,
"missing or invalid from on db result packet");
1670 log_debug(
ZONE,
"missing or invalid to on db result packet");
1677 rkeylen = strlen(rkey);
1681 log_write(out->
s2s->
log, LOG_NOTICE,
"[%d] [%s, port=%d] outgoing route '%s' is now valid %s",
1702 log_write(out->
s2s->
log, LOG_NOTICE,
"[%d] [%s, port=%d] outgoing route '%s' is now invalid", out->
fd->
fd, out->
ip, out->
port, rkey);
1734 log_debug(
ZONE,
"missing or invalid from on db verify packet");
1741 log_debug(
ZONE,
"missing or invalid to on db verify packet");
1771 log_write(in->
s2s->
log, LOG_NOTICE,
"[%d] [%s, port=%d] incoming route '%s' is now valid %s",
1775 log_write(in->
s2s->
log, LOG_NOTICE,
"[%d] [%s, port=%d] incoming route '%s' is now invalid", in->
fd->
fd, in->
ip, in->
port, rkey);
1842 if(pkt->
nad->
ecur > 1 &&
NAD_NURI_L(pkt->
nad,
NAD_ENS(pkt->
nad, 1)) == strlen(
uri_CLIENT) && strncmp(
NAD_NURI(pkt->
nad,
NAD_ENS(pkt->
nad, 1)),
uri_CLIENT, strlen(
uri_CLIENT)) == 0 &&
nad_find_attr(pkt->
nad, 0, -1,
"error", NULL) < 0) {
1855 log_debug(
ZONE,
"deleting out packet queue for %.*s", rkeylen, rkey);
1890 c = memchr(rkey,
'/', rkeylen);
1892 c_len = rkeylen - (c - rkey);
1893 if (strncmp(domain, c, c_len) == 0)
1909 log_debug(
ZONE,
"flushing %d packets for '%.*s' to out_packet", npkt, rkeylen, rkey);
1911 for(i = 0; i < npkt; i++) {
1926 log_debug(
ZONE,
"deleting out packet queue for '%.*s'", rkeylen, rkey);
#define INET6_ADDRSTRLEN
maximum length of the string representation of an IPv6 address
struct nad_elem_st * elems
void out_flush_domain_queues(s2s_t s2s, const char *domain)
nad_t nad_new(void)
create a new nad
int nad_append_attr(nad_t nad, int ns, const char *name, const char *val)
attach new attr to the last elem
static void _out_dialback(conn_t out, const char *rkey, int rkeylen)
unsigned int packet_count
char ip[INET6_ADDRSTRLEN+1]
sx_t router
router's conn
#define sx_nad_write(s, nad)
static void _dns_add_result(dnsquery_t query, const char *ip, int port, int prio, int weight, unsigned int ttl)
void * pmalloc(pool_t p, int size)
void sx_nad_write_elem(sx_t s, nad_t nad, int elem)
app version
const char * local_ip
ip/port to listen on
time_t expiry
time that this entry expires
void send_dialbacks(conn_t out)
jid_t jid_new(const char *id, int len)
make a new jid
int nad_find_attr(nad_t nad, unsigned int elem, int ns, const char *name, const char *val)
get a matching attr on this elem, both name and optional val
xht hosts
srv lookup results (key host/port)
void out_resolve(s2s_t s2s, const char *domain, xht results, time_t expiry)
responses from the resolver
void nad_set_attr(nad_t nad, unsigned int elem, int ns, const char *name, const char *val, int vallen)
create, update, or zap any matching attr on this elem
jqueue_t dead
list of sx_t on the way out
struct dnsres_st * dnsres_t
void * xhash_getx(xht h, const char *key, int len)
int jqueue_size(jqueue_t q)
void nad_append_cdata(nad_t nad, const char *cdata, int len, int depth)
append new cdata to the last elem
#define stream_err_INVALID_ID
void log_write(log_t log, int level, const char *msgfmt,...)
void xhash_iter_zap(xht h)
error info for event_ERROR
sx_t sx_new(sx_env_t env, int tag, sx_callback_t cb, void *arg)
if you change these, reflect your changes in the table in error.c
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
int nad_add_namespace(nad_t nad, const char *uri, const char *prefix)
bring a new namespace into scope
static void _out_packet_queue(s2s_t s2s, pkt_t pkt)
queue the packet
int srv_i
srv lookup index
xht states
states of outgoing dialbacks (key is local/remote)
int out_bounce_route_queue(s2s_t s2s, const char *rkey, int rkeylen, int err)
void out_pkt_free(pkt_t pkt)
mio_action_t
these are the actions and a handler type assigned by the applicaiton using mio
int nad_append_elem(nad_t nad, int ns, const char *name, int depth)
create a new elem on the list
xht outq
queues of packets waiting to go out (key is route)
void nad_free(nad_t nad)
free that nad
time_t expiry
time that this entry expires
xht out_host
outgoing conns (key is ip/port)
int xhash_iter_next(xht h)
long long int packet_count
packet counter
#define mio_connect(m, port, hostip, srcip, app, arg)
for creating a new socket connected to this ip:port (returns new fd or <0, use mio_read/write first) ...
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)
static int _out_sx_callback(sx_t s, sx_event_t e, void *data, void *arg)
#define mio_read(m, fd)
process read events for this fd
static void _dns_add_host(dnsquery_t query, const char *ip, int port, int prio, int weight, unsigned int ttl)
int nad_find_namespace(nad_t nad, unsigned int elem, const char *uri, const char *prefix)
get a matching ns on this elem, both uri and optional prefix
void jqueue_free(jqueue_t q)
xht dns_bad
dns resolution bad host cache
void dns_resolve_domain(s2s_t s2s, dnscache_t dns)
#define MIO_ERROR
all MIO related routines should use those for error reporting
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
#define stanza_err_REMOTE_SERVER_TIMEOUT
int sx_can_read(sx_t s)
we can read
int etc_hosts_ttl
/etc/hosts ttl limits
int pending
set when we're waiting for a resolve response
holds the state for a single stream
jid_t from
packet addressing (not used for routing)
char * s2s_db_key(pool_t p, const char *secret, const char *remote, const char *id)
generate a dialback key
packet summary data wrapper
void sx_client_init(sx_t s, unsigned int flags, const char *ns, const char *to, const char *from, const char *version)
static void _dns_result_a(struct dns_ctx *ctx, struct dns_rr_a4 *result, void *data)
#define NAD_ENAME_L(N, E)
void jqueue_push(jqueue_t q, void *data, int priority)
char * pstrdupx(pool_t p, const char *src, int len)
use given size
#define NAD_NURI_L(N, NS)
nad_t nad
nad of the entire packet
void jid_free(jid_t jid)
free a jid
xht results
results (key ip/port)
char name[1024]
the name proper
int s2s_domain_in_whitelist(s2s_t s2s, const char *in_domain)
jqueue_t dead_conn
list of conn_t on the way out
void xhash_put(xht h, const char *key, void *val)
static void _dns_result_srv(struct dns_ctx *ctx, struct dns_rr_srv *result, void *data)
xht states_time
time of the last state change (key is local/remote)
time_t cur_expiry
current host max expiry
nad_t stanza_tofrom(nad_t nad, int elem)
flip the to and from attributes on this elem
static int _out_mio_callback(mio_t m, mio_action_t a, mio_fd_t fd, void *data, void *arg)
mio callback for outgoing conns
xht results
host lookup results (key ip/port)
void out_flush_route_queue(s2s_t s2s, const char *rkey, int rkeylen)
const char * local_secret
dialback secret
int xhash_iter_get(xht h, const char **key, int *keylen, void **val)
#define stanza_err_REMOTE_SERVER_NOT_FOUND
void xhash_zap(xht h, const char *key)
const char * name
domain name
static void _out_result(conn_t out, nad_t nad)
process incoming auth responses
time_t jqueue_age(jqueue_t q)
int out_reuse
reuse outgoing conns keyed by ip/port
void xhash_zapx(xht h, const char *key, int len)
nad_t stanza_error(nad_t nad, int elem, int err)
error the packet
struct _sx_buf_st * sx_buf_t
utility: buffer
char * dns_make_ipport(const char *host, int port)
static void _dns_result_aaaa(struct dns_ctx *ctx, struct dns_rr_a6 *result, void *data)
void sx_error(sx_t s, int err, const char *text)
int cur_prio
current host priority
int out_route(s2s_t s2s, const char *route, int routelen, conn_t *out, int allow_bad)
find/make a connection for a route
static int _etc_hosts_lookup(const char *cszName, char *szIP, const int ciMaxIPLen)
int resolve_aaaa
if we resolve AAAA records
void * jqueue_pull(jqueue_t q)
int nad_find_elem(nad_t nad, unsigned int elem, int ns, const char *name, int depth)
locate the next elem at a given depth with an optional matching name
int xhash_count(xht h)
return the total number of entries in this xht
void _out_dns_mark_bad(conn_t out)
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
struct dns_query * query
set when we're waiting for a resolve response
int xhash_iter_first(xht h)
iteration
jqueue_t jqueue_new(void)
pool_t xhash_pool(xht h)
get our pool
int out_bounce_conn_queues(conn_t out, int err)
char * pstrdup(pool_t p, const char *src)
XXX efficient: move this to const char * and then loop throug the existing heaps to see if src is wit...
xht in
incoming conns (key is stream id)
static void _out_verify(conn_t out, nad_t nad)
incoming stream authenticated
void * xhash_get(xht h, const char *key)
#define mio_close(m, fd)
request that mio close this fd
const char * local_private_key_password
private key password for local pemfile, if encrypted
#define mio_write(m, fd)
mio should try the write action on this fd now
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
int cur_weight
current host weight
#define AF_INET6
address family for IPv6
int out_packet(s2s_t s2s, pkt_t pkt)
send a packet out
#define stanza_err_SERVICE_UNAVAILABLE
const char * local_pemfile
pemfile for peer connections
struct dnscache_st * dnscache_t
int sx_ssl_client_starttls(sx_plugin_t p, sx_t s, const char *pemfile, const char *private_key_password)
struct dnsquery_st * dnsquery_t
time_t last_activity
timestamps for idle timeouts
int out_bounce_domain_queues(s2s_t s2s, const char *domain, int err)
int dns_min_ttl
dns ttl limits
int nad_find_scoped_namespace(nad_t nad, const char *uri, const char *prefix)
find a namespace in scope
struct _jqueue_st * jqueue_t
char * _sx_flags(sx_t s)
show sx flags as string - for logging
int dns_select(s2s_t s2s, char *ip, int *port, time_t now, dnscache_t dns, int allow_bad)