doxy
[oweals/gnunet.git] / src / core / gnunet-service-core_kx.h
index b5b9b712e3796d6fdc80b0494beb7909c8aaad51..5ecd2c17f8b11d3f38a397519c786d7fb0ee7af4 100644 (file)
 #define GNUNET_SERVICE_CORE_KX_H
 
 #include "gnunet_util_lib.h"
+#include "gnunet_transport_service.h"
 
 
 /**
  * Information about the status of a key exchange with another peer.
  */
-struct GSC_KeyExchangeInfo
-{
-
-  /**
-   * SetKeyMessage to transmit, NULL if we are not currently trying
-   * to send one.
-   */
-  struct SetKeyMessage *skm;
-
-  /**
-   * Non-NULL if we are currently looking up HELLOs for this peer.
-   * for this peer.
-   */
-  struct GNUNET_PEERINFO_IteratorContext *pitr;
-
-  /**
-   * Public key of the neighbour, NULL if we don't have it yet.
-   */
-  struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *public_key;
-
-  /**
-   * We received a PING message before we got the "public_key"
-   * (or the SET_KEY).  We keep it here until we have a key
-   * to decrypt it.  NULL if no PING is pending.
-   */
-  struct PingMessage *pending_ping;
-
-  /**
-   * We received a PONG message before we got the "public_key"
-   * (or the SET_KEY).  We keep it here until we have a key
-   * to decrypt it.  NULL if no PONG is pending.
-   */
-  struct PongMessage *pending_pong;
-
-  /**
-   * Key we use to encrypt our messages for the other peer
-   * (initialized by us when we do the handshake).
-   */
-  struct GNUNET_CRYPTO_AesSessionKey encrypt_key;
-
-  /**
-   * Key we use to decrypt messages from the other peer
-   * (given to us by the other peer during the handshake).
-   */
-  struct GNUNET_CRYPTO_AesSessionKey decrypt_key;
-
-  /**
-   * At what time did we generate our encryption key?
-   */
-  struct GNUNET_TIME_Absolute encrypt_key_created;
-
-  /**
-   * At what time did the other peer generate the decryption key?
-   */
-  struct GNUNET_TIME_Absolute decrypt_key_created;
-
-  /**
-   * At what frequency are we currently re-trying SET_KEY messages?
-   */
-  struct GNUNET_TIME_Relative set_key_retry_frequency;
-
-  /**
-   * ID of task used for re-trying SET_KEY and PING message.
-   */
-  GNUNET_SCHEDULER_TaskIdentifier retry_set_key_task;
-
-  /**
-   * What was our PING challenge number (for this peer)?
-   */
-  uint32_t ping_challenge;
-
-  /**
-   * What is our connection status?
-   */
-  enum PeerStateMachine status;
-
-};
+struct GSC_KeyExchangeInfo;
 
 
 /**
@@ -117,14 +42,10 @@ struct GSC_KeyExchangeInfo
  *
  * @param kx key exchange status for the corresponding peer
  * @param msg the set key message we received
- * @param ats performance data
- * @param ats_count number of entries in ats (excluding 0-termination)
  */
 void
-GSC_KX_handle_set_key (struct GSC_KeyExchangeInfo *n, 
-                      const struct GNUNET_MessageHandler *msg,
-                      const struct GNUNET_TRANSPORT_ATS_Information *ats,
-                      uint32_t ats_count);
+GSC_KX_handle_set_key (struct GSC_KeyExchangeInfo *kx,
+                       const struct GNUNET_MessageHeader *msg);
 
 
 /**
@@ -133,14 +54,10 @@ GSC_KX_handle_set_key (struct GSC_KeyExchangeInfo *n,
  *
  * @param kx key exchange status for the corresponding peer
  * @param msg the encrypted PING message itself
- * @param ats performance data
- * @param ats_count number of entries in ats (excluding 0-termination)
  */
 void
-GSC_KX_handle_ping (struct GSC_KeyExchangeInfo *kx, 
-                   const struct GNUNET_MessageHeader *msg,
-                   const struct GNUNET_TRANSPORT_ATS_Information *ats,
-                   uint32_t ats_count);
+GSC_KX_handle_ping (struct GSC_KeyExchangeInfo *kx,
+                    const struct GNUNET_MessageHeader *msg);
 
 
 /**
@@ -148,14 +65,10 @@ GSC_KX_handle_ping (struct GSC_KeyExchangeInfo *kx,
  *
  * @param kx key exchange status for the corresponding peer
  * @param msg the encrypted PONG message itself
- * @param ats performance data
- * @param ats_count number of entries in ats (excluding 0-termination)
  */
 void
 GSC_KX_handle_pong (struct GSC_KeyExchangeInfo *kx,
-                   const struct GNUNET_MessageHeader *msg,
-                   const struct GNUNET_TRANSPORT_ATS_Information *ats,
-                   uint32_t ats_count);
+                    const struct GNUNET_MessageHeader *msg);
 
 
 /**
@@ -167,8 +80,7 @@ GSC_KX_handle_pong (struct GSC_KeyExchangeInfo *kx,
  */
 void
 GSC_KX_encrypt_and_transmit (struct GSC_KeyExchangeInfo *kx,
-                            const void *payload,
-                            size_t payload_size);
+                             const void *payload, size_t payload_size);
 
 
 /**
@@ -177,14 +89,14 @@ GSC_KX_encrypt_and_transmit (struct GSC_KeyExchangeInfo *kx,
  *
  * @param kx key exchange information context
  * @param msg encrypted message
- * @param ats performance data
- * @param ats_count number of entries in ats (excluding 0-termination)
+ * @param atsi performance data
+ * @param atsi_count number of entries in ats (excluding 0-termination)
  */
 void
-GSC_KX_handle_encrypted_message (struct GSC_KeyExchangeInfo *kx, 
-                                const struct GNUNET_MessageHeader *msg,
-                                const struct GNUNET_TRANSPORT_ATS_Information *ats,
-                                uint32_t ats_count);
+GSC_KX_handle_encrypted_message (struct GSC_KeyExchangeInfo *kx,
+                                 const struct GNUNET_MessageHeader *msg,
+                                 const struct GNUNET_ATS_Information *atsi,
+                                 uint32_t atsi_count);
 
 
 /**
@@ -211,14 +123,14 @@ GSC_KX_stop (struct GSC_KeyExchangeInfo *kx);
  *
  * @return GNUNET_OK on success, GNUNET_SYSERR on failure
  */
-int 
+int
 GSC_KX_init (void);
 
 
 /**
  * Shutdown KX subsystem.
  */
-void 
+void
 GSC_KX_done (void);
 
 #endif