diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2010-12-07 04:48:14 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2010-12-07 04:48:14 +0000 |
commit | 14c652150c9a6339c792eb1911da809327237123 (patch) | |
tree | ad1bfa3e8818651ae8e4026f7571ec6392fb45b0 /libsylph/socks.h | |
parent | 3a54dc9a9d8e28b9415552512d45d172528d1a78 (diff) |
added SOCKS4/5 proxy support.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2733 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph/socks.h')
-rw-r--r-- | libsylph/socks.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/libsylph/socks.h b/libsylph/socks.h new file mode 100644 index 00000000..afa34c5b --- /dev/null +++ b/libsylph/socks.h @@ -0,0 +1,59 @@ +/* + * LibSylph -- E-Mail client library + * Copyright (C) 1999-2010 Hiroyuki Yamamoto + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef __SOCKS_H__ +#define __SOCKS_H__ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <glib.h> + +#include "socket.h" + +typedef struct _SocksInfo SocksInfo; + +typedef enum { + SOCKS_SOCKS4, + SOCKS_SOCKS5 +} SocksType; + +struct _SocksInfo +{ + SocksType type; + gchar *proxy_host; + gushort proxy_port; + gchar *proxy_name; + gchar *proxy_pass; +}; + +SocksInfo *socks_info_new(SocksType type, const gchar *proxy_host, + gushort proxy_port, const gchar *proxy_name, + const gchar *proxy_pass); +void socks_info_free(SocksInfo *socks_info); + +gint socks_connect(SockInfo *sock, const gchar *hostname, gushort port, + SocksInfo *socks_info); + +gint socks4_connect(SockInfo *sock, const gchar *hostname, gushort port); +gint socks5_connect(SockInfo *sock, const gchar *hostname, gushort port, + const gchar *proxy_name, const gchar *proxy_pass); + +#endif /* __SOCKS_H__ */ |