jabberd2  2.2.17
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
s2s.h File Reference
#include "mio/mio.h"
#include "sx/sx.h"
#include <udns.h>

Go to the source code of this file.

Data Structures

struct  host_st
struct  s2s_st
struct  pkt_st
 packet summary data wrapper More...
struct  conn_st
struct  dnsquery_st
 dns query data More...
struct  dnscache_st
 one item in the dns resolution cache More...
struct  dnsres_st
 dns resolution results More...
union  xhashv
 session packet handling More...

Macros

#define DNS_MAX_RESULTS   50
#define S2S_DB_HEADER   (1<<10)
#define MAX_DOMAIN_LEN   1023

Typedefs

typedef struct host_sthost_t
typedef struct s2s_sts2s_t
typedef struct pkt_stpkt_t
typedef struct conn_stconn_t
typedef struct dnsquery_stdnsquery_t
typedef struct dnscache_stdnscache_t
typedef struct dnsres_stdnsres_t

Enumerations

enum  conn_state_t { conn_NONE, conn_INPROGRESS, conn_VALID, conn_INVALID }

Functions

int s2s_router_mio_callback (mio_t m, mio_action_t a, mio_fd_t fd, void *data, void *arg)
int s2s_router_sx_callback (sx_t s, sx_event_t e, void *data, void *arg)
 our master callback
int s2s_domain_in_whitelist (s2s_t s2s, char *in_domain)
char * s2s_route_key (pool_t p, char *local, char *remote)
 generate a local/remote route key
int s2s_route_key_match (char *local, char *remote, char *rkey, int rkeylen)
 match route key - used for searching route hash
char * s2s_db_key (pool_t p, char *secret, char *remote, char *id)
 generate a dialback key
char * dns_make_ipport (char *host, int port)
int out_packet (s2s_t s2s, pkt_t pkt)
 send a packet out
int out_route (s2s_t s2s, char *route, int routelen, conn_t *out, int allow_bad)
 find/make a connection for a route
int dns_select (s2s_t s2s, char *ip, int *port, time_t now, dnscache_t dns, int allow_bad)
void dns_resolve_domain (s2s_t s2s, dnscache_t dns)
void out_resolve (s2s_t s2s, char *domain, xht results, time_t expiry)
 responses from the resolver
void out_dialback (s2s_t s2s, pkt_t pkt)
int out_bounce_domain_queues (s2s_t s2s, const char *domain, int err)
int out_bounce_route_queue (s2s_t s2s, char *rkey, int rkeylen, int err)
int out_bounce_conn_queues (conn_t out, int err)
void out_flush_domain_queues (s2s_t s2s, const char *domain)
void out_flush_route_queue (s2s_t s2s, char *rkey, int rkeylen)
int in_mio_callback (mio_t m, mio_action_t a, mio_fd_t fd, void *data, void *arg)
int s2s_db_init (sx_env_t env, sx_plugin_t p, va_list args)
void out_pkt_free (pkt_t pkt)

Variables

sig_atomic_t s2s_lost_router

Macro Definition Documentation

#define DNS_MAX_RESULTS   50

Definition at line 274 of file s2s.h.

Referenced by _dns_add_host(), _dns_add_result(), and dns_select().

#define S2S_DB_HEADER   (1<<10)

Definition at line 373 of file s2s.h.

Referenced by _s2s_db_header(), in_mio_callback(), and out_route().

#define MAX_DOMAIN_LEN   1023

Definition at line 376 of file s2s.h.

Referenced by _s2s_populate_whitelist_domains(), and s2s_domain_in_whitelist().


Typedef Documentation

typedef struct host_st* host_t

Definition at line 38 of file s2s.h.

typedef struct s2s_st* s2s_t

Definition at line 39 of file s2s.h.

typedef struct pkt_st* pkt_t

Definition at line 40 of file s2s.h.

typedef struct conn_st* conn_t

Definition at line 41 of file s2s.h.

typedef struct dnsquery_st* dnsquery_t

Definition at line 42 of file s2s.h.

