aboutsummaryrefslogtreecommitdiff
path: root/src/vpn
diff options
context:
space:
mode:
authorPhilipp Tölke <toelke@in.tum.de>2011-06-15 07:15:34 +0000
committerPhilipp Tölke <toelke@in.tum.de>2011-06-15 07:15:34 +0000
commit728fb46aebbf873afd67433c6abb5e6375d0c535 (patch)
tree4649d8d83d7e93008030c6f6375806e15602c79f /src/vpn
parentbd039b96c0050dbe4bfc2173b58611aa1ce6517a (diff)
downloadgnunet-728fb46aebbf873afd67433c6abb5e6375d0c535.tar.gz
gnunet-728fb46aebbf873afd67433c6abb5e6375d0c535.zip
indentation
Diffstat (limited to 'src/vpn')
-rw-r--r--src/vpn/gnunet-daemon-vpn-helper.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/src/vpn/gnunet-daemon-vpn-helper.c b/src/vpn/gnunet-daemon-vpn-helper.c
index ca885ecec..1c7ee7987 100644
--- a/src/vpn/gnunet-daemon-vpn-helper.c
+++ b/src/vpn/gnunet-daemon-vpn-helper.c
@@ -309,44 +309,44 @@ message_token (void *cls,
309 else 309 else
310 { 310 {
311 /* This is a mapping to a "real" address */ 311 /* This is a mapping to a "real" address */
312 struct remote_addr *s = (struct remote_addr*) hc; 312 struct remote_addr *s = (struct remote_addr*) hc;
313 s->addrlen = me->addrlen; 313 s->addrlen = me->addrlen;
314 memcpy(s->addr, me->addr, me->addrlen); 314 memcpy(s->addr, me->addr, me->addrlen);
315 s->proto= pkt6->ip6_hdr.nxthdr; 315 s->proto= pkt6->ip6_hdr.nxthdr;
316 if (s->proto == 0x11) 316 if (s->proto == 0x11)
317 { 317 {
318 hdr->type = GNUNET_MESSAGE_TYPE_REMOTE_UDP; 318 hdr->type = GNUNET_MESSAGE_TYPE_REMOTE_UDP;
319 memcpy (hc + 1, &pkt6_udp->udp_hdr, 319 memcpy (hc + 1, &pkt6_udp->udp_hdr,
320 ntohs (pkt6_udp->udp_hdr.len)); 320 ntohs (pkt6_udp->udp_hdr.len));
321 app_type = GNUNET_APPLICATION_TYPE_INTERNET_UDP_GATEWAY; 321 app_type = GNUNET_APPLICATION_TYPE_INTERNET_UDP_GATEWAY;
322 } 322 }
323 else if (s->proto == 0x06) 323 else if (s->proto == 0x06)
324 { 324 {
325 hdr->type = GNUNET_MESSAGE_TYPE_REMOTE_TCP; 325 hdr->type = GNUNET_MESSAGE_TYPE_REMOTE_TCP;
326 memcpy (hc + 1, &pkt6_tcp->tcp_hdr, 326 memcpy (hc + 1, &pkt6_tcp->tcp_hdr,
327 ntohs (pkt6->ip6_hdr.paylgth)); 327 ntohs (pkt6->ip6_hdr.paylgth));
328 if (ntohs(pkt6_tcp->tcp_hdr.dpt) == 443) 328 if (ntohs(pkt6_tcp->tcp_hdr.dpt) == 443)
329 app_type = GNUNET_APPLICATION_TYPE_INTERNET_HTTPS_GATEWAY; 329 app_type = GNUNET_APPLICATION_TYPE_INTERNET_HTTPS_GATEWAY;
330 else if (ntohs(pkt6_tcp->tcp_hdr.dpt) == 80) 330 else if (ntohs(pkt6_tcp->tcp_hdr.dpt) == 80)
331 app_type = GNUNET_APPLICATION_TYPE_INTERNET_HTTP_GATEWAY; 331 app_type = GNUNET_APPLICATION_TYPE_INTERNET_HTTP_GATEWAY;
332 else 332 else
333 app_type = GNUNET_APPLICATION_TYPE_INTERNET_TCP_GATEWAY; 333 app_type = GNUNET_APPLICATION_TYPE_INTERNET_TCP_GATEWAY;
334 } 334 }
335 } 335 if (me->tunnel == NULL && NULL != cls)
336 if (me->tunnel == NULL && NULL != cls) 336 {
337 { 337 *cls = GNUNET_MESH_peer_request_connect_by_type(mesh_handle,
338 *cls = GNUNET_MESH_peer_request_connect_by_type(mesh_handle, 338 GNUNET_TIME_UNIT_FOREVER_REL,
339 GNUNET_TIME_UNIT_FOREVER_REL, 339 app_type,
340 app_type, 340 send_pkt_to_peer,
341 send_pkt_to_peer, 341 NULL,
342 NULL, 342 cls);
343 cls); 343 me->tunnel = *cls;
344 me->tunnel = *cls; 344 }
345 } 345 else if (NULL != cls)
346 else if (NULL != cls) 346 {
347 { 347 *cls = me->tunnel;
348 *cls = me->tunnel; 348 send_pkt_to_peer(cls, (struct GNUNET_PeerIdentity*) 1, NULL);
349 send_pkt_to_peer(cls, (struct GNUNET_PeerIdentity*) 1, NULL); 349 }
350 } 350 }
351 } 351 }
352 break; 352 break;