Require <bind> tag for bind attempts.
[citadel.git] / citadel / modules / jabber / serv_xmpp.h
1 /*
2  * $Id$
3  *
4  */
5
6 struct citxmpp {                        /* Information about the current session */
7         XML_Parser xp;                  /* XML parser instance for incoming client stream */
8         char server_name[256];          /* who they think we are */
9         char *chardata;
10         int chardata_len;
11         int chardata_alloc;
12         char client_jid[256];           /* "full JID" of the client */
13         int last_event_processed;
14
15         char iq_type[256];              /* for <iq> stanzas */
16         char iq_id[256];
17         char iq_from[256];
18         char iq_to[256];
19         char iq_client_resource[256];   /* resource name requested by the client */
20         int iq_session;                 /* nonzero == client is requesting a session */
21         char iq_query_xmlns[256];       /* Namespace of <query> */
22
23         char sasl_auth_mech[32];        /* SASL auth mechanism requested by the client */
24
25         char message_to[256];
26         char *message_body;             /* Message body in transit */
27         int html_tag_level;             /* <html> tag nesting level */
28
29         int bind_requested;             /* In this stanza, client is asking server to bind a resource. */
30 };
31
32 #define XMPP ((struct citxmpp *)CC->session_specific_data)
33
34 struct xmpp_event {
35         struct xmpp_event *next;
36         int event_seq;
37         time_t event_time;
38         int event_type;
39         char event_jid[256];
40         int session_which_generated_this_event;
41 };
42
43 extern struct xmpp_event *xmpp_queue;
44 extern int queue_event_seq;
45
46 enum {
47         XMPP_EVT_LOGIN,
48         XMPP_EVT_LOGOUT
49 };
50
51 void xmpp_cleanup_function(void);
52 void xmpp_greeting(void);
53 void xmpp_command_loop(void);
54 void xmpp_async_loop(void);
55 void xmpp_sasl_auth(char *, char *);
56 void xmpp_output_auth_mechs(void);
57 void xmpp_query_namespace(char *, char *, char *, char *);
58 void jabber_wholist_presence_dump(void);
59 void jabber_output_incoming_messages(void);
60 void xmpp_queue_event(int, char *);
61 void xmpp_process_events(void);
62 void xmpp_presence_notify(char *, char *);
63 void jabber_roster_item(struct CitContext *);
64 void jabber_send_message(char *, char *);