aboutsummaryrefslogtreecommitdiff
path: root/src/upnp/upnp.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/upnp/upnp.h')
-rw-r--r--src/upnp/upnp.h82
1 files changed, 82 insertions, 0 deletions
diff --git a/src/upnp/upnp.h b/src/upnp/upnp.h
new file mode 100644
index 000000000..1f99c5352
--- /dev/null
+++ b/src/upnp/upnp.h
@@ -0,0 +1,82 @@
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
29#include <libxml/parser.h>
30#include <string.h>
31#include "gnunet_util_lib.h"
32
33#ifdef __cplusplus
34extern "C"
35{
36#if 0 /* keep Emacsens' auto-indent happy */
37}
38#endif
39#endif
40
41/**
42 * Sends a discovery request to search for a UPnP enabled IGD that
43 * contains the WANIPConnection service that will allow us to receive the
44 * public IP address of the IGD, and control it for forwarding ports.
45 * The result will be cached for further use.
46 */
47int gaim_upnp_discover (struct GNUNET_CONFIGURATION_Handle *cfg, int sock);
48
49/**
50 * Gets the IP address from a UPnP enabled IGD that sits on the local
51 * network, so when getting the network IP, instead of returning the
52 * local network IP, the public IP is retrieved. This is a cached value from
53 * the time of the UPnP discovery.
54 *
55 * @return The IP address of the network, or NULL if something went wrong
56 */
57const char *gaim_upnp_get_public_ip (void);
58
59/**
60 * Maps Ports in a UPnP enabled IGD that sits on the local network to
61 * this gaim client. Essentially, this function takes care of the port
62 * forwarding so things like file transfers can work behind NAT firewalls
63 *
64 * @param portmap The port to map to this client
65 * @param protocol The protocol to map, either "TCP" or "UDP"
66 * @param do_add TRUE/GNUNET_YES to add, FALSE/GNUNET_NO to remove
67 * @param cb an optional callback function to be notified when the mapping
68 * addition is complete
69 * @param cb_data Extra data to be passed to the callback
70 */
71int gaim_upnp_change_port_mapping (struct GNUNET_CONFIGURATION_Handle *cfg,
72 int do_add,
73 uint16_t portmap, const char *protocol);
74
75#if 0 /* keep Emacsens' auto-indent happy */
76{
77#endif
78#ifdef __cplusplus
79}
80#endif
81
82#endif /* _GAIM_UPNP_H_ */