jabberd2  2.5.0
Data Structures | Macros | Typedefs | Functions
mod_disco.c File Reference

service discovery More...

#include "sm.h"

Go to the source code of this file.

Data Structures

struct  service_st
 
struct  disco_st
 
union  xhashv
 session packet handling More...
 

Macros

#define ACTIVE_SESSIONS_NAME   "Active sessions"
 

Typedefs

typedef struct service_stservice_t
 holder for a single service More...
 
typedef struct disco_stdisco_t
 all the current disco data More...
 

Functions

static void _disco_unify_walker (const char *key, int keylen, void *val, void *arg)
 put val into arg More...
 
static void _disco_unify_lists (disco_t d)
 unify the contents of dyn and stat More...
 
static pkt_t _disco_items_result (module_t mod, disco_t d)
 build a disco items result, known services More...
 
static pkt_t _disco_info_result (module_t mod, disco_t d)
 build a disco info result More...
 
static pkt_t _disco_agents_result (module_t mod, disco_t d)
 build an agents result More...
 
static void _disco_generate_packets (module_t mod, disco_t d)
 generate cached result packets More...
 
static mod_ret_t _disco_pkt_sm_populate (mod_instance_t mi, pkt_t pkt)
 catch responses and populate the table More...
 
static void _disco_sessions_result (module_t mod, disco_t d, pkt_t pkt)
 build a disco items result, active sessions More...
 
static mod_ret_t _disco_pkt_sm (mod_instance_t mi, pkt_t pkt)
 catch responses and populate the table; respond to requests More...
 
static void _disco_user_result (pkt_t pkt, user_t user)
 response to quering user JID More...
 
static mod_ret_t _disco_in_sess (mod_instance_t mi, sess_t sess, pkt_t pkt)
 legacy support for agents requests from sessions More...
 
static mod_ret_t _disco_pkt_user (mod_instance_t mi, user_t user, pkt_t pkt)
 
static mod_ret_t _disco_pkt_router (mod_instance_t mi, pkt_t pkt)
 update the table for component changes More...
 
static void _disco_free_walker (const char *key, int keylen, void *val, void *arg)
 
static void _disco_free (module_t mod)
 
DLLEXPORT int module_init (mod_instance_t mi, const char *arg)
 

Detailed Description

service discovery

Author
Robert Norris
Date
2005/09/09 05:34:13
Revision
1.35

Definition in file mod_disco.c.

Macro Definition Documentation

#define ACTIVE_SESSIONS_NAME   "Active sessions"

Definition at line 30 of file mod_disco.c.

Referenced by _disco_pkt_sm().

Typedef Documentation

typedef struct service_st* service_t

holder for a single service

Definition at line 33 of file mod_disco.c.

typedef struct disco_st* disco_t

all the current disco data

Definition at line 46 of file mod_disco.c.

Function Documentation

static void _disco_unify_walker ( const char *  key,
int  keylen,
void *  val,
void *  arg 
)
static

put val into arg

Definition at line 79 of file mod_disco.c.

References service_st::jid, jid_full(), log_debug, xhash_get(), xhash_put(), and ZONE.

Referenced by _disco_unify_lists().

static void _disco_unify_lists ( disco_t  d)
static

unify the contents of dyn and stat

Definition at line 93 of file mod_disco.c.

References _disco_unify_walker(), disco_st::dyn, log_debug, disco_st::stat, disco_st::un, xhash_free(), xhash_new(), xhash_walk(), and ZONE.

Referenced by _disco_pkt_router(), _disco_pkt_sm_populate(), and module_init().

static pkt_t _disco_items_result ( module_t  mod,
disco_t  d 
)
static
static pkt_t _disco_info_result ( module_t  mod,
disco_t  d 
)
static
static pkt_t _disco_agents_result ( module_t  mod,
disco_t  d 
)
static
static void _disco_generate_packets ( module_t  mod,
disco_t  d 
)
static
static mod_ret_t _disco_pkt_sm_populate ( mod_instance_t  mi,
pkt_t  pkt 
)
static
static void _disco_sessions_result ( module_t  mod,
disco_t  d,
pkt_t  pkt 
)
static
static mod_ret_t _disco_pkt_sm ( mod_instance_t  mi,
pkt_t  pkt 
)
static
static void _disco_user_result ( pkt_t  pkt,
user_t  user 
)
static

response to quering user JID

Definition at line 477 of file mod_disco.c.

References user_st::active, user_st::jid, jid_full(), log_debug, pkt_st::nad, nad_append_attr(), nad_append_elem(), nad_set_attr(), user_st::sessions, and ZONE.

Referenced by _disco_in_sess(), and _disco_pkt_user().

static mod_ret_t _disco_in_sess ( mod_instance_t  mi,
sess_t  sess,
pkt_t  pkt 
)
static
static mod_ret_t _disco_pkt_user ( mod_instance_t  mi,
user_t  user,
pkt_t  pkt 
)
static
static mod_ret_t _disco_pkt_router ( mod_instance_t  mi,
pkt_t  pkt 
)
static
static void _disco_free_walker ( const char *  key,
int  keylen,
void *  val,
void *  arg 
)
static

Definition at line 602 of file mod_disco.c.

References service_st::features, service_st::jid, jid_free(), and xhash_free().

Referenced by _disco_free().

static void _disco_free ( module_t  mod)
static
DLLEXPORT int module_init ( mod_instance_t  mi,
const char *  arg 
)