typedef struct dnscache_st* dnscache_t

Definition at line 43 of file s2s.h.

typedef struct dnsres_st* dnsres_t

Definition at line 44 of file s2s.h.


Enumeration Type Documentation

Enumerator:
conn_NONE 
conn_INPROGRESS 
conn_VALID 
conn_INVALID 

Definition at line 231 of file s2s.h.


Function Documentation

int s2s_router_mio_callback ( mio_t  m,
mio_action_t  a,
mio_fd_t  fd,
void *  data,
void *  arg 
)
int s2s_router_sx_callback ( sx_t  s,
sx_event_t  e,
void *  data,
void *  arg 
)
int s2s_domain_in_whitelist ( s2s_t  s2s,
char *  in_domain 
)
char* s2s_route_key ( pool_t  p,
char *  local,
char *  remote 
)

generate a local/remote route key

Definition at line 27 of file util.c.

References pmalloc().

Referenced by _in_packet(), _in_result(), _out_packet_queue(), _out_result(), _out_verify(), and out_packet().

int s2s_route_key_match ( char *  local,
char *  remote,
char *  rkey,
int  rkeylen 
)

match route key - used for searching route hash

Definition at line 44 of file util.c.

Referenced by out_bounce_domain_queues().

char* s2s_db_key ( pool_t  p,
char *  secret,
char *  remote,
char *  id 
)

generate a dialback key

Definition at line 61 of file util.c.

References _sx_debug, pstrdup(), shahash_r(), and ZONE.

Referenced by _in_verify(), and _out_dialback().

char* dns_make_ipport ( char *  host,
int  port 
)

Definition at line 727 of file out.c.

Referenced by _dns_add_host(), _dns_add_result(), _out_dns_mark_bad(), and _s2s_time_checks().

int out_packet ( s2s_t  s2s,
pkt_t  pkt 
)
int out_route ( s2s_t  s2s,
char *  route,
int  routelen,
conn_t out,
int  allow_bad 
)
int dns_select ( s2s_t  s2s,
char *  ip,
int *  port,
time_t  now,
dnscache_t  dns,
int  allow_bad 
)
void dns_resolve_domain ( s2s_t  s2s,
dnscache_t  dns 
)
void out_resolve ( s2s_t  s2s,
char *  domain,
xht  results,
time_t  expiry 
)
void out_dialback ( s2s_t  s2s,
pkt_t  pkt 
)
int out_bounce_domain_queues ( s2s_t  s2s,
const char *  domain,
int  err 
)
int out_bounce_route_queue ( s2s_t  s2s,
char *  rkey,
int  rkeylen,
int  err 
)
int out_bounce_conn_queues ( conn_t  out,
int  err 
)
void out_flush_domain_queues ( s2s_t  s2s,
const char *  domain 
)

Definition at line 1863 of file out.c.

References out_flush_route_queue(), s2s_st::outq, xhash_iter_first(), xhash_iter_get(), and xhash_iter_next().

Referenced by out_resolve().

void out_flush_route_queue ( s2s_t  s2s,
char *  rkey,
int  rkeylen 
)
int in_mio_callback ( mio_t  m,
mio_action_t  a,
mio_fd_t  fd,
void *  data,
void *  arg 
)
int s2s_db_init ( sx_env_t  env,
sx_plugin_t  p,
va_list  args 
)

Definition at line 55 of file db.c.

References _s2s_db_features(), _s2s_db_header(), _sx_plugin_st::features, _sx_plugin_st::header, log_debug, and ZONE.

Referenced by JABBER_MAIN().

void out_pkt_free ( pkt_t  pkt)

Definition at line 601 of file out.c.

References pkt_st::from, jid_free(), pkt_st::nad, nad_free(), and pkt_st::to.

Referenced by JABBER_MAIN().


Variable Documentation

sig_atomic_t s2s_lost_router

Definition at line 26 of file main.c.

Referenced by _s2s_router_connect(), _s2s_signal(), JABBER_MAIN(), and s2s_router_mio_callback().