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