GNUnet  0.17.6
gnunet_vpn_service.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet
3  Copyright (C) 2012 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 
34 #ifndef GNUNET_VPN_SERVICE_H
35 #define GNUNET_VPN_SERVICE_H
36 
37 #include "gnunet_util_lib.h"
38 
39 
43 struct GNUNET_VPN_Handle;
44 
49 
50 
64 typedef void (*GNUNET_VPN_AllocationCallback)(void *cls,
65  int af,
66  const void *address);
67 
68 
74 void
76 
77 
102  int result_af,
103  uint8_t protocol,
104  const struct GNUNET_PeerIdentity *peer,
105  const struct GNUNET_HashCode *serv,
108  void *cb_cls);
109 
110 
136  int result_af,
137  int addr_af,
138  const void *addr,
141  void *cb_cls);
142 
143 
150 struct GNUNET_VPN_Handle *
152 
153 
159 void
161 
162 #endif
163  /* end of group */
165  /* end of group addition */
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
static char * address
GNS address for this phone.
struct GNUNET_VPN_RedirectionRequest * GNUNET_VPN_redirect_to_ip(struct GNUNET_VPN_Handle *vh, int result_af, int addr_af, const void *addr, struct GNUNET_TIME_Absolute expiration_time, GNUNET_VPN_AllocationCallback cb, void *cb_cls)
Tell the VPN that forwarding to the Internet via some exit node is requested.
Definition: vpn_api.c:461
void GNUNET_VPN_cancel_request(struct GNUNET_VPN_RedirectionRequest *rr)
Cancel redirection request with the service.
Definition: vpn_api.c:375
struct GNUNET_VPN_Handle * GNUNET_VPN_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the VPN service.
Definition: vpn_api.c:512
void(* GNUNET_VPN_AllocationCallback)(void *cls, int af, const void *address)
Callback invoked from the VPN service once a redirection is available.
struct GNUNET_VPN_RedirectionRequest * GNUNET_VPN_redirect_to_peer(struct GNUNET_VPN_Handle *vh, int result_af, uint8_t protocol, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_HashCode *serv, struct GNUNET_TIME_Absolute expiration_time, GNUNET_VPN_AllocationCallback cb, void *cb_cls)
Tell the VPN that a forwarding to a particular peer offering a particular service is requested.
Definition: vpn_api.c:410
void GNUNET_VPN_disconnect(struct GNUNET_VPN_Handle *vh)
Disconnect from the VPN service.
Definition: vpn_api.c:534
A 512-bit hashcode.
The identity of the host (wraps the signing key of the peer).
Time for absolute times used by GNUnet, in microseconds.
Opaque VPN handle.
Definition: vpn_api.c:35
Opaque redirection request handle.
Definition: vpn_api.c:77
const void * addr
Target IP address for the redirection, or NULL for redirection to service.
Definition: vpn_api.c:97
GNUNET_VPN_AllocationCallback cb
Function to call with the designated IP address.
Definition: vpn_api.c:102
void * cb_cls
Closure for cb.
Definition: vpn_api.c:107
struct GNUNET_VPN_Handle * vh
Pointer to the VPN struct.
Definition: vpn_api.c:91
uint8_t protocol
For service redirection, IPPROT_UDP or IPPROTO_TCP.
Definition: vpn_api.c:142
struct GNUNET_TIME_Absolute expiration_time
At what time should the created service mapping expire?
Definition: vpn_api.c:122
int addr_af
Address family of addr.
Definition: vpn_api.c:137
int result_af
Desired address family for the result.
Definition: vpn_api.c:132
struct GNUNET_HashCode serv
For service redirection, service descriptor.
Definition: vpn_api.c:117
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.