Tool to manually request VPN tunnels to be created. More...
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 97 of file gnunet-vpn.c.
References GNUNET_free, GNUNET_VPN_cancel_request(), GNUNET_VPN_disconnect(), handle, peer_id, request, 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 129 of file gnunet-vpn.c.
References _, address, buf, GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_SCHEDULER_shutdown(), request, 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 162 of file gnunet-vpn.c.
References _, allocation_cb(), cfg, do_disconnect(), duration, etime, 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(), handle, ipv4, ipv6, peer, peer_id, request, ret, service_name, target_ip, tcp, and udp.
Referenced by main().
int main | ( | int | argc, |
char *const * | argv | ||
) |
Definition at line 289 of file gnunet-vpn.c.
References duration, 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, options, peer_id, ret, run(), service_name, target_ip, tcp, udp, and verbosity.
|
static |
Handle to vpn service.
Definition at line 35 of file gnunet-vpn.c.
Referenced by do_disconnect(), and run().
|
static |
Opaque redirection request handle.
Definition at line 40 of file gnunet-vpn.c.
Referenced by allocation_cb(), cb_intersection_request_alice(), display_request(), dns_post_request_handler(), dns_pre_request_handler(), dns_result_processor(), do_disconnect(), do_timeout(), generate_gns_certificate(), GNUNET_DNSSTUB_resolve(), GNUNET_SET_accept(), GNUNET_SETI_accept(), GNUNET_SETU_accept(), GSF_cadet_start_server(), handle_dns_request(), handle_list(), handle_request(), handle_revocation_union_request(), libgnunet_plugin_rest_gns_done(), libgnunet_plugin_rest_namestore_done(), libgnunet_plugin_rest_reclaim_done(), listen_connect(), modify_request(), open_device(), reconnect(), result_processor(), run(), send_response(), set_listen_cb(), shuffle_answers(), and vpn_allocation_cb().
|
static |
Option -p: destination peer identity for service.
Definition at line 45 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 50 of file gnunet-vpn.c.
Referenced by change_service(), do_disconnect(), get_server_addresses(), GNUNET_ARM_request_service_start(), GNUNET_ARM_request_service_stop(), GNUNET_CLIENT_connect(), GNUNET_CLIENT_test(), GNUNET_SERVICE_run_(), GNUNET_SERVICE_start(), GNUNET_SOCKS_check_service(), GNUNET_SOCKS_do_connect(), GNUNET_TESTBED_peer_manage_service(), GNUNET_TESTING_service_run(), GNUNET_TUN_service_name_to_hash(), LEGACY_SERVICE_get_server_addresses(), LEGACY_SERVICE_run(), LEGACY_SERVICE_start(), main(), run(), server_get_addresses(), test_service_configuration(), and try_unixpath().
|
static |
Option -i: target IP.
Definition at line 55 of file gnunet-vpn.c.
Referenced by do_disconnect(), main(), and run().
|
static |
Option -4: IPv4 requested.
Definition at line 60 of file gnunet-vpn.c.
Referenced by GNUNET_HOSTLIST_server_start(), handle_icmp_back(), handle_tcp_back(), handle_udp_back(), icmp_from_helper(), main(), make_up_icmp_service_payload(), run(), send_icmp_packet_via_tun(), send_tcp_packet_via_tun(), and send_udp_packet_via_tun().
|
static |
Option -6: IPv6 requested.
Definition at line 65 of file gnunet-vpn.c.
Referenced by GNUNET_HOSTLIST_server_start(), GNUNET_TUN_ipv6toregexsearch(), handle_icmp_back(), handle_tcp_back(), handle_udp_back(), icmp_from_helper(), main(), make_up_icmp_service_payload(), run(), send_icmp_packet_via_tun(), send_tcp_packet_via_tun(), and send_udp_packet_via_tun().
|
static |
Option -t: TCP requested.
Definition at line 70 of file gnunet-vpn.c.
Referenced by GNUNET_TUN_calculate_tcp4_checksum(), GNUNET_TUN_calculate_tcp6_checksum(), handle_tcp_back(), main(), route_packet(), run(), and tcp_from_helper().
|
static |
Option -u: UDP requested.
Definition at line 75 of file gnunet-vpn.c.
Referenced by GNUNET_TUN_calculate_udp4_checksum(), GNUNET_TUN_calculate_udp6_checksum(), handle_icmp_back(), handle_icmp_remote(), handle_udp_back(), icmp_from_helper(), main(), make_up_icmp_service_payload(), make_up_icmpv4_payload(), make_up_icmpv6_payload(), process_helper_messages(), request_done(), route_packet(), run(), udp_from_helper(), and udp_plugin_send().
|
static |
|
static |
Global return value.
Definition at line 85 of file gnunet-vpn.c.
Referenced by allocation_cb(), main(), and run().
|
static |
Option '-d': duration of the mapping.
Definition at line 85 of file gnunet-vpn.c.