X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fcore%2Fgnunet-service-core_kx.h;h=28293e6072143de5e920c797e7f2c72ca2a95a1e;hb=81ea73fcf38405a714d949189ed0ec6bc5b6bea6;hp=5d4d638b5475813d46d2ca7d93be7f03a8e3c8e7;hpb=2d31c529e63e8a76d05fe5733b02802b101af9e1;p=oweals%2Fgnunet.git diff --git a/src/core/gnunet-service-core_kx.h b/src/core/gnunet-service-core_kx.h index 5d4d638b5..28293e607 100644 --- a/src/core/gnunet-service-core_kx.h +++ b/src/core/gnunet-service-core_kx.h @@ -1,6 +1,6 @@ /* This file is part of GNUnet. - (C) 2009, 2010, 2011 Christian Grothoff (and other contributing authors) + Copyright (C) 2009, 2010, 2011 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 @@ -14,8 +14,8 @@ 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /** @@ -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,58 @@ 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); /** - * We received an encrypted message. Decrypt, validate and - * pass on to the appropriate clients. + * Initialize KX subsystem. * - * @param kx key exchange information context - * @param msg encrypted message - * @param atsi performance data - * @param atsi_count number of entries in ats (excluding 0-termination) + * @param pk private key to use for the peer + * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure */ -void -GSC_KX_handle_encrypted_message (struct GSC_KeyExchangeInfo *kx, - const struct GNUNET_MessageHeader *msg); +int +GSC_KX_init (struct GNUNET_CRYPTO_EddsaPrivateKey *pk); /** - * Start the key exchange with the given peer. - * - * @param pid identity of the peer to do a key exchange with - * @return key exchange information context + * Shutdown KX subsystem. */ -struct GSC_KeyExchangeInfo * -GSC_KX_start (const struct GNUNET_PeerIdentity *pid); +void +GSC_KX_done (void); /** - * Stop key exchange with the given peer. Clean up key material. + * Check if the given neighbour has excess bandwidth available. * - * @param kx key exchange to stop + * @param target neighbour to check + * @return #GNUNET_YES if excess bandwidth is available, #GNUNET_NO if not */ -void -GSC_KX_stop (struct GSC_KeyExchangeInfo *kx); +int +GSC_NEIGHBOURS_check_excess_bandwidth (const struct GSC_KeyExchangeInfo *target); /** - * Initialize KX subsystem. + * Check how many messages are queued for the given neighbour. * - * @param pk private key to use for the peer - * @return GNUNET_OK on success, GNUNET_SYSERR on failure + * @param target neighbour to check + * @return number of items in the message queue */ -int -GSC_KX_init (struct GNUNET_CRYPTO_EccPrivateKey *pk); +unsigned int +GSC_NEIGHBOURS_get_queue_length (const struct GSC_KeyExchangeInfo *target); /** - * Shutdown KX subsystem. + * Handle #GNUNET_MESSAGE_TYPE_CORE_MONITOR_PEERS request. For this + * request type, the client does not have to have transmitted an INIT + * request. All current peers are returned, regardless of which + * message types they accept. + * + * @param mq message queue to add for monitoring */ void -GSC_KX_done (void); +GSC_KX_handle_client_monitor_peers (struct GNUNET_MQ_Handle *mq); + #endif /* end of gnunet-service-core_kx.h */