jabberd2
2.6.1
|
Go to the source code of this file.
Data Structures | |
struct | build_data |
parse a buffer into a nad More... | |
Macros | |
#define | _nad_ptr_check(func, nad) |
!!! Things to do (after 2.0) More... | |
#define | BLOCKSIZE 128 |
#define | NAD_SAFE(blocks, size, len) if((size) > len) len = _nad_realloc((void**)&(blocks),(size)); |
this is the safety check used to make sure there's always enough mem More... | |
Functions | |
static int | _nad_realloc (void **oblocks, int len) |
Reallocate the given buffer to make it larger. More... | |
static int | _nad_cdata (nad_t nad, const char *cdata, int len) |
internal: append some cdata and return the index to it More... | |
static int | _nad_attr (nad_t nad, int elem, int ns, const char *name, const char *val, int vallen) |
internal: create a new attr on any given elem More... | |
nad_t | nad_new (void) |
create a new nad More... | |
nad_t | nad_copy (nad_t nad) |
copy a nad More... | |
void | nad_free (nad_t nad) |
free that nad More... | |
int | nad_find_elem (nad_t nad, unsigned int elem, int ns, const char *name, int depth) |
locate the next elem at a given depth with an optional matching name More... | |
int | nad_find_attr (nad_t nad, unsigned int elem, int ns, const char *name, const char *val) |
get a matching attr on this elem, both name and optional val More... | |
int | nad_find_namespace (nad_t nad, unsigned int elem, const char *uri, const char *prefix) |
get a matching ns on this elem, both uri and optional prefix More... | |
int | nad_find_scoped_namespace (nad_t nad, const char *uri, const char *prefix) |
find a namespace in scope More... | |
int | nad_find_elem_path (nad_t nad, unsigned int elem, int ns, const char *name) |
find elem using XPath like query 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 "!attrib" to match the first tag without that attrib defined "!attrib=value" to match the first tag without that attrib and value or any combination: "name/name/?attrib", etc More... | |
void | nad_set_attr (nad_t nad, unsigned int elem, int ns, const char *name, const char *val, int vallen) |
create, update, or zap any matching attr on this elem More... | |
int | nad_insert_elem (nad_t nad, unsigned int parent, int ns, const char *name, const char *cdata) |
shove in a new child elem after the given one More... | |
void | nad_drop_elem (nad_t nad, unsigned int elem) |
remove an element (and its subelements) More... | |
void | nad_wrap_elem (nad_t nad, unsigned int elem, int ns, const char *name) |
wrap an element with another element More... | |
int | nad_insert_nad (nad_t dest, int delem, nad_t src, int selem) |
insert part of a nad into another nad More... | |
int | nad_append_elem (nad_t nad, int ns, const char *name, int depth) |
create a new elem on the list More... | |
int | nad_append_attr (nad_t nad, int ns, const char *name, const char *val) |
attach new attr to the last elem More... | |
void | nad_append_cdata (nad_t nad, const char *cdata, int len, int depth) |
append new cdata to the last elem More... | |
int | nad_add_namespace (nad_t nad, const char *uri, const char *prefix) |
bring a new namespace into scope More... | |
int | nad_append_namespace (nad_t nad, unsigned int elem, const char *uri, const char *prefix) |
declare a namespace on an already-existing element More... | |
static void | _nad_escape (nad_t nad, int data, int len, int flag) |
static int | _nad_lp0 (nad_t nad, unsigned int elem) |
internal recursive printing function More... | |
void | nad_print (nad_t nad, unsigned int elem, const char **xml, int *len) |
create a string representation of the given element (and children), point references to it More... | |
void | nad_serialize (nad_t nad, char **buf, int *len) |
nads serialize to a buffer of this form: More... | |
nad_t | nad_deserialize (const char *buf) |
static void | _nad_parse_element_start (void *arg, const char *name, const char **atts) |
static void | _nad_parse_element_end (void *arg, const char *name) |
static void | _nad_parse_cdata (void *arg, const char *str, int len) |
static void | _nad_parse_namespace_start (void *arg, const char *prefix, const char *uri) |
nad_t | nad_parse (const char *buf, int len) |
create a nad from raw xml More... | |
#define _nad_ptr_check | ( | func, | |
nad | |||
) |
!!! Things to do (after 2.0)
Definition at line 61 of file nad.c.
Referenced by nad_add_namespace(), nad_append_attr(), nad_append_cdata(), nad_append_elem(), nad_append_namespace(), nad_copy(), nad_deserialize(), nad_drop_elem(), nad_find_attr(), nad_find_elem(), nad_find_elem_path(), nad_find_namespace(), nad_find_scoped_namespace(), nad_free(), nad_insert_elem(), nad_insert_nad(), nad_new(), nad_print(), nad_serialize(), nad_set_attr(), and nad_wrap_elem().
#define BLOCKSIZE 128 |
Definition at line 64 of file nad.c.
Referenced by _nad_realloc().
#define NAD_SAFE | ( | blocks, | |
size, | |||
len | |||
) | if((size) > len) len = _nad_realloc((void**)&(blocks),(size)); |
this is the safety check used to make sure there's always enough mem
Definition at line 89 of file nad.c.
Referenced by _nad_attr(), _nad_cdata(), _nad_escape(), _nad_lp0(), nad_add_namespace(), nad_append_elem(), nad_append_namespace(), nad_copy(), nad_insert_elem(), nad_insert_nad(), and nad_wrap_elem().
|
static |
Reallocate the given buffer to make it larger.
oblocks | A pointer to a buffer that will be made larger. |
len | The minimum size in bytes to make the buffer. The actual size of the buffer will be rounded up to the nearest block of 1024 bytes. |
Definition at line 76 of file nad.c.
References BLOCKSIZE.
|
static |
internal: append some cdata and return the index to it
Definition at line 92 of file nad.c.
References nad_st::ccur, nad_st::cdata, nad_st::clen, and NAD_SAFE.
Referenced by _nad_attr(), nad_add_namespace(), nad_append_cdata(), nad_append_elem(), nad_append_namespace(), nad_insert_elem(), nad_insert_nad(), nad_set_attr(), and nad_wrap_elem().
|
static |
internal: create a new attr on any given elem
Definition at line 102 of file nad.c.
References _nad_cdata(), nad_st::acur, nad_st::alen, nad_elem_st::attr, nad_st::attrs, nad_st::elems, nad_attr_st::iname, nad_attr_st::ival, nad_attr_st::lname, nad_attr_st::lval, nad_attr_st::my_ns, NAD_SAFE, and nad_attr_st::next.
Referenced by nad_append_attr(), and nad_set_attr().
nad_t nad_new | ( | void | ) |
create a new nad
Definition at line 125 of file nad.c.
References _nad_ptr_check, pstrdup(), nad_st::scope, xhash_new(), xhash_pool(), and xhash_put().
Referenced by _authreg_auth_get(), _authreg_auth_set(), _authreg_register_get(), _authreg_register_set(), _c2s_client_sx_callback(), _in_result(), _out_dialback(), _out_verify(), _pbx_presence_nad(), _router_advertise(), _router_advertise_reverse(), _sm_build_route(), _sx_element_start(), _sx_namespace_start(), _sx_sasl_abort(), _sx_sasl_challenge(), _sx_sasl_failure(), _sx_sasl_response(), _sx_sasl_success(), _sx_server_notify_header(), c2s_router_sx_callback(), config_load_with_id(), nad_copy(), nad_deserialize(), nad_parse(), pkt_create(), s2s_router_sx_callback(), sm_c2s_action(), sm_sx_callback(), and sx_sasl_auth().
copy a nad
Definition at line 147 of file nad.c.
References _nad_ptr_check, nad_st::acur, nad_st::alen, nad_st::attrs, nad_st::ccur, nad_st::cdata, nad_st::clen, nad_st::ecur, nad_st::elems, nad_st::elen, nad_new(), NAD_SAFE, nad_st::ncur, nad_st::nlen, nad_st::nss, and nad_st::scope.
Referenced by _announce_broadcast_user(), _announce_in_sess(), _announce_load(), _help_pkt_sm(), _iq_private_in_sess(), _offline_in_sess(), _offline_user_delete(), _router_broadcast(), _router_process_route(), _router_route_log_sink(), _status_sess_end(), _status_sess_start(), pkt_dup(), and pres_in().
void nad_free | ( | nad_t | nad | ) |
free that nad
Definition at line 180 of file nad.c.
References _nad_ptr_check, nad_st::attrs, nad_st::cdata, nad_st::depths, nad_st::elems, nad_st::nss, pstrdup(), xhash_pool(), xhash_put(), and xhash_zap().
Referenced by _announce_free(), _announce_pkt_sm(), _authreg_auth_get(), _authreg_auth_set(), _authreg_register_get(), _authreg_register_set(), _c2s_client_sx_callback(), _c2s_component_presence(), _help_pkt_sm(), _in_packet(), _in_result(), _in_sx_callback(), _in_verify(), _out_result(), _out_sx_callback(), _out_verify(), _router_advertise(), _router_process_handshake(), _router_process_route(), _router_sx_callback(), _status_sess_end(), _status_sess_start(), _sx_ack_process(), _sx_compress_process(), _sx_nad_write(), _sx_process_read(), _sx_sasl_process(), _sx_server_notify_header(), _sx_ssl_process(), c2s_router_sx_callback(), config_free(), config_load_with_id(), filter_load(), JABBER_MAIN(), nad_parse(), out_bounce_route_queue(), out_packet(), out_pkt_free(), pkt_free(), pkt_new(), s2s_router_sx_callback(), sm_sx_callback(), sx_free(), and user_table_load().
int nad_find_elem | ( | nad_t | nad, |
unsigned int | elem, | ||
int | ns, | ||
const char * | name, | ||
int | depth | ||
) |
locate the next elem at a given depth with an optional matching name
find the next element with this name/depth
Definition at line 206 of file nad.c.
References _nad_ptr_check, nad_st::cdata, nad_elem_st::depth, nad_st::ecur, nad_st::elems, nad_elem_st::iname, nad_elem_st::lname, nad_elem_st::my_ns, NAD_NURI, and NAD_NURI_L.
Referenced by _amp_pkt_user(), _announce_load(), _announce_pkt_sm(), _authreg_auth_get(), _authreg_auth_set(), _authreg_register_set(), _c2s_client_sx_callback(), _disco_pkt_sm_populate(), _help_pkt_sm(), _iq_ping_reply(), _iq_private_in_sess(), _iq_vcard_to_object(), _iq_vcard_to_pkt(), _offline_in_sess(), _offline_pkt_user(), _offline_user_delete(), _out_sx_callback(), _pep_in_sess(), _privacy_in_sess(), _privacy_lists_result_builder(), _privacy_out_router(), _privacy_result_builder(), _roster_in_sess(), _roster_set_item(), _router_process_bind(), _session_in_router(), _status_store(), _sx_process_read(), _template_roster_reload(), _vacation_in_sess(), _verify_in_sess(), _xdata_field_parse(), aci_load(), authreg_process(), c2s_router_sx_callback(), filter_load(), message_log(), mm_new(), module_init(), nad_find_elem_path(), pkt_new(), pkt_router(), s2s_router_sx_callback(), sm_sx_callback(), user_table_load(), and xdata_parse().
int nad_find_attr | ( | nad_t | nad, |
unsigned int | elem, | ||
int | ns, | ||
const char * | name, | ||
const char * | val | ||
) |
get a matching attr on this elem, both name and optional val
find the first matching attribute (and optionally value)
Definition at line 237 of file nad.c.
References _nad_ptr_check, nad_elem_st::attr, nad_st::attrs, nad_st::cdata, nad_st::ecur, nad_st::elems, nad_attr_st::iname, nad_attr_st::ival, nad_attr_st::lname, nad_attr_st::lval, nad_attr_st::my_ns, NAD_NURI, NAD_NURI_L, and nad_attr_st::next.
Referenced by _amp_pkt_sm(), _amp_pkt_user(), _announce_load(), _authreg_auth_get(), _authreg_auth_set(), _authreg_register_get(), _authreg_register_set(), _c2s_client_sx_callback(), _c2s_component_presence(), _disco_pkt_sm(), _disco_pkt_sm_populate(), _in_packet(), _in_result(), _in_sx_callback(), _in_verify(), _offline_in_sess(), _offline_pkt_user(), _offline_user_delete(), _out_result(), _out_verify(), _privacy_in_sess(), _roster_in_sess(), _roster_set_item(), _router_comp_write(), _router_process_bind(), _router_process_route(), _router_process_unbind(), _router_sx_callback(), _session_in_router(), _sx_ack_process(), _sx_sasl_process(), _template_roster_reload(), _xdata_field_parse(), aci_load(), authreg_process(), c2s_router_sx_callback(), dispatch(), filter_load(), filter_packet(), mm_new(), module_init(), nad_find_elem_path(), nad_set_attr(), out_bounce_route_queue(), pkt_id(), pkt_new(), s2s_router_sx_callback(), sm_sx_callback(), stanza_tofrom(), and xdata_parse().
int nad_find_namespace | ( | nad_t | nad, |
unsigned int | elem, | ||
const char * | uri, | ||
const char * | prefix | ||
) |
get a matching ns on this elem, both uri and optional prefix
find the first matching namespace (and optionally prefix)
Definition at line 264 of file nad.c.
References _nad_ptr_check, nad_st::ecur, nad_st::elems, nad_ns_st::iprefix, NAD_NPREFIX, NAD_NPREFIX_L, NAD_NURI, NAD_NURI_L, nad_ns_st::next, nad_elem_st::ns, nad_st::nss, and nad_elem_st::parent.
Referenced by _c2s_client_sx_callback(), _in_packet(), _router_sx_callback(), _session_in_router(), c2s_router_sx_callback(), nad_append_namespace(), nad_find_elem_path(), out_packet(), pkt_new(), and pkt_router().
int nad_find_scoped_namespace | ( | nad_t | nad, |
const char * | uri, | ||
const char * | prefix | ||
) |
find a namespace in scope
find a namespace in scope (and optionally prefix)
Definition at line 292 of file nad.c.
References _nad_ptr_check, nad_ns_st::iprefix, NAD_NPREFIX, NAD_NPREFIX_L, NAD_NURI, NAD_NURI_L, nad_st::ncur, and nad_st::nss.
Referenced by _amp_pkt_user(), _announce_load(), _authreg_auth_get(), _authreg_auth_set(), _authreg_register_set(), _c2s_client_sx_callback(), _disco_pkt_sm_populate(), _iq_ping_reply(), _iq_private_in_sess(), _offline_in_sess(), _offline_pkt_user(), _offline_user_delete(), _out_sx_callback(), _pep_in_sess(), _privacy_in_sess(), _privacy_lists_result_builder(), _privacy_result_builder(), _session_in_router(), _sx_process_read(), _vacation_in_sess(), authreg_process(), c2s_router_sx_callback(), nad_add_namespace(), s2s_router_sx_callback(), and sm_sx_callback().
int nad_find_elem_path | ( | nad_t | nad, |
unsigned int | elem, | ||
int | ns, | ||
const char * | name | ||
) |
find elem using XPath like query 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 "!attrib" to match the first tag without that attrib defined "!attrib=value" to match the first tag without that attrib and value or any combination: "name/name/?attrib", etc
find elem using XPath like query 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 or any combination: "name/name/?attrib", etc
Definition at line 322 of file nad.c.
References _nad_ptr_check, nad_st::ecur, nad_find_attr(), nad_find_elem(), nad_find_elem_path(), and nad_find_namespace().
Referenced by filter_packet(), and nad_find_elem_path().
void nad_set_attr | ( | nad_t | nad, |
unsigned int | elem, | ||
int | ns, | ||
const char * | name, | ||
const char * | val, | ||
int | vallen | ||
) |
create, update, or zap any matching attr on this elem
reset or store the given attribute
Definition at line 407 of file nad.c.
References _nad_attr(), _nad_cdata(), _nad_ptr_check, nad_st::attrs, nad_attr_st::ival, nad_attr_st::lname, nad_attr_st::lval, and nad_find_attr().
Referenced by _announce_broadcast_user(), _announce_in_sess(), _announce_pkt_sm(), _authreg_auth_set(), _authreg_register_set(), _c2s_client_sx_callback(), _deliver_in_sess(), _disco_info_result(), _disco_pkt_sm(), _disco_user_result(), _help_pkt_sm(), _in_packet(), _in_result(), _in_verify(), _iq_last_pkt_sm(), _iq_last_pkt_user(), _iq_ping_reply(), _iq_private_in_sess(), _iq_time_pkt_sm(), _iq_vcard_in_sess(), _iq_vcard_pkt_sm(), _iq_vcard_pkt_user(), _iq_version_pkt_sm(), _offline_pkt_user(), _out_dialback(), _presence_in_sess(), _privacy_in_sess(), _privacy_lists_result_builder(), _privacy_result_builder(), _roster_in_sess(), _roster_in_sess_s10n(), _roster_insert_item(), _roster_pkt_user(), _roster_set_item(), _roster_update_walker(), _router_advertise_reverse(), _router_process_bind(), _router_process_route(), _router_process_unbind(), _router_route_log_sink(), _router_sx_callback(), _session_in_router(), _vacation_in_sess(), c2s_router_sx_callback(), filter_packet(), pkt_delay(), pkt_dup(), pkt_id(), pkt_id_new(), pkt_router(), pkt_sess(), pkt_tofrom(), pres_in(), s2s_router_sx_callback(), sess_route(), sm_packet(), sm_sx_callback(), stanza_error(), and stanza_tofrom().
int nad_insert_elem | ( | nad_t | nad, |
unsigned int | parent, | ||
int | ns, | ||
const char * | name, | ||
const char * | cdata | ||
) |
shove in a new child elem after the given one
insert and return a new element as a child of this one
Definition at line 437 of file nad.c.
References _nad_cdata(), _nad_ptr_check, nad_elem_st::attr, nad_elem_st::depth, nad_st::ecur, nad_st::elems, nad_st::elen, nad_elem_st::icdata, nad_elem_st::iname, nad_elem_st::itail, nad_elem_st::lcdata, nad_elem_st::lname, nad_elem_st::ltail, nad_elem_st::my_ns, NAD_SAFE, nad_elem_st::ns, nad_elem_st::parent, and nad_st::scope.
Referenced by _help_pkt_sm(), _iq_time_pkt_sm(), _iq_version_pkt_sm(), _privacy_in_sess(), _privacy_lists_result_builder(), _privacy_out_router(), _privacy_result_builder(), _roster_insert_item(), _vacation_in_sess(), _vacation_pkt_user(), check_code(), pkt_delay(), print_instructions(), send_email(), and stanza_error().
void nad_drop_elem | ( | nad_t | nad, |
unsigned int | elem | ||
) |
remove an element (and its subelements)
Definition at line 484 of file nad.c.
References _nad_ptr_check, nad_elem_st::depth, nad_st::ecur, nad_st::elems, and nad_elem_st::parent.
Referenced by _announce_pkt_sm(), _help_pkt_sm(), _iq_ping_reply(), _roster_in_sess(), and _session_in_router().
void nad_wrap_elem | ( | nad_t | nad, |
unsigned int | elem, | ||
int | ns, | ||
const char * | name | ||
) |
wrap an element with another element
Definition at line 507 of file nad.c.
References _nad_cdata(), _nad_ptr_check, nad_elem_st::attr, nad_elem_st::depth, nad_st::ecur, nad_st::elems, nad_st::elen, nad_elem_st::icdata, nad_elem_st::iname, nad_elem_st::itail, nad_elem_st::lcdata, nad_elem_st::lname, nad_elem_st::ltail, nad_elem_st::my_ns, NAD_SAFE, nad_elem_st::ns, nad_elem_st::parent, and nad_st::scope.
Referenced by _in_packet(), _router_sx_callback(), and sm_packet().
insert part of a nad into another nad
Definition at line 544 of file nad.c.
References _nad_cdata(), _nad_ptr_check, nad_st::acur, nad_st::alen, nad_elem_st::attr, nad_st::attrs, nad_st::cdata, nad_elem_st::depth, nad_st::ecur, nad_st::elems, nad_st::elen, nad_elem_st::icdata, nad_elem_st::iname, nad_attr_st::iname, nad_elem_st::itail, nad_attr_st::ival, nad_elem_st::lcdata, nad_elem_st::lname, nad_attr_st::lname, nad_elem_st::ltail, nad_attr_st::lval, nad_elem_st::my_ns, nad_attr_st::my_ns, nad_add_namespace(), NAD_NPREFIX, NAD_NPREFIX_L, NAD_NURI, NAD_NURI_L, NAD_SAFE, nad_st::ncur, nad_attr_st::next, nad_ns_st::next, nad_elem_st::ns, nad_st::nss, nad_elem_st::parent, and nad_st::scope.
int nad_append_elem | ( | nad_t | nad, |
int | ns, | ||
const char * | name, | ||
int | depth | ||
) |
create a new elem on the list
append and return a new element
Definition at line 711 of file nad.c.
References _nad_cdata(), _nad_ptr_check, nad_elem_st::attr, nad_elem_st::depth, nad_st::depths, nad_st::dlen, nad_st::ecur, nad_st::elems, nad_st::elen, nad_elem_st::icdata, nad_elem_st::iname, nad_elem_st::itail, nad_elem_st::lcdata, nad_elem_st::lname, nad_elem_st::ltail, nad_elem_st::my_ns, NAD_SAFE, nad_elem_st::ns, nad_elem_st::parent, and nad_st::scope.
Referenced by _address_features(), _amp_pkt_sm(), _authreg_auth_get(), _authreg_auth_set(), _authreg_register_get(), _authreg_register_set(), _bind_features(), _c2s_client_sx_callback(), _config_startElement(), _disco_agents_result(), _disco_info_result(), _disco_items_result(), _disco_pkt_router(), _disco_pkt_sm(), _disco_sessions_result(), _disco_user_result(), _help_disco_extend(), _in_result(), _iq_vcard_to_pkt(), _iq_version_disco_extend(), _nad_parse_element_start(), _offline_pkt_user(), _out_dialback(), _out_verify(), _pbx_presence_nad(), _pep_out_sess(), _roster_in_sess_s10n(), _roster_pkt_user(), _roster_set_item(), _roster_update_walker(), _router_advertise(), _router_advertise_reverse(), _s2s_db_features(), _sm_build_route(), _sx_ack_features(), _sx_compress_features(), _sx_element_start(), _sx_sasl_abort(), _sx_sasl_challenge(), _sx_sasl_failure(), _sx_sasl_features(), _sx_sasl_response(), _sx_sasl_success(), _sx_server_notify_header(), _sx_ssl_features(), amp_build_response_pkt(), c2s_router_sx_callback(), pkt_create(), s2s_router_sx_callback(), sm_c2s_action(), sm_sx_callback(), and sx_sasl_auth().
int nad_append_attr | ( | nad_t | nad, |
int | ns, | ||
const char * | name, | ||
const char * | val | ||
) |
attach new attr to the last elem
append attribs to the last element
Definition at line 745 of file nad.c.
References _nad_attr(), _nad_ptr_check, and nad_st::ecur.
Referenced by _amp_pkt_sm(), _authreg_auth_get(), _authreg_register_get(), _config_startElement(), _disco_agents_result(), _disco_info_result(), _disco_items_result(), _disco_pkt_sm(), _disco_sessions_result(), _disco_user_result(), _help_disco_extend(), _in_result(), _iq_version_disco_extend(), _nad_parse_element_start(), _out_verify(), _pbx_presence_nad(), _pep_out_sess(), _router_advertise(), _sm_build_route(), _sx_element_start(), amp_build_response_pkt(), c2s_router_sx_callback(), pkt_create(), s2s_router_sx_callback(), sm_c2s_action(), sm_sx_callback(), and sx_sasl_auth().
void nad_append_cdata | ( | nad_t | nad, |
const char * | cdata, | ||
int | len, | ||
int | depth | ||
) |
append new cdata to the last elem
append more cdata to the last element
Definition at line 753 of file nad.c.
References _nad_cdata(), _nad_ptr_check, nad_st::ccur, nad_elem_st::depth, nad_st::depths, nad_st::ecur, nad_st::elems, nad_elem_st::icdata, nad_elem_st::itail, nad_elem_st::lcdata, and nad_elem_st::ltail.
Referenced by _address_features(), _authreg_auth_get(), _authreg_register_get(), _c2s_client_sx_callback(), _config_charData(), _disco_agents_result(), _help_disco_extend(), _in_result(), _iq_vcard_to_pkt(), _iq_version_disco_extend(), _nad_parse_cdata(), _offline_pkt_user(), _out_dialback(), _pbx_presence_nad(), _sx_cdata(), _sx_compress_features(), _sx_sasl_challenge(), _sx_sasl_failure(), _sx_sasl_features(), _sx_sasl_response(), _sx_sasl_success(), and sx_sasl_auth().
int nad_add_namespace | ( | nad_t | nad, |
const char * | uri, | ||
const char * | prefix | ||
) |
bring a new namespace into scope
add a namespace to the next element (ie, called when the namespace comes into scope)
Definition at line 778 of file nad.c.
References _nad_cdata(), _nad_ptr_check, nad_ns_st::iprefix, nad_ns_st::iuri, nad_ns_st::lprefix, nad_ns_st::luri, nad_find_scoped_namespace(), NAD_SAFE, nad_st::ncur, nad_ns_st::next, nad_st::nlen, nad_st::nss, and nad_st::scope.
Referenced by _address_features(), _amp_pkt_sm(), _authreg_auth_get(), _authreg_auth_set(), _authreg_register_get(), _authreg_register_set(), _bind_features(), _c2s_client_sx_callback(), _disco_agents_result(), _disco_info_result(), _disco_items_result(), _disco_pkt_router(), _disco_pkt_sm(), _disco_sessions_result(), _help_disco_extend(), _in_packet(), _in_result(), _iq_vcard_to_pkt(), _iq_version_disco_extend(), _nad_parse_element_start(), _nad_parse_namespace_start(), _offline_pkt_user(), _out_dialback(), _out_verify(), _pbx_presence_nad(), _privacy_in_sess(), _privacy_out_router(), _roster_in_sess_s10n(), _roster_insert_item(), _roster_pkt_user(), _roster_set_item(), _roster_update_walker(), _router_advertise(), _router_advertise_reverse(), _router_sx_callback(), _s2s_db_features(), _sm_build_route(), _sx_compress_features(), _sx_element_start(), _sx_namespace_start(), _sx_sasl_abort(), _sx_sasl_challenge(), _sx_sasl_failure(), _sx_sasl_features(), _sx_sasl_response(), _sx_sasl_success(), _sx_server_notify_header(), _sx_ssl_features(), amp_build_response_pkt(), c2s_router_sx_callback(), nad_insert_nad(), pkt_create(), pkt_delay(), s2s_router_sx_callback(), sm_c2s_action(), sm_packet(), sm_sx_callback(), stanza_error(), and sx_sasl_auth().
int nad_append_namespace | ( | nad_t | nad, |
unsigned int | elem, | ||
const char * | uri, | ||
const char * | prefix | ||
) |
declare a namespace on an already-existing element
declare a namespace on an already existing element
Definition at line 814 of file nad.c.
References _nad_cdata(), _nad_ptr_check, nad_st::elems, nad_ns_st::iprefix, nad_ns_st::iuri, nad_ns_st::lprefix, nad_ns_st::luri, nad_find_namespace(), NAD_SAFE, nad_st::ncur, nad_ns_st::next, nad_st::nlen, nad_elem_st::ns, and nad_st::nss.
Referenced by _nad_parse_element_start(), _sx_element_start(), sess_route(), and sm_packet().
|
static |
Definition at line 848 of file nad.c.
References nad_st::ccur, nad_st::cdata, nad_st::clen, and NAD_SAFE.
Referenced by _nad_lp0().
|
static |
internal recursive printing function
Definition at line 952 of file nad.c.
References _nad_escape(), nad_elem_st::attr, nad_st::attrs, nad_st::ccur, nad_st::cdata, nad_st::clen, nad_elem_st::depth, nad_st::ecur, nad_st::elems, nad_elem_st::icdata, nad_elem_st::iname, nad_attr_st::iname, nad_ns_st::iprefix, nad_elem_st::itail, nad_ns_st::iuri, nad_attr_st::ival, nad_elem_st::lcdata, nad_elem_st::lname, nad_attr_st::lname, nad_ns_st::lprefix, nad_elem_st::ltail, nad_ns_st::luri, nad_attr_st::lval, nad_elem_st::my_ns, nad_attr_st::my_ns, NAD_SAFE, nad_attr_st::next, nad_ns_st::next, nad_elem_st::ns, nad_st::nss, and uri_XML.
Referenced by nad_print().
void nad_print | ( | nad_t | nad, |
unsigned int | elem, | ||
const char ** | xml, | ||
int * | len | ||
) |
create a string representation of the given element (and children), point references to it
Definition at line 1208 of file nad.c.
References _nad_lp0(), _nad_ptr_check, nad_st::ccur, and nad_st::cdata.
Referenced by _help_pkt_sm(), _router_process_route(), _sx_nad_write(), _sx_process_read(), _sx_server_notify_header(), c2s_router_sx_callback(), and filter_packet().
void nad_serialize | ( | nad_t | nad, |
char ** | buf, | ||
int * | len | ||
) |
nads serialize to a buffer of this form:
serialize and deserialize a nad
[buflen][ecur][acur][ncur][ccur][elems][attrs][nss][cdata]
nothing is done with endianness or word length, so the nad must be serialized and deserialized on the same platform
buflen is not actually used by deserialize(), but is provided as a convenience to the application so it knows how many bytes to read before passing them in to deserialize()
the depths array is not stored, so after deserialization nad_append_elem() and nad_append_cdata() will not work. this is rarely a problem
Definition at line 1236 of file nad.c.
References _nad_ptr_check, nad_st::acur, nad_st::attrs, nad_st::ccur, nad_st::cdata, nad_st::ecur, nad_st::elems, nad_st::ncur, and nad_st::nss.
nad_t nad_deserialize | ( | const char * | buf | ) |
Definition at line 1262 of file nad.c.
References _nad_ptr_check, nad_st::acur, nad_st::alen, nad_st::attrs, nad_st::ccur, nad_st::cdata, nad_st::clen, build_data::depth, nad_st::ecur, nad_st::elems, nad_st::elen, build_data::nad, nad_new(), nad_st::ncur, nad_st::nlen, and nad_st::nss.
|
static |
Definition at line 1316 of file nad.c.
References build_data::depth, build_data::nad, nad_add_namespace(), nad_append_attr(), nad_append_elem(), and nad_append_namespace().
Referenced by nad_parse().
|
static |
|
static |
Definition at line 1399 of file nad.c.
References build_data::depth, build_data::nad, and nad_append_cdata().
Referenced by nad_parse().
|
static |
Definition at line 1406 of file nad.c.
References build_data::nad, nad_add_namespace(), build_data::p, and nad_st::scope.
Referenced by nad_parse().
nad_t nad_parse | ( | const char * | buf, |
int | len | ||
) |
create a nad from raw xml
Definition at line 1430 of file nad.c.
References _nad_parse_cdata(), _nad_parse_element_end(), _nad_parse_element_start(), _nad_parse_namespace_start(), build_data::depth, build_data::nad, nad_free(), nad_new(), and build_data::p.
Referenced by _template_roster_reload(), filter_load(), and user_table_load().