Mon, 21 Aug 2006 05:25:44 +0000
[gaim-migrate @ 16944]
Rename GaimProxyConnectInfo to GaimProxyConnectData, and change the
variables from connect_info to connect_data. Sorry, but I wanted
to get this right before it becomes permanent.
| 7014 | 1 | /** |
| 2 | * @file jabber.h | |
| 3 | * | |
| 4 | * gaim | |
| 5 | * | |
| 6 | * Copyright (C) 2003 Nathan Walp <faceprint@faceprint.com> | |
| 2086 | 7 | * |
| 7014 | 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by | |
| 10 | * the Free Software Foundation; either version 2 of the License, or | |
| 11 | * (at your option) any later version. | |
| 2086 | 12 | * |
| 7014 | 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 16 | * GNU General Public License for more details. | |
| 2086 | 17 | * |
| 7014 | 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program; if not, write to the Free Software | |
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 2086 | 21 | */ |
| 7014 | 22 | #ifndef _GAIM_JABBER_H_ |
| 23 | #define _GAIM_JABBER_H_ | |
| 2086 | 24 | |
| 13808 | 25 | #ifdef HAVE_LIBXML |
| 26 | #include <libxml/parser.h> | |
| 27 | #endif | |
| 7014 | 28 | #include <glib.h> |
|
14013
86dac5633bd9
[gaim-migrate @ 16496]
Mark Doliner <markdoliner@pidgin.im>
parents:
13808
diff
changeset
|
29 | #include "circbuffer.h" |
| 7014 | 30 | #include "connection.h" |
| 8113 | 31 | #include "roomlist.h" |
| 7014 | 32 | #include "sslconn.h" |
| 2086 | 33 | |
| 7014 | 34 | #include "jutil.h" |
| 35 | #include "xmlnode.h" | |
| 2086 | 36 | |
| 12508 | 37 | #ifdef HAVE_CYRUS_SASL |
| 38 | #include <sasl/sasl.h> | |
| 39 | #endif | |
| 40 | ||
| 13385 | 41 | #define CAPS0115_NODE "http://gaim.sf.net/caps" |
| 42 | ||
| 7014 | 43 | typedef enum { |
| 8312 | 44 | JABBER_CAP_NONE = 0, |
| 45 | JABBER_CAP_XHTML = 1 << 0, | |
| 46 | JABBER_CAP_COMPOSING = 1 << 1, | |
| 47 | JABBER_CAP_SI = 1 << 2, | |
| 48 | JABBER_CAP_SI_FILE_XFER = 1 << 3, | |
| 49 | JABBER_CAP_BYTESTREAMS = 1 << 4, | |
| 50 | JABBER_CAP_IBB = 1 << 5, | |
| 11393 | 51 | JABBER_CAP_CHAT_STATES = 1 << 6, |
| 11675 | 52 | JABBER_CAP_IQ_SEARCH = 1 << 7, |
| 53 | JABBER_CAP_IQ_REGISTER = 1 << 8, | |
| 8312 | 54 | JABBER_CAP_RETRIEVED = 1 << 31 |
| 55 | } JabberCapabilities; | |
| 56 | ||
| 57 | typedef enum { | |
| 7014 | 58 | JABBER_STREAM_OFFLINE, |
| 59 | JABBER_STREAM_CONNECTING, | |
| 60 | JABBER_STREAM_INITIALIZING, | |
| 61 | JABBER_STREAM_AUTHENTICATING, | |
| 62 | JABBER_STREAM_REINITIALIZING, | |
| 63 | JABBER_STREAM_CONNECTED | |
| 64 | } JabberStreamState; | |
| 2086 | 65 | |
| 7014 | 66 | typedef struct _JabberStream |
| 2086 | 67 | { |
| 7014 | 68 | int fd; |
| 2086 | 69 | |
|
14324
8cbedd82b6ac
[gaim-migrate @ 16944]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
70 | GaimProxyConnectData *connect_data; |
|
14175
2bc5a80c5071
[gaim-migrate @ 16747]
Mark Doliner <markdoliner@pidgin.im>
parents:
14062
diff
changeset
|
71 | |
| 13808 | 72 | #ifdef HAVE_LIBXML |
| 73 | xmlParserCtxt *context; | |
| 74 | #else | |
| 7014 | 75 | GMarkupParseContext *context; |
| 13808 | 76 | #endif |
| 7014 | 77 | xmlnode *current; |
| 2086 | 78 | |
| 7014 | 79 | enum { |
| 80 | JABBER_PROTO_0_9, | |
| 81 | JABBER_PROTO_1_0 | |
| 82 | } protocol_version; | |
| 7291 | 83 | enum { |
| 8296 | 84 | JABBER_AUTH_UNKNOWN, |
| 7291 | 85 | JABBER_AUTH_DIGEST_MD5, |
| 8296 | 86 | JABBER_AUTH_PLAIN, |
| 12508 | 87 | JABBER_AUTH_IQ_AUTH, |
| 88 | JABBER_AUTH_CYRUS | |
| 7291 | 89 | } auth_type; |
| 7014 | 90 | char *stream_id; |
| 91 | JabberStreamState state; | |
| 2086 | 92 | |
| 7014 | 93 | /* SASL authentication */ |
| 94 | char *expected_rspauth; | |
| 2086 | 95 | |
| 7014 | 96 | GHashTable *buddies; |
| 97 | gboolean roster_parsed; | |
| 2086 | 98 | |
| 7014 | 99 | GHashTable *chats; |
| 8043 | 100 | GList *chat_servers; |
| 8113 | 101 | GaimRoomlist *roomlist; |
| 11675 | 102 | GList *user_directories; |
| 2086 | 103 | |
| 8312 | 104 | GHashTable *iq_callbacks; |
| 105 | GHashTable *disco_callbacks; | |
| 7014 | 106 | int next_id; |
| 2086 | 107 | |
| 8312 | 108 | |
| 7395 | 109 | GList *oob_file_transfers; |
| 7170 | 110 | GList *file_transfers; |
| 111 | ||
| 7014 | 112 | time_t idle; |
| 2086 | 113 | |
| 7014 | 114 | JabberID *user; |
| 115 | GaimConnection *gc; | |
| 116 | GaimSslConnection *gsc; | |
| 7072 | 117 | |
| 118 | gboolean registration; | |
| 10189 | 119 | |
| 120 | char *avatar_hash; | |
| 10941 | 121 | GSList *pending_avatar_requests; |
| 12508 | 122 | |
|
13201
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
12508
diff
changeset
|
123 | GaimCircBuffer *write_buffer; |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
12508
diff
changeset
|
124 | guint writeh; |
|
8c224ef70efa
[gaim-migrate @ 15563]
Daniel Atallah <datallah@pidgin.im>
parents:
12508
diff
changeset
|
125 | |
| 14062 | 126 | gboolean reinit; |
| 127 | ||
| 12508 | 128 | /* OK, this stays at the end of the struct, so plugins can depend |
| 129 | * on the rest of the stuff being in the right place | |
| 130 | */ | |
| 131 | #ifdef HAVE_CYRUS_SASL | |
| 132 | sasl_conn_t *sasl; | |
| 133 | sasl_callback_t *sasl_cb; | |
| 134 | int sasl_state; | |
| 135 | int sasl_maxbuf; | |
| 136 | GString *sasl_mechs; | |
| 137 | #endif | |
| 138 | ||
| 7014 | 139 | } JabberStream; |
| 2086 | 140 | |
| 7014 | 141 | void jabber_process_packet(JabberStream *js, xmlnode *packet); |
| 142 | void jabber_send(JabberStream *js, xmlnode *data); | |
| 7642 | 143 | void jabber_send_raw(JabberStream *js, const char *data, int len); |
| 2086 | 144 | |
| 7014 | 145 | void jabber_stream_set_state(JabberStream *js, JabberStreamState state); |
| 2086 | 146 | |
| 7077 | 147 | void jabber_register_parse(JabberStream *js, xmlnode *packet); |
| 8016 | 148 | void jabber_register_start(JabberStream *js); |
| 7077 | 149 | |
| 7014 | 150 | char *jabber_get_next_id(JabberStream *js); |
| 2086 | 151 | |
| 8401 | 152 | char *jabber_parse_error(JabberStream *js, xmlnode *packet); |
| 153 | ||
| 7014 | 154 | #endif /* _GAIM_JABBER_H_ */ |