REST: nothing triggers rest
[oweals/gnunet.git] / src / nat / nat.h
index 9ab402c1dd02e4fab75c6d5ed9bb489715ea8756..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
 
 /**
@@ -76,22 +77,16 @@ enum GNUNET_NAT_RegisterFlags
    */
   GNUNET_NAT_RF_NONE = 0,
 
-  /**
-   * This client wants to be informed about our IPv4 address
-   * changing.
-   */
-  GNUNET_NAT_RF_IPV4 = 1,
-
   /**
    * This client wants to be informed about changes to our
-   * external addresses.
+   * applicable addresses.
    */
-  GNUNET_NAT_RF_ADDRESSES = 2,
+  GNUNET_NAT_RF_ADDRESSES = 1,
 
   /**
    * This client supports address reversal.
    */
-  GNUNET_NAT_RF_REVERSAL = 4
+  GNUNET_NAT_RF_REVERSAL = 2
 };
 
 
@@ -108,18 +103,18 @@ struct GNUNET_NAT_RegisterMessage
   /**
    * An `enum GNUNET_NAT_RegisterFlags`.
    */
-  uint8_t flags GNUNET_PACKED;
+  uint8_t flags;
 
   /**
    * Client's IPPROTO, e.g. IPPROTO_UDP or IPPROTO_TCP.
    */
-  uint8_t proto GNUNET_PACKED;
+  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.
@@ -130,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 */
   
 };
 
@@ -197,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` */
   
 };
 
@@ -230,126 +215,12 @@ struct GNUNET_NAT_AddressChangeNotificationMessage
    */ 
   int32_t add_remove GNUNET_PACKED;
 
-  /* followed by a `struct sockaddr` */
-  
-};
-
-
-/**
- * Service notifying the client about a change of our
- * known external IPv4 address.
- */
-struct GNUNET_NAT_Ipv4ChangeNotificationMessage
-{
-  /**
-   * Header with type #GNUNET_MESSAGE_TYPE_NAT_IPV4_CHANGE
-   */
-  struct GNUNET_MessageHeader header;
-
-  /**
-   * #GNUNET_YES to add, #GNUNET_NO to remove the address from the list.
-   */ 
-  int32_t add_remove GNUNET_PACKED;
-
-  /**
-   * IPv4 address affected.
-   */
-  struct in_addr addr GNUNET_PACKED;
-  
-};
-
-
-/**
- * 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.
+   * Type of the address, an `enum GNUNET_NAT_AddressClass` 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
-   */
-  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) */
 };