From 12d2fb0c47f2ef0868c5a247d9acd70c86e8daeb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Philipp=20T=C3=B6lke?= Date: Wed, 27 Jul 2011 07:28:09 +0000 Subject: [PATCH] save the udp and tcp tunnels --- src/vpn/gnunet-daemon-vpn-helper.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/vpn/gnunet-daemon-vpn-helper.c b/src/vpn/gnunet-daemon-vpn-helper.c index ebdc0d2ae..9dbd2ade7 100644 --- a/src/vpn/gnunet-daemon-vpn-helper.c +++ b/src/vpn/gnunet-daemon-vpn-helper.c @@ -45,6 +45,12 @@ struct GNUNET_VPN_HELPER_Handle *helper_handle; +/** + * The tunnels that will be used to send tcp- and udp-packets + */ +static struct GNUNET_MESH_Tunnel* tcp_tunnel; +static struct GNUNET_MESH_Tunnel* udp_tunnel; + /** * Start the helper-process * @@ -325,6 +331,8 @@ message_token (void *cls __attribute__((unused)), memcpy (hc + 1, &pkt6_udp->udp_hdr, ntohs (pkt6_udp->udp_hdr.len)); app_type = GNUNET_APPLICATION_TYPE_INTERNET_UDP_GATEWAY; + if (NULL != udp_tunnel) + me->tunnel = udp_tunnel; } else if (s->proto == 0x06) { @@ -332,6 +340,8 @@ message_token (void *cls __attribute__((unused)), memcpy (hc + 1, &pkt6_tcp->tcp_hdr, ntohs (pkt6->ip6_hdr.paylgth)); app_type = GNUNET_APPLICATION_TYPE_INTERNET_TCP_GATEWAY; + if (NULL != tcp_tunnel) + me->tunnel = tcp_tunnel; } if (me->tunnel == NULL && NULL != cls) { @@ -342,6 +352,10 @@ message_token (void *cls __attribute__((unused)), NULL, cls); me->tunnel = *cls; + if (GNUNET_APPLICATION_TYPE_INTERNET_UDP_GATEWAY == app_type) + udp_tunnel = *cls; + else if (GNUNET_APPLICATION_TYPE_INTERNET_TCP_GATEWAY == app_type) + tcp_tunnel = *cls; } else if (NULL != cls) { -- 2.25.1