GNUnet 0.22.2
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
37typedef void
38(*GNUNET_NAT_IPCallback) (void *cls,
39 const struct in_addr *addr,
41
42
47
48
58 void *cb_cls);
59
60
66void
69
70
75
76
88typedef void
90 int add_remove,
91 const struct sockaddr *addr,
92 socklen_t addrlen,
94
95
111 int is_tcp,
113 void *ac_cls);
114
115
124void
126
127
128#endif
static uint16_t port
Port number.
Definition: gnunet-bcd.c:146
static int result
Global testing status.
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 GNUNET_NAT_mini_get_external_ipv4_cancel_(struct GNUNET_NAT_ExternalHandle *eh)
Cancel operation.
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 ...
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.
void GNUNET_NAT_mini_map_stop(struct GNUNET_NAT_MiniHandle *mini)
Remove a mapping created with (mini)upnpc.
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.
GNUNET_NAT_StatusCode
Error Types for the NAT subsystem (which can then later be converted/resolved to a string)
Opaque handle to cancel "GNUNET_NAT_mini_get_external_ipv4" operation.
GNUNET_NAT_IPCallback cb
Function to call with the result.
Handle to a mapping created with upnpc.
void * ac_cls
Closure for ac.
int is_tcp
Are we mapping TCP or UDP?
GNUNET_NAT_MiniAddressCallback ac
Function to call on mapping changes.