X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fcore%2Fgnunet-service-core_kx.h;h=28293e6072143de5e920c797e7f2c72ca2a95a1e;hb=43ee295fd2b0d38dcbfa3a7bb6df461cad15cf4f;hp=343015de562aeffc02777737d7db0ef8b87ebfda;hpb=bb5fe91d23b0938baa3c4f0e92a83df659df216a;p=oweals%2Fgnunet.git diff --git a/src/core/gnunet-service-core_kx.h b/src/core/gnunet-service-core_kx.h index 343015de5..28293e607 100644 --- a/src/core/gnunet-service-core_kx.h +++ b/src/core/gnunet-service-core_kx.h @@ -36,41 +36,6 @@ struct GSC_KeyExchangeInfo; -/** - * We received a EPHEMERAL_KEY message. Validate and update - * our key material and status. - * - * @param kx key exchange status for the corresponding peer - * @param msg the set key message we received - */ -void -GSC_KX_handle_ephemeral_key (struct GSC_KeyExchangeInfo *kx, - const struct GNUNET_MessageHeader *msg); - - -/** - * We received a PING message. Validate and transmit - * a PONG message. - * - * @param kx key exchange status for the corresponding peer - * @param msg the encrypted PING message itself - */ -void -GSC_KX_handle_ping (struct GSC_KeyExchangeInfo *kx, - const struct GNUNET_MessageHeader *msg); - - -/** - * We received a PONG message. Validate and update our status. - * - * @param kx key exchange status for the corresponding peer - * @param msg the encrypted PONG message itself - */ -void -GSC_KX_handle_pong (struct GSC_KeyExchangeInfo *kx, - const struct GNUNET_MessageHeader *msg); - - /** * Encrypt and transmit a message with the given payload. * @@ -80,57 +45,45 @@ 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); - - -/** - * We received an encrypted message. Decrypt, validate and - * pass on to the appropriate clients. - * - * @param kx key exchange information context - * @param msg encrypted message - */ -void -GSC_KX_handle_encrypted_message (struct GSC_KeyExchangeInfo *kx, - const struct GNUNET_MessageHeader *msg); + const void *payload, + size_t payload_size); /** - * Start the key exchange with the given peer. + * Initialize KX subsystem. * - * @param pid identity of the peer to do a key exchange with - * @return key exchange information context + * @param pk private key to use for the peer + * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure */ -struct GSC_KeyExchangeInfo * -GSC_KX_start (const struct GNUNET_PeerIdentity *pid); +int +GSC_KX_init (struct GNUNET_CRYPTO_EddsaPrivateKey *pk); /** - * Stop key exchange with the given peer. Clean up key material. - * - * @param kx key exchange to stop + * Shutdown KX subsystem. */ void -GSC_KX_stop (struct GSC_KeyExchangeInfo *kx); +GSC_KX_done (void); /** - * Initialize KX subsystem. + * Check if the given neighbour has excess bandwidth available. * - * @param pk private key to use for the peer - * @param server the server of the CORE service - * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure + * @param target neighbour to check + * @return #GNUNET_YES if excess bandwidth is available, #GNUNET_NO if not */ int -GSC_KX_init (struct GNUNET_CRYPTO_EddsaPrivateKey *pk, - struct GNUNET_SERVER_Handle *server); +GSC_NEIGHBOURS_check_excess_bandwidth (const struct GSC_KeyExchangeInfo *target); /** - * Shutdown KX subsystem. + * Check how many messages are queued for the given neighbour. + * + * @param target neighbour to check + * @return number of items in the message queue */ -void -GSC_KX_done (void); +unsigned int +GSC_NEIGHBOURS_get_queue_length (const struct GSC_KeyExchangeInfo *target); /** @@ -139,14 +92,10 @@ GSC_KX_done (void); * request. All current peers are returned, regardless of which * message types they accept. * - * @param cls unused - * @param client client sending the iteration request - * @param message iteration request message + * @param mq message queue to add for monitoring */ void -GSC_KX_handle_client_monitor_peers (void *cls, - struct GNUNET_SERVER_Client *client, - const struct GNUNET_MessageHeader *message); +GSC_KX_handle_client_monitor_peers (struct GNUNET_MQ_Handle *mq); #endif