diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-01-01 23:39:24 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-01-01 23:39:24 +0000 |
commit | 402a25de1ef93133c9879706071081405ade61f6 (patch) | |
tree | 96763797649dd4bff0b7f8b2010a0589f8179dcb /src/vpn/gnunet-daemon-vpn.c | |
parent | 3e73780b201b600dd8dd8725f5a628d62d9c4f51 (diff) | |
download | gnunet-402a25de1ef93133c9879706071081405ade61f6.tar.gz gnunet-402a25de1ef93133c9879706071081405ade61f6.zip |
first quick hack to extract an initial DNS service API
Diffstat (limited to 'src/vpn/gnunet-daemon-vpn.c')
-rw-r--r-- | src/vpn/gnunet-daemon-vpn.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/vpn/gnunet-daemon-vpn.c b/src/vpn/gnunet-daemon-vpn.c index 6b65b709e..86f08d19c 100644 --- a/src/vpn/gnunet-daemon-vpn.c +++ b/src/vpn/gnunet-daemon-vpn.c | |||
@@ -36,7 +36,7 @@ | |||
36 | #include "gnunet_constants.h" | 36 | #include "gnunet_constants.h" |
37 | #include <block_dns.h> | 37 | #include <block_dns.h> |
38 | #include "gnunet-daemon-vpn-helper.h" | 38 | #include "gnunet-daemon-vpn-helper.h" |
39 | #include "gnunet-daemon-vpn-dns.h" | 39 | #include "gnunet_dns_service.h" |
40 | #include "gnunet-daemon-vpn.h" | 40 | #include "gnunet-daemon-vpn.h" |
41 | #include "gnunet-vpn-checksum.h" | 41 | #include "gnunet-vpn-checksum.h" |
42 | 42 | ||
@@ -45,6 +45,13 @@ struct GNUNET_MESH_Handle *mesh_handle; | |||
45 | struct GNUNET_CONTAINER_MultiHashMap *hashmap; | 45 | struct GNUNET_CONTAINER_MultiHashMap *hashmap; |
46 | static struct GNUNET_CONTAINER_Heap *heap; | 46 | static struct GNUNET_CONTAINER_Heap *heap; |
47 | 47 | ||
48 | struct GNUNET_DNS_Handle *dns_handle; | ||
49 | |||
50 | struct answer_packet_list *answer_proc_head; | ||
51 | |||
52 | struct answer_packet_list *answer_proc_tail; | ||
53 | |||
54 | |||
48 | struct tunnel_notify_queue | 55 | struct tunnel_notify_queue |
49 | { | 56 | { |
50 | struct tunnel_notify_queue *next; | 57 | struct tunnel_notify_queue *next; |
@@ -87,12 +94,7 @@ cleanup (void *cls GNUNET_UNUSED, | |||
87 | cleanup_helper (helper_handle); | 94 | cleanup_helper (helper_handle); |
88 | 95 | ||
89 | /* close the connection to the service-dns */ | 96 | /* close the connection to the service-dns */ |
90 | if (dns_connection != NULL) | 97 | GNUNET_DNS_disconnect (dns_handle); |
91 | { | ||
92 | GNUNET_CLIENT_disconnect (dns_connection, GNUNET_NO); | ||
93 | dns_connection = NULL; | ||
94 | } | ||
95 | |||
96 | if (mesh_handle != NULL) | 98 | if (mesh_handle != NULL) |
97 | { | 99 | { |
98 | GNUNET_MESH_disconnect (mesh_handle); | 100 | GNUNET_MESH_disconnect (mesh_handle); |
@@ -1258,13 +1260,14 @@ run (void *cls, char *const *args GNUNET_UNUSED, | |||
1258 | GNUNET_MESH_connect (cfg_, 42, NULL, new_tunnel, cleaner, handlers, | 1260 | GNUNET_MESH_connect (cfg_, 42, NULL, new_tunnel, cleaner, handlers, |
1259 | types); | 1261 | types); |
1260 | cfg = cfg_; | 1262 | cfg = cfg_; |
1261 | restart_hijack = 0; | ||
1262 | hashmap = GNUNET_CONTAINER_multihashmap_create (65536); | 1263 | hashmap = GNUNET_CONTAINER_multihashmap_create (65536); |
1263 | heap = GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN); | 1264 | heap = GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN); |
1264 | GNUNET_CONFIGURATION_get_value_number (cfg, "vpn", "MAX_MAPPINGg", | 1265 | GNUNET_CONFIGURATION_get_value_number (cfg, "vpn", "MAX_MAPPINGg", |
1265 | &max_mappings); | 1266 | &max_mappings); |
1266 | udp_connections = GNUNET_CONTAINER_multihashmap_create (65536); | 1267 | udp_connections = GNUNET_CONTAINER_multihashmap_create (65536); |
1267 | conn_task = GNUNET_SCHEDULER_add_now (connect_to_service_dns, NULL); | 1268 | dns_handle = GNUNET_DNS_connect (cfg, |
1269 | &process_answer, | ||
1270 | NULL); | ||
1268 | shs_task = | 1271 | shs_task = |
1269 | GNUNET_SCHEDULER_add_after (conn_task, start_helper_and_schedule, NULL); | 1272 | GNUNET_SCHEDULER_add_after (conn_task, start_helper_and_schedule, NULL); |
1270 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &cleanup, cls); | 1273 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &cleanup, cls); |