00001
00025 #ifndef _GAIM_PROXY_H_
00026 #define _GAIM_PROXY_H_
00027
00028 #include <glib.h>
00029 #include "eventloop.h"
00030
00034 typedef enum
00035 {
00036 GAIM_PROXY_USE_GLOBAL = -1,
00037 GAIM_PROXY_NONE = 0,
00038 GAIM_PROXY_HTTP,
00039 GAIM_PROXY_SOCKS4,
00040 GAIM_PROXY_SOCKS5,
00041 GAIM_PROXY_USE_ENVVAR
00043 } GaimProxyType;
00044
00048 typedef struct
00049 {
00050 GaimProxyType type;
00052 char *host;
00053 int port;
00054 char *username;
00055 char *password;
00057 } GaimProxyInfo;
00058
00059
00060 #include "account.h"
00061
00062 #ifdef __cplusplus
00063 extern "C" {
00064 #endif
00065
00066
00068
00076 GaimProxyInfo *gaim_proxy_info_new(void);
00077
00083 void gaim_proxy_info_destroy(GaimProxyInfo *info);
00084
00091 void gaim_proxy_info_set_type(GaimProxyInfo *info, GaimProxyType type);
00092
00099 void gaim_proxy_info_set_host(GaimProxyInfo *info, const char *host);
00100
00107 void gaim_proxy_info_set_port(GaimProxyInfo *info, int port);
00108
00115 void gaim_proxy_info_set_username(GaimProxyInfo *info, const char *username);
00116
00123 void gaim_proxy_info_set_password(GaimProxyInfo *info, const char *password);
00124
00132 GaimProxyType gaim_proxy_info_get_type(const GaimProxyInfo *info);
00133
00141 const char *gaim_proxy_info_get_host(const GaimProxyInfo *info);
00142
00150 int gaim_proxy_info_get_port(const GaimProxyInfo *info);
00151
00159 const char *gaim_proxy_info_get_username(const GaimProxyInfo *info);
00160
00168 const char *gaim_proxy_info_get_password(const GaimProxyInfo *info);
00169
00172
00174
00182 GaimProxyInfo *gaim_global_proxy_get_info(void);
00183
00186
00188
00194 void gaim_proxy_init(void);
00195
00207 int gaim_proxy_connect(GaimAccount *account, const char *host, int port,
00208 GaimInputFunction func, gpointer data);
00209
00221 int gaim_proxy_connect_socks5(GaimProxyInfo *gpi, const char *host, int port,
00222 GaimInputFunction func, gpointer data);
00223
00226 #ifdef __cplusplus
00227 }
00228 #endif
00229
00230 #endif