|
jabberd14 1.6.2
|
implements the main part of the DNS resolver component More...
Data Structures | |
| struct | __dns_resend_list_host_list |
| structure to build a list that holds all hosts to which the packets are resent for a service More... | |
| struct | __dns_resend_list |
| struct | dns_io |
| struct | __dns_packet_list |
Typedefs | |
| typedef struct __dns_resend_list_host_list * | dns_resend_list_host_list |
| structure to build a list that holds all hosts to which the packets are resent for a service | |
| typedef struct __dns_resend_list_host_list | _dns_resend_list_host_list |
| typedef struct __dns_resend_list * | dns_resend_list |
| typedef struct __dns_resend_list | _dns_resend_list |
| typedef struct dns_io | _dns_io |
| typedef int(* | RESOLVEFUNC )(dns_io di) |
| typedef struct __dns_packet_list * | dns_packet_list |
| typedef struct __dns_packet_list | _dns_packet_list |
Functions | |
| void | _dnsrv_signal (int sig) |
| void | dnsrv_child_process_xstream_io (int type, xmlnode x, void *args) |
| int | dnsrv_child_main (dns_io di) |
| int | dnsrv_fork_and_capture (RESOLVEFUNC f, dns_io di) |
| void | dnsrv_resend (xmlnode pkt, char *ip, char *to) |
| void | dnsrv_lookup (dns_io d, dpacket p) |
| result | dnsrv_deliver (instance i, dpacket p, void *args) |
| void | dnsrv_process_xstream_io (int type, xmlnode x, void *arg) |
| void * | dnsrv_process_io (void *threadarg) |
| void * | dnsrv_thread (void *arg) |
| void | _dnsrv_beat_packets (xht h, const char *key, void *data, void *arg) |
| result | dnsrv_beat_packets (void *arg) |
| void | dnsrv (instance i, xmlnode x) |
implements the main part of the DNS resolver component
Config format: <dnsrv xmlns='jabber:config:dnsrv'> <resend service="_jabber._tcp">s2s-component</resend> </dnsrv>
Note: You must specify the services in the order you want them tried
| typedef struct __dns_packet_list _dns_packet_list |
| typedef struct __dns_resend_list _dns_resend_list |
| typedef struct __dns_resend_list_host_list _dns_resend_list_host_list |
| typedef struct __dns_packet_list * dns_packet_list |
struct to store list of dpackets which need to be delivered
| typedef struct __dns_resend_list * dns_resend_list |
struct to store list of services and resend hosts
| typedef struct __dns_resend_list_host_list * dns_resend_list_host_list |
structure to build a list that holds all hosts to which the packets are resent for a service
| typedef int(* RESOLVEFUNC)(dns_io di) |
prototype for the resolver function
| di | pointer to the instance global data |
| void _dnsrv_beat_packets | ( | xht | h, |
| const char * | key, | ||
| void * | data, | ||
| void * | arg | ||
| ) |
References deliver_fail(), dpacket_struct::host, log_notice(), N_, __dns_packet_list::next, __dns_packet_list::packet, dns_io::packet_table, dns_io::packet_timeout, __dns_packet_list::stamp, and xhash_zap().
Referenced by dnsrv_beat_packets().
| void _dnsrv_signal | ( | int | sig | ) |
signal handler: just die after any signal
| sig | the signal number that has been sent |
Referenced by dnsrv_fork_and_capture().
References dnsrv_beat_packets(), dnsrv_deliver(), dnsrv_process_io(), dnsrv_thread(), __dns_resend_list_host_list::host, __dns_resend_list::hosts, instance_struct::id, j_atoi(), j_strcmp(), jid_new(), log_debug2, log_error, LOGT_CONFIG, LOGT_INIT, dns_io::mempool, __dns_resend_list::next, __dns_resend_list_host_list::next, NS_JABBERD_CONFIG_DNSRV, o_DELIVER, instance_struct::p, dns_io::packet_table, dns_io::packet_timeout, pmalloco(), pool_cleanup(), pstrdup(), register_beat(), register_phandler(), __dns_resend_list::service, dns_io::svclist, __dns_resend_list_host_list::weight, __dns_resend_list::weight_sum, xdb_cache(), xdb_get(), xhash_free(), xhash_new(), xmlnode_free(), xmlnode_get_attrib_ns(), xmlnode_get_data(), xmlnode_get_lastchild(), xmlnode_get_localname(), xmlnode_get_namespace(), xmlnode_get_prevsibling(), xmlnode_pool(), xmlnode_serialize_string(), and ZONE.
| result dnsrv_beat_packets | ( | void * | arg | ) |
References _dnsrv_beat_packets(), dns_io::packet_table, r_DONE, and xhash_walk().
Referenced by dnsrv().
| int dnsrv_child_main | ( | dns_io | di | ) |
References dnsrv_child_process_xstream_io(), dns_io::in, log_debug2, LOGT_CLEANUP, LOGT_INIT, LOGT_IO, LOGT_STRANGE, dns_io::out, pool_free(), pool_new, xstream_eat(), xstream_new(), XSTREAM_NODE, and ZONE.
Referenced by dnsrv_process_io(), and dnsrv_thread().
| void dnsrv_child_process_xstream_io | ( | int | type, |
| xmlnode | x, | ||
| void * | args | ||
| ) |
coprocess functionality
References __dns_resend_list_host_list::host, __dns_resend_list::hosts, log_debug2, LOGT_IO, __dns_resend_list::next, __dns_resend_list_host_list::next, dns_io::out, xmlnode_t::p, __dns_resend_list::service, srv_lookup(), dns_io::svclist, __dns_resend_list_host_list::weight, __dns_resend_list::weight_sum, xmlnode_free(), xmlnode_get_data(), xmlnode_put_attrib_ns(), xmlnode_serialize_string(), XSTREAM_NODE, and ZONE.
Referenced by dnsrv_child_main().
References dns_io::cache_table, dns_io::cache_timeout, dnsrv_lookup(), dnsrv_resend(), xmppd::jabberid::get_domain(), dpacket_struct::host, dpacket_struct::id, instance_struct::id, j_strcmp(), jid_new(), log_notice(), dpacket_struct::p, p_ROUTE, pstrdup(), r_DONE, r_ERR, dpacket_struct::type, dpacket_struct::x, xhash_get(), xhash_zap(), xmlnode_free(), xmlnode_get_attrib(), xmlnode_get_attrib_ns(), xmlnode_get_firstchild(), and xmlnode_serialize_string().
Referenced by dnsrv().
| int dnsrv_fork_and_capture | ( | RESOLVEFUNC | f, |
| dns_io | di | ||
| ) |
References _dnsrv_signal(), dns_io::in, and dns_io::out.
Referenced by dnsrv_process_io(), and dnsrv_thread().
References deliver_fail(), dpacket_struct::host, log_debug2, LOGT_IO, N_, __dns_packet_list::next, NS_SERVER, dns_io::out, dpacket_struct::p, __dns_packet_list::packet, dns_io::packet_table, pmalloco(), __dns_packet_list::stamp, xhash_get(), xhash_put(), xmlnode_insert_cdata(), xmlnode_new_tag_pool_ns(), xmlnode_serialize_string(), and ZONE.
Referenced by dnsrv_deliver().
| void* dnsrv_process_io | ( | void * | threadarg | ) |
References dnsrv_child_main(), dnsrv_fork_and_capture(), dnsrv_process_xstream_io(), dns_io::in, log_debug2, LOGT_INIT, LOGT_IO, LOGT_STRANGE, dns_io::mempool, dns_io::out, dns_io::pid, xstream_eat(), xstream_new(), XSTREAM_NODE, and ZONE.
Referenced by dnsrv().
| void dnsrv_process_xstream_io | ( | int | type, |
| xmlnode | x, | ||
| void * | arg | ||
| ) |
References dns_io::cache_table, dnsrv_resend(), log_debug2, LOGT_IO, __dns_packet_list::next, __dns_packet_list::packet, dns_io::packet_table, dpacket_struct::x, xhash_get(), xhash_put(), xhash_zap(), xmlnode_free(), xmlnode_get_attrib_ns(), xmlnode_get_data(), xmlnode_put_attrib(), xmlnode_serialize_string(), XSTREAM_NODE, and ZONE.
Referenced by dnsrv_process_io().
| void dnsrv_resend | ( | xmlnode | pkt, |
| char * | ip, | ||
| char * | to | ||
| ) |
References deliver(), dpacket_new(), jutil_error_xmpp(), log_debug2, LOGT_IO, N_, xmlnode_get_attrib_ns(), xmlnode_put_attrib_ns(), xmlnode_wrap_ns(), and ZONE.
Referenced by dnsrv_deliver(), and dnsrv_process_xstream_io().
| void* dnsrv_thread | ( | void * | arg | ) |
References dnsrv_child_main(), dnsrv_fork_and_capture(), and dns_io::pid.
Referenced by dnsrv().
1.7.4