jabberd2
2.7.0
|
#include "ac-stdint.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <time.h>
#include <errno.h>
#include <assert.h>
#include <expat.h>
#include <ctype.h>
#include "util/util_compat.h"
#include "sha1.h"
#include "md5.h"
#include <util/nad.h>
#include <util/pool.h>
#include <util/xhash.h>
#include "util/uri.h"
#include "util/jid.h"
#include "inaddr.h"
#include "xdata.h"
Go to the source code of this file.
Data Structures | |
struct | spool_node |
struct | spool_struct |
struct | log_st |
struct | log_facility_st |
struct | config_st |
holder for the config hash and nad More... | |
struct | config_elem_st |
a single element More... | |
struct | access_rule_st |
struct | access_st |
struct | rate_st |
struct | _jqueue_node_st |
struct | _jqueue_st |
struct | _stanza_error_st |
Typedefs | |
typedef struct spool_struct * | spool |
typedef struct log_st * | log_t |
typedef struct log_facility_st | log_facility_t |
typedef struct config_elem_st * | config_elem_t |
typedef struct config_st * | config_t |
typedef struct access_rule_st * | access_rule_t |
typedef struct access_st * | access_t |
typedef struct rate_st * | rate_t |
typedef struct _jqueue_node_st * | _jqueue_node_t |
typedef struct _jqueue_st * | jqueue_t |
typedef struct _stanza_error_st * | stanza_error_t |
typedef void | jsighandler_t(int) |
Enumerations | |
enum | log_type_t { log_STDOUT, log_SYSLOG, log_FILE, log_STDOUT, log_SYSLOG, log_FILE } |
enum | datetime_t { dt_DATE = 1, dt_TIME = 2, dt_DATETIME = 3, dt_LEGACY = 4, dt_DATE = 1, dt_TIME = 2, dt_DATETIME = 3, dt_LEGACY = 4 } |
Functions | |
JABBERD2_API char * | j_strdup (const char *str) |
More... | |
JABBERD2_API char * | j_strcat (char *dest, const char *txt) |
JABBERD2_API int | j_strcmp (const char *a, const char *b) |
JABBERD2_API int | j_strcasecmp (const char *a, const char *b) |
JABBERD2_API int | j_strncmp (const char *a, const char *b, int i) |
JABBERD2_API int | j_strncasecmp (const char *a, const char *b, int i) |
JABBERD2_API int | j_strlen (const char *a) |
JABBERD2_API int | j_atoi (const char *a, int def) |
JABBERD2_API char * | j_attr (const char **atts, const char *attr) |
JABBERD2_API char * | j_strnchr (const char *s, int c, int n) |
like strchr, but only searches n chars More... | |
JABBERD2_API void | shahash_r (const char *str, char hashbuf[41]) |
old convenience function, now in str.c More... | |
JABBERD2_API void | shahash_raw (const char *str, unsigned char hashval[20]) |
JABBERD2_API char * | strescape (pool_t p, const char *buf, int len) |
JABBERD2_API char * | strunescape (pool_t p, char *buf) |
JABBERD2_API spool | spool_new (pool_t p) |
JABBERD2_API void | spooler (spool s,...) |
JABBERD2_API const char * | spool_print (spool s) |
JABBERD2_API void | spool_add (spool s, const char *str) |
JABBERD2_API void | spool_escape (spool s, const char *raw, int len) |
JABBERD2_API const char * | spools (pool_t p,...) |
convenience :) More... | |
JABBERD2_API log_t | log_new (log_type_t type, const char *ident, const char *facility) |
JABBERD2_API void | log_write (log_t log, int level, const char *msgfmt,...) |
JABBERD2_API void | log_free (log_t log) |
JABBERD2_API config_t | config_new (void) |
new config structure More... | |
JABBERD2_API int | config_load (config_t c, const char *file) |
turn an xml file into a config hash More... | |
JABBERD2_API int | config_load_with_id (config_t c, const char *file, const char *id) |
turn an xml file into a config hash More... | |
JABBERD2_API config_elem_t | config_get (config_t c, const char *key) |
get the config element for this key More... | |
JABBERD2_API const char * | config_get_one (config_t c, const char *key, int num) |
get config value n for this key More... | |
JABBERD2_API const char * | config_get_one_default (config_t c, const char *key, int num, const char *default_value) |
get config value n for this key, returns default_value if not found More... | |
JABBERD2_API int | config_count (config_t c, const char *key) |
how many values for this key? More... | |
JABBERD2_API char * | config_get_attr (config_t c, const char *key, int num, const char *attr) |
get an attr for this value More... | |
JABBERD2_API char * | config_expand (config_t c, const char *value) |
JABBERD2_API void | config_free (config_t) |
Replaces $(some.value) with config_get_one(c, "some.value", 0) More... | |
JABBERD2_API access_t | access_new (int order) |
JABBERD2_API void | access_free (access_t access) |
JABBERD2_API int | access_allow (access_t access, const char *ip, const char *mask) |
JABBERD2_API int | access_deny (access_t access, const char *ip, const char *mask) |
JABBERD2_API int | access_check (access_t access, const char *ip) |
JABBERD2_API rate_t | rate_new (int total, int seconds, int wait) |
JABBERD2_API void | rate_free (rate_t rt) |
JABBERD2_API void | rate_reset (rate_t rt) |
JABBERD2_API void | rate_add (rate_t rt, int count) |
Add a number of events to the counter. More... | |
JABBERD2_API int | rate_left (rate_t rt) |
JABBERD2_API int | rate_check (rate_t rt) |
JABBERD2_API int | ser_string_get (char **dest, int *source, const char *buf, int len) |
JABBERD2_API int | ser_int_get (int *dest, int *source, const char *buf, int len) |
JABBERD2_API void | ser_string_set (const char *source, int *dest, char **buf, int *len) |
JABBERD2_API void | ser_int_set (int source, int *dest, char **buf, int *len) |
JABBERD2_API jqueue_t | jqueue_new (void) |
JABBERD2_API void | jqueue_free (jqueue_t q) |
JABBERD2_API void | jqueue_push (jqueue_t q, void *data, int pri) |
JABBERD2_API void * | jqueue_pull (jqueue_t q) |
JABBERD2_API int | jqueue_size (jqueue_t q) |
JABBERD2_API time_t | jqueue_age (jqueue_t q) |
JABBERD2_API time_t | datetime_in (char *date) |
JABBERD2_API void | datetime_out (time_t t, datetime_t type, char *date, int datelen) |
JABBERD2_API int | apr_base64_decode_len (const char *bufcoded, int buflen) |
JABBERD2_API int | apr_base64_decode (char *bufplain, const char *bufcoded, int buflen) |
JABBERD2_API int | apr_base64_encode_len (int len) |
JABBERD2_API int | apr_base64_encode (char *encoded, const char *string, int len) |
JABBERD2_API char * | b64_encode (char *buf, int len) |
JABBERD2_API char * | b64_decode (char *buf) |
JABBERD2_API nad_t | stanza_error (nad_t nad, int elem, int err) |
error the packet More... | |
JABBERD2_API nad_t | stanza_tofrom (nad_t nad, int elem) |
flip the to and from attributes on this elem More... | |
JABBERD2_API void | hex_from_raw (const unsigned char *in, int inlen, char *out) |
turn raw into hex - out must be (inlen*2)+1 More... | |
JABBERD2_API int | hex_to_raw (const char *in, int inlen, char *out) |
turn hex into raw - out must be (inlen/2) More... | |
JABBERD2_API int | get_debug_flag (void) |
JABBERD2_API void | set_debug_flag (int v) |
JABBERD2_API void | debug_log (const char *file, int line, const char *msgfmt,...) |
JABBERD2_API void | set_debug_file (const char *filename) |
JABBERD2_API void | set_debug_log_from_config (config_t c) |
JABBERD2_API jsighandler_t * | jabber_signal (int signo, jsighandler_t *func) |
Variables | |
JABBERD2_API struct _stanza_error_st | _stanza_errors [] |
#define PATH_MAX 512 |
Definition at line 69 of file util.h.
Referenced by authreg_init(), and mm_new().
#define stanza_err_BAD_REQUEST (100) |
Definition at line 367 of file util.h.
Referenced by _authreg_auth_get(), _authreg_auth_set(), _authreg_register_set(), _c2s_client_sx_callback(), _disco_pkt_sm_populate(), _iq_private_in_sess(), _privacy_in_sess(), _roster_in_sess(), _roster_in_sess_s10n(), _router_comp_write(), _router_process_route(), _vacation_in_sess(), _validate_in_sess(), authreg_process(), dispatch(), filter_load(), s2s_router_sx_callback(), and stanza_error().
#define stanza_err_CONFLICT (101) |
Definition at line 368 of file util.h.
Referenced by _authreg_register_set().
#define stanza_err_FEATURE_NOT_IMPLEMENTED (102) |
Definition at line 369 of file util.h.
Referenced by _announce_pkt_sm(), _deliver_in_sess(), _iq_last_pkt_user(), _iq_private_in_sess(), _iq_vcard_in_sess(), _iq_vcard_pkt_sm(), _iq_vcard_pkt_user(), _privacy_in_router(), _session_in_router(), and dispatch().
#define stanza_err_FORBIDDEN (103) |
Definition at line 370 of file util.h.
Referenced by _announce_pkt_sm(), _authreg_auth_get(), _authreg_auth_set(), _iq_last_pkt_user(), _iq_vcard_pkt_sm(), and _iq_vcard_pkt_user().
#define stanza_err_INTERNAL_SERVER_ERROR (105) |
Definition at line 372 of file util.h.
Referenced by _announce_pkt_sm(), _authreg_auth_get(), _authreg_register_set(), _iq_last_pkt_user(), _iq_private_in_sess(), _iq_vcard_in_sess(), _iq_vcard_pkt_sm(), _iq_vcard_pkt_user(), _offline_pkt_user(), _privacy_in_sess(), _vacation_in_sess(), and c2s_router_sx_callback().
#define stanza_err_ITEM_NOT_FOUND (106) |
Definition at line 373 of file util.h.
Referenced by _c2s_client_sx_callback(), _disco_pkt_sm(), _iq_vcard_pkt_sm(), _offline_user_delete(), and _privacy_in_sess().
#define stanza_err_JID_MALFORMED (107) |
Definition at line 374 of file util.h.
Referenced by _authreg_auth_get(), _authreg_auth_set(), and _authreg_register_set().
#define stanza_err_NOT_ACCEPTABLE (108) |
Definition at line 375 of file util.h.
Referenced by _privacy_out_router(), and _roster_in_sess_s10n().
#define stanza_err_NOT_ALLOWED (109) |
Definition at line 376 of file util.h.
Referenced by _authreg_auth_get(), _authreg_auth_set(), _authreg_register_get(), _authreg_register_set(), _disco_in_sess(), _disco_pkt_sm(), _disco_pkt_sm_populate(), authreg_process(), and filter_load().
#define stanza_err_REDIRECT (112) |
Definition at line 379 of file util.h.
Referenced by _router_process_route(), and filter_load().
#define stanza_err_REMOTE_SERVER_NOT_FOUND (114) |
Definition at line 381 of file util.h.
Referenced by _s2s_time_checks(), dispatch(), out_resolve(), and s2s_router_sx_callback().
#define stanza_err_REMOTE_SERVER_TIMEOUT (115) |
Definition at line 382 of file util.h.
Referenced by _out_mio_callback(), and _s2s_time_checks().
#define stanza_err_RESOURCE_CONSTRAINT (116) |
Definition at line 383 of file util.h.
Referenced by _iq_vcard_in_sess(), _iq_vcard_pkt_user(), _roster_in_sess_s10n(), and _roster_pkt_user().
#define stanza_err_SERVICE_UNAVAILABLE (117) |
Definition at line 384 of file util.h.
Referenced by _deliver_pkt_user(), _iq_last_pkt_user(), _iq_vcard_pkt_user(), _offline_pkt_user(), _out_mio_callback(), _out_result(), _router_comp_write(), dispatch(), JABBER_MAIN(), and out_packet().
#define stanza_err_OLD_UNAUTH (121) |
Definition at line 388 of file util.h.
Referenced by _authreg_auth_get(), _authreg_auth_set(), and _authreg_register_set().
#define stanza_err_UNKNOWN_SENDER (122) |
Definition at line 389 of file util.h.
Referenced by _c2s_client_sx_callback().
#define stanza_err_LAST (123) |
Definition at line 390 of file util.h.
Referenced by stanza_error().
#define MAX_DEBUG 8192 |
Definition at line 422 of file util.h.
Referenced by __sx_debug().
#define JABBER_MAIN | ( | name, | |
display, | |||
description, | |||
depends | |||
) | int main(int argc, char** argv) |
typedef struct spool_struct * spool |
typedef struct log_facility_st log_facility_t |
typedef struct config_elem_st* config_elem_t |
typedef struct access_rule_st * access_rule_t |
typedef struct _jqueue_node_st* _jqueue_node_t |
typedef struct _jqueue_st * jqueue_t |
typedef struct _stanza_error_st * stanza_error_t |
enum log_type_t |
enum datetime_t |
JABBERD2_API char* j_strdup | ( | const char * | str | ) |
JABBERD2_API char* j_strcat | ( | char * | dest, |
const char * | txt | ||
) |
Definition at line 32 of file str.c.
Referenced by spool_print().
JABBERD2_API int j_strcmp | ( | const char * | a, |
const char * | b | ||
) |
Definition at line 43 of file str.c.
Referenced by _sx_websocket_rio(), and j_attr().
JABBERD2_API int j_strcasecmp | ( | const char * | a, |
const char * | b | ||
) |
JABBERD2_API int j_strncmp | ( | const char * | a, |
const char * | b, | ||
int | i | ||
) |
JABBERD2_API int j_strncasecmp | ( | const char * | a, |
const char * | b, | ||
int | i | ||
) |
JABBERD2_API int j_strlen | ( | const char * | a | ) |
Definition at line 79 of file str.c.
Referenced by _sx_websocket_http_return(), and _sx_websocket_rio().
JABBERD2_API int j_atoi | ( | const char * | a, |
int | def | ||
) |
Definition at line 87 of file str.c.
Referenced by _access_calc_netsize(), _c2s_config_expand(), _c2s_hosts_expand(), _roster_in_sess(), _router_config_expand(), _s2s_config_expand(), _s2s_hosts_expand(), _sm_config_expand(), _sx_websocket_rio(), and module_init().
JABBERD2_API char* j_attr | ( | const char ** | atts, |
const char * | attr | ||
) |
Definition at line 95 of file str.c.
References j_strcmp().
Referenced by _c2s_config_expand(), _c2s_hosts_expand(), _router_config_expand(), _s2s_hosts_expand(), _sm_config_expand(), config_get_attr(), and JABBER_MAIN().
JABBERD2_API char* j_strnchr | ( | const char * | s, |
int | c, | ||
int | n | ||
) |
JABBERD2_API void shahash_r | ( | const char * | str, |
char | hashbuf[41] | ||
) |
old convenience function, now in str.c
old convenience function, now in str.c
Definition at line 358 of file str.c.
References hex_from_raw(), and shahash_raw().
Referenced by _authreg_auth_set(), _pbx_process_command(), _router_process_handshake(), _sm_generate_id(), jid_random_part(), and s2s_db_key().
JABBERD2_API void shahash_raw | ( | const char * | str, |
unsigned char | hashval[20] | ||
) |
Definition at line 364 of file str.c.
References sha1_hash().
Referenced by _router_process_route(), and shahash_r().
JABBERD2_API char* strescape | ( | pool_t | p, |
const char * | buf, | ||
int | len | ||
) |
JABBERD2_API char* strunescape | ( | pool_t | p, |
char * | buf | ||
) |
Definition at line 238 of file str.c.
References pmalloc().
Referenced by _sx_websocket_http_header_field().
JABBERD2_API spool spool_new | ( | pool_t | p | ) |
Definition at line 119 of file str.c.
References spool_struct::first, spool_struct::last, spool_struct::len, spool_struct::p, and pmalloc().
Referenced by _sx_websocket_http_header_field(), _sx_websocket_http_header_value(), _sx_websocket_new(), and spools().
JABBERD2_API void spooler | ( | spool | s, |
... | |||
) |
Definition at line 163 of file str.c.
References spool_add().
JABBERD2_API const char* spool_print | ( | spool | s | ) |
Definition at line 186 of file str.c.
References spool_node::c, spool_struct::first, j_strcat(), spool_struct::len, spool_node::next, spool_struct::p, and pmalloc().
Referenced by _sx_websocket_http_header_field(), and spools().
JABBERD2_API void spool_add | ( | spool | s, |
const char * | str | ||
) |
Definition at line 147 of file str.c.
References _spool_add(), spool_struct::p, and pstrdup().
JABBERD2_API void spool_escape | ( | spool | s, |
const char * | raw, | ||
int | len | ||
) |
Definition at line 155 of file str.c.
References _spool_add(), spool_struct::p, and strescape().
Referenced by _sx_websocket_http_header_field(), and _sx_websocket_http_header_value().
JABBERD2_API const char* spools | ( | pool_t | p, |
... | |||
) |
convenience :)
Definition at line 209 of file str.c.
References spool_add(), spool_new(), and spool_print().
JABBERD2_API log_t log_new | ( | log_type_t | type, |
const char * | ident, | ||
const char * | facility | ||
) |
Definition at line 69 of file log.c.
References _log_facility(), log_STDOUT, and log_SYSLOG.
Referenced by JABBER_MAIN().
JABBERD2_API void log_write | ( | log_t | log, |
int | level, | ||
const char * | msgfmt, | ||
... | |||
) |
Definition at line 104 of file log.c.
References _log_level, get_debug_flag(), log_STDOUT, log_SYSLOG, and MAX_LOG_LINE.
Referenced by _authreg_auth_log(), _authreg_auth_set(), _authreg_register_set(), _c2s_client_accept_check(), _c2s_client_mio_callback(), _c2s_client_sx_callback(), _c2s_config_expand(), _c2s_hosts_expand(), _c2s_pidfile(), _c2s_router_connect(), _c2s_sx_sasl_callback(), _c2s_time_checks(), _dns_result_a(), _help_pkt_sm(), _in_packet(), _in_result(), _in_sx_callback(), _in_verify(), _out_dialback(), _out_mio_callback(), _out_result(), _out_sx_callback(), _out_verify(), _pbx_open_pipe(), _pbx_process_command(), _roster_publish_user_load(), _route_add(), _router_accept_check(), _router_pidfile(), _router_process_bind(), _router_process_route(), _router_process_throttle(), _router_process_unbind(), _router_route_unbind_walker(), _router_sx_callback(), _s2s_check_conn_routes(), _s2s_config_expand(), _s2s_hosts_expand(), _s2s_pidfile(), _s2s_router_connect(), _s2s_time_checks(), _sm_hosts_expand(), _sm_pidfile(), _sm_router_connect(), _template_roster_reload(), authreg_init(), c2s_pbx_init(), c2s_router_mio_callback(), c2s_router_sx_callback(), check_code(), dns_resolve_domain(), filter_load(), filter_packet(), in_mio_callback(), JABBER_MAIN(), message_log(), mm_new(), out_packet(), out_resolve(), out_route(), pkt_new(), pres_update(), router_mio_callback(), s2s_domain_in_whitelist(), s2s_router_mio_callback(), s2s_router_sx_callback(), send_email(), sess_end(), sess_start(), sm_mio_callback(), sm_storage_rate_limit(), sm_sx_callback(), user_create(), user_delete(), and user_table_load().
JABBERD2_API void log_free | ( | log_t | log | ) |
Definition at line 174 of file log.c.
References log_FILE, and log_SYSLOG.
Referenced by JABBER_MAIN().
JABBERD2_API config_t config_new | ( | void | ) |
new config structure
Definition at line 25 of file config.c.
References config_st::hash, and xhash_new().
Referenced by JABBER_MAIN().
JABBERD2_API int config_load | ( | config_t | c, |
const char * | file | ||
) |
turn an xml file into a config hash
Definition at line 74 of file config.c.
References config_load_with_id().
Referenced by JABBER_MAIN().
JABBERD2_API int config_load_with_id | ( | config_t | c, |
const char * | file, | ||
const char * | id | ||
) |
turn an xml file into a config hash
Definition at line 80 of file config.c.
References _config_charData(), _config_endElement(), _config_expandx(), _config_startElement(), nad_elem_st::attr, config_elem_st::attrs, build_data::depth, nad_elem_st::depth, config_st::hash, nad_elem_st::iname, nad_elem_st::lname, build_data::nad, config_st::nad, NAD_ANAME, NAD_ANAME_L, NAD_AVAL, NAD_AVAL_L, NAD_CDATA, NAD_CDATA_L, nad_free(), nad_new(), config_elem_st::nvalues, build_data::p, pmalloc(), pmalloco(), pstrdup(), pstrdupx(), config_elem_st::values, xhash_get(), xhash_pool(), and xhash_put().
Referenced by config_load(), and JABBER_MAIN().
JABBERD2_API config_elem_t config_get | ( | config_t | c, |
const char * | key | ||
) |
get the config element for this key
Definition at line 272 of file config.c.
References config_st::hash, and xhash_get().
Referenced by _c2s_config_expand(), _c2s_hosts_expand(), _c2s_sx_sasl_callback(), _help_disco_extend(), _router_config_expand(), _s2s_config_expand(), _s2s_hosts_expand(), _sm_config_expand(), _sm_hosts_expand(), JABBER_MAIN(), module_init(), and sess_start().
JABBERD2_API const char* config_get_one | ( | config_t | c, |
const char * | key, | ||
int | num | ||
) |
get config value n for this key
Definition at line 278 of file config.c.
References config_st::hash, config_elem_st::nvalues, config_elem_st::values, and xhash_get().
Referenced by _c2s_config_expand(), _c2s_pidfile(), _config_expandx(), _router_config_expand(), _router_pidfile(), _s2s_config_expand(), _s2s_pidfile(), _sm_config_expand(), _sm_pidfile(), authreg_init(), config_get_one_default(), filter_load(), mm_new(), module_init(), and user_table_load().
JABBERD2_API const char* config_get_one_default | ( | config_t | c, |
const char * | key, | ||
int | num, | ||
const char * | default_value | ||
) |
get config value n for this key, returns default_value if not found
Definition at line 292 of file config.c.
References config_get_one().
JABBERD2_API int config_count | ( | config_t | c, |
const char * | key | ||
) |
how many values for this key?
Definition at line 304 of file config.c.
References config_st::hash, config_elem_st::nvalues, and xhash_get().
Referenced by _s2s_config_expand().
JABBERD2_API char* config_get_attr | ( | config_t | c, |
const char * | key, | ||
int | num, | ||
const char * | attr | ||
) |
get an attr for this value
Definition at line 315 of file config.c.
References nad_elem_st::attr, config_elem_st::attrs, config_st::hash, j_attr(), config_elem_st::nvalues, and xhash_get().
Referenced by _c2s_config_expand(), _router_config_expand(), _s2s_config_expand(), and _sm_config_expand().
JABBERD2_API char* config_expand | ( | config_t | c, |
const char * | value | ||
) |
Definition at line 334 of file config.c.
References _config_expandx().
JABBERD2_API void config_free | ( | config_t | c | ) |
Replaces $(some.value) with config_get_one(c, "some.value", 0)
Replaces $(some.value) with config_get_one(c, "some.value", 0)
Definition at line 411 of file config.c.
References _config_reaper(), config_st::hash, config_st::nad, nad_free(), xhash_free(), and xhash_walk().
Referenced by JABBER_MAIN().
JABBERD2_API access_t access_new | ( | int | order | ) |
Definition at line 26 of file access.c.
References access_st::order.
Referenced by _c2s_config_expand(), and _router_config_expand().
JABBERD2_API void access_free | ( | access_t | access | ) |
Definition at line 35 of file access.c.
References access_st::allow, and access_st::deny.
Referenced by JABBER_MAIN().
JABBERD2_API int access_allow | ( | access_t | access, |
const char * | ip, | ||
const char * | mask | ||
) |
Definition at line 164 of file access.c.
References _access_calc_netsize(), access_st::allow, access_rule_st::ip, j_inet_pton(), access_rule_st::mask, access_st::nallow, and sockaddr_storage::ss_family.
Referenced by _c2s_config_expand(), and _router_config_expand().
JABBERD2_API int access_deny | ( | access_t | access, |
const char * | ip, | ||
const char * | mask | ||
) |
Definition at line 184 of file access.c.
References _access_calc_netsize(), access_st::deny, access_rule_st::ip, j_inet_pton(), access_rule_st::mask, access_st::ndeny, and sockaddr_storage::ss_family.
Referenced by _c2s_config_expand(), and _router_config_expand().
JABBERD2_API int access_check | ( | access_t | access, |
const char * | ip | ||
) |
Definition at line 204 of file access.c.
References _access_check_match(), access_st::allow, access_st::deny, j_inet_pton(), access_st::nallow, access_st::ndeny, and access_st::order.
Referenced by _c2s_client_accept_check(), and _router_accept_check().
JABBERD2_API rate_t rate_new | ( | int | total, |
int | seconds, | ||
int | wait | ||
) |
Definition at line 25 of file rate.c.
References rate_st::seconds, rate_st::total, and rate_st::wait.
Referenced by _c2s_client_accept_check(), _c2s_client_mio_callback(), _router_accept_check(), router_mio_callback(), and sm_storage_rate_limit().
JABBERD2_API void rate_free | ( | rate_t | rt | ) |
Definition at line 36 of file rate.c.
Referenced by _c2s_client_accept_check(), JABBER_MAIN(), router_mio_callback(), and sm_storage_rate_limit().
JABBERD2_API void rate_reset | ( | rate_t | rt | ) |
Definition at line 41 of file rate.c.
References rate_st::bad, rate_st::count, and rate_st::time.
Referenced by rate_add(), and rate_check().
JABBERD2_API void rate_add | ( | rate_t | rt, |
int | count | ||
) |
Add a number of events to the counter.
This takes care of moving the sliding window, if we've moved outside the previous window.
Definition at line 48 of file rate.c.
References rate_st::bad, rate_st::count, rate_reset(), rate_st::seconds, rate_st::time, and rate_st::total.
Referenced by _c2s_client_accept_check(), _c2s_client_sx_callback(), _router_accept_check(), _router_sx_callback(), and sm_storage_rate_limit().
JABBERD2_API int rate_left | ( | rate_t | rt | ) |
Definition at line 69 of file rate.c.
References rate_st::bad, rate_st::count, and rate_st::total.
Referenced by _c2s_client_sx_callback(), and _router_sx_callback().
JABBERD2_API int rate_check | ( | rate_t | rt | ) |
Definition at line 78 of file rate.c.
References rate_st::bad, rate_st::count, rate_reset(), rate_st::time, rate_st::total, and rate_st::wait.
Referenced by _c2s_client_accept_check(), _c2s_client_sx_callback(), _c2s_time_checks(), _router_accept_check(), _router_sx_callback(), and sm_storage_rate_limit().
JABBERD2_API int ser_string_get | ( | char ** | dest, |
int * | source, | ||
const char * | buf, | ||
int | len | ||
) |
JABBERD2_API int ser_int_get | ( | int * | dest, |
int * | source, | ||
const char * | buf, | ||
int | len | ||
) |
JABBERD2_API void ser_string_set | ( | const char * | source, |
int * | dest, | ||
char ** | buf, | ||
int * | len | ||
) |
JABBERD2_API void ser_int_set | ( | int | source, |
int * | dest, | ||
char ** | buf, | ||
int * | len | ||
) |
JABBERD2_API jqueue_t jqueue_new | ( | void | ) |
Definition at line 25 of file jqueue.c.
References _jqueue_st::init_time, _jqueue_st::p, pmalloco(), and pool_new.
Referenced by _out_packet_queue(), _router_process_throttle(), _sx_ssl_client(), _sx_ssl_server(), JABBER_MAIN(), and sx_new().
JABBERD2_API void jqueue_free | ( | jqueue_t | q | ) |
Definition at line 38 of file jqueue.c.
References _jqueue_st::p, and pool_free().
Referenced by _router_process_throttle(), _sx_ssl_free(), JABBER_MAIN(), out_bounce_route_queue(), out_flush_route_queue(), router_mio_callback(), and sx_free().
JABBERD2_API void jqueue_push | ( | jqueue_t | q, |
void * | data, | ||
int | pri | ||
) |
Definition at line 44 of file jqueue.c.
References _jqueue_st::back, _jqueue_st::cache, _jqueue_node_st::data, _jqueue_st::front, _jqueue_node_st::next, _jqueue_st::p, pmalloc(), _jqueue_node_st::prev, _jqueue_node_st::priority, and _jqueue_st::size.
Referenced by _c2s_client_mio_callback(), _out_mio_callback(), _out_packet_queue(), _pbx_process_command(), _route_remove(), _router_comp_write(), _router_sx_callback(), _sx_ack_process(), _sx_close(), _sx_compress_process(), _sx_element_end(), _sx_error(), _sx_error_extended(), _sx_get_pending_write(), _sx_nad_write(), _sx_process_read(), _sx_raw_write(), _sx_server_element_start(), _sx_server_notify_header(), _sx_ssl_process(), _sx_ssl_wio(), _sx_websocket_http_return(), in_mio_callback(), libwebsock_send_fragment(), router_mio_callback(), sx_client_init(), sx_compress_client_compress(), and sx_ssl_client_starttls().
JABBERD2_API void* jqueue_pull | ( | jqueue_t | q | ) |
Definition at line 96 of file jqueue.c.
References _jqueue_st::back, _jqueue_st::cache, _jqueue_node_st::data, _jqueue_st::front, _jqueue_node_st::next, _jqueue_node_st::prev, and _jqueue_st::size.
Referenced by _router_process_throttle(), _sx_get_pending_write(), _sx_process_read(), _sx_ssl_free(), _sx_ssl_wio(), JABBER_MAIN(), out_bounce_route_queue(), out_flush_route_queue(), and sx_free().
JABBERD2_API int jqueue_size | ( | jqueue_t | q | ) |
Definition at line 126 of file jqueue.c.
References _jqueue_st::size.
Referenced by _out_mio_callback(), _s2s_time_checks(), _sx_get_pending_write(), _sx_server_notify_header(), _sx_ssl_rio(), _sx_ssl_wio(), JABBER_MAIN(), and out_flush_route_queue().
JABBERD2_API time_t jqueue_age | ( | jqueue_t | q | ) |
Definition at line 130 of file jqueue.c.
References _jqueue_st::init_time.
Referenced by _out_mio_callback().
JABBERD2_API time_t datetime_in | ( | char * | date | ) |
Definition at line 34 of file datetime.c.
References DT_DATETIME_M, DT_DATETIME_P, DT_DATETIME_Z, DT_LEGACY, DT_TIME_M, DT_TIME_P, and DT_TIME_Z.
Referenced by _amp_pkt_user(), _offline_in_sess(), _offline_user_delete(), and _vacation_in_sess().
JABBERD2_API void datetime_out | ( | time_t | t, |
datetime_t | type, | ||
char * | date, | ||
int | datelen | ||
) |
Definition at line 114 of file datetime.c.
References dt_DATE, dt_DATETIME, dt_LEGACY, and dt_TIME.
Referenced by _iq_time_pkt_sm(), _vacation_in_sess(), pkt_delay(), and sess_start().
JABBERD2_API int apr_base64_decode_len | ( | const char * | bufcoded, |
int | buflen | ||
) |
JABBERD2_API int apr_base64_decode | ( | char * | bufplain, |
const char * | bufcoded, | ||
int | buflen | ||
) |
Definition at line 156 of file base64.c.
References apr_base64_decode_binary().
Referenced by b64_decode().
JABBERD2_API int apr_base64_encode_len | ( | int | len | ) |
Definition at line 213 of file base64.c.
Referenced by b64_encode().
JABBERD2_API int apr_base64_encode | ( | char * | encoded, |
const char * | string, | ||
int | len | ||
) |
Definition at line 220 of file base64.c.
References apr_base64_encode_binary().
Referenced by b64_encode().
JABBERD2_API char* b64_encode | ( | char * | buf, |
int | len | ||
) |
Definition at line 260 of file base64.c.
References apr_base64_encode(), and apr_base64_encode_len().
Referenced by _sx_websocket_rio().
JABBERD2_API char* b64_decode | ( | char * | buf | ) |
Definition at line 275 of file base64.c.
References apr_base64_decode(), and apr_base64_decode_len().
JABBERD2_API nad_t stanza_error | ( | nad_t | nad, |
int | elem, | ||
int | err | ||
) |
error the packet
Definition at line 52 of file stanza.c.
References _stanza_errors, _stanza_error_st::code, nad_add_namespace(), nad_insert_elem(), nad_set_attr(), _stanza_error_st::name, stanza_err_BAD_REQUEST, stanza_err_LAST, _stanza_error_st::type, and uri_STANZA_ERR.
Referenced by _authreg_auth_get(), _authreg_auth_set(), _authreg_register_get(), _authreg_register_set(), _c2s_client_sx_callback(), _router_comp_write(), authreg_process(), c2s_router_sx_callback(), out_bounce_route_queue(), pkt_error(), and s2s_router_sx_callback().
JABBERD2_API nad_t stanza_tofrom | ( | nad_t | nad, |
int | elem | ||
) |
flip the to and from attributes on this elem
Definition at line 78 of file stanza.c.
References NAD_AVAL, NAD_AVAL_L, nad_find_attr(), and nad_set_attr().
Referenced by _authreg_auth_get(), _authreg_auth_set(), _authreg_register_get(), _authreg_register_set(), _in_result(), _in_verify(), _session_in_router(), authreg_process(), out_bounce_route_queue(), and s2s_router_sx_callback().
JABBERD2_API void hex_from_raw | ( | const unsigned char * | in, |
int | inlen, | ||
char * | out | ||
) |
turn raw into hex - out must be (inlen*2)+1
Definition at line 26 of file hex.c.
Referenced by sess_start(), and shahash_r().
JABBERD2_API int hex_to_raw | ( | const char * | in, |
int | inlen, | ||
char * | out | ||
) |
JABBERD2_API int get_debug_flag | ( | void | ) |
Referenced by log_write().
JABBERD2_API void set_debug_flag | ( | int | v | ) |
Definition at line 264 of file log.c.
Referenced by _c2s_signal_usr1(), _c2s_signal_usr2(), _s2s_signal_usr1(), _s2s_signal_usr2(), _sm_signal_usr1(), _sm_signal_usr2(), JABBER_MAIN(), router_signal_usr1(), and router_signal_usr2().
JABBERD2_API void debug_log | ( | const char * | file, |
int | line, | ||
const char * | msgfmt, | ||
... | |||
) |
JABBERD2_API void set_debug_file | ( | const char * | filename | ) |
JABBERD2_API void set_debug_log_from_config | ( | config_t | c | ) |
Definition at line 267 of file log.c.
Referenced by _c2s_config_expand(), _router_config_expand(), _s2s_config_expand(), _sm_config_expand(), and JABBER_MAIN().
JABBERD2_API jsighandler_t* jabber_signal | ( | int | signo, |
jsighandler_t * | func | ||
) |
Definition at line 33 of file jsignal.c.
Referenced by JABBER_MAIN().
JABBERD2_API struct _stanza_error_st _stanza_errors[] |