/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2007 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2012 Hiroyuki Yamamoto and the Claws Mail team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#define __SOCKET_H__
#ifdef HAVE_CONFIG_H
-# include "config.h"
+#include "claws-features.h"
#endif
#if (defined (_XOPEN_SOURCE) && !defined (_BSD_SOURCE))
typedef struct _SockInfo SockInfo;
-#if USE_OPENSSL
+#ifdef USE_GNUTLS
# include "ssl.h"
#endif
struct _SockInfo
{
gint sock;
-#if USE_OPENSSL
- SSL *ssl;
- guint g_source;
+#if USE_GNUTLS
+ gnutls_session_t ssl;
+ gnutls_certificate_credentials_t xcred;
+ gnutls_x509_crt_t client_crt;
+ gnutls_x509_privkey_t client_key;
+ gchar *gnutls_priority;
#endif
GIOChannel *sock_ch;
SockFunc callback;
GIOCondition condition;
gchar *canonical_name;
+
+ const void *account;
+ gboolean is_smtp;
};
void refresh_resolvers (void);
struct hostent *my_gethostbyname (const gchar *hostname);
SockInfo *sock_connect (const gchar *hostname, gushort port);
-SockInfo *sock_connect_cmd (const gchar *hostname, const gchar *tunnelcmd);
gint sock_connect_async (const gchar *hostname, gushort port,
SockConnectFunc func, gpointer data);
gint sock_connect_async_cancel (gint id);
gint sock_read (SockInfo *sock, gchar *buf, gint len);
gint sock_write (SockInfo *sock, const gchar *buf, gint len);
gint sock_write_all (SockInfo *sock, const gchar *buf, gint len);
-gint sock_gets (SockInfo *sock, gchar *buf, gint len);
gint sock_close (SockInfo *sock);
/* Functions to directly work on FD. They are needed for pipes */
gint fd_open_unix (const gchar *path);
gint fd_accept (gint sock);
+gint fd_connect_inet(gushort port);
+gint fd_open_inet(gushort port);
+
gint fd_write (gint sock, const gchar *buf, gint len);
gint fd_write_all (gint sock, const gchar *buf, gint len);
gint fd_gets (gint sock, gchar *buf, gint len);