comparison src/sslconn.h @ 6738:6c95f01aaf49

[gaim-migrate @ 7270] Added optional GNUTLS support, which will also be used as a fallback if Mozilla NSS is not installed. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Thu, 04 Sep 2003 06:19:25 +0000
parents 41120df7ed94
children 818ce550d2ce
comparison
equal deleted inserted replaced
6737:05098da416bb 6738:6c95f01aaf49
23 #ifndef _GAIM_SSL_H_ 23 #ifndef _GAIM_SSL_H_
24 #define _GAIM_SSL_H_ 24 #define _GAIM_SSL_H_
25 25
26 #include "proxy.h" 26 #include "proxy.h"
27 27
28 #define GAIM_SSL_DEFAULT_PORT 443
29
30 typedef struct _GaimSslConnection GaimSslConnection;
31
32 typedef void (*GaimSslInputFunction)(gpointer, GaimSslConnection *,
33 GaimInputCondition);
34
35 struct _GaimSslConnection
36 {
37 char *host;
38 int port;
39 void *user_data;
40 GaimSslInputFunction input_func;
41
42 int fd;
43 int inpa;
44
45 void *private_data;
46 };
47
48 /**
49 * SSL implementation operations structure.
50 *
51 * Every SSL implementation must provide one of these and register it.
52 */
53 typedef struct
54 {
55 gboolean (*init)(void);
56 void (*uninit)(void);
57 GaimInputFunction connect_cb;
58 void (*close)(GaimSslConnection *gsc);
59 size_t (*read)(GaimSslConnection *gsc, void *data, size_t len);
60 size_t (*write)(GaimSslConnection *gsc, const void *data, size_t len);
61
62 } GaimSslOps;
63
28 #ifdef __cplusplus 64 #ifdef __cplusplus
29 extern "C" { 65 extern "C" {
30 #endif 66 #endif
31
32 #define GAIM_SSL_DEFAULT_PORT 443
33
34 typedef void *GaimSslConnection;
35 typedef void (*GaimSslInputFunction)(gpointer, GaimSslConnection *,
36 GaimInputCondition);
37 67
38 /**************************************************************************/ 68 /**************************************************************************/
39 /** @name SSL API */ 69 /** @name SSL API */
40 /**************************************************************************/ 70 /**************************************************************************/
41 /*@{*/ 71 /*@{*/
97 /** @name Subsystem API */ 127 /** @name Subsystem API */
98 /**************************************************************************/ 128 /**************************************************************************/
99 /*@{*/ 129 /*@{*/
100 130
101 /** 131 /**
132 * Sets the current SSL operations structure.
133 *
134 * @param ops The SSL operations structure to assign.
135 */
136 void gaim_ssl_set_ops(GaimSslOps *ops);
137
138 /**
139 * Returns the current SSL operations structure.
140 *
141 * @return The SSL operations structure.
142 */
143 GaimSslOps *gaim_ssl_get_ops(void);
144
145 /**
102 * Initializes the SSL subsystem. 146 * Initializes the SSL subsystem.
103 */ 147 */
104 void gaim_ssl_init(void); 148 void gaim_ssl_init(void);
105 149
106 /** 150 /**