REST: nothing triggers rest
[oweals/gnunet.git] / src / nat / nat.h
index debe011ef32106e39c72ff21321645f7e3361d62..86de3c2f637e23dfa48cf9c374e48d05fecda3c7 100644 (file)
@@ -2,20 +2,20 @@
      This file is part of GNUnet.
      Copyright (C) 2011, 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
 */
 
 /**
@@ -29,6 +29,7 @@
 #include "gnunet_util_lib.h"
 
 
+
 GNUNET_NETWORK_STRUCT_BEGIN
 
 /**
@@ -78,7 +79,7 @@ enum GNUNET_NAT_RegisterFlags
 
   /**
    * This client wants to be informed about changes to our
-   * external addresses.
+   * applicable addresses.
    */
   GNUNET_NAT_RF_ADDRESSES = 1,
 
@@ -110,10 +111,10 @@ struct GNUNET_NAT_RegisterMessage
   uint8_t proto;
 
   /**
-   * Port we would like as we are configured to use this one for
-   * advertising (in addition to the one we are binding to).
+   * Number of bytes in the string that follow which
+   * specifies a section name in the configuration.
    */
-  uint16_t adv_port GNUNET_PACKED;
+  uint16_t str_len GNUNET_PACKED;
 
   /**
    * Number of addresses that this service is bound to that follow.
@@ -124,6 +125,8 @@ struct GNUNET_NAT_RegisterMessage
 
   /* Followed by @e num_addrs addresses of type 'struct
      sockaddr' */
+
+  /* Followed by @e str_len section name to use for options */
   
 };
 
@@ -191,19 +194,7 @@ struct GNUNET_NAT_ConnectionReversalRequestedMessage
    */
   struct GNUNET_MessageHeader header;
 
-  /**
-   * Size of the local address where we received the request, in NBO.
-   */
-  uint16_t local_addr_size;
-
-  /**
-   * Size of the remote address making the request, in NBO.
-   */
-  uint16_t remote_addr_size;
-
-  /* followed by a `struct sockaddr` of @e local_addr_size bytes */
-
-  /* followed by a `struct sockaddr` of @e remote_addr_size bytes */
+  /* followed by a `struct sockaddr_in` */
   
 };
 
@@ -224,102 +215,12 @@ struct GNUNET_NAT_AddressChangeNotificationMessage
    */ 
   int32_t add_remove GNUNET_PACKED;
 
-  /* followed by a `struct sockaddr` */
-  
-};
-
-
-/**
- * Client requesting test of network connectivity.
- */
-struct GNUNET_NAT_RequestTestMessage
-{
-  /**
-   * Header with type #GNUNET_MESSAGE_TYPE_NAT_REQUEST_TEST
-   */
-  struct GNUNET_MessageHeader header;
-
-  /**
-   * Port to bind to, in NBO
-   */
-  uint16_t bind_port GNUNET_PACKED;
-
-  /**
-   * Port external verifier should try to connect to, in NBO.
-   */
-  uint16_t extern_port GNUNET_PACKED;
-
-  /**
-   * IPv4 to bind to, in NBO.
-   */
-  struct in_addr bind_ip GNUNET_PACKED;
-
-  /**
-   * IPv4 external verifier should try to connect to, in NBO.
-   */
-  struct in_addr extern_ip GNUNET_PACKED;
-  
-  /**
-   * IP protocol to use, i.e. IPPROTO_UDP or IPPROTO_TCP.
-   */
-  uint8_t proto;
-
-};
-
-
-/**
- * Service responding with network connectivity test result.
- */
-struct GNUNET_NAT_TestResultMessage
-{
-  /**
-   * Header with type #GNUNET_MESSAGE_TYPE_NAT_TEST_RESULT
-   */
-  struct GNUNET_MessageHeader header;
-
-  /**
-   * An `enum GNUNET_NAT_StatusCode` in NBO.
-   */
-  int32_t status_code GNUNET_PACKED;
-};
-
-
-/**
- * Client requesting automatic configuration.
- */
-struct GNUNET_NAT_AutoconfigRequestMessage
-{
   /**
-   * Header with type #GNUNET_MESSAGE_TYPE_NAT_REQUEST_AUTO_CFG
+   * Type of the address, an `enum GNUNET_NAT_AddressClass` in NBO.
    */
-  struct GNUNET_MessageHeader header;
-
-  /* Followed by configuration (diff, serialized, compressed) */
-  
-};
-
-
-/**
- * Service responding with proposed configuration.
- */
-struct GNUNET_NAT_AutoconfigResultMessage
-{
-  /**
-   * Header with type #GNUNET_MESSAGE_TYPE_NAT_AUTO_CFG_RESULT
-   */
-  struct GNUNET_MessageHeader header;
+  uint32_t addr_class GNUNET_PACKED;
+  /* followed by a `struct sockaddr` */
   
-  /**
-   * An `enum GNUNET_NAT_StatusCode` in NBO.
-   */
-  int32_t status_code GNUNET_PACKED;
-
-  /**
-   * An `enum GNUNET_NAT_Type` in NBO.
-   */
-  int32_t type GNUNET_PACKED;
-
-  /* Followed by configuration (diff, serialized, compressed) */
 };