#include <cstring>#include <cstdlib>#include <sys/types.h>#include <stdio.h>#include <setjmp.h>#include <sys/stat.h>#include <fcntl.h>#include <errno.h>#include <signal.h>#include <syslog.h>#include <strings.h>#include <unistd.h>#include <sys/param.h>#include <sys/socket.h>#include <netinet/in.h>#include <netdb.h>#include <arpa/inet.h>#include <arpa/nameser.h>#include <sys/time.h>#include <stdarg.h>#include <ctype.h>#include <ctime>#include <pth.h>#include <expat.h>#include <utility>#include <list>#include <map>#include <glibmm.h>#include <varargs.h>#include <string>#include <vector>#include <sstream>#include <stdexcept>#include <set>#include <pointer.tcc>Go to the source code of this file.
Data Structures | |
| class | xmppd::pointer< pointed_type > |
| class | xmppd::hash |
| class | xmppd::sha1 |
| struct | pheap |
| struct | pfree |
| struct | pool_struct |
| class | xmppd::to_lower |
| class | xmppd::xhash< value_type > |
| struct | xmlnode_t |
| class | xmppd::ns_decl_list |
| struct | xstream_struct |
| struct | streamerr_struct |
| struct | j_SHA_CTX |
| class | xmppd::jabberid |
| class | xmppd::jabberid_pool |
| struct | jpacket_struct |
| struct | jlimit_struct |
| struct | karma |
| struct | terror_struct |
| struct | xterror_struct |
| class | xmppd::lwresc::invalid_packet |
| class | xmppd::lwresc::lwquery |
| class | xmppd::lwresc::rrsetbyname |
| class | xmppd::lwresc::rrecord |
| class | xmppd::lwresc::srv_record |
| class | xmppd::lwresc::aaaa_record |
| class | xmppd::lwresc::a_record |
| class | xmppd::lwresc::lwresult_rdata |
| class | xmppd::lwresc::lwresult_rrset |
| class | xmppd::lwresc::lwresult |
Namespaces | |
| namespace | xmppd |
| namespace | xmppd::lwresc |
Defines | |
| #define | N_(n) (n) |
| #define | MAXSHORTSTR 203 |
| #define | QUAD_T unsigned long long |
| #define | VA_LOCAL_DECL va_list ap; |
| #define | VA_START(f) va_start(ap) |
| #define | VA_END va_end(ap) |
| #define | ZONE zonestr(__FILE__,__LINE__) |
| #define | pool_heap(i) _pool_new_heap(i, NULL, 0) |
| #define | pool_new() _pool_new(NULL, 0) |
| #define | MAXHOSTNAMELEN 64 |
| #define | NETSOCKET_SERVER 0 |
| #define | NETSOCKET_CLIENT 1 |
| #define | NETSOCKET_UDP 2 |
| #define | NTYPE_TAG 0 |
| #define | NTYPE_ATTRIB 1 |
| #define | NTYPE_CDATA 2 |
| #define | NTYPE_LAST 2 |
| #define | NTYPE_UNDEF -1 |
| #define | XMLNS_SEPARATOR ' ' |
| #define | XSTREAM_MAXNODE 1000000 |
| #define | XSTREAM_MAXDEPTH 100 |
| #define | XSTREAM_ROOT 0 |
| #define | XSTREAM_NODE 1 |
| #define | XSTREAM_CLOSE 2 |
| #define | XSTREAM_ERR 4 |
| #define | JID_RESOURCE 1 |
| #define | JID_USER 2 |
| #define | JID_SERVER 4 |
| #define | JPACKET_UNKNOWN 0x00 |
| #define | JPACKET_MESSAGE 0x01 |
| #define | JPACKET_PRESENCE 0x02 |
| #define | JPACKET_IQ 0x04 |
| #define | JPACKET_S10N 0x08 |
| #define | JPACKET__UNKNOWN 0 |
| #define | JPACKET__NONE 1 |
| #define | JPACKET__ERROR 2 |
| #define | JPACKET__CHAT 3 |
| #define | JPACKET__GROUPCHAT 4 |
| #define | JPACKET__GET 5 |
| #define | JPACKET__SET 6 |
| #define | JPACKET__RESULT 7 |
| #define | JPACKET__SUBSCRIBE 8 |
| #define | JPACKET__SUBSCRIBED 9 |
| #define | JPACKET__UNSUBSCRIBE 10 |
| #define | JPACKET__UNSUBSCRIBED 11 |
| #define | JPACKET__AVAILABLE 12 |
| #define | JPACKET__UNAVAILABLE 13 |
| #define | JPACKET__PROBE 14 |
| #define | JPACKET__HEADLINE 15 |
| #define | JPACKET__INVISIBLE 16 |
| #define | KARMA_READ_MAX(k) (abs(k)*100) |
| #define | KARMA_INIT 5 |
| #define | KARMA_HEARTBEAT 2 |
| #define | KARMA_MAX 10 |
| #define | KARMA_INC 1 |
| #define | KARMA_DEC 0 |
| #define | KARMA_PENALTY -5 |
| #define | KARMA_RESTORE 5 |
| #define | KARMA_RESETMETER 0 |
| #define | TERROR_BAD (terror){400,"Bad Request"} |
| #define | TERROR_AUTH (terror){401,"Unauthorized"} |
| #define | TERROR_PAY (terror){402,"Payment Required"} |
| #define | TERROR_FORBIDDEN (terror){403,"Forbidden"} |
| #define | TERROR_NOTFOUND (terror){404,"Not Found"} |
| #define | TERROR_NOTALLOWED (terror){405,"Not Allowed"} |
| #define | TERROR_NOTACCEPTABLE (terror){406,"Not Acceptable"} |
| #define | TERROR_REGISTER (terror){407,"Registration Required"} |
| #define | TERROR_REQTIMEOUT (terror){408,"Request Timeout"} |
| #define | TERROR_CONFLICT (terror){409,"Conflict"} |
| #define | TERROR_INTERNAL (terror){500,"Internal Server Error"} |
| #define | TERROR_NOTIMPL (terror){501,"Not Implemented"} |
| #define | TERROR_EXTERNAL (terror){502,"Remote Server Error"} |
| #define | TERROR_UNAVAIL (terror){503,"Service Unavailable"} |
| #define | TERROR_EXTTIMEOUT (terror){504,"Remote Server Timeout"} |
| #define | TERROR_DISCONNECTED (terror){510,"Disconnected"} |
| #define | HAS_XTERROR |
| #define | XTERROR_BAD (xterror){400, N_("Bad Request"),"modify","bad-request"} |
| #define | XTERROR_CONFLICT (xterror){409, N_("Conflict"), "cancel", "conflict"} |
| #define | XTERROR_NOTIMPL (xterror){501, N_("Not Implemented"), "cancel", "feature-not-implemented"} |
| #define | XTERROR_FORBIDDEN (xterror){403, N_("Forbidden"), "auth", "forbidden"} |
| #define | XTERROR_GONE (xterror){302, N_("Gone"), "modify", "gone"} |
| #define | XTERROR_INTERNAL (xterror){500, N_("Internal Server Error"), "wait", "internal-server-error"} |
| #define | XTERROR_NOTFOUND (xterror){404, N_("Not Found"), "cancel", "item-not-found"} |
| #define | XTERROR_JIDMALFORMED (xterror){400, N_("Bad Request"), "modify", "jid-malformed"} |
| #define | XTERROR_NOTACCEPTABLE (xterror){406, N_("Not Acceptable"), "modify", "not-acceptable"} |
| #define | XTERROR_NOTALLOWED (xterror){405, N_("Not Allowed"), "cancel", "not-allowed"} |
| #define | XTERROR_AUTH (xterror){401, N_("Unauthorized"), "auth", "not-authorized"} |
| #define | XTERROR_PAY (xterror){402, N_("Payment Required"), "auth", "payment-required"} |
| #define | XTERROR_RECIPIENTUNAVAIL (xterror){404, N_("Recipient Is Unavailable"), "wait", "recipient-unavailable"} |
| #define | XTERROR_REDIRECT (xterror){302, N_("Redirect"), "modify", "redirect"} |
| #define | XTERROR_REGISTER (xterror){407, N_("Registration Required"), "auth", "registration-required"} |
| #define | XTERROR_REMOTENOTFOUND (xterror){404, N_("Remote Server Not Found"), "cancel", "remote-server-not-found"} |
| #define | XTERROR_REMOTETIMEOUT (xterror){504, N_("Remote Server Timeout"), "wait", "remote-server-timeout"} |
| #define | XTERROR_RESCONSTRAINT (xterror){500, N_("Resource Constraint"), "wait", "resource-constraint"} |
| #define | XTERROR_UNAVAIL (xterror){503, N_("Service Unavailable"), "cancel", "service-unavailable"} |
| #define | XTERROR_SUBSCRIPTIONREQ (xterror){407, N_("Subscription Required"), "auth", "subscription-required"} |
| #define | XTERROR_UNDEF_CANCEL (xterror){500, NULL, "cancel", "undefined-condition"} |
| #define | XTERROR_UNDEF_CONTINUE (xterror){500, NULL, "continue", "undefined-condition"} |
| #define | XTERROR_UNDEF_MODIFY (xterror){500, NULL, "modify", "undefined-condition"} |
| #define | XTERROR_UNDEF_AUTH (xterror){500, NULL, "auth", "undefined-condition"} |
| #define | XTERROR_UNDEF_WAIT (xterror){500, NULL, "wait", "undefined-condition"} |
| #define | XTERROR_UNEXPECTED (xterror){400, N_("Unexpected Request"), "wait", "unexpected-request"} |
| #define | XTERROR_REQTIMEOUT (xterror){408, N_("Request Timeout"), "wait", "remote-server-timeout"} |
| #define | XTERROR_EXTERNAL (xterror){502, N_("Remote Server Error"), "wait", "service-unavailable"} |
| #define | XTERROR_EXTTIMEOUT (xterror){504, N_("Remote Server Timeout"), "wait", "remote-server-timeout"} |
| #define | XTERROR_DISCONNECTED (xterror){510, N_("Disconnected"), "cancel", "service-unavailable"} |
| #define | XTERROR_STORAGE_FAILED (xterror){500, N_("Storage Failed"), "wait", "internal-server-error"} |
| #define | NSCHECK(x, n) (j_strcmp(xmlnode_get_namespace(x), n) == 0) |
| #define | NS_STREAM "http://etherx.jabber.org/streams" |
| #define | NS_FLASHSTREAM "http://www.jabber.com/streams/flash" |
| #define | NS_CLIENT "jabber:client" |
| #define | NS_SERVER "jabber:server" |
| #define | NS_DIALBACK "jabber:server:dialback" |
| #define | NS_COMPONENT_ACCEPT "jabber:component:accept" |
| #define | NS_AUTH "jabber:iq:auth" |
| #define | NS_AUTH_CRYPT "jabber:iq:auth:crypt" |
| #define | NS_REGISTER "jabber:iq:register" |
| #define | NS_ROSTER "jabber:iq:roster" |
| #define | NS_OFFLINE "jabber:x:offline" |
| #define | NS_AGENT "jabber:iq:agent" |
| #define | NS_AGENTS "jabber:iq:agents" |
| #define | NS_DELAY "jabber:x:delay" |
| #define | NS_VERSION "jabber:iq:version" |
| #define | NS_TIME "jabber:iq:time" |
| #define | NS_VCARD "vcard-temp" |
| #define | NS_PRIVATE "jabber:iq:private" |
| #define | NS_SEARCH "jabber:iq:search" |
| #define | NS_OOB "jabber:iq:oob" |
| #define | NS_XOOB "jabber:x:oob" |
| #define | NS_FILTER "jabber:iq:filter" |
| #define | NS_AUTH_0K "jabber:iq:auth:0k" |
| #define | NS_BROWSE "jabber:iq:browse" |
| #define | NS_EVENT "jabber:x:event" |
| #define | NS_CONFERENCE "jabber:iq:conference" |
| #define | NS_SIGNED "jabber:x:signed" |
| #define | NS_ENCRYPTED "jabber:x:encrypted" |
| #define | NS_GATEWAY "jabber:iq:gateway" |
| #define | NS_LAST "jabber:iq:last" |
| #define | NS_ENVELOPE "jabber:x:envelope" |
| #define | NS_EXPIRE "jabber:x:expire" |
| #define | NS_PRIVACY "jabber:iq:privacy" |
| #define | NS_XHTML "http://www.w3.org/1999/xhtml" |
| #define | NS_DISCO_INFO "http://jabber.org/protocol/disco#info" |
| #define | NS_DISCO_ITEMS "http://jabber.org/protocol/disco#items" |
| #define | NS_DATA "jabber:x:data" |
| #define | NS_FLEXIBLE_OFFLINE "http://jabber.org/protocol/offline" |
| #define | NS_IQ_AUTH "http://jabber.org/features/iq-auth" |
| #define | NS_REGISTER_FEATURE "http://jabber.org/features/iq-register" |
| #define | NS_MSGOFFLINE "msgoffline" |
| #define | NS_BYTESTREAMS "http://jabber.org/protocol/bytestreams" |
| #define | NS_COMMAND "http://jabber.org/protocol/commands" |
| #define | NS_XDBNSLIST "jabber:xdb:nslist" |
| #define | NS_XMPP_STANZAS "urn:ietf:params:xml:ns:xmpp-stanzas" |
| #define | NS_XMPP_TLS "urn:ietf:params:xml:ns:xmpp-tls" |
| #define | NS_XMPP_STREAMS "urn:ietf:params:xml:ns:xmpp-streams" |
| #define | NS_XMPP_SASL "urn:ietf:params:xml:ns:xmpp-sasl" |
| #define | NS_XMPP_PING "urn:xmpp:ping" |
| #define | NS_JABBERD_STOREDPRESENCE "http://jabberd.org/ns/storedpresence" |
| #define | NS_JABBERD_STOREDPEERPRESENCE "http://jabberd.org/ns/storedpeerpresence" |
| #define | NS_JABBERD_STOREDREQUEST "http://jabberd.org/ns/storedsubscriptionrequest" |
| #define | NS_JABBERD_STOREDSTATE "http://jabberd.org/ns/storedstate" |
| #define | NS_JABBERD_HISTORY "http://jabberd.org/ns/history" |
| #define | NS_JABBERD_HASH "http://jabberd.org/ns/hash" |
| #define | NS_JABBERD_XDB "http://jabberd.org/ns/xdb" |
| #define | NS_JABBERD_WRAPPER "http://jabberd.org/ns/wrapper" |
| #define | NS_JABBERD_XDBSQL "http://jabberd.org/ns/xdbsql" |
| #define | NS_JABBERD_ACL "http://jabberd.org/ns/acl" |
| #define | NS_JABBERD_LOOPCHECK "http://jabberd.org/ns/loopcheck" |
| #define | NS_JABBERD_ERRMSG "http://jabberd.org/ns/errmsg" |
| #define | NS_SESSION "http://jabberd.jabberstudio.org/ns/session/1.0" |
| #define | NS_XMLNS "http://www.w3.org/2000/xmlns/" |
| #define | NS_XML "http://www.w3.org/XML/1998/namespace" |
| #define | NS_JABBERD_CONFIGFILE "http://jabberd.org/ns/configfile" |
| #define | NS_JABBERD_CONFIGFILE_REPLACE "http://jabberd.org/ns/configfile/replace" |
| #define | NS_JABBERD_CONFIGFILE_ROUTER "http://xmppd.org/ns/configfile/router" |
| #define | NS_JABBERD_CONFIG_XDBFILE "jabber:config:xdb_file" |
| #define | NS_JABBERD_CONFIG_DIALBACK "jabber:config:dialback" |
| #define | NS_JABBERD_CONFIG_DNSRV "jabber:config:dnsrv" |
| #define | NS_JABBERD_CONFIG_JSM "jabber:config:jsm" |
| #define | NS_JABBERD_CONFIG_PTHCSOCK "jabber:config:pth-csock" |
| #define | NS_JABBERD_CONFIG_XDBSQL "jabber:config:xdb_sql" |
| #define | NS_JABBERD_CONFIG_DYNAMICHOST "http://xmppd.org/ns/dynamichost" |
Typedefs | |
| typedef void(* | pool_cleaner )(void *arg) |
| typedef struct pool_struct | _pool |
| typedef struct pool_struct * | pool |
| typedef unsigned int | uint32 |
| typedef xmppd::xhash< void * > * | xht |
| typedef void(* | xhash_walker )(xht h, const char *key, void *val, void *arg) |
| typedef struct xmlnode_t | _xmlnode |
| typedef struct xmlnode_t * | xmlnode |
| typedef std::vector< xmlnode > | xmlnode_vector |
| typedef void(* | xstream_onNode )(int type, xmlnode x, void *arg) |
| typedef struct xstream_struct * | xstream |
| typedef struct xstream_struct | _xstream |
| typedef struct streamerr_struct * | streamerr |
| typedef struct streamerr_struct | _streamerr |
| typedef xmppd::jabberid_pool * | jid |
| typedef struct jpacket_struct * | jpacket |
| typedef struct jpacket_struct | _jpacket |
| typedef struct jlimit_struct * | jlimit |
| typedef struct jlimit_struct | _jlimit |
| typedef struct terror_struct | terror |
| typedef struct xterror_struct | xterror |
Enumerations | |
| enum | streamerr_reason { unknown_error_type, bad_format, bad_namespace_prefix, conflict, connection_timeout, host_gone, host_unknown, improper_addressing, internal_server_error, invalid_from, invalid_id, invalid_namespace, invalid_xml, not_authorized, policy_violation, remote_connection_failed, resource_constraint, restricted_xml, see_other_host, system_shutdown, undefined_condition, unsupported_encoding, unsupported_stanza_type, unsupported_version, xml_not_well_formed } |
| enum | streamerr_severity { normal, configuration, feature_lack, unknown, error } |
Functions | |
| char * | zonestr (char const *file, int line) |
| pool | _pool_new (char *zone, int line) |
| pool | _pool_new_heap (int size, char *zone, int line) |
| void * | pmalloc (pool p, int size) |
| void * | pmalloc_x (pool p, int size, char c) |
| void * | pmalloco (pool p, int size) |
| char * | pstrdup (pool p, const char *src) |
| void | pool_stat (int full) |
| char * | pstrdupx (pool p, const char *src) |
| void | pool_cleanup (pool p, pool_cleaner f, void *arg) |
| void | pool_free (pool p) |
| int | pool_size (pool p) |
| int | make_netsocket (u_short port, char const *host, int type) |
| int | make_netsocket2 (Glib::ustring servname, Glib::ustring nodename, int type) |
| struct in_addr * | make_addr (char const *host) |
| char * | j_strdup (const char *str) |
| char * | j_strcat (char *dest, char *txt) |
| int | j_strcmp (const char *a, const char *b) |
| int | j_strcasecmp (const char *a, const char *b) |
| int | j_strncmp (const char *a, const char *b, int i) |
| int | j_strncasecmp (const char *a, const char *b, int i) |
| int | j_strlen (const char *a) |
| int | j_atoi (const char *a, int def) |
| void | str_b64decode (char *str) |
| int | base64_encode (unsigned char *source, size_t sourcelen, char *target, size_t targetlen) |
| size_t | base64_decode (const char *source, unsigned char *target, size_t targetlen) |
| char * | shahash (char const *str) |
| void | shahash_r (const char *str, char hashbuf[41]) |
| void | shaBlock (unsigned char *dataIn, int len, unsigned char hashout[20]) |
| void | crc32_r (const char *str, char crc32buf[9]) |
| xht | xhash_new (int prime) |
| void | xhash_put (xht h, const char *key, void *val) |
| void * | xhash_get (xht h, const char *key) |
| void * | xhash_get_by_domain (xht h, const char *domain) |
| void | xhash_zap (xht h, const char *key) |
| void | xhash_free (xht h) |
| void | xhash_walk (xht h, xhash_walker w, void *arg) |
| char * | strescape (pool p, char *buf) |
| char * | strunescape (pool p, char *buf) |
| std::string | strescape (std::string s) |
| xmlnode | xmlnode_wrap (xmlnode x, const char *wrapper) |
| xmlnode | xmlnode_wrap_ns (xmlnode x, const char *name, const char *prefix, const char *ns_iri) |
| xmlnode | xmlnode_new_tag (const char *name) |
| xmlnode | xmlnode_new_tag_ns (const char *name, const char *prefix, const char *ns_iri) |
| xmlnode | xmlnode_new_tag_pool (pool p, const char *name) |
| xmlnode | xmlnode_new_tag_pool_ns (pool p, const char *name, const char *prefix, const char *ns_iri) |
| xmlnode | xmlnode_insert_tag (xmlnode parent, const char *name) |
| xmlnode | xmlnode_insert_tag_ns (xmlnode parent, const char *name, const char *prefix, const char *ns_iri) |
| xmlnode | xmlnode_insert_cdata (xmlnode parent, const char *CDATA, unsigned int size) |
| xmlnode | xmlnode_insert_tag_node (xmlnode parent, xmlnode node) |
| void | xmlnode_insert_node (xmlnode parent, xmlnode node) |
| xmlnode | xmlnode_str (const char *str, int len) |
| xmlnode | xmlnode_file (const char *file) |
| char const * | xmlnode_file_borked (char const *file) |
| xmlnode | xmlnode_dup (xmlnode x) |
| xmlnode | xmlnode_dup_pool (pool p, xmlnode x) |
| pool | xmlnode_pool (xmlnode node) |
| void | xmlnode_hide (xmlnode child) |
| void | xmlnode_hide_attrib (xmlnode parent, const char *name) |
| void | xmlnode_hide_attrib_ns (xmlnode parent, const char *name, const char *ns_iri) |
| void | xmlnode_free (xmlnode node) |
| xmlnode | xmlnode_get_tag (xmlnode parent, const char *name) |
| char * | xmlnode_get_tag_data (xmlnode parent, const char *name) |
| xmlnode_vector | xmlnode_get_tags (xmlnode context_node, const char *path, xht namespaces) |
| xmlnode | xmlnode_get_list_item (const xmlnode_vector &first, unsigned int i) |
| char * | xmlnode_get_list_item_data (const xmlnode_vector &first, unsigned int i) |
| xmlnode | xmlnode_select_by_lang (const xmlnode_vector &nodes, const char *lang) |
| void | xmlnode_put_attrib (xmlnode owner, const char *name, const char *value) |
| void | xmlnode_put_attrib_ns (xmlnode owner, const char *name, const char *prefix, const char *ns_iri, const char *value) |
| char * | xmlnode_get_attrib (xmlnode owner, const char *name) |
| char * | xmlnode_get_attrib_ns (xmlnode owner, const char *name, const char *ns_iri) |
| void | xmlnode_put_expat_attribs (xmlnode owner, const char **atts, xmppd::ns_decl_list &nslist) |
| const char * | xmlnode_get_lang (xmlnode node) |
| xmlnode | xmlnode_get_firstattrib (xmlnode parent) |
| xmlnode | xmlnode_get_firstchild (xmlnode parent) |
| xmlnode | xmlnode_get_lastchild (xmlnode parent) |
| xmlnode | xmlnode_get_nextsibling (xmlnode sibling) |
| xmlnode | xmlnode_get_prevsibling (xmlnode sibling) |
| xmlnode | xmlnode_get_parent (xmlnode node) |
| char * | xmlnode_get_name (xmlnode node) |
| char * | xmlnode_get_data (xmlnode node) |
| int | xmlnode_get_type (xmlnode node) |
| const char * | xmlnode_get_localname (xmlnode node) |
| const char * | xmlnode_get_namespace (xmlnode node) |
| const char * | xmlnode_get_nsprefix (xmlnode node) |
| void | xmlnode_change_namespace (xmlnode node, const char *ns_iri) |
| int | xmlnode_has_children (xmlnode node) |
| char * | xmlnode_serialize_string (xmlnode_t const *node, const xmppd::ns_decl_list &nslist, int stream_type) |
| int | xmlnode2file (char const *file, xmlnode node) |
| int | xmlnode2file_limited (char const *file, xmlnode node, size_t sizelimit) |
| void | expat_startElement (void *userdata, const char *name, const char **atts) |
| void | expat_endElement (void *userdata, const char *name) |
| void | expat_charData (void *userdata, const char *s, int len) |
| xmlnode | xhash_to_xml (xht h) |
| xht | xhash_from_xml (xmlnode hash, pool p) |
| xstream | xstream_new (pool p, xstream_onNode f, void *arg) |
| int | xstream_eat (xstream xs, char *buff, int len) |
| xmlnode | xstream_header (const char *to, const char *from) |
| char * | xstream_header_char (xmlnode x, int stream_type) |
| void | xstream_format_error (std::ostream &out, streamerr errstruct) |
| streamerr_severity | xstream_parse_error (pool p, xmlnode errnode, streamerr errstruct) |
| void | shaInit (j_SHA_CTX *ctx) |
| void | shaUpdate (j_SHA_CTX *ctx, unsigned char *dataIn, int len) |
| void | shaFinal (j_SHA_CTX *ctx, unsigned char hashout[20]) |
| void | hmac_sha1_ascii_r (char const *secret, unsigned char const *message, size_t len, char hmac[41]) |
| jid | jid_new (pool p, const char *idstr) |
| void | jid_set (jid id, const char *str, int item) |
| char * | jid_full (jid id) |
| int | jid_cmp (jid a, jid b) |
| int | jid_cmpx (jid a, jid b, int parts) |
| jid | jid_user (jid a) |
| jid | jid_user_pool (jid a, pool p) |
| jid | jid_append (jid a, jid b) |
| jpacket | jpacket_new (xmlnode x) |
| jpacket | jpacket_reset (jpacket p) |
| int | jpacket_subtype (jpacket p) |
| jlimit | jlimit_new (int maxt, int maxp) |
| void | jlimit_free (jlimit r) |
| int | jlimit_check (jlimit r, char *key, int points) |
| struct karma * | karma_new (pool p) |
| void | karma_copy (struct karma *new_instance, struct karma *old) |
| void | karma_increment (struct karma *k) |
| void | karma_decrement (struct karma *k, long bytes_read) |
| int | karma_check (struct karma *k, long bytes_read) |
| xmlnode | jutil_presnew (int type, char const *to, const char *status) |
| xmlnode | jutil_iqnew (int type, char const *ns) |
| xmlnode | jutil_msgnew (char const *type, char const *to, char const *subj, char const *body) |
| int | jutil_priority (xmlnode x) |
| void | jutil_tofrom (xmlnode x) |
| xmlnode | jutil_iqresult (xmlnode x) |
| char * | jutil_timestamp (void) |
| char * | jutil_timestamp_ms (char *buffer) |
| void | jutil_error (xmlnode x, terror E) |
| void | jutil_error_xmpp (xmlnode x, xterror E) |
| void | jutil_error_map (terror old, xterror *mapped) |
| void | jutil_delay (xmlnode msg, char const *reason) |
| char * | jutil_regkey (char *key, char *seed) |
| void | messages_set_mapping (const char *lang, const char *locale_name) |
| const char * | messages_get (const char *lang, const char *message) |
| std::ostream & | xmppd::lwresc::operator<< (std::ostream &os, const lwquery &lwq) |
| #define HAS_XTERROR |
| #define JID_RESOURCE 1 |
| #define JID_SERVER 4 |
Referenced by _js_session_from(), acl_check_access(), jid_cmpx(), jid_set(), js_deliver(), js_remove_seen(), and js_remove_trustee().
| #define JID_USER 2 |
| #define JPACKET__AVAILABLE 12 |
Referenced by jpacket_reset(), and js_online().
| #define JPACKET__CHAT 3 |
Referenced by jpacket_subtype().
| #define JPACKET__ERROR 2 |
Referenced by _js_session_from(), _js_session_to(), jpacket_reset(), jpacket_subtype(), and jutil_iqnew().
| #define JPACKET__GET 5 |
| #define JPACKET__GROUPCHAT 4 |
Referenced by _js_session_from(), _js_session_to(), and jpacket_subtype().
| #define JPACKET__HEADLINE 15 |
Referenced by _js_session_from(), _js_session_to(), and jpacket_subtype().
| #define JPACKET__INVISIBLE 16 |
Referenced by jpacket_reset(), js_online(), and jutil_presnew().
| #define JPACKET__NONE 1 |
Referenced by jpacket_subtype().
| #define JPACKET__PROBE 14 |
Referenced by jpacket_reset(), and jutil_presnew().
| #define JPACKET__RESULT 7 |
Referenced by jpacket_subtype(), and jutil_iqnew().
| #define JPACKET__SET 6 |
Referenced by jpacket_subtype(), js_mapi_create_additional_iq_result(), and jutil_iqnew().
| #define JPACKET__SUBSCRIBE 8 |
Referenced by jpacket_subtype(), and jutil_presnew().
| #define JPACKET__SUBSCRIBED 9 |
Referenced by jpacket_subtype(), and jutil_presnew().
| #define JPACKET__UNAVAILABLE 13 |
Referenced by jpacket_reset(), js_sc_session_new(), js_session_end(), js_session_new(), and jutil_presnew().
| #define JPACKET__UNKNOWN 0 |
Referenced by jpacket_subtype().
| #define JPACKET__UNSUBSCRIBE 10 |
Referenced by jpacket_subtype(), and jutil_presnew().
| #define JPACKET__UNSUBSCRIBED 11 |
Referenced by jpacket_subtype(), and jutil_presnew().
| #define JPACKET_IQ 0x04 |
| #define JPACKET_MESSAGE 0x01 |
| #define JPACKET_PRESENCE 0x02 |
Referenced by jpacket_reset(), and xmppd::instance_base::on_stanza_packet().
| #define JPACKET_S10N 0x08 |
Referenced by jpacket_reset(), jpacket_subtype(), and xmppd::instance_base::on_stanza_packet().
| #define JPACKET_UNKNOWN 0x00 |
Referenced by _js_session_from(), and jpacket_reset().
| #define KARMA_DEC 0 |
Referenced by dialback(), karma_new(), mio_init(), and pthsock_client().
| #define KARMA_HEARTBEAT 2 |
Referenced by karma_increment(), and mio_init().
| #define KARMA_INC 1 |
Referenced by dialback(), karma_new(), mio_init(), and pthsock_client().
| #define KARMA_INIT 5 |
Referenced by dialback(), karma_new(), mio_init(), and pthsock_client().
| #define KARMA_MAX 10 |
Referenced by dialback(), karma_new(), mio_init(), and pthsock_client().
| #define KARMA_PENALTY -5 |
Referenced by dialback(), karma_new(), mio_init(), and pthsock_client().
| #define KARMA_READ_MAX | ( | k | ) | (abs(k)*100) |
Referenced by karma_decrement(), and karma_increment().
| #define KARMA_RESETMETER 0 |
Referenced by dialback(), karma_new(), mio_init(), and pthsock_client().
| #define KARMA_RESTORE 5 |
Referenced by dialback(), karma_new(), mio_init(), and pthsock_client().
| #define MAXHOSTNAMELEN 64 |
Referenced by make_addr().
| #define MAXSHORTSTR 203 |
| #define N_ | ( | n | ) | (n) |
Referenced by __jsm_shutdown(), _dialback_out_beat_packets(), _dnsrv_beat_packets(), _js_authreg_register(), _js_routed_error_packet(), _js_routed_packet(), _js_routed_session_control_packet(), _js_routed_session_packet(), dialback_out_connection_cleanup(), dnsrv_lookup(), dnsrv_resend(), js_sc_session_new(), js_session_new(), js_session_route(), xmppd::instance_base::on_log_packet(), xmppd::instance_base::on_packet(), xmppd::instance_base::on_route_packet(), xmppd::instance_base::on_stanza_packet(), and xmppd::instance_base::on_xdb_packet().
| #define NETSOCKET_CLIENT 1 |
type of a connection socket
Referenced by make_netsocket().
| #define NETSOCKET_SERVER 0 |
type of a local listening socket
Referenced by make_netsocket(), and mio_listen().
| #define NETSOCKET_UDP 2 |
type of a UDP connection socket
Referenced by make_netsocket().
| #define NS_AGENT "jabber:iq:agent" |
| #define NS_AGENTS "jabber:iq:agents" |
| #define NS_AUTH "jabber:iq:auth" |
Referenced by _js_authreg_auth(), js_authreg(), js_user(), jsm(), and pthsock_client().
| #define NS_AUTH_0K "jabber:iq:auth:0k" |
| #define NS_AUTH_CRYPT "jabber:iq:auth:crypt" |
Referenced by js_user().
| #define NS_BROWSE "jabber:iq:browse" |
Referenced by jsm().
| #define NS_BYTESTREAMS "http://jabber.org/protocol/bytestreams" |
Referenced by xmppd::proxy65::proxy65::proxy65().
| #define NS_CLIENT "jabber:client" |
| #define NS_COMMAND "http://jabber.org/protocol/commands" |
Referenced by jsm().
| #define NS_COMPONENT_ACCEPT "jabber:component:accept" |
| #define NS_CONFERENCE "jabber:iq:conference" |
| #define NS_DATA "jabber:x:data" |
Referenced by jsm().
| #define NS_DELAY "jabber:x:delay" |
Referenced by jsm(), and jutil_delay().
| #define NS_DIALBACK "jabber:server:dialback" |
| #define NS_DISCO_INFO "http://jabber.org/protocol/disco#info" |
Referenced by dialback(), and jsm().
| #define NS_DISCO_ITEMS "http://jabber.org/protocol/disco#items" |
| #define NS_ENCRYPTED "jabber:x:encrypted" |
| #define NS_ENVELOPE "jabber:x:envelope" |
| #define NS_EVENT "jabber:x:event" |
Referenced by _js_session_from(), _js_session_to(), and jsm().
| #define NS_EXPIRE "jabber:x:expire" |
Referenced by jsm().
| #define NS_FILTER "jabber:iq:filter" |
| #define NS_FLASHSTREAM "http://www.jabber.com/streams/flash" |
| #define NS_FLEXIBLE_OFFLINE "http://jabber.org/protocol/offline" |
| #define NS_GATEWAY "jabber:iq:gateway" |
| #define NS_IQ_AUTH "http://jabber.org/features/iq-auth" |
| #define NS_JABBERD_ACL "http://jabberd.org/ns/acl" |
namespace for access control lists
Referenced by acl_get_users().
| #define NS_JABBERD_CONFIG_DIALBACK "jabber:config:dialback" |
namespace of dialback component configuration
Referenced by dialback().
| #define NS_JABBERD_CONFIG_DNSRV "jabber:config:dnsrv" |
namespace of the dnsrv component configuration
Referenced by dnsrv(), and xmppd::resolver::resend_service::resend_service().
| #define NS_JABBERD_CONFIG_DYNAMICHOST "http://xmppd.org/ns/dynamichost" |
namespace of the dynamic configuration of additional hosts for components
Referenced by jsm(), and mod_dynamic().
| #define NS_JABBERD_CONFIG_JSM "jabber:config:jsm" |
namespace of the jsm component configuration
Referenced by js_config(), jsm(), and mod_presence().
| #define NS_JABBERD_CONFIG_PTHCSOCK "jabber:config:pth-csock" |
namespace of the pthsock_client component configuration
Referenced by pthsock_client().
| #define NS_JABBERD_CONFIG_XDBFILE "jabber:config:xdb_file" |
namespace of xdb_file component configuration
Referenced by main(), and xdb_file().
| #define NS_JABBERD_CONFIG_XDBSQL "jabber:config:xdb_sql" |
namepace of the xdb_sql component configuration
Referenced by xdb_sql().
| #define NS_JABBERD_CONFIGFILE "http://jabberd.org/ns/configfile" |
namespace of the root element in the config file
Referenced by acl_get_users(), configurate(), deliver(), deliver_config_filter(), xmppd::instance_base::get_instance_config(), main(), mio_init(), mio_ssl_init(), and register_instance().
| #define NS_JABBERD_CONFIGFILE_REPLACE "http://jabberd.org/ns/configfile/replace" |
namespace of replace and include commands
Referenced by main().
| #define NS_JABBERD_CONFIGFILE_ROUTER "http://xmppd.org/ns/configfile/router" |
namespace for global router configuration
Referenced by deliver().
| #define NS_JABBERD_ERRMSG "http://jabberd.org/ns/errmsg" |
namespace for session control error messages
Referenced by deliver_fail().
| #define NS_JABBERD_HASH "http://jabberd.org/ns/hash" |
namespace for storing xhash data
Referenced by xhash_from_xml(), and xhash_to_xml().
| #define NS_JABBERD_HISTORY "http://jabberd.org/ns/history" |
Referenced by _js_session_from(), and _js_session_to().
| #define NS_JABBERD_LOOPCHECK "http://jabberd.org/ns/loopcheck" |
namespace for loopchecking of s2s connections
Referenced by dialback_in_read(), and dialback_out_read().
| #define NS_JABBERD_STOREDPEERPRESENCE "http://jabberd.org/ns/storedpeerpresence" |
| #define NS_JABBERD_STOREDPRESENCE "http://jabberd.org/ns/storedpresence" |
| #define NS_JABBERD_STOREDREQUEST "http://jabberd.org/ns/storedsubscriptionrequest" |
| #define NS_JABBERD_STOREDSTATE "http://jabberd.org/ns/storedstate" |
namespace to store internal state of jabberd
Referenced by jsm(), and jsm_serialize().
| #define NS_JABBERD_WRAPPER "http://jabberd.org/ns/wrapper" |
namespace used to wrap various internal data
Referenced by dialback(), dialback_ip_set(), dialback_out_connection(), and jsm().
| #define NS_JABBERD_XDB "http://jabberd.org/ns/xdb" |
namespace for the root element used by xdb_file to store data in files
Referenced by xdb_file(), xdb_file_load(), and xdb_file_phandler().
| #define NS_JABBERD_XDBSQL "http://jabberd.org/ns/xdbsql" |
namespace for substitution in xdb_sql configuration
| #define NS_LAST "jabber:iq:last" |
Referenced by _js_authreg_register().
| #define NS_MSGOFFLINE "msgoffline" |
| #define NS_OFFLINE "jabber:x:offline" |
| #define NS_OOB "jabber:iq:oob" |
| #define NS_PRIVACY "jabber:iq:privacy" |
Referenced by jsm().
| #define NS_PRIVATE "jabber:iq:private" |
Referenced by jsm().
| #define NS_REGISTER "jabber:iq:register" |
Referenced by _js_authreg_register(), js_authreg(), jsm(), and pthsock_client().
| #define NS_REGISTER_FEATURE "http://jabber.org/features/iq-register" |
| #define NS_ROSTER "jabber:iq:roster" |
Referenced by jsm().
| #define NS_SEARCH "jabber:iq:search" |
| #define NS_SERVER "jabber:server" |
Referenced by dialback(), dialback_in_read_db(), dnsrv_lookup(), jpacket_reset(), js_authreg(), js_bounce_xmpp(), js_session_route(), jsm(), jutil_error_xmpp(), jutil_iqnew(), jutil_msgnew(), jutil_presnew(), jutil_priority(), log_generic(), logger(), mio_write_root(), xmppd::proxy65::proxy65::proxy65(), pthsock_client(), xdb_file_load(), xmlnode_insert_tag_ns(), xmlnode_new_tag_pool(), xmlnode_new_tag_pool_ns(), xmlnode_put_attrib(), xmlnode_put_attrib_ns(), xmlnode_wrap(), xstream_eat(), xstream_header(), and xstream_header_char().
| #define NS_SESSION "http://jabberd.jabberstudio.org/ns/session/1.0" |
namespace of the jabberd2 session control protocol (http://jabberd.jabberstudio.org/dev/docs/session.shtml)
Referenced by _js_routed_packet(), _js_routed_session_control_packet(), deliver_fail(), js_sc_session_new(), and js_session_route().
| #define NS_SIGNED "jabber:x:signed" |
| #define NS_STREAM "http://etherx.jabber.org/streams" |
| #define NS_TIME "jabber:iq:time" |
| #define NS_VCARD "vcard-temp" |
Referenced by jsm().
| #define NS_VERSION "jabber:iq:version" |
| #define NS_XDBNSLIST "jabber:xdb:nslist" |
| #define NS_XHTML "http://www.w3.org/1999/xhtml" |
| #define NS_XML "http://www.w3.org/XML/1998/namespace" |
namespace declared by the xml prefix, defined by 'Namespaces in XML' (W3C)
Referenced by xmppd::ns_decl_list::ns_decl_list(), xmlnode_get_lang(), xmlnode_put_attrib(), and xmlnode_wrap_ns().
| #define NS_XMLNS "http://www.w3.org/2000/xmlns/" |
namespace of xml namespace declarations, defined by 'Namespaces in XML' (W3C)
Referenced by _js_routed_packet(), dialback_in_read(), dialback_out_read(), mio_write_root(), xmppd::ns_decl_list::ns_decl_list(), xmlnode_change_namespace(), xmlnode_get_attrib(), xmlnode_hide_attrib(), xmlnode_insert_tag_ns(), xmlnode_new_tag_pool_ns(), xmlnode_put_attrib(), xstream_header(), and xstream_header_char().
| #define NS_XMPP_PING "urn:xmpp:ping" |
| #define NS_XMPP_SASL "urn:ietf:params:xml:ns:xmpp-sasl" |
Referenced by dialback(), dialback_in_read(), dialback_in_read_db(), and dialback_out_read().
| #define NS_XMPP_STANZAS "urn:ietf:params:xml:ns:xmpp-stanzas" |
Referenced by jutil_error_xmpp().
| #define NS_XMPP_STREAMS "urn:ietf:params:xml:ns:xmpp-streams" |
Referenced by xstream_parse_error().
| #define NS_XMPP_TLS "urn:ietf:params:xml:ns:xmpp-tls" |
Referenced by dialback(), dialback_in_read(), dialback_in_read_db(), and dialback_out_read().
| #define NS_XOOB "jabber:x:oob" |
Referenced by jsm().
| #define NSCHECK | ( | x, | |||
| n | ) | (j_strcmp(xmlnode_get_namespace(x), n) == 0) |
Referenced by js_authreg(), and mod_presence().
| #define NTYPE_ATTRIB 1 |
xmlnode is an attribute node
Referenced by main(), xmlnode_get_attrib_ns(), xmlnode_hide(), xmlnode_hide_attrib_ns(), xmlnode_insert_node(), and xmlnode_put_attrib_ns().
| #define NTYPE_CDATA 2 |
xmlnode is a text node (!)
Referenced by main(), xmlnode_get_data(), xmlnode_get_tags(), xmlnode_insert_cdata(), xmlnode_insert_node(), and xstream_parse_error().
| #define NTYPE_LAST 2 |
highest possible value of xmlnode types
| #define NTYPE_TAG 0 |
xmlnode is an element (tag)
Referenced by _js_routed_packet(), configo(), dialback_out_read(), xmppd::instance_base::get_instance_config(), jpacket_reset(), main(), mio_ssl_init(), mod_dynamic(), mod_log(), mod_presence(), pthsock_client(), xdb_get(), xmlnode_get_data(), xmlnode_get_lang(), xmlnode_get_tag(), xmlnode_insert_node(), xmlnode_insert_tag(), xmlnode_insert_tag_ns(), xmlnode_new_tag_pool(), xmlnode_new_tag_pool_ns(), and xstream_parse_error().
| #define NTYPE_UNDEF -1 |
xmlnode has no defined type
Referenced by xmlnode_get_type().
| #define pool_heap | ( | i | ) | _pool_new_heap(i, NULL, 0) |
Referenced by dialback_out_connection(), js_sc_session_new(), js_session_new(), js_user(), xmlnode_new_tag(), and xmlnode_new_tag_ns().
| #define pool_new | ( | ) | _pool_new(NULL, 0) |
Referenced by _new_beat(), acl_get_users(), deliver(), deliver_config_filter(), dnsrv_child_main(), jlimit_new(), js_config(), main(), mio_connect(), mio_handlers_new(), mio_init(), mio_new(), mio_ssl_init(), mio_write(), mod_version(), mtq_send(), register_phandler(), register_routing_update_callback(), register_shutdown(), xdb_convert_spool(), xdb_file_phandler(), xmlnode_file(), and xmlnode_str().
| #define QUAD_T unsigned long long |
| #define TERROR_AUTH (terror){401,"Unauthorized"} |
| #define TERROR_BAD (terror){400,"Bad Request"} |
| #define TERROR_CONFLICT (terror){409,"Conflict"} |
| #define TERROR_DISCONNECTED (terror){510,"Disconnected"} |
| #define TERROR_EXTERNAL (terror){502,"Remote Server Error"} |
| #define TERROR_EXTTIMEOUT (terror){504,"Remote Server Timeout"} |
| #define TERROR_FORBIDDEN (terror){403,"Forbidden"} |
| #define TERROR_INTERNAL (terror){500,"Internal Server Error"} |
| #define TERROR_NOTACCEPTABLE (terror){406,"Not Acceptable"} |
| #define TERROR_NOTALLOWED (terror){405,"Not Allowed"} |
| #define TERROR_NOTFOUND (terror){404,"Not Found"} |
| #define TERROR_NOTIMPL (terror){501,"Not Implemented"} |
| #define TERROR_PAY (terror){402,"Payment Required"} |
| #define TERROR_REGISTER (terror){407,"Registration Required"} |
| #define TERROR_REQTIMEOUT (terror){408,"Request Timeout"} |
| #define TERROR_UNAVAIL (terror){503,"Service Unavailable"} |
| #define VA_END va_end(ap) |
| #define VA_LOCAL_DECL va_list ap; |
| #define VA_START | ( | f | ) | va_start(ap) |
| #define XMLNS_SEPARATOR ' ' |
character used to separate NS IRI from local name in expat callbacks
Referenced by _mio_xstream_init(), expat_startElement(), xmlnode_file(), xmlnode_file_borked(), xmlnode_put_expat_attribs(), xmlnode_str(), and xstream_new().
| #define XSTREAM_CLOSE 2 |
| #define XSTREAM_ERR 4 |
Referenced by xstream_eat().
| #define XSTREAM_MAXDEPTH 100 |
| #define XSTREAM_MAXNODE 1000000 |
Referenced by xstream_eat().
| #define XSTREAM_NODE 1 |
Referenced by dnsrv_child_main(), dnsrv_child_process_xstream_io(), dnsrv_process_io(), and dnsrv_process_xstream_io().
| #define XSTREAM_ROOT 0 |
| #define XTERROR_AUTH (xterror){401, N_("Unauthorized"), "auth", "not-authorized"} |
Referenced by _js_authreg_auth().
| #define XTERROR_BAD (xterror){400, N_("Bad Request"),"modify","bad-request"} |
Referenced by _js_session_from(), and js_deliver().
| #define XTERROR_CONFLICT (xterror){409, N_("Conflict"), "cancel", "conflict"} |
| #define XTERROR_DISCONNECTED (xterror){510, N_("Disconnected"), "cancel", "service-unavailable"} |
| #define XTERROR_EXTERNAL (xterror){502, N_("Remote Server Error"), "wait", "service-unavailable"} |
Referenced by deliver_fail().
| #define XTERROR_EXTTIMEOUT (xterror){504, N_("Remote Server Timeout"), "wait", "remote-server-timeout"} |
| #define XTERROR_FORBIDDEN (xterror){403, N_("Forbidden"), "auth", "forbidden"} |
| #define XTERROR_GONE (xterror){302, N_("Gone"), "modify", "gone"} |
| #define XTERROR_INTERNAL (xterror){500, N_("Internal Server Error"), "wait", "internal-server-error"} |
| #define XTERROR_NOTACCEPTABLE (xterror){406, N_("Not Acceptable"), "modify", "not-acceptable"} |
Referenced by _js_authreg_register(), and js_authreg().
| #define XTERROR_NOTALLOWED (xterror){405, N_("Not Allowed"), "cancel", "not-allowed"} |
| #define XTERROR_NOTFOUND (xterror){404, N_("Not Found"), "cancel", "item-not-found"} |
Referenced by js_server_main().
| #define XTERROR_NOTIMPL (xterror){501, N_("Not Implemented"), "cancel", "feature-not-implemented"} |
| #define XTERROR_PAY (xterror){402, N_("Payment Required"), "auth", "payment-required"} |
| #define XTERROR_RECIPIENTUNAVAIL (xterror){404, N_("Recipient Is Unavailable"), "wait", "recipient-unavailable"} |
Referenced by js_offline_main().
| #define XTERROR_REDIRECT (xterror){302, N_("Redirect"), "modify", "redirect"} |
| #define XTERROR_REGISTER (xterror){407, N_("Registration Required"), "auth", "registration-required"} |
| #define XTERROR_REMOTENOTFOUND (xterror){404, N_("Remote Server Not Found"), "cancel", "remote-server-not-found"} |
| #define XTERROR_REMOTETIMEOUT (xterror){504, N_("Remote Server Timeout"), "wait", "remote-server-timeout"} |
| #define XTERROR_REQTIMEOUT (xterror){408, N_("Request Timeout"), "wait", "remote-server-timeout"} |
| #define XTERROR_RESCONSTRAINT (xterror){500, N_("Resource Constraint"), "wait", "resource-constraint"} |
| #define XTERROR_STORAGE_FAILED (xterror){500, N_("Storage Failed"), "wait", "internal-server-error"} |
| #define XTERROR_SUBSCRIPTIONREQ (xterror){407, N_("Subscription Required"), "auth", "subscription-required"} |
| #define XTERROR_UNAVAIL (xterror){503, N_("Service Unavailable"), "cancel", "service-unavailable"} |
Referenced by _js_authreg_register().
| #define XTERROR_UNDEF_AUTH (xterror){500, NULL, "auth", "undefined-condition"} |
| #define XTERROR_UNDEF_CANCEL (xterror){500, NULL, "cancel", "undefined-condition"} |
| #define XTERROR_UNDEF_CONTINUE (xterror){500, NULL, "continue", "undefined-condition"} |
| #define XTERROR_UNDEF_MODIFY (xterror){500, NULL, "modify", "undefined-condition"} |
| #define XTERROR_UNDEF_WAIT (xterror){500, NULL, "wait", "undefined-condition"} |
| #define XTERROR_UNEXPECTED (xterror){400, N_("Unexpected Request"), "wait", "unexpected-request"} |
| #define ZONE zonestr(__FILE__,__LINE__) |
Referenced by _dialback_beat_idle(), _dialback_beat_in_idle(), _dialback_beat_out_idle(), _dialback_miod_hash_cleanup(), _js_authreg_auth(), _js_authreg_register(), _js_hosts_del(), _js_session_end(), _js_session_from(), _js_session_to(), _js_users_del(), _jsm_shutdown(), _mio_ssl_cleanup(), _mio_ssl_read(), _mio_ssl_write(), _mio_tls_cont_handshake_server(), _mio_write_dump(), _mio_xml_parser(), _xdb_file_purge(), _xdb_get_hashes(), acl_check_access(), base_accept(), base_connect(), base_dir(), base_file(), base_format(), base_importspool(), base_load(), base_stderr(), base_stdout(), base_syslog(), base_syslog_config(), base_to(), base_unsubscribe(), xmppd::proxy65::connected_sockets::connected_sockets(), deliver(), deliver_config_filter(), deliver_fail(), dialback(), dialback_beat_idle(), dialback_check_settings(), dialback_in_read(), dialback_in_read_db(), dialback_in_verify(), dialback_ip_get(), dialback_ip_set(), dialback_merlin(), dialback_miod_hash(), dialback_out_connect(), dialback_out_connection(), dialback_out_packet(), dialback_out_read(), dialback_out_read_db(), dnsrv(), dnsrv_child_main(), dnsrv_child_process_xstream_io(), dnsrv_lookup(), dnsrv_process_io(), dnsrv_process_xstream_io(), dnsrv_resend(), js_bounce_xmpp(), js_config(), js_deliver(), js_mapi_call2(), js_mapi_register(), js_mapi_session(), js_offline_main(), js_packet(), js_psend(), js_sc_session_new(), js_server_main(), js_session_end(), js_session_from(), js_session_new(), js_session_to(), js_user(), js_users_gc(), jsm(), jsm_shutdown(), log_generic(), logger(), main(), mio_close(), mio_listen(), mio_new(), mio_ssl_init(), mio_ssl_starttls(), mio_stop(), mio_write(), mio_xml_starttls(), mod_agents(), mod_auth_crypt(), mod_auth_digest(), mod_auth_plain(), mod_last(), mod_log(), mod_offline(), mod_presence(), mod_privacy(), mod_register(), mod_useridpolicy(), mtq_new(), mtq_send(), pthsock_client(), register_instance(), register_routing_update_callback(), xmppd::proxy65::socks5stub::socks5stub(), srv_lookup(), unregister_instance(), xdb_convert_spool(), xdb_file(), xdb_file_load(), xdb_file_phandler(), xdb_file_purge(), xdb_get(), and xdb_sql().
| typedef struct jlimit_struct _jlimit |
| typedef struct jpacket_struct _jpacket |
| typedef struct pool_struct _pool |
| typedef struct streamerr_struct _streamerr |
| typedef struct xstream_struct _xstream |
| typedef xmppd::jabberid_pool* jid |
| typedef struct jlimit_struct * jlimit |
| typedef struct jpacket_struct * jpacket |
| typedef struct pool_struct * pool |
| typedef void(* pool_cleaner)(void *arg) |
| typedef struct streamerr_struct * streamerr |
structure that contains information about a stream error
| typedef struct terror_struct terror |
| typedef unsigned int uint32 |
| typedef void(* xhash_walker)(xht h, const char *key, void *val, void *arg) |
| typedef xmppd::xhash<void*>* xht |
| typedef std::vector<xmlnode> xmlnode_vector |
container, that contains a vector of xmlnodes
This has been a pointer to a special struct in former versions of jabberd14, but we are now using a standard container. Declaring this type to keep the syntax of the interface. So don't be confused by the name of this type, it is not a single item but the complete vector.
| typedef struct xstream_struct * xstream |
| typedef void(* xstream_onNode)(int type, xmlnode x, void *arg) |
| typedef struct xterror_struct xterror |
| enum streamerr_reason |
error cause types for streams, see section 4.7.3 of RFC 3920
| enum streamerr_severity |
severity of stream error (well all stream errors are unrecoverable, but we might log them different
| pool _pool_new | ( | char * | zone, | |
| int | line | |||
| ) |
make an empty pool
Use the macro pool_new() instead of a direct call to this function. The macro will create the parameters for you.
| zone | the file in which the pool_new macro is called | |
| line | the line in the file in which the pool_new macro is called |
References _retried__malloc(), pool_struct::cleanup, pool_struct::heap, pool_struct::size, xhash_new(), and xhash_put().
Referenced by _pool_new_heap().
| pool _pool_new_heap | ( | int | size, | |
| char * | zone, | |||
| int | line | |||
| ) |
create a new memory pool and set the initial heap size
| size | the initial size of the memory pool | |
| zone | the file where this function is called (for debugging) | |
| line | the line in the file where this function is called |
References _pool_heap(), _pool_new(), and pool_struct::heap.
| size_t base64_decode | ( | const char * | source, | |
| unsigned char * | target, | |||
| size_t | targetlen | |||
| ) |
decode base64 encoded data
| source | the encoded data (zero terminated) | |
| target | pointer to the target buffer | |
| targetlen | length of the target buffer |
Referenced by dialback_in_read_db(), and str_b64decode().
| int base64_encode | ( | unsigned char * | source, | |
| size_t | sourcelen, | |||
| char * | target, | |||
| size_t | targetlen | |||
| ) |
encode an array of bytes using Base64 (RFC 3548)
| source | the source buffer | |
| sourcelen | the length of the source buffer | |
| target | the target buffer | |
| targetlen | the length of the target buffer |
Referenced by dialback_out_read().
| void crc32_r | ( | const char * | str, | |
| char | crc32buf[9] | |||
| ) |
calculate a 32 bit CRC value with the polynom c(x) = 1+x+x^2+x^4+x^5+x^7+x^8+x^10+x^11+x^12+x^16+x^22+x^23+x^26+x^32 on a given string. We are initializing with zero and we are not inverting the result
| str | the string for which we calculate the CRC | |
| crc32buf | where to put the result |
References CRC32_UPDATE.
Referenced by _xdb_get_hashes().
| void expat_charData | ( | void * | userdata, | |
| const char * | s, | |||
| int | len | |||
| ) |
callback function for CDATA nodes
This function will insert CDATA in an xmlnode
| userdata | pointer to the current xmlnode | |
| s | pointer to the CDATA string (not zero terminated!) | |
| len | length of the CDATA string |
References _expat_callback_data::x, and xmlnode_insert_cdata().
Referenced by xmlnode_file(), and xmlnode_str().
| void expat_endElement | ( | void * | userdata, | |
| const char * | name | |||
| ) |
callback function used for end elements
This function is used internally by expat.c as a callback function given to expat. It will complete an xmlnode and update the userdata pointer to point to the node that is parent of the next starting element.
| userdata | pointer to the current xmlnode | |
| name | name of the ending element (ignored by this function) |
References _expat_callback_data::x, and xmlnode_get_parent().
Referenced by xmlnode_file(), and xmlnode_str().
| void expat_startElement | ( | void * | userdata, | |
| const char * | name, | |||
| const char ** | atts | |||
| ) |
callback function used for start elements
This function is used internally by expat.c as a callback function given to expat. It will create a new xmlnode and add it to the already created xmlnode tree.
| userdata | pointer to the parent xmlnode instance (NULL if this function is called for the root note) | |
| name | name of the starting element | |
| atts | attributes that are contained in the start element |
References xmppd::ns_decl_list::get_nsprefix(), j_strcmp(), _expat_callback_data::ns, NS_DIALBACK, NS_STREAM, _expat_callback_data::parse_pool, pstrdup(), _expat_callback_data::x, xmlnode_insert_tag_ns(), xmlnode_new_tag_ns(), xmlnode_put_expat_attribs(), and XMLNS_SEPARATOR.
Referenced by xmlnode_file(), and xmlnode_str().
| void hmac_sha1_ascii_r | ( | char const * | secret, | |
| unsigned char const * | message, | |||
| size_t | len, | |||
| char | hmac[41] | |||
| ) |
Calculate the HMAC-SHA1 for a given block of data, the result a string containing the hmac as hex value
| secret | the key to use | |
| message | the message to calculate the HMAC-SHA1 for | |
| len | the length of the message in bytes | |
| hmac | where to place the result |
Referenced by dialback_get_loopcheck_token(), and dialback_merlin().
| int j_atoi | ( | const char * | a, | |
| int | def | |||
| ) |
| int j_strcasecmp | ( | const char * | a, | |
| const char * | b | |||
| ) |
NULL pointer save version of strcasecmp()
If one of the parameters contains a NULL pointer, the string is considered to be unequal
| a | the one string | |
| b | the other string |
Referenced by dialback_in_read_db(), dialback_out_read(), and xmlnode_select_by_lang().
| char* j_strcat | ( | char * | dest, | |
| char * | txt | |||
| ) |
NULL pointer save version of strcat()
| dest | where to append the string | |
| txt | what to append |
| int j_strcmp | ( | const char * | a, | |
| const char * | b | |||
| ) |
NULL pointer save version of strcmp
If one of the parameters contains a NULL pointer, the string is considered to be unequal.
| a | the one string | |
| b | the other string |
Referenced by _js_routed_packet(), _js_routed_session_control_packet(), _xdb_convert_hostspool(), acl_get_users(), deliver_fail(), dialback_check_settings(), dialback_in_read(), dialback_in_read_db(), dialback_in_verify(), dialback_out_packet(), dialback_out_read(), dialback_out_read_db(), dialback_packets(), dnsrv(), dnsrv_deliver(), expat_startElement(), xmppd::instance_base::get_instance_config(), jlimit_check(), jpacket_subtype(), js_bounce_xmpp(), js_sc_session_new(), js_session_end(), js_session_get(), js_session_new(), jsm(), jutil_regkey(), log_get_facility(), log_get_level(), main(), mio_ssl_init(), mod_dynamic(), mod_log(), mod_presence(), pthsock_client(), xdb_file_load(), xdb_file_phandler(), xdb_sql(), xmlnode_get_attrib(), xmlnode_get_tag(), xmlnode_get_tags(), xmlnode_insert_tag_ns(), xmlnode_new_tag_pool(), xmlnode_new_tag_pool_ns(), xmlnode_put_attrib(), xmlnode_put_attrib_ns(), xmlnode_put_expat_attribs(), and xstream_parse_error().
| char* j_strdup | ( | const char * | str | ) |
NULL pointer save version of strdup()
| str | the string the should be duplicated |
| int j_strlen | ( | const char * | a | ) |
NULL pointer save version of strlen
If the parameter contains a NULL pointer, 0 is returned
| a | the string for which the length should be calculated |
Referenced by dialback_in_read_db(), js_session_get(), jutil_msgnew(), jutil_presnew(), log_generic(), logger(), main(), srv_lookup(), xdb_file_phandler(), and xmlnode2file_limited().
| int j_strncasecmp | ( | const char * | a, | |
| const char * | b, | |||
| int | i | |||
| ) |
NULL pointer save version of strncasecmp()
If one of the parameters contains a NULL pointer, the string is considered to be unequal
| a | the first string | |
| b | the second string | |
| i | how many characters to compare at most |
| int j_strncmp | ( | const char * | a, | |
| const char * | b, | |||
| int | i | |||
| ) |
NULL pointer save version of strncmp()
If one of the parameters contains a NULL pointer, the string is considered to be unequal
| a | the first string | |
| b | the second string | |
| i | how many characters to compare at most |
Referenced by dialback_check_settings(), js_session_get(), xmlnode_get_attrib(), xmlnode_hide_attrib(), and xmlnode_put_attrib().
References xmppd::jabberid_pool::get_pool(), jid_cmp(), jid_full(), jid_new(), and xmppd::jabberid_pool::next.
Referenced by acl_get_users(), mod_log(), and mod_presence().
Referenced by _js_session_from(), and jid_append().
References xmppd::jabberid::compare(), JID_RESOURCE, JID_SERVER, and JID_USER.
Referenced by _js_session_from(), acl_check_access(), js_deliver(), js_remove_seen(), and js_remove_trustee().
| char* jid_full | ( | jid | id | ) |
Referenced by _dialback_miod_hash_cleanup(), _dialback_walk_in_connecting(), _dialback_walk_in_established(), _dialback_walk_out_connecting(), _dialback_walk_out_established(), _js_routed_error_packet(), _js_routed_packet(), _js_routed_session_control_packet(), _js_routed_session_packet(), _js_session_from(), _js_session_to(), acl_check_access(), deliver(), dialback_in_read(), dialback_in_read_db(), dialback_in_verify(), dialback_miod_hash(), dialback_out_connect(), dialback_out_connection(), dialback_out_connection_cleanup(), dialback_out_packet(), dialback_out_read(), jid_append(), js_deliver(), js_offline_main(), js_sc_session_new(), js_session_end(), js_session_new(), js_session_route(), js_user(), xdb_file_phandler(), and xdb_get().
create a new jid
References pool_cleanup().
Referenced by _js_routed_packet(), _js_routed_session_control_packet(), _js_session_from(), acl_get_users(), deliver(), dialback(), dialback_in_read(), dialback_in_read_db(), dialback_in_verify(), dialback_miod_hash(), dialback_out_connection(), dialback_out_packet(), dialback_packets(), dnsrv(), dnsrv_deliver(), dpacket_new(), jid_append(), jid_user_pool(), jpacket_reset(), js_config(), js_sc_session_new(), js_session_new(), js_user(), main(), mod_dynamic(), mod_log(), mod_presence(), pthsock_client(), xdb_file(), and xdb_sql().
| void jid_set | ( | jid | id, | |
| const char * | str, | |||
| int | item | |||
| ) |
set part of a jabberid
References JID_RESOURCE, JID_SERVER, and JID_USER.
Referenced by _dialback_walk_in_connecting(), _dialback_walk_in_established(), _dialback_walk_out_connecting(), _dialback_walk_out_established(), dialback_in_read(), dialback_in_read_db(), dialback_in_verify(), dialback_out_packet(), and js_session_new().
References xmppd::jabberid_pool::get_pool(), and jid_user_pool().
Referenced by _js_authreg_register(), and js_user().
Returns the same jid but without the resource.
Returns the jid, if it does not contain a resource, else a new jid is created.
If memory needs to be allocated, the given memory pool is used.
| a | the original jid | |
| p | the memory pool to use |
References xmppd::jabberid::get_user(), and jid_new().
Referenced by _js_session_from(), and jid_user().
| int jlimit_check | ( | jlimit | r, | |
| char * | key, | |||
| int | points | |||
| ) |
update/check a key in a jlimit instance
Each jlimit instance can track many limits (that have the same setup). The limit is selected by the key, which can be an IP address.
| r | the jlimit instance | |
| key | for which key the limit should be checked | |
| points | how many points of the limit should be consumed |
References j_strcmp(), jlimit_struct::key, jlimit_struct::maxp, jlimit_struct::maxt, jlimit_struct::points, and jlimit_struct::start.
| void jlimit_free | ( | jlimit | r | ) |
free a jlimit instance
| r | the jlimit instance that should be freed |
References jlimit_struct::key, jlimit_struct::p, and pool_free().
Referenced by mio_rate().
| jlimit jlimit_new | ( | int | maxt, | |
| int | maxp | |||
| ) |
create a new instance of jlimit that is used to limit events
limit the events to maxp points per maxt seconds
| maxt | time interval (in seconds) after which the points are cleared | |
| maxp | maximum number of points available for the time interval given in maxt |
References jlimit_struct::key, jlimit_struct::maxp, jlimit_struct::maxt, jlimit_struct::p, pmalloc(), jlimit_struct::points, pool_new, and jlimit_struct::start.
Referenced by mio_rate().
create a new jpacket by wrapping an xmlnode
| x | the xmlnode that should be wrapped |
References jpacket_reset(), pmalloc(), jpacket_struct::x, and xmlnode_pool().
Referenced by _js_routed_packet(), dialback_miod_read(), js_bounce_xmpp(), js_mapi_create_additional_iq_result(), js_packet(), and xmppd::instance_base::on_stanza_packet().
recalculate the information the jpacket holds about the stanza
| p | the packet that should get its information recalculated |
References jpacket_struct::from, jpacket_struct::iq, jpacket_struct::iqns, jid_new(), JPACKET__AVAILABLE, JPACKET__ERROR, JPACKET__INVISIBLE, JPACKET__PROBE, JPACKET__UNAVAILABLE, JPACKET_IQ, JPACKET_MESSAGE, JPACKET_PRESENCE, JPACKET_S10N, JPACKET_UNKNOWN, NS_SERVER, NTYPE_TAG, jpacket_struct::p, pstrdup(), jpacket_struct::subtype, jpacket_struct::to, xmlnode_t::type, jpacket_struct::type, jpacket_struct::x, xmlnode_get_attrib_ns(), xmlnode_get_firstchild(), xmlnode_get_localname(), xmlnode_get_namespace(), xmlnode_get_nextsibling(), xmlnode_hide_attrib_ns(), and xmlnode_pool().
Referenced by _js_routed_auth_packet(), _js_session_from(), and jpacket_new().
| int jpacket_subtype | ( | jpacket | p | ) |
get the subtype of a jpacket
| p | the jpacket for which the caller wants to know the subtype |
References j_strcmp(), JPACKET__CHAT, JPACKET__ERROR, JPACKET__GET, JPACKET__GROUPCHAT, JPACKET__HEADLINE, JPACKET__NONE, JPACKET__RESULT, JPACKET__SET, JPACKET__SUBSCRIBE, JPACKET__SUBSCRIBED, JPACKET__UNKNOWN, JPACKET__UNSUBSCRIBE, JPACKET__UNSUBSCRIBED, JPACKET_IQ, JPACKET_MESSAGE, JPACKET_S10N, jpacket_struct::subtype, jpacket_struct::type, jpacket_struct::x, and xmlnode_get_attrib_ns().
Referenced by _js_authreg_auth(), _js_authreg_register(), _js_session_from(), _js_session_to(), js_authreg(), js_mapi_create_additional_iq_result(), and js_online().
| void jutil_delay | ( | xmlnode | msg, | |
| char const * | reason | |||
| ) |
wrapper around jutil_error_xmpp for compatibility with modules for jabberd up to version 1.4.3
| x | the xmlnode that should become an stanza error message | |
| E | the strucutre that holds the error information |
References jutil_error_map(), and jutil_error_xmpp().
map a terror structure to a xterror structure
terror structures have been used in jabberd14 up to version 1.4.3 but are not able to hold XMPP compliant stanza errors. The xterror structure has been introduced to be XMPP compliant. This function is to ease writting wrappers that accept terror structures and call the real functions that require now xterror structures
| old | the terror struct that should be converted | |
| mapped | pointer to the xterror struct that should be filled with the converted error |
References terror_struct::code, xterror_struct::code, xterror_struct::condition, xterror_struct::msg, terror_struct::msg, and xterror_struct::type.
Referenced by jutil_error().
update an xmlnode to be the error stanza for itself
| x | the xmlnode that should become an stanza error message | |
| E | the structure that holds the error information |
References xterror_struct::code, xterror_struct::condition, jutil_tofrom(), messages_get(), xterror_struct::msg, NS_SERVER, NS_XMPP_STANZAS, xterror_struct::type, xmlnode_get_lang(), xmlnode_insert_cdata(), xmlnode_insert_tag_ns(), and xmlnode_put_attrib_ns().
Referenced by _js_authreg_auth(), _js_authreg_register(), _js_session_from(), xmppd::instance_base::bounce_stanza(), deliver_fail(), dnsrv_resend(), js_authreg(), js_bounce_xmpp(), and jutil_error().
| xmlnode jutil_iqnew | ( | int | type, | |
| char const * | ns | |||
| ) |
change and xmlnode to be the result xmlnode for the original iq query
| x | the xmlnode that should become the result for itself |
References jutil_tofrom(), xmlnode_get_firstchild(), xmlnode_get_nextsibling(), xmlnode_hide(), and xmlnode_put_attrib_ns().
Referenced by js_bounce_xmpp(), and js_mapi_create_additional_iq_result().
| xmlnode jutil_msgnew | ( | char const * | type, | |
| char const * | to, | |||
| char const * | subj, | |||
| char const * | body | |||
| ) |
utility for making message stanzas
| type | the type of the message (as a string!) | |
| to | the recipient of the message | |
| subj | the subject of the message (NULL for no subject element) | |
| body | the body of the message |
References j_strlen(), NS_SERVER, xmlnode_insert_cdata(), xmlnode_insert_tag_ns(), xmlnode_new_tag_ns(), and xmlnode_put_attrib_ns().
| xmlnode jutil_presnew | ( | int | type, | |
| char const * | to, | |||
| char const * | status | |||
| ) |
utility for making presence stanzas
| type | the type of the presence (one of the JPACKET__* contants) | |
| to | to whom the presence should be sent, NULL for a broadcast presence | |
| status | optional status (CDATA for the <status/> element, NULL for no <status/> element) |
References j_strlen(), JPACKET__INVISIBLE, JPACKET__PROBE, JPACKET__SUBSCRIBE, JPACKET__SUBSCRIBED, JPACKET__UNAVAILABLE, JPACKET__UNSUBSCRIBE, JPACKET__UNSUBSCRIBED, NS_SERVER, xmlnode_insert_cdata(), xmlnode_insert_tag_ns(), xmlnode_new_tag_ns(), and xmlnode_put_attrib_ns().
Referenced by js_sc_session_new(), js_session_end(), and js_session_new().
| int jutil_priority | ( | xmlnode | x | ) |
returns the priority on an available presence packet
| x | the xmlnode containing the presence packet |
References NS_SERVER, xhash_free(), xhash_new(), xhash_put(), xmlnode_get_attrib_ns(), xmlnode_get_data(), xmlnode_get_list_item(), and xmlnode_get_tags().
| char* jutil_regkey | ( | char * | key, | |
| char * | seed | |||
| ) |
create or validate a key value for stone-age jabber protocols
Before dialback had been introduced for s2s (and therefore only in jabberd 1.0), Jabber used these keys to protect some iq requests. A client first had to request a key with a IQ get and use it inside the IQ set request. By being able to receive the key in the IQ get response, the client (more or less) proved to be who he claimed to be.
The implementation of this function uses a static array with KEYBUF entries (default value of KEYBUF is 100). Therefore a key gets invalid at the 100th key that is created afterwards. It is also invalidated after it has been validated once.
| key | for validation the key the client sent, for generation of a new key NULL | |
| seed | the seed for generating the key, must stay the same for the same user |
References j_strcmp(), KEYBUF, and shahash().
| char* jutil_timestamp | ( | void | ) |
get the present time as a textual timestamp in the format YYYYMMDDTHH:MM:SS
Referenced by jutil_delay().
| char* jutil_timestamp_ms | ( | char * | buffer | ) |
| void jutil_tofrom | ( | xmlnode | x | ) |
reverse sender and destination of a packet
| x | the xmlnode where sender and receiver should be exchanged |
References xmlnode_get_attrib_ns(), and xmlnode_put_attrib_ns().
Referenced by _js_authreg_auth(), _js_authreg_register(), _js_routed_session_control_packet(), _js_routed_session_packet(), deliver_fail(), dialback_in_read_db(), dialback_out_connection_cleanup(), dialback_out_packet(), jutil_error_xmpp(), and jutil_iqresult().
| int karma_check | ( | struct karma * | k, | |
| long | bytes_read | |||
| ) |
check the karma for a connection
| k | the karma that should be checked | |
| bytes_read | the number of bytes, that have been read on a connection, that is karma controlled |
References karma_decrement(), karma_increment(), and karma::val.
make a copy of a karma structure
| new_instance | pointer to the destination (the structure must already exist) | |
| old | pointer to the values, that should be copied |
References karma::bytes, karma::dec, karma::inc, karma::last_update, karma::max, karma::penalty, karma::reset_meter, karma::restore, and karma::val.
Referenced by mio_karma2().
| void karma_decrement | ( | struct karma * | k, | |
| long | bytes_read | |||
| ) |
update karma: there was traffic, that has to be considered for karma calculations
Traffic reduces karma, passed time increments karma
| k | the karma structure to update | |
| bytes_read | the ammount of bytes that have been read on a connection, that is karma controlled |
References karma::bytes, karma::dec, KARMA_READ_MAX, karma::penalty, and karma::val.
Referenced by karma_check().
| void karma_increment | ( | struct karma * | k | ) |
update karma: if karma is incremented, it means that additional bytes are now possible in the configured bandwidth
Traffic reduces karma, passed time increments karma
| k | the karma structure |
References karma::bytes, karma::inc, KARMA_HEARTBEAT, KARMA_READ_MAX, karma::last_update, karma::max, karma::reset_meter, karma::restore, and karma::val.
Referenced by karma_check().
create a new karma structure
| p | memory pool to allocate the memory on |
References karma::bytes, karma::dec, karma::inc, KARMA_DEC, KARMA_INC, KARMA_INIT, KARMA_MAX, KARMA_PENALTY, KARMA_RESETMETER, KARMA_RESTORE, karma::last_update, karma::max, karma::penalty, pmalloco(), karma::reset_meter, karma::restore, and karma::val.
Referenced by mio_init(), and pthsock_client().
| struct in_addr* make_addr | ( | char const * | host | ) | [read] |
convert an IPv4 address or hostname to a in_addr structure
| host | the IPv4 address or hostname to convert, on NULL, the hostname is used |
References MAXHOSTNAMELEN.
Referenced by make_netsocket().
| int make_netsocket | ( | u_short | port, | |
| char const * | host, | |||
| int | type | |||
| ) |
Simple wrapper to make socket creation easy.
| port | port number of the socket | |
| host | hostname where to connect to or listen on | |
| type | type of socket (NETSOCKET_SERVER, NETSOCKET_CLIENT; or NETSOCKET_UDP) |
References make_addr(), NETSOCKET_CLIENT, NETSOCKET_SERVER, and NETSOCKET_UDP.
Referenced by make_netsocket2(), and mio_listen().
| int make_netsocket2 | ( | Glib::ustring | servname, | |
| Glib::ustring | nodename, | |||
| int | type | |||
| ) |
Simple wrapper to create sockets
| servname | the service name (currently this has to be a numeric port number) | |
| nodename | the hostname where to connect to or listen on | |
| type | type of socket (NETSOCKET_SERVER, NETSOCKET_CLIENT, or NETSOCKET_UDP) |
References make_netsocket().
| const char* messages_get | ( | const char * | lang, | |
| const char * | message | |||
| ) |
get a translated message from the static messages instance
| lang | the language (XML language token) to get the message for | |
| message | the message to get a translation for |
References messages::get().
Referenced by _dialback_out_beat_packets(), _js_routed_session_control_packet(), _js_routed_session_packet(), deliver_fail(), dialback_out_connection_cleanup(), js_session_end(), js_session_route(), jutil_delay(), and jutil_error_xmpp().
| void messages_set_mapping | ( | const char * | lang, | |
| const char * | locale_name | |||
| ) |
define a mapping from a language token in XML to a system locale for the static messages instance
| lang | the XML language token | |
| locale_name | the system locale name |
References messages::set_mapping().
Referenced by configurate().
| void* pmalloc | ( | pool | p, | |
| int | size | |||
| ) |
allocate memory from a memory pool
| p | the pool to use | |
| size | how much memory to allocate |
References _pool__free, _pool_cleanup_append(), _pool_free(), _pool_heap(), _retried__malloc(), pheap::block, pool_struct::heap, pool_struct::size, pheap::size, and pheap::used.
Referenced by jlimit_new(), jpacket_new(), pmalloc_x(), pmalloco(), pstrdup(), strescape(), strunescape(), and xmlnode_insert_cdata().
| void* pmalloc_x | ( | pool | p, | |
| int | size, | |||
| char | c | |||
| ) |
allocate memory and initialize the memory with the given char c
| p | which pool to use | |
| size | the size of the allocation | |
| c | the initialization character |
References pmalloc().
| void* pmalloco | ( | pool | p, | |
| int | size | |||
| ) |
allocate memory and initialize the memory with zero bytes
easy safety utility (for creating blank mem for structs, etc)
| p | which pool to use | |
| size | the size of the allocation |
References pmalloc().
Referenced by _new_beat(), deliver(), dialback(), dialback_in_read_db(), dialback_merlin(), dialback_miod_hash(), dialback_miod_new(), dialback_out_connection(), dialback_out_packet(), dialback_out_read(), dialback_out_read_db(), dnsrv(), dnsrv_lookup(), dpacket_new(), js_mapi_register(), js_mapi_session(), js_psend(), js_sc_session_new(), js_session_new(), js_user(), jsm(), karma_new(), mio_connect(), mio_handlers_new(), mio_init(), mio_new(), mio_write(), mod_announce(), mod_last(), mod_offline(), mod_presence(), mod_stat(), mod_version(), mtq_new(), mtq_send(), pthsock_client(), register_config(), register_phandler(), register_routing_update_callback(), register_shutdown(), srv_lookup(), srv_port2str(), xdb_cache(), xdb_file(), xdb_file_load(), xmlnode_insert_tag(), xmlnode_new_tag_pool(), xmlnode_wrap(), and xstream_new().
| void pool_cleanup | ( | pool | p, | |
| pool_cleaner | f, | |||
| void * | arg | |||
| ) |
public cleanup utils, insert in a way that they are run FIFO, before mem frees
References _pool_free(), pool_struct::cleanup, and pfree::next.
Referenced by _mio_xstream_init(), dialback(), dialback_miod_hash(), dialback_out_connection(), dnsrv(), jid_new(), js_sc_session_new(), js_session_new(), js_user(), mio_ssl_starttls(), mtq_new(), pthsock_client(), xdb_file(), xdb_sql(), xmlnode_new_tag_pool(), xmlnode_new_tag_pool_ns(), and xstream_new().
| void pool_free | ( | pool | p | ) |
free a pool (and all memory that is allocated in it)
| p | which pool to free |
References _pool__free, pfree::arg, pool_struct::cleanup, pfree::f, pfree::next, and xhash_zap().
Referenced by _js_session_end(), _js_users_del(), _mio_write_dump(), acl_check_access(), deliver(), deliver_config_filter(), deliver_fail(), dialback_out_connection_cleanup(), dnsrv_child_main(), heartbeat(), heartbeat_death(), instance_shutdown(), jlimit_free(), js_config(), js_sc_session_new(), main(), mio_cleanup(), mio_handlers_free(), mio_stop(), mio_write(), shutdown_callbacks(), xdb_convert_spool(), xdb_file_phandler(), xmlnode_file(), xmlnode_free(), and xmlnode_str().
| int pool_size | ( | pool | p | ) |
get the size of a memory pool
| p | the pool |
References pool_struct::size.
Referenced by xstream_eat().
| void pool_stat | ( | int | full | ) |
dummy implementation: print memory pool statistics (for debugging purposes, real implementation if POOL_DEBUG is defined)
| full | make a full report? (0 = no, 1 = yes) |
Referenced by main().
| char* pstrdup | ( | pool | p, | |
| const char * | src | |||
| ) |
duplicate a string and allocate memory for it
| p | the pool to use | |
| src | the string that should be duplicated |
References pmalloc().
Referenced by _dialback_out_beat_packets(), deliver_config_filter(), dialback(), dialback_in_read_db(), dialback_ip_get(), dialback_out_connection(), dialback_out_connection_cleanup(), dialback_out_read(), dnsrv(), dnsrv_deliver(), dpacket_new(), expat_startElement(), xmppd::jabberid_pool::full_pooled(), jpacket_reset(), js_packet(), js_sc_session_new(), js_session_new(), jsm(), main(), mio_connect(), mio_init(), mio_listen(), mod_version(), pstrdupx(), register_config(), register_instance(), srv_inet_ntoa(), srv_lookup(), srv_xhash_join(), unregister_instance(), xdb_file(), xdb_file_full(), xdb_file_load(), xdb_sql(), xhash_from_xml(), xmlnode_change_namespace(), xmlnode_get_name(), xmlnode_put_attrib(), xmlnode_put_attrib_ns(), xmlnode_put_expat_attribs(), xmlnode_serialize_string(), xstream_header_char(), and xstream_parse_error().
| char* pstrdupx | ( | pool | p, | |
| const char * | src | |||
| ) |
| void shaBlock | ( | unsigned char * | dataIn, | |
| int | len, | |||
| unsigned char | hashout[20] | |||
| ) |
References xmppd::sha1::final(), and xmppd::sha1::update().
| void shaFinal | ( | j_SHA_CTX * | ctx, | |
| unsigned char | hashout[20] | |||
| ) |
| char* shahash | ( | char const * | str | ) |
References shahash_r().
Referenced by jutil_regkey().
| void shahash_r | ( | const char * | str, | |
| char | hashbuf[41] | |||
| ) |
References xmppd::hash::final_hex(), and xmppd::sha1::update().
Referenced by dialback_randstr(), shahash(), and xstream_header().
| void shaInit | ( | j_SHA_CTX * | ctx | ) |
| void shaUpdate | ( | j_SHA_CTX * | ctx, | |
| unsigned char * | dataIn, | |||
| int | len | |||
| ) |
| void str_b64decode | ( | char * | str | ) |
decode a base64 string and put the result in the same buffer as the source
This function does not handle decoded data that contains the null byte very well as the size of the decoded data is not returned.
The result will be zero terminated.
| str | buffer for the source and the result |
References base64_decode().
| std::string strescape | ( | std::string | s | ) |
escape a string to be print as XML
| s | the original string |
| char* strescape | ( | pool | p, | |
| char * | buf | |||
| ) |
References pmalloc().
Referenced by xstream_header_char().
| void xhash_free | ( | xht | h | ) |
free a xhash structure
| h | the xhash to free |
Referenced by _jsm_shutdown(), configurate(), deliver(), deliver_config_filter(), deliver_shutdown(), dialback(), dnsrv(), js_session_free_aux_data(), js_user_free_aux_data(), jsm_shutdown(), jutil_priority(), main(), mio_init(), mio_ssl_init(), register_instance(), xmppd::resolver::resend_service::resend_service(), xdb_file_cleanup(), xdb_file_phandler(), and xhash_from_xml().
convert the xmlnode representation of an xhash back to an xhash
| hash | the xhash in xml notation |
References j_atoi(), NS_JABBERD_HASH, pstrdup(), xhash_free(), xhash_new(), xhash_put(), xmlnode_get_attrib_ns(), xmlnode_get_data(), xmlnode_get_list_item(), and xmlnode_get_tags().
Referenced by xdb_file_phandler().
| void* xhash_get | ( | xht | h, | |
| const char * | key | |||
| ) |
retrive a value from a xhash
| h | the xhash to get the value from | |
| key | which value to get |
Referenced by _dialback_miod_hash_cleanup(), _js_routed_packet(), _js_routed_session_control_packet(), configurate(), dialback_in_dbic_cleanup(), dialback_in_read_db(), dialback_in_verify(), dialback_ip_get(), dialback_ip_set(), dialback_out_connection(), dialback_out_packet(), dialback_out_read(), dnsrv_deliver(), dnsrv_lookup(), dnsrv_process_xstream_io(), js_deliver(), js_islocal(), js_packet(), js_user(), register_instance(), srv_lookup(), srv_xhash_join(), unregister_instance(), xdb_file_load(), and xmlnode_get_tags().
| void* xhash_get_by_domain | ( | xht | h, | |
| const char * | domain | |||
| ) |
retrive a value from a xhash ... considering the key to be a domain
In contrast to xhash_get() this function interprets the key as a domain and checks all higher level domains, if the key is not found in the hash. If now higher level domains are found either, the key '*' is tried.
Example: For the domain 'a.example.com' the following lookups are done in this order until there is the first match: 'a.example.com', 'example.com', 'com', and '*'.
| h | the xhash to get the value from | |
| domain | the domain which should be used as the key |
References xmppd::xhash< value_type >::get_by_domain().
Referenced by dialback_check_settings(), dialback_in_read(), dialback_in_read_db(), and dialback_out_read().
| xht xhash_new | ( | int | prima | ) |
create a new xhash hash collection
| prime | size of the hash (use a prime number!) |
Referenced by _js_authreg_register(), _pool_new(), acl_get_users(), configo(), configurate(), deliver(), deliver_config_filter(), deliver_init(), dialback(), dnsrv(), js_packet(), js_sc_session_new(), js_session_new(), js_user(), jsm(), jutil_priority(), main(), mio_init(), mio_ssl_init(), xmppd::proxy65::proxy65::proxy65(), pthsock_client(), register_instance(), xmppd::resolver::resend_service::resend_service(), srv_lookup(), xdb_file(), xdb_sql(), and xhash_from_xml().
| void xhash_put | ( | xht | h, | |
| const char * | key, | |||
| void * | val | |||
| ) |
put an entry in the xhash
| h | the hash to insert the entry in | |
| key | with which key the value should be entered | |
| val | the value, that should be entered |
Referenced by _js_authreg_register(), _pool_new(), acl_get_users(), configurate(), deliver(), deliver_config_filter(), dialback(), dialback_ip_set(), dialback_miod_hash(), dialback_out_connection(), dnsrv_lookup(), dnsrv_process_xstream_io(), js_packet(), js_sc_session_new(), js_user(), jsm(), jutil_priority(), main(), mio_init(), mio_ssl_init(), xmppd::proxy65::proxy65::proxy65(), pthsock_client(), register_instance(), xmppd::resolver::resend_service::resend_service(), srv_xhash_join(), unregister_instance(), xdb_file(), xdb_file_load(), xdb_sql(), and xhash_from_xml().
write the contents of an xhash to an xmlnode
| h | the xhash to be converted |
References NS_JABBERD_HASH, xhash_walk(), and xmlnode_new_tag_ns().
| void xhash_walk | ( | xht | h, | |
| xhash_walker | w, | |||
| void * | arg | |||
| ) |
iterate over a xhash strucutre
| h | the xhash to iterave over | |
| w | which function should be called for each value | |
| arg | what to pass to the optional argument of the xhash_walker function |
Referenced by _js_hosts_del(), _jsm_shutdown(), deliver(), deliver_routed_hosts(), dialback_beat_idle(), dialback_out_beat_packets(), dnsrv_beat_packets(), instance_shutdown(), js_users_gc(), jsm_serialize(), jsm_shutdown(), xdb_file_purge(), and xhash_to_xml().
| void xhash_zap | ( | xht | h, | |
| const char * | key | |||
| ) |
remove an entry from the xhash
| h | the xhash where a value should be removed | |
| key | the key of the value, that should be removed |
Referenced by _dialback_miod_hash_cleanup(), _dnsrv_beat_packets(), _js_users_del(), _xdb_file_purge(), dialback_in_dbic_cleanup(), dialback_out_connection_cleanup(), dnsrv_deliver(), dnsrv_process_xstream_io(), instance_shutdown(), js_session_end(), pool_free(), unregister_instance(), and xdb_file_phandler().
| int xmlnode2file | ( | char const * | file, | |
| xmlnode | node | |||
| ) |
write an xmlnode to a file (without a size limit)
| file | the target file | |
| node | the xmlnode that should be written |
References xmlnode2file_limited().
Referenced by jsm_serialize(), and main().
| int xmlnode2file_limited | ( | char const * | file, | |
| xmlnode | node, | |||
| size_t | sizelimit | |||
| ) |
write an xmlnode to a file, limited by size
| file | the target file | |
| node | the xmlnode that should be written | |
| sizelimit | the maximum length of the file to be written |
References j_strlen(), and xmlnode_serialize_string().
Referenced by xdb_file_phandler(), and xmlnode2file().
| void xmlnode_change_namespace | ( | xmlnode | node, | |
| const char * | ns_iri | |||
| ) |
change the namespace of a node
| node | the node to change the namespace for | |
| ns_iri | the new namespace of the node |
References xmlnode_t::ns_iri, NS_XMLNS, xmlnode_t::prefix, pstrdup(), xmlnode_get_attrib_ns(), xmlnode_pool(), and xmlnode_put_attrib_ns().
Referenced by xdb_file_load().
produce full duplicate of x with a new pool
| x | xmlnode (tag) that should be duplicated using a new memory pool |
References xmlnode_t::name, xmlnode_t::ns_iri, xmlnode_t::prefix, xmlnode_get_firstattrib(), xmlnode_get_firstchild(), xmlnode_has_children(), xmlnode_insert_node(), and xmlnode_new_tag_ns().
Referenced by dialback_out_connection_cleanup(), dialback_out_read(), dpacket_copy(), and js_mapi_create_additional_iq_result().
produce a full duplicate of a x using the specified memory pool
| p | memory pool to use | |
| x | xmlnode (tag) that should be duplicated |
References xmlnode_t::name, xmlnode_t::ns_iri, xmlnode_t::prefix, xmlnode_get_firstattrib(), xmlnode_get_firstchild(), xmlnode_has_children(), xmlnode_insert_node(), and xmlnode_new_tag_pool_ns().
| xmlnode xmlnode_file | ( | const char * | file | ) |
create an xmlnode instance (possibly including other xmlnode instances) by parsing a file
This function will parse a file containing an XML document and create an xmlnode graph
| file | the filename |
References expat_charData(), expat_endElement(), expat_startElement(), _expat_callback_data::ns, _expat_callback_data::parse_pool, pool_free(), pool_new, _expat_callback_data::x, xmlnode_free(), and XMLNS_SEPARATOR.
Referenced by configurate(), jsm_deserialize(), main(), and xdb_file_load().
| char const* xmlnode_file_borked | ( | char const * | file | ) |
get message why parsing of a file failed
This function can be used to get a textual message why parsing an XML file failed.
| file | the filename |
References XMLNS_SEPARATOR.
Referenced by configurate(), and main().
| void xmlnode_free | ( | xmlnode | node | ) |
free the memory allocated by an xmlnode tree
No nodes inside the xmlnode tree can be used afterwards, as they are all freed by this function
| node | one of the elements inside a tree of xmlnodes that should be freed |
References xmlnode_t::p, and pool_free().
Referenced by _js_authreg_register(), _js_routed_error_packet(), _js_routed_packet(), _js_session_end(), _js_session_from(), _js_session_to(), _mio_xstream_cleanup(), _xdb_file_purge(), configurate(), dialback(), dialback_in_read(), dialback_in_read_db(), dialback_in_verify(), dialback_ip_set(), dialback_miod_read(), dialback_out_packet(), dialback_out_read(), dialback_out_read_db(), dialback_packets(), dnsrv(), dnsrv_child_process_xstream_io(), dnsrv_deliver(), dnsrv_process_xstream_io(), dpacket_new(), js_bounce_xmpp(), js_deliver(), js_mapi_call2(), js_packet(), js_session_end(), js_user(), jsm(), jsm_deserialize(), jsm_serialize(), main(), mio_write_root(), mod_auth_crypt(), mod_auth_digest(), mod_auth_plain(), mod_dynamic(), mod_last(), mod_log(), mod_offline(), mod_presence(), mod_version(), mod_xml(), xmppd::instance_base::on_subscription_stanza(), xdb_file(), xdb_file_phandler(), xdb_get(), xdb_sql(), xmlnode_file(), and xmlnode_str().
| char* xmlnode_get_attrib | ( | xmlnode | owner, | |
| const char * | name | |||
| ) |
get an attribute value
| owner | element where to look for the attribute | |
| name | name of the attribute of which the value should be returned |
References j_strcmp(), j_strncmp(), NS_XMLNS, and xmlnode_get_attrib_ns().
Referenced by dnsrv_deliver(), js_bounce_xmpp(), xdb_file_phandler(), and xmlnode_get_tag().
| char* xmlnode_get_attrib_ns | ( | xmlnode | owner, | |
| const char * | name, | |||
| const char * | ns_iri | |||
| ) |
get an attribute value
| owner | element where to look for the attribute | |
| name | local name of the attribute of which the value should be returned | |
| ns_iri | namespace IRI of the attribute of which the value should be returned |
References xmlnode_t::data, xmlnode_t::firstattrib, and NTYPE_ATTRIB.
Referenced by _js_authreg_register(), _js_routed_auth_packet(), _js_routed_packet(), _js_routed_session_control_packet(), _js_session_from(), _js_session_to(), acl_get_users(), configurate(), deliver(), deliver_config_filter(), deliver_fail(), dialback(), dialback_in_read(), dialback_in_read_db(), dialback_in_verify(), dialback_ip_get(), dialback_ip_set(), dialback_out_packet(), dialback_out_read(), dialback_packets(), dnsrv(), dnsrv_deliver(), dnsrv_process_xstream_io(), dnsrv_resend(), dpacket_new(), jpacket_reset(), jpacket_subtype(), js_authreg(), js_sc_session_new(), js_session_end(), js_session_new(), jsm(), jutil_delay(), jutil_priority(), jutil_tofrom(), mio_init(), mio_ssl_init(), mio_write_root(), mod_dynamic(), pthsock_client(), xmppd::resolver::resend_service::resend_service(), xdb_file_phandler(), xdb_sql(), xhash_from_xml(), xmlnode_change_namespace(), xmlnode_get_attrib(), xmlnode_get_lang(), and xstream_header_char().
| char* xmlnode_get_data | ( | xmlnode | node | ) |
return the text inside the element given as node
| node | the node to search for text nodes inside |
References xmlnode_t::data, xmlnode_t::next, NTYPE_CDATA, NTYPE_TAG, xmlnode_get_firstchild(), xmlnode_get_nextsibling(), and xmlnode_get_type().
Referenced by _js_authreg_register(), acl_get_users(), deliver(), deliver_config_filter(), dialback(), dialback_in_read_db(), dialback_out_read(), dnsrv(), dnsrv_child_process_xstream_io(), dnsrv_process_xstream_io(), js_packet(), jsm(), jutil_priority(), main(), mio_init(), mio_ssl_init(), mod_log(), mod_presence(), mod_version(), xmppd::ns_decl_list::ns_decl_list(), pthsock_client(), xmppd::resolver::resend_service::resend_service(), xdb_file(), xdb_file_phandler(), xdb_sql(), xhash_from_xml(), xmlnode_get_list_item_data(), xmlnode_get_tag(), xmlnode_get_tag_data(), xmlnode_insert_node(), and xstream_parse_error().
get the first attribute node of an element
iteration on all attributes is possible by using xmlnode_get_nextsibling() using the result of this function as the start
| parent | element for which the first attribute node should be returned |
References xmlnode_t::firstattrib.
Referenced by xmppd::ns_decl_list::ns_decl_list(), xmlnode_dup(), xmlnode_dup_pool(), xmlnode_get_tags(), and xmlnode_insert_tag_node().
get the first child node of a node
iteration on all childs is possible using xmlnode_get_nextsibling() using the result of this function as the start
| parent | element for which the first child should be returned |
References xmlnode_t::firstchild.
Referenced by _js_routed_error_packet(), _js_routed_packet(), configo(), deliver_fail(), dialback_in_read_db(), dialback_out_connection_cleanup(), dialback_out_read(), dialback_packets(), dnsrv_deliver(), xmppd::instance_base::get_instance_config(), jpacket_reset(), jutil_iqresult(), main(), mio_ssl_init(), mod_dynamic(), mod_log(), mod_presence(), pthsock_client(), xdb_file_phandler(), xdb_get(), xmlnode_dup(), xmlnode_dup_pool(), xmlnode_get_data(), xmlnode_get_tags(), xmlnode_insert_tag_node(), and xstream_parse_error().
| const char* xmlnode_get_lang | ( | xmlnode | node | ) |
get the declared language of a node
| node | the node to get the language for |
References NS_XML, NTYPE_TAG, xmlnode_t::parent, xmlnode_t::type, xmlnode_get_attrib_ns(), and xmlnode_get_lang().
Referenced by _dialback_out_beat_packets(), _js_routed_session_control_packet(), _js_routed_session_packet(), deliver_fail(), dialback_out_connection_cleanup(), js_session_end(), js_session_route(), jutil_delay(), jutil_error_xmpp(), xmlnode_get_lang(), xmlnode_select_by_lang(), xmlnode_wrap_ns(), and xstream_parse_error().
get the last child node of a node
(backwards) iteration on all childs is possible using xmlnode_get_prevsibling() using the result of this function as the start
| parent | element for which the last child should be returned |
References xmlnode_t::lastchild.
Referenced by dnsrv().
| xmlnode xmlnode_get_list_item | ( | const xmlnode_vector & | first, | |
| unsigned int | i | |||
| ) |
get the (i+1)-th element in a list of xmlnodes
| first | first list item | |
| i | which item to get (we start counting at zero) |
Referenced by _js_authreg_register(), _js_session_from(), _js_session_to(), dialback(), dialback_in_verify(), dialback_out_read(), dialback_packets(), jsm(), jutil_priority(), main(), mio_init(), mod_offline(), mod_version(), pthsock_client(), register_instance(), xdb_file(), xdb_file_phandler(), xdb_sql(), and xhash_from_xml().
| char* xmlnode_get_list_item_data | ( | const xmlnode_vector & | first, | |
| unsigned int | i | |||
| ) |
get that text wrapped by the (i+1)-th element in a list of xmlnodes
| first | pointer to the first list item | |
| i | which item to use |
References xmlnode_get_data().
Referenced by dialback(), and xdb_file().
| const char* xmlnode_get_localname | ( | xmlnode | node | ) |
get the local name of a node
| node | the node to get the local name for |
References xmlnode_t::name.
Referenced by _js_routed_packet(), dialback_in_read_db(), dialback_out_packet(), dialback_out_read(), dialback_out_read_db(), dnsrv(), dpacket_new(), jpacket_reset(), js_bounce_xmpp(), main(), mio_ssl_init(), mod_dynamic(), mod_log(), mod_presence(), xmppd::ns_decl_list::ns_decl_list(), pthsock_client(), and xstream_parse_error().
| char* xmlnode_get_name | ( | xmlnode | node | ) |
get the name of a node
| node | the node to get the name for |
References xmlnode_t::name, xmlnode_t::p, xmlnode_t::prefix, and pstrdup().
Referenced by configo(), dialback_packets(), and xmlnode_get_tag().
| const char* xmlnode_get_namespace | ( | xmlnode | node | ) |
get the namespace IRI of a node
| node | the node to get the namespace IRI for |
References xmlnode_t::ns_iri.
Referenced by _js_routed_packet(), deliver_fail(), dialback_in_read_db(), dialback_out_packet(), dialback_out_read(), dialback_out_read_db(), dialback_packets(), dnsrv(), xmppd::instance_base::get_instance_config(), jpacket_reset(), js_bounce_xmpp(), main(), mio_ssl_init(), mod_dynamic(), xmppd::ns_decl_list::ns_decl_list(), pthsock_client(), xdb_file_load(), and xstream_parse_error().
return the next sibling
this can be used together with xmlnode_get_firstchild() to iterate over the childrens of a node
| sibling | the node to get the next sibling for |
References xmlnode_t::next.
Referenced by _js_routed_packet(), configo(), dialback_out_connection_cleanup(), dialback_out_read(), xmppd::instance_base::get_instance_config(), jpacket_reset(), jutil_iqresult(), mio_ssl_init(), mod_dynamic(), mod_log(), mod_presence(), xmppd::ns_decl_list::ns_decl_list(), xdb_get(), xmlnode_get_data(), xmlnode_get_tag(), xmlnode_get_tags(), xmlnode_insert_node(), and xstream_parse_error().
| const char* xmlnode_get_nsprefix | ( | xmlnode | node | ) |
get the namespace prefix of a node
| node | the node to get the namespace prefix for |
References xmlnode_t::prefix.
Referenced by main().
get the parent node for a node
| node | the node for which the parent node should be returned |
References xmlnode_t::parent.
Referenced by expat_endElement(), main(), and xmlnode_get_tags().
return the previous sibling
this can be used together with xmlnode_get_lastchild() to iterate backwards over the childrens of a node
| sibling | the node to get the previous sibling for |
References xmlnode_t::prev.
Referenced by dnsrv().
find given tag in an xmlnode tree
| parent | pointer to the parent tag | |
| name | "name" for the child tag of that name, "name/name" for a sub child (recurses), "?attrib" to match the first tag with that attrib defined, "?attrib=value" to match the first tag with that attrib and value, "=cdata" to match the text node contents of the child, or any combination: "name/name/?attrib", "name=cdata", etc |
References xmlnode_t::firstchild, j_strcmp(), NTYPE_TAG, xmlnode_get_attrib(), xmlnode_get_data(), xmlnode_get_name(), xmlnode_get_nextsibling(), xmlnode_get_tag(), and xmlnode_get_type().
Referenced by jsm(), xdb_file_phandler(), xmlnode_get_tag(), and xmlnode_get_tag_data().
| char* xmlnode_get_tag_data | ( | xmlnode | parent, | |
| const char * | name | |||
| ) |
return the text wrapped inside the element found by the name parameter
this equals xmlnode_get_data(xmlnode_get_tag(parent, name))
| parent | the element where to search for the element defined by the name parameter | |
| name | search query for the element whichs textual content should be returned |
References xmlnode_get_data(), and xmlnode_get_tag().
| xmlnode_vector xmlnode_get_tags | ( | xmlnode | context_node, | |
| const char * | _path, | |||
| xht | namespaces | |||
| ) |
at all xmlnodes that match a path
The valid paths are a very small subset of xpath.
The only predicates we support is for existence of attributes, or for attribute values, we only support steps in the axis child and the axis must be ommited, we support text() as a step.
Examples:
| context_node | the xmlnode where to start the path | |
| path | the path (xpath like syntax, but only a small subset) | |
| namespaces | hashtable mapping namespace prefixes to namespace IRIs | |
| p | memory pool to use |
References j_strcmp(), xmlnode_t::name, xmlnode_t::ns_iri, NTYPE_CDATA, xmlnode_t::type, xhash_get(), xmlnode_get_firstattrib(), xmlnode_get_firstchild(), xmlnode_get_nextsibling(), and xmlnode_get_parent().
Referenced by _js_authreg_register(), _js_session_from(), _js_session_to(), acl_get_users(), configurate(), deliver(), deliver_config_filter(), dialback(), dialback_in_verify(), dialback_out_read(), dialback_packets(), js_config(), jsm(), jsm_deserialize(), jutil_priority(), main(), mio_init(), mod_offline(), mod_version(), mod_xml(), pthsock_client(), register_instance(), xmppd::resolver::resend_service::resend_service(), xdb_file(), xdb_file_phandler(), xdb_sql(), and xhash_from_xml().
| int xmlnode_get_type | ( | xmlnode | node | ) |
get the type of the node
| node | the node to get the type for |
References NTYPE_UNDEF, and xmlnode_t::type.
Referenced by _js_routed_packet(), configo(), dialback_out_read(), xmppd::instance_base::get_instance_config(), mod_dynamic(), mod_log(), mod_presence(), xdb_get(), xmlnode_get_data(), xmlnode_get_tag(), xmlnode_insert_node(), and xstream_parse_error().
| int xmlnode_has_children | ( | xmlnode | node | ) |
check if a node has child nodes
| node | the node to check |
References xmlnode_t::firstchild.
Referenced by xmlnode_dup(), xmlnode_dup_pool(), xmlnode_insert_tag_node(), and xstream_header_char().
| void xmlnode_hide | ( | xmlnode | child | ) |
hide (remove) a node from a document
| child | the xmlnode that should be hidden |
References xmlnode_t::firstattrib, xmlnode_t::firstchild, xmlnode_t::lastattrib, xmlnode_t::lastchild, xmlnode_t::next, NTYPE_ATTRIB, xmlnode_t::parent, xmlnode_t::prev, and xmlnode_t::type.
Referenced by deliver_fail(), dialback_in_read_db(), dialback_in_verify(), dialback_out_read(), jutil_iqresult(), main(), and xdb_file_phandler().
| void xmlnode_hide_attrib | ( | xmlnode | parent, | |
| const char * | name | |||
| ) |
hide (remove) an attribute of an element
| parent | the element for which an attribute should be hidden | |
| name | name of the attribute, that should be hidden |
References j_strncmp(), NS_XMLNS, and xmlnode_hide_attrib_ns().
| void xmlnode_hide_attrib_ns | ( | xmlnode | parent, | |
| const char * | name, | |||
| const char * | ns_iri | |||
| ) |
hide (remove) a namespaced attribute of an element
| parent | the element for which an attribute should be hidden | |
| name | local name of the attribute, that should be hidden | |
| ns_iri | namespace IRI of the attribute, that should be hidden |
References xmlnode_t::firstattrib, xmlnode_t::lastattrib, xmlnode_t::next, NTYPE_ATTRIB, and xmlnode_t::prev.
Referenced by _js_routed_packet(), _js_session_from(), _js_session_to(), dialback_out_packet(), dialback_out_read(), dialback_packets(), jpacket_reset(), js_authreg(), xdb_file_phandler(), and xmlnode_hide_attrib().
insert a text node as child to an existing xmlnode
| parent | where to insert the new text node | |
| CDATA | content of the text node to insert | |
| size | size of the string in CDATA, or -1 for auto-detection on null-terminated strings |
References xmlnode_t::data, xmlnode_t::data_sz, NTYPE_CDATA, xmlnode_t::p, and pmalloc().
Referenced by _mio_xstream_CDATA(), configurate(), dialback_in_read(), dialback_out_connection(), dialback_out_read(), dnsrv_lookup(), expat_charData(), js_bounce_xmpp(), jutil_delay(), jutil_error_xmpp(), jutil_msgnew(), jutil_presnew(), log_generic(), logger(), main(), xmlnode_insert_node(), and xstream_eat().
places copy of node and node's siblings in parent
| parent | where to place the copy to | |
| node | what to copy |
References xmlnode_t::name, xmlnode_t::ns_iri, NTYPE_ATTRIB, NTYPE_CDATA, NTYPE_TAG, xmlnode_t::prefix, xmlnode_get_data(), xmlnode_get_nextsibling(), xmlnode_get_type(), xmlnode_insert_cdata(), xmlnode_insert_tag_node(), and xmlnode_put_attrib_ns().
Referenced by dialback_in_read_db(), main(), xmlnode_dup(), xmlnode_dup_pool(), and xmlnode_insert_tag_node().
append a child tag to a tag
| parent | the xmlnode where the new element should be inserted | |
| name | name of the child tag |
References xmlnode_t::ns_iri, NTYPE_TAG, pmalloco(), xmlnode_t::prefix, and xmlnode_pool().
copy an element node as a child to an other node
| parent | where to insert the xmlnode | |
| node | node to insert |
References xmlnode_t::name, xmlnode_t::ns_iri, xmlnode_t::prefix, xmlnode_get_firstattrib(), xmlnode_get_firstchild(),