1 /* 2 * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client 3 * Copyright (C) 2018 the Claws Mail team 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 3 of the License, or 8 * (at your option) any later version. 9 * 10 * This program 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 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 */ 18 19 #ifndef __PROXY_H__ 20 #define __PROXY_H__ 21 22 #ifdef HAVE_CONFIG_H 23 # include "config.h" 24 #endif 25 26 #include <glib.h> 27 28 #include "socket.h" 29 30 typedef struct _ProxyInfo ProxyInfo; 31 32 typedef enum { 33 PROXY_SOCKS4, 34 PROXY_SOCKS5 35 } ProxyType; 36 37 struct _ProxyInfo 38 { 39 ProxyType proxy_type; 40 gchar *proxy_host; 41 gushort proxy_port; 42 43 gboolean use_proxy_auth; 44 gchar *proxy_name; 45 gchar *proxy_pass; 46 }; 47 48 /* As a side effect, this function will zero out and free 49 * string pointed to by proxy_info->proxy_pass after the password 50 * is no longer needed. */ 51 gint proxy_connect(SockInfo *sock, const gchar *hostname, gushort port, 52 ProxyInfo *proxy_info); 53 54 #endif /* __PROXY_H__ */ 55