27 snprintf(str, 3094,
"%s%d%s", type, (
int) time(NULL),
jid_full(res->
jid));
51 if(res->
sm_id[0] !=
'\0')
C2S_API void sm_create(sess_t sess, bres_t res)
C2S_API void sm_end(sess_t sess, bres_t res)
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
C2S_API void sm_packet(sess_t sess, bres_t res, nad_t nad)
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
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
void nad_wrap_elem(nad_t nad, int elem, int ns, const char *name)
wrap an element with another element
sx_t router
router's conn
void nad_set_attr(nad_t nad, int elem, int ns, const char *name, const char *val, int vallen)
create, update, or zap any matching attr on this elem
static void _sm_generate_id(sess_t sess, bres_t res, const char *type)
generate a new session request id
char c2s_id[44]
session id for this jid for us and them
C2S_API void sm_start(sess_t sess, bres_t res)
There is one instance of this struct per user who is logged in to this c2s instance.
int nad_append_namespace(nad_t nad, int elem, const char *uri, const char *prefix)
declare a namespace on an already-existing element
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
C2S_API void sm_delete(sess_t sess, bres_t res)