jabberd2  2.3.2
Data Structures | Macros | Typedefs | Functions | Variables
c2s.h File Reference
#include <expat.h>
#include "mio/mio.h"
#include "sx/sx.h"
#include "util/util.h"

Go to the source code of this file.

Data Structures

struct  bres_st
 list of resources bound to session More...
 
struct  sess_st
 There is one instance of this struct per user who is logged in to this c2s instance. More...
 
struct  host_st
 
struct  c2s_st
 
struct  authreg_st
 
union  xhashv
 session packet handling More...
 
struct  stream_redirect_st
 

Macros

#define DLLEXPORT
 
#define C2S_API
 
#define AR_MECH_TRAD_PLAIN   (1<<0)
 
#define AR_MECH_TRAD_DIGEST   (1<<1)
 
#define AR_MECH_TRAD_CRAMMD5   (1<<2)
 

Typedefs

typedef struct host_sthost_t
 
typedef struct c2s_stc2s_t
 
typedef struct bres_stbres_t
 
typedef struct sess_stsess_t
 
typedef struct authreg_stauthreg_t
 
typedef int(* ar_module_init_fn )(authreg_t)
 type for the module init function More...
 
typedef struct stream_redirect_ststream_redirect_t
 

Functions

C2S_API int c2s_router_mio_callback (mio_t m, mio_action_t a, mio_fd_t fd, void *data, void *arg)
 
C2S_API int c2s_router_sx_callback (sx_t s, sx_event_t e, void *data, void *arg)
 
C2S_API void sm_start (sess_t sess, bres_t res)
 
C2S_API void sm_end (sess_t sess, bres_t res)
 
C2S_API void sm_create (sess_t sess, bres_t res)
 
C2S_API void sm_delete (sess_t sess, bres_t res)
 
C2S_API void sm_packet (sess_t sess, bres_t res, nad_t nad)
 
C2S_API int bind_init (sx_env_t env, sx_plugin_t p, va_list args)
 plugin initialiser More...
 
C2S_API void c2s_pbx_init (c2s_t c2s)
 
JABBERD2_API int address_init (sx_env_t env, sx_plugin_t p, va_list args)
 args: none More...
 
C2S_API authreg_t authreg_init (c2s_t c2s, const char *name)
 get a handle for a single module More...
 
C2S_API void authreg_free (authreg_t ar)
 shut down More...
 
C2S_API int authreg_process (c2s_t c2s, sess_t sess, nad_t nad)
 the main authreg processor More...
 

Variables

sig_atomic_t c2s_lost_router
 

Macro Definition Documentation

#define DLLEXPORT

Definition at line 47 of file c2s.h.

#define C2S_API

Definition at line 48 of file c2s.h.

#define AR_MECH_TRAD_PLAIN   (1<<0)

Definition at line 117 of file c2s.h.

Referenced by _authreg_auth_get(), _authreg_auth_set(), and _c2s_config_expand().

#define AR_MECH_TRAD_DIGEST   (1<<1)

Definition at line 118 of file c2s.h.

Referenced by _authreg_auth_get(), _authreg_auth_set(), and _c2s_config_expand().

#define AR_MECH_TRAD_CRAMMD5   (1<<2)

Definition at line 119 of file c2s.h.

Referenced by _authreg_auth_get(), _authreg_auth_set(), and _c2s_config_expand().

Typedef Documentation

typedef struct host_st* host_t

Definition at line 52 of file c2s.h.

typedef struct c2s_st* c2s_t

Definition at line 53 of file c2s.h.

typedef struct bres_st* bres_t

Definition at line 54 of file c2s.h.

typedef struct sess_st* sess_t

Definition at line 55 of file c2s.h.

typedef struct authreg_st* authreg_t

Definition at line 56 of file c2s.h.

typedef int(* ar_module_init_fn)(authreg_t)

type for the module init function

Definition at line 359 of file c2s.h.

Function Documentation

C2S_API int c2s_router_mio_callback ( mio_t  m,
mio_action_t  a,
mio_fd_t  fd,
void *  data,
void *  arg 
)
C2S_API int c2s_router_sx_callback ( sx_t  s,
sx_event_t  e,
void *  data,
void *  arg 
)

Definition at line 700 of file c2s.c.

