pidgin 2.14.14dev
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
46
50typedef struct
51{
54 char *host;
55 int port;
56 char *username;
57 char *password;
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/**************************************************************************/
83
90
98
105void purple_proxy_info_set_host(PurpleProxyInfo *info, const char *host);
106
114
121void purple_proxy_info_set_username(PurpleProxyInfo *info, const char *username);
122
129void purple_proxy_info_set_password(PurpleProxyInfo *info, const char *password);
130
139
148
157
166
175
178/**************************************************************************/
180/**************************************************************************/
189
197
200/**************************************************************************/
202/**************************************************************************/
211
216
221
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
357void 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 API.
Purple Event Loop API.
void purple_global_proxy_set_info(PurpleProxyInfo *info)
Set purple's global proxy information.
const char * purple_proxy_info_get_username(const PurpleProxyInfo *info)
Returns the proxy's username.
void purple_proxy_info_set_port(PurpleProxyInfo *info, int port)
Sets the proxy port.
void purple_proxy_info_set_type(PurpleProxyInfo *info, PurpleProxyType type)
Sets the type of proxy.
void purple_proxy_info_set_password(PurpleProxyInfo *info, const char *password)
Sets the proxy password.
PurpleProxyInfo * purple_proxy_info_new(void)
Creates a proxy information structure.
PurpleProxyType
A type of proxy connection.
Definition proxy.h:36
@ PURPLE_PROXY_SOCKS5
SOCKS 5 proxy.
Definition proxy.h:41
@ PURPLE_PROXY_USE_ENVVAR
Use environmental settings.
Definition proxy.h:42
@ PURPLE_PROXY_USE_GLOBAL
Use the global proxy information.
Definition proxy.h:37
@ PURPLE_PROXY_TOR
Use a Tor proxy (SOCKS 5 really)
Definition proxy.h:43
@ PURPLE_PROXY_NONE
No proxy.
Definition proxy.h:38
@ PURPLE_PROXY_HTTP
HTTP proxy.
Definition proxy.h:39
@ PURPLE_PROXY_SOCKS4
SOCKS 4 proxy.
Definition proxy.h:40
void purple_proxy_info_set_username(PurpleProxyInfo *info, const char *username)
Sets the proxy username.
void purple_proxy_connect_cancel(PurpleProxyConnectData *connect_data)
Cancel an in-progress connection attempt.
const char * purple_proxy_info_get_password(const PurpleProxyInfo *info)
Returns the proxy's password.
PurpleProxyInfo * purple_proxy_get_setup(PurpleAccount *account)
Returns configuration of a proxy.
void purple_proxy_info_set_host(PurpleProxyInfo *info, const char *host)
Sets the proxy host.
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.
void purple_proxy_info_destroy(PurpleProxyInfo *info)
Destroys a proxy information structure.
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.
void purple_proxy_uninit(void)
Uninitializes the proxy subsystem.
void * purple_proxy_get_handle(void)
Returns the proxy subsystem handle.
PurpleProxyInfo * purple_global_proxy_get_info(void)
Returns purple's global proxy information.
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.
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.
void purple_proxy_init(void)
Initializes the proxy subsystem.
const char * purple_proxy_info_get_host(const PurpleProxyInfo *info)
Returns the proxy's host.
int purple_proxy_info_get_port(const PurpleProxyInfo *info)
Returns the proxy's port.
PurpleProxyType purple_proxy_info_get_type(const PurpleProxyInfo *info)
Returns the proxy's type.
Information on proxy settings.
Definition proxy.h:51
int port
The port number.
Definition proxy.h:55
char * password
The password.
Definition proxy.h:57
PurpleProxyType type
The proxy type.
Definition proxy.h:52
char * host
The host.
Definition proxy.h:54
char * username
The username.
Definition proxy.h:56
Structure representing an account.
Definition account.h:170