annotate src/protocols/jabber/jabber.h @ 7814:f23a7bc0de77

[gaim-migrate @ 8461] i never remember to update this anyway committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Tue, 09 Dec 2003 01:11:13 +0000
parents 9008b5be4275
children 7bae464195c4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
1 /**
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
2 * @file jabber.h
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
3 *
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
4 * gaim
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
5 *
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
6 * Copyright (C) 2003 Nathan Walp <faceprint@faceprint.com>
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
7 *
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
8 * This program is free software; you can redistribute it and/or modify
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
9 * it under the terms of the GNU General Public License as published by
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
11 * (at your option) any later version.
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
12 *
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
13 * This program is distributed in the hope that it will be useful,
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
16 * GNU General Public License for more details.
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
17 *
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
18 * You should have received a copy of the GNU General Public License
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
19 * along with this program; if not, write to the Free Software
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
21 */
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
22 #ifndef _GAIM_JABBER_H_
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
23 #define _GAIM_JABBER_H_
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
24
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
25 #include <glib.h>
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
26 #include "connection.h"
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
27 #include "sslconn.h"
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
28
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
29 #include "jutil.h"
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
30 #include "xmlnode.h"
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
31
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
32 typedef enum {
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
33 JABBER_STREAM_OFFLINE,
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
34 JABBER_STREAM_CONNECTING,
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
35 JABBER_STREAM_INITIALIZING,
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
36 JABBER_STREAM_AUTHENTICATING,
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
37 JABBER_STREAM_REINITIALIZING,
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
38 JABBER_STREAM_CONNECTED
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
39 } JabberStreamState;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
40
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
41 typedef struct _JabberStream
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
42 {
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
43 int fd;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
44
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
45 GMarkupParseContext *context;
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
46 xmlnode *current;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
47
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
48 enum {
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
49 JABBER_PROTO_0_9,
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
50 JABBER_PROTO_1_0
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
51 } protocol_version;
7291
632cee95cc5c [gaim-migrate @ 7872]
Nathan Walp <nwalp@pidgin.im>
parents: 7170
diff changeset
52 enum {
632cee95cc5c [gaim-migrate @ 7872]
Nathan Walp <nwalp@pidgin.im>
parents: 7170
diff changeset
53 JABBER_AUTH_NONE,
632cee95cc5c [gaim-migrate @ 7872]
Nathan Walp <nwalp@pidgin.im>
parents: 7170
diff changeset
54 JABBER_AUTH_DIGEST_MD5,
632cee95cc5c [gaim-migrate @ 7872]
Nathan Walp <nwalp@pidgin.im>
parents: 7170
diff changeset
55 JABBER_AUTH_PLAIN
632cee95cc5c [gaim-migrate @ 7872]
Nathan Walp <nwalp@pidgin.im>
parents: 7170
diff changeset
56 } auth_type;
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
57 char *stream_id;
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
58 JabberStreamState state;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
59
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
60 /* SASL authentication */
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
61 char *expected_rspauth;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
62
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
63 GHashTable *buddies;
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
64 gboolean roster_parsed;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
65
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
66 GHashTable *chats;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
67
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
68 GHashTable *callbacks;
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
69 int next_id;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
70
7395
b250288fa948 [gaim-migrate @ 7990]
Nathan Walp <nwalp@pidgin.im>
parents: 7291
diff changeset
71 GList *oob_file_transfers;
7170
1cf80749f2f0 [gaim-migrate @ 7737]
Nathan Walp <nwalp@pidgin.im>
parents: 7077
diff changeset
72 GList *file_transfers;
1cf80749f2f0 [gaim-migrate @ 7737]
Nathan Walp <nwalp@pidgin.im>
parents: 7077
diff changeset
73
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
74 time_t idle;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
75
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
76 JabberID *user;
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
77 GaimConnection *gc;
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
78 GaimSslConnection *gsc;
7072
1350352f5818 [gaim-migrate @ 7637]
Nathan Walp <nwalp@pidgin.im>
parents: 7014
diff changeset
79
1350352f5818 [gaim-migrate @ 7637]
Nathan Walp <nwalp@pidgin.im>
parents: 7014
diff changeset
80 gboolean registration;
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
81 } JabberStream;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
82
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
83 void jabber_process_packet(JabberStream *js, xmlnode *packet);
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
84 void jabber_send(JabberStream *js, xmlnode *data);
7642
9008b5be4275 [gaim-migrate @ 8285]
Nathan Walp <nwalp@pidgin.im>
parents: 7395
diff changeset
85 void jabber_send_raw(JabberStream *js, const char *data, int len);
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
86
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
87 void jabber_stream_set_state(JabberStream *js, JabberStreamState state);
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
88
7077
6d10bf28be0e [gaim-migrate @ 7642]
Nathan Walp <nwalp@pidgin.im>
parents: 7072
diff changeset
89 void jabber_register_parse(JabberStream *js, xmlnode *packet);
6d10bf28be0e [gaim-migrate @ 7642]
Nathan Walp <nwalp@pidgin.im>
parents: 7072
diff changeset
90
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
91 char *jabber_get_next_id(JabberStream *js);
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
92
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
93 #endif /* _GAIM_JABBER_H_ */