uncrustify as demanded.
[oweals/gnunet.git] / src / testbed / testbed_api_underlay.c
index 5cc8d8597f5dafc6666fcf53e97d3366c9f1dd7d..b0c712ca616bf9d04549015a7a9eed7f327f5073 100644 (file)
@@ -1,22 +1,22 @@
 /*
-  This file is part of GNUnet.
-  Copyright (C) 2008--2013 GNUnet e.V.
-
-  GNUnet is free software: you can redistribute it and/or modify it
-  under the terms of the GNU Affero General Public License as published
-  by the Free Software Foundation, either version 3 of the License,
-  or (at your option) any later version.
-
-  GNUnet is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Affero General Public License for more details.
-  You should have received a copy of the GNU Affero General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+   This file is part of GNUnet.
+   Copyright (C) 2008--2013 GNUnet e.V.
+
+   GNUnet is free software: you can redistribute it and/or modify it
+   under the terms of the GNU Affero General Public License as published
+   by the Free Software Foundation, either version 3 of the License,
+   or (at your option) any later version.
+
+   GNUnet is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Affero General Public License for more details.
+
+   You should have received a copy of the GNU Affero General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
      SPDX-License-Identifier: AGPL3.0-or-later
-*/
+ */
 
 /**
  * @file testbed/testbed_api_underlay.c
@@ -30,8 +30,7 @@
 /**
  * An underlay link
  */
