jabberd2  2.3.1
Data Structures | Macros | Typedefs | Functions
router.c File Reference
#include "router.h"

Go to the source code of this file.

Data Structures

struct  broadcast_st
 info for broadcasts More...
 

Macros

#define MAX_JID   3072
 
#define MAX_MESSAGE   65535
 
#define SECS_PER_DAY   86400
 
#define BYTES_PER_MEG   1048576
 

Typedefs

typedef struct broadcast_stbroadcast_t
 info for broadcasts More...
 

Functions

static void _router_broadcast (const char *key, int keylen, void *val, void *arg)
 broadcast a packet More...
 
static void _router_advertise (router_t r, const char *domain, component_t src, int unavail)
 domain advertisement More...
 
static void _router_advertise_reverse (const char *key, int keylen, void *val, void *arg)
 tell a component about all the others More...
 
static void _router_process_handshake (component_t comp, nad_t nad)
 
void routes_free (routes_t routes)
 
static int _route_add (xht hroutes, const char *name, component_t comp, route_type_t rtype)
 
static void _route_remove (xht hroutes, const char *name, component_t comp)
 
static void _router_process_bind (component_t comp, nad_t nad)
 
static void _router_process_unbind (component_t comp, nad_t nad)
 
static void _router_comp_write (component_t comp, nad_t nad)
 
static void _router_route_log_sink (const char *key, int keylen, void *val, void *arg)
 
static void _router_process_route (component_t comp, nad_t nad)
 
static void _router_process_throttle (component_t comp, nad_t nad)
 
static int _router_sx_callback (sx_t s, sx_event_t e, void *data, void *arg)
 
static int _router_accept_check (router_t r, mio_fd_t fd, const char *ip)
 
static void _router_route_unbind_walker (const char *key, int keylen, void *val, void *arg)
 
int router_mio_callback (mio_t m, mio_action_t a, mio_fd_t fd, void *data, void *arg)
 
int message_log (nad_t nad, router_t r, const char *msg_from, const char *msg_to)
 

Macro Definition Documentation

#define MAX_JID   3072

Definition at line 23 of file router.c.

#define MAX_MESSAGE   65535

Definition at line 24 of file router.c.

Referenced by message_log().

#define SECS_PER_DAY   86400

Definition at line 25 of file router.c.

#define BYTES_PER_MEG   1048576

Definition at line 26 of file router.c.

Typedef Documentation

typedef struct broadcast_st * broadcast_t

info for broadcasts

Function Documentation

static void _router_broadcast ( const char *  key,
int  keylen,
void *  val,
void *  arg 
)
static
static void _router_advertise ( router_t  r,
const char *  domain,
component_t  src,
int  unavail 
)
static
static void _router_advertise_reverse ( const char *  key,
int  keylen,
void *  val,
void *  arg 
)
static
static void _router_process_handshake ( component_t  comp,
nad_t  nad 
)
static
void routes_free ( routes_t  routes)

Definition at line 153 of file router.c.

References routes_st::comp, and routes_st::name.

Referenced by JABBER_MAIN().

static int _route_add ( xht  hroutes,
const char *  name,
component_t  comp,
route_type_t  rtype 
)
static
static void _route_remove ( xht  hroutes,
const char *  name,
component_t  comp 
)
static
static void _router_process_bind ( component_t  comp,
nad_t  nad 
)
static
static void _router_process_unbind ( component_t  comp,
nad_t  nad 
)
static
static void _router_comp_write ( component_t  comp,
nad_t  nad 
)
static
static void _router_route_log_sink ( const char *  key,
int  keylen,
void *  val,
void *  arg 
)
static
static void _router_process_route ( component_t  comp,
nad_t  nad 
)
static
static void _router_process_throttle ( component_t  comp,
nad_t  nad 
)
static
static int _router_sx_callback ( sx_t  s,
sx_event_t  e,
void *  data,
void *  arg 
)
static

Definition at line 671 of file router.c.

References _route_add(), _router_advertise(), _router_process_bind(), _router_process_handshake(), _router_process_route(), _router_process_throttle(), _router_process_unbind(), router_st::aliases, _sx_st::auth_id, router_st::closefd, _sx_buf_st::data, _jqueue_node_st::data, jid_st::domain, nad_st::elems, event_CLOSED, event_ERROR, event_OPEN, event_PACKET, event_READ, event_STREAM, event_WANT_READ, event_WANT_WRITE, event_WRITE, mio_fd_st::fd, component_st::fd, _jqueue_st::front, _sx_error_st::generic, component_st::ip, jid_reset(), jid_static(), jqueue_push(), component_st::legacy, _sx_buf_st::len, router_st::local_secret, router_st::log, log_debug, log_write(), router_st::mio, mio_read, MIO_WOULDBLOCK, mio_write, nad_elem_st::my_ns, nad_add_namespace(), NAD_AVAL, NAD_AVAL_L, NAD_ENAME, NAD_ENAME_L, NAD_ENS, nad_find_attr(), nad_find_namespace(), nad_free(), NAD_NURI, NAD_NURI_L, nad_set_attr(), nad_wrap_elem(), alias_st::name, nad_ns_st::next, alias_st::next, nad_elem_st::ns, _sx_st::ns, nad_st::nss, component_st::port, _jqueue_node_st::prev, pstrdup(), component_st::r, component_st::rate, rate_add(), rate_check(), rate_left(), component_st::rate_log, _sx_st::req_to, route_MULTI_FROM, router_st::routes, component_st::routes, component_st::s, nad_st::scope, _sx_error_st::specific, _sx_st::state, state_STREAM, stream_err_HOST_UNKNOWN, stream_err_INVALID_NAMESPACE, sx_close(), sx_error(), sx_kill(), alias_st::target, uri_CLIENT, uri_COMPONENT, xhash_pool(), xhash_put(), and ZONE.

Referenced by router_mio_callback().

static int _router_accept_check ( router_t  r,
mio_fd_t  fd,
const char *  ip 
)
static
static void _router_route_unbind_walker ( const char *  key,
int  keylen,
void *  val,
void *  arg 
)
static
int router_mio_callback ( mio_t  m,
mio_action_t  a,
mio_fd_t  fd,
void *  data,
void *  arg 
)
int message_log ( nad_t  nad,
router_t  r,
const char *  msg_from,
const char *  msg_to 
)