diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-11-30 08:17:33 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-11-30 08:17:33 +0100 |
commit | e43df97dfdb10903dd53571ab07863d95740592c (patch) | |
tree | 5a4bfaffe744b311d3097eac17117a978a8c259c /src/nat/gnunet-service-nat_helper.h | |
parent | 1b4333f3a6a4f76aa76fc3abc21e8476ea0a92e3 (diff) | |
download | gnunet-e43df97dfdb10903dd53571ab07863d95740592c.tar.gz gnunet-e43df97dfdb10903dd53571ab07863d95740592c.zip |
moving basic logic for launching nat-server helper to new NAT service
Diffstat (limited to 'src/nat/gnunet-service-nat_helper.h')
-rw-r--r-- | src/nat/gnunet-service-nat_helper.h | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/src/nat/gnunet-service-nat_helper.h b/src/nat/gnunet-service-nat_helper.h new file mode 100644 index 000000000..c3074d9ad --- /dev/null +++ b/src/nat/gnunet-service-nat_helper.h | |||
@@ -0,0 +1,74 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | Copyright (C) 2009, 2010, 2011, 2016 GNUnet e.V. | ||
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 3, 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., 51 Franklin Street, Fifth Floor, | ||
18 | Boston, MA 02110-1301, USA. | ||
19 | */ | ||
20 | |||
21 | /** | ||
22 | * @file nat/gnunet-service-nat_helper.h | ||
23 | * @brief runs the gnunet-helper-nat-server | ||
24 | * @author Milan Bouchet-Valat | ||
25 | * @author Christian Grothoff | ||
26 | */ | ||
27 | #include "platform.h" | ||
28 | #include "gnunet_util_lib.h" | ||
29 | |||
30 | |||
31 | /** | ||
32 | * Information we keep per NAT helper process. | ||
33 | */ | ||
34 | struct HelperContext; | ||
35 | |||
36 | |||
37 | /** | ||
38 | * Function called whenever we get a connection reversal | ||
39 | * request from another peer. | ||
40 | * | ||
41 | * @param cls closure | ||
42 | * @param ra IP address of the peer who wants us to connect to it | ||
43 | */ | ||
44 | typedef void | ||
45 | (*GN_ReversalCallback) (void *cls, | ||
46 | const struct sockaddr_in *ra); | ||
47 | |||
48 | |||
49 | /** | ||
50 | * Start the gnunet-helper-nat-server and process incoming | ||
51 | * requests. | ||
52 | * | ||
53 | * @param internal_address | ||
54 | * @param cb function to call if we receive a request | ||
55 | * @param cb_cls closure for @a cb | ||
56 | * @return NULL on error | ||
57 | */ | ||
58 | struct HelperContext * | ||
59 | GN_start_gnunet_nat_server_ (const char *internal_address, | ||
60 | GN_ReversalCallback cb, | ||
61 | void *cb_cls); | ||
62 | |||
63 | |||
64 | /** | ||
65 | * Start the gnunet-helper-nat-server and process incoming | ||
66 | * requests. | ||
67 | * | ||
68 | * @param h helper context to stop | ||
69 | */ | ||
70 | void | ||
71 | GN_stop_gnunet_nat_server_ (struct HelperContext *h); | ||
72 | |||
73 | |||
74 | /* end of gnunet-service-nat_helper.h */ | ||