This file is part of GNUnet.
Copyright (C) 2001-2017 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
*/
/**
#define GNUNET_SERVICE_CADET_H
#include "gnunet_util_lib.h"
-#define NEW_CADET 1
#include "cadet_protocol.h"
/**
};
+/**
+ * Port opened by a client.
+ */
+struct OpenPort
+{
+
+ /**
+ * Client that opened the port.
+ */
+ struct CadetClient *c;
+
+ /**
+ * Port number.
+ */
+ struct GNUNET_HashCode port;
+
+ /**
+ * Port hashed with our PID (matches incoming OPEN messages).
+ */
+ struct GNUNET_HashCode h_port;
+
+};
+
+
/**
* Active path through the network (used by a tunnel). There may
* be at most one connection per path.
extern struct GNUNET_CRYPTO_EddsaPrivateKey *my_private_key;
/**
- * All ports clients of this peer have opened.
+ * All ports clients of this peer have opened. Maps from
+ * a hashed port to a `struct OpenPort`.
*/
extern struct GNUNET_CONTAINER_MultiHashMap *open_ports;
/**
* Map from ports to channels where the ports were closed at the
* time we got the inbound connection.
- * Indexed by port, contains `struct CadetChannel`.
+ * Indexed by h_port, contains `struct CadetChannel`.
*/
extern struct GNUNET_CONTAINER_MultiHashMap *loose_channels;
* A client that created a loose channel that was not bound to a port
* disconnected, drop it from the #loose_channels list.
*
- * @param port the port the channel was trying to bind to
+ * @param h_port the hashed port the channel was trying to bind to
* @param ch the channel that was lost
*/
void
-GSC_drop_loose_channel (const struct GNUNET_HashCode *port,
+GSC_drop_loose_channel (const struct GNUNET_HashCode *h_port,
struct CadetChannel *ch);