preparations for keepalives
authorChristian Grothoff <christian@grothoff.org>
Wed, 25 Jan 2017 19:38:18 +0000 (20:38 +0100)
committerChristian Grothoff <christian@grothoff.org>
Wed, 25 Jan 2017 19:38:18 +0000 (20:38 +0100)
src/cadet/gnunet-service-cadet-new.c
src/cadet/gnunet-service-cadet-new.h
src/cadet/gnunet-service-cadet-new_tunnels.c

index 97489f3fd64c1c139aa1ec1e822d05cade19635c..af5ac13aea0b681ce320aff0328174190d01c9a7 100644 (file)
@@ -183,6 +183,11 @@ unsigned long long ratchet_messages;
  */
 struct GNUNET_TIME_Relative ratchet_time;
 
+/**
+ * How frequently do we send KEEPALIVE messages on idle connections?
+ */
+struct GNUNET_TIME_Relative keepalive_period;
+
 
 /**
  * Send a message to a client.
@@ -1335,6 +1340,18 @@ run (void *cls,
                                "need delay value");
     ratchet_time = GNUNET_TIME_UNIT_HOURS;
   }
+  if (GNUNET_OK !=
+      GNUNET_CONFIGURATION_get_value_time (c,
+                                           "CADET",
+                                           "REFRESHC_CONNECTION_TIME",
+                                           &keepalive_period))
+  {
+    GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_WARNING,
+                               "CADET",
+                               "REFRESH_CONNECTION_TIME",
+                               "need delay value");
+    keepalive_period = GNUNET_TIME_UNIT_MINUTES;
+  }
 
   my_private_key = GNUNET_CRYPTO_eddsa_key_create_from_configuration (c);
   if (NULL == my_private_key)
index 4a76c578b4ac018a8254b1f6ef75aaa1b8901f5f..721044ac425dc0e67d5f64d9fdc98e59cae8d40c 100644 (file)
@@ -225,6 +225,11 @@ extern unsigned long long ratchet_messages;
  */
 extern struct GNUNET_TIME_Relative ratchet_time;
 
+/**
+ * How frequently do we send KEEPALIVE messages on idle connections?
+ */
+extern struct GNUNET_TIME_Relative keepalive_period;
+
 /**
  * Signal that shutdown is happening: prevent recovery measures.
  */
index fd833548661b15082f3b1cb59204a131cbd11f78..3420c00dbb9b766d109348edbc7655534f001d41 100644 (file)
@@ -24,6 +24,8 @@
  * @author Christian Grothoff
  *
  * FIXME:
+ * - implement keepalive
+ * - implement rekeying
  * - check KX estate machine -- make sure it is never stuck!
  * - clean up KX logic, including adding sender authentication
  * - implement connection management (evaluate, kill old ones,