REST/NAMESTORE: rework API
[oweals/gnunet.git] / src / transport / plugin_transport_template.c
index 7c8bc3cba3ceeb45c941d4a74a2297e458f031a8..8ec2c39920a7a70972c01756f57568153815040d 100644 (file)
@@ -1,21 +1,21 @@
 /*
      This file is part of GNUnet
-     Copyright (C) 2002-2014 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2002-2014 GNUnet e.V.
 
-     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
-     option) any later version.
+     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
-     General Public License for more details.
+     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/>.
 
-     You should have received a copy of the GNU General Public License
-     along with GNUnet; see the file COPYING.  If not, write to the
-     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-     Boston, MA 02110-1301, USA.
+     SPDX-License-Identifier: AGPL3.0-or-later
 */
 
 /**
@@ -51,7 +51,7 @@ struct Plugin;
 /**
  * Session handle for connections.
  */
-struct Session
+struct GNUNET_ATS_Session
 {
   /**
    * To whom are we talking to (set to our identity
@@ -62,7 +62,7 @@ struct Session
   /**
    * Stored in a linked list (or a peer map, or ...)
    */
-  struct Session *next;
+  struct GNUNET_ATS_Session *next;
 
   /**
    * Pointer to the global plugin struct.
@@ -132,7 +132,7 @@ struct Plugin
   /**
    * List of open sessions (or peer map, or...)
    */
-  struct Session *sessions;
+  struct GNUNET_ATS_Session *sessions;
 
   /**
    * Function to call about session status changes.
@@ -162,7 +162,7 @@ struct Plugin
  */
 static void
 notify_session_monitor (struct Plugin *plugin,
-                        struct Session *session,
+                        struct GNUNET_ATS_Session *session,
                         enum GNUNET_TRANSPORT_SessionState state)
 {
   struct GNUNET_TRANSPORT_SessionInfo info;
@@ -213,7 +213,7 @@ notify_session_monitor (struct Plugin *plugin,
  */
 static ssize_t
 template_plugin_send (void *cls,
-                      struct Session *session,
+                      struct GNUNET_ATS_Session *session,
                       const char *msgbuf,
                       size_t msgbuf_size,
                       unsigned int priority,
@@ -256,7 +256,7 @@ template_plugin_disconnect_peer (void *cls,
  */
 static int
 template_plugin_disconnect_session (void *cls,
-                                    struct Session *session)
+                                    struct GNUNET_ATS_Session *session)
 {
   // struct Plugin *plugin = cls;
   // FIXME
@@ -286,12 +286,12 @@ template_plugin_query_keepalive_factor (void *cls)
  * @param session the session
  * @return the network type in HBO or #GNUNET_SYSERR
  */
-static enum GNUNET_ATS_Network_Type
+static enum GNUNET_NetworkType
 template_plugin_get_network (void *cls,
-                            struct Session *session)
+                            struct GNUNET_ATS_Session *session)
 {
   GNUNET_assert (NULL != session);
-  return GNUNET_ATS_NET_UNSPECIFIED; /* Change to correct network type */
+  return GNUNET_NT_UNSPECIFIED; /* Change to correct network type */
 }
 
 
@@ -302,11 +302,11 @@ template_plugin_get_network (void *cls,
  * @param address the address
  * @return the network type
  */
-static enum GNUNET_ATS_Network_Type
+static enum GNUNET_NetworkType
 template_plugin_get_network_for_address (void *cls,
                                          const struct GNUNET_HELLO_Address *address)
 {
-  return GNUNET_ATS_NET_WAN; /* FOR NOW */
+  return GNUNET_NT_WAN; /* FOR NOW */
 }
 
 
@@ -423,7 +423,7 @@ template_plugin_string_to_address (void *cls,
  * @param address pointer to the GNUNET_HELLO_Address
  * @return the session if the address is valid, NULL otherwise
  */
-static struct Session *
+static struct GNUNET_ATS_Session *
 template_plugin_get_session (void *cls,
                         const struct GNUNET_HELLO_Address *address)
 {
@@ -435,7 +435,7 @@ template_plugin_get_session (void *cls,
 static void
 template_plugin_update_session_timeout (void *cls,
                                         const struct GNUNET_PeerIdentity *peer,
-                                        struct Session *session)
+                                        struct GNUNET_ATS_Session *session)
 {
 
 }
@@ -448,7 +448,7 @@ template_plugin_update_session_timeout (void *cls,
  *
  * @param cls the `struct Plugin` with the monitor callback (`sic`)
  * @param peer peer we send information about
- * @param value our `struct Session` to send information about
+ * @param value our `struct GNUNET_ATS_Session` to send information about
  * @return #GNUNET_OK (continue to iterate)
  */
 static int
@@ -457,7 +457,7 @@ send_session_info_iter (void *cls,
                         void *value)
 {
   struct Plugin *plugin = cls;
-  struct Session *session = value;
+  struct GNUNET_ATS_Session *session = value;
 
   notify_session_monitor (plugin,
                           session,