pidgin: proxy.h Source File

pidgin 2.14.4

Loading...
Searching...
No Matches
proxy.h
Go to the documentation of this file.
1
6/* purple
7 *
8 * Purple is the legal property of its developers, whose names are too numerous
9 * to list here. Please refer to the COPYRIGHT file distributed with this
10 * source distribution.
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
25 */
26#ifndef _PURPLE_PROXY_H_
27#define _PURPLE_PROXY_H_
28
29#include <glib.h>
30#include "eventloop.h"
31
35 typedef enum
36{
37 PURPLE_PROXY_USE_GLOBAL = -1,
38 PURPLE_PROXY_NONE = 0,
39 PURPLE_PROXY_HTTP,
40 PURPLE_PROXY_SOCKS4,
41 PURPLE_PROXY_SOCKS5,
42 PURPLE_PROXY_USE_ENVVAR,
43 PURPLE_PROXY_TOR
45} PurpleProxyType;
46
50 typedef struct
51{
52 PurpleProxyType type;
54 char *host;
55 int port;
56 char *username;
57 char *password;
59} PurpleProxyInfo;
60
61typedef struct _PurpleProxyConnectData PurpleProxyConnectData;
62
63typedef void (*PurpleProxyConnectFunction)(gpointer data, gint source, const gchar *error_message);
64
65
66#include "account.h"
67
68#ifdef __cplusplus
69extern "C" {
70#endif
71
72/**************************************************************************/
74/**************************************************************************/
82 PurpleProxyInfo *purple_proxy_info_new(void);
83
89 void purple_proxy_info_destroy(PurpleProxyInfo *info);
90
97 void purple_proxy_info_set_type(PurpleProxyInfo *info, PurpleProxyType type);
98
105 void purple_proxy_info_set_host(PurpleProxyInfo *info, const char *host);
106
113 void purple_proxy_info_set_port(PurpleProxyInfo *info, int port);
114
121 void purple_proxy_info_set_username(PurpleProxyInfo *info, const char *username);
122
129 void purple_proxy_info_set_password(PurpleProxyInfo *info, const char *password);
130
138 PurpleProxyType purple_proxy_info_get_type(const PurpleProxyInfo *info);
139
147 const char *purple_proxy_info_get_host(const PurpleProxyInfo *info);
148
156 int purple_proxy_info_get_port(const PurpleProxyInfo *info);
157
165 const char *purple_proxy_info_get_username(const PurpleProxyInfo *info);
166
174 const char *purple_proxy_info_get_password(const PurpleProxyInfo *info);
175
178/**************************************************************************/
180/**************************************************************************/
188 PurpleProxyInfo *purple_global_proxy_get_info(void);
189
196 void purple_global_proxy_set_info(PurpleProxyInfo *info);
197
200/**************************************************************************/
202/**************************************************************************/
210 void *purple_proxy_get_handle(void);
211
215 void purple_proxy_init(void);
216
220 void purple_proxy_uninit(void);
221
229 PurpleProxyInfo *purple_proxy_get_setup(PurpleAccount *account);
230
255PurpleProxyConnectData *purple_proxy_connect(void *handle,
256 PurpleAccount *account,
257 const char *host, int port,
258 PurpleProxyConnectFunction connect_cb, gpointer data);
259
284PurpleProxyConnectData *purple_proxy_connect_udp(void *handle,
285 PurpleAccount *account,
286 const char *host, int port,
287 PurpleProxyConnectFunction connect_cb, gpointer data);
288
314PurpleProxyConnectData *purple_proxy_connect_socks5_account(void *handle,
315 PurpleAccount *account, PurpleProxyInfo *gpi,
316 const char *host, int port,
317 PurpleProxyConnectFunction connect_cb, gpointer data);
318
319#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_PROXY_C_)
342PurpleProxyConnectData *purple_proxy_connect_socks5(void *handle,
343 PurpleProxyInfo *gpi,
344 const char *host, int port,
345 PurpleProxyConnectFunction connect_cb, gpointer data);
346#endif
347
357 void purple_proxy_connect_cancel(PurpleProxyConnectData *connect_data);
358
359/*
360 * Closes all proxy connections registered with the specified handle.
361 *
362 * @param handle The handle.
363 */
364void purple_proxy_connect_cancel_with_handle(void *handle);
365
368#ifdef __cplusplus
369}
370#endif
371
372#endif /* _PURPLE_PROXY_H_ */
account.h
Account API.
eventloop.h
Purple Event Loop API.
purple_global_proxy_set_info
void purple_global_proxy_set_info(PurpleProxyInfo *info)
Set purple's global proxy information.
purple_proxy_info_get_username
const char * purple_proxy_info_get_username(const PurpleProxyInfo *info)
Returns the proxy's username.
purple_proxy_info_set_port
void purple_proxy_info_set_port(PurpleProxyInfo *info, int port)
Sets the proxy port.
purple_proxy_info_set_type
void purple_proxy_info_set_type(PurpleProxyInfo *info, PurpleProxyType type)
Sets the type of proxy.
purple_proxy_info_set_password
void purple_proxy_info_set_password(PurpleProxyInfo *info, const char *password)
Sets the proxy password.
purple_proxy_info_new
PurpleProxyInfo * purple_proxy_info_new(void)
Creates a proxy information structure.
PurpleProxyType
PurpleProxyType
A type of proxy connection.
Definition: proxy.h:36
PURPLE_PROXY_SOCKS5
@ PURPLE_PROXY_SOCKS5
SOCKS 5 proxy.
Definition: proxy.h:41
PURPLE_PROXY_USE_ENVVAR
@ PURPLE_PROXY_USE_ENVVAR
Use environmental settings.
Definition: proxy.h:42
PURPLE_PROXY_USE_GLOBAL
@ PURPLE_PROXY_USE_GLOBAL
Use the global proxy information.
Definition: proxy.h:37
PURPLE_PROXY_TOR
@ PURPLE_PROXY_TOR
Use a Tor proxy (SOCKS 5 really)
Definition: proxy.h:43
PURPLE_PROXY_NONE
@ PURPLE_PROXY_NONE
No proxy.
Definition: proxy.h:38
PURPLE_PROXY_HTTP
@ PURPLE_PROXY_HTTP
HTTP proxy.
Definition: proxy.h:39
PURPLE_PROXY_SOCKS4
@ PURPLE_PROXY_SOCKS4
SOCKS 4 proxy.
Definition: proxy.h:40
purple_proxy_info_set_username
void purple_proxy_info_set_username(PurpleProxyInfo *info, const char *username)
Sets the proxy username.
purple_proxy_connect_cancel
void purple_proxy_connect_cancel(PurpleProxyConnectData *connect_data)
Cancel an in-progress connection attempt.
purple_proxy_info_get_password
const char * purple_proxy_info_get_password(const PurpleProxyInfo *info)
Returns the proxy's password.
purple_proxy_get_setup
PurpleProxyInfo * purple_proxy_get_setup(PurpleAccount *account)
Returns configuration of a proxy.
purple_proxy_info_set_host
void purple_proxy_info_set_host(PurpleProxyInfo *info, const char *host)
Sets the proxy host.
purple_proxy_connect
PurpleProxyConnectData * purple_proxy_connect(void *handle, PurpleAccount *account, const char *host, int port, PurpleProxyConnectFunction connect_cb, gpointer data)
Makes a connection to the specified host and port.
purple_proxy_info_destroy
void purple_proxy_info_destroy(PurpleProxyInfo *info)
Destroys a proxy information structure.
purple_proxy_connect_socks5
PurpleProxyConnectData * purple_proxy_connect_socks5(void *handle, PurpleProxyInfo *gpi, const char *host, int port, PurpleProxyConnectFunction connect_cb, gpointer data)
Makes a connection through a SOCKS5 proxy.
purple_proxy_uninit
void purple_proxy_uninit(void)
Uninitializes the proxy subsystem.
purple_proxy_get_handle
void * purple_proxy_get_handle(void)
Returns the proxy subsystem handle.
purple_global_proxy_get_info
PurpleProxyInfo * purple_global_proxy_get_info(void)
Returns purple's global proxy information.
purple_proxy_connect_socks5_account
PurpleProxyConnectData * purple_proxy_connect_socks5_account(void *handle, PurpleAccount *account, PurpleProxyInfo *gpi, const char *host, int port, PurpleProxyConnectFunction connect_cb, gpointer data)
Makes a connection through a SOCKS5 proxy.
purple_proxy_connect_udp
PurpleProxyConnectData * purple_proxy_connect_udp(void *handle, PurpleAccount *account, const char *host, int port, PurpleProxyConnectFunction connect_cb, gpointer data)
Makes a connection to the specified host and port.
purple_proxy_init
void purple_proxy_init(void)
Initializes the proxy subsystem.
purple_proxy_info_get_host
const char * purple_proxy_info_get_host(const PurpleProxyInfo *info)
Returns the proxy's host.
purple_proxy_info_get_port
int purple_proxy_info_get_port(const PurpleProxyInfo *info)
Returns the proxy's port.
purple_proxy_info_get_type
PurpleProxyType purple_proxy_info_get_type(const PurpleProxyInfo *info)
Returns the proxy's type.
PurpleProxyInfo
Information on proxy settings.
Definition: proxy.h:51
PurpleProxyInfo::port
int port
The port number.
Definition: proxy.h:55
PurpleProxyInfo::password
char * password
The password.
Definition: proxy.h:57
PurpleProxyInfo::type
PurpleProxyType type
The proxy type.
Definition: proxy.h:52
PurpleProxyInfo::host
char * host
The host.
Definition: proxy.h:54
PurpleProxyInfo::username
char * username
The username.
Definition: proxy.h:56
_PurpleAccount
Structure representing an account.
Definition: account.h:170