27 snprintf(str, 3094,
"%s%d%s", type, (
int) time(NULL),
jid_full(res->
jid));
51 if(res->
sm_id[0] !=
'\0')
void nad_wrap_elem(nad_t nad, unsigned int elem, int ns, const char *name)
wrap an element with another element
nad_t nad_new(void)
create a new nad
int nad_append_attr(nad_t nad, int ns, const char *name, const char *val)
attach new attr to the last elem
char sm_request[41]
this holds the id of the current pending SM request
#define sx_nad_write(s, nad)
const char * jid_user(jid_t jid)
expand and return the user
const char * jid_full(jid_t jid)
expand and return the full
void sm_delete(sess_t sess, bres_t res)
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
void shahash_r(const char *str, char hashbuf[41])
convenience (originally by Thomas Muldowney)
list of resources bound to session
int nad_add_namespace(nad_t nad, const char *uri, const char *prefix)
bring a new namespace into scope
void sm_end(sess_t sess, bres_t res)
const char * id
our id (hostname) with the router
int nad_append_elem(nad_t nad, int ns, const char *name, int depth)
create a new elem on the list
sx_t router
router's conn
static void _sm_generate_id(sess_t sess, bres_t res, const char *type)
generate a new session request id
void sm_packet(sess_t sess, bres_t res, nad_t nad)
char c2s_id[44]
session id for this jid for us and them
There is one instance of this struct per user who is logged in to this c2s instance.
void sm_create(sess_t sess, bres_t res)
static nad_t _sm_build_route(sess_t sess, bres_t res, const char *action, const char *target, const char *id)
make a new action route
int nad_append_namespace(nad_t nad, unsigned int elem, const char *uri, const char *prefix)
declare a namespace on an already-existing element
void sm_start(sess_t sess, bres_t res)