comparison src/sslconn.h @ 6703:36897b9e009f

[gaim-migrate @ 7229] Forgot the SSL wrapper code. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Tue, 02 Sep 2003 04:43:28 +0000
parents
children 41120df7ed94
comparison
equal deleted inserted replaced
6702:302ee2792e91 6703:36897b9e009f
1 /**
2 * @file sslconn.h SSL API
3 * @ingroup core
4 *
5 * gaim
6 *
7 * Copyright (C) 2003 Christian Hammond <chipx86@gnupdate.org>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23 #ifndef _GAIM_SSL_H_
24 #define _GAIM_SSL_H_
25
26 #include "proxy.h"
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 #define GAIM_SSL_DEFAULT_PORT 443
33
34 typedef void *GaimSslConnection;
35 typedef void (*GaimSslInputFunction)(gpointer, GaimSslConnection *,
36 GaimInputCondition);
37
38 /**************************************************************************/
39 /** @name SSL API */
40 /**************************************************************************/
41 /*@{*/
42
43 /**
44 * Returns whether or not SSL is currently supported.
45 *
46 * @return TRUE if SSL is supported, or FALSE otherwise.
47 */
48 gboolean gaim_ssl_is_supported(void);
49
50 /**
51 * Makes a SSL connection to the specified host and port.
52 *
53 * @param account The account making the connection.
54 * @param host The destination host.
55 * @param port The destination port.
56 * @param func The SSL input handler function.
57 * @param data User-defined data.
58 *
59 * @return The SSL connection handle.
60 */
61 GaimSslConnection *gaim_ssl_connect(GaimAccount *account, const char *host,
62 int port, GaimSslInputFunction func,
63 void *data);
64
65 /**
66 * Closes a SSL connection.
67 *
68 * @param gsc The SSL connection to close.
69 */
70 void gaim_ssl_close(GaimSslConnection *gsc);
71
72 /**
73 * Reads data from an SSL connection.
74 *
75 * @param gsc The SSL connection handle.
76 * @param buffer The destination buffer.
77 * @param len The maximum number of bytes to read.
78 *
79 * @return The number of bytes read.
80 */
81 size_t gaim_ssl_read(GaimSslConnection *gsc, void *data, size_t len);
82
83 /**
84 * Writes data to an SSL connection.
85 *
86 * @param gsc The SSL connection handle.
87 * @param data The data to write.
88 * @param len The length of the data to write.
89 *
90 * @return The number of bytes written.
91 */
92 size_t gaim_ssl_write(GaimSslConnection *gsc, const void *data, size_t len);
93
94 /*@}*/
95
96 /**************************************************************************/
97 /** @name Subsystem API */
98 /**************************************************************************/
99 /*@{*/
100
101 /**
102 * Initializes the SSL subsystem.
103 */
104 void gaim_ssl_init(void);
105
106 /**
107 * Uninitializes the SSL subsystem.
108 */
109 void gaim_ssl_uninit(void);
110
111 /*@}*/
112
113 #ifdef __cplusplus
114 }
115 #endif
116
117 #endif /* _GAIM_SSL_H_ */