REST/NAMESTORE: rework API
[oweals/gnunet.git] / src / transport / transport_api_hello_get.c
index 9d4209e048608576709bff0c9d7dd56234b97e33..a4d55b4306f5267abc5bf47c5178864e55aa65dc 100644 (file)
@@ -2,20 +2,20 @@
      This file is part of GNUnet.
      Copyright (C) 2009-2013, 2016 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
 */
 
 /**
@@ -77,7 +77,7 @@ struct GNUNET_TRANSPORT_HelloGetHandle
   /**
    * Type of HELLOs client cares about.
    */
-  enum GNUNET_ATS_Network_Type nt;
+  enum GNUNET_TRANSPORT_AddressClass ac;
 };
 
 
@@ -167,12 +167,12 @@ mq_error_handler (void *cls,
 static void
 reconnect (void *cls)
 {
-  GNUNET_MQ_hd_var_size (hello,
-                         GNUNET_MESSAGE_TYPE_HELLO,
-                         struct GNUNET_MessageHeader);
   struct GNUNET_TRANSPORT_HelloGetHandle *ghh = cls;
   struct GNUNET_MQ_MessageHandler handlers[] = {
-    make_hello_handler (ghh),
+    GNUNET_MQ_hd_var_size (hello,
+                           GNUNET_MESSAGE_TYPE_HELLO,
+                           struct GNUNET_MessageHeader,
+                           ghh),
     GNUNET_MQ_handler_end ()
   };
   struct GNUNET_MQ_Envelope *env;
@@ -182,7 +182,7 @@ reconnect (void *cls)
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Connecting to transport service.\n");
   GNUNET_assert (NULL == ghh->mq);
-  ghh->mq = GNUNET_CLIENT_connecT (ghh->cfg,
+  ghh->mq = GNUNET_CLIENT_connect (ghh->cfg,
                                    "transport",
                                    handlers,
                                    &mq_error_handler,
@@ -219,7 +219,7 @@ schedule_reconnect (struct GNUNET_TRANSPORT_HelloGetHandle *ghh)
  * is never called synchronously.
  *
  * @param cfg configuration
- * @param nt which network type should the addresses from the HELLO belong to?
+ * @param ac which network type should the addresses from the HELLO belong to?
  * @param rec function to call with the HELLO, sender will be our peer
  *            identity; message and sender will be NULL on timeout
  *            (handshake with transport service pending/failed).
@@ -229,7 +229,7 @@ schedule_reconnect (struct GNUNET_TRANSPORT_HelloGetHandle *ghh)
  */
 struct GNUNET_TRANSPORT_HelloGetHandle *
 GNUNET_TRANSPORT_hello_get (const struct GNUNET_CONFIGURATION_Handle *cfg,
-                            enum GNUNET_ATS_Network_Type nt,
+                            enum GNUNET_TRANSPORT_AddressClass ac,
                             GNUNET_TRANSPORT_HelloUpdateCallback rec,
                             void *rec_cls)
 {
@@ -239,7 +239,7 @@ GNUNET_TRANSPORT_hello_get (const struct GNUNET_CONFIGURATION_Handle *cfg,
   ghh->rec = rec;
   ghh->rec_cls = rec_cls;
   ghh->cfg = cfg;
-  ghh->nt = nt;
+  ghh->ac = ac;
   reconnect (ghh);
   if (NULL == ghh->mq)
   {