pidgin 2.14.14dev
|
Proxy API. More...
Go to the source code of this file.
Data Structures | |
struct | PurpleProxyInfo |
Information on proxy settings. More... | |
Typedefs | |
typedef struct _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 , PURPLE_PROXY_TOR } |
A type of proxy connection. More... | |
Functions | |
Proxy structure API <br> | |
PurpleProxyInfo * | purple_proxy_info_new (void) |
Creates a proxy information structure. | |
void | purple_proxy_info_destroy (PurpleProxyInfo *info) |
Destroys a proxy information structure. | |
void | purple_proxy_info_set_type (PurpleProxyInfo *info, PurpleProxyType type) |
Sets the type of proxy. | |
void | purple_proxy_info_set_host (PurpleProxyInfo *info, const char *host) |
Sets the proxy host. | |
void | purple_proxy_info_set_port (PurpleProxyInfo *info, int port) |
Sets the proxy port. | |
void | purple_proxy_info_set_username (PurpleProxyInfo *info, const char *username) |
Sets the proxy username. | |
void | purple_proxy_info_set_password (PurpleProxyInfo *info, const char *password) |
Sets the proxy password. | |
PurpleProxyType | purple_proxy_info_get_type (const PurpleProxyInfo *info) |
Returns the proxy's type. | |
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. | |
const char * | purple_proxy_info_get_username (const PurpleProxyInfo *info) |
Returns the proxy's username. | |
const char * | purple_proxy_info_get_password (const PurpleProxyInfo *info) |
Returns the proxy's password. | |
Global Proxy API <br> | |
PurpleProxyInfo * | purple_global_proxy_get_info (void) |
Returns purple's global proxy information. | |
void | purple_global_proxy_set_info (PurpleProxyInfo *info) |
Set purple's global proxy information. | |
Proxy API <br> | |
void * | purple_proxy_get_handle (void) |
Returns the proxy subsystem handle. | |
void | purple_proxy_init (void) |
Initializes the proxy subsystem. | |
void | purple_proxy_uninit (void) |
Uninitializes the proxy subsystem. | |
PurpleProxyInfo * | purple_proxy_get_setup (PurpleAccount *account) |
Returns configuration of a proxy. | |
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. | |
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. | |
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_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_connect_cancel (PurpleProxyConnectData *connect_data) |
Cancel an in-progress connection attempt. | |
void | purple_proxy_connect_cancel_with_handle (void *handle) |
Proxy API.
Definition in file proxy.h.
typedef struct _PurpleProxyConnectData PurpleProxyConnectData |
typedef void(* PurpleProxyConnectFunction) (gpointer data, gint source, const gchar *error_message) |
enum PurpleProxyType |
A type of proxy connection.
PurpleProxyInfo * purple_global_proxy_get_info | ( | void | ) |
Returns purple's global proxy information.
void purple_global_proxy_set_info | ( | PurpleProxyInfo * | info | ) |
Set purple's global proxy information.
info | The 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. |
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.
Note that if the account that is making the connection uses a proxy, this connection to a SOCKS5 proxy will be made through the account 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. |
account | The account making the connection. |
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. |
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.
Note that this function name can be misleading–although it is called "proxy connect," it is used for establishing any outgoing UDP 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_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. |