Don't pass NULL to destroy_route
[oweals/gnunet.git] / src / cadet / gnunet-service-cadet_connection.h
index 4e994f2beccbd9123e2332c16943e65b5f3c7ca2..307cb42c2b7c5537b5d57f18cc2a1afcbafbd39f 100644 (file)
@@ -125,7 +125,7 @@ typedef void
  */
 void
 GCC_handle_create (struct CadetPeer *peer,
-                   const struct GNUNET_CADET_ConnectionCreate *msg);
+                   const struct GNUNET_CADET_ConnectionCreateMessage *msg);
 
 
 /**
@@ -136,7 +136,7 @@ GCC_handle_create (struct CadetPeer *peer,
  */
 void
 GCC_handle_confirm (struct CadetPeer *peer,
-                    const struct GNUNET_CADET_ConnectionACK *msg);
+                    const struct GNUNET_CADET_ConnectionCreateAckMessage *msg);
 
 
 /**
@@ -147,7 +147,7 @@ GCC_handle_confirm (struct CadetPeer *peer,
  */
 void
 GCC_handle_broken (struct CadetPeer *peer,
-                   const struct GNUNET_CADET_ConnectionBroken *msg);
+                   const struct GNUNET_CADET_ConnectionBrokenMessage *msg);
 
 /**
  * Handler for notifications of destroyed connections.
@@ -157,7 +157,7 @@ GCC_handle_broken (struct CadetPeer *peer,
  */
 void
 GCC_handle_destroy (struct CadetPeer *peer,
-                    const struct GNUNET_CADET_ConnectionDestroy *msg);
+                    const struct GNUNET_CADET_ConnectionDestroyMessage *msg);
 
 /**
  * Handler for cadet network traffic hop-by-hop acks.
@@ -167,7 +167,7 @@ GCC_handle_destroy (struct CadetPeer *peer,
  */
 void
 GCC_handle_ack (struct CadetPeer *peer,
-                const struct GNUNET_CADET_ACK *msg);
+                const struct GNUNET_CADET_ConnectionEncryptedAckMessage *msg);
 
 /**
  * Handler for cadet network traffic hop-by-hop data counter polls.
@@ -177,7 +177,7 @@ GCC_handle_ack (struct CadetPeer *peer,
  */
 void
 GCC_handle_poll (struct CadetPeer *peer,
-                 const struct GNUNET_CADET_Poll *msg);
+                 const struct GNUNET_CADET_ConnectionHopByHopPollMessage *msg);
 
 /**
  * Handler for key exchange traffic (Axolotl KX).
@@ -187,7 +187,7 @@ GCC_handle_poll (struct CadetPeer *peer,
  */
 void
 GCC_handle_kx (struct CadetPeer *peer,
-               const struct GNUNET_CADET_KX *msg);
+               const struct GNUNET_CADET_TunnelKeyExchangeMessage *msg);
 
 /**
  * Handler for encrypted cadet network traffic (channel mgmt, data).
@@ -197,7 +197,7 @@ GCC_handle_kx (struct CadetPeer *peer,
  */
 void
 GCC_handle_encrypted (struct CadetPeer *peer,
-                      const struct GNUNET_CADET_AX *msg);
+                      const struct GNUNET_CADET_TunnelEncryptedMessage *msg);
 
 /**
  * Core handler for axolotl key exchange traffic.
@@ -277,7 +277,7 @@ GCC_shutdown (void);
  *         NULL in case of error: own id not in path, wrong neighbors, ...
  */
 struct CadetConnection *
-GCC_new (const struct GNUNET_CADET_Hash *cid,
+GCC_new (const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid,
          struct CadetTunnel *t,
          struct CadetPeerPath *path,
          unsigned int own_pos);
@@ -300,21 +300,10 @@ GCC_destroy (struct CadetConnection *c);
  *
  * @return ID of the connection.
  */
-const struct GNUNET_CADET_Hash *
+const struct GNUNET_CADET_ConnectionTunnelIdentifier *
 GCC_get_id (const struct CadetConnection *c);
 
 
-/**
- * Get a hash for the connection ID.
- *
- * @param c Connection to get the hash.
- *
- * @return Hash expanded from the ID of the connection.
- */
-const struct GNUNET_HashCode *
-GCC_get_h (const struct CadetConnection *c);
-
-
 /**
  * Get the connection path.
  *
@@ -383,10 +372,9 @@ GCC_get_qn (struct CadetConnection *c, int fwd);
  *
  * @param c Connection.
  * @param fwd Is query about FWD traffic?
- *
  * @return Next PID to use.
  */
-uint32_t
+struct CadetEncryptedMessageIdentifier
 GCC_get_pid (struct CadetConnection *c, int fwd);
 
 /**
@@ -493,6 +481,8 @@ GCC_cancel (struct CadetConnectionQueue *q);
  *
  * @param message Message to send.
  * @param payload_type Type of payload, in case the message is encrypted.
+ *                     0 for restransmissions (when type is no longer known)
+ *                     UINT16_MAX when not applicable.
  * @param payload_id ID of the payload (PID, ACK, ...).
  * @param c Connection on which this message is transmitted.
  * @param fwd Is this a fwd message?
@@ -501,12 +491,13 @@ GCC_cancel (struct CadetConnectionQueue *q);
  * @param cont_cls Closure for @c cont.
  *
  * @return Handle to cancel the message before it's sent.
- *         NULL on error or if @c cont is NULL.
+ *         NULL on error.
  *         Invalid on @c cont call.
  */
 struct CadetConnectionQueue *
 GCC_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
-                           uint16_t payload_type, uint32_t payload_id,
+                           uint16_t payload_type,
+                           struct CadetEncryptedMessageIdentifier payload_id,
                            struct CadetConnection *c, int fwd, int force,
                            GCC_sent cont, void *cont_cls);