#include <glib.h>
#include "eventloop.h"
#include "account.h"
Include dependency graph for proxy.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Data Structures | |
struct | PurpleProxyInfo |
Information on proxy settings. More... | |
Typedefs | |
typedef _PurpleProxyConnectData | PurpleProxyConnectData |
typedef void(*) | PurpleProxyConnectFunction (gpointer data, gint source, const gchar *error_message) |
Enumerations | |
enum | PurpleProxyType { PURPLE_PROXY_USE_GLOBAL = -1, PURPLE_PROXY_NONE = 0, PURPLE_PROXY_HTTP, PURPLE_PROXY_SOCKS4, PURPLE_PROXY_SOCKS5, PURPLE_PROXY_USE_ENVVAR } |
A type of proxy connection. More... | |
Functions | |
Global Proxy API | |
PurpleProxyInfo * | purple_global_proxy_get_info (void) |
Returns purple's global proxy information. | |
Proxy API | |
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_connect_cancel (PurpleProxyConnectData *connect_data) |
Cancel an in-progress connection attempt. | |
void | purple_proxy_connect_cancel_with_handle (void *handle) |
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_get_handle (void) |
Returns the proxy subsystem handle. | |
PurpleProxyInfo * | purple_proxy_get_setup (PurpleAccount *account) |
Returns configuration of a proxy. | |
void | purple_proxy_init (void) |
Initializes the proxy subsystem. | |
void | purple_proxy_uninit (void) |
Uninitializes the proxy subsystem. | |
Proxy structure API | |
void | purple_proxy_info_destroy (PurpleProxyInfo *info) |
Destroys a proxy information structure. | |
const char * | purple_proxy_info_get_host (const PurpleProxyInfo *info) |
Returns the proxy's host. | |
const char * | purple_proxy_info_get_password (const PurpleProxyInfo *info) |
Returns the proxy's password. | |
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. | |
const char * | purple_proxy_info_get_username (const PurpleProxyInfo *info) |
Returns the proxy's username. | |
PurpleProxyInfo * | purple_proxy_info_new (void) |
Creates a proxy information structure. | |
void | purple_proxy_info_set_host (PurpleProxyInfo *info, const char *host) |
Sets the proxy host. | |
void | purple_proxy_info_set_password (PurpleProxyInfo *info, const char *password) |
Sets the proxy password. | |
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_username (PurpleProxyInfo *info, const char *username) |
Sets the proxy username. |
purple
Purple is the legal property of its developers, whose names are too numerous to list here. Please refer to the COPYRIGHT file distributed with this source distribution.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Definition in file proxy.h.
enum PurpleProxyType |
PurpleProxyInfo* purple_global_proxy_get_info | ( | void | ) |
Returns purple's global proxy information.
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.
Note that this function name can be misleading--although it is called "proxy connect," it is used for establishing any outgoing TCP connection, whether through a proxy or not.
handle | A handle that should be associated with this connection attempt. The handle can be used to cancel the connection attempt using the purple_proxy_connect_cancel_with_handle() function. | |
account | The account making the connection. | |
host | The destination host. | |
port | The destination port. | |
connect_cb | The function to call when the connection is established. If the connection failed then fd will be -1 and error message will be set to something descriptive (hopefully). | |
data | User-defined data. |
void purple_proxy_connect_cancel | ( | PurpleProxyConnectData * | connect_data | ) |
Cancel an in-progress connection attempt.
This should be called by the PRPL if the user disables an account while it is still performing the initial sign on. Or when establishing a file transfer, if we attempt to connect to a remote user but they are behind a firewall then the PRPL can cancel the connection attempt early rather than just letting the OS's TCP/IP stack time-out the connection.
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.
handle | A handle that should be associated with this connection attempt. The handle can be used to cancel the connection attempt using the purple_proxy_connect_cancel_with_handle() function. | |
gpi | The PurpleProxyInfo specifying the proxy settings | |
host | The destination host. | |
port | The destination port. | |
connect_cb | The function to call when the connection is established. If the connection failed then fd will be -1 and error message will be set to something descriptive (hopefully). | |
data | User-defined data. |
void* purple_proxy_get_handle | ( | void | ) |
Returns the proxy subsystem handle.
PurpleProxyInfo* purple_proxy_get_setup | ( | PurpleAccount * | account | ) |
Returns configuration of a proxy.
account | The account for which the configuration is needed. |
void purple_proxy_info_destroy | ( | PurpleProxyInfo * | info | ) |
Destroys a proxy information structure.
info | The proxy information structure to destroy. |
const char* purple_proxy_info_get_host | ( | const PurpleProxyInfo * | info | ) |
Returns the proxy's host.
info | The proxy information. |
const char* purple_proxy_info_get_password | ( | const PurpleProxyInfo * | info | ) |
Returns the proxy's password.
info | The proxy information. |
int purple_proxy_info_get_port | ( | const PurpleProxyInfo * | info | ) |
Returns the proxy's port.
info | The proxy information. |
PurpleProxyType purple_proxy_info_get_type | ( | const PurpleProxyInfo * | info | ) |
Returns the proxy's type.
info | The proxy information. |
const char* purple_proxy_info_get_username | ( | const PurpleProxyInfo * | info | ) |
Returns the proxy's username.
info | The proxy information. |
PurpleProxyInfo* purple_proxy_info_new | ( | void | ) |
Creates a proxy information structure.
void purple_proxy_info_set_host | ( | PurpleProxyInfo * | info, | |
const char * | host | |||
) |
Sets the proxy host.
info | The proxy information. | |
host | The host. |
void purple_proxy_info_set_password | ( | PurpleProxyInfo * | info, | |
const char * | password | |||
) |
Sets the proxy password.
info | The proxy information. | |
password | The password. |
void purple_proxy_info_set_port | ( | PurpleProxyInfo * | info, | |
int | port | |||
) |
Sets the proxy port.
info | The proxy information. | |
port | The port. |
void purple_proxy_info_set_type | ( | PurpleProxyInfo * | info, | |
PurpleProxyType | type | |||
) |
Sets the type of proxy.
info | The proxy information. | |
type | The proxy type. |
void purple_proxy_info_set_username | ( | PurpleProxyInfo * | info, | |
const char * | username | |||
) |
Sets the proxy username.
info | The proxy information. | |
username | The username. |