References _c2s_client_mio_callback(), _c2s_component_presence(), sess_st::active, c2s_st::ar, _sx_st::auth_id, sess_st::bound, sess_st::c2s, bres_st::c2s_id, c2s_pbx_init(), _sx_error_st::code, _sx_buf_st::data, authreg_st::delete_user, nad_st::ecur, 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, c2s_st::fd, _sx_error_st::generic, sess_st::host, c2s_st::id, bres_st::jid, jid_free(), jid_full(), jid_new(), _sx_buf_st::len, c2s_st::local_ip, c2s_st::local_pemfile, c2s_st::local_port, c2s_st::local_ssl_port, c2s_st::log, log_debug, log_write(), c2s_st::mio, mio_close, MIO_ERROR, mio_listen, mio_read, MIO_STRERROR, MIO_WOULDBLOCK, mio_write, nad_add_namespace(), nad_append_attr(), nad_append_elem(), NAD_AVAL, NAD_AVAL_L, NAD_ENAME, NAD_ENAME_L, NAD_ENS, nad_find_attr(), nad_find_elem(), nad_find_namespace(), nad_find_scoped_namespace(), nad_free(), nad_new(), NAD_NURI, NAD_NURI_L, nad_print(), nad_set_attr(), bres_st::next, nad_ns_st::next, jid_st::node, nad_elem_st::ns, nad_st::nss, c2s_st::online, sess_st::packet_count, c2s_st::packet_count, c2s_st::pbx_pipe, host_st::realm, sess_st::resources, sess_st::result, c2s_st::retry_left, c2s_st::retry_lost, c2s_st::router, c2s_st::router_pass, c2s_st::router_pemfile, c2s_st::router_private_key_password, c2s_st::router_user, sess_st::s, sess_st::sasl_authd, c2s_st::server_fd, c2s_st::sessions, sess_st::skey, sm_end(), bres_st::sm_id, sm_packet(), bres_st::sm_request, sess_st::smcomp, _sx_error_st::specific, _sx_st::ssf, stanza_err_INTERNAL_SERVER_ERROR, stanza_error(), c2s_st::started, _sx_st::state, state_OPEN, state_STREAM, stream_err_CONFLICT, stream_err_INTERNAL_SERVER_ERROR, sx_auth(), sx_close(), SX_ERR_AUTH, sx_error(), sx_kill(), sx_nad_write, sx_nad_write_elem(), c2s_st::sx_sasl, sx_sasl_auth(), c2s_st::sx_ssl, sx_ssl_client_starttls(), _sx_st::tag, uri_CLIENT, uri_COMPONENT, uri_SESSION, uri_STREAMS, uri_TLS, xhash_get(), and ZONE.

Referenced by _c2s_router_connect().

C2S_API void sm_start ( sess_t  sess,
bres_t  res 
)
C2S_API void sm_end ( sess_t  sess,
bres_t  res 
)
C2S_API void sm_create ( sess_t  sess,
bres_t  res 
)
C2S_API void sm_delete ( sess_t  sess,
bres_t  res 
)

Definition at line 82 of file sm.c.

References _sm_build_route(), sess_st::c2s, bres_st::jid, jid_user(), c2s_st::router, and sx_nad_write.

Referenced by _authreg_register_set().

C2S_API void sm_packet ( sess_t  sess,
bres_t  res,
nad_t  nad 
)
C2S_API int bind_init ( sx_env_t  env,
sx_plugin_t  p,
va_list  args 
)

plugin initialiser

args: c2s

Definition at line 69 of file bind.c.

References _bind_features(), _sx_plugin_st::features, log_debug, _sx_plugin_st::private, and ZONE.

Referenced by JABBER_MAIN().

C2S_API void c2s_pbx_init ( c2s_t  c2s)

Definition at line 120 of file pbx.c.

References _pbx_read_pipe(), c2s_st::log, log_debug, log_write(), c2s_st::pbx_pipe, and ZONE.

Referenced by c2s_router_sx_callback().

JABBERD2_API int address_init ( sx_env_t  env,
sx_plugin_t  p,
va_list  args 
)

args: none

Definition at line 42 of file address.c.

References _address_features(), _sx_plugin_st::features, log_debug, and ZONE.

Referenced by JABBER_MAIN().

C2S_API authreg_t authreg_init ( c2s_t  c2s,
const char *  name 
)

get a handle for a single module

get a handle for a single module

Definition at line 40 of file authreg.c.

References authreg_free(), authreg_st::c2s, c2s_st::config, config_get_one(), c2s_st::log, log_debug, log_write(), PATH_MAX, authreg_st::user_exists, and ZONE.

Referenced by JABBER_MAIN().

C2S_API void authreg_free ( authreg_t  ar)

shut down

shut down

Definition at line 116 of file authreg.c.

References authreg_st::free.

Referenced by authreg_init(), and JABBER_MAIN().

C2S_API int authreg_process ( c2s_t  c2s,
sess_t  sess,
nad_t  nad 
)

Variable Documentation

sig_atomic_t c2s_lost_router

Definition at line 26 of file main.c.

Referenced by _c2s_router_connect(), _c2s_signal(), c2s_router_mio_callback(), and JABBER_MAIN().