GNUnet  0.10.x
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 
31 #ifndef GNUNET_VPN_SERVICE_H
32 #define GNUNET_VPN_SERVICE_H
33 
34 #include "gnunet_util_lib.h"
35 
36 
40 struct GNUNET_VPN_Handle;
41 
46 
47 
61 typedef void (*GNUNET_VPN_AllocationCallback)(void *cls,
62  int af,
63  const void *address);
64 
65 
71 void
73 
74 
99  int result_af,
100  uint8_t protocol,
101  const struct GNUNET_PeerIdentity *peer,
102  const struct GNUNET_HashCode *serv,
105  void *cb_cls);
106 
107 
133  int result_af,
134  int addr_af,
135  const void *addr,
138  void *cb_cls);
139 
140 
147 struct GNUNET_VPN_Handle *
149 
150 
156 void
158 
159 #endif
160  /* end of group */
int result_af
Desired address family for the result.
Definition: vpn_api.c:130
void(* GNUNET_VPN_AllocationCallback)(void *cls, int af, const void *address)
Callback invoked from the VPN service once a redirection is available.
struct GNUNET_TIME_Absolute expiration_time
At what time should the created service mapping expire?
Definition: vpn_api.c:120
Opaque VPN handle.
Definition: vpn_api.c:34
GNUNET_VPN_AllocationCallback cb
Function to call with the designated IP address.
Definition: vpn_api.c:100
void GNUNET_VPN_disconnect(struct GNUNET_VPN_Handle *vh)
Disconnect from the VPN service.
Definition: vpn_api.c:529
A 512-bit hashcode.
void GNUNET_VPN_cancel_request(struct GNUNET_VPN_RedirectionRequest *rr)
Cancel redirection request with the service.
Definition: vpn_api.c:370
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition: gnunet-arm.c:104
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:405
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.
Opaque redirection request handle.
Definition: vpn_api.c:75
struct GNUNET_VPN_Handle * GNUNET_VPN_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the VPN service.
Definition: vpn_api.c:507
The identity of the host (wraps the signing key of the peer).
configuration data
Definition: configuration.c:83
uint8_t protocol
For service redirection, IPPROT_UDP or IPPROTO_TCP.
Definition: vpn_api.c:140
void * cb_cls
Closure for cb.
Definition: vpn_api.c:105
Time for absolute times used by GNUnet, in microseconds.
int addr_af
Address family of addr.
Definition: vpn_api.c:135
static char * address
GNS address for this phone.
struct GNUNET_HashCode serv
For service redirection, service descriptor.
Definition: vpn_api.c:115
const void * addr
Target IP address for the redirection, or NULL for redirection to service.
Definition: vpn_api.c:95
struct GNUNET_VPN_Handle * vh
Pointer to the VPN struct.
Definition: vpn_api.c:89
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:456