Thu, 31 May 2007 00:39:01 +0000
disapproval of revision '8976f9e287fef5bd2856c34ea931afa70a997895'
| 6703 | 1 | /** |
| 2 | * @file sslconn.h SSL API | |
| 3 | * @ingroup core | |
| 4 | * | |
| 15884 | 5 | * purple |
| 6703 | 6 | * |
| 15884 | 7 | * Purple is the legal property of its developers, whose names are too numerous |
| 8046 | 8 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 9 | * source distribution. | |
| 6703 | 10 | * |
| 11 | * This program is free software; you can redistribute it and/or modify | |
| 12 | * it under the terms of the GNU General Public License as published by | |
| 13 | * the Free Software Foundation; either version 2 of the License, or | |
| 14 | * (at your option) any later version. | |
| 15 | * | |
| 16 | * This program is distributed in the hope that it will be useful, | |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 | * GNU General Public License for more details. | |
| 20 | * | |
| 21 | * You should have received a copy of the GNU General Public License | |
| 22 | * along with this program; if not, write to the Free Software | |
| 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 24 | */ | |
| 15884 | 25 | #ifndef _PURPLE_SSLCONN_H_ |
| 26 | #define _PURPLE_SSLCONN_H_ | |
| 6703 | 27 | |
| 28 | #include "proxy.h" | |
| 29 | ||
| 15884 | 30 | #define PURPLE_SSL_DEFAULT_PORT 443 |
|
6738
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
31 | |
|
7274
42ec5f56e32a
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
6783
diff
changeset
|
32 | typedef enum |
|
42ec5f56e32a
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
6783
diff
changeset
|
33 | { |
| 15884 | 34 | PURPLE_SSL_HANDSHAKE_FAILED = 1, |
|
17430
95d550efcc3d
disapproval of revision '8976f9e287fef5bd2856c34ea931afa70a997895'
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17429
diff
changeset
|
35 | PURPLE_SSL_CONNECT_FAILED = 2 |
| 15884 | 36 | } PurpleSslErrorType; |
|
7274
42ec5f56e32a
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
6783
diff
changeset
|
37 | |
| 15884 | 38 | typedef struct _PurpleSslConnection PurpleSslConnection; |
|
6738
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
39 | |
| 15884 | 40 | typedef void (*PurpleSslInputFunction)(gpointer, PurpleSslConnection *, |
| 41 | PurpleInputCondition); | |
| 42 | typedef void (*PurpleSslErrorFunction)(PurpleSslConnection *, PurpleSslErrorType, | |
|
7274
42ec5f56e32a
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
6783
diff
changeset
|
43 | gpointer); |
|
6738
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
44 | |
| 15884 | 45 | struct _PurpleSslConnection |
|
6738
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
46 | { |
|
17314
db5063b444df
Partial documentation on SslConnection struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17313
diff
changeset
|
47 | /** Hostname to which the SSL connection will be made */ |
|
6738
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
48 | char *host; |
|
17314
db5063b444df
Partial documentation on SslConnection struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17313
diff
changeset
|
49 | /** Port to connect to */ |
|
6738
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
50 | int port; |
|
17315
b6976c48ec78
More documenting
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17314
diff
changeset
|
51 | /** Data to pass to PurpleSslConnection::connect_cb() */ |
| 6764 | 52 | void *connect_cb_data; |
|
17315
b6976c48ec78
More documenting
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17314
diff
changeset
|
53 | /** Callback triggered once the SSL handshake is complete */ |
| 15884 | 54 | PurpleSslInputFunction connect_cb; |
|
17316
a511aef67b4f
- Completed SslConnection fields docs
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17315
diff
changeset
|
55 | /** Callback triggered if there is an error during connection */ |
| 15884 | 56 | PurpleSslErrorFunction error_cb; |
|
17315
b6976c48ec78
More documenting
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17314
diff
changeset
|
57 | /** Data passed to PurpleSslConnection::recv_cb() */ |
| 6764 | 58 | void *recv_cb_data; |
|
17316
a511aef67b4f
- Completed SslConnection fields docs
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17315
diff
changeset
|
59 | /** User-defined callback executed when the SSL connection receives data */ |
| 15884 | 60 | PurpleSslInputFunction recv_cb; |
|
6738
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
61 | |
|
17314
db5063b444df
Partial documentation on SslConnection struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17313
diff
changeset
|
62 | /** File descriptor used to refer to the socket */ |
|
6738
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
63 | int fd; |
|
17316
a511aef67b4f
- Completed SslConnection fields docs
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17315
diff
changeset
|
64 | /** Glib event source ID; used to refer to the received data callback |
|
a511aef67b4f
- Completed SslConnection fields docs
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17315
diff
changeset
|
65 | * in the glib eventloop */ |
|
6738
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
66 | int inpa; |
|
17316
a511aef67b4f
- Completed SslConnection fields docs
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17315
diff
changeset
|
67 | /** Data related to the underlying TCP connection */ |
| 15884 | 68 | PurpleProxyConnectData *connect_data; |
|
6738
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
69 | |
|
17314
db5063b444df
Partial documentation on SslConnection struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17313
diff
changeset
|
70 | /** Internal connection data managed by the SSL backend (GnuTLS/LibNSS/whatever) */ |
|
6738
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
71 | void *private_data; |
|
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
72 | }; |
|
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
73 | |
|
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
74 | /** |
|
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
75 | * SSL implementation operations structure. |
|
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
76 | * |
|
17315
b6976c48ec78
More documenting
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17314
diff
changeset
|
77 | * Every SSL implementation must provide all of these and register it via purple_ssl_set_ops() |
|
17313
c8b649e48d4f
Clarify documentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17312
diff
changeset
|
78 | * These should not be called directly! Instead, use the purple_ssl_* functions. |
|
6738
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
79 | */ |
|
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
80 | typedef struct |
|
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
81 | { |
|
17312
ba4bc8d967f8
Documented the SslOps structure
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16743
diff
changeset
|
82 | /** Initializes the SSL system provided. |
|
ba4bc8d967f8
Documented the SslOps structure
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16743
diff
changeset
|
83 | * @return TRUE if initialization succeeded |
|
ba4bc8d967f8
Documented the SslOps structure
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16743
diff
changeset
|
84 | */ |
|
6738
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
85 | gboolean (*init)(void); |
|
17312
ba4bc8d967f8
Documented the SslOps structure
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16743
diff
changeset
|
86 | /** Unloads the SSL system. Inverse of init. */ |
|
6738
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
87 | void (*uninit)(void); |
|
17312
ba4bc8d967f8
Documented the SslOps structure
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16743
diff
changeset
|
88 | /** Sets up the SSL connection for a PurpleSslConnection once |
|
ba4bc8d967f8
Documented the SslOps structure
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16743
diff
changeset
|
89 | * the TCP connection has been established */ |
| 15884 | 90 | void (*connectfunc)(PurpleSslConnection *gsc); |
|
17313
c8b649e48d4f
Clarify documentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17312
diff
changeset
|
91 | /** Destroys the internal data of the SSL connection provided. |
|
c8b649e48d4f
Clarify documentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17312
diff
changeset
|
92 | * Freeing gsc itself is left to purple_ssl_close() |
|
c8b649e48d4f
Clarify documentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17312
diff
changeset
|
93 | * |
|
c8b649e48d4f
Clarify documentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17312
diff
changeset
|
94 | */ |
| 15884 | 95 | void (*close)(PurpleSslConnection *gsc); |
|
17312
ba4bc8d967f8
Documented the SslOps structure
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16743
diff
changeset
|
96 | /** Reads data from a connection (like POSIX read()) |
|
ba4bc8d967f8
Documented the SslOps structure
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16743
diff
changeset
|
97 | * @param gsc Connection context |
|
ba4bc8d967f8
Documented the SslOps structure
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16743
diff
changeset
|
98 | * @param data Pointer to buffer to drop data into |
|
ba4bc8d967f8
Documented the SslOps structure
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16743
diff
changeset
|
99 | * @param len Maximum number of bytes to read |
|
ba4bc8d967f8
Documented the SslOps structure
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16743
diff
changeset
|
100 | * @return Number of bytes actually written into the buffer, or <0 on error |
|
ba4bc8d967f8
Documented the SslOps structure
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16743
diff
changeset
|
101 | */ |
| 15884 | 102 | size_t (*read)(PurpleSslConnection *gsc, void *data, size_t len); |
|
17312
ba4bc8d967f8
Documented the SslOps structure
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16743
diff
changeset
|
103 | /** Writes data to a connection (like POSIX send()) |
|
ba4bc8d967f8
Documented the SslOps structure
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16743
diff
changeset
|
104 | * @param gsc Connection context |
|
ba4bc8d967f8
Documented the SslOps structure
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16743
diff
changeset
|
105 | * @param data Data buffer to send data from |
|
ba4bc8d967f8
Documented the SslOps structure
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16743
diff
changeset
|
106 | * @param len Number of bytes to send from buffer |
|
ba4bc8d967f8
Documented the SslOps structure
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16743
diff
changeset
|
107 | * @return The number of bytes written (may be less than len) or <0 on error |
|
ba4bc8d967f8
Documented the SslOps structure
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16743
diff
changeset
|
108 | */ |
| 15884 | 109 | size_t (*write)(PurpleSslConnection *gsc, const void *data, size_t len); |
|
6738
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
110 | |
|
16743
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
111 | void (*_purple_reserved1)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
112 | void (*_purple_reserved2)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
113 | void (*_purple_reserved3)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
114 | void (*_purple_reserved4)(void); |
| 15884 | 115 | } PurpleSslOps; |
|
6738
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
116 | |
| 6703 | 117 | #ifdef __cplusplus |
| 118 | extern "C" { | |
| 119 | #endif | |
| 120 | ||
| 121 | /**************************************************************************/ | |
| 122 | /** @name SSL API */ | |
| 123 | /**************************************************************************/ | |
| 124 | /*@{*/ | |
| 125 | ||
| 126 | /** | |
| 127 | * Returns whether or not SSL is currently supported. | |
| 128 | * | |
| 129 | * @return TRUE if SSL is supported, or FALSE otherwise. | |
| 130 | */ | |
| 15884 | 131 | gboolean purple_ssl_is_supported(void); |
| 6703 | 132 | |
| 133 | /** | |
|
14312
6ce4512aa9a8
[gaim-migrate @ 16932]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
134 | * Makes a SSL connection to the specified host and port. The caller |
|
6ce4512aa9a8
[gaim-migrate @ 16932]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
135 | * should keep track of the returned value and use it to cancel the |
|
6ce4512aa9a8
[gaim-migrate @ 16932]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
136 | * connection, if needed. |
| 6703 | 137 | * |
|
7274
42ec5f56e32a
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
6783
diff
changeset
|
138 | * @param account The account making the connection. |
|
42ec5f56e32a
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
6783
diff
changeset
|
139 | * @param host The destination host. |
|
42ec5f56e32a
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
6783
diff
changeset
|
140 | * @param port The destination port. |
|
42ec5f56e32a
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
6783
diff
changeset
|
141 | * @param func The SSL input handler function. |
|
14312
6ce4512aa9a8
[gaim-migrate @ 16932]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
142 | * @param error_func The SSL error handler function. This function |
| 15884 | 143 | * should NOT call purple_ssl_close(). In the event |
| 144 | * of an error the PurpleSslConnection will be | |
|
14312
6ce4512aa9a8
[gaim-migrate @ 16932]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
145 | * destroyed for you. |
|
7274
42ec5f56e32a
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
6783
diff
changeset
|
146 | * @param data User-defined data. |
| 6703 | 147 | * |
| 148 | * @return The SSL connection handle. | |
| 149 | */ | |
| 15884 | 150 | PurpleSslConnection *purple_ssl_connect(PurpleAccount *account, const char *host, |
| 151 | int port, PurpleSslInputFunction func, | |
| 152 | PurpleSslErrorFunction error_func, | |
| 6703 | 153 | void *data); |
| 154 | ||
| 155 | /** | |
|
7274
42ec5f56e32a
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
6783
diff
changeset
|
156 | * Makes a SSL connection using an already open file descriptor. |
|
42ec5f56e32a
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
6783
diff
changeset
|
157 | * |
|
42ec5f56e32a
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
6783
diff
changeset
|
158 | * @param account The account making the connection. |
|
42ec5f56e32a
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
6783
diff
changeset
|
159 | * @param fd The file descriptor. |
|
42ec5f56e32a
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
6783
diff
changeset
|
160 | * @param func The SSL input handler function. |
|
42ec5f56e32a
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
6783
diff
changeset
|
161 | * @param error_func The SSL error handler function. |
|
42ec5f56e32a
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
6783
diff
changeset
|
162 | * @param data User-defined data. |
|
42ec5f56e32a
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
6783
diff
changeset
|
163 | * |
|
42ec5f56e32a
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
6783
diff
changeset
|
164 | * @return The SSL connection handle. |
|
42ec5f56e32a
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
6783
diff
changeset
|
165 | */ |
| 15884 | 166 | PurpleSslConnection *purple_ssl_connect_fd(PurpleAccount *account, int fd, |
| 167 | PurpleSslInputFunction func, | |
| 168 | PurpleSslErrorFunction error_func, | |
|
7274
42ec5f56e32a
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
6783
diff
changeset
|
169 | void *data); |
|
42ec5f56e32a
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
6783
diff
changeset
|
170 | |
|
42ec5f56e32a
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
6783
diff
changeset
|
171 | /** |
| 6764 | 172 | * Adds an input watcher for the specified SSL connection. |
|
17344
158859c42ae9
Add note on use of purple_ssl_input_add
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17316
diff
changeset
|
173 | * Once the SSL handshake is complete, use this to watch for actual data across it. |
| 6764 | 174 | * |
| 175 | * @param gsc The SSL connection handle. | |
| 176 | * @param func The callback function. | |
| 177 | * @param data User-defined data. | |
| 178 | */ | |
| 15884 | 179 | void purple_ssl_input_add(PurpleSslConnection *gsc, PurpleSslInputFunction func, |
|
7274
42ec5f56e32a
[gaim-migrate @ 7851]
Christian Hammond <chipx86@chipx86.com>
parents:
6783
diff
changeset
|
180 | void *data); |
|
6762
2349053f14aa
[gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents:
6738
diff
changeset
|
181 | |
|
2349053f14aa
[gaim-migrate @ 7294]
Christian Hammond <chipx86@chipx86.com>
parents:
6738
diff
changeset
|
182 | /** |
| 6703 | 183 | * Closes a SSL connection. |
| 184 | * | |
| 185 | * @param gsc The SSL connection to close. | |
| 186 | */ | |
| 15884 | 187 | void purple_ssl_close(PurpleSslConnection *gsc); |
| 6703 | 188 | |
| 189 | /** | |
| 190 | * Reads data from an SSL connection. | |
| 191 | * | |
| 192 | * @param gsc The SSL connection handle. | |
| 193 | * @param buffer The destination buffer. | |
| 194 | * @param len The maximum number of bytes to read. | |
| 195 | * | |
| 196 | * @return The number of bytes read. | |
| 197 | */ | |
| 15884 | 198 | size_t purple_ssl_read(PurpleSslConnection *gsc, void *buffer, size_t len); |
| 6703 | 199 | |
| 200 | /** | |
| 201 | * Writes data to an SSL connection. | |
| 202 | * | |
|
6720
cdc5348dd848
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6703
diff
changeset
|
203 | * @param gsc The SSL connection handle. |
|
cdc5348dd848
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6703
diff
changeset
|
204 | * @param buffer The buffer to write. |
|
cdc5348dd848
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6703
diff
changeset
|
205 | * @param len The length of the data to write. |
| 6703 | 206 | * |
| 207 | * @return The number of bytes written. | |
| 208 | */ | |
| 15884 | 209 | size_t purple_ssl_write(PurpleSslConnection *gsc, const void *buffer, size_t len); |
| 6703 | 210 | |
| 211 | /*@}*/ | |
| 212 | ||
| 213 | /**************************************************************************/ | |
| 214 | /** @name Subsystem API */ | |
| 215 | /**************************************************************************/ | |
| 216 | /*@{*/ | |
| 217 | ||
| 218 | /** | |
|
6738
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
219 | * Sets the current SSL operations structure. |
|
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
220 | * |
|
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
221 | * @param ops The SSL operations structure to assign. |
|
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
222 | */ |
| 15884 | 223 | void purple_ssl_set_ops(PurpleSslOps *ops); |
|
6738
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
224 | |
|
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
225 | /** |
|
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
226 | * Returns the current SSL operations structure. |
|
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
227 | * |
|
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
228 | * @return The SSL operations structure. |
|
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
229 | */ |
| 15884 | 230 | PurpleSslOps *purple_ssl_get_ops(void); |
|
6738
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
231 | |
|
aa797bcc69dd
[gaim-migrate @ 7270]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
232 | /** |
| 6703 | 233 | * Initializes the SSL subsystem. |
| 234 | */ | |
| 15884 | 235 | void purple_ssl_init(void); |
| 6703 | 236 | |
| 237 | /** | |
| 238 | * Uninitializes the SSL subsystem. | |
| 239 | */ | |
| 15884 | 240 | void purple_ssl_uninit(void); |
| 6703 | 241 | |
| 242 | /*@}*/ | |
| 243 | ||
| 244 | #ifdef __cplusplus | |
| 245 | } | |
| 246 | #endif | |
| 247 | ||
| 15884 | 248 | #endif /* _PURPLE_SSLCONN_H_ */ |