Mercurial > pidgin
diff 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 |
line wrap: on
line diff
--- a/src/sslconn.h Thu Sep 04 05:36:09 2003 +0000 +++ b/src/sslconn.h Thu Sep 04 06:19:25 2003 +0000 @@ -25,16 +25,46 @@ #include "proxy.h" +#define GAIM_SSL_DEFAULT_PORT 443 + +typedef struct _GaimSslConnection GaimSslConnection; + +typedef void (*GaimSslInputFunction)(gpointer, GaimSslConnection *, + GaimInputCondition); + +struct _GaimSslConnection +{ + char *host; + int port; + void *user_data; + GaimSslInputFunction input_func; + + int fd; + int inpa; + + void *private_data; +}; + +/** + * SSL implementation operations structure. + * + * Every SSL implementation must provide one of these and register it. + */ +typedef struct +{ + gboolean (*init)(void); + void (*uninit)(void); + GaimInputFunction connect_cb; + void (*close)(GaimSslConnection *gsc); + size_t (*read)(GaimSslConnection *gsc, void *data, size_t len); + size_t (*write)(GaimSslConnection *gsc, const void *data, size_t len); + +} GaimSslOps; + #ifdef __cplusplus extern "C" { #endif -#define GAIM_SSL_DEFAULT_PORT 443 - -typedef void *GaimSslConnection; -typedef void (*GaimSslInputFunction)(gpointer, GaimSslConnection *, - GaimInputCondition); - /**************************************************************************/ /** @name SSL API */ /**************************************************************************/ @@ -99,6 +129,20 @@ /*@{*/ /** + * Sets the current SSL operations structure. + * + * @param ops The SSL operations structure to assign. + */ +void gaim_ssl_set_ops(GaimSslOps *ops); + +/** + * Returns the current SSL operations structure. + * + * @return The SSL operations structure. + */ +GaimSslOps *gaim_ssl_get_ops(void); + +/** * Initializes the SSL subsystem. */ void gaim_ssl_init(void);