jabberd2
2.3.4
|
data structures and prototypes for the session manager More...
#include "sx/sx.h"
#include "mio/mio.h"
#include "util/util.h"
#include "storage/storage.h"
#include "util/uri.h"
Go to the source code of this file.
Data Structures | |
struct | pkt_st |
packet summary data wrapper More... | |
struct | item_st |
roster items More... | |
struct | sm_st |
session manager global context More... | |
struct | user_st |
data for a single user More... | |
struct | sess_st |
There is one instance of this struct per user who is logged in to this c2s instance. More... | |
struct | mm_st |
module manager data More... | |
struct | module_st |
data for a single module More... | |
struct | mod_instance_st |
single instance of a module in a chain More... | |
Macros | |
#define | DLLEXPORT |
#define | SM_API |
#define | ns_AUTH (1) |
#define | ns_REGISTER (2) |
#define | ns_ROSTER (3) |
#define | ns_AGENTS (4) |
#define | ns_DELAY (5) |
#define | ns_BROWSE (6) |
#define | ns_EVENT (7) |
#define | ns_GATEWAY (8) |
#define | ns_EXPIRE (9) |
#define | ns_SEARCH (10) |
#define | ns_DISCO (11) |
#define | ns_DISCO_ITEMS (12) |
#define | ns_DISCO_INFO (13) |
#define | ns_AMP (14) |
#define | ns_AMP_ERRORS (15) |
#define | ns_AMP_ACTION_DROP (16) |
#define | ns_AMP_ACTION_ERROR (17) |
#define | ns_AMP_ACTION_NOTIFY (18) |
#define | ns_AMP_CONDITION_DELIVER (19) |
#define | ns_AMP_CONDITION_EXPIREAT (20) |
#define | ns_AMP_CONDITION_MATCHRESOURCE (21) |
Typedefs | |
typedef struct sm_st * | sm_t |
typedef struct user_st * | user_t |
typedef struct sess_st * | sess_t |
typedef struct aci_st * | aci_t |
typedef struct mm_st * | mm_t |
typedef struct pkt_st * | pkt_t |
packet summary data wrapper More... | |
typedef struct item_st * | item_t |
roster items More... | |
typedef struct module_st * | module_t |
typedef struct mod_instance_st * | mod_instance_t |
Functions | |
SM_API xht | aci_load (sm_t sm) |
SM_API int | aci_check (xht acls, const char *type, jid_t jid) |
see if a jid is in an acl More... | |
SM_API void | aci_unload (xht acls) |
unload aci table More... | |
SM_API int | sm_sx_callback (sx_t s, sx_event_t e, void *data, void *arg) |
our master callback More... | |
SM_API int | sm_mio_callback (mio_t m, mio_action_t a, mio_fd_t fd, void *data, void *arg) |
SM_API void | sm_timestamp (time_t t, char timestamp[18]) |
SM_API void | sm_c2s_action (sess_t dest, const char *action, const char *target) |
send a new action route More... | |
SM_API void | sm_signature (sm_t sm, const char *str) |
this is gratuitous, but apache gets one, so why not? More... | |
SM_API int | sm_register_ns (sm_t sm, const char *uri) |
register a new global ns More... | |
SM_API void | sm_unregister_ns (sm_t sm, const char *uri) |
unregister a global ns More... | |
SM_API int | sm_get_ns (sm_t sm, const char *uri) |
get a globally registered ns More... | |
SM_API int | sm_storage_rate_limit (sm_t sm, const char *owner) |
SM_API void | dispatch (sm_t sm, pkt_t pkt) |
main packet dispatcher More... | |
SM_API pkt_t | pkt_error (pkt_t pkt, int err) |
SM_API pkt_t | pkt_tofrom (pkt_t pkt) |
swap a packet's to and from attributes More... | |
SM_API pkt_t | pkt_dup (pkt_t pkt, const char *to, const char *from) |
duplicate pkt, replacing addresses More... | |
SM_API pkt_t | pkt_new (sm_t sm, nad_t nad) |
SM_API void | pkt_free (pkt_t pkt) |
SM_API pkt_t | pkt_create (sm_t sm, const char *elem, const char *type, const char *to, const char *from) |
SM_API void | pkt_id (pkt_t src, pkt_t dest) |
convenience - copy the packet id from src to dest More... | |
SM_API void | pkt_id_new (pkt_t pkt) |
create an id value for new iq packets More... | |
SM_API void | pkt_delay (pkt_t pkt, time_t t, const char *from) |
add an x:delay stamp More... | |
SM_API void | pkt_router (pkt_t pkt) |
SM_API void | pkt_sess (pkt_t pkt, sess_t sess) |
SM_API int | pres_trust (user_t user, jid_t jid) |
see if the jid is trusted (ie in the roster with s10n="from" or "both") More... | |
SM_API void | pres_roster (sess_t sess, item_t item) |
send presence based on roster changes More... | |
SM_API void | pres_update (sess_t sess, pkt_t pres) |
presence updates from a session More... | |
SM_API void | pres_error (sess_t sess, jid_t jid) |
SM_API void | pres_deliver (sess_t sess, pkt_t pres) |
outgoing directed presence More... | |
SM_API void | pres_in (user_t user, pkt_t pres) |
presence updates from a remote jid - RFC 3921bis 4.3.2. More... | |
SM_API void | pres_probe (user_t user) |
SM_API void | sess_route (sess_t sess, pkt_t pkt) |
send a packet to the client for this session More... | |
SM_API sess_t | sess_start (sm_t sm, jid_t jid) |
SM_API void | sess_end (sess_t sess) |
SM_API sess_t | sess_match (user_t user, const char *resource) |
match a session by resource More... | |
SM_API user_t | user_load (sm_t sm, jid_t jid) |
fetch user data More... | |
SM_API void | user_free (user_t user) |
SM_API int | user_create (sm_t sm, jid_t jid) |
initialise a user More... | |
SM_API void | user_delete (sm_t sm, jid_t jid) |
trash a user More... | |
SM_API void | feature_register (sm_t sm, const char *feature) |
register a feature More... | |
SM_API void | feature_unregister (sm_t sm, const char *feature) |
unregister feature More... | |
SM_API mm_t | mm_new (sm_t sm) |
allocate a module manager instance, and loads the modules More... | |
SM_API void | mm_free (mm_t mm) |
free a mm instance More... | |
SM_API int | mm_sess_start (mm_t mm, sess_t sess) |
fire sess-start chain More... | |
SM_API void | mm_sess_end (mm_t mm, sess_t sess) |
fire sess-end chain More... | |
SM_API mod_ret_t | mm_in_sess (mm_t mm, sess_t sess, pkt_t pkt) |
fire in-sess chain More... | |
SM_API mod_ret_t | mm_in_router (mm_t mm, pkt_t pkt) |
fire in-router chain More... | |
SM_API mod_ret_t | mm_out_sess (mm_t mm, sess_t sess, pkt_t pkt) |
fire out-sess chain More... | |
SM_API mod_ret_t | mm_out_router (mm_t mm, pkt_t pkt) |
fire out-router chain More... | |
SM_API mod_ret_t | mm_pkt_sm (mm_t mm, pkt_t pkt) |
fire pkt-sm chain More... | |
SM_API mod_ret_t | mm_pkt_user (mm_t mm, user_t user, pkt_t pkt) |
fire pkt-user chain More... | |
SM_API mod_ret_t | mm_pkt_router (mm_t mm, pkt_t pkt) |
fire pkt-router chain More... | |
SM_API int | mm_user_load (mm_t mm, user_t user) |
fire user-load chain More... | |
SM_API int | mm_user_unload (mm_t mm, user_t user) |
fire user-unload chain More... | |
SM_API int | mm_user_create (mm_t mm, jid_t jid) |
fire user-create chain More... | |
SM_API void | mm_user_delete (mm_t mm, jid_t jid) |
fire user-delete chain More... | |
SM_API void | mm_disco_extend (mm_t mm, pkt_t pkt) |
fire disco-extend chain More... | |
Variables | |
sig_atomic_t | sm_lost_router |
data structures and prototypes for the session manager
Definition in file sm.h.
#define ns_AUTH (1) |
Definition at line 69 of file sm.h.
Referenced by JABBER_MAIN().
#define ns_REGISTER (2) |
Definition at line 70 of file sm.h.
Referenced by JABBER_MAIN().
#define ns_ROSTER (3) |
Definition at line 71 of file sm.h.
Referenced by _roster_in_sess(), and JABBER_MAIN().
#define ns_AGENTS (4) |
Definition at line 72 of file sm.h.
Referenced by _disco_in_sess(), _disco_pkt_sm(), and JABBER_MAIN().
#define ns_DELAY (5) |
Definition at line 73 of file sm.h.
Referenced by JABBER_MAIN().
#define ns_BROWSE (6) |
Definition at line 74 of file sm.h.
Referenced by JABBER_MAIN().
#define ns_EVENT (7) |
Definition at line 75 of file sm.h.
Referenced by JABBER_MAIN().
#define ns_GATEWAY (8) |
Definition at line 76 of file sm.h.
Referenced by JABBER_MAIN().
#define ns_EXPIRE (9) |
Definition at line 77 of file sm.h.
Referenced by JABBER_MAIN().
#define ns_SEARCH (10) |
Definition at line 78 of file sm.h.
Referenced by JABBER_MAIN().
#define ns_DISCO (11) |
Definition at line 79 of file sm.h.
Referenced by JABBER_MAIN().
#define ns_DISCO_ITEMS (12) |
Definition at line 80 of file sm.h.
Referenced by _disco_pkt_sm(), and JABBER_MAIN().
#define ns_DISCO_INFO (13) |
Definition at line 81 of file sm.h.
Referenced by _amp_pkt_sm(), _disco_in_sess(), _disco_pkt_sm(), _disco_pkt_user(), _pep_out_sess(), and JABBER_MAIN().
typedef struct mod_instance_st* mod_instance_t |
enum pkt_type_t |
packet types
enum route_type_t |
route types
enum mod_ret_t |
enum mod_chain_t |
module chain types
Definition at line 30 of file aci.c.
References sm_st::config, jid_append(), jid_free(), jid_new(), jid_user(), log_debug, config_st::nad, NAD_AVAL, NAD_AVAL_L, NAD_CDATA, NAD_CDATA_L, nad_find_attr(), nad_find_elem(), pstrdup(), xhash_new(), xhash_pool(), xhash_put(), and ZONE.
see if a jid is in an acl
Definition at line 86 of file aci.c.
References jid_st::dirty, jid_dup(), jid_free(), jid_full(), jid_search(), jid_user(), log_debug, jid_st::resource, xhash_get(), and ZONE.
unload aci table
Definition at line 114 of file aci.c.
References jid_free(), log_debug, aci_user_st::name, aci_user_st::next, jid_st::next, xhash_free(), xhash_iter_first(), xhash_iter_get(), xhash_iter_next(), and ZONE.
Referenced by JABBER_MAIN().
SM_API int sm_sx_callback | ( | sx_t | s, |
sx_event_t | e, | ||
void * | data, | ||
void * | arg | ||
) |
our master callback
Definition at line 33 of file sm.c.
References _sx_error_st::code, _sx_buf_st::data, dispatch(), event_CLOSED, event_ERROR, event_OPEN, event_PACKET, event_READ, event_STREAM, event_WANT_READ, event_WANT_WRITE, event_WRITE, mio_fd_st::fd, sm_st::fd, _sx_error_st::generic, sm_st::hosts, sm_st::id, _sx_buf_st::len, sm_st::log, log_debug, log_write(), sm_st::mio, mio_close, MIO_ERROR, 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_scoped_namespace(), nad_free(), nad_new(), NAD_NURI, NAD_NURI_L, nad_set_attr(), sm_st::online, pkt_new(), sm_st::retry_left, sm_st::retry_lost, sm_st::router, sm_st::router_pass, sm_st::router_user, sm, _sx_error_st::specific, _sx_st::ssf, sm_st::started, _sx_st::state, state_OPEN, state_STREAM, sx_close(), SX_ERR_AUTH, sx_kill(), sx_nad_write, sm_st::sx_sasl, sx_sasl_auth(), sm_st::sx_ssl, sx_ssl_client_starttls(), uri_COMPONENT, uri_STREAMS, uri_TLS, xhash_iter_first(), xhash_iter_get(), xhash_iter_next(), and ZONE.
Referenced by _sm_router_connect().
SM_API int sm_mio_callback | ( | mio_t | m, |
mio_action_t | a, | ||
mio_fd_t | fd, | ||
void * | data, | ||
void * | arg | ||
) |
Definition at line 241 of file sm.c.
References action_ACCEPT, action_CLOSE, action_READ, action_WRITE, mio_fd_st::fd, sm_st::log, log_debug, log_write(), sm_st::online, sm_st::router, sm, sm_lost_router, sx_can_read(), sx_can_write(), sx_kill(), and ZONE.
Referenced by _sm_router_connect().
SM_API void sm_timestamp | ( | time_t | t, |
char | timestamp[18] | ||
) |
send a new action route
Definition at line 280 of file sm.c.
References sess_st::c2s, sess_st::c2s_id, sm_st::id, log_debug, nad_add_namespace(), nad_append_attr(), nad_append_elem(), nad_new(), sm_st::router, user_st::sm, sess_st::sm_id, sx_nad_write, uri_COMPONENT, uri_SESSION, sess_st::user, and ZONE.
Referenced by _session_in_router(), JABBER_MAIN(), sess_start(), sm_storage_rate_limit(), and user_delete().
this is gratuitous, but apache gets one, so why not?
Definition at line 313 of file sm.c.
References sm_st::siglen, and sm_st::signature.
Referenced by JABBER_MAIN().
register a new global ns
Definition at line 324 of file sm.c.
References pstrdup(), xhash_count(), xhash_get(), xhash_pool(), xhash_put(), sm_st::xmlns, and sm_st::xmlns_refcount.
Referenced by module_init().
unregister a global ns
Definition at line 338 of file sm.c.
References xhash_get(), xhash_put(), xhash_zap(), sm_st::xmlns, and sm_st::xmlns_refcount.
Referenced by _iq_last_free(), _iq_ping_free(), _iq_private_free(), _iq_time_free(), _iq_vcard_free(), _iq_version_free(), _privacy_free(), and _vacation_free().
get a globally registered ns
Definition at line 349 of file sm.c.
References xhash_get(), and sm_st::xmlns.
Definition at line 355 of file sm.c.
References item_st::jid, user_st::jid, jid_full(), sm_st::log, log_debug, log_write(), sess_st::next, pkt_create(), pkt_router(), pool_cleanup(), pstrdup(), sm_st::query_rate_seconds, sm_st::query_rate_total, sm_st::query_rate_wait, sm_st::query_rates, rate_add(), rate_check(), rate_free(), rate_new(), user_st::roster, user_st::sessions, user_st::sm, sm_c2s_action(), item_st::to, sm_st::users, xhash_get(), xhash_iter_first(), xhash_iter_get(), xhash_iter_next(), xhash_pool(), xhash_put(), and ZONE.
Referenced by _iq_vcard_in_sess(), _iq_vcard_pkt_user(), _roster_in_sess_s10n(), _roster_pkt_user(), and _roster_set_item().
main packet dispatcher
Definition at line 31 of file dispatch.c.
References _stanza_errors, _stanza_error_st::code, pkt_st::from, jid_full(), log_debug, sm_st::mm, mm_in_router(), mm_pkt_router(), mm_pkt_sm(), mm_pkt_user(), mod_HANDLED, mod_PASS, pkt_st::nad, NAD_AVAL, NAD_AVAL_L, nad_find_attr(), jid_st::node, pkt_create(), pkt_error(), pkt_free(), pkt_IQ_RESULT, pkt_PRESENCE, pkt_PRESENCE_PROBE, pkt_router(), route_BROADCAST, route_ERROR, route_UNICAST, pkt_st::rtype, user_st::sessions, pkt_st::sm, stanza_err_BAD_REQUEST, stanza_err_FEATURE_NOT_IMPLEMENTED, stanza_err_REMOTE_SERVER_NOT_FOUND, stanza_err_SERVICE_UNAVAILABLE, pkt_st::to, pkt_st::type, user_free(), user_load(), and ZONE.
Referenced by sm_sx_callback().
Definition at line 30 of file pkt.c.
References jid_dup(), log_debug, pkt_st::nad, pkt_ERROR, pkt_free(), pkt_tofrom(), pkt_st::rto, stanza_error(), pkt_st::to, pkt_st::type, and ZONE.
Referenced by _offline_user_delete(), _privacy_out_router(), _session_in_router(), dispatch(), pkt_router(), and pkt_sess().
swap a packet's to and from attributes
Definition at line 57 of file pkt.c.
References pkt_st::from, jid_full(), pkt_st::nad, nad_set_attr(), pkt_st::rfrom, pkt_st::rto, and pkt_st::to.
Referenced by _disco_in_sess(), _disco_pkt_user(), _echo_pkt_sm(), _iq_last_pkt_sm(), _iq_last_pkt_user(), _iq_ping_pkt_sm(), _iq_private_in_sess(), _iq_time_pkt_sm(), _iq_version_pkt_sm(), _roster_in_sess(), _roster_pkt_user(), _vacation_in_sess(), and pkt_error().
duplicate pkt, replacing addresses
Definition at line 84 of file pkt.c.
References pkt_st::from, jid_dup(), jid_full(), jid_new(), log_debug, pkt_st::nad, nad_copy(), nad_set_attr(), pkt_st::sm, pkt_st::to, pkt_st::type, and ZONE.
Referenced by _announce_pkt_sm(), _disco_in_sess(), _disco_pkt_sm(), _help_pkt_sm(), _iq_private_in_sess(), _offline_pkt_user(), _privacy_in_sess(), _roster_push(), _unblock_jid(), pres_in(), pres_roster(), and pres_update().
Definition at line 113 of file pkt.c.
References nad_st::ecur, pkt_st::from, jid_new(), sm_st::log, log_debug, log_write(), pkt_st::nad, NAD_AVAL, NAD_AVAL_L, NAD_CDATA, NAD_CDATA_L, NAD_ENAME, NAD_ENAME_L, NAD_ENS, nad_find_attr(), nad_find_elem(), nad_find_namespace(), nad_free(), NAD_NURI, NAD_NURI_L, pkt_st::ns, pkt_ERROR, pkt_free(), pkt_IQ, pkt_IQ_RESULT, pkt_IQ_SET, pkt_MESSAGE, pkt_MESSAGE_CHAT, pkt_MESSAGE_GROUPCHAT, pkt_MESSAGE_HEADLINE, pkt_PRESENCE, pkt_PRESENCE_PROBE, pkt_PRESENCE_UN, pkt_S10N, pkt_S10N_ED, pkt_S10N_UN, pkt_S10N_UNED, pkt_SESS, pkt_SESS_CREATE, pkt_SESS_DELETE, pkt_SESS_END, pkt_SESS_FAILED, pkt_st::pri, pkt_st::rfrom, route_ADV, route_ADV_UN, route_BROADCAST, route_ERROR, route_UNICAST, pkt_st::rto, pkt_st::rtype, sm, pkt_st::sm, pkt_st::to, pkt_st::type, uri_CLIENT, uri_COMPONENT, uri_SESSION, xhash_getx(), sm_st::xmlns, and ZONE.
Referenced by _announce_broadcast_user(), _announce_in_sess(), _iq_private_in_sess(), _offline_in_sess(), _offline_user_delete(), pkt_create(), pres_in(), and sm_sx_callback().
Definition at line 315 of file pkt.c.
References pkt_st::from, jid_free(), log_debug, pkt_st::nad, nad_free(), pkt_st::rfrom, pkt_st::rto, pkt_st::to, and ZONE.
Referenced by _amp_pkt_sm(), _amp_pkt_user(), _announce_pkt_sm(), _deliver_in_sess(), _deliver_pkt_user(), _disco_free(), _disco_generate_packets(), _disco_in_sess(), _disco_pkt_router(), _disco_pkt_sm(), _disco_pkt_sm_populate(), _help_pkt_sm(), _iq_private_in_sess(), _iq_vcard_in_sess(), _iq_vcard_pkt_sm(), _iq_vcard_pkt_user(), _offline_in_sess(), _offline_pkt_user(), _offline_user_delete(), _presence_in_router(), _presence_pkt_sm(), _presence_pkt_user(), _privacy_in_router(), _privacy_in_sess(), _privacy_out_router(), _roster_in_sess(), _roster_in_sess_s10n(), _roster_pkt_user(), _roster_set_item(), _session_in_router(), _vacation_in_sess(), _vacation_pkt_user(), dispatch(), pkt_error(), pkt_new(), pkt_router(), pkt_sess(), pres_deliver(), pres_in(), and pres_update().
SM_API pkt_t pkt_create | ( | sm_t | sm, |
const char * | elem, | ||
const char * | type, | ||
const char * | to, | ||
const char * | from | ||
) |
Definition at line 328 of file pkt.c.
References nad_add_namespace(), nad_append_attr(), nad_append_elem(), nad_new(), pkt_new(), uri_CLIENT, uri_COMPONENT, and uri_SESSION.
Referenced by _amp_pkt_sm(), _announce_pkt_sm(), _disco_agents_result(), _disco_info_result(), _disco_items_result(), _disco_pkt_router(), _disco_pkt_sm(), _echo_pkt_sm(), _help_pkt_sm(), _iq_private_in_sess(), _iq_vcard_in_sess(), _iq_vcard_to_pkt(), _offline_pkt_user(), _presence_pkt_sm(), _privacy_in_sess(), _roster_in_sess(), _roster_in_sess_s10n(), _roster_pkt_user(), _roster_set_item(), _roster_update_walker(), _sess_end_guts(), _status_pkt_sm(), _vacation_in_sess(), _vacation_pkt_user(), amp_build_response_pkt(), dispatch(), pres_in(), pres_probe(), pres_roster(), pres_update(), and sm_storage_rate_limit().
convenience - copy the packet id from src to dest
Definition at line 353 of file pkt.c.
References pkt_st::nad, NAD_AVAL, NAD_AVAL_L, nad_find_attr(), and nad_set_attr().
Referenced by _amp_pkt_sm(), _disco_in_sess(), _disco_pkt_sm(), _iq_private_in_sess(), _iq_vcard_in_sess(), _iq_vcard_pkt_sm(), _iq_vcard_pkt_user(), _privacy_in_sess(), _roster_in_sess(), _vacation_in_sess(), and amp_build_response_pkt().
create an id value for new iq packets
Definition at line 364 of file pkt.c.
References pkt_st::nad, and nad_set_attr().
Referenced by _disco_pkt_router(), _iq_private_in_sess(), _privacy_in_sess(), _roster_in_sess_s10n(), _roster_pkt_user(), _roster_set_item(), and _roster_update_walker().
add an x:delay stamp
Definition at line 508 of file pkt.c.
References datetime_out(), dt_DATETIME, dt_LEGACY, log_debug, pkt_st::nad, nad_add_namespace(), nad_insert_elem(), nad_set_attr(), uri_DELAY, uri_URN_DELAY, and ZONE.
Referenced by _announce_pkt_sm(), _offline_pkt_user(), and pres_update().
Definition at line 379 of file pkt.c.
References jid_st::domain, nad_st::elems, sm_st::id, jid_free(), jid_new(), log_debug, sm_st::mm, mm_out_router(), mod_HANDLED, mod_PASS, pkt_st::nad, nad_find_elem(), nad_find_namespace(), nad_set_attr(), nad_ns_st::next, nad_elem_st::ns, nad_st::nss, pkt_error(), pkt_free(), pkt_router(), pkt_st::rfrom, sm_st::router, pkt_st::rto, pkt_st::sm, sx_nad_write, pkt_st::to, uri_SESSION, and ZONE.
Referenced by _amp_pkt_sm(), _amp_pkt_user(), _announce_broadcast_user(), _announce_in_sess(), _announce_pkt_sm(), _deliver_in_sess(), _disco_pkt_router(), _disco_pkt_sm(), _disco_pkt_user(), _echo_pkt_sm(), _help_pkt_sm(), _iq_last_pkt_sm(), _iq_last_pkt_user(), _iq_ping_pkt_sm(), _iq_time_pkt_sm(), _iq_vcard_pkt_sm(), _iq_vcard_pkt_user(), _iq_version_pkt_sm(), _offline_pkt_user(), _offline_user_delete(), _presence_pkt_sm(), _privacy_in_sess(), _roster_pkt_user(), _roster_set_item(), _status_pkt_sm(), _unblock_jid(), _vacation_pkt_user(), dispatch(), pkt_router(), pkt_sess(), pres_deliver(), pres_in(), pres_probe(), pres_roster(), pres_update(), and sm_storage_rate_limit().
Definition at line 459 of file pkt.c.
References sess_st::c2s, jid_st::domain, sm_st::id, sess_st::jid, jid_free(), jid_full(), jid_new(), log_debug, sm_st::mm, mm_out_sess(), mod_HANDLED, mod_PASS, pkt_st::nad, nad_set_attr(), pkt_error(), pkt_free(), pkt_router(), pkt_st::rfrom, pkt_st::rto, sess_route(), pkt_st::sm, and ZONE.
Referenced by _deliver_pkt_user(), _disco_in_sess(), _iq_ping_in_sess(), _iq_private_in_sess(), _iq_vcard_in_sess(), _offline_in_sess(), _offline_pkt_user(), _presence_pkt_user(), _privacy_in_sess(), _privacy_out_router(), _roster_in_sess(), _roster_push(), _roster_update_walker(), _session_in_router(), _vacation_in_sess(), and pres_in().
see if the jid is trusted (ie in the roster with s10n="from" or "both")
Definition at line 337 of file pres.c.
References item_st::from, user_st::jid, jid_compare_user(), jid_full(), jid_user(), user_st::roster, and xhash_get().
Referenced by _iq_last_pkt_user(), _privacy_in_sess(), _unblock_jid(), pres_deliver(), pres_in(), and pres_update().
send presence based on roster changes
Definition at line 359 of file pres.c.
References sess_st::A, sess_st::available, sess_st::E, item_st::from, item_st::jid, sess_st::jid, jid_full(), jid_search(), log_debug, pkt_create(), pkt_dup(), pkt_router(), sess_st::pres, user_st::sm, sess_st::user, and ZONE.
Referenced by _roster_in_sess_s10n(), _roster_pkt_user(), and _roster_set_item().
presence updates from a session
Definition at line 72 of file pres.c.
References _pres_top(), sess_st::A, sess_st::available, sess_st::E, sess_st::fake, pkt_st::from, item_st::from, item_st::jid, sess_st::jid, jid_free(), jid_full(), jid_search(), jid_user(), log_debug, jid_st::next, sess_st::next, pkt_create(), pkt_delay(), pkt_dup(), pkt_free(), pkt_PRESENCE, pkt_PRESENCE_UN, pkt_router(), sess_st::pres, pres_trust(), pkt_st::pri, sess_st::pri, user_st::roster, user_st::sessions, user_st::sm, item_st::to, pkt_st::type, sess_st::user, xhash_iter_first(), xhash_iter_get(), xhash_iter_next(), and ZONE.
Referenced by _presence_in_sess().
Definition at line 296 of file pres.c.
References sess_st::A, sess_st::E, jid_append(), jid_full(), jid_zap(), log_debug, and ZONE.
Referenced by _presence_pkt_user().
outgoing directed presence
Definition at line 304 of file pres.c.
References sess_st::A, sess_st::E, jid_append(), jid_full(), jid_zap(), log_debug, pkt_free(), pkt_PRESENCE, pkt_PRESENCE_UN, pkt_router(), pres_trust(), pkt_st::to, pkt_st::type, sess_st::user, and ZONE.
Referenced by _presence_in_sess().
presence updates from a remote jid - RFC 3921bis 4.3.2.
Definition at line 212 of file pres.c.
References user_st::available, sess_st::available, sess_st::E, sess_st::fake, pkt_st::from, user_st::jid, sess_st::jid, jid_compare_full(), jid_full(), jid_user(), jid_zap(), log_debug, pkt_st::nad, nad_copy(), nad_set_attr(), sess_st::next, pkt_create(), pkt_dup(), pkt_free(), pkt_new(), pkt_PRESENCE_PROBE, pkt_router(), pkt_sess(), sess_st::pres, pres_trust(), jid_st::resource, user_st::sessions, pkt_st::sm, user_st::sm, sm_st::st, pkt_st::to, pkt_st::type, and ZONE.
Referenced by _presence_pkt_user().
Definition at line 380 of file pres.c.
References item_st::jid, user_st::jid, jid_full(), jid_user(), log_debug, pkt_create(), pkt_router(), user_st::roster, user_st::sm, item_st::to, xhash_iter_first(), xhash_iter_get(), xhash_iter_next(), and ZONE.
send a packet to the client for this session
Definition at line 31 of file sess.c.
References sess_st::c2s, sess_st::c2s_id, jid_st::domain, pkt_st::from, user_st::jid, sess_st::jid, jid_free(), jid_full(), log_debug, pkt_st::nad, nad_append_namespace(), nad_set_attr(), pkt_st::rfrom, sm_st::router, pkt_st::rto, user_st::sm, sess_st::sm_id, sx_nad_write, pkt_st::to, uri_SESSION, sess_st::user, and ZONE.
Referenced by pkt_sess().
Definition at line 103 of file sess.c.
References _sess_end_guts(), sess_st::c2s_id, sm_st::config, config_get(), datetime_out(), jid_st::domain, dt_DATETIME, hex_from_raw(), sm_st::hosts, sess_st::jid, jid_compare_full(), jid_dup(), jid_free(), jid_full(), jid_user(), sm_st::log, log_debug, log_write(), sm_st::mm, mm_sess_start(), sess_st::module_data, sess_st::next, mm_st::nindex, sess_st::p, pmalloco(), pool_cleanup(), pool_free(), pool_new, sess_st::pri, sm_st::sessions, user_st::sessions, sha1_append(), sha1_finish(), sha1_init(), user_st::sm, sm_c2s_action(), sess_st::sm_id, sess_st::user, user_create(), user_load(), xhash_get(), xhash_put(), and ZONE.
Referenced by _session_in_router().
Definition at line 85 of file sess.c.
References _sess_end_guts(), sess_st::jid, jid_full(), jid_user(), sm_st::log, log_debug, log_write(), sm_st::mm, mm_user_unload(), sess_st::p, pool_free(), user_st::sessions, user_st::sm, sess_st::user, user_free(), and ZONE.
Referenced by _session_in_router(), _session_pkt_router(), JABBER_MAIN(), and user_delete().
match a session by resource
Definition at line 206 of file sess.c.
References sess_st::jid, sess_st::next, jid_st::resource, and user_st::sessions.
Referenced by _amp_pkt_user(), _deliver_pkt_user(), _presence_pkt_user(), _privacy_in_router(), and _privacy_out_router().
fetch user data
Definition at line 52 of file user.c.
References _user_alloc(), user_st::jid, jid_user(), log_debug, sm_st::mm, mm_user_load(), user_st::p, pool_free(), sm_st::users, xhash_get(), xhash_put(), and ZONE.
Referenced by _privacy_in_router(), _privacy_out_router(), dispatch(), sess_start(), user_create(), and user_delete().
Definition at line 80 of file user.c.
References user_st::jid, jid_user(), log_debug, user_st::p, pool_free(), user_st::sm, sm_st::users, xhash_zap(), and ZONE.
Referenced by dispatch(), and sess_end().
initialise a user
Definition at line 88 of file user.c.
References jid_st::domain, sm_st::hosts, jid_user(), sm_st::log, log_debug, log_write(), sm_st::mm, mm_user_create(), mm_user_delete(), user_load(), xhash_get(), and ZONE.
Referenced by _session_in_router(), and sess_start().
trash a user
Definition at line 121 of file user.c.
References jid_user(), sm_st::log, log_debug, log_write(), sm_st::mm, mm_user_delete(), sess_st::next, sess_end(), user_st::sessions, sm_c2s_action(), user_load(), and ZONE.
Referenced by _session_in_router().
register a feature
Definition at line 37 of file feature.c.
References sm_st::features, log_debug, pstrdup(), xhash_get(), xhash_pool(), xhash_put(), and ZONE.
Referenced by JABBER_MAIN(), and module_init().
unregister feature
Definition at line 45 of file feature.c.
References sm_st::features, log_debug, xhash_get(), xhash_put(), xhash_zap(), and ZONE.
Referenced by _iq_last_free(), _iq_ping_free(), _iq_private_free(), _iq_time_free(), _iq_vcard_free(), _iq_version_free(), _presence_free(), _privacy_free(), and _vacation_free().
allocate a module manager instance, and loads the modules
Definition at line 47 of file mm.c.
References chain_DISCO_EXTEND, chain_IN_ROUTER, chain_IN_SESS, chain_OUT_ROUTER, chain_OUT_SESS, chain_PKT_ROUTER, chain_PKT_SM, chain_PKT_USER, chain_SESS_END, chain_SESS_START, chain_USER_CREATE, chain_USER_DELETE, chain_USER_LOAD, chain_USER_UNLOAD, sm_st::config, config_get_one(), mm_st::disco_extend, module_st::handle, mm_st::in_router, mm_st::in_sess, module_st::index, module_st::init, sm_st::log, log_debug, log_write(), module_st::mm, module_st::module_init_fn, mm_st::modules, config_st::nad, NAD_AVAL, NAD_AVAL_L, NAD_CDATA, NAD_CDATA_L, nad_find_attr(), nad_find_elem(), module_st::name, mm_st::ndisco_extend, mm_st::nin_router, mm_st::nin_sess, mm_st::nindex, mm_st::nout_router, mm_st::nout_sess, mm_st::npkt_router, mm_st::npkt_sm, mm_st::npkt_user, mm_st::nsess_end, mm_st::nsess_start, mm_st::nuser_create, mm_st::nuser_delete, mm_st::nuser_load, mm_st::nuser_unload, mm_st::out_router, mm_st::out_sess, PATH_MAX, mm_st::pkt_router, mm_st::pkt_sm, mm_st::pkt_user, mm_st::sess_end, mm_st::sess_start, sm, mm_st::sm, mm_st::user_create, mm_st::user_delete, mm_st::user_load, mm_st::user_unload, xhash_get(), xhash_new(), xhash_put(), xhash_zap(), and ZONE.
Referenced by _sm_signal_hup(), and JABBER_MAIN().
free a mm instance
Definition at line 291 of file mm.c.
References _mm_reaper(), mm_st::disco_extend, mm_st::in_router, mm_st::in_sess, mm_st::modules, mm_st::ndisco_extend, mm_st::nin_router, mm_st::nin_sess, mm_st::nout_router, mm_st::nout_sess, mm_st::npkt_router, mm_st::npkt_sm, mm_st::npkt_user, mm_st::nsess_end, mm_st::nsess_start, mm_st::nuser_create, mm_st::nuser_delete, mm_st::nuser_load, mm_st::out_router, mm_st::out_sess, mm_st::pkt_router, mm_st::pkt_sm, mm_st::pkt_user, mm_st::sess_end, mm_st::sess_start, mm_st::user_create, mm_st::user_delete, mm_st::user_load, xhash_free(), and xhash_walk().
Referenced by _sm_signal_hup(), and JABBER_MAIN().
fire sess-start chain
fire sess-start chain
Definition at line 384 of file mm.c.
References log_debug, mod_instance_st::mod, module_st::name, mm_st::nsess_start, mm_st::sess_start, module_st::sess_start, and ZONE.
Referenced by sess_start().
fire sess-end chain
fire sess-end chain
Definition at line 415 of file mm.c.
References log_debug, mod_instance_st::mod, module_st::name, mm_st::nsess_end, mm_st::sess_end, module_st::sess_end, and ZONE.
Referenced by _sess_end_guts().
fire in-sess chain
fire in-sess chain
Definition at line 441 of file mm.c.
References mm_st::in_sess, module_st::in_sess, log_debug, mod_instance_st::mod, mod_PASS, module_st::name, mm_st::nin_sess, and ZONE.
Referenced by _sess_end_guts(), and _session_in_router().
fire in-router chain
fire in-router chain
Definition at line 473 of file mm.c.
References mm_st::in_router, module_st::in_router, log_debug, mod_instance_st::mod, mod_PASS, module_st::name, mm_st::nin_router, and ZONE.
Referenced by dispatch().
fire out-sess chain
fire out-sess chain
Definition at line 505 of file mm.c.
References log_debug, mod_instance_st::mod, mod_PASS, module_st::name, mm_st::nout_sess, mm_st::out_sess, module_st::out_sess, and ZONE.
Referenced by pkt_sess().
fire out-router chain
fire out-router chain
Definition at line 536 of file mm.c.
References log_debug, mod_instance_st::mod, mod_PASS, module_st::name, mm_st::nout_router, mm_st::out_router, module_st::out_router, and ZONE.
Referenced by pkt_router().
fire pkt-sm chain
fire pkt-sm chain
Definition at line 567 of file mm.c.
References log_debug, mod_instance_st::mod, mod_PASS, module_st::name, mm_st::npkt_sm, mm_st::pkt_sm, module_st::pkt_sm, and ZONE.
Referenced by dispatch().
fire pkt-user chain
fire pkt-user chain
Definition at line 597 of file mm.c.
References log_debug, mod_instance_st::mod, mod_PASS, module_st::name, mm_st::npkt_user, mm_st::pkt_user, module_st::pkt_user, and ZONE.
Referenced by dispatch().
fire pkt-router chain
fire pkt-router chain
Definition at line 628 of file mm.c.
References log_debug, mod_instance_st::mod, mod_PASS, module_st::name, mm_st::npkt_router, mm_st::pkt_router, module_st::pkt_router, and ZONE.
Referenced by dispatch().
fire user-load chain
fire user-load chain
Definition at line 659 of file mm.c.
References log_debug, mod_instance_st::mod, module_st::name, mm_st::nuser_load, mm_st::user_load, module_st::user_load, and ZONE.
Referenced by user_load().
fire user-unload chain
fire user-unload chain
Definition at line 690 of file mm.c.
References log_debug, mod_instance_st::mod, module_st::name, mm_st::nuser_unload, mm_st::user_unload, module_st::user_unload, and ZONE.
Referenced by sess_end().
fire user-create chain
fire user-create chain
Definition at line 721 of file mm.c.
References log_debug, mod_instance_st::mod, module_st::name, mm_st::nuser_create, mm_st::user_create, module_st::user_create, and ZONE.
Referenced by user_create().
fire user-delete chain
fire user-delete chain
Definition at line 752 of file mm.c.
References log_debug, mod_instance_st::mod, module_st::name, mm_st::nuser_delete, mm_st::user_delete, module_st::user_delete, and ZONE.
Referenced by user_create(), and user_delete().
fire disco-extend chain
fire disco-extend chain
Definition at line 778 of file mm.c.
References mm_st::disco_extend, module_st::disco_extend, log_debug, mod_instance_st::mod, module_st::name, mm_st::ndisco_extend, and ZONE.
Referenced by _disco_info_result().
sig_atomic_t sm_lost_router |
Definition at line 30 of file sm.c.
Referenced by _sm_router_connect(), _sm_signal(), JABBER_MAIN(), and sm_mio_callback().