- use proper signedness
[oweals/gnunet.git] / src / transport / plugin_transport_template.c
index feb0802d91429e06ba975694633d22e79aeb5ff4..f39db3e7961949081c3f79937bb2b4fd3acc039e 100644 (file)
@@ -223,6 +223,21 @@ template_plugin_disconnect_session (void *cls,
 }
 
 
+/**
+ * Function that is called to get the keepalive factor.
+ * GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT is divided by this number to
+ * calculate the interval between keepalive packets.
+ *
+ * @param cls closure with the `struct Plugin`
+ * @return keepalive factor
+ */
+static unsigned int
+template_plugin_query_keepalive_factor (void *cls)
+{
+  return 3;
+}
+
+
 /**
  * Function obtain the network type for a session
  *
@@ -363,6 +378,13 @@ template_plugin_get_session (void *cls,
   return NULL;
 }
 
+static void
+template_plugin_update_session_timeout (void *cls,
+                                  const struct GNUNET_PeerIdentity *peer,
+                                  struct Session *session)
+{
+
+}
 
 /**
  * Entry point for the plugin.
@@ -393,12 +415,14 @@ libgnunet_plugin_transport_template_init (void *cls)
   api->send = &template_plugin_send;
   api->disconnect_peer = &template_plugin_disconnect_peer;
   api->disconnect_session = &template_plugin_disconnect_session;
+  api->query_keepalive_factor = &template_plugin_query_keepalive_factor;
   api->address_pretty_printer = &template_plugin_address_pretty_printer;
   api->check_address = &template_plugin_address_suggested;
   api->address_to_string = &template_plugin_address_to_string;
   api->string_to_address = &template_plugin_string_to_address;
   api->get_session = &template_plugin_get_session;
   api->get_network = &template_plugin_get_network;
+  api->update_session_timeout = &template_plugin_update_session_timeout;
   LOG (GNUNET_ERROR_TYPE_INFO, "Template plugin successfully loaded\n");
   return api;
 }