-struct LinkProperty
-{
+struct LinkProperty {
   /**
    * next pointer for list
    */
@@ -62,8 +61,7 @@ struct LinkProperty
 /**
  * Container for holding a peer in whitelist/blacklist
  */
-struct ListEntry
-{
+struct ListEntry {
   /**
    * the next pointer
    */
@@ -80,8 +78,7 @@ struct ListEntry
  * Model for configuring underlay links of a peer
  * @ingroup underlay
  */
-struct GNUNET_TESTBED_UnderlayLinkModel
-{
+struct GNUNET_TESTBED_UnderlayLinkModel {
   /**
    * The peer associated with this model
    */
@@ -110,15 +107,15 @@ struct GNUNET_TESTBED_UnderlayLinkModel
  * @param model the model
  */
 static void
-free_entries (struct GNUNET_TESTBED_UnderlayLinkModel *model)
+free_entries(struct GNUNET_TESTBED_UnderlayLinkModel *model)
 {
   struct ListEntry *e;
 
   while (NULL != (e = model->entries))
-  {
-    model->entries = e->next;
-    GNUNET_free (e);
-  }
+    {
+      model->entries = e->next;
+      GNUNET_free(e);
+    }
 }
 
 
@@ -128,15 +125,15 @@ free_entries (struct GNUNET_TESTBED_UnderlayLinkModel *model)
  * @param model the model
  */
 static void
-free_link_properties (struct GNUNET_TESTBED_UnderlayLinkModel *model)
+free_link_properties(struct GNUNET_TESTBED_UnderlayLinkModel *model)
 {
   struct LinkProperty *p;
 
   while (NULL != (p = model->props))
-  {
-    model->props = p->next;
-    GNUNET_free (p);
-  }
+    {
+      model->props = p->next;
+      GNUNET_free(p);
+    }
 }
 
 
@@ -150,13 +147,13 @@ free_link_properties (struct GNUNET_TESTBED_UnderlayLinkModel *model)
  * @return the model
  */
 struct GNUNET_TESTBED_UnderlayLinkModel *
-GNUNET_TESTBED_underlaylinkmodel_create (struct GNUNET_TESTBED_Peer *peer,
-                                         enum GNUNET_TESTBED_UnderlayLinkModelType type)
+GNUNET_TESTBED_underlaylinkmodel_create(struct GNUNET_TESTBED_Peer *peer,
+                                        enum GNUNET_TESTBED_UnderlayLinkModelType type)
 {
   struct GNUNET_TESTBED_UnderlayLinkModel *m;
 
-  GNUNET_assert (0 == peer->underlay_model_exists);
-  m = GNUNET_new (struct GNUNET_TESTBED_UnderlayLinkModel);
+  GNUNET_assert(0 == peer->underlay_model_exists);
+  m = GNUNET_new(struct GNUNET_TESTBED_UnderlayLinkModel);
   peer->underlay_model_exists = 1;
   m->type = type;
   return m;
@@ -173,12 +170,12 @@ GNUNET_TESTBED_underlaylinkmodel_create (struct GNUNET_TESTBED_Peer *peer,
  * @param peer the peer to add
  */
 void
-GNUNET_TESTBED_underlaylinkmodel_add_peer (struct GNUNET_TESTBED_UnderlayLinkModel *model,
-                                           struct GNUNET_TESTBED_Peer *peer)
+GNUNET_TESTBED_underlaylinkmodel_add_peer(struct GNUNET_TESTBED_UnderlayLinkModel *model,
+                                          struct GNUNET_TESTBED_Peer *peer)
 {
   struct ListEntry *entry;
 
-  entry = GNUNET_new (struct ListEntry);
+  entry = GNUNET_new(struct ListEntry);
   entry->peer = peer;
   entry->next = model->entries;
   model->entries = entry;
@@ -197,15 +194,15 @@ GNUNET_TESTBED_underlaylinkmodel_add_peer (struct GNUNET_TESTBED_UnderlayLinkMod
  * @param bandwidth bandwidth of the link in kilobytes per second [kB/s]
  */
 void
-GNUNET_TESTBED_underlaylinkmodel_set_link (struct GNUNET_TESTBED_UnderlayLinkModel *model,
-                                           struct GNUNET_TESTBED_Peer *peer,
-                                           uint32_t latency,
-                                           uint32_t loss,
-                                           uint32_t bandwidth)
+GNUNET_TESTBED_underlaylinkmodel_set_link(struct GNUNET_TESTBED_UnderlayLinkModel *model,
+                                          struct GNUNET_TESTBED_Peer *peer,
+                                          uint32_t latency,
+                                          uint32_t loss,
+                                          uint32_t bandwidth)
 {
   struct LinkProperty *prop;
 
-  prop = GNUNET_new (struct LinkProperty);
+  prop = GNUNET_new(struct LinkProperty);
   prop->peer = peer;
   prop->latency = latency;
   prop->loss = loss;
@@ -224,12 +221,12 @@ GNUNET_TESTBED_underlaylinkmodel_set_link (struct GNUNET_TESTBED_UnderlayLinkMod
  * @param model the model to unallocate
  */
 void
-GNUNET_TESTBED_underlaylinkmodel_free (struct GNUNET_TESTBED_UnderlayLinkModel *model)
+GNUNET_TESTBED_underlaylinkmodel_free(struct GNUNET_TESTBED_UnderlayLinkModel *model)
 {
   model->peer->underlay_model_exists = 0;
-  free_entries (model);
-  free_link_properties (model);
-  gnunet_free (model);
+  free_entries(model);
+  free_link_properties(model);
+  gnunet_free(model);
 }
 
 
@@ -240,12 +237,12 @@ GNUNET_TESTBED_underlaylinkmodel_free (struct GNUNET_TESTBED_UnderlayLinkModel *
  * @param model the model to commit
  */
 void
-GNUNET_TESTBED_underlaylinkmodel_commit (struct GNUNET_TESTBED_UnderlayLinkModel *model)
+GNUNET_TESTBED_underlaylinkmodel_commit(struct GNUNET_TESTBED_UnderlayLinkModel *model)
 {
   /* FIXME: Marshal the model into a message */
-  GNUNET_break (0);
+  GNUNET_break(0);
   /* do not reset the value of model->peer->underlay_model_exists */
-  free_entries (model);
-  free_link_properties (model);
-  GNUNET_free (model);
+  free_entries(model);
+  free_link_properties(model);
+  GNUNET_free(model);
 }