Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

sslconn.h

Go to the documentation of this file.
00001 
00025 #ifndef _GAIM_SSLCONN_H_
00026 #define _GAIM_SSLCONN_H_
00027 
00028 #include "proxy.h"
00029 
00030 #define GAIM_SSL_DEFAULT_PORT 443
00031 
00032 typedef enum
00033 {
00034     GAIM_SSL_HANDSHAKE_FAILED = 1,
00035     GAIM_SSL_CONNECT_FAILED = 2
00036 } GaimSslErrorType;
00037 
00038 typedef struct _GaimSslConnection GaimSslConnection;
00039 
00040 typedef void (*GaimSslInputFunction)(gpointer, GaimSslConnection *,
00041                                      GaimInputCondition);
00042 typedef void (*GaimSslErrorFunction)(GaimSslConnection *, GaimSslErrorType,
00043                                      gpointer);
00044 
00045 struct _GaimSslConnection
00046 {
00047     char *host;
00048     int port;
00049     void *connect_cb_data;
00050     GaimSslInputFunction connect_cb;
00051     GaimSslErrorFunction error_cb;
00052     void *recv_cb_data;
00053     GaimSslInputFunction recv_cb;
00054 
00055     int fd;
00056     int inpa;
00057 
00058     void *private_data;
00059 };
00060 
00066 typedef struct
00067 {
00068     gboolean (*init)(void);
00069     void (*uninit)(void);
00070     GaimInputFunction connect_cb;
00071     void (*close)(GaimSslConnection *gsc);
00072     size_t (*read)(GaimSslConnection *gsc, void *data, size_t len);
00073     size_t (*write)(GaimSslConnection *gsc, const void *data, size_t len);
00074 
00075 } GaimSslOps;
00076 
00077 #ifdef __cplusplus
00078 extern "C" {
00079 #endif
00080 
00081 /**************************************************************************/
00083 /**************************************************************************/
00091 gboolean gaim_ssl_is_supported(void);
00092 
00105 GaimSslConnection *gaim_ssl_connect(GaimAccount *account, const char *host,
00106                                     int port, GaimSslInputFunction func,
00107                                     GaimSslErrorFunction error_func,
00108                                     void *data);
00109 
00121 GaimSslConnection *gaim_ssl_connect_fd(GaimAccount *account, int fd,
00122                                        GaimSslInputFunction func,
00123                                        GaimSslErrorFunction error_func,
00124                                        void *data);
00125 
00133 void gaim_ssl_input_add(GaimSslConnection *gsc, GaimSslInputFunction func,
00134                         void *data);
00135 
00141 void gaim_ssl_close(GaimSslConnection *gsc);
00142 
00152 size_t gaim_ssl_read(GaimSslConnection *gsc, void *buffer, size_t len);
00153 
00163 size_t gaim_ssl_write(GaimSslConnection *gsc, const void *buffer, size_t len);
00164 
00167 /**************************************************************************/
00169 /**************************************************************************/
00177 void gaim_ssl_set_ops(GaimSslOps *ops);
00178 
00184 GaimSslOps *gaim_ssl_get_ops(void);
00185 
00189 void gaim_ssl_init(void);
00190 
00194 void gaim_ssl_uninit(void);
00195 
00198 #ifdef __cplusplus
00199 }
00200 #endif
00201 
00202 #endif /* _GAIM_SSLCONN_H_ */

Generated on Sun Jun 5 18:07:36 2005 for gaim by  doxygen 1.3.9.1