26#ifndef _PURPLE_NETWORK_H_
27#define _PURPLE_NETWORK_H_
38typedef struct _PurpleNetworkListenData PurpleNetworkListenData;
40typedef void (*PurpleNetworkListenCallback) (
int listenfd, gpointer data);
158 int socket_type, PurpleNetworkListenCallback cb, gpointer cb_data);
178 int socket_family,
int socket_type, PurpleNetworkListenCallback cb,
212 unsigned short end,
int socket_type,
213 PurpleNetworkListenCallback cb, gpointer cb_data);
234 unsigned short start,
unsigned short end,
int socket_family,
235 int socket_type, PurpleNetworkListenCallback cb, gpointer cb_data);
void * purple_network_get_handle(void)
Get the handle for the network system.
void purple_network_remove_port_mapping(gint fd)
Remove a port mapping (UPnP or NAT-PMP) associated with listening socket.
void purple_network_listen_map_external(gboolean map_external)
Should calls to purple_network_listen() and purple_network_listen_range() map the port externally usi...
GList * purple_network_get_all_local_system_ips(void)
Returns all IP addresses of the local system.
PurpleNetworkListenData * purple_network_listen(unsigned short port, int socket_type, PurpleNetworkListenCallback cb, gpointer cb_data)
Attempts to open a listening port ONLY on the specified port number.
const char * purple_network_get_local_system_ip(int fd)
Returns the IP address of the local system.
gboolean purple_network_is_available(void)
Detects if there is an available network connection.
PurpleNetworkListenData * purple_network_listen_range(unsigned short start, unsigned short end, int socket_type, PurpleNetworkListenCallback cb, gpointer cb_data)
Opens a listening port selected from a range of ports.
const char * purple_network_get_public_ip(void)
Returns the IP address of the local system set in preferences.
PurpleNetworkListenData * purple_network_listen_range_family(unsigned short start, unsigned short end, int socket_family, int socket_type, PurpleNetworkListenCallback cb, gpointer cb_data)
Opens a listening port selected from a range of ports.
void purple_network_listen_cancel(PurpleNetworkListenData *listen_data)
This can be used to cancel any in-progress listener connection by passing in the return value from ei...
const unsigned char * purple_network_ip_atoi(const char *ip)
Converts a dot-decimal IP address to an array of unsigned chars.
void purple_network_force_online(void)
Makes purple_network_is_available() always return TRUE.
void purple_network_set_public_ip(const char *ip)
Sets the IP address of the local system in preferences.
const gchar * purple_network_get_turn_ip(void)
Get the IP address of the TURN server as a string representation.
unsigned short purple_network_get_port_from_fd(int fd)
Gets a port number from a file descriptor.
const char * purple_network_get_my_ip(int fd)
Returns the IP address that should be used anywhere a public IP addresses is needed (listening for an...
int purple_network_convert_idn_to_ascii(const gchar *in, gchar **out)
Convert a UTF-8 domain name to ASCII in accordance with the IDNA specification.
void purple_network_init(void)
Initializes the network subsystem.
const gchar * purple_network_get_stun_ip(void)
Get the IP address of the STUN server as a string representation.
PurpleNetworkListenData * purple_network_listen_family(unsigned short port, int socket_family, int socket_type, PurpleNetworkListenCallback cb, gpointer cb_data)
Attempts to open a listening port ONLY on the specified port number.
void purple_network_set_stun_server(const gchar *stun_server)
Update the STUN server IP given the host name Will result in a DNS query being executed asynchronous.
void purple_network_uninit(void)
Shuts down the network subsystem.
void purple_network_set_turn_server(const gchar *turn_server)
Update the TURN server IP given the host name Will result in a DNS query being executed asynchronous.