From 75c121f5ae37d3c7ccd95f4449aea33ccb4200f0 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Thu, 21 Mar 2013 14:43:47 +0000 Subject: change to core pai --- src/core/core_api.c | 10 +++++----- src/core/core_api_is_connected.c | 14 ++++++-------- src/core/core_api_iterate_peers.c | 9 ++++----- src/core/gnunet-core.c | 9 ++------- src/core/test_core_api.c | 16 ++++------------ src/core/test_core_api_reliability.c | 16 ++++------------ src/core/test_core_api_send_to_self.c | 6 ++---- src/core/test_core_api_start_only.c | 12 +++--------- src/core/test_core_quota_compliance.c | 16 ++++------------ 9 files changed, 34 insertions(+), 74 deletions(-) (limited to 'src/core') diff --git a/src/core/core_api.c b/src/core/core_api.c index 511c7ee99..a123a3a26 100644 --- a/src/core/core_api.c +++ b/src/core/core_api.c @@ -800,7 +800,7 @@ main_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg) &h->me.hashPubKey, pr, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST)); if (NULL != h->connects) - h->connects (h->cls, &h->me, NULL, 0); + h->connects (h->cls, &h->me); break; case GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT: if (msize < sizeof (struct ConnectNotifyMessage)) @@ -841,7 +841,7 @@ main_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg) &cnm->peer.hashPubKey, pr, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST)); if (NULL != h->connects) - h->connects (h->cls, &cnm->peer, NULL, 0); + h->connects (h->cls, &cnm->peer); break; case GNUNET_MESSAGE_TYPE_CORE_NOTIFY_DISCONNECT: if (msize != sizeof (struct DisconnectNotifyMessage)) @@ -924,14 +924,14 @@ main_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg) return; } if (GNUNET_OK != - h->handlers[hpos].callback (h->cls, &ntm->peer, em, NULL,0)) + h->handlers[hpos].callback (h->cls, &ntm->peer, em)) { /* error in processing, do not process other messages! */ break; } } if (NULL != h->inbound_notify) - h->inbound_notify (h->cls, &ntm->peer, em, NULL, 0); + h->inbound_notify (h->cls, &ntm->peer, em); break; case GNUNET_MESSAGE_TYPE_CORE_NOTIFY_OUTBOUND: if (msize < sizeof (struct NotifyTrafficMessage)) @@ -966,7 +966,7 @@ main_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg) GNUNET_break (0); break; } - h->outbound_notify (h->cls, &ntm->peer, em, NULL, 0); + h->outbound_notify (h->cls, &ntm->peer, em); break; case GNUNET_MESSAGE_TYPE_CORE_SEND_READY: if (msize != sizeof (struct SendMessageReady)) diff --git a/src/core/core_api_is_connected.c b/src/core/core_api_is_connected.c index 10af88f5c..31edb94b4 100644 --- a/src/core/core_api_is_connected.c +++ b/src/core/core_api_is_connected.c @@ -83,7 +83,7 @@ receive_connect_info (void *cls, const struct GNUNET_MessageHeader *msg) if (NULL == msg) { /* core died, failure */ - cth->peer_cb (cth->cb_cls, NULL, NULL, 0); + cth->peer_cb (cth->cb_cls, NULL); GNUNET_CORE_is_peer_connected_cancel (cth); return; } @@ -91,7 +91,7 @@ receive_connect_info (void *cls, const struct GNUNET_MessageHeader *msg) (ntohs (msg->size) == sizeof (struct GNUNET_MessageHeader))) { /* end of transmissions */ - cth->peer_cb (cth->cb_cls, NULL, NULL, 0); + cth->peer_cb (cth->cb_cls, NULL); GNUNET_CORE_is_peer_connected_cancel (cth); return; } @@ -101,7 +101,7 @@ receive_connect_info (void *cls, const struct GNUNET_MessageHeader *msg) (msize < sizeof (struct ConnectNotifyMessage))) { GNUNET_break (0); - cth->peer_cb (cth->cb_cls, NULL, NULL, 0); + cth->peer_cb (cth->cb_cls, NULL); GNUNET_CORE_is_peer_connected_cancel (cth); return; } @@ -109,12 +109,12 @@ receive_connect_info (void *cls, const struct GNUNET_MessageHeader *msg) if (msize != sizeof (struct ConnectNotifyMessage)) { GNUNET_break (0); - cth->peer_cb (cth->cb_cls, NULL, NULL, 0); + cth->peer_cb (cth->cb_cls, NULL); GNUNET_CORE_is_peer_connected_cancel (cth); return; } /* Normal case */ - cth->peer_cb (cth->cb_cls, &connect_message->peer, NULL, 0); + cth->peer_cb (cth->cb_cls, &connect_message->peer); GNUNET_CLIENT_receive (cth->client, &receive_connect_info, cth, GNUNET_TIME_UNIT_FOREVER_REL); } @@ -144,9 +144,7 @@ transmit_is_connected_request (void *cls, size_t size, void *buf) sizeof (struct GNUNET_PeerIdentity); if ( (NULL == buf) || (0 == size) ) { - cth->peer_cb (cth->cb_cls, - NULL, - NULL, 0); + cth->peer_cb (cth->cb_cls, NULL); GNUNET_CLIENT_disconnect (cth->client); GNUNET_free (cth); return 0; diff --git a/src/core/core_api_iterate_peers.c b/src/core/core_api_iterate_peers.c index 4cb73dc21..cc3db6476 100644 --- a/src/core/core_api_iterate_peers.c +++ b/src/core/core_api_iterate_peers.c @@ -78,7 +78,7 @@ receive_info (void *cls, const struct GNUNET_MessageHeader *msg) (ntohs (msg->size) == sizeof (struct GNUNET_MessageHeader)))) { if (request_context->peer_cb != NULL) - request_context->peer_cb (request_context->cb_cls, NULL, NULL, 0); + request_context->peer_cb (request_context->cb_cls, NULL); GNUNET_CLIENT_disconnect (request_context->client); GNUNET_free (request_context); return; @@ -91,7 +91,7 @@ receive_info (void *cls, const struct GNUNET_MessageHeader *msg) { GNUNET_break (0); if (request_context->peer_cb != NULL) - request_context->peer_cb (request_context->cb_cls, NULL, NULL, 0); + request_context->peer_cb (request_context->cb_cls, NULL); GNUNET_CLIENT_disconnect (request_context->client); GNUNET_free (request_context); return; @@ -101,15 +101,14 @@ receive_info (void *cls, const struct GNUNET_MessageHeader *msg) { GNUNET_break (0); if (request_context->peer_cb != NULL) - request_context->peer_cb (request_context->cb_cls, NULL, NULL, 0); + request_context->peer_cb (request_context->cb_cls, NULL); GNUNET_CLIENT_disconnect (request_context->client); GNUNET_free (request_context); return; } /* Normal case */ if (request_context->peer_cb != NULL) - request_context->peer_cb (request_context->cb_cls, &connect_message->peer, - NULL , 0); + request_context->peer_cb (request_context->cb_cls, &connect_message->peer); GNUNET_CLIENT_receive (request_context->client, &receive_info, request_context, GNUNET_TIME_UNIT_FOREVER_REL); } diff --git a/src/core/gnunet-core.c b/src/core/gnunet-core.c index 17b840480..87a372f30 100644 --- a/src/core/gnunet-core.c +++ b/src/core/gnunet-core.c @@ -74,9 +74,7 @@ shutdown_task (void *cls, * @param atsi_count number of records in 'atsi' */ static void -connected_peer_callback (void *cls, const struct GNUNET_PeerIdentity *peer, - const struct GNUNET_ATS_Information *atsi, - unsigned int atsi_count) +connected_peer_callback (void *cls, const struct GNUNET_PeerIdentity *peer) { struct GNUNET_CRYPTO_HashAsciiEncoded enc; @@ -102,12 +100,9 @@ monitor_notify_startup (void *cls, * * @param cls closure * @param peer the peer that connected - * @param ats performance data - * @param ats_count number of entries in ats (excluding 0-termination) */ static void -monitor_notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer, - const struct GNUNET_ATS_Information *ats, uint32_t ats_count) +monitor_notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer) { struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get(); const char *now_str; diff --git a/src/core/test_core_api.c b/src/core/test_core_api.c index ab96fb47e..c7865dd11 100644 --- a/src/core/test_core_api.c +++ b/src/core/test_core_api.c @@ -153,9 +153,7 @@ transmit_ready (void *cls, size_t size, void *buf) static void -connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer, - const struct GNUNET_ATS_Information *atsi, - unsigned int atsi_count) +connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer) { struct PeerContext *pc = cls; @@ -207,9 +205,7 @@ disconnect_notify (void *cls, const struct GNUNET_PeerIdentity *peer) static int inbound_notify (void *cls, const struct GNUNET_PeerIdentity *other, - const struct GNUNET_MessageHeader *message, - const struct GNUNET_ATS_Information *atsi, - unsigned int atsi_count) + const struct GNUNET_MessageHeader *message) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Core provides inbound data from `%4s'.\n", GNUNET_i2s (other)); @@ -219,9 +215,7 @@ inbound_notify (void *cls, const struct GNUNET_PeerIdentity *other, static int outbound_notify (void *cls, const struct GNUNET_PeerIdentity *other, - const struct GNUNET_MessageHeader *message, - const struct GNUNET_ATS_Information *atsi, - unsigned int atsi_count) + const struct GNUNET_MessageHeader *message) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Core notifies about outbound data for `%4s'.\n", @@ -233,9 +227,7 @@ outbound_notify (void *cls, const struct GNUNET_PeerIdentity *other, static int process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer, - const struct GNUNET_MessageHeader *message, - const struct GNUNET_ATS_Information *atsi, - unsigned int atsi_count) + const struct GNUNET_MessageHeader *message) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receiving message from `%4s'.\n", GNUNET_i2s (peer)); diff --git a/src/core/test_core_api_reliability.c b/src/core/test_core_api_reliability.c index 061158d71..47ade350c 100644 --- a/src/core/test_core_api_reliability.c +++ b/src/core/test_core_api_reliability.c @@ -231,9 +231,7 @@ transmit_ready (void *cls, size_t size, void *buf) static void -connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer, - const struct GNUNET_ATS_Information *atsi, - unsigned int atsi_count) +connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer) { struct PeerContext *pc = cls; @@ -277,9 +275,7 @@ disconnect_notify (void *cls, const struct GNUNET_PeerIdentity *peer) static int inbound_notify (void *cls, const struct GNUNET_PeerIdentity *other, - const struct GNUNET_MessageHeader *message, - const struct GNUNET_ATS_Information *atsi, - unsigned int atsi_count) + const struct GNUNET_MessageHeader *message) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Core provides inbound data from `%4s'.\n", GNUNET_i2s (other)); @@ -289,9 +285,7 @@ inbound_notify (void *cls, const struct GNUNET_PeerIdentity *other, static int outbound_notify (void *cls, const struct GNUNET_PeerIdentity *other, - const struct GNUNET_MessageHeader *message, - const struct GNUNET_ATS_Information *atsi, - unsigned int atsi_count) + const struct GNUNET_MessageHeader *message) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Core notifies about outbound data for `%4s'.\n", @@ -306,9 +300,7 @@ transmit_ready (void *cls, size_t size, void *buf); static int process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer, - const struct GNUNET_MessageHeader *message, - const struct GNUNET_ATS_Information *atsi, - unsigned int atsi_count) + const struct GNUNET_MessageHeader *message) { static int n; unsigned int s; diff --git a/src/core/test_core_api_send_to_self.c b/src/core/test_core_api_send_to_self.c index c56e227e5..82048ea92 100644 --- a/src/core/test_core_api_send_to_self.c +++ b/src/core/test_core_api_send_to_self.c @@ -71,8 +71,7 @@ cleanup (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tskctx) static int receive (void *cls, const struct GNUNET_PeerIdentity *other, - const struct GNUNET_MessageHeader *message, - const struct GNUNET_ATS_Information *atsi, unsigned int atsi_count) + const struct GNUNET_MessageHeader *message) { if (die_task != GNUNET_SCHEDULER_NO_TASK) GNUNET_SCHEDULER_cancel (die_task); @@ -120,8 +119,7 @@ init (void *cls, struct GNUNET_CORE_Handle *core, static void -connect_cb (void *cls, const struct GNUNET_PeerIdentity *peer, - const struct GNUNET_ATS_Information *atsi, unsigned int atsi_count) +connect_cb (void *cls, const struct GNUNET_PeerIdentity *peer) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connected to peer %s.\n", GNUNET_i2s (peer)); diff --git a/src/core/test_core_api_start_only.c b/src/core/test_core_api_start_only.c index d9cb4150d..e98b374d2 100644 --- a/src/core/test_core_api_start_only.c +++ b/src/core/test_core_api_start_only.c @@ -60,9 +60,7 @@ static int ok; static void -connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer, - const struct GNUNET_ATS_Information *atsi, - unsigned int atsi_count) +connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer) { } @@ -75,9 +73,7 @@ disconnect_notify (void *cls, const struct GNUNET_PeerIdentity *peer) static int inbound_notify (void *cls, const struct GNUNET_PeerIdentity *other, - const struct GNUNET_MessageHeader *message, - const struct GNUNET_ATS_Information *atsi, - unsigned int atsi_count) + const struct GNUNET_MessageHeader *message) { return GNUNET_OK; } @@ -85,9 +81,7 @@ inbound_notify (void *cls, const struct GNUNET_PeerIdentity *other, static int outbound_notify (void *cls, const struct GNUNET_PeerIdentity *other, - const struct GNUNET_MessageHeader *message, - const struct GNUNET_ATS_Information *atsi, - unsigned int atsi_count) + const struct GNUNET_MessageHeader *message) { return GNUNET_OK; } diff --git a/src/core/test_core_quota_compliance.c b/src/core/test_core_quota_compliance.c index 884d5fa5e..e09417642 100644 --- a/src/core/test_core_quota_compliance.c +++ b/src/core/test_core_quota_compliance.c @@ -360,9 +360,7 @@ transmit_ready (void *cls, size_t size, void *buf) static void -connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer, - const struct GNUNET_ATS_Information *atsi, - unsigned int atsi_count) +connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer) { struct PeerContext *pc = cls; @@ -425,9 +423,7 @@ disconnect_notify (void *cls, const struct GNUNET_PeerIdentity *peer) static int inbound_notify (void *cls, const struct GNUNET_PeerIdentity *other, - const struct GNUNET_MessageHeader *message, - const struct GNUNET_ATS_Information *atsi, - unsigned int atsi_count) + const struct GNUNET_MessageHeader *message) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Core provides inbound data from `%4s' %llu.\n", @@ -439,9 +435,7 @@ inbound_notify (void *cls, const struct GNUNET_PeerIdentity *other, static int outbound_notify (void *cls, const struct GNUNET_PeerIdentity *other, - const struct GNUNET_MessageHeader *message, - const struct GNUNET_ATS_Information *atsi, - unsigned int atsi_count) + const struct GNUNET_MessageHeader *message) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Core notifies about outbound data for `%4s'.\n", @@ -455,9 +449,7 @@ transmit_ready (void *cls, size_t size, void *buf); static int process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer, - const struct GNUNET_MessageHeader *message, - const struct GNUNET_ATS_Information *atsi, - unsigned int atsi_count) + const struct GNUNET_MessageHeader *message) { static int n; const struct TestMessage *hdr; -- cgit v1.2.3