aboutsummaryrefslogtreecommitdiff
path: root/src/vpn
diff options
context:
space:
mode:
authorPhilipp Tölke <toelke@in.tum.de>2011-04-21 13:44:49 +0000
committerPhilipp Tölke <toelke@in.tum.de>2011-04-21 13:44:49 +0000
commite03fb9e56eb3d9a9f0105db2d51ea9a52222819e (patch)
treeed79e4d1828046cc135c6d8c3aa0bbb22ff3bea8 /src/vpn
parent8d33b3f3ecd98f6d79633b0e259f624ad976b698 (diff)
downloadgnunet-e03fb9e56eb3d9a9f0105db2d51ea9a52222819e.tar.gz
gnunet-e03fb9e56eb3d9a9f0105db2d51ea9a52222819e.zip
cleanup
Diffstat (limited to 'src/vpn')
-rw-r--r--src/vpn/gnunet-daemon-vpn.c8
-rw-r--r--src/vpn/gnunet-service-dns.c27
2 files changed, 16 insertions, 19 deletions
diff --git a/src/vpn/gnunet-daemon-vpn.c b/src/vpn/gnunet-daemon-vpn.c
index e835fbcfa..885c77aad 100644
--- a/src/vpn/gnunet-daemon-vpn.c
+++ b/src/vpn/gnunet-daemon-vpn.c
@@ -560,14 +560,6 @@ receive_tcp_back (void *cls, struct GNUNET_MESH_Tunnel* tunnel,
560 return GNUNET_OK; 560 return GNUNET_OK;
561} 561}
562 562
563void init_mesh (void* cls, struct GNUNET_MESH_Handle* server, const struct GNUNET_PeerIdentity* my_identity, const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *pubkey) {
564 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Connected to MESH, I am %x\n", *((unsigned long*)my_identity));
565}
566
567void connect_mesh (void* cls, const struct GNUNET_PeerIdentity* peer, const struct GNUNET_TRANSPORT_ATS_Information *atsi) {
568 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Connected to peer %x\n", *((unsigned long*)peer));
569}
570
571/** 563/**
572 * Main function that will be run by the scheduler. 564 * Main function that will be run by the scheduler.
573 * 565 *
diff --git a/src/vpn/gnunet-service-dns.c b/src/vpn/gnunet-service-dns.c
index 9fb88bed2..d861e32b2 100644
--- a/src/vpn/gnunet-service-dns.c
+++ b/src/vpn/gnunet-service-dns.c
@@ -257,6 +257,9 @@ send_mesh_query (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
257 257
258static void 258static void
259send_rev_query(void * cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { 259send_rev_query(void * cls, const struct GNUNET_SCHEDULER_TaskContext *tc) {
260 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
261 return;
262
260 struct dns_pkt_parsed* pdns = (struct dns_pkt_parsed*) cls; 263 struct dns_pkt_parsed* pdns = (struct dns_pkt_parsed*) cls;
261 264
262 unsigned short id = pdns->s.id; 265 unsigned short id = pdns->s.id;
@@ -504,7 +507,8 @@ receive_query(void *cls,
504 } 507 }
505 508
506 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Query for '%s'; namelen=%d\n", pdns->queries[0]->name, pdns->queries[0]->namelen); 509 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Query for '%s'; namelen=%d\n", pdns->queries[0]->name, pdns->queries[0]->namelen);
507 /* The query is for a PTR of a previosly resolved virtual IP */ 510
511 /* This is a PTR-Query. Check if it is for "our" network */
508 if (htons(pdns->queries[0]->qtype) == 12 && 512 if (htons(pdns->queries[0]->qtype) == 12 &&
509 74 == pdns->queries[0]->namelen) 513 74 == pdns->queries[0]->namelen)
510 { 514 {
@@ -973,10 +977,11 @@ run (void *cls,
973 const struct GNUNET_CONFIGURATION_Handle *cfg_) 977 const struct GNUNET_CONFIGURATION_Handle *cfg_)
974{ 978{
975 static const struct GNUNET_SERVER_MessageHandler handlers[] = { 979 static const struct GNUNET_SERVER_MessageHandler handlers[] = {
976 /* callback, cls, type, size */ 980 /* callback, cls, type, size */
977 {&receive_query, NULL, GNUNET_MESSAGE_TYPE_LOCAL_QUERY_DNS, 0}, 981 {&receive_query, NULL, GNUNET_MESSAGE_TYPE_LOCAL_QUERY_DNS, 0},
978 {&rehijack, NULL, GNUNET_MESSAGE_TYPE_REHIJACK, sizeof(struct GNUNET_MessageHeader)}, 982 {&rehijack, NULL, GNUNET_MESSAGE_TYPE_REHIJACK,
979 {NULL, NULL, 0, 0} 983 sizeof (struct GNUNET_MessageHeader)},
984 {NULL, NULL, 0, 0}
980 }; 985 };
981 986
982 987
@@ -995,20 +1000,20 @@ run (void *cls,
995 cfg = cfg_; 1000 cfg = cfg_;
996 1001
997 unsigned int i; 1002 unsigned int i;
998 for (i = 0; i < 65536; i++) { 1003 for (i = 0; i < 65536; i++)
1004 {
999 query_states[i].valid = GNUNET_NO; 1005 query_states[i].valid = GNUNET_NO;
1000 } 1006 }
1001 1007
1002 dht = GNUNET_DHT_connect(cfg, 1024); 1008 dht = GNUNET_DHT_connect (cfg, 1024);
1003 1009
1004 open_port(); 1010 open_port ();
1005 1011
1006 GNUNET_SCHEDULER_add_now (publish_names, NULL); 1012 GNUNET_SCHEDULER_add_now (publish_names, NULL);
1007 1013
1008 GNUNET_SERVER_add_handlers (server, handlers); 1014 GNUNET_SERVER_add_handlers (server, handlers);
1009 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, 1015 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
1010 &cleanup_task, 1016 &cleanup_task, cls);
1011 cls);
1012} 1017}
1013 1018
1014/** 1019/**