annotate src/sslconn.h @ 12116:e75ef7aa913e

[gaim-migrate @ 14416] " This patch implements a replacement for the queuing system from 1.x. It also obsoletes a previous patch [#1338873] I submitted to prioritize the unseen states in gtk conversations. The attached envelope.png is ripped from the msgunread.png already included in gaim. It should be dropped in the pixmaps directory (Makefile.am is updated accordingly in this patch). The two separate queuing preferences from 1.x, queuing messages while away and queuing all new messages (from docklet), are replaced with a single 3-way preference for conversations. The new preference is "Hide new IM conversations". This preference can be set to never, away and always. When a gtk conversation is created, it may be placed in a hidden conversation window instead of being placed normally. This decision is based upon the preference and possibly the away state of the account the conversation is being created for. This *will* effect conversations the user explicitly requests to be created, so in these cases the caller must be sure to present the conversation to the user, using gaim_gtkconv_present_conversation(). This is done already in gtkdialogs.c which handles creating conversations requested by the user from gaim proper (menus, double-clicking on budy in blist, etc.). The main advantage to not queuing messages is that the conversations exist, the message is written to the conversation (and logged if appropriate) and the unseen state is set on the conversation. This means no additional features are needed to track whether there are queued messages or not, just use the unseen state on conversations. Since conversations may not be visible (messages "queued"), gaim proper needs some notification that there are messages waiting. I opted for a menutray icon that shows up when an im conversation has an unseen message. Clicking this icon will focus (and show if hidden) the first conversation with an unseen message. This is essentially the same behavior of the docklet in cvs right now, except that the icon is only visible when there is a conversation with an unread message. The api that is added is flexible enough to allow either the docklet or the new blist menutray icon to be visible for conversations of any/all types and for unseen messages >= any state. Currently they are set to only IM conversations and only unseen states >= TEXT (system messages and no log messages will not trigger blinking the docklet or showing the blist tray icon), but these could be made preferences relatively easily in the future. Other plugins could probably benefit as well: gaim_gtk_conversations_get_first_unseen(). There is probably some limit to comment size, so I'll stop rambling now. If anyone has more questions/comments, catch me in #gaim, here or on gaim-devel." committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Wed, 16 Nov 2005 18:17:01 +0000
parents db62420a53a2
children c8ebbc0110f4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6703
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1 /**
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
2 * @file sslconn.h SSL API
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
3 * @ingroup core
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
4 *
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
5 * gaim
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
6 *
8046
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 7274
diff changeset
7 * Gaim is the legal property of its developers, whose names are too numerous
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 7274
diff changeset
8 * to list here. Please refer to the COPYRIGHT file distributed with this
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 7274
diff changeset
9 * source distribution.
6703
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
10 *
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
11 * This program is free software; you can redistribute it and/or modify
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
12 * it under the terms of the GNU General Public License as published by
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13 * the Free Software Foundation; either version 2 of the License, or
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 * (at your option) any later version.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 *
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16 * This program is distributed in the hope that it will be useful,
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
19 * GNU General Public License for more details.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20 *
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
21 * You should have received a copy of the GNU General Public License
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
22 * along with this program; if not, write to the Free Software
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
24 */
9713
db62420a53a2 [gaim-migrate @ 10574]
Mark Doliner <mark@kingant.net>
parents: 8362
diff changeset
25 #ifndef _GAIM_SSLCONN_H_
db62420a53a2 [gaim-migrate @ 10574]
Mark Doliner <mark@kingant.net>
parents: 8362
diff changeset
26 #define _GAIM_SSLCONN_H_
6703
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
27
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
28 #include "proxy.h"
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
29
6738
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
30 #define GAIM_SSL_DEFAULT_PORT 443
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
31
7274
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 6783
diff changeset
32 typedef enum
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 6783
diff changeset
33 {
8362
1976914caa51 [gaim-migrate @ 9087]
Nathan Walp <nwalp@pidgin.im>
parents: 8046
diff changeset
34 GAIM_SSL_HANDSHAKE_FAILED = 1,
1976914caa51 [gaim-migrate @ 9087]
Nathan Walp <nwalp@pidgin.im>
parents: 8046
diff changeset
35 GAIM_SSL_CONNECT_FAILED = 2
7274
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 6783
diff changeset
36 } GaimSslErrorType;
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 6783
diff changeset
37
6738
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
38 typedef struct _GaimSslConnection GaimSslConnection;
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
39
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
40 typedef void (*GaimSslInputFunction)(gpointer, GaimSslConnection *,
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
41 GaimInputCondition);
7274
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 6783
diff changeset
42 typedef void (*GaimSslErrorFunction)(GaimSslConnection *, GaimSslErrorType,
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 6783
diff changeset
43 gpointer);
6738
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
44
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
45 struct _GaimSslConnection
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
46 {
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
47 char *host;
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
48 int port;
6764
6d0d4e9149b9 [gaim-migrate @ 7296]
Nathan Walp <nwalp@pidgin.im>
parents: 6762
diff changeset
49 void *connect_cb_data;
6d0d4e9149b9 [gaim-migrate @ 7296]
Nathan Walp <nwalp@pidgin.im>
parents: 6762
diff changeset
50 GaimSslInputFunction connect_cb;
7274
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 6783
diff changeset
51 GaimSslErrorFunction error_cb;
6764
6d0d4e9149b9 [gaim-migrate @ 7296]
Nathan Walp <nwalp@pidgin.im>
parents: 6762
diff changeset
52 void *recv_cb_data;
6d0d4e9149b9 [gaim-migrate @ 7296]
Nathan Walp <nwalp@pidgin.im>
parents: 6762
diff changeset
53 GaimSslInputFunction recv_cb;
6738
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
54
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
55 int fd;
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
56 int inpa;
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
57
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
58 void *private_data;
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
59 };
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
60
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
61 /**
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
62 * SSL implementation operations structure.
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
63 *
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
64 * Every SSL implementation must provide one of these and register it.
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
65 */
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
66 typedef struct
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
67 {
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
68 gboolean (*init)(void);
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
69 void (*uninit)(void);
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
70 GaimInputFunction connect_cb;
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
71 void (*close)(GaimSslConnection *gsc);
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
72 size_t (*read)(GaimSslConnection *gsc, void *data, size_t len);
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
73 size_t (*write)(GaimSslConnection *gsc, const void *data, size_t len);
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
74
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
75 } GaimSslOps;
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
76
6703
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
77 #ifdef __cplusplus
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
78 extern "C" {
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
79 #endif
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
80
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
81 /**************************************************************************/
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
82 /** @name SSL API */
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
83 /**************************************************************************/
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
84 /*@{*/
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
85
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
86 /**
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
87 * Returns whether or not SSL is currently supported.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
88 *
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
89 * @return TRUE if SSL is supported, or FALSE otherwise.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
90 */
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
91 gboolean gaim_ssl_is_supported(void);
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
92
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
93 /**
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
94 * Makes a SSL connection to the specified host and port.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
95 *
7274
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 6783
diff changeset
96 * @param account The account making the connection.
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 6783
diff changeset
97 * @param host The destination host.
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 6783
diff changeset
98 * @param port The destination port.
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 6783
diff changeset
99 * @param func The SSL input handler function.
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 6783
diff changeset
100 * @param error_func The SSL error handler function.
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 6783
diff changeset
101 * @param data User-defined data.
6703
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
102 *
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
103 * @return The SSL connection handle.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
104 */
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
105 GaimSslConnection *gaim_ssl_connect(GaimAccount *account, const char *host,
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
106 int port, GaimSslInputFunction func,
7274
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 6783
diff changeset
107 GaimSslErrorFunction error_func,
6703
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
108 void *data);
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
109
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
110 /**
7274
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 6783
diff changeset
111 * Makes a SSL connection using an already open file descriptor.
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 6783
diff changeset
112 *
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 6783
diff changeset
113 * @param account The account making the connection.
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 6783
diff changeset
114 * @param fd The file descriptor.
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 6783
diff changeset
115 * @param func The SSL input handler function.
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 6783
diff changeset
116 * @param error_func The SSL error handler function.
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 6783
diff changeset
117 * @param data User-defined data.
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 6783
diff changeset
118 *
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 6783
diff changeset
119 * @return The SSL connection handle.
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 6783
diff changeset
120 */
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 6783
diff changeset
121 GaimSslConnection *gaim_ssl_connect_fd(GaimAccount *account, int fd,
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 6783
diff changeset
122 GaimSslInputFunction func,
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 6783
diff changeset
123 GaimSslErrorFunction error_func,
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 6783
diff changeset
124 void *data);
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 6783
diff changeset
125
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 6783
diff changeset
126 /**
6764
6d0d4e9149b9 [gaim-migrate @ 7296]
Nathan Walp <nwalp@pidgin.im>
parents: 6762
diff changeset
127 * Adds an input watcher for the specified SSL connection.
6d0d4e9149b9 [gaim-migrate @ 7296]
Nathan Walp <nwalp@pidgin.im>
parents: 6762
diff changeset
128 *
6d0d4e9149b9 [gaim-migrate @ 7296]
Nathan Walp <nwalp@pidgin.im>
parents: 6762
diff changeset
129 * @param gsc The SSL connection handle.
6d0d4e9149b9 [gaim-migrate @ 7296]
Nathan Walp <nwalp@pidgin.im>
parents: 6762
diff changeset
130 * @param func The callback function.
6d0d4e9149b9 [gaim-migrate @ 7296]
Nathan Walp <nwalp@pidgin.im>
parents: 6762
diff changeset
131 * @param data User-defined data.
6d0d4e9149b9 [gaim-migrate @ 7296]
Nathan Walp <nwalp@pidgin.im>
parents: 6762
diff changeset
132 */
6d0d4e9149b9 [gaim-migrate @ 7296]
Nathan Walp <nwalp@pidgin.im>
parents: 6762
diff changeset
133 void gaim_ssl_input_add(GaimSslConnection *gsc, GaimSslInputFunction func,
7274
448e39ace278 [gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents: 6783
diff changeset
134 void *data);
6762
818ce550d2ce [gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents: 6738
diff changeset
135
818ce550d2ce [gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents: 6738
diff changeset
136 /**
6703
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
137 * Closes a SSL connection.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
138 *
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
139 * @param gsc The SSL connection to close.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
140 */
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
141 void gaim_ssl_close(GaimSslConnection *gsc);
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
142
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
143 /**
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
144 * Reads data from an SSL connection.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
145 *
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
146 * @param gsc The SSL connection handle.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
147 * @param buffer The destination buffer.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
148 * @param len The maximum number of bytes to read.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
149 *
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
150 * @return The number of bytes read.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
151 */
6720
41120df7ed94 [gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents: 6703
diff changeset
152 size_t gaim_ssl_read(GaimSslConnection *gsc, void *buffer, size_t len);
6703
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
153
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
154 /**
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
155 * Writes data to an SSL connection.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
156 *
6720
41120df7ed94 [gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents: 6703
diff changeset
157 * @param gsc The SSL connection handle.
41120df7ed94 [gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents: 6703
diff changeset
158 * @param buffer The buffer to write.
41120df7ed94 [gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents: 6703
diff changeset
159 * @param len The length of the data to write.
6703
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
160 *
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
161 * @return The number of bytes written.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
162 */
6720
41120df7ed94 [gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents: 6703
diff changeset
163 size_t gaim_ssl_write(GaimSslConnection *gsc, const void *buffer, size_t len);
6703
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
164
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
165 /*@}*/
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
166
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
167 /**************************************************************************/
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
168 /** @name Subsystem API */
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
169 /**************************************************************************/
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
170 /*@{*/
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
171
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
172 /**
6738
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
173 * Sets the current SSL operations structure.
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
174 *
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
175 * @param ops The SSL operations structure to assign.
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
176 */
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
177 void gaim_ssl_set_ops(GaimSslOps *ops);
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
178
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
179 /**
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
180 * Returns the current SSL operations structure.
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
181 *
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
182 * @return The SSL operations structure.
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
183 */
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
184 GaimSslOps *gaim_ssl_get_ops(void);
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
185
6c95f01aaf49 [gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
186 /**
6703
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
187 * Initializes the SSL subsystem.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
188 */
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
189 void gaim_ssl_init(void);
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
190
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
191 /**
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
192 * Uninitializes the SSL subsystem.
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
193 */
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
194 void gaim_ssl_uninit(void);
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
195
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
196 /*@}*/
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
197
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
198 #ifdef __cplusplus
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
199 }
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
200 #endif
36897b9e009f [gaim-migrate @ 7229]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
201
9713
db62420a53a2 [gaim-migrate @ 10574]
Mark Doliner <mark@kingant.net>
parents: 8362
diff changeset
202 #endif /* _GAIM_SSLCONN_H_ */