diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-09-14 11:59:46 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-09-14 11:59:46 +0000 |
commit | 1fe79fd553e21a20206301c18568d30158c9dd46 (patch) | |
tree | 3db4e42adb872d1e8aa792643c341a14b2959736 /src/vpn | |
parent | f709218364f7d40e5a13938886514e866602715d (diff) | |
download | gnunet-1fe79fd553e21a20206301c18568d30158c9dd46.tar.gz gnunet-1fe79fd553e21a20206301c18568d30158c9dd46.zip |
indentation
Diffstat (limited to 'src/vpn')
-rw-r--r-- | src/vpn/gnunet-daemon-vpn-helper.c | 15 | ||||
-rw-r--r-- | src/vpn/gnunet-service-dns.c | 34 |
2 files changed, 24 insertions, 25 deletions
diff --git a/src/vpn/gnunet-daemon-vpn-helper.c b/src/vpn/gnunet-daemon-vpn-helper.c index a7ab160ea..29850b446 100644 --- a/src/vpn/gnunet-daemon-vpn-helper.c +++ b/src/vpn/gnunet-daemon-vpn-helper.c | |||
@@ -355,9 +355,10 @@ message_token (void *cls __attribute__ ((unused)), void *client | |||
355 | app_type = GNUNET_APPLICATION_TYPE_INTERNET_TCP_GATEWAY; | 355 | app_type = GNUNET_APPLICATION_TYPE_INTERNET_TCP_GATEWAY; |
356 | if (NULL != tcp_tunnel) | 356 | if (NULL != tcp_tunnel) |
357 | me->tunnel = tcp_tunnel; | 357 | me->tunnel = tcp_tunnel; |
358 | } else | 358 | } |
359 | else | ||
359 | { | 360 | { |
360 | GNUNET_assert (0); | 361 | GNUNET_assert (0); |
361 | } | 362 | } |
362 | if (me->tunnel == NULL && NULL != cls) | 363 | if (me->tunnel == NULL && NULL != cls) |
363 | { | 364 | { |
@@ -489,17 +490,17 @@ message_token (void *cls __attribute__ ((unused)), void *client | |||
489 | /* This is a mapping to a gnunet-service */ | 490 | /* This is a mapping to a gnunet-service */ |
490 | memcpy (hc, &me->desc.service_descriptor, sizeof (GNUNET_HashCode)); | 491 | memcpy (hc, &me->desc.service_descriptor, sizeof (GNUNET_HashCode)); |
491 | 492 | ||
492 | if ( (IPPROTO_UDP == pkt->ip_hdr.proto) && | 493 | if ((IPPROTO_UDP == pkt->ip_hdr.proto) && |
493 | (me->desc.service_type & htonl (GNUNET_DNS_SERVICE_TYPE_UDP)) && | 494 | (me->desc.service_type & htonl (GNUNET_DNS_SERVICE_TYPE_UDP)) && |
494 | (port_in_ports (me->desc.ports, pkt_udp->udp_hdr.dpt) || | 495 | (port_in_ports (me->desc.ports, pkt_udp->udp_hdr.dpt) || |
495 | testBit (me->additional_ports, ntohs (pkt_udp->udp_hdr.dpt))) ) | 496 | testBit (me->additional_ports, ntohs (pkt_udp->udp_hdr.dpt)))) |
496 | { | 497 | { |
497 | hdr->type = ntohs (GNUNET_MESSAGE_TYPE_VPN_SERVICE_UDP); | 498 | hdr->type = ntohs (GNUNET_MESSAGE_TYPE_VPN_SERVICE_UDP); |
498 | 499 | ||
499 | memcpy (hc + 1, &pkt_udp->udp_hdr, ntohs (pkt_udp->udp_hdr.len)); | 500 | memcpy (hc + 1, &pkt_udp->udp_hdr, ntohs (pkt_udp->udp_hdr.len)); |
500 | 501 | ||
501 | } | 502 | } |
502 | else if ( (IPPROTO_TCP == pkt->ip_hdr.proto) && | 503 | else if ((IPPROTO_TCP == pkt->ip_hdr.proto) && |
503 | (me-> | 504 | (me-> |
504 | desc.service_type & htonl (GNUNET_DNS_SERVICE_TYPE_TCP)) | 505 | desc.service_type & htonl (GNUNET_DNS_SERVICE_TYPE_TCP)) |
505 | && (port_in_ports (me->desc.ports, pkt_tcp->tcp_hdr.dpt))) | 506 | && (port_in_ports (me->desc.ports, pkt_tcp->tcp_hdr.dpt))) |
diff --git a/src/vpn/gnunet-service-dns.c b/src/vpn/gnunet-service-dns.c index bdbf7e001..271c8a772 100644 --- a/src/vpn/gnunet-service-dns.c +++ b/src/vpn/gnunet-service-dns.c | |||
@@ -1265,16 +1265,14 @@ publish_iterate (void *cls __attribute__ ((unused)), const char *section) | |||
1265 | if ((strlen (section) < 8) || | 1265 | if ((strlen (section) < 8) || |
1266 | (0 != strcmp (".gnunet.", section + (strlen (section) - 8)))) | 1266 | (0 != strcmp (".gnunet.", section + (strlen (section) - 8)))) |
1267 | return; | 1267 | return; |
1268 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1268 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Parsing dns-name %s\n", section); |
1269 | "Parsing dns-name %s\n", | ||
1270 | section); | ||
1271 | if (GNUNET_OK != | 1269 | if (GNUNET_OK != |
1272 | GNUNET_CONFIGURATION_get_value_string (cfg, section, "UDP_REDIRECTS", | 1270 | GNUNET_CONFIGURATION_get_value_string (cfg, section, "UDP_REDIRECTS", |
1273 | &udp_redirects)) | 1271 | &udp_redirects)) |
1274 | udp_redirects = NULL; | 1272 | udp_redirects = NULL; |
1275 | if (GNUNET_OK != | 1273 | if (GNUNET_OK != |
1276 | GNUNET_CONFIGURATION_get_value_string (cfg, section, "TCP_REDIRECTS", | 1274 | GNUNET_CONFIGURATION_get_value_string (cfg, section, "TCP_REDIRECTS", |
1277 | &tcp_redirects)) | 1275 | &tcp_redirects)) |
1278 | tcp_redirects = NULL; | 1276 | tcp_redirects = NULL; |
1279 | 1277 | ||
1280 | if (GNUNET_OK != | 1278 | if (GNUNET_OK != |
@@ -1307,21 +1305,21 @@ publish_iterate (void *cls __attribute__ ((unused)), const char *section) | |||
1307 | publish_name (section, ports, service_type, my_private_key); | 1305 | publish_name (section, ports, service_type, my_private_key); |
1308 | if (GNUNET_OK == | 1306 | if (GNUNET_OK == |
1309 | GNUNET_CONFIGURATION_get_value_string (cfg, section, "ALTERNATIVE_NAMES", | 1307 | GNUNET_CONFIGURATION_get_value_string (cfg, section, "ALTERNATIVE_NAMES", |
1310 | &alternative_names)) | 1308 | &alternative_names)) |
1309 | { | ||
1310 | for (alternative_name = strtok (alternative_names, " "); | ||
1311 | alternative_name != NULL; alternative_name = strtok (NULL, " ")) | ||
1311 | { | 1312 | { |
1312 | for (alternative_name = strtok (alternative_names, " "); | 1313 | char *altname = |
1313 | alternative_name != NULL; alternative_name = strtok (NULL, " ")) | 1314 | alloca (strlen (alternative_name) + strlen (section) + 1 + 1); |
1314 | { | 1315 | strcpy (altname, alternative_name); |
1315 | char *altname = | 1316 | strcpy (altname + strlen (alternative_name) + 1, section); |
1316 | alloca (strlen (alternative_name) + strlen (section) + 1 + 1); | 1317 | altname[strlen (alternative_name)] = '.'; |
1317 | strcpy (altname, alternative_name); | 1318 | |
1318 | strcpy (altname + strlen (alternative_name) + 1, section); | 1319 | publish_name (altname, ports, service_type, my_private_key); |
1319 | altname[strlen (alternative_name)] = '.'; | ||
1320 | |||
1321 | publish_name (altname, ports, service_type, my_private_key); | ||
1322 | } | ||
1323 | GNUNET_free (alternative_names); | ||
1324 | } | 1320 | } |
1321 | GNUNET_free (alternative_names); | ||
1322 | } | ||
1325 | GNUNET_CRYPTO_rsa_key_free (my_private_key); | 1323 | GNUNET_CRYPTO_rsa_key_free (my_private_key); |
1326 | GNUNET_free_non_null (udp_redirects); | 1324 | GNUNET_free_non_null (udp_redirects); |
1327 | GNUNET_free_non_null (tcp_redirects); | 1325 | GNUNET_free_non_null (tcp_redirects); |