deliver.cc File Reference

#include "jabberd.h"

Data Structures

struct  deliver_mp_st
struct  ilist_struct
struct  deliver_routed_hosts_walk_args

Typedefs

typedef struct deliver_mp_st _deliver_msg
typedef struct deliver_mp_stdeliver_msg
typedef struct ilist_structilist
typedef struct ilist_struct _ilist

Functions

std::set< Glib::ustring > deliver_routed_hosts (ptype type, instance i)
bool deliver_is_uplink (instance i)
void register_instance (instance i, char const *host)
void unregister_instance (instance i, char const *host)
void deliver (dpacket p, instance i)
instance deliver_hostcheck (char const *host)
void deliver_init (pool p)
void deliver_shutdown (void)
void register_phandler (instance id, order o, phandler f, void *arg)
void deliver_fail (dpacket p, const char *err)
void deliver_instance (instance i, dpacket p)
dpacket dpacket_new (xmlnode x)
dpacket dpacket_copy (dpacket p)
void register_routing_update_callback (instance i, register_notify f, void *arg)
void deliver_pool_debug ()

Variables

int deliver__flag = 0
pth_msgport_t deliver__mp = NULL
xht deliver__hnorm = NULL
xht deliver__hxdb = NULL
xht deliver__hlog = NULL
xht deliver__ns = NULL
xht deliver__logtype = NULL
instance deliver__uplink = NULL
pool global_routing_update_pool = NULL
register_notifier global_routing_update_callbacks

Typedef Documentation

typedef struct deliver_mp_st _deliver_msg

typedef struct ilist_struct _ilist

typedef struct deliver_mp_st* deliver_msg

typedef struct ilist_struct * ilist


Function Documentation

void deliver ( dpacket  p,
instance  i 
)

void deliver_fail ( dpacket  p,
const char *  err 
)

instance deliver_hostcheck ( char const *  host  ) 

util to check and see which instance this hostname is going to get mapped to for normal packets

Parameters:
host the hostname to get checked
Returns:
the instance packets of this host get mapped to

References ilist_struct::i, and ilist_struct::next.

void deliver_init ( pool  p  ) 

initialize the XML delivery system

Parameters:
p memory pool that can be used to register config handlers (must be available for the livetime of jabberd)

References register_config(), and xhash_new().

Referenced by main().

void deliver_instance ( instance  i,
dpacket  p 
)

actually perform the delivery to an instance

Parameters:
i the instance to deliver to
p the packet that gets delivered (packet gets consumed)

References handel_struct::arg, deliver_fail(), dpacket_copy(), handel_struct::f, instance_struct::hds, instance_struct::id, log_debug2, LOGT_DELIVER, N_, handel_struct::next, handel_struct::o, o_COND, o_DELIVER, handel_struct::p, dpacket_struct::p, pool_free(), r_DONE, r_ERR, r_LAST, r_UNREG, and ZONE.

Referenced by deliver().

bool deliver_is_uplink ( instance  i  ) 

checks if an instance is configured to be the uplink

Parameters:
i the instance to check
Returns:
true if uplink, else false

void deliver_pool_debug (  ) 

Referenced by main().

std::set<Glib::ustring> deliver_routed_hosts ( ptype  type,
instance  i 
)

get list of hosts with explicit routing

Parameters:
type the type to get the routing for
i the instance to exclude from the result (NULL for not excluding any instance)
Returns:
list of the hosts that have explicit routings to other components than i for the given type

References deliver_routed_hosts_walk_args::i, deliver_routed_hosts_walk_args::result, and xhash_walk().

void deliver_shutdown ( void   ) 

free the delivery structures ... this is called when we already have shutdown the server therefore we cannot register it with register_shutdown()

References xhash_free().

Referenced by main().

dpacket dpacket_copy ( dpacket  p  ) 

create a clone of a deliverable packet

References dpacket_new(), dpacket_struct::x, and xmlnode_dup().

Referenced by deliver_instance().

dpacket dpacket_new ( xmlnode  x  ) 

void register_instance ( instance  i,
char const *  host 
)

register this instance as a possible recipient of packets to this host

Parameters:
i the instance to register
host the domain to register this instance for (or "*" to register as the default routing)

References register_notifier_struct::arg, register_notifier_struct::callback, instance_struct::id, log_debug2, LOGT_REGISTER, register_notifier_struct::next, NS_JABBERD_CONFIGFILE, instance_struct::p, p_LOG, p_XDB, pstrdup(), instance_struct::routing_update_callbacks, instance_struct::type, instance_struct::x, xhash_free(), xhash_get(), xhash_new(), xhash_put(), xmlnode_get_list_item(), xmlnode_get_tags(), and ZONE.

Referenced by dialback_miod_hash(), and dialback_out_packet().

void register_phandler ( instance  id,
order  o,
phandler  f,
void *  arg 
)

void register_routing_update_callback ( instance  i,
register_notify  f,
void *  arg 
)

register a function that gets called on registering/unregistering a host for an instance

Parameters:
i the instance to get register/unregister events for (NULL for a global registration)
f the callback method to call
arg argument to pass to the callback

References register_notifier_struct::arg, register_notifier_struct::callback, log_debug2, LOGT_EXECFLOW, register_notifier_struct::next, instance_struct::p, pmalloco(), pool_new, instance_struct::routing_update_callbacks, and ZONE.

Referenced by jsm().

void unregister_instance ( instance  i,
char const *  host 
)

unregister an instance as a possible recipient of packets for a domain

Parameters:
i the instance to unregister
host the domain to unregister (or "*" to unregister as the default routing)

References register_notifier_struct::arg, register_notifier_struct::callback, instance_struct::id, log_debug2, LOGT_REGISTER, register_notifier_struct::next, instance_struct::p, pstrdup(), instance_struct::routing_update_callbacks, instance_struct::type, xhash_get(), xhash_put(), xhash_zap(), and ZONE.

Referenced by _dialback_miod_hash_cleanup(), and instance_shutdown().


Variable Documentation

int deliver__flag = 0

0 = pause delivery on startup and queue for later delivery, 1 = normal operation, -1 = shutdown: no delivery, no queueing

Referenced by deliver(), and main().

host filters for logging

hosts for normal packets, important and most frequently used one

host filters for xdb requests

log types, fixed set, but it's easier (wussier) to just be consistent and use a hashtable

pth_msgport_t deliver__mp = NULL

message port, that contains all queued messages for later delivery while deliver__flag = 0

Referenced by deliver().

xht deliver__ns = NULL

namespace filters for xdb

uplink instance, only one

list of callback functions, that should be called on all routing updates

memory pool to hold the entries in the global_routing_update_callbacks list


Generated on Wed Sep 10 01:59:47 2008 for jabberd14 by  doxygen 1.5.5