diff options
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 0000000..afa34c5 --- /dev/null +++ b/libsylph/socks.h | |||
| @@ -0,0 +1,59 @@ | |||
| 1 | /* | ||
| 2 | * LibSylph -- E-Mail client library | ||
| 3 | * Copyright (C) 1999-2010 Hiroyuki Yamamoto | ||
| 4 | * | ||
| 5 | * This library is free software; you can redistribute it and/or | ||
| 6 | * modify it under the terms of the GNU Lesser General Public | ||
| 7 | * License as published by the Free Software Foundation; either | ||
| 8 | * version 2.1 of the License, or (at your option) any later version. | ||
| 9 | * | ||
| 10 | * This library is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | * Lesser General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU Lesser General Public | ||
| 16 | * License along with this library; if not, write to the Free Software | ||
| 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 18 | */ | ||
| 19 | |||
| 20 | #ifndef __SOCKS_H__ | ||
| 21 | #define __SOCKS_H__ | ||
| 22 | |||
| 23 | #ifdef HAVE_CONFIG_H | ||
| 24 | # include "config.h" | ||
| 25 | #endif | ||
| 26 | |||
| 27 | #include <glib.h> | ||
| 28 | |||
| 29 | #include "socket.h" | ||
| 30 | |||
| 31 | typedef struct _SocksInfo SocksInfo; | ||
| 32 | |||
| 33 | typedef enum { | ||
| 34 | SOCKS_SOCKS4, | ||
| 35 | SOCKS_SOCKS5 | ||
| 36 | } SocksType; | ||
| 37 | |||
| 38 | struct _SocksInfo | ||
| 39 | { | ||
| 40 | SocksType type; | ||
| 41 | gchar *proxy_host; | ||
| 42 | gushort proxy_port; | ||
| 43 | gchar *proxy_name; | ||
| 44 | gchar *proxy_pass; | ||
| 45 | }; | ||
| 46 | |||
| 47 | SocksInfo *socks_info_new(SocksType type, const gchar *proxy_host, | ||
| 48 | gushort proxy_port, const gchar *proxy_name, | ||
| 49 | const gchar *proxy_pass); | ||
| 50 | void socks_info_free(SocksInfo *socks_info); | ||
| 51 | |||
| 52 | gint socks_connect(SockInfo *sock, const gchar *hostname, gushort port, | ||
| 53 | SocksInfo *socks_info); | ||
| 54 | |||
| 55 | gint socks4_connect(SockInfo *sock, const gchar *hostname, gushort port); | ||
| 56 | gint socks5_connect(SockInfo *sock, const gchar *hostname, gushort port, | ||
| 57 | const gchar *proxy_name, const gchar *proxy_pass); | ||
| 58 | |||
| 59 | #endif /* __SOCKS_H__ */ | ||
