Merge branch 'master' of gnunet.org:gnunet
[oweals/gnunet.git] / src / include / gnunet_tun_lib.h
index 822a661cfb2fddde79fbcde3d3953954ef95fc4b..11c43e8b74b80b6ad21461d4f5c94b31c18e2e7a 100644 (file)
@@ -2,20 +2,20 @@
      This file is part of GNUnet.
      Copyright (C) 2010-2013 Christian Grothoff
 
-     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
 */
 
 /**
@@ -32,7 +32,8 @@
 #ifndef GNUNET_TUN_LIB_H
 #define GNUNET_TUN_LIB_H
 
-#include "gnunet_util_lib.h"
+#include "gnunet_common.h"
+#include "gnunet_crypto_lib.h"
 
 
 /* see http://www.iana.org/assignments/ethernet-numbers */
@@ -57,6 +58,7 @@
  * 8 bytes for IPv4, 4 bytes for port, 1 byte for "4", 2 bytes for "-",
  * one byte for 0-termination.
  */
+
 #define GNUNET_TUN_IPV4_REGEXLEN 16
 
 
@@ -917,6 +919,20 @@ GNUNET_TUN_service_name_to_hash (const char *service_name,
                                  struct GNUNET_HashCode *hc);
 
 
+/**
+ * Check if two sockaddrs are equal.
+ *
+ * @param sa one address
+ * @param sb another address
+ * @param include_port also check ports
+ * @return #GNUNET_YES if they are equal
+ */
+int
+GNUNET_TUN_sockaddr_cmp (const struct sockaddr *sa,
+                         const struct sockaddr *sb,
+                         int include_port);
+
+
 /**
  * Compute the CADET port given a service descriptor
  * (returned from #GNUNET_TUN_service_name_to_hash) and