Mercurial > pidgin
comparison libpurple/upnp.h @ 15822:32c366eeeb99
sed -ie 's/gaim/purple/g'
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Mon, 19 Mar 2007 07:01:17 +0000 |
parents | 56a2a0bb290a |
children | 1a12ce76c4f4 |
comparison
equal
deleted
inserted
replaced
15821:84b0f9b23ede | 15822:32c366eeeb99 |
---|---|
1 /** | 1 /** |
2 * @file upnp.h Universal Plug N Play API | 2 * @file upnp.h Universal Plug N Play API |
3 * @ingroup core | 3 * @ingroup core |
4 * | 4 * |
5 * gaim | 5 * purple |
6 * | 6 * |
7 * Gaim is the legal property of its developers, whose names are too numerous | 7 * Purple is the legal property of its developers, whose names are too numerous |
8 * to list here. Please refer to the COPYRIGHT file distributed with this | 8 * to list here. Please refer to the COPYRIGHT file distributed with this |
9 * source distribution. | 9 * source distribution. |
10 * | 10 * |
11 * This program is free software; you can redistribute it and/or modify | 11 * This program is free software; you can redistribute it and/or modify |
12 * it under the terms of the GNU General Public License as published by | 12 * it under the terms of the GNU General Public License as published by |
21 * You should have received a copy of the GNU General Public License | 21 * You should have received a copy of the GNU General Public License |
22 * along with this program; if not, write to the Free Software | 22 * along with this program; if not, write to the Free Software |
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
24 */ | 24 */ |
25 | 25 |
26 #ifndef _GAIM_UPNP_H_ | 26 #ifndef _PURPLE_UPNP_H_ |
27 #define _GAIM_UPNP_H_ | 27 #define _PURPLE_UPNP_H_ |
28 | 28 |
29 typedef struct _UPnPMappingAddRemove UPnPMappingAddRemove; | 29 typedef struct _UPnPMappingAddRemove UPnPMappingAddRemove; |
30 | 30 |
31 #ifdef __cplusplus | 31 #ifdef __cplusplus |
32 extern "C" { | 32 extern "C" { |
35 /**************************************************************************/ | 35 /**************************************************************************/ |
36 /** @name UPnP API */ | 36 /** @name UPnP API */ |
37 /**************************************************************************/ | 37 /**************************************************************************/ |
38 /*@{*/ | 38 /*@{*/ |
39 | 39 |
40 /* typedef struct _GaimUPnPRequestData GaimUPnPRequestData; */ | 40 /* typedef struct _PurpleUPnPRequestData PurpleUPnPRequestData; */ |
41 | 41 |
42 typedef void (*GaimUPnPCallback) (gboolean success, gpointer data); | 42 typedef void (*PurpleUPnPCallback) (gboolean success, gpointer data); |
43 | 43 |
44 /** | 44 /** |
45 * Sends a discovery request to search for a UPnP enabled IGD that | 45 * Sends a discovery request to search for a UPnP enabled IGD that |
46 * contains the WANIPConnection service that will allow us to recieve the | 46 * contains the WANIPConnection service that will allow us to recieve the |
47 * public IP address of the IGD, and control it for forwarding ports. | 47 * public IP address of the IGD, and control it for forwarding ports. |
49 * | 49 * |
50 * @param cb an optional callback function to be notified when the UPnP | 50 * @param cb an optional callback function to be notified when the UPnP |
51 * discovery is complete | 51 * discovery is complete |
52 * @param cb_data Extra data to be passed to the callback | 52 * @param cb_data Extra data to be passed to the callback |
53 */ | 53 */ |
54 void gaim_upnp_discover(GaimUPnPCallback cb, gpointer cb_data); | 54 void purple_upnp_discover(PurpleUPnPCallback cb, gpointer cb_data); |
55 | 55 |
56 #if 0 | 56 #if 0 |
57 /** | 57 /** |
58 * Retrieve the current UPnP control info, if there is any available. | 58 * Retrieve the current UPnP control info, if there is any available. |
59 * This will only be filled in if gaim_upnp_discover() had been called, | 59 * This will only be filled in if purple_upnp_discover() had been called, |
60 * and finished discovering. | 60 * and finished discovering. |
61 * | 61 * |
62 * @return The control URL for the IGD we'll use to use the IGD services | 62 * @return The control URL for the IGD we'll use to use the IGD services |
63 */ | 63 */ |
64 const GaimUPnPControlInfo* gaim_upnp_get_control_info(void); | 64 const PurpleUPnPControlInfo* purple_upnp_get_control_info(void); |
65 #endif | 65 #endif |
66 | 66 |
67 /** | 67 /** |
68 * Gets the IP address from a UPnP enabled IGD that sits on the local | 68 * Gets the IP address from a UPnP enabled IGD that sits on the local |
69 * network, so when getting the network IP, instead of returning the | 69 * network, so when getting the network IP, instead of returning the |
70 * local network IP, the public IP is retrieved. This is a cached value from | 70 * local network IP, the public IP is retrieved. This is a cached value from |
71 * the time of the UPnP discovery. | 71 * the time of the UPnP discovery. |
72 * | 72 * |
73 * @return The IP address of the network, or NULL if something went wrong | 73 * @return The IP address of the network, or NULL if something went wrong |
74 */ | 74 */ |
75 const gchar* gaim_upnp_get_public_ip(void); | 75 const gchar* purple_upnp_get_public_ip(void); |
76 | 76 |
77 /** | 77 /** |
78 * Cancel a pending port mapping request initiated with either | 78 * Cancel a pending port mapping request initiated with either |
79 * gaim_upnp_set_port_mapping() or gaim_upnp_remove_port_mapping(). | 79 * purple_upnp_set_port_mapping() or purple_upnp_remove_port_mapping(). |
80 * | 80 * |
81 * @param mapping_data The data returned when you initiated the UPnP mapping request. | 81 * @param mapping_data The data returned when you initiated the UPnP mapping request. |
82 */ | 82 */ |
83 void gaim_upnp_cancel_port_mapping(UPnPMappingAddRemove *mapping_data); | 83 void purple_upnp_cancel_port_mapping(UPnPMappingAddRemove *mapping_data); |
84 | 84 |
85 /** | 85 /** |
86 * Maps Ports in a UPnP enabled IGD that sits on the local network to | 86 * Maps Ports in a UPnP enabled IGD that sits on the local network to |
87 * this gaim client. Essentially, this function takes care of the port | 87 * this purple client. Essentially, this function takes care of the port |
88 * forwarding so things like file transfers can work behind NAT firewalls | 88 * forwarding so things like file transfers can work behind NAT firewalls |
89 * | 89 * |
90 * @param portmap The port to map to this client | 90 * @param portmap The port to map to this client |
91 * @param protocol The protocol to map, either "TCP" or "UDP" | 91 * @param protocol The protocol to map, either "TCP" or "UDP" |
92 * @param cb an optional callback function to be notified when the mapping | 92 * @param cb an optional callback function to be notified when the mapping |
93 * addition is complete | 93 * addition is complete |
94 * @param cb_data Extra data to be passed to the callback | 94 * @param cb_data Extra data to be passed to the callback |
95 * | 95 * |
96 * @return Data which can be passed to gaim_upnp_port_mapping_cancel() to cancel | 96 * @return Data which can be passed to purple_upnp_port_mapping_cancel() to cancel |
97 */ | 97 */ |
98 UPnPMappingAddRemove *gaim_upnp_set_port_mapping(unsigned short portmap, const gchar* protocol, | 98 UPnPMappingAddRemove *purple_upnp_set_port_mapping(unsigned short portmap, const gchar* protocol, |
99 GaimUPnPCallback cb, gpointer cb_data); | 99 PurpleUPnPCallback cb, gpointer cb_data); |
100 | 100 |
101 /** | 101 /** |
102 * Deletes a port mapping in a UPnP enabled IGD that sits on the local network | 102 * Deletes a port mapping in a UPnP enabled IGD that sits on the local network |
103 * to this gaim client. Essentially, this function takes care of deleting the | 103 * to this purple client. Essentially, this function takes care of deleting the |
104 * port forwarding after they have completed a connection so another client on | 104 * port forwarding after they have completed a connection so another client on |
105 * the local network can take advantage of the port forwarding | 105 * the local network can take advantage of the port forwarding |
106 * | 106 * |
107 * @param portmap The port to delete the mapping for | 107 * @param portmap The port to delete the mapping for |
108 * @param protocol The protocol to map to. Either "TCP" or "UDP" | 108 * @param protocol The protocol to map to. Either "TCP" or "UDP" |
109 * @param cb an optional callback function to be notified when the mapping | 109 * @param cb an optional callback function to be notified when the mapping |
110 * removal is complete | 110 * removal is complete |
111 * @param cb_data Extra data to be passed to the callback | 111 * @param cb_data Extra data to be passed to the callback |
112 * | 112 * |
113 * @return Data which can be passed to gaim_upnp_port_mapping_cancel() to cancel | 113 * @return Data which can be passed to purple_upnp_port_mapping_cancel() to cancel |
114 */ | 114 */ |
115 UPnPMappingAddRemove *gaim_upnp_remove_port_mapping(unsigned short portmap, | 115 UPnPMappingAddRemove *purple_upnp_remove_port_mapping(unsigned short portmap, |
116 const gchar* protocol, GaimUPnPCallback cb, gpointer cb_data); | 116 const gchar* protocol, PurpleUPnPCallback cb, gpointer cb_data); |
117 | 117 |
118 /*@}*/ | 118 /*@}*/ |
119 | 119 |
120 #ifdef __cplusplus | 120 #ifdef __cplusplus |
121 } | 121 } |
122 #endif | 122 #endif |
123 | 123 |
124 #endif /* _GAIM_UPNP_H_ */ | 124 #endif /* _PURPLE_UPNP_H_ */ |