GNUnet  0.20.0
gnunet-service-nat_helper.h
Go to the documentation of this file.
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 it
6  under the terms of the GNU Affero General Public License as published
7  by the Free Software Foundation, either version 3 of the License,
8  or (at your 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  Affero General Public License for more details.
14 
15  You should have received a copy of the GNU Affero General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18  SPDX-License-Identifier: AGPL3.0-or-later
19  */
20 
27 #include "platform.h"
28 #include "gnunet_util_lib.h"
29 
30 
34 struct HelperContext;
35 
36 
44 typedef void
45 (*GN_ReversalCallback) (void *cls,
46  const struct sockaddr_in *ra);
47 
48 
59 struct HelperContext *
60 GN_start_gnunet_nat_server_ (const struct in_addr *internal_address,
62  void *cb_cls,
63  const struct GNUNET_CONFIGURATION_Handle *cfg);
64 
65 
72 void
74 
75 
88 int
90  uint16_t internal_port,
91  const struct in_addr *remote_v4,
92  const struct GNUNET_CONFIGURATION_Handle *cfg);
93 
94 
95 /* end of gnunet-service-nat_helper.h */
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
int GN_request_connection_reversal(const struct in_addr *internal_address, uint16_t internal_port, const struct in_addr *remote_v4, const struct GNUNET_CONFIGURATION_Handle *cfg)
We want to connect to a peer that is behind NAT.
void GN_stop_gnunet_nat_server_(struct HelperContext *h)
Start the gnunet-helper-nat-server and process incoming requests.
void(* GN_ReversalCallback)(void *cls, const struct sockaddr_in *ra)
Function called whenever we get a connection reversal request from another peer.
struct HelperContext * GN_start_gnunet_nat_server_(const struct in_addr *internal_address, GN_ReversalCallback cb, void *cb_cls, const struct GNUNET_CONFIGURATION_Handle *cfg)
Start the gnunet-helper-nat-server and process incoming requests.
Information we keep per NAT helper process.
struct in_addr internal_address
IP address we pass to the NAT helper.
GN_ReversalCallback cb
Function to call if we receive a reversal request.
void * cb_cls
Closure for cb.