diff options
Diffstat (limited to 'src/include/gnunet_upnp_service.h')
-rw-r--r-- | src/include/gnunet_upnp_service.h | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/src/include/gnunet_upnp_service.h b/src/include/gnunet_upnp_service.h new file mode 100644 index 000000000..758d5c598 --- /dev/null +++ b/src/include/gnunet_upnp_service.h | |||
@@ -0,0 +1,75 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet | ||
3 | (C) 2006 Christian Grothoff (and other contributing authors) | ||
4 | |||
5 | GNUnet is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published | ||
7 | by the Free Software Foundation; either version 2, or (at your | ||
8 | option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with GNUnet; see the file COPYING. If not, write to the | ||
17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
18 | Boston, MA 02111-1307, USA. | ||
19 | */ | ||
20 | |||
21 | /** | ||
22 | * @file include/gnunet_upnp_service.h | ||
23 | * @brief API for UPnP access | ||
24 | * @author Christian Grothoff | ||
25 | */ | ||
26 | |||
27 | #ifndef GNUNET_UPNP_SERVICE_H | ||
28 | #define GNUNET_UPNP_SERVICE_H | ||
29 | |||
30 | #include "gnunet_resolver_service.h" | ||
31 | |||
32 | #ifdef __cplusplus | ||
33 | extern "C" | ||
34 | { | ||
35 | #if 0 /* keep Emacsens' auto-indent happy */ | ||
36 | } | ||
37 | #endif | ||
38 | #endif | ||
39 | |||
40 | |||
41 | /** | ||
42 | * Get the external IP address for the local machine and | ||
43 | * install a port mapping if possible. The external port | ||
44 | * will be returned as part of the address. | ||
45 | * | ||
46 | * @param sched scheduler to use | ||
47 | * @param cfg configuration to use | ||
48 | * @param domain communication domain (i.e. PF_INET or PF_INET6) | ||
49 | * @param type communication semantics (SOCK_STREAM, SOCK_DGRAM) | ||
50 | * @param protocol protocol to use, 0 for default (see protocols(5)) | ||
51 | * @param port port to map | ||
52 | * @param timeout after how long should we give up (and call | ||
53 | * notify with buf NULL and size 0)? | ||
54 | * @param callback function to call with the external address; | ||
55 | * function will be called with NULL on error | ||
56 | * @param cls closure for callback | ||
57 | */ | ||
58 | int GNUNET_UPNP_get_ip (struct GNUNET_SCHEDULER_Handle *sched, | ||
59 | struct GNUNET_CONFIGURATION_Handle *cfg, | ||
60 | int domain, | ||
61 | int type, | ||
62 | int protocol, | ||
63 | uint16_t port, | ||
64 | struct GNUNET_TIME_Relative timeout, | ||
65 | GNUNET_RESOLVER_AddressCallback callback, void *cls); | ||
66 | |||
67 | |||
68 | #if 0 /* keep Emacsens' auto-indent happy */ | ||
69 | { | ||
70 | #endif | ||
71 | #ifdef __cplusplus | ||
72 | } | ||
73 | #endif | ||
74 | |||
75 | #endif | ||