GNUnet  0.10.x
gnunet-service-nat_mini.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2011-2014, 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 
26 #ifndef GNUNET_SERVICE_NAT_MINI_H
27 #define GNUNET_SERVICE_NAT_MINI_H
28 
29 
37 typedef void
38 (*GNUNET_NAT_IPCallback) (void *cls,
39  const struct in_addr *addr,
41 
42 
47 
48 
58  void *cb_cls);
59 
60 
66 void
68 
69 
74 
75 
87 typedef void
89  int add_remove,
90  const struct sockaddr *addr,
91  socklen_t addrlen,
93 
94 
108 struct GNUNET_NAT_MiniHandle *
110  int is_tcp,
112  void *ac_cls);
113 
114 
123 void
125 
126 
127 #endif
Opaque handle to cancel "GNUNET_NAT_mini_get_external_ipv4" operation.
void GNUNET_NAT_mini_get_external_ipv4_cancel_(struct GNUNET_NAT_ExternalHandle *eh)
Cancel operation.
struct GNUNET_NAT_ExternalHandle * GNUNET_NAT_mini_get_external_ipv4_(GNUNET_NAT_IPCallback cb, void *cb_cls)
Try to get the external IPv4 address of this peer.
Handle to a mapping created with upnpc.
int is_tcp
Are we mapping TCP or UDP?
GNUNET_NAT_IPCallback cb
Function to call with the result.
GNUNET_NAT_StatusCode
Error Types for the NAT subsystem (which can then later be converted/resolved to a string) ...
static int result
Global testing status.
void * ac_cls
Closure for ac.
void(* GNUNET_NAT_MiniAddressCallback)(void *cls, int add_remove, const struct sockaddr *addr, socklen_t addrlen, enum GNUNET_NAT_StatusCode result)
Signature of the callback passed to GNUNET_NAT_register() for a function to call whenever our set of ...
static struct GNUNET_MQ_Envelope * ac
Handle to current GNUNET_PEERINFO_add_peer() operation.
void(* GNUNET_NAT_IPCallback)(void *cls, const struct in_addr *addr, enum GNUNET_NAT_StatusCode result)
Signature of a callback that is given an IP address.
static uint16_t port
Port number.
Definition: gnunet-bcd.c:81
void GNUNET_NAT_mini_map_stop(struct GNUNET_NAT_MiniHandle *mini)
Remove a mapping created with (mini)upnpc.
struct GNUNET_NAT_MiniHandle * GNUNET_NAT_mini_map_start(uint16_t port, int is_tcp, GNUNET_NAT_MiniAddressCallback ac, void *ac_cls)
Start mapping the given port using (mini)upnpc.
void * cb_cls
Closure for cb.