Start implementation of some functions.
[oweals/gnunet.git] / src / dht / gnunet-service-dht.c
index 72575acaefa0b10e69fb21da4cc8536efb7bb22f..9df116b472ec882c0f520a463eb902aa8d1536e6 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2009, 2010, 2011 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2009, 2010, 2011 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -66,12 +66,16 @@ struct GNUNET_MessageHeader *GDS_my_hello;
  */
 struct GNUNET_TRANSPORT_Handle *GDS_transport_handle;
 
-
 /**
  * Handle to get our current HELLO.
  */
 static struct GNUNET_TRANSPORT_GetHelloHandle *ghh;
 
+/**
+ * Hello address expiration
+ */
+struct GNUNET_TIME_Relative hello_expiration;
+
 
 /**
  * Receive the HELLO from transport service, free current and replace
@@ -141,6 +145,11 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
      const struct GNUNET_CONFIGURATION_Handle *c)
 {
   GDS_cfg = c;
+  if (GNUNET_OK !=
+      GNUNET_CONFIGURATION_get_value_time (c, "transport", "HELLO_EXPIRATION", &hello_expiration))
+  {
+    hello_expiration = GNUNET_CONSTANTS_HELLO_ADDRESS_EXPIRATION;
+  }
   GDS_block_context = GNUNET_BLOCK_context_create (GDS_cfg);
   GDS_stats = GNUNET_STATISTICS_create ("dht", GDS_cfg);
   GDS_ROUTING_init ();