![]() |
GNUnet
0.11.x
|
Tool to manually request VPN tunnels to be created. More...
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_tun_lib.h"
#include "gnunet_vpn_service.h"
Go to the source code of this file.
Functions | |
static void | do_disconnect (void *cls) |
Shutdown. More... | |
static void | allocation_cb (void *cls, int af, const void *address) |
Callback invoked from the VPN service once a redirection is available. More... | |
static void | run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) |
Main function that will be run by the scheduler. More... | |
int | main (int argc, char *const *argv) |
Variables | |
static struct GNUNET_VPN_Handle * | handle |
Handle to vpn service. More... | |
static struct GNUNET_VPN_RedirectionRequest * | request |
Opaque redirection request handle. More... | |
static char * | peer_id |
Option -p: destination peer identity for service. More... | |
static char * | service_name |
Option -s: service name (hash to get service descriptor) More... | |
static char * | target_ip |
Option -i: target IP. More... | |
static int | ipv4 |
Option -4: IPv4 requested. More... | |
static int | ipv6 |
Option -6: IPv6 requested. More... | |
static int | tcp |
Option -t: TCP requested. More... | |
static int | udp |
Option -u: UDP requested. More... | |
static unsigned int | verbosity |
Selected level of verbosity. More... | |
static int | ret |
Global return value. More... | |
static struct GNUNET_TIME_Relative | duration = { 5 * 60 * 1000 } |
Option '-d': duration of the mapping. More... | |
Tool to manually request VPN tunnels to be created.
Definition in file gnunet-vpn.c.
|
static |
Shutdown.
Definition at line 98 of file gnunet-vpn.c.
References GNUNET_free, GNUNET_VPN_cancel_request(), GNUNET_VPN_disconnect(), peer_id, service_name, and target_ip.
Referenced by run().
|
static |
Callback invoked from the VPN service once a redirection is available.
Provides the IP address that can now be used to reach the requested destination.
cls | closure |
af | address family, AF_INET or AF_INET6; AF_UNSPEC on error; will match 'result_af' from the request |
address | IP address (struct in_addr or struct in_addr6, depending on 'af') that the VPN allocated for the redirection; traffic to this IP will now be redirected to the specified target peer; NULL on error |
Definition at line 130 of file gnunet-vpn.c.
References _, buf, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_SCHEDULER_shutdown(), and ret.
Referenced by run().
|
static |
Main function that will be run by the scheduler.
cls | closure |
args | remaining command-line arguments |
cfgfile | name of the configuration file used (for saving, can be NULL!) |
cfg | configuration |
Definition at line 163 of file gnunet-vpn.c.
References _, allocation_cb(), do_disconnect(), GNUNET_CRYPTO_eddsa_public_key_from_string(), GNUNET_OK, GNUNET_SCHEDULER_add_shutdown(), GNUNET_SCHEDULER_shutdown(), GNUNET_TIME_relative_to_absolute(), GNUNET_TUN_service_name_to_hash(), GNUNET_VPN_connect(), GNUNET_VPN_redirect_to_ip(), GNUNET_VPN_redirect_to_peer(), ipv4, ipv6, peer_id, GNUNET_PeerIdentity::public_key, ret, service_name, target_ip, tcp, and udp.
Referenced by main().
int main | ( | int | argc, |
char *const * | argv | ||
) |
Definition at line 290 of file gnunet-vpn.c.
References gettext_noop, GNUNET_free_nz, GNUNET_GETOPT_OPTION_END, GNUNET_GETOPT_option_flag(), GNUNET_GETOPT_option_relative_time(), GNUNET_GETOPT_option_string(), GNUNET_GETOPT_option_verbose(), GNUNET_OK, GNUNET_PROGRAM_run(), GNUNET_STRINGS_get_utf8_args(), ipv4, ipv6, peer_id, ret, run(), service_name, target_ip, tcp, udp, and verbosity.
|
static |
Handle to vpn service.
Definition at line 36 of file gnunet-vpn.c.
|
static |
Opaque redirection request handle.
Definition at line 41 of file gnunet-vpn.c.
Referenced by create_response(), dns_result_processor(), do_timeout(), generate_gns_certificate(), GSF_cadet_start_server(), handle_request(), libgnunet_plugin_rest_gns_done(), libgnunet_plugin_rest_namestore_done(), libgnunet_plugin_rest_reclaim_done(), listen_connect(), lookup_it_error(), lookup_it_finished(), lookup_it_processor(), open_device(), post_iterator(), put_continuation(), reconnect(), request_completed_callback(), result_processor(), zone_to_name_cb(), and zone_to_name_error().
|
static |
Option -p: destination peer identity for service.
Definition at line 46 of file gnunet-vpn.c.
Referenced by do_disconnect(), main(), and run().
|
static |
Option -s: service name (hash to get service descriptor)
Definition at line 51 of file gnunet-vpn.c.
Referenced by do_disconnect(), GNUNET_SERVICE_run_(), GNUNET_SERVICE_start(), main(), and run().
|
static |
Option -i: target IP.
Definition at line 56 of file gnunet-vpn.c.
Referenced by do_disconnect(), main(), and run().
|
static |
Option -4: IPv4 requested.
Definition at line 61 of file gnunet-vpn.c.
Referenced by GNUNET_HOSTLIST_server_start(), handle_icmp_back(), handle_tcp_back(), handle_udp_back(), main(), and run().
|
static |
Option -6: IPv6 requested.
Definition at line 66 of file gnunet-vpn.c.
Referenced by GNUNET_HOSTLIST_server_start(), handle_icmp_back(), handle_tcp_back(), handle_udp_back(), main(), and run().
|
static |
Option -t: TCP requested.
Definition at line 71 of file gnunet-vpn.c.
Referenced by handle_tcp_back(), main(), route_packet(), and run().
|
static |
Option -u: UDP requested.
Definition at line 76 of file gnunet-vpn.c.
Referenced by handle_icmp_back(), handle_icmp_remote(), handle_udp_back(), icmp_from_helper(), main(), make_up_icmp_service_payload(), process_helper_messages(), request_done(), route_packet(), run(), and udp_plugin_send().
|
static |
|
static |
Global return value.
Definition at line 86 of file gnunet-vpn.c.
Referenced by allocation_cb(), main(), and run().
|
static |
Option '-d': duration of the mapping.
Definition at line 91 of file gnunet-vpn.c.