jabberd2  2.2.16
Data Structures | Defines | Typedefs | Functions | Variables
c2s/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

Defines

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

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
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
C2S_API void c2s_pbx_init (c2s_t c2s)
C2S_API authreg_t authreg_init (c2s_t c2s, char *name)
 get a handle for a single module
C2S_API void authreg_free (authreg_t ar)
 shut down
C2S_API int authreg_process (c2s_t c2s, sess_t sess, nad_t nad)
 the main authreg processor

Variables

sig_atomic_t c2s_lost_router

Define 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 114 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 115 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 340 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 699 of file c2s.c.

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

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 sx_nad_write, sess_st::c2s, c2s_st::router, _sm_build_route(), jid_user(), and bres_st::jid.

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 log_debug, ZONE, _sx_plugin_st::features, _bind_features(), and _sx_plugin_st::private.

Referenced by JABBER_MAIN().

C2S_API void c2s_pbx_init ( c2s_t  c2s)

Definition at line 120 of file pbx.c.

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

Referenced by c2s_router_sx_callback().

C2S_API authreg_t authreg_init ( c2s_t  c2s,
char *  name 
)

get a handle for a single module

Definition at line 40 of file authreg.c.

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

Referenced by JABBER_MAIN().

C2S_API void authreg_free ( authreg_t  ar)

shut down

Definition at line 115 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_mio_callback(), _c2s_signal(), _c2s_router_connect(), and JABBER_MAIN().