-bringing copyright tags up to FSF standard
[oweals/gnunet.git] / src / transport / gnunet-service-transport_plugins.c
index e43b7057adbec29485131285b85c6a1d9420149f..3e0e6601dc0b616c63b78e6d1419bb4074a9d2a1 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of GNUnet.
-  (C) 2010-2014 Christian Grothoff (and other contributing authors)
-  
+  Copyright (C) 2010-2014 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
   by the Free Software Foundation; either version 3, or (at your
@@ -78,7 +78,6 @@ static struct TransportPlugin *plugins_head;
 static struct TransportPlugin *plugins_tail;
 
 
-
 /**
  * Load and initialize all plugins.  The respective functions will be
  * invoked by the plugins when the respective events happen.  The
@@ -86,8 +85,6 @@ static struct TransportPlugin *plugins_tail;
  * plugin that caused the call.
  *
  * @param recv_cb function to call when data is received
- * @param register_quota_cb function to call to register a quota callback
- * @param unregister_quota_cb function to call to unregister a quota callback
  * @param address_cb function to call when our public addresses changed
  * @param session_start_cb function to call when a session was created
  * @param session_end_cb function to call when a session was terminated
@@ -96,8 +93,6 @@ static struct TransportPlugin *plugins_tail;
  */
 void
 GST_plugins_load (GNUNET_TRANSPORT_PluginReceiveCallback recv_cb,
-                  GNUNET_TRANSPORT_RegisterQuotaNotification register_quota_cb,
-                  GNUNET_TRANSPORT_UnregisterQuotaNotification unregister_quota_cb,
                   GNUNET_TRANSPORT_AddressNotification address_cb,
                   GNUNET_TRANSPORT_SessionStart session_start_cb,
                   GNUNET_TRANSPORT_SessionEnd session_end_cb,
@@ -146,15 +141,13 @@ GST_plugins_load (GNUNET_TRANSPORT_PluginReceiveCallback recv_cb,
     plug->env.session_end = session_end_cb;
     plug->env.get_address_type = address_type_cb;
     plug->env.update_address_metrics = metric_update_cb;
-    plug->env.register_quota_notification = register_quota_cb;
-    plug->env.unregister_quota_notification = unregister_quota_cb;
     plug->env.max_connections = tneigh;
     plug->env.stats = GST_stats;
     GNUNET_CONTAINER_DLL_insert (plugins_head, plugins_tail, plug);
   }
   GNUNET_free (plugs);
   next = plugins_head;
-  while (next != NULL)
+  while (NULL != next)
   {
     plug = next;
     next = plug->next;
@@ -197,7 +190,7 @@ GST_plugins_load (GNUNET_TRANSPORT_PluginReceiveCallback recv_cb,
     }
     if (NULL == plug->api->check_address)
     {
-       fail = GNUNET_YES;
+      fail = GNUNET_YES;
       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                   _("Missing function `%s' in transport plugin for `%s'\n"),
                   "check_address",
@@ -205,7 +198,7 @@ GST_plugins_load (GNUNET_TRANSPORT_PluginReceiveCallback recv_cb,
     }
     if (NULL == plug->api->get_session)
     {
-       fail = GNUNET_YES;
+      fail = GNUNET_YES;
       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                   _("Missing function `%s' in transport plugin for `%s'\n"),
                   "get_session",
@@ -213,7 +206,7 @@ GST_plugins_load (GNUNET_TRANSPORT_PluginReceiveCallback recv_cb,
     }
     if (NULL == plug->api->get_network)
     {
-       fail = GNUNET_YES;
+      fail = GNUNET_YES;
       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                   _("Missing function `%s' in transport plugin for `%s'\n"),
                   "get_network",
@@ -221,7 +214,7 @@ GST_plugins_load (GNUNET_TRANSPORT_PluginReceiveCallback recv_cb,
     }
     if (NULL == plug->api->send)
     {
-       fail = GNUNET_YES;
+      fail = GNUNET_YES;
       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                   _("Missing function `%s' in transport plugin for `%s'\n"),
                   "send",
@@ -357,10 +350,7 @@ GST_plugins_a2s (const struct GNUNET_HELLO_Address *address)
   static const char *s;
 
   if (NULL == address)
-  {
-    GNUNET_break (0); /* a HELLO address cannot be NULL */
-    return "<invalid>";
-  }
+    return "<NULL>";
   if (0 == address->address_length)
     return TRANSPORT_SESSION_INBOUND_STRING; /* Addresse with length 0 are inbound, address->address itself may be NULL */
   api = GST_plugins_printer_find (address->transport_name);