network.h

Go to the documentation of this file.
00001
00006 /* purple
00007  *
00008  * Purple is the legal property of its developers, whose names are too numerous
00009  * to list here.  Please refer to the COPYRIGHT file distributed with this
00010  * source distribution.
00011  *
00012  * This program is free software; you can redistribute it and/or modify
00013  * it under the terms of the GNU General Public License as published by
00014  * the Free Software Foundation; either version 2 of the License, or
00015  * (at your option) any later version.
00016  *
00017  * This program is distributed in the hope that it will be useful,
00018  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  * GNU General Public License for more details.
00021  *
00022  * You should have received a copy of the GNU General Public License
00023  * along with this program; if not, write to the Free Software
00024  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
00025  */
00026 #ifndef _PURPLE_NETWORK_H_
00027 #define _PURPLE_NETWORK_H_
00028 
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif
00032 
00033 /**************************************************************************/
00035 /**************************************************************************/
00038 typedef struct _PurpleNetworkListenData PurpleNetworkListenData;
00039
00040 typedef void (*PurpleNetworkListenCallback) (int listenfd, gpointer data);
00041
00054 const unsigned char *purple_network_ip_atoi(const char *ip);
00055
00064 void purple_network_set_public_ip(const char *ip);
00065
00074 const char *purple_network_get_public_ip(void);
00075
00088 const char *purple_network_get_local_system_ip(int fd);
00089
00099 GList *purple_network_get_all_local_system_ips(void);
00100
00118 const char *purple_network_get_my_ip(int fd);
00119
00130 void purple_network_listen_map_external(gboolean map_external);
00131
00157 PurpleNetworkListenData *purple_network_listen(unsigned short port,
00158         int socket_type, PurpleNetworkListenCallback cb, gpointer cb_data);
00159
00177 PurpleNetworkListenData *purple_network_listen_family(unsigned short port,
00178     int socket_family, int socket_type, PurpleNetworkListenCallback cb,
00179     gpointer cb_data);
00180
00211 PurpleNetworkListenData *purple_network_listen_range(unsigned short start,
00212         unsigned short end, int socket_type,
00213         PurpleNetworkListenCallback cb, gpointer cb_data);
00214
00233 PurpleNetworkListenData *purple_network_listen_range_family(
00234     unsigned short start, unsigned short end, int socket_family,
00235     int socket_type, PurpleNetworkListenCallback cb, gpointer cb_data);
00236
00245 void purple_network_listen_cancel(PurpleNetworkListenData *listen_data);
00246
00255 unsigned short purple_network_get_port_from_fd(int fd);
00256
00262 gboolean purple_network_is_available(void);
00263
00273 void purple_network_force_online(void);
00274
00280 void *purple_network_get_handle(void);
00281
00289 void purple_network_set_stun_server(const gchar *stun_server);
00290
00297 const gchar *purple_network_get_stun_ip(void);
00298
00306 void purple_network_set_turn_server(const gchar *turn_server);
00307
00314 const gchar *purple_network_get_turn_ip(void);
00315
00322 void purple_network_remove_port_mapping(gint fd);
00323
00341 int purple_network_convert_idn_to_ascii(const gchar *in, gchar **out);
00342
00346 void purple_network_init(void);
00347
00351 void purple_network_uninit(void);
00352
00355 #ifdef __cplusplus
00356 }
00357 #endif
00358 
00359 #endif /* _PURPLE_NETWORK_H_ */
All information, including names and email addresses, entered onto this website or sent to mailing lists affiliated with this website will be public. Do not post confidential information, especially passwords!