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 
00107 const char *purple_network_get_my_ip(int fd);
00108 
00109 #ifndef PURPLE_DISABLE_DEPRECATED
00110 
00120 void purple_network_listen_map_external(gboolean map_external);
00121 #endif
00122 
00148 PurpleNetworkListenData *purple_network_listen(unsigned short port,
00149         int socket_type, PurpleNetworkListenCallback cb, gpointer cb_data);
00150 
00181 PurpleNetworkListenData *purple_network_listen_range(unsigned short start,
00182         unsigned short end, int socket_type,
00183         PurpleNetworkListenCallback cb, gpointer cb_data);
00184 
00193 void purple_network_listen_cancel(PurpleNetworkListenData *listen_data);
00194 
00203 unsigned short purple_network_get_port_from_fd(int fd);
00204 
00212 gboolean purple_network_is_available(void);
00213 
00219 void *purple_network_get_handle(void);
00220 
00224 void purple_network_init(void);
00225 
00229 void purple_network_uninit(void);
00230 
00233 #ifdef __cplusplus
00234 }
00235 #endif
00236 
00237 #endif /* _PURPLE_NETWORK_H_ */

Generated on Mon Sep 8 09:11:27 2008 for pidgin by  doxygen 1.5.1