diff options
author | Philipp Tölke <toelke@in.tum.de> | 2011-07-27 07:28:09 +0000 |
---|---|---|
committer | Philipp Tölke <toelke@in.tum.de> | 2011-07-27 07:28:09 +0000 |
commit | 12d2fb0c47f2ef0868c5a247d9acd70c86e8daeb (patch) | |
tree | 3d696bdb98852219f5ab0d552dbbf1e23058c09b /src/vpn | |
parent | 9840bf19f7b5d401aa7c5d30f0d01626ae5c1b88 (diff) | |
download | gnunet-12d2fb0c47f2ef0868c5a247d9acd70c86e8daeb.tar.gz gnunet-12d2fb0c47f2ef0868c5a247d9acd70c86e8daeb.zip |
save the udp and tcp tunnels
Diffstat (limited to 'src/vpn')
-rw-r--r-- | src/vpn/gnunet-daemon-vpn-helper.c | 14 |
1 files changed, 14 insertions, 0 deletions
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 | |||
@@ -46,6 +46,12 @@ | |||
46 | struct GNUNET_VPN_HELPER_Handle *helper_handle; | 46 | struct GNUNET_VPN_HELPER_Handle *helper_handle; |
47 | 47 | ||
48 | /** | 48 | /** |
49 | * The tunnels that will be used to send tcp- and udp-packets | ||
50 | */ | ||
51 | static struct GNUNET_MESH_Tunnel* tcp_tunnel; | ||
52 | static struct GNUNET_MESH_Tunnel* udp_tunnel; | ||
53 | |||
54 | /** | ||
49 | * Start the helper-process | 55 | * Start the helper-process |
50 | * | 56 | * |
51 | * If cls != NULL it is assumed that this function is called as a result of a dying | 57 | * If cls != NULL it is assumed that this function is called as a result of a dying |
@@ -325,6 +331,8 @@ message_token (void *cls __attribute__((unused)), | |||
325 | memcpy (hc + 1, &pkt6_udp->udp_hdr, | 331 | memcpy (hc + 1, &pkt6_udp->udp_hdr, |
326 | ntohs (pkt6_udp->udp_hdr.len)); | 332 | ntohs (pkt6_udp->udp_hdr.len)); |
327 | app_type = GNUNET_APPLICATION_TYPE_INTERNET_UDP_GATEWAY; | 333 | app_type = GNUNET_APPLICATION_TYPE_INTERNET_UDP_GATEWAY; |
334 | if (NULL != udp_tunnel) | ||
335 | me->tunnel = udp_tunnel; | ||
328 | } | 336 | } |
329 | else if (s->proto == 0x06) | 337 | else if (s->proto == 0x06) |
330 | { | 338 | { |
@@ -332,6 +340,8 @@ message_token (void *cls __attribute__((unused)), | |||
332 | memcpy (hc + 1, &pkt6_tcp->tcp_hdr, | 340 | memcpy (hc + 1, &pkt6_tcp->tcp_hdr, |
333 | ntohs (pkt6->ip6_hdr.paylgth)); | 341 | ntohs (pkt6->ip6_hdr.paylgth)); |
334 | app_type = GNUNET_APPLICATION_TYPE_INTERNET_TCP_GATEWAY; | 342 | app_type = GNUNET_APPLICATION_TYPE_INTERNET_TCP_GATEWAY; |
343 | if (NULL != tcp_tunnel) | ||
344 | me->tunnel = tcp_tunnel; | ||
335 | } | 345 | } |
336 | if (me->tunnel == NULL && NULL != cls) | 346 | if (me->tunnel == NULL && NULL != cls) |
337 | { | 347 | { |
@@ -342,6 +352,10 @@ message_token (void *cls __attribute__((unused)), | |||
342 | NULL, | 352 | NULL, |
343 | cls); | 353 | cls); |
344 | me->tunnel = *cls; | 354 | me->tunnel = *cls; |
355 | if (GNUNET_APPLICATION_TYPE_INTERNET_UDP_GATEWAY == app_type) | ||
356 | udp_tunnel = *cls; | ||
357 | else if (GNUNET_APPLICATION_TYPE_INTERNET_TCP_GATEWAY == app_type) | ||
358 | tcp_tunnel = *cls; | ||
345 | } | 359 | } |
346 | else if (NULL != cls) | 360 | else if (NULL != cls) |
347 | { | 361 | { |