Mercurial > pidgin
annotate src/upnp.h @ 12767:53218d758ba9
[gaim-migrate @ 15114]
Make the dns lookup for udp connecting asynchronous. Thomas pointed out that it should be instantaneous anyway because the SRV lookup that has just been done, but this'll avoid blocking if the SRV lookup failed or something.
committer: Tailor Script <tailor@pidgin.im>
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Sun, 08 Jan 2006 22:09:28 +0000 |
parents | 9563b768e8e2 |
children | 8e3b85fe4a55 |
rev | line source |
---|---|
11195 | 1 /** |
2 * @file upnp.h Universal Plug N Play API | |
3 * @ingroup core | |
4 * | |
5 * gaim | |
6 * | |
7 * Gaim 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 | |
9 * source distribution. | |
10 * | |
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 | |
13 * the Free Software Foundation; either version 2 of the License, or | |
14 * (at your option) any later version. | |
15 * | |
16 * This program is distributed in the hope that it will be useful, | |
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 * GNU General Public License for more details. | |
20 * | |
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 | |
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
24 */ | |
25 | |
26 #ifndef _GAIM_UPNP_H_ | |
27 #define _GAIM_UPNP_H_ | |
28 | |
11391 | 29 |
30 typedef struct | |
31 { | |
32 gchar* controlURL; | |
33 gchar* serviceType; | |
34 } GaimUPnPControlInfo; | |
35 | |
36 | |
11195 | 37 #ifdef __cplusplus |
38 extern "C" { | |
39 #endif | |
40 | |
41 /**************************************************************************/ | |
42 /** @name UPnP API */ | |
43 /**************************************************************************/ | |
44 /*@{*/ | |
45 | |
46 /** | |
47 * Sends a discovery request to search for a UPnP enabled IGD that | |
48 * contains the WANIPConnection service that will allow us to recieve the | |
49 * public IP address of the IGD, and control it for forwarding ports. | |
50 * | |
51 * @return The control URL for the IGD we'll use to use the IGD services | |
52 */ | |
11391 | 53 GaimUPnPControlInfo* gaim_upnp_discover(void); |
11195 | 54 |
55 | |
11213 | 56 |
11195 | 57 /** |
58 * Gets the IP address from a UPnP enabled IGD that sits on the local | |
59 * network, so when getting the network IP, instead of returning the | |
60 * local network IP, the public IP is retrieved. | |
61 * | |
11501
9563b768e8e2
[gaim-migrate @ 13746]
Richard Laager <rlaager@wiktel.com>
parents:
11391
diff
changeset
|
62 * @param controlInfo The control URL retrieved from gaim_upnp_discover. |
11195 | 63 * |
64 * @return The IP address of the network, or NULL if something went wrong | |
65 */ | |
11391 | 66 gchar* gaim_upnp_get_public_ip(const GaimUPnPControlInfo* controlInfo); |
11195 | 67 |
68 | |
69 /** | |
70 * Maps Ports in a UPnP enabled IGD that sits on the local network to | |
71 * this gaim client. Essentially, this function takes care of the port | |
72 * forwarding so things like file transfers can work behind NAT firewalls | |
73 * | |
11501
9563b768e8e2
[gaim-migrate @ 13746]
Richard Laager <rlaager@wiktel.com>
parents:
11391
diff
changeset
|
74 * @param controlInfo The control URL retrieved from gaim_upnp_discover. |
11195 | 75 * @param portMap The port to map to this client |
76 * @param protocol The protocol to map, either "TCP" or "UDP" | |
77 * | |
78 * @return TRUE if success, FALSE if something went wrong. | |
79 */ | |
11391 | 80 gboolean gaim_upnp_set_port_mapping(const GaimUPnPControlInfo* controlInfo, |
11195 | 81 unsigned short portMap, |
11391 | 82 const gchar* protocol); |
11195 | 83 |
84 /** | |
85 * Deletes a port mapping in a UPnP enabled IGD that sits on the local network | |
86 * to this gaim client. Essentially, this function takes care of deleting the | |
87 * port forwarding after they have completed a connection so another client on | |
88 * the local network can take advantage of the port forwarding | |
89 * | |
11501
9563b768e8e2
[gaim-migrate @ 13746]
Richard Laager <rlaager@wiktel.com>
parents:
11391
diff
changeset
|
90 * @param controlInfo The control URL retrieved from gaim_upnp_discover. |
11195 | 91 * @param portMap The port to delete the mapping for |
92 * @param protocol The protocol to map to. Either "TCP" or "UDP" | |
93 * | |
94 * @return TRUE if success, FALSE if something went wrong. | |
95 */ | |
96 gboolean | |
11501
9563b768e8e2
[gaim-migrate @ 13746]
Richard Laager <rlaager@wiktel.com>
parents:
11391
diff
changeset
|
97 gaim_upnp_remove_port_mapping(const GaimUPnPControlInfo* controlInfo, |
11391 | 98 unsigned short portMap, |
99 const gchar* protocol); | |
11195 | 100 /*@}*/ |
101 | |
102 | |
103 #ifdef __cplusplus | |
104 } | |
105 #endif | |
106 | |
107 #endif /* _GAIM_UPNP_H_ */ |