From: David Barksdale Date: Thu, 18 Aug 2016 00:03:29 +0000 (+0000) Subject: Use statement exprs instead of local function X-Git-Tag: initial-import-from-subversion-38251~373 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7f937e3781f36538d9864fa841822eecdaf0bf27;p=oweals%2Fgnunet.git Use statement exprs instead of local function This change lets us compile with clang again. --- diff --git a/src/arm/arm_api.c b/src/arm/arm_api.c index c8c5e8ba6..5c4a1c794 100644 --- a/src/arm/arm_api.c +++ b/src/arm/arm_api.c @@ -453,19 +453,19 @@ mq_error_handler (void *cls, static int reconnect_arm (struct GNUNET_ARM_Handle *h) { - GNUNET_MQ_hd_fixed_size (arm_result, - GNUNET_MESSAGE_TYPE_ARM_RESULT, - struct GNUNET_ARM_ResultMessage); - GNUNET_MQ_hd_var_size (arm_list_result, - GNUNET_MESSAGE_TYPE_ARM_LIST_RESULT, - struct GNUNET_ARM_ListResultMessage); - GNUNET_MQ_hd_fixed_size (confirm, - GNUNET_MESSAGE_TYPE_TEST, - struct GNUNET_MessageHeader); struct GNUNET_MQ_MessageHandler handlers[] = { - make_arm_result_handler (h), - make_arm_list_result_handler (h), - make_confirm_handler (h), + GNUNET_MQ_hd_fixed_size (arm_result, + GNUNET_MESSAGE_TYPE_ARM_RESULT, + struct GNUNET_ARM_ResultMessage, + h), + GNUNET_MQ_hd_var_size (arm_list_result, + GNUNET_MESSAGE_TYPE_ARM_LIST_RESULT, + struct GNUNET_ARM_ListResultMessage, + h), + GNUNET_MQ_hd_fixed_size (confirm, + GNUNET_MESSAGE_TYPE_TEST, + struct GNUNET_MessageHeader, + h), GNUNET_MQ_handler_end () }; struct GNUNET_MessageHeader *test; diff --git a/src/arm/arm_monitor_api.c b/src/arm/arm_monitor_api.c index 442320fe8..471393c7e 100644 --- a/src/arm/arm_monitor_api.c +++ b/src/arm/arm_monitor_api.c @@ -198,11 +198,11 @@ mq_error_handler (void *cls, static int reconnect_arm_monitor (struct GNUNET_ARM_MonitorHandle *h) { - GNUNET_MQ_hd_var_size (monitor_notify, - GNUNET_MESSAGE_TYPE_ARM_STATUS, - struct GNUNET_ARM_StatusMessage); struct GNUNET_MQ_MessageHandler handlers[] = { - make_monitor_notify_handler (h), + GNUNET_MQ_hd_var_size (monitor_notify, + GNUNET_MESSAGE_TYPE_ARM_STATUS, + struct GNUNET_ARM_StatusMessage, + h), GNUNET_MQ_handler_end () }; struct GNUNET_MessageHeader *msg; diff --git a/src/ats-tests/ats-testing.c b/src/ats-tests/ats-testing.c index 9f0519fa3..eb30daa6b 100644 --- a/src/ats-tests/ats-testing.c +++ b/src/ats-tests/ats-testing.c @@ -348,16 +348,16 @@ static void * transport_connect_adapter (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg) { - GNUNET_MQ_hd_fixed_size (ping, - TEST_MESSAGE_TYPE_PING, - struct TestMessage); - GNUNET_MQ_hd_fixed_size (pong, - TEST_MESSAGE_TYPE_PONG, - struct TestMessage); struct BenchmarkPeer *me = cls; struct GNUNET_MQ_MessageHandler handlers[] = { - make_ping_handler (me), - make_pong_handler (me), + GNUNET_MQ_hd_fixed_size (ping, + TEST_MESSAGE_TYPE_PING, + struct TestMessage, + me), + GNUNET_MQ_hd_fixed_size (pong, + TEST_MESSAGE_TYPE_PONG, + struct TestMessage, + me), GNUNET_MQ_handler_end () }; @@ -390,16 +390,16 @@ static void * core_connect_adapter (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg) { - GNUNET_MQ_hd_fixed_size (ping, - TEST_MESSAGE_TYPE_PING, - struct TestMessage); - GNUNET_MQ_hd_fixed_size (pong, - TEST_MESSAGE_TYPE_PONG, - struct TestMessage); struct BenchmarkPeer *me = cls; struct GNUNET_MQ_MessageHandler handlers[] = { - make_ping_handler (me), - make_pong_handler (me), + GNUNET_MQ_hd_fixed_size (ping, + TEST_MESSAGE_TYPE_PING, + struct TestMessage, + me), + GNUNET_MQ_hd_fixed_size (pong, + TEST_MESSAGE_TYPE_PONG, + struct TestMessage, + me), GNUNET_MQ_handler_end () }; diff --git a/src/ats/ats_api_performance.c b/src/ats/ats_api_performance.c index 7edc39e38..dd8666d4c 100644 --- a/src/ats/ats_api_performance.c +++ b/src/ats/ats_api_performance.c @@ -566,19 +566,19 @@ mq_error_handler (void *cls, static void reconnect (struct GNUNET_ATS_PerformanceHandle *ph) { - GNUNET_MQ_hd_var_size (peer_information, - GNUNET_MESSAGE_TYPE_ATS_PEER_INFORMATION, - struct PeerInformationMessage); - GNUNET_MQ_hd_fixed_size (reservation_result, - GNUNET_MESSAGE_TYPE_ATS_RESERVATION_RESULT, - struct ReservationResultMessage); - GNUNET_MQ_hd_var_size (address_list, - GNUNET_MESSAGE_TYPE_ATS_ADDRESSLIST_RESPONSE, - struct PeerInformationMessage); struct GNUNET_MQ_MessageHandler handlers[] = { - make_peer_information_handler (ph), - make_reservation_result_handler (ph), - make_address_list_handler (ph), + GNUNET_MQ_hd_var_size (peer_information, + GNUNET_MESSAGE_TYPE_ATS_PEER_INFORMATION, + struct PeerInformationMessage, + ph), + GNUNET_MQ_hd_fixed_size (reservation_result, + GNUNET_MESSAGE_TYPE_ATS_RESERVATION_RESULT, + struct ReservationResultMessage, + ph), + GNUNET_MQ_hd_var_size (address_list, + GNUNET_MESSAGE_TYPE_ATS_ADDRESSLIST_RESPONSE, + struct PeerInformationMessage, + ph), GNUNET_MQ_handler_end () }; struct GNUNET_MQ_Envelope *env; diff --git a/src/ats/ats_api_scheduling.c b/src/ats/ats_api_scheduling.c index c4174f99e..4a872b90a 100644 --- a/src/ats/ats_api_scheduling.c +++ b/src/ats/ats_api_scheduling.c @@ -515,15 +515,15 @@ send_add_address_message (struct GNUNET_ATS_SchedulingHandle *sh, static void reconnect (struct GNUNET_ATS_SchedulingHandle *sh) { - GNUNET_MQ_hd_fixed_size (ats_session_release, - GNUNET_MESSAGE_TYPE_ATS_SESSION_RELEASE, - struct GNUNET_ATS_SessionReleaseMessage); - GNUNET_MQ_hd_fixed_size (ats_address_suggestion, - GNUNET_MESSAGE_TYPE_ATS_ADDRESS_SUGGESTION, - struct AddressSuggestionMessage); struct GNUNET_MQ_MessageHandler handlers[] = { - make_ats_session_release_handler (sh), - make_ats_address_suggestion_handler (sh), + GNUNET_MQ_hd_fixed_size (ats_session_release, + GNUNET_MESSAGE_TYPE_ATS_SESSION_RELEASE, + struct GNUNET_ATS_SessionReleaseMessage, + sh), + GNUNET_MQ_hd_fixed_size (ats_address_suggestion, + GNUNET_MESSAGE_TYPE_ATS_ADDRESS_SUGGESTION, + struct AddressSuggestionMessage, + sh), GNUNET_MQ_handler_end () }; struct GNUNET_MQ_Envelope *ev; diff --git a/src/cadet/cadet_api.c b/src/cadet/cadet_api.c index 1d4530b6f..d75815588 100644 --- a/src/cadet/cadet_api.c +++ b/src/cadet/cadet_api.c @@ -1239,43 +1239,43 @@ handle_get_tunnel (void *cls, static int do_reconnect (struct GNUNET_CADET_Handle *h) { - GNUNET_MQ_hd_fixed_size (channel_created, - GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE, - struct GNUNET_CADET_ChannelCreateMessage); - GNUNET_MQ_hd_fixed_size (channel_destroy, - GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY, - struct GNUNET_CADET_ChannelDestroyMessage); - GNUNET_MQ_hd_var_size (local_data, - GNUNET_MESSAGE_TYPE_CADET_LOCAL_DATA, - struct GNUNET_CADET_LocalData); - GNUNET_MQ_hd_fixed_size (local_ack, - GNUNET_MESSAGE_TYPE_CADET_LOCAL_ACK, - struct GNUNET_CADET_LocalAck); - GNUNET_MQ_hd_var_size (get_peers, - GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PEERS, - struct GNUNET_CADET_LocalInfoPeer); - GNUNET_MQ_hd_var_size (get_peer, - GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PEER, - struct GNUNET_CADET_LocalInfoPeer); - GNUNET_MQ_hd_var_size (get_tunnels, - GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_TUNNELS, - struct GNUNET_CADET_LocalInfoTunnel); - GNUNET_MQ_hd_var_size (get_tunnel, - GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_TUNNEL, - struct GNUNET_CADET_LocalInfoTunnel); + struct GNUNET_MQ_MessageHandler handlers[] = { + GNUNET_MQ_hd_fixed_size (channel_created, + GNUNET_MESSAGE_TYPE_CADET_CHANNEL_CREATE, + struct GNUNET_CADET_ChannelCreateMessage, + h), + GNUNET_MQ_hd_fixed_size (channel_destroy, + GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY, + struct GNUNET_CADET_ChannelDestroyMessage, + h), + GNUNET_MQ_hd_var_size (local_data, + GNUNET_MESSAGE_TYPE_CADET_LOCAL_DATA, + struct GNUNET_CADET_LocalData, + h), + GNUNET_MQ_hd_fixed_size (local_ack, + GNUNET_MESSAGE_TYPE_CADET_LOCAL_ACK, + struct GNUNET_CADET_LocalAck, + h), + GNUNET_MQ_hd_var_size (get_peers, + GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PEERS, + struct GNUNET_CADET_LocalInfoPeer, + h), + GNUNET_MQ_hd_var_size (get_peer, + GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PEER, + struct GNUNET_CADET_LocalInfoPeer, + h), + GNUNET_MQ_hd_var_size (get_tunnels, + GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_TUNNELS, + struct GNUNET_CADET_LocalInfoTunnel, + h), + GNUNET_MQ_hd_var_size (get_tunnel, + GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_TUNNEL, + struct GNUNET_CADET_LocalInfoTunnel, + h), // FIXME // GNUNET_MQ_hd_fixed_Y size (channel_destroyed, // GNUNET_MESSAGE_TYPE_CADET_CHANNEL_NACK, // struct GNUNET_CADET_ChannelDestroyMessage); - struct GNUNET_MQ_MessageHandler handlers[] = { - make_channel_created_handler (h), - make_channel_destroy_handler (h), - make_local_data_handler (h), - make_local_ack_handler (h), - make_get_peers_handler (h), - make_get_peer_handler (h), - make_get_tunnels_handler (h), - make_get_tunnel_handler (h), GNUNET_MQ_handler_end () }; diff --git a/src/consensus/consensus_api.c b/src/consensus/consensus_api.c index 088fafd08..18898bebd 100644 --- a/src/consensus/consensus_api.c +++ b/src/consensus/consensus_api.c @@ -202,17 +202,17 @@ GNUNET_CONSENSUS_create (const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_CONSENSUS_ElementCallback new_element_cb, void *new_element_cls) { - GNUNET_MQ_hd_var_size (new_element, - GNUNET_MESSAGE_TYPE_CONSENSUS_CLIENT_RECEIVED_ELEMENT, - struct GNUNET_CONSENSUS_ElementMessage); - GNUNET_MQ_hd_fixed_size (conclude_done, - GNUNET_MESSAGE_TYPE_CONSENSUS_CLIENT_CONCLUDE_DONE, - struct GNUNET_MessageHeader); struct GNUNET_CONSENSUS_Handle *consensus = GNUNET_new (struct GNUNET_CONSENSUS_Handle); struct GNUNET_MQ_MessageHandler mq_handlers[] = { - make_new_element_handler (consensus), - make_conclude_done_handler (consensus), + GNUNET_MQ_hd_var_size (new_element, + GNUNET_MESSAGE_TYPE_CONSENSUS_CLIENT_RECEIVED_ELEMENT, + struct GNUNET_CONSENSUS_ElementMessage, + consensus), + GNUNET_MQ_hd_fixed_size (conclude_done, + GNUNET_MESSAGE_TYPE_CONSENSUS_CLIENT_CONCLUDE_DONE, + struct GNUNET_MessageHeader, + consensus), GNUNET_MQ_handler_end () }; struct GNUNET_CONSENSUS_JoinMessage *join_msg; diff --git a/src/conversation/conversation_api.c b/src/conversation/conversation_api.c index 5dd9cf79e..8a74f0ca6 100644 --- a/src/conversation/conversation_api.c +++ b/src/conversation/conversation_api.c @@ -551,27 +551,27 @@ clean_up_callers (struct GNUNET_CONVERSATION_Phone *phone) static void reconnect_phone (struct GNUNET_CONVERSATION_Phone *phone) { - GNUNET_MQ_hd_fixed_size (phone_ring, - GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RING, - struct ClientPhoneRingMessage); - GNUNET_MQ_hd_fixed_size (phone_hangup, - GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP, - struct ClientPhoneHangupMessage); - GNUNET_MQ_hd_fixed_size (phone_suspend, - GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_SUSPEND, - struct ClientPhoneSuspendMessage); - GNUNET_MQ_hd_fixed_size (phone_resume, - GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RESUME, - struct ClientPhoneResumeMessage); - GNUNET_MQ_hd_var_size (phone_audio, - GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO, - struct ClientAudioMessage); struct GNUNET_MQ_MessageHandler handlers[] = { - make_phone_ring_handler (phone), - make_phone_hangup_handler (phone), - make_phone_suspend_handler (phone), - make_phone_resume_handler (phone), - make_phone_audio_handler (phone), + GNUNET_MQ_hd_fixed_size (phone_ring, + GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RING, + struct ClientPhoneRingMessage, + phone), + GNUNET_MQ_hd_fixed_size (phone_hangup, + GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP, + struct ClientPhoneHangupMessage, + phone), + GNUNET_MQ_hd_fixed_size (phone_suspend, + GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_SUSPEND, + struct ClientPhoneSuspendMessage, + phone), + GNUNET_MQ_hd_fixed_size (phone_resume, + GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RESUME, + struct ClientPhoneResumeMessage, + phone), + GNUNET_MQ_hd_var_size (phone_audio, + GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO, + struct ClientAudioMessage, + phone), GNUNET_MQ_handler_end () }; struct GNUNET_MQ_Envelope *e; diff --git a/src/conversation/conversation_api_call.c b/src/conversation/conversation_api_call.c index af05f3ea6..17e26465e 100644 --- a/src/conversation/conversation_api_call.c +++ b/src/conversation/conversation_api_call.c @@ -543,29 +543,29 @@ GNUNET_CONVERSATION_call_start (const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_CONVERSATION_CallEventHandler event_handler, void *event_handler_cls) { - GNUNET_MQ_hd_fixed_size (call_suspend, - GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_SUSPEND, - struct ClientPhoneSuspendMessage); - GNUNET_MQ_hd_fixed_size (call_resume, - GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RESUME, - struct ClientPhoneResumeMessage); - GNUNET_MQ_hd_fixed_size (call_picked_up, - GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICKED_UP, - struct ClientPhonePickedupMessage); - GNUNET_MQ_hd_fixed_size (call_hangup, - GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP, - struct ClientPhoneHangupMessage); - GNUNET_MQ_hd_var_size (call_audio, - GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO, - struct ClientAudioMessage); struct GNUNET_CONVERSATION_Call *call = GNUNET_new (struct GNUNET_CONVERSATION_Call); struct GNUNET_MQ_MessageHandler handlers[] = { - make_call_suspend_handler (call), - make_call_resume_handler (call), - make_call_picked_up_handler (call), - make_call_hangup_handler (call), - make_call_audio_handler (call), + GNUNET_MQ_hd_fixed_size (call_suspend, + GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_SUSPEND, + struct ClientPhoneSuspendMessage, + call), + GNUNET_MQ_hd_fixed_size (call_resume, + GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RESUME, + struct ClientPhoneResumeMessage, + call), + GNUNET_MQ_hd_fixed_size (call_picked_up, + GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICKED_UP, + struct ClientPhonePickedupMessage, + call), + GNUNET_MQ_hd_fixed_size (call_hangup, + GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP, + struct ClientPhoneHangupMessage, + call), + GNUNET_MQ_hd_var_size (call_audio, + GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO, + struct ClientAudioMessage, + call), GNUNET_MQ_handler_end () }; struct GNUNET_CRYPTO_EcdsaPublicKey my_zone; diff --git a/src/core/core_api.c b/src/core/core_api.c index caf614afc..6055b99c1 100644 --- a/src/core/core_api.c +++ b/src/core/core_api.c @@ -767,31 +767,31 @@ handle_send_ready (void *cls, static void reconnect (struct GNUNET_CORE_Handle *h) { - GNUNET_MQ_hd_fixed_size (init_reply, - GNUNET_MESSAGE_TYPE_CORE_INIT_REPLY, - struct InitReplyMessage); - GNUNET_MQ_hd_fixed_size (connect_notify, - GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT, - struct ConnectNotifyMessage); - GNUNET_MQ_hd_fixed_size (disconnect_notify, - GNUNET_MESSAGE_TYPE_CORE_NOTIFY_DISCONNECT, - struct DisconnectNotifyMessage); - GNUNET_MQ_hd_var_size (notify_inbound, - GNUNET_MESSAGE_TYPE_CORE_NOTIFY_INBOUND, - struct NotifyTrafficMessage); - GNUNET_MQ_hd_var_size (notify_outbound, - GNUNET_MESSAGE_TYPE_CORE_NOTIFY_OUTBOUND, - struct NotifyTrafficMessage); - GNUNET_MQ_hd_fixed_size (send_ready, - GNUNET_MESSAGE_TYPE_CORE_SEND_READY, - struct SendMessageReady); - struct GNUNET_MQ_MessageHandler handlers[] = { - make_init_reply_handler (h), - make_connect_notify_handler (h), - make_disconnect_notify_handler (h), - make_notify_inbound_handler (h), - make_notify_outbound_handler (h), - make_send_ready_handler (h), + struct GNUNET_MQ_MessageHandler handlers[] = { + GNUNET_MQ_hd_fixed_size (init_reply, + GNUNET_MESSAGE_TYPE_CORE_INIT_REPLY, + struct InitReplyMessage, + h), + GNUNET_MQ_hd_fixed_size (connect_notify, + GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT, + struct ConnectNotifyMessage, + h), + GNUNET_MQ_hd_fixed_size (disconnect_notify, + GNUNET_MESSAGE_TYPE_CORE_NOTIFY_DISCONNECT, + struct DisconnectNotifyMessage, + h), + GNUNET_MQ_hd_var_size (notify_inbound, + GNUNET_MESSAGE_TYPE_CORE_NOTIFY_INBOUND, + struct NotifyTrafficMessage, + h), + GNUNET_MQ_hd_var_size (notify_outbound, + GNUNET_MESSAGE_TYPE_CORE_NOTIFY_OUTBOUND, + struct NotifyTrafficMessage, + h), + GNUNET_MQ_hd_fixed_size (send_ready, + GNUNET_MESSAGE_TYPE_CORE_SEND_READY, + struct SendMessageReady, + h), GNUNET_MQ_handler_end () }; struct InitMessage *init; diff --git a/src/core/core_api_2.c b/src/core/core_api_2.c index 536fe597c..d810bf2ec 100644 --- a/src/core/core_api_2.c +++ b/src/core/core_api_2.c @@ -700,27 +700,27 @@ handle_send_ready (void *cls, static void reconnect (struct GNUNET_CORE_Handle *h) { - GNUNET_MQ_hd_fixed_size (init_reply, - GNUNET_MESSAGE_TYPE_CORE_INIT_REPLY, - struct InitReplyMessage); - GNUNET_MQ_hd_fixed_size (connect_notify, - GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT, - struct ConnectNotifyMessage); - GNUNET_MQ_hd_fixed_size (disconnect_notify, - GNUNET_MESSAGE_TYPE_CORE_NOTIFY_DISCONNECT, - struct DisconnectNotifyMessage); - GNUNET_MQ_hd_var_size (notify_inbound, - GNUNET_MESSAGE_TYPE_CORE_NOTIFY_INBOUND, - struct NotifyTrafficMessage); - GNUNET_MQ_hd_fixed_size (send_ready, - GNUNET_MESSAGE_TYPE_CORE_SEND_READY, - struct SendMessageReady); struct GNUNET_MQ_MessageHandler handlers[] = { - make_init_reply_handler (h), - make_connect_notify_handler (h), - make_disconnect_notify_handler (h), - make_notify_inbound_handler (h), - make_send_ready_handler (h), + GNUNET_MQ_hd_fixed_size (init_reply, + GNUNET_MESSAGE_TYPE_CORE_INIT_REPLY, + struct InitReplyMessage, + h), + GNUNET_MQ_hd_fixed_size (connect_notify, + GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT, + struct ConnectNotifyMessage, + h), + GNUNET_MQ_hd_fixed_size (disconnect_notify, + GNUNET_MESSAGE_TYPE_CORE_NOTIFY_DISCONNECT, + struct DisconnectNotifyMessage, + h), + GNUNET_MQ_hd_var_size (notify_inbound, + GNUNET_MESSAGE_TYPE_CORE_NOTIFY_INBOUND, + struct NotifyTrafficMessage, + h), + GNUNET_MQ_hd_fixed_size (send_ready, + GNUNET_MESSAGE_TYPE_CORE_SEND_READY, + struct SendMessageReady, + h), GNUNET_MQ_handler_end () }; struct InitMessage *init; diff --git a/src/core/core_api_monitor_peers.c b/src/core/core_api_monitor_peers.c index bafcd3e94..1455eb2b0 100644 --- a/src/core/core_api_monitor_peers.c +++ b/src/core/core_api_monitor_peers.c @@ -114,11 +114,11 @@ handle_receive_info (void *cls, static void reconnect (struct GNUNET_CORE_MonitorHandle *mh) { - GNUNET_MQ_hd_fixed_size (receive_info, - GNUNET_MESSAGE_TYPE_CORE_MONITOR_NOTIFY, - struct MonitorNotifyMessage); struct GNUNET_MQ_MessageHandler handlers[] = { - make_receive_info_handler (mh), + GNUNET_MQ_hd_fixed_size (receive_info, + GNUNET_MESSAGE_TYPE_CORE_MONITOR_NOTIFY, + struct MonitorNotifyMessage, + mh), GNUNET_MQ_handler_end () }; struct GNUNET_MQ_Envelope *env; diff --git a/src/core/gnunet-service-core_kx.c b/src/core/gnunet-service-core_kx.c index b2949a688..6f6786d89 100644 --- a/src/core/gnunet-service-core_kx.c +++ b/src/core/gnunet-service-core_kx.c @@ -1814,23 +1814,23 @@ int GSC_KX_init (struct GNUNET_CRYPTO_EddsaPrivateKey *pk, struct GNUNET_SERVER_Handle *server) { - GNUNET_MQ_hd_fixed_size (ephemeral_key, - GNUNET_MESSAGE_TYPE_CORE_EPHEMERAL_KEY, - struct EphemeralKeyMessage); - GNUNET_MQ_hd_fixed_size (ping, - GNUNET_MESSAGE_TYPE_CORE_PING, - struct PingMessage); - GNUNET_MQ_hd_fixed_size (pong, - GNUNET_MESSAGE_TYPE_CORE_PONG, - struct PongMessage); - GNUNET_MQ_hd_var_size (encrypted, - GNUNET_MESSAGE_TYPE_CORE_ENCRYPTED_MESSAGE, - struct EncryptedMessage); struct GNUNET_MQ_MessageHandler handlers[] = { - make_ephemeral_key_handler (NULL), - make_ping_handler (NULL), - make_pong_handler (NULL), - make_encrypted_handler (NULL), + GNUNET_MQ_hd_fixed_size (ephemeral_key, + GNUNET_MESSAGE_TYPE_CORE_EPHEMERAL_KEY, + struct EphemeralKeyMessage, + NULL), + GNUNET_MQ_hd_fixed_size (ping, + GNUNET_MESSAGE_TYPE_CORE_PING, + struct PingMessage, + NULL), + GNUNET_MQ_hd_fixed_size (pong, + GNUNET_MESSAGE_TYPE_CORE_PONG, + struct PongMessage, + NULL), + GNUNET_MQ_hd_var_size (encrypted, + GNUNET_MESSAGE_TYPE_CORE_ENCRYPTED_MESSAGE, + struct EncryptedMessage, + NULL), GNUNET_MQ_handler_end() }; diff --git a/src/core/test_core_api.c b/src/core/test_core_api.c index 772ded991..650c89cda 100644 --- a/src/core/test_core_api.c +++ b/src/core/test_core_api.c @@ -225,12 +225,12 @@ static void init_notify (void *cls, const struct GNUNET_PeerIdentity *my_identity) { - GNUNET_MQ_hd_fixed_size (test, - MTYPE, - struct GNUNET_MessageHeader); struct PeerContext *p = cls; struct GNUNET_MQ_MessageHandler handlers[] = { - make_test_handler (NULL), + GNUNET_MQ_hd_fixed_size (test, + MTYPE, + struct GNUNET_MessageHeader, + NULL); GNUNET_MQ_handler_end () }; @@ -298,11 +298,11 @@ run (void *cls, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) { - GNUNET_MQ_hd_fixed_size (test, - MTYPE, - struct GNUNET_MessageHeader); struct GNUNET_MQ_MessageHandler handlers[] = { - make_test_handler (NULL), + GNUNET_MQ_hd_fixed_size (test, + MTYPE, + struct GNUNET_MessageHeader, + NULL); GNUNET_MQ_handler_end () }; diff --git a/src/core/test_core_api_reliability.c b/src/core/test_core_api_reliability.c index d7d4a6bd6..4d8d54028 100644 --- a/src/core/test_core_api_reliability.c +++ b/src/core/test_core_api_reliability.c @@ -322,12 +322,12 @@ static void init_notify (void *cls, const struct GNUNET_PeerIdentity *my_identity) { - GNUNET_MQ_hd_var_size (test, - MTYPE, - struct TestMessage); struct PeerContext *p = cls; struct GNUNET_MQ_MessageHandler handlers[] = { - make_test_handler (NULL), + GNUNET_MQ_hd_var_size (test, + MTYPE, + struct TestMessage, + NULL); GNUNET_MQ_handler_end () }; @@ -442,11 +442,11 @@ run (void *cls, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) { - GNUNET_MQ_hd_fixed_size (test, - MTYPE, - struct TestMessage); struct GNUNET_MQ_MessageHandler handlers[] = { - make_test_handler (NULL), + GNUNET_MQ_hd_fixed_size (test, + MTYPE, + struct TestMessage, + NULL); GNUNET_MQ_handler_end () }; diff --git a/src/core/test_core_api_send_to_self.c b/src/core/test_core_api_send_to_self.c index 111aea900..d29da651b 100644 --- a/src/core/test_core_api_send_to_self.c +++ b/src/core/test_core_api_send_to_self.c @@ -150,11 +150,11 @@ run (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_TESTING_Peer *peer) { - GNUNET_MQ_hd_fixed_size (test, - GNUNET_MESSAGE_TYPE_DUMMY, - struct GNUNET_MessageHeader); struct GNUNET_MQ_MessageHandler handlers[] = { - make_test_handler (NULL), + GNUNET_MQ_hd_fixed_size (test, + GNUNET_MESSAGE_TYPE_DUMMY, + struct GNUNET_MessageHeader, + NULL), GNUNET_MQ_handler_end () }; diff --git a/src/core/test_core_quota_compliance.c b/src/core/test_core_quota_compliance.c index 31063b814..4dee958f2 100644 --- a/src/core/test_core_quota_compliance.c +++ b/src/core/test_core_quota_compliance.c @@ -461,12 +461,12 @@ static void init_notify (void *cls, const struct GNUNET_PeerIdentity *my_identity) { - GNUNET_MQ_hd_fixed_size (test, - MTYPE, - struct TestMessage); struct PeerContext *p = cls; struct GNUNET_MQ_MessageHandler handlers[] = { - make_test_handler (NULL), + GNUNET_MQ_hd_fixed_size (test, + MTYPE, + struct TestMessage, + NULL), GNUNET_MQ_handler_end () }; @@ -593,11 +593,11 @@ run (void *cls, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) { - GNUNET_MQ_hd_fixed_size (test, - MTYPE, - struct TestMessage); struct GNUNET_MQ_MessageHandler handlers[] = { - make_test_handler (NULL), + GNUNET_MQ_hd_fixed_size (test, + MTYPE, + struct TestMessage, + NULL), GNUNET_MQ_handler_end () }; diff --git a/src/datastore/datastore_api.c b/src/datastore/datastore_api.c index 3f8ef9db4..d75a58552 100644 --- a/src/datastore/datastore_api.c +++ b/src/datastore/datastore_api.c @@ -848,20 +848,20 @@ handle_data_end (void *cls, static void try_reconnect (void *cls) { - GNUNET_MQ_hd_var_size (status, - GNUNET_MESSAGE_TYPE_DATASTORE_STATUS, - struct StatusMessage); - GNUNET_MQ_hd_var_size (data, - GNUNET_MESSAGE_TYPE_DATASTORE_DATA, - struct DataMessage); - GNUNET_MQ_hd_fixed_size (data_end, - GNUNET_MESSAGE_TYPE_DATASTORE_DATA_END, - struct GNUNET_MessageHeader); struct GNUNET_DATASTORE_Handle *h = cls; struct GNUNET_MQ_MessageHandler handlers[] = { - make_status_handler (h), - make_data_handler (h), - make_data_end_handler (h), + GNUNET_MQ_hd_var_size (status, + GNUNET_MESSAGE_TYPE_DATASTORE_STATUS, + struct StatusMessage, + h), + GNUNET_MQ_hd_var_size (data, + GNUNET_MESSAGE_TYPE_DATASTORE_DATA, + struct DataMessage, + h), + GNUNET_MQ_hd_fixed_size (data_end, + GNUNET_MESSAGE_TYPE_DATASTORE_DATA_END, + struct GNUNET_MessageHeader, + h), GNUNET_MQ_handler_end () }; diff --git a/src/dht/dht_api.c b/src/dht/dht_api.c index 0ada41662..57880165e 100644 --- a/src/dht/dht_api.c +++ b/src/dht/dht_api.c @@ -842,27 +842,27 @@ handle_put_confirmation (void *cls, static int try_connect (struct GNUNET_DHT_Handle *h) { - GNUNET_MQ_hd_var_size (monitor_get, - GNUNET_MESSAGE_TYPE_DHT_MONITOR_GET, - struct GNUNET_DHT_MonitorGetMessage); - GNUNET_MQ_hd_var_size (monitor_get_resp, - GNUNET_MESSAGE_TYPE_DHT_MONITOR_GET_RESP, - struct GNUNET_DHT_MonitorGetRespMessage); - GNUNET_MQ_hd_var_size (monitor_put, - GNUNET_MESSAGE_TYPE_DHT_MONITOR_PUT, - struct GNUNET_DHT_MonitorPutMessage); - GNUNET_MQ_hd_var_size (client_result, - GNUNET_MESSAGE_TYPE_DHT_CLIENT_RESULT, - struct GNUNET_DHT_ClientResultMessage); - GNUNET_MQ_hd_fixed_size (put_confirmation, - GNUNET_MESSAGE_TYPE_DHT_CLIENT_PUT_OK, - struct GNUNET_DHT_ClientPutConfirmationMessage); struct GNUNET_MQ_MessageHandler handlers[] = { - make_monitor_get_handler (h), - make_monitor_get_resp_handler (h), - make_monitor_put_handler (h), - make_client_result_handler (h), - make_put_confirmation_handler (h), + GNUNET_MQ_hd_var_size (monitor_get, + GNUNET_MESSAGE_TYPE_DHT_MONITOR_GET, + struct GNUNET_DHT_MonitorGetMessage, + h), + GNUNET_MQ_hd_var_size (monitor_get_resp, + GNUNET_MESSAGE_TYPE_DHT_MONITOR_GET_RESP, + struct GNUNET_DHT_MonitorGetRespMessage, + h), + GNUNET_MQ_hd_var_size (monitor_put, + GNUNET_MESSAGE_TYPE_DHT_MONITOR_PUT, + struct GNUNET_DHT_MonitorPutMessage, + h), + GNUNET_MQ_hd_var_size (client_result, + GNUNET_MESSAGE_TYPE_DHT_CLIENT_RESULT, + struct GNUNET_DHT_ClientResultMessage, + h), + GNUNET_MQ_hd_fixed_size (put_confirmation, + GNUNET_MESSAGE_TYPE_DHT_CLIENT_PUT_OK, + struct GNUNET_DHT_ClientPutConfirmationMessage, + h), GNUNET_MQ_handler_end () }; if (NULL != h->mq) diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c index 2dd6c800b..683e0991a 100644 --- a/src/dht/gnunet-service-dht_neighbours.c +++ b/src/dht/gnunet-service-dht_neighbours.c @@ -2298,19 +2298,19 @@ handle_dht_p2p_result (void *cls, int GDS_NEIGHBOURS_init () { - GNUNET_MQ_hd_var_size (dht_p2p_get, - GNUNET_MESSAGE_TYPE_DHT_P2P_GET, - struct PeerGetMessage); - GNUNET_MQ_hd_var_size (dht_p2p_put, - GNUNET_MESSAGE_TYPE_DHT_P2P_PUT, - struct PeerPutMessage); - GNUNET_MQ_hd_var_size (dht_p2p_result, - GNUNET_MESSAGE_TYPE_DHT_P2P_RESULT, - struct PeerResultMessage); struct GNUNET_MQ_MessageHandler core_handlers[] = { - make_dht_p2p_get_handler (NULL), - make_dht_p2p_put_handler (NULL), - make_dht_p2p_result_handler (NULL), + GNUNET_MQ_hd_var_size (dht_p2p_get, + GNUNET_MESSAGE_TYPE_DHT_P2P_GET, + struct PeerGetMessage, + NULL), + GNUNET_MQ_hd_var_size (dht_p2p_put, + GNUNET_MESSAGE_TYPE_DHT_P2P_PUT, + struct PeerPutMessage, + NULL), + GNUNET_MQ_hd_var_size (dht_p2p_result, + GNUNET_MESSAGE_TYPE_DHT_P2P_RESULT, + struct PeerResultMessage, + NULL), GNUNET_MQ_handler_end () }; unsigned long long temp_config_num; diff --git a/src/dht/gnunet-service-wdht_neighbours.c b/src/dht/gnunet-service-wdht_neighbours.c index 1d5fd67c0..a6ebdb033 100644 --- a/src/dht/gnunet-service-wdht_neighbours.c +++ b/src/dht/gnunet-service-wdht_neighbours.c @@ -1666,23 +1666,23 @@ handle_dht_p2p_trail_route (void *cls, int GDS_NEIGHBOURS_init (void) { - GNUNET_MQ_hd_fixed_size (dht_p2p_random_walk, - GNUNET_MESSAGE_TYPE_WDHT_RANDOM_WALK, - struct RandomWalkMessage); - GNUNET_MQ_hd_fixed_size (dht_p2p_random_walk_response, - GNUNET_MESSAGE_TYPE_WDHT_RANDOM_WALK_RESPONSE, - struct RandomWalkResponseMessage); - GNUNET_MQ_hd_fixed_size (dht_p2p_trail_destroy, - GNUNET_MESSAGE_TYPE_WDHT_TRAIL_DESTROY, - struct TrailDestroyMessage); - GNUNET_MQ_hd_var_size (dht_p2p_trail_route, - GNUNET_MESSAGE_TYPE_WDHT_TRAIL_ROUTE, - struct TrailRouteMessage); struct GNUNET_MQ_MessageHandler core_handlers[] = { - make_dht_p2p_random_walk_handler (NULL), - make_dht_p2p_random_walk_response_handler (NULL), - make_dht_p2p_trail_destroy_handler (NULL), - make_dht_p2p_trail_route_handler (NULL), + GNUNET_MQ_hd_fixed_size (dht_p2p_random_walk, + GNUNET_MESSAGE_TYPE_WDHT_RANDOM_WALK, + struct RandomWalkMessage, + NULL), + GNUNET_MQ_hd_fixed_size (dht_p2p_random_walk_response, + GNUNET_MESSAGE_TYPE_WDHT_RANDOM_WALK_RESPONSE, + struct RandomWalkResponseMessage, + NULL), + GNUNET_MQ_hd_fixed_size (dht_p2p_trail_destroy, + GNUNET_MESSAGE_TYPE_WDHT_TRAIL_DESTROY, + struct TrailDestroyMessage, + NULL), + GNUNET_MQ_hd_var_size (dht_p2p_trail_route, + GNUNET_MESSAGE_TYPE_WDHT_TRAIL_ROUTE, + struct TrailRouteMessage, + NULL), GNUNET_MQ_handler_end () }; diff --git a/src/dht/gnunet-service-xdht_neighbours.c b/src/dht/gnunet-service-xdht_neighbours.c index 7bfc11918..9ae39e0a0 100644 --- a/src/dht/gnunet-service-xdht_neighbours.c +++ b/src/dht/gnunet-service-xdht_neighbours.c @@ -6039,55 +6039,55 @@ finger_table_init () int GDS_NEIGHBOURS_init (void) { - GNUNET_MQ_hd_var_size (dht_p2p_put, - GNUNET_MESSAGE_TYPE_XDHT_P2P_PUT, - struct PeerPutMessage); - GNUNET_MQ_hd_var_size (dht_p2p_get, - GNUNET_MESSAGE_TYPE_XDHT_P2P_GET, - struct PeerGetMessage); - GNUNET_MQ_hd_var_size (dht_p2p_get_result, - GNUNET_MESSAGE_TYPE_XDHT_P2P_GET_RESULT, - struct PeerGetResultMessage); - GNUNET_MQ_hd_var_size (dht_p2p_trail_setup, - GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_SETUP, - struct PeerTrailSetupMessage); - GNUNET_MQ_hd_var_size (dht_p2p_trail_setup_result, - GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_SETUP_RESULT, - struct PeerTrailSetupResultMessage); - GNUNET_MQ_hd_var_size (dht_p2p_verify_successor, - GNUNET_MESSAGE_TYPE_XDHT_P2P_VERIFY_SUCCESSOR, - struct PeerVerifySuccessorMessage); - GNUNET_MQ_hd_var_size (dht_p2p_verify_successor_result, - GNUNET_MESSAGE_TYPE_XDHT_P2P_VERIFY_SUCCESSOR_RESULT, - struct PeerVerifySuccessorResultMessage); - GNUNET_MQ_hd_var_size (dht_p2p_notify_new_successor, - GNUNET_MESSAGE_TYPE_XDHT_P2P_NOTIFY_NEW_SUCCESSOR, - struct PeerNotifyNewSuccessorMessage); - GNUNET_MQ_hd_var_size (dht_p2p_trail_setup_rejection, - GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_SETUP_REJECTION, - struct PeerTrailRejectionMessage); - GNUNET_MQ_hd_fixed_size (dht_p2p_trail_teardown, - GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_TEARDOWN, - struct PeerTrailTearDownMessage); - GNUNET_MQ_hd_var_size (dht_p2p_add_trail, - GNUNET_MESSAGE_TYPE_XDHT_P2P_ADD_TRAIL, - struct PeerAddTrailMessage); - GNUNET_MQ_hd_fixed_size (dht_p2p_notify_succ_confirmation, - GNUNET_MESSAGE_TYPE_XDHT_P2P_NOTIFY_SUCCESSOR_CONFIRMATION, - struct PeerNotifyConfirmationMessage); struct GNUNET_MQ_MessageHandler core_handlers[] = { - make_dht_p2p_put_handler (NULL), - make_dht_p2p_get_handler (NULL), - make_dht_p2p_get_result_handler (NULL), - make_dht_p2p_trail_setup_handler (NULL), - make_dht_p2p_trail_setup_result_handler (NULL), - make_dht_p2p_verify_successor_handler (NULL), - make_dht_p2p_verify_successor_result_handler (NULL), - make_dht_p2p_notify_new_successor_handler (NULL), - make_dht_p2p_trail_setup_rejection_handler (NULL), - make_dht_p2p_trail_teardown_handler (NULL), - make_dht_p2p_add_trail_handler (NULL), - make_dht_p2p_notify_succ_confirmation_handler (NULL), + GNUNET_MQ_hd_var_size (dht_p2p_put, + GNUNET_MESSAGE_TYPE_XDHT_P2P_PUT, + struct PeerPutMessage, + NULL), + GNUNET_MQ_hd_var_size (dht_p2p_get, + GNUNET_MESSAGE_TYPE_XDHT_P2P_GET, + struct PeerGetMessage, + NULL), + GNUNET_MQ_hd_var_size (dht_p2p_get_result, + GNUNET_MESSAGE_TYPE_XDHT_P2P_GET_RESULT, + struct PeerGetResultMessage, + NULL), + GNUNET_MQ_hd_var_size (dht_p2p_trail_setup, + GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_SETUP, + struct PeerTrailSetupMessage, + NULL), + GNUNET_MQ_hd_var_size (dht_p2p_trail_setup_result, + GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_SETUP_RESULT, + struct PeerTrailSetupResultMessag, + NULL), + GNUNET_MQ_hd_var_size (dht_p2p_verify_successor, + GNUNET_MESSAGE_TYPE_XDHT_P2P_VERIFY_SUCCESSOR, + struct PeerVerifySuccessorMessage, + NULL), + GNUNET_MQ_hd_var_size (dht_p2p_verify_successor_result, + GNUNET_MESSAGE_TYPE_XDHT_P2P_VERIFY_SUCCESSOR_RESULT, + struct PeerVerifySuccessorResultMessage, + NULL), + GNUNET_MQ_hd_var_size (dht_p2p_notify_new_successor, + GNUNET_MESSAGE_TYPE_XDHT_P2P_NOTIFY_NEW_SUCCESSOR, + struct PeerNotifyNewSuccessorMessage, + NULL), + GNUNET_MQ_hd_var_size (dht_p2p_trail_setup_rejection, + GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_SETUP_REJECTION, + struct PeerTrailRejectionMessage, + NULL), + GNUNET_MQ_hd_fixed_size (dht_p2p_trail_teardown, + GNUNET_MESSAGE_TYPE_XDHT_P2P_TRAIL_TEARDOWN, + struct PeerTrailTearDownMessage, + NULL), + GNUNET_MQ_hd_var_size (dht_p2p_add_trail, + GNUNET_MESSAGE_TYPE_XDHT_P2P_ADD_TRAIL, + struct PeerAddTrailMessage, + NULL), + GNUNET_MQ_hd_fixed_size (dht_p2p_notify_succ_confirmation, + GNUNET_MESSAGE_TYPE_XDHT_P2P_NOTIFY_SUCCESSOR_CONFIRMATION, + struct PeerNotifyConfirmationMessage, + NULL), GNUNET_MQ_handler_end () }; diff --git a/src/dns/dns_api.c b/src/dns/dns_api.c index 08d5df4a1..4803fe3fc 100644 --- a/src/dns/dns_api.c +++ b/src/dns/dns_api.c @@ -205,12 +205,12 @@ handle_request (void *cls, static void reconnect (void *cls) { - GNUNET_MQ_hd_var_size (request, - GNUNET_MESSAGE_TYPE_DNS_CLIENT_REQUEST, - struct GNUNET_DNS_Request); struct GNUNET_DNS_Handle *dh = cls; struct GNUNET_MQ_MessageHandler handlers[] = { - make_request_handler (dh), + GNUNET_MQ_hd_var_size (request, + GNUNET_MESSAGE_TYPE_DNS_CLIENT_REQUEST, + struct GNUNET_DNS_Request, + dh), GNUNET_MQ_handler_end () }; struct GNUNET_MQ_Envelope *env; diff --git a/src/dv/dv_api.c b/src/dv/dv_api.c index 76a6ea484..43b6c7db1 100644 --- a/src/dv/dv_api.c +++ b/src/dv/dv_api.c @@ -314,23 +314,23 @@ mq_error_handler (void *cls, static void reconnect (struct GNUNET_DV_ServiceHandle *sh) { - GNUNET_MQ_hd_fixed_size (connect, - GNUNET_MESSAGE_TYPE_DV_CONNECT, - struct GNUNET_DV_ConnectMessage); - GNUNET_MQ_hd_fixed_size (disconnect, - GNUNET_MESSAGE_TYPE_DV_DISCONNECT, - struct GNUNET_DV_DisconnectMessage); - GNUNET_MQ_hd_fixed_size (distance_update, - GNUNET_MESSAGE_TYPE_DV_DISTANCE_CHANGED, - struct GNUNET_DV_DistanceUpdateMessage); - GNUNET_MQ_hd_var_size (received, - GNUNET_MESSAGE_TYPE_DV_RECV, - struct GNUNET_DV_ReceivedMessage); struct GNUNET_MQ_MessageHandler handlers[] = { - make_connect_handler (sh), - make_disconnect_handler (sh), - make_distance_update_handler (sh), - make_received_handler (sh), + GNUNET_MQ_hd_fixed_size (connect, + GNUNET_MESSAGE_TYPE_DV_CONNECT, + struct GNUNET_DV_ConnectMessage, + sh), + GNUNET_MQ_hd_fixed_size (disconnect, + GNUNET_MESSAGE_TYPE_DV_DISCONNECT, + struct GNUNET_DV_DisconnectMessage, + sh), + GNUNET_MQ_hd_fixed_size (distance_update, + GNUNET_MESSAGE_TYPE_DV_DISTANCE_CHANGED, + struct GNUNET_DV_DistanceUpdateMessage, + sh), + GNUNET_MQ_hd_var_size (received, + GNUNET_MESSAGE_TYPE_DV_RECV, + struct GNUNET_DV_ReceivedMessage, + sh), GNUNET_MQ_handler_end () }; struct GNUNET_MessageHeader *sm; diff --git a/src/dv/gnunet-service-dv.c b/src/dv/gnunet-service-dv.c index 11ec13387..667970b75 100644 --- a/src/dv/gnunet-service-dv.c +++ b/src/dv/gnunet-service-dv.c @@ -2033,11 +2033,11 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, const struct GNUNET_CONFIGURATION_Handle *c) { - GNUNET_MQ_hd_var_size (dv_route_message, - GNUNET_MESSAGE_TYPE_DV_ROUTE, - struct RouteMessage); struct GNUNET_MQ_MessageHandler core_handlers[] = { - make_dv_route_message_handler (NULL), + GNUNET_MQ_hd_var_size (dv_route_message, + GNUNET_MESSAGE_TYPE_DV_ROUTE, + struct RouteMessage, + NULL), GNUNET_MQ_handler_end () }; static struct GNUNET_SERVER_MessageHandler plugin_handlers[] = { diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c index 98c76882a..eacc3c2df 100644 --- a/src/fs/fs_download.c +++ b/src/fs/fs_download.c @@ -1325,12 +1325,12 @@ download_mq_error_handler (void *cls, static void do_reconnect (void *cls) { - GNUNET_MQ_hd_var_size (put, - GNUNET_MESSAGE_TYPE_FS_PUT, - struct ClientPutMessage); struct GNUNET_FS_DownloadContext *dc = cls; struct GNUNET_MQ_MessageHandler handlers[] = { - make_put_handler (dc), + GNUNET_MQ_hd_var_size (put, + GNUNET_MESSAGE_TYPE_FS_PUT, + struct ClientPutMessage, + dc), GNUNET_MQ_handler_end () }; diff --git a/src/fs/fs_list_indexed.c b/src/fs/fs_list_indexed.c index 21385d40b..67183fce2 100644 --- a/src/fs/fs_list_indexed.c +++ b/src/fs/fs_list_indexed.c @@ -169,17 +169,17 @@ GNUNET_FS_get_indexed_files (struct GNUNET_FS_Handle *h, GNUNET_FS_IndexedFileProcessor iterator, void *iterator_cls) { - GNUNET_MQ_hd_fixed_size (index_info_end, - GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_END, - struct GNUNET_MessageHeader); - GNUNET_MQ_hd_var_size (index_info, - GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_ENTRY, - struct IndexInfoMessage); struct GNUNET_FS_GetIndexedContext *gic = GNUNET_new (struct GNUNET_FS_GetIndexedContext); struct GNUNET_MQ_MessageHandler handlers[] = { - make_index_info_end_handler (gic), - make_index_info_handler (gic), + GNUNET_MQ_hd_fixed_size (index_info_end, + GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_END, + struct GNUNET_MessageHeader, + gic), + GNUNET_MQ_hd_var_size (index_info, + GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_ENTRY, + struct IndexInfoMessage, + gic), GNUNET_MQ_handler_end () }; struct GNUNET_MQ_Envelope *env; diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c index 01305d678..5820c3d0c 100644 --- a/src/fs/fs_publish.c +++ b/src/fs/fs_publish.c @@ -795,16 +795,16 @@ static void hash_for_index_cb (void *cls, const struct GNUNET_HashCode *res) { - GNUNET_MQ_hd_fixed_size (index_start_ok, - GNUNET_MESSAGE_TYPE_FS_INDEX_START_OK, - struct GNUNET_MessageHeader); - GNUNET_MQ_hd_var_size (index_start_failed, - GNUNET_MESSAGE_TYPE_FS_INDEX_START_FAILED, - struct GNUNET_MessageHeader); struct GNUNET_FS_PublishContext *pc = cls; struct GNUNET_MQ_MessageHandler handlers[] = { - make_index_start_ok_handler (pc), - make_index_start_failed_handler (pc), + GNUNET_MQ_hd_fixed_size (index_start_ok, + GNUNET_MESSAGE_TYPE_FS_INDEX_START_OK, + struct GNUNET_MessageHeader, + pc), + GNUNET_MQ_hd_var_size (index_start_failed, + GNUNET_MESSAGE_TYPE_FS_INDEX_START_FAILED, + struct GNUNET_MessageHeader, + pc), GNUNET_MQ_handler_end () }; struct GNUNET_FS_FileInformation *p; @@ -1003,11 +1003,11 @@ loc_mq_error_handler (void *cls, static void create_loc_uri (struct GNUNET_FS_PublishContext *pc) { - GNUNET_MQ_hd_fixed_size (signature_response, - GNUNET_MESSAGE_TYPE_FS_REQUEST_LOC_SIGNATURE, - struct ResponseLocSignatureMessage); struct GNUNET_MQ_MessageHandler handlers[] = { - make_signature_response_handler (pc), + GNUNET_MQ_hd_fixed_size (signature_response, + GNUNET_MESSAGE_TYPE_FS_REQUEST_LOC_SIGNATURE, + struct ResponseLocSignatureMessage, + pc), GNUNET_MQ_handler_end () }; struct GNUNET_MQ_Envelope *env; diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c index 8a3652e3f..7874bb6e0 100644 --- a/src/fs/fs_search.c +++ b/src/fs/fs_search.c @@ -1234,12 +1234,12 @@ search_mq_error_handler (void *cls, static void do_reconnect (void *cls) { - GNUNET_MQ_hd_var_size (result, - GNUNET_MESSAGE_TYPE_FS_PUT, - struct ClientPutMessage); struct GNUNET_FS_SearchContext *sc = cls; struct GNUNET_MQ_MessageHandler handlers[] = { - make_result_handler (sc), + GNUNET_MQ_hd_var_size (result, + GNUNET_MESSAGE_TYPE_FS_PUT, + struct ClientPutMessage, + sc), GNUNET_MQ_handler_end () }; diff --git a/src/fs/fs_unindex.c b/src/fs/fs_unindex.c index f43725a59..2a024ecbb 100644 --- a/src/fs/fs_unindex.c +++ b/src/fs/fs_unindex.c @@ -288,11 +288,11 @@ unindex_mq_error_handler (void *cls, static void unindex_finish (struct GNUNET_FS_UnindexContext *uc) { - GNUNET_MQ_hd_fixed_size (unindex_response, - GNUNET_MESSAGE_TYPE_FS_UNINDEX_OK, - struct GNUNET_MessageHeader); struct GNUNET_MQ_MessageHandler handlers[] = { - make_unindex_response_handler (uc), + GNUNET_MQ_hd_fixed_size (unindex_response, + GNUNET_MESSAGE_TYPE_FS_UNINDEX_OK, + struct GNUNET_MessageHeader, + uc), GNUNET_MQ_handler_end () }; char *emsg; diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c index bc0da09bc..4131b1670 100644 --- a/src/fs/gnunet-service-fs.c +++ b/src/fs/gnunet-service-fs.c @@ -617,22 +617,22 @@ static int main_init (struct GNUNET_SERVER_Handle *server, const struct GNUNET_CONFIGURATION_Handle *c) { - GNUNET_MQ_hd_var_size (p2p_get, - GNUNET_MESSAGE_TYPE_FS_GET, - struct GetMessage); - GNUNET_MQ_hd_var_size (p2p_put, - GNUNET_MESSAGE_TYPE_FS_PUT, - struct PutMessage); - GNUNET_MQ_hd_fixed_size (p2p_migration_stop, - GNUNET_MESSAGE_TYPE_FS_MIGRATION_STOP, - struct MigrationStopMessage); struct GNUNET_MQ_MessageHandler no_p2p_handlers[] = { GNUNET_MQ_handler_end () }; struct GNUNET_MQ_MessageHandler p2p_handlers[] = { - make_p2p_get_handler (NULL), - make_p2p_put_handler (NULL), - make_p2p_migration_stop_handler (NULL), + GNUNET_MQ_hd_var_size (p2p_get, + GNUNET_MESSAGE_TYPE_FS_GET, + struct GetMessage, + NULL), + GNUNET_MQ_hd_var_size (p2p_put, + GNUNET_MESSAGE_TYPE_FS_PUT, + struct PutMessage, + NULL), + GNUNET_MQ_hd_fixed_size (p2p_migration_stop, + GNUNET_MESSAGE_TYPE_FS_MIGRATION_STOP, + struct MigrationStopMessage, + NULL), GNUNET_MQ_handler_end () }; static const struct GNUNET_SERVER_MessageHandler handlers[] = { diff --git a/src/gns/gns_api.c b/src/gns/gns_api.c index c45f5bc3d..475d5b5cd 100644 --- a/src/gns/gns_api.c +++ b/src/gns/gns_api.c @@ -264,11 +264,11 @@ handle_result (void *cls, static void reconnect (struct GNUNET_GNS_Handle *handle) { - GNUNET_MQ_hd_var_size (result, - GNUNET_MESSAGE_TYPE_GNS_LOOKUP_RESULT, - struct GNUNET_GNS_ClientLookupResultMessage); struct GNUNET_MQ_MessageHandler handlers[] = { - make_result_handler (handle), + GNUNET_MQ_hd_var_size (result, + GNUNET_MESSAGE_TYPE_GNS_LOOKUP_RESULT, + struct GNUNET_GNS_ClientLookupResultMessage, + handle), GNUNET_MQ_handler_end () }; struct GNUNET_GNS_LookupRequest *lh; diff --git a/src/hostlist/gnunet-daemon-hostlist.c b/src/hostlist/gnunet-daemon-hostlist.c index 44db59949..7181a913b 100644 --- a/src/hostlist/gnunet-daemon-hostlist.c +++ b/src/hostlist/gnunet-daemon-hostlist.c @@ -296,11 +296,11 @@ run (void *cls, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) { - GNUNET_MQ_hd_var_size (advertisement, - GNUNET_MESSAGE_TYPE_HOSTLIST_ADVERTISEMENT, - struct GNUNET_MessageHeader); struct GNUNET_MQ_MessageHandler learn_handlers[] = { - make_advertisement_handler (NULL), + GNUNET_MQ_hd_var_size (advertisement, + GNUNET_MESSAGE_TYPE_HOSTLIST_ADVERTISEMENT, + struct GNUNET_MessageHeader, + NULL), GNUNET_MQ_handler_end () }; struct GNUNET_MQ_MessageHandler no_learn_handlers[] = { diff --git a/src/hostlist/test_gnunet_daemon_hostlist_learning.c b/src/hostlist/test_gnunet_daemon_hostlist_learning.c index 041898abd..c39c57eb3 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist_learning.c +++ b/src/hostlist/test_gnunet_daemon_hostlist_learning.c @@ -394,11 +394,11 @@ static void setup_learn_peer (struct PeerContext *p, const char *cfgname) { - GNUNET_MQ_hd_var_size (ad_arrive, - GNUNET_MESSAGE_TYPE_HOSTLIST_ADVERTISEMENT, - struct GNUNET_MessageHeader); struct GNUNET_MQ_MessageHandler learn_handlers[] = { - make_ad_arrive_handler (NULL), + GNUNET_MQ_hd_var_size (ad_arrive, + GNUNET_MESSAGE_TYPE_HOSTLIST_ADVERTISEMENT, + struct GNUNET_MessageHeader, + NULL), GNUNET_MQ_handler_end () }; char *filename; diff --git a/src/identity-provider/identity_provider_api.c b/src/identity-provider/identity_provider_api.c index 6e1b867de..8317d18ad 100644 --- a/src/identity-provider/identity_provider_api.c +++ b/src/identity-provider/identity_provider_api.c @@ -363,15 +363,15 @@ handle_result (void *cls, static void reconnect (struct GNUNET_IDENTITY_PROVIDER_Handle *h) { - GNUNET_MQ_hd_var_size (result, - GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ISSUE_RESULT, - struct GNUNET_IDENTITY_PROVIDER_IssueResultMessage); - GNUNET_MQ_hd_var_size (exchange_result, - GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_EXCHANGE_RESULT, - struct GNUNET_IDENTITY_PROVIDER_ExchangeResultMessage); struct GNUNET_MQ_MessageHandler handlers[] = { - make_result_handler (h), - make_exchange_result_handler (h), + GNUNET_MQ_hd_var_size (result, + GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ISSUE_RESULT, + struct GNUNET_IDENTITY_PROVIDER_IssueResultMessage, + h), + GNUNET_MQ_hd_var_size (exchange_result, + GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_EXCHANGE_RESULT, + struct GNUNET_IDENTITY_PROVIDER_ExchangeResultMessage, + h), GNUNET_MQ_handler_end () }; struct GNUNET_IDENTITY_PROVIDER_Operation *op; diff --git a/src/identity/identity_api.c b/src/identity/identity_api.c index 4c8a35dc2..dd61fdfb4 100644 --- a/src/identity/identity_api.c +++ b/src/identity/identity_api.c @@ -552,20 +552,20 @@ handle_identity_set_default (void *cls, static void reconnect (void *cls) { - GNUNET_MQ_hd_var_size (identity_result_code, - GNUNET_MESSAGE_TYPE_IDENTITY_RESULT_CODE, - struct GNUNET_IDENTITY_ResultCodeMessage); - GNUNET_MQ_hd_var_size (identity_update, - GNUNET_MESSAGE_TYPE_IDENTITY_UPDATE, - struct GNUNET_IDENTITY_UpdateMessage); - GNUNET_MQ_hd_var_size (identity_set_default, - GNUNET_MESSAGE_TYPE_IDENTITY_SET_DEFAULT, - struct GNUNET_IDENTITY_SetDefaultMessage); struct GNUNET_IDENTITY_Handle *h = cls; struct GNUNET_MQ_MessageHandler handlers[] = { - make_identity_result_code_handler (h), - make_identity_update_handler (h), - make_identity_set_default_handler (h), + GNUNET_MQ_hd_var_size (identity_result_code, + GNUNET_MESSAGE_TYPE_IDENTITY_RESULT_CODE, + struct GNUNET_IDENTITY_ResultCodeMessage, + h), + GNUNET_MQ_hd_var_size (identity_update, + GNUNET_MESSAGE_TYPE_IDENTITY_UPDATE, + struct GNUNET_IDENTITY_UpdateMessage, + h), + GNUNET_MQ_hd_var_size (identity_set_default, + GNUNET_MESSAGE_TYPE_IDENTITY_SET_DEFAULT, + struct GNUNET_IDENTITY_SetDefaultMessage, + h), GNUNET_MQ_handler_end () }; struct GNUNET_MQ_Envelope *env; diff --git a/src/include/gnunet_mq_lib.h b/src/include/gnunet_mq_lib.h index d383adbb5..86144abca 100644 --- a/src/include/gnunet_mq_lib.h +++ b/src/include/gnunet_mq_lib.h @@ -323,27 +323,26 @@ struct GNUNET_MQ_MessageHandler * const struct GNUNET_MessageTest *msg) * { ... } * - * GNUNET_MQ_hd_fixed_size(test_message, - * GNUNET_MESSAGE_TYPE_TEST, - * struct GNUNET_MessageTest); * struct GNUNET_MQ_MessageHandler handlers[] = { - * make_test_message_handler (NULL), + * GNUNET_MQ_hd_fixed_size(test_message, + * GNUNET_MESSAGE_TYPE_TEST, + * struct GNUNET_MessageTest, + * "context"), * GNUNET_MQ_handler_end() * }; * * @param name unique basename for the functions * @param code message type constant * @param str type of the message (a struct) + * @param ctx context for the callbacks */ -#define GNUNET_MQ_hd_fixed_size(name,code,str) \ - struct GNUNET_MQ_MessageHandler \ - make_##name##_handler (void *cls) { \ - void (*cb)(void *cls, const str *msg) = &handle_##name; \ - struct GNUNET_MQ_MessageHandler mh = { \ - NULL, (GNUNET_MQ_MessageCallback) cb, \ - cls, code, sizeof (str) }; \ - return mh; \ - } +#define GNUNET_MQ_hd_fixed_size(name,code,str,ctx) \ + ({ \ + void (*_cb)(void *cls, const str *msg) = &handle_##name; \ + ((struct GNUNET_MQ_MessageHandler) { \ + NULL, (GNUNET_MQ_MessageCallback) _cb, \ + (ctx), (code), sizeof (str) }); \ + }) /** @@ -356,9 +355,6 @@ struct GNUNET_MQ_MessageHandler * The macro is to be used as follows: * * struct GNUNET_MessageTest { ... }; // can be variable size - * GNUNET_MQ_hd_var_size(test_message, - * GNUNET_MESSAGE_TYPE_TEST, - * struct GNUNET_MessageTest); * static int * check_test (void *cls, * const struct GNUNET_MessageTest *msg) @@ -377,25 +373,27 @@ struct GNUNET_MQ_MessageHandler * } * * struct GNUNET_MQ_MessageHandler handlers[] = { - * make_test_message_handler ("context"), + * GNUNET_MQ_hd_var_size(test_message, + * GNUNET_MESSAGE_TYPE_TEST, + * struct GNUNET_MessageTest, + * "context"), * GNUNET_MQ_handler_end() * }; * * @param name unique basename for the functions * @param code message type constant * @param str type of the message (a struct) - */ -#define GNUNET_MQ_hd_var_size(name,code,str) \ - struct GNUNET_MQ_MessageHandler \ - make_##name##_handler (void *ctx) { \ - int (*mv)(void *cls, const str *msg) = &check_##name; \ - void (*cb)(void *cls, const str *msg) = &handle_##name;\ - struct GNUNET_MQ_MessageHandler mh = \ - { (GNUNET_MQ_MessageValidationCallback) mv, \ - (GNUNET_MQ_MessageCallback) cb, \ - ctx, code, sizeof (str) }; \ - return mh; \ - } + * @param ctx context for the callbacks + */ +#define GNUNET_MQ_hd_var_size(name,code,str,ctx) \ + ({ \ + int (*_mv)(void *cls, const str *msg) = &check_##name; \ + void (*_cb)(void *cls, const str *msg) = &handle_##name; \ + ((struct GNUNET_MQ_MessageHandler) \ + { (GNUNET_MQ_MessageValidationCallback) _mv, \ + (GNUNET_MQ_MessageCallback) _cb, \ + (ctx), (code), sizeof (str) }); \ + }) /** diff --git a/src/multicast/multicast_api.c b/src/multicast/multicast_api.c index ad9929dca..7cfe70835 100644 --- a/src/multicast/multicast_api.c +++ b/src/multicast/multicast_api.c @@ -762,32 +762,27 @@ origin_connect (struct GNUNET_MULTICAST_Origin *orig) { struct GNUNET_MULTICAST_Group *grp = &orig->grp; - GNUNET_MQ_hd_var_size (group_message, - GNUNET_MESSAGE_TYPE_MULTICAST_MESSAGE, - struct GNUNET_MULTICAST_MessageHeader); - - GNUNET_MQ_hd_var_size (origin_request, - GNUNET_MESSAGE_TYPE_MULTICAST_REQUEST, - struct GNUNET_MULTICAST_RequestHeader); - - GNUNET_MQ_hd_fixed_size (group_fragment_ack, - GNUNET_MESSAGE_TYPE_MULTICAST_FRAGMENT_ACK, - struct GNUNET_MessageHeader); - - GNUNET_MQ_hd_var_size (group_join_request, - GNUNET_MESSAGE_TYPE_MULTICAST_JOIN_REQUEST, - struct MulticastJoinRequestMessage); - - GNUNET_MQ_hd_fixed_size (group_replay_request, - GNUNET_MESSAGE_TYPE_MULTICAST_REPLAY_REQUEST, - struct MulticastReplayRequestMessage); - struct GNUNET_MQ_MessageHandler handlers[] = { - make_group_message_handler (grp), - make_origin_request_handler (orig), - make_group_fragment_ack_handler (grp), - make_group_join_request_handler (grp), - make_group_replay_request_handler (grp), + GNUNET_MQ_hd_var_size (group_message, + GNUNET_MESSAGE_TYPE_MULTICAST_MESSAGE, + struct GNUNET_MULTICAST_MessageHeader, + grp), + GNUNET_MQ_hd_var_size (origin_request, + GNUNET_MESSAGE_TYPE_MULTICAST_REQUEST, + struct GNUNET_MULTICAST_RequestHeader, + orig), + GNUNET_MQ_hd_fixed_size (group_fragment_ack, + GNUNET_MESSAGE_TYPE_MULTICAST_FRAGMENT_ACK, + struct GNUNET_MessageHeader, + grp), + GNUNET_MQ_hd_var_size (group_join_request, + GNUNET_MESSAGE_TYPE_MULTICAST_JOIN_REQUEST, + struct MulticastJoinRequestMessage, + grp), + GNUNET_MQ_hd_fixed_size (group_replay_request, + GNUNET_MESSAGE_TYPE_MULTICAST_REPLAY_REQUEST, + struct MulticastReplayRequestMessage, + grp), GNUNET_MQ_handler_end () }; @@ -1053,37 +1048,31 @@ member_connect (struct GNUNET_MULTICAST_Member *mem) { struct GNUNET_MULTICAST_Group *grp = &mem->grp; - GNUNET_MQ_hd_var_size (group_message, - GNUNET_MESSAGE_TYPE_MULTICAST_MESSAGE, - struct GNUNET_MULTICAST_MessageHeader); - - GNUNET_MQ_hd_fixed_size (group_fragment_ack, - GNUNET_MESSAGE_TYPE_MULTICAST_FRAGMENT_ACK, - struct GNUNET_MessageHeader); - - GNUNET_MQ_hd_var_size (group_join_request, - GNUNET_MESSAGE_TYPE_MULTICAST_JOIN_REQUEST, - struct MulticastJoinRequestMessage); - - GNUNET_MQ_hd_var_size (member_join_decision, - GNUNET_MESSAGE_TYPE_MULTICAST_JOIN_DECISION, - struct MulticastJoinDecisionMessageHeader); - - GNUNET_MQ_hd_fixed_size (group_replay_request, - GNUNET_MESSAGE_TYPE_MULTICAST_REPLAY_REQUEST, - struct MulticastReplayRequestMessage); - - GNUNET_MQ_hd_var_size (member_replay_response, - GNUNET_MESSAGE_TYPE_MULTICAST_REPLAY_RESPONSE, - struct MulticastReplayResponseMessage); - struct GNUNET_MQ_MessageHandler handlers[] = { - make_group_message_handler (grp), - make_group_fragment_ack_handler (grp), - make_group_join_request_handler (grp), - make_member_join_decision_handler (mem), - make_group_replay_request_handler (grp), - make_member_replay_response_handler (mem), + GNUNET_MQ_hd_var_size (group_message, + GNUNET_MESSAGE_TYPE_MULTICAST_MESSAGE, + struct GNUNET_MULTICAST_MessageHeader, + grp), + GNUNET_MQ_hd_fixed_size (group_fragment_ack, + GNUNET_MESSAGE_TYPE_MULTICAST_FRAGMENT_ACK, + struct GNUNET_MessageHeader, + grp), + GNUNET_MQ_hd_var_size (group_join_request, + GNUNET_MESSAGE_TYPE_MULTICAST_JOIN_REQUEST, + struct MulticastJoinRequestMessage, + grp), + GNUNET_MQ_hd_var_size (member_join_decision, + GNUNET_MESSAGE_TYPE_MULTICAST_JOIN_DECISION, + struct MulticastJoinDecisionMessageHeader, + mem), + GNUNET_MQ_hd_fixed_size (group_replay_request, + GNUNET_MESSAGE_TYPE_MULTICAST_REPLAY_REQUEST, + struct MulticastReplayRequestMessage, + grp), + GNUNET_MQ_hd_var_size (member_replay_response, + GNUNET_MESSAGE_TYPE_MULTICAST_REPLAY_RESPONSE, + struct MulticastReplayResponseMessage, + mem), GNUNET_MQ_handler_end () }; diff --git a/src/namecache/namecache_api.c b/src/namecache/namecache_api.c index 46d685a26..9ccb91bc8 100644 --- a/src/namecache/namecache_api.c +++ b/src/namecache/namecache_api.c @@ -324,15 +324,15 @@ mq_error_handler (void *cls, static void reconnect (struct GNUNET_NAMECACHE_Handle *h) { - GNUNET_MQ_hd_var_size (lookup_block_response, - GNUNET_MESSAGE_TYPE_NAMECACHE_LOOKUP_BLOCK_RESPONSE, - struct LookupBlockResponseMessage); - GNUNET_MQ_hd_fixed_size (block_cache_response, - GNUNET_MESSAGE_TYPE_NAMECACHE_BLOCK_CACHE_RESPONSE, - struct BlockCacheResponseMessage); struct GNUNET_MQ_MessageHandler handlers[] = { - make_lookup_block_response_handler (h), - make_block_cache_response_handler (h), + GNUNET_MQ_hd_var_size (lookup_block_response, + GNUNET_MESSAGE_TYPE_NAMECACHE_LOOKUP_BLOCK_RESPONSE, + struct LookupBlockResponseMessage, + h), + GNUNET_MQ_hd_fixed_size (block_cache_response, + GNUNET_MESSAGE_TYPE_NAMECACHE_BLOCK_CACHE_RESPONSE, + struct BlockCacheResponseMessage, + h), GNUNET_MQ_handler_end () }; GNUNET_assert (NULL == h->mq); diff --git a/src/namestore/namestore_api.c b/src/namestore/namestore_api.c index 61d8385b6..6dc0df6fd 100644 --- a/src/namestore/namestore_api.c +++ b/src/namestore/namestore_api.c @@ -783,23 +783,23 @@ mq_error_handler (void *cls, static void reconnect (struct GNUNET_NAMESTORE_Handle *h) { - GNUNET_MQ_hd_fixed_size (record_store_response, - GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_STORE_RESPONSE, - struct RecordStoreResponseMessage); - GNUNET_MQ_hd_var_size (zone_to_name_response, - GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_TO_NAME_RESPONSE, - struct ZoneToNameResponseMessage); - GNUNET_MQ_hd_var_size (record_result, - GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_RESULT, - struct RecordResultMessage); - GNUNET_MQ_hd_var_size (lookup_result, - GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_LOOKUP_RESPONSE, - struct LabelLookupResponseMessage); struct GNUNET_MQ_MessageHandler handlers[] = { - make_record_store_response_handler (h), - make_zone_to_name_response_handler (h), - make_record_result_handler (h), - make_lookup_result_handler (h), + GNUNET_MQ_hd_fixed_size (record_store_response, + GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_STORE_RESPONSE, + struct RecordStoreResponseMessage, + h), + GNUNET_MQ_hd_var_size (zone_to_name_response, + GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_TO_NAME_RESPONSE, + struct ZoneToNameResponseMessage, + h), + GNUNET_MQ_hd_var_size (record_result, + GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_RESULT, + struct RecordResultMessage, + h), + GNUNET_MQ_hd_var_size (lookup_result, + GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_LOOKUP_RESPONSE, + struct LabelLookupResponseMessage, + h), GNUNET_MQ_handler_end () }; struct GNUNET_NAMESTORE_ZoneIterator *it; diff --git a/src/namestore/namestore_api_monitor.c b/src/namestore/namestore_api_monitor.c index 7e75b07e5..00f0887d4 100644 --- a/src/namestore/namestore_api_monitor.c +++ b/src/namestore/namestore_api_monitor.c @@ -243,15 +243,15 @@ mq_error_handler (void *cls, static void reconnect (struct GNUNET_NAMESTORE_ZoneMonitor *zm) { - GNUNET_MQ_hd_fixed_size (sync, - GNUNET_MESSAGE_TYPE_NAMESTORE_MONITOR_SYNC, - struct GNUNET_MessageHeader); - GNUNET_MQ_hd_var_size (result, - GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_RESULT, - struct RecordResultMessage); struct GNUNET_MQ_MessageHandler handlers[] = { - make_sync_handler (zm), - make_result_handler (zm), + GNUNET_MQ_hd_fixed_size (sync, + GNUNET_MESSAGE_TYPE_NAMESTORE_MONITOR_SYNC, + struct GNUNET_MessageHeader, + zm), + GNUNET_MQ_hd_var_size (result, + GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_RESULT, + struct RecordResultMessage, + zm), GNUNET_MQ_handler_end () }; struct GNUNET_MQ_Envelope *env; diff --git a/src/nse/gnunet-service-nse.c b/src/nse/gnunet-service-nse.c index 2b6780c08..1f06c0a75 100644 --- a/src/nse/gnunet-service-nse.c +++ b/src/nse/gnunet-service-nse.c @@ -1484,16 +1484,16 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, const struct GNUNET_CONFIGURATION_Handle *c) { - GNUNET_MQ_hd_fixed_size (p2p_estimate, - GNUNET_MESSAGE_TYPE_NSE_P2P_FLOOD, - struct GNUNET_NSE_FloodMessage); static const struct GNUNET_SERVER_MessageHandler handlers[] = { {&handle_start_message, NULL, GNUNET_MESSAGE_TYPE_NSE_START, sizeof (struct GNUNET_MessageHeader)}, {NULL, NULL, 0, 0} }; struct GNUNET_MQ_MessageHandler core_handlers[] = { - make_p2p_estimate_handler (NULL), + GNUNET_MQ_hd_fixed_size (p2p_estimate, + GNUNET_MESSAGE_TYPE_NSE_P2P_FLOOD, + struct GNUNET_NSE_FloodMessage, + NULL), GNUNET_MQ_handler_end () }; char *proof; diff --git a/src/nse/nse_api.c b/src/nse/nse_api.c index e9b704be9..cfe5482eb 100644 --- a/src/nse/nse_api.c +++ b/src/nse/nse_api.c @@ -135,12 +135,12 @@ handle_estimate (void *cls, static void reconnect (void *cls) { - GNUNET_MQ_hd_fixed_size (estimate, - GNUNET_MESSAGE_TYPE_NSE_ESTIMATE, - struct GNUNET_NSE_ClientMessage); struct GNUNET_NSE_Handle *h = cls; struct GNUNET_MQ_MessageHandler handlers[] = { - make_estimate_handler (h), + GNUNET_MQ_hd_fixed_size (estimate, + GNUNET_MESSAGE_TYPE_NSE_ESTIMATE, + struct GNUNET_NSE_ClientMessage, + h), GNUNET_MQ_handler_end () }; struct GNUNET_MessageHeader *msg; diff --git a/src/peerinfo/peerinfo_api.c b/src/peerinfo/peerinfo_api.c index e477186ee..3080fb503 100644 --- a/src/peerinfo/peerinfo_api.c +++ b/src/peerinfo/peerinfo_api.c @@ -440,15 +440,15 @@ handle_end_iteration (void *cls, static void reconnect (struct GNUNET_PEERINFO_Handle *h) { - GNUNET_MQ_hd_var_size (info, - GNUNET_MESSAGE_TYPE_PEERINFO_INFO, - struct InfoMessage); - GNUNET_MQ_hd_fixed_size (end_iteration, - GNUNET_MESSAGE_TYPE_PEERINFO_INFO_END, - struct GNUNET_MessageHeader); struct GNUNET_MQ_MessageHandler handlers[] = { - make_info_handler (h), - make_end_iteration_handler (h), + GNUNET_MQ_hd_var_size (info, + GNUNET_MESSAGE_TYPE_PEERINFO_INFO, + struct InfoMessage, + h), + GNUNET_MQ_hd_fixed_size (end_iteration, + GNUNET_MESSAGE_TYPE_PEERINFO_INFO_END, + struct GNUNET_MessageHeader, + h), GNUNET_MQ_handler_end () }; diff --git a/src/peerinfo/peerinfo_api_notify.c b/src/peerinfo/peerinfo_api_notify.c index c3dac5064..625cfb8f6 100644 --- a/src/peerinfo/peerinfo_api_notify.c +++ b/src/peerinfo/peerinfo_api_notify.c @@ -179,12 +179,12 @@ handle_notification (void *cls, static void reconnect (void *cls) { - GNUNET_MQ_hd_var_size (notification, - GNUNET_MESSAGE_TYPE_PEERINFO_INFO, - struct InfoMessage); struct GNUNET_PEERINFO_NotifyContext *nc = cls; struct GNUNET_MQ_MessageHandler handlers[] = { - make_notification_handler (nc), + GNUNET_MQ_hd_var_size (notification, + GNUNET_MESSAGE_TYPE_PEERINFO_INFO, + struct InfoMessage, + nc), GNUNET_MQ_handler_end () }; struct GNUNET_MQ_Envelope *env; diff --git a/src/peerstore/peerstore_api.c b/src/peerstore/peerstore_api.c index a288e74d2..f6910c017 100644 --- a/src/peerstore/peerstore_api.c +++ b/src/peerstore/peerstore_api.c @@ -786,19 +786,19 @@ handle_watch_record (void *cls, static void reconnect (struct GNUNET_PEERSTORE_Handle *h) { - GNUNET_MQ_hd_fixed_size (iterate_end, - GNUNET_MESSAGE_TYPE_PEERSTORE_ITERATE_END, - struct GNUNET_MessageHeader); - GNUNET_MQ_hd_var_size (iterate_result, - GNUNET_MESSAGE_TYPE_PEERSTORE_ITERATE_RECORD, - struct GNUNET_MessageHeader); - GNUNET_MQ_hd_var_size (watch_record, - GNUNET_MESSAGE_TYPE_PEERSTORE_WATCH_RECORD, - struct GNUNET_MessageHeader); struct GNUNET_MQ_MessageHandler mq_handlers[] = { - make_iterate_end_handler (h), - make_iterate_result_handler (h), - make_watch_record_handler (h), + GNUNET_MQ_hd_fixed_size (iterate_end, + GNUNET_MESSAGE_TYPE_PEERSTORE_ITERATE_END, + struct GNUNET_MessageHeader, + h), + GNUNET_MQ_hd_var_size (iterate_result, + GNUNET_MESSAGE_TYPE_PEERSTORE_ITERATE_RECORD, + struct GNUNET_MessageHeader, + h), + GNUNET_MQ_hd_var_size (watch_record, + GNUNET_MESSAGE_TYPE_PEERSTORE_WATCH_RECORD, + struct GNUNET_MessageHeader, + h), GNUNET_MQ_handler_end () }; struct GNUNET_PEERSTORE_IterateContext *ic; diff --git a/src/psyc/psyc_api.c b/src/psyc/psyc_api.c index 8e960c7be..45e4135a3 100644 --- a/src/psyc/psyc_api.c +++ b/src/psyc/psyc_api.c @@ -642,42 +642,35 @@ master_connect (struct GNUNET_PSYC_Master *mst) { struct GNUNET_PSYC_Channel *chn = &mst->chn; - GNUNET_MQ_hd_fixed_size (master_start_ack, - GNUNET_MESSAGE_TYPE_PSYC_MASTER_START_ACK, - struct GNUNET_PSYC_CountersResultMessage); - - GNUNET_MQ_hd_var_size (master_join_request, - GNUNET_MESSAGE_TYPE_PSYC_JOIN_REQUEST, - struct GNUNET_PSYC_JoinRequestMessage); - - GNUNET_MQ_hd_var_size (channel_message, - GNUNET_MESSAGE_TYPE_PSYC_MESSAGE, - struct GNUNET_PSYC_MessageHeader); - - GNUNET_MQ_hd_fixed_size (channel_message_ack, - GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_ACK, - struct GNUNET_MessageHeader); - - GNUNET_MQ_hd_var_size (channel_history_result, - GNUNET_MESSAGE_TYPE_PSYC_HISTORY_RESULT, - struct GNUNET_OperationResultMessage); - - GNUNET_MQ_hd_var_size (channel_state_result, - GNUNET_MESSAGE_TYPE_PSYC_STATE_RESULT, - struct GNUNET_OperationResultMessage); - - GNUNET_MQ_hd_var_size (channel_result, - GNUNET_MESSAGE_TYPE_PSYC_RESULT_CODE, - struct GNUNET_OperationResultMessage); - struct GNUNET_MQ_MessageHandler handlers[] = { - make_master_start_ack_handler (mst), - make_master_join_request_handler (mst), - make_channel_message_handler (chn), - make_channel_message_ack_handler (chn), - make_channel_history_result_handler (chn), - make_channel_state_result_handler (chn), - make_channel_result_handler (chn), + GNUNET_MQ_hd_fixed_size (master_start_ack, + GNUNET_MESSAGE_TYPE_PSYC_MASTER_START_ACK, + struct GNUNET_PSYC_CountersResultMessage, + mst), + GNUNET_MQ_hd_var_size (master_join_request, + GNUNET_MESSAGE_TYPE_PSYC_JOIN_REQUEST, + struct GNUNET_PSYC_JoinRequestMessage, + mst), + GNUNET_MQ_hd_var_size (channel_message, + GNUNET_MESSAGE_TYPE_PSYC_MESSAGE, + struct GNUNET_PSYC_MessageHeader, + chn), + GNUNET_MQ_hd_fixed_size (channel_message_ack, + GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_ACK, + struct GNUNET_MessageHeader, + chn), + GNUNET_MQ_hd_var_size (channel_history_result, + GNUNET_MESSAGE_TYPE_PSYC_HISTORY_RESULT, + struct GNUNET_OperationResultMessage, + chn), + GNUNET_MQ_hd_var_size (channel_state_result, + GNUNET_MESSAGE_TYPE_PSYC_STATE_RESULT, + struct GNUNET_OperationResultMessage, + chn), + GNUNET_MQ_hd_var_size (channel_result, + GNUNET_MESSAGE_TYPE_PSYC_RESULT_CODE, + struct GNUNET_OperationResultMessage, + chn), GNUNET_MQ_handler_end () }; @@ -948,42 +941,35 @@ slave_connect (struct GNUNET_PSYC_Slave *slv) { struct GNUNET_PSYC_Channel *chn = &slv->chn; - GNUNET_MQ_hd_fixed_size (slave_join_ack, - GNUNET_MESSAGE_TYPE_PSYC_SLAVE_JOIN_ACK, - struct GNUNET_PSYC_CountersResultMessage); - - GNUNET_MQ_hd_var_size (slave_join_decision, - GNUNET_MESSAGE_TYPE_PSYC_JOIN_DECISION, - struct GNUNET_PSYC_JoinDecisionMessage); - - GNUNET_MQ_hd_var_size (channel_message, - GNUNET_MESSAGE_TYPE_PSYC_MESSAGE, - struct GNUNET_PSYC_MessageHeader); - - GNUNET_MQ_hd_fixed_size (channel_message_ack, - GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_ACK, - struct GNUNET_MessageHeader); - - GNUNET_MQ_hd_var_size (channel_history_result, - GNUNET_MESSAGE_TYPE_PSYC_HISTORY_RESULT, - struct GNUNET_OperationResultMessage); - - GNUNET_MQ_hd_var_size (channel_state_result, - GNUNET_MESSAGE_TYPE_PSYC_STATE_RESULT, - struct GNUNET_OperationResultMessage); - - GNUNET_MQ_hd_var_size (channel_result, - GNUNET_MESSAGE_TYPE_PSYC_RESULT_CODE, - struct GNUNET_OperationResultMessage); - struct GNUNET_MQ_MessageHandler handlers[] = { - make_slave_join_ack_handler (slv), - make_slave_join_decision_handler (slv), - make_channel_message_handler (chn), - make_channel_message_ack_handler (chn), - make_channel_history_result_handler (chn), - make_channel_state_result_handler (chn), - make_channel_result_handler (chn), + GNUNET_MQ_hd_fixed_size (slave_join_ack, + GNUNET_MESSAGE_TYPE_PSYC_SLAVE_JOIN_ACK, + struct GNUNET_PSYC_CountersResultMessage, + slv), + GNUNET_MQ_hd_var_size (slave_join_decision, + GNUNET_MESSAGE_TYPE_PSYC_JOIN_DECISION, + struct GNUNET_PSYC_JoinDecisionMessage, + slv), + GNUNET_MQ_hd_var_size (channel_message, + GNUNET_MESSAGE_TYPE_PSYC_MESSAGE, + struct GNUNET_PSYC_MessageHeader, + chn), + GNUNET_MQ_hd_fixed_size (channel_message_ack, + GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_ACK, + struct GNUNET_MessageHeader, + chn), + GNUNET_MQ_hd_var_size (channel_history_result, + GNUNET_MESSAGE_TYPE_PSYC_HISTORY_RESULT, + struct GNUNET_OperationResultMessage, + chn), + GNUNET_MQ_hd_var_size (channel_state_result, + GNUNET_MESSAGE_TYPE_PSYC_STATE_RESULT, + struct GNUNET_OperationResultMessage, + chn), + GNUNET_MQ_hd_var_size (channel_result, + GNUNET_MESSAGE_TYPE_PSYC_RESULT_CODE, + struct GNUNET_OperationResultMessage, + chn), GNUNET_MQ_handler_end () }; diff --git a/src/psycstore/psycstore_api.c b/src/psycstore/psycstore_api.c index 89be19a42..7bbf2e3d8 100644 --- a/src/psycstore/psycstore_api.c +++ b/src/psycstore/psycstore_api.c @@ -323,27 +323,23 @@ do_connect (struct GNUNET_PSYCSTORE_Handle *h) LOG (GNUNET_ERROR_TYPE_DEBUG, "Connecting to PSYCstore service.\n"); - GNUNET_MQ_hd_var_size (result_code, - GNUNET_MESSAGE_TYPE_PSYCSTORE_RESULT_CODE, - struct OperationResult); - - GNUNET_MQ_hd_fixed_size (result_counters, - GNUNET_MESSAGE_TYPE_PSYCSTORE_RESULT_COUNTERS, - struct CountersResult); - - GNUNET_MQ_hd_var_size (result_fragment, - GNUNET_MESSAGE_TYPE_PSYCSTORE_RESULT_FRAGMENT, - struct FragmentResult); - - GNUNET_MQ_hd_var_size (result_state, - GNUNET_MESSAGE_TYPE_PSYCSTORE_RESULT_STATE, - struct StateResult); - struct GNUNET_MQ_MessageHandler handlers[] = { - make_result_code_handler (h), - make_result_counters_handler (h), - make_result_fragment_handler (h), - make_result_state_handler (h), + GNUNET_MQ_hd_var_size (result_code, + GNUNET_MESSAGE_TYPE_PSYCSTORE_RESULT_CODE, + struct OperationResult, + h), + GNUNET_MQ_hd_fixed_size (result_counters, + GNUNET_MESSAGE_TYPE_PSYCSTORE_RESULT_COUNTERS, + struct CountersResult, + h), + GNUNET_MQ_hd_var_size (result_fragment, + GNUNET_MESSAGE_TYPE_PSYCSTORE_RESULT_FRAGMENT, + struct FragmentResult, + h), + GNUNET_MQ_hd_var_size (result_state, + GNUNET_MESSAGE_TYPE_PSYCSTORE_RESULT_STATE, + struct StateResult, + h), GNUNET_MQ_handler_end () }; diff --git a/src/regex/regex_api_search.c b/src/regex/regex_api_search.c index 84a58f367..ff85f5748 100644 --- a/src/regex/regex_api_search.c +++ b/src/regex/regex_api_search.c @@ -155,11 +155,11 @@ mq_error_handler (void *cls, static void search_reconnect (struct GNUNET_REGEX_Search *s) { - GNUNET_MQ_hd_var_size (search_response, - GNUNET_MESSAGE_TYPE_REGEX_RESULT, - struct ResultMessage); struct GNUNET_MQ_MessageHandler handlers[] = { - make_search_response_handler (s), + GNUNET_MQ_hd_var_size (search_response, + GNUNET_MESSAGE_TYPE_REGEX_RESULT, + struct ResultMessage, + s), GNUNET_MQ_handler_end () }; size_t slen = strlen (s->string) + 1; diff --git a/src/revocation/gnunet-service-revocation.c b/src/revocation/gnunet-service-revocation.c index 0f67977a1..706432ece 100644 --- a/src/revocation/gnunet-service-revocation.c +++ b/src/revocation/gnunet-service-revocation.c @@ -777,9 +777,6 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, const struct GNUNET_CONFIGURATION_Handle *c) { - GNUNET_MQ_hd_fixed_size (p2p_revoke, - GNUNET_MESSAGE_TYPE_REVOCATION_REVOKE, - struct RevokeMessage); static const struct GNUNET_SERVER_MessageHandler handlers[] = { {&handle_query_message, NULL, GNUNET_MESSAGE_TYPE_REVOCATION_QUERY, sizeof (struct QueryMessage)}, @@ -788,7 +785,10 @@ run (void *cls, {NULL, NULL, 0, 0} }; struct GNUNET_MQ_MessageHandler core_handlers[] = { - make_p2p_revoke_handler (NULL), + GNUNET_MQ_hd_fixed_size (p2p_revoke, + GNUNET_MESSAGE_TYPE_REVOCATION_REVOKE, + struct RevokeMessage, + NULL), GNUNET_MQ_handler_end () }; char *fn; diff --git a/src/revocation/revocation_api.c b/src/revocation/revocation_api.c index 0b9bc4ea6..8c00ac2ae 100644 --- a/src/revocation/revocation_api.c +++ b/src/revocation/revocation_api.c @@ -113,13 +113,13 @@ GNUNET_REVOCATION_query (const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_REVOCATION_Callback func, void *func_cls) { - GNUNET_MQ_hd_fixed_size (revocation_query_response, - GNUNET_MESSAGE_TYPE_REVOCATION_QUERY_RESPONSE, - struct QueryResponseMessage); struct GNUNET_REVOCATION_Query *q = GNUNET_new (struct GNUNET_REVOCATION_Query); struct GNUNET_MQ_MessageHandler handlers[] = { - make_revocation_query_response_handler (q), + GNUNET_MQ_hd_fixed_size (revocation_query_response, + GNUNET_MESSAGE_TYPE_REVOCATION_QUERY_RESPONSE, + struct QueryResponseMessage, + q), GNUNET_MQ_handler_end () }; struct QueryMessage *qm; @@ -255,13 +255,13 @@ GNUNET_REVOCATION_revoke (const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_REVOCATION_Callback func, void *func_cls) { - GNUNET_MQ_hd_fixed_size (revocation_response, - GNUNET_MESSAGE_TYPE_REVOCATION_REVOKE_RESPONSE, - struct RevocationResponseMessage); struct GNUNET_REVOCATION_Handle *h = GNUNET_new (struct GNUNET_REVOCATION_Handle); struct GNUNET_MQ_MessageHandler handlers[] = { - make_revocation_response_handler (h), + GNUNET_MQ_hd_fixed_size (revocation_response, + GNUNET_MESSAGE_TYPE_REVOCATION_REVOKE_RESPONSE, + struct RevocationResponseMessage, + h), GNUNET_MQ_handler_end () }; unsigned long long matching_bits; diff --git a/src/rps/rps_api.c b/src/rps/rps_api.c index 39fb0168b..c04056c58 100644 --- a/src/rps/rps_api.c +++ b/src/rps/rps_api.c @@ -211,11 +211,11 @@ mq_error_handler (void *cls, static void reconnect (struct GNUNET_RPS_Handle *h) { - GNUNET_MQ_hd_var_size (reply, - GNUNET_MESSAGE_TYPE_RPS_CS_REPLY, - struct GNUNET_RPS_CS_ReplyMessage); struct GNUNET_MQ_MessageHandler mq_handlers[] = { - make_reply_handler (h), + GNUNET_MQ_hd_var_size (reply, + GNUNET_MESSAGE_TYPE_RPS_CS_REPLY, + struct GNUNET_RPS_CS_ReplyMessage, + h), GNUNET_MQ_handler_end () }; diff --git a/src/scalarproduct/scalarproduct_api.c b/src/scalarproduct/scalarproduct_api.c index 09e06d5a0..5ad64f4be 100644 --- a/src/scalarproduct/scalarproduct_api.c +++ b/src/scalarproduct/scalarproduct_api.c @@ -230,13 +230,13 @@ GNUNET_SCALARPRODUCT_accept_computation (const struct GNUNET_CONFIGURATION_Handl GNUNET_SCALARPRODUCT_ContinuationWithStatus cont, void *cont_cls) { - GNUNET_MQ_hd_var_size (response, - GNUNET_MESSAGE_TYPE_SCALARPRODUCT_RESULT, - struct ClientResponseMessage); struct GNUNET_SCALARPRODUCT_ComputationHandle *h = GNUNET_new (struct GNUNET_SCALARPRODUCT_ComputationHandle); struct GNUNET_MQ_MessageHandler handlers[] = { - make_response_handler (h), + GNUNET_MQ_hd_var_size (response, + GNUNET_MESSAGE_TYPE_SCALARPRODUCT_RESULT, + struct ClientResponseMessage, + h), GNUNET_MQ_handler_end () }; struct GNUNET_MQ_Envelope *env; @@ -388,13 +388,13 @@ GNUNET_SCALARPRODUCT_start_computation (const struct GNUNET_CONFIGURATION_Handle GNUNET_SCALARPRODUCT_DatumProcessor cont, void *cont_cls) { - GNUNET_MQ_hd_var_size (response, - GNUNET_MESSAGE_TYPE_SCALARPRODUCT_RESULT, - struct ClientResponseMessage); struct GNUNET_SCALARPRODUCT_ComputationHandle *h = GNUNET_new (struct GNUNET_SCALARPRODUCT_ComputationHandle); struct GNUNET_MQ_MessageHandler handlers[] = { - make_response_handler (h), + GNUNET_MQ_hd_var_size (response, + GNUNET_MESSAGE_TYPE_SCALARPRODUCT_RESULT, + struct ClientResponseMessage, + h), GNUNET_MQ_handler_end () }; struct GNUNET_MQ_Envelope *env; diff --git a/src/secretsharing/secretsharing_api.c b/src/secretsharing/secretsharing_api.c index 429aec47e..78167b671 100644 --- a/src/secretsharing/secretsharing_api.c +++ b/src/secretsharing/secretsharing_api.c @@ -249,13 +249,13 @@ GNUNET_SECRETSHARING_create_session (const struct GNUNET_CONFIGURATION_Handle *c GNUNET_SECRETSHARING_SecretReadyCallback cb, void *cls) { - GNUNET_MQ_hd_var_size (secret_ready, - GNUNET_MESSAGE_TYPE_SECRETSHARING_CLIENT_SECRET_READY, - struct GNUNET_SECRETSHARING_SecretReadyMessage); struct GNUNET_SECRETSHARING_Session *s = GNUNET_new (struct GNUNET_SECRETSHARING_Session); struct GNUNET_MQ_MessageHandler mq_handlers[] = { - make_secret_ready_handler (s), + GNUNET_MQ_hd_var_size (secret_ready, + GNUNET_MESSAGE_TYPE_SECRETSHARING_CLIENT_SECRET_READY, + struct GNUNET_SECRETSHARING_SecretReadyMessage, + s), GNUNET_MQ_handler_end () }; struct GNUNET_MQ_Envelope *ev; @@ -333,13 +333,13 @@ GNUNET_SECRETSHARING_decrypt (const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_SECRETSHARING_DecryptCallback decrypt_cb, void *decrypt_cb_cls) { - GNUNET_MQ_hd_fixed_size (decrypt_done, - GNUNET_MESSAGE_TYPE_SECRETSHARING_CLIENT_DECRYPT_DONE, - struct GNUNET_SECRETSHARING_DecryptResponseMessage); struct GNUNET_SECRETSHARING_DecryptionHandle *s = GNUNET_new (struct GNUNET_SECRETSHARING_DecryptionHandle); struct GNUNET_MQ_MessageHandler mq_handlers[] = { - make_decrypt_done_handler (s), + GNUNET_MQ_hd_fixed_size (decrypt_done, + GNUNET_MESSAGE_TYPE_SECRETSHARING_CLIENT_DECRYPT_DONE, + struct GNUNET_SECRETSHARING_DecryptResponseMessage, + s), GNUNET_MQ_handler_end () }; struct GNUNET_MQ_Envelope *ev; diff --git a/src/set/set_api.c b/src/set/set_api.c index 3e9a4fdcf..7a33b86ea 100644 --- a/src/set/set_api.c +++ b/src/set/set_api.c @@ -561,24 +561,24 @@ create_internal (const struct GNUNET_CONFIGURATION_Handle *cfg, enum GNUNET_SET_OperationType op, const uint32_t *cookie) { - GNUNET_MQ_hd_var_size (result, - GNUNET_MESSAGE_TYPE_SET_RESULT, - struct GNUNET_SET_ResultMessage); - GNUNET_MQ_hd_var_size (iter_element, - GNUNET_MESSAGE_TYPE_SET_ITER_ELEMENT, - struct GNUNET_SET_IterResponseMessage); - GNUNET_MQ_hd_fixed_size (iter_done, - GNUNET_MESSAGE_TYPE_SET_ITER_DONE, - struct GNUNET_MessageHeader); - GNUNET_MQ_hd_fixed_size (copy_lazy, - GNUNET_MESSAGE_TYPE_SET_COPY_LAZY_RESPONSE, - struct GNUNET_SET_CopyLazyResponseMessage); struct GNUNET_SET_Handle *set = GNUNET_new (struct GNUNET_SET_Handle); struct GNUNET_MQ_MessageHandler mq_handlers[] = { - make_result_handler (set), - make_iter_element_handler (set), - make_iter_done_handler (set), - make_copy_lazy_handler (set), + GNUNET_MQ_hd_var_size (result, + GNUNET_MESSAGE_TYPE_SET_RESULT, + struct GNUNET_SET_ResultMessage, + set), + GNUNET_MQ_hd_var_size (iter_element, + GNUNET_MESSAGE_TYPE_SET_ITER_ELEMENT, + struct GNUNET_SET_IterResponseMessage, + set), + GNUNET_MQ_hd_fixed_size (iter_done, + GNUNET_MESSAGE_TYPE_SET_ITER_DONE, + struct GNUNET_MessageHeader, + set), + GNUNET_MQ_hd_fixed_size (copy_lazy, + GNUNET_MESSAGE_TYPE_SET_COPY_LAZY_RESPONSE, + struct GNUNET_SET_CopyLazyResponseMessage, + set), GNUNET_MQ_handler_end () }; struct GNUNET_MQ_Envelope *mqm; @@ -901,12 +901,12 @@ handle_client_listener_error (void *cls, static void listen_connect (void *cls) { - GNUNET_MQ_hd_var_size (request, - GNUNET_MESSAGE_TYPE_SET_REQUEST, - struct GNUNET_SET_RequestMessage); struct GNUNET_SET_ListenHandle *lh = cls; struct GNUNET_MQ_MessageHandler mq_handlers[] = { - make_request_handler (lh), + GNUNET_MQ_hd_var_size (request, + GNUNET_MESSAGE_TYPE_SET_REQUEST, + struct GNUNET_SET_RequestMessage, + lh), GNUNET_MQ_handler_end () }; struct GNUNET_MQ_Envelope *mqm; diff --git a/src/social/social_api.c b/src/social/social_api.c index c08de0356..583ce6d1e 100644 --- a/src/social/social_api.c +++ b/src/social/social_api.c @@ -1155,42 +1155,35 @@ host_connect (struct GNUNET_SOCIAL_Host *hst) { struct GNUNET_SOCIAL_Place *plc = &hst->plc; - GNUNET_MQ_hd_fixed_size (host_enter_ack, - GNUNET_MESSAGE_TYPE_SOCIAL_HOST_ENTER_ACK, - struct HostEnterAck); - - GNUNET_MQ_hd_var_size (host_enter_request, - GNUNET_MESSAGE_TYPE_PSYC_JOIN_REQUEST, - struct GNUNET_PSYC_JoinRequestMessage); - - GNUNET_MQ_hd_var_size (host_message, - GNUNET_MESSAGE_TYPE_PSYC_MESSAGE, - struct GNUNET_PSYC_MessageHeader); - - GNUNET_MQ_hd_fixed_size (place_message_ack, - GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_ACK, - struct GNUNET_MessageHeader); - - GNUNET_MQ_hd_var_size (place_history_result, - GNUNET_MESSAGE_TYPE_PSYC_HISTORY_RESULT, - struct GNUNET_OperationResultMessage); - - GNUNET_MQ_hd_var_size (place_state_result, - GNUNET_MESSAGE_TYPE_PSYC_STATE_RESULT, - struct GNUNET_OperationResultMessage); - - GNUNET_MQ_hd_var_size (place_result, - GNUNET_MESSAGE_TYPE_PSYC_RESULT_CODE, - struct GNUNET_OperationResultMessage); - struct GNUNET_MQ_MessageHandler handlers[] = { - make_host_enter_ack_handler (hst), - make_host_enter_request_handler (hst), - make_host_message_handler (plc), - make_place_message_ack_handler (plc), - make_place_history_result_handler (plc), - make_place_state_result_handler (plc), - make_place_result_handler (plc), + GNUNET_MQ_hd_fixed_size (host_enter_ack, + GNUNET_MESSAGE_TYPE_SOCIAL_HOST_ENTER_ACK, + struct HostEnterAck, + hst), + GNUNET_MQ_hd_var_size (host_enter_request, + GNUNET_MESSAGE_TYPE_PSYC_JOIN_REQUEST, + struct GNUNET_PSYC_JoinRequestMessage, + hst), + GNUNET_MQ_hd_var_size (host_message, + GNUNET_MESSAGE_TYPE_PSYC_MESSAGE, + struct GNUNET_PSYC_MessageHeader, + hst), + GNUNET_MQ_hd_fixed_size (place_message_ack, + GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_ACK, + struct GNUNET_MessageHeader, + plc), + GNUNET_MQ_hd_var_size (place_history_result, + GNUNET_MESSAGE_TYPE_PSYC_HISTORY_RESULT, + struct GNUNET_OperationResultMessage, + plc), + GNUNET_MQ_hd_var_size (place_state_result, + GNUNET_MESSAGE_TYPE_PSYC_STATE_RESULT, + struct GNUNET_OperationResultMessage, + plc), + GNUNET_MQ_hd_var_size (place_result, + GNUNET_MESSAGE_TYPE_PSYC_RESULT_CODE, + struct GNUNET_OperationResultMessage, + plc), GNUNET_MQ_handler_end () }; @@ -1664,42 +1657,35 @@ guest_connect (struct GNUNET_SOCIAL_Guest *gst) { struct GNUNET_SOCIAL_Place *plc = &gst->plc; - GNUNET_MQ_hd_fixed_size (guest_enter_ack, - GNUNET_MESSAGE_TYPE_SOCIAL_GUEST_ENTER_ACK, - struct GNUNET_PSYC_CountersResultMessage); - - GNUNET_MQ_hd_var_size (guest_enter_decision, - GNUNET_MESSAGE_TYPE_PSYC_JOIN_DECISION, - struct GNUNET_PSYC_JoinDecisionMessage); - - GNUNET_MQ_hd_var_size (place_message, - GNUNET_MESSAGE_TYPE_PSYC_MESSAGE, - struct GNUNET_PSYC_MessageHeader); - - GNUNET_MQ_hd_fixed_size (place_message_ack, - GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_ACK, - struct GNUNET_MessageHeader); - - GNUNET_MQ_hd_var_size (place_history_result, - GNUNET_MESSAGE_TYPE_PSYC_HISTORY_RESULT, - struct GNUNET_OperationResultMessage); - - GNUNET_MQ_hd_var_size (place_state_result, - GNUNET_MESSAGE_TYPE_PSYC_STATE_RESULT, - struct GNUNET_OperationResultMessage); - - GNUNET_MQ_hd_var_size (place_result, - GNUNET_MESSAGE_TYPE_PSYC_RESULT_CODE, - struct GNUNET_OperationResultMessage); - struct GNUNET_MQ_MessageHandler handlers[] = { - make_guest_enter_ack_handler (gst), - make_guest_enter_decision_handler (gst), - make_place_message_handler (plc), - make_place_message_ack_handler (plc), - make_place_history_result_handler (plc), - make_place_state_result_handler (plc), - make_place_result_handler (plc), + GNUNET_MQ_hd_fixed_size (guest_enter_ack, + GNUNET_MESSAGE_TYPE_SOCIAL_GUEST_ENTER_ACK, + struct GNUNET_PSYC_CountersResultMessage, + gst), + GNUNET_MQ_hd_var_size (guest_enter_decision, + GNUNET_MESSAGE_TYPE_PSYC_JOIN_DECISION, + struct GNUNET_PSYC_JoinDecisionMessage, + gst), + GNUNET_MQ_hd_var_size (place_message, + GNUNET_MESSAGE_TYPE_PSYC_MESSAGE, + struct GNUNET_PSYC_MessageHeader, + plc), + GNUNET_MQ_hd_fixed_size (place_message_ack, + GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_ACK, + struct GNUNET_MessageHeader, + plc), + GNUNET_MQ_hd_var_size (place_history_result, + GNUNET_MESSAGE_TYPE_PSYC_HISTORY_RESULT, + struct GNUNET_OperationResultMessage, + plc), + GNUNET_MQ_hd_var_size (place_state_result, + GNUNET_MESSAGE_TYPE_PSYC_STATE_RESULT, + struct GNUNET_OperationResultMessage, + plc), + GNUNET_MQ_hd_var_size (place_result, + GNUNET_MESSAGE_TYPE_PSYC_RESULT_CODE, + struct GNUNET_OperationResultMessage, + plc), GNUNET_MQ_handler_end () }; @@ -2579,32 +2565,27 @@ app_disconnected (void *cls, enum GNUNET_MQ_Error error) static void app_connect (struct GNUNET_SOCIAL_App *app) { - GNUNET_MQ_hd_var_size (app_ego, - GNUNET_MESSAGE_TYPE_SOCIAL_APP_EGO, - struct AppEgoMessage); - - GNUNET_MQ_hd_fixed_size (app_ego_end, - GNUNET_MESSAGE_TYPE_SOCIAL_APP_EGO_END, - struct GNUNET_MessageHeader); - - GNUNET_MQ_hd_var_size (app_place, - GNUNET_MESSAGE_TYPE_SOCIAL_APP_PLACE, - struct AppPlaceMessage); - - GNUNET_MQ_hd_fixed_size (app_place_end, - GNUNET_MESSAGE_TYPE_SOCIAL_APP_PLACE_END, - struct GNUNET_MessageHeader); - - GNUNET_MQ_hd_var_size (app_result, - GNUNET_MESSAGE_TYPE_PSYC_RESULT_CODE, - struct GNUNET_OperationResultMessage); - struct GNUNET_MQ_MessageHandler handlers[] = { - make_app_ego_handler (app), - make_app_ego_end_handler (app), - make_app_place_handler (app), - make_app_place_end_handler (app), - make_app_result_handler (app), + GNUNET_MQ_hd_var_size (app_ego, + GNUNET_MESSAGE_TYPE_SOCIAL_APP_EGO, + struct AppEgoMessage, + app), + GNUNET_MQ_hd_fixed_size (app_ego_end, + GNUNET_MESSAGE_TYPE_SOCIAL_APP_EGO_END, + struct GNUNET_MessageHeader, + app), + GNUNET_MQ_hd_var_size (app_place, + GNUNET_MESSAGE_TYPE_SOCIAL_APP_PLACE, + struct AppPlaceMessage, + app), + GNUNET_MQ_hd_fixed_size (app_place_end, + GNUNET_MESSAGE_TYPE_SOCIAL_APP_PLACE_END, + struct GNUNET_MessageHeader, + app), + GNUNET_MQ_hd_var_size (app_result, + GNUNET_MESSAGE_TYPE_PSYC_RESULT_CODE, + struct GNUNET_OperationResultMessage, + app), GNUNET_MQ_handler_end () }; diff --git a/src/statistics/statistics_api.c b/src/statistics/statistics_api.c index 7f5a257d9..acaa1cc45 100644 --- a/src/statistics/statistics_api.c +++ b/src/statistics/statistics_api.c @@ -646,23 +646,23 @@ handle_statistics_end (void *cls, static int try_connect (struct GNUNET_STATISTICS_Handle *h) { - GNUNET_MQ_hd_fixed_size (test, - GNUNET_MESSAGE_TYPE_TEST, - struct GNUNET_MessageHeader); - GNUNET_MQ_hd_fixed_size (statistics_end, - GNUNET_MESSAGE_TYPE_STATISTICS_END, - struct GNUNET_MessageHeader); - GNUNET_MQ_hd_var_size (statistics_value, - GNUNET_MESSAGE_TYPE_STATISTICS_VALUE, - struct GNUNET_STATISTICS_ReplyMessage); - GNUNET_MQ_hd_fixed_size (statistics_watch_value, - GNUNET_MESSAGE_TYPE_STATISTICS_WATCH_VALUE, - struct GNUNET_STATISTICS_WatchValueMessage); struct GNUNET_MQ_MessageHandler handlers[] = { - make_test_handler (h), - make_statistics_end_handler (h), - make_statistics_value_handler (h), - make_statistics_watch_value_handler (h), + GNUNET_MQ_hd_fixed_size (test, + GNUNET_MESSAGE_TYPE_TEST, + struct GNUNET_MessageHeader, + h), + GNUNET_MQ_hd_fixed_size (statistics_end, + GNUNET_MESSAGE_TYPE_STATISTICS_END, + struct GNUNET_MessageHeader, + h), + GNUNET_MQ_hd_var_size (statistics_value, + GNUNET_MESSAGE_TYPE_STATISTICS_VALUE, + struct GNUNET_STATISTICS_ReplyMessage, + h), + GNUNET_MQ_hd_fixed_size (statistics_watch_value, + GNUNET_MESSAGE_TYPE_STATISTICS_WATCH_VALUE, + struct GNUNET_STATISTICS_WatchValueMessage, + h), GNUNET_MQ_handler_end () }; struct GNUNET_STATISTICS_GetHandle *gh; diff --git a/src/testbed/testbed_api.c b/src/testbed/testbed_api.c index 895800514..53f70a1c0 100644 --- a/src/testbed/testbed_api.c +++ b/src/testbed/testbed_api.c @@ -1549,49 +1549,49 @@ GNUNET_TESTBED_controller_connect (struct GNUNET_TESTBED_Host *host, GNUNET_TESTBED_ControllerCallback cc, void *cc_cls) { - GNUNET_MQ_hd_var_size (add_host_confirm, - GNUNET_MESSAGE_TYPE_TESTBED_ADD_HOST_SUCCESS, - struct GNUNET_TESTBED_HostConfirmedMessage); - GNUNET_MQ_hd_fixed_size (peer_conevent, - GNUNET_MESSAGE_TYPE_TESTBED_PEER_CONNECT_EVENT, - struct GNUNET_TESTBED_ConnectionEventMessage); - GNUNET_MQ_hd_fixed_size (opsuccess, - GNUNET_MESSAGE_TYPE_TESTBED_GENERIC_OPERATION_SUCCESS, - struct GNUNET_TESTBED_GenericOperationSuccessEventMessage); - GNUNET_MQ_hd_var_size (op_fail_event, - GNUNET_MESSAGE_TYPE_TESTBED_OPERATION_FAIL_EVENT, - struct GNUNET_TESTBED_OperationFailureEventMessage); - GNUNET_MQ_hd_fixed_size (peer_create_success, - GNUNET_MESSAGE_TYPE_TESTBED_CREATE_PEER_SUCCESS, - struct GNUNET_TESTBED_PeerCreateSuccessEventMessage); - GNUNET_MQ_hd_fixed_size (peer_event, - GNUNET_MESSAGE_TYPE_TESTBED_PEER_EVENT, - struct GNUNET_TESTBED_PeerEventMessage); - GNUNET_MQ_hd_var_size (peer_config, - GNUNET_MESSAGE_TYPE_TESTBED_PEER_INFORMATION, - struct GNUNET_TESTBED_PeerConfigurationInformationMessage); - GNUNET_MQ_hd_var_size (slave_config, - GNUNET_MESSAGE_TYPE_TESTBED_SLAVE_CONFIGURATION, - struct GNUNET_TESTBED_SlaveConfiguration); - GNUNET_MQ_hd_var_size (link_controllers_result, - GNUNET_MESSAGE_TYPE_TESTBED_LINK_CONTROLLERS_RESULT, - struct GNUNET_TESTBED_ControllerLinkResponse); - GNUNET_MQ_hd_var_size (barrier_status, - GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_STATUS, - const struct GNUNET_TESTBED_BarrierStatusMsg); struct GNUNET_TESTBED_Controller *controller = GNUNET_new (struct GNUNET_TESTBED_Controller); struct GNUNET_MQ_MessageHandler handlers[] = { - make_add_host_confirm_handler (controller), - make_peer_conevent_handler (controller), - make_opsuccess_handler (controller), - make_op_fail_event_handler (controller), - make_peer_create_success_handler (controller), - make_peer_event_handler (controller), - make_peer_config_handler (controller), - make_slave_config_handler (controller), - make_link_controllers_result_handler (controller), - make_barrier_status_handler (controller), + GNUNET_MQ_hd_var_size (add_host_confirm, + GNUNET_MESSAGE_TYPE_TESTBED_ADD_HOST_SUCCESS, + struct GNUNET_TESTBED_HostConfirmedMessage, + controller), + GNUNET_MQ_hd_fixed_size (peer_conevent, + GNUNET_MESSAGE_TYPE_TESTBED_PEER_CONNECT_EVENT, + struct GNUNET_TESTBED_ConnectionEventMessage, + controller), + GNUNET_MQ_hd_fixed_size (opsuccess, + GNUNET_MESSAGE_TYPE_TESTBED_GENERIC_OPERATION_SUCCESS, + struct GNUNET_TESTBED_GenericOperationSuccessEventMessage, + controller), + GNUNET_MQ_hd_var_size (op_fail_event, + GNUNET_MESSAGE_TYPE_TESTBED_OPERATION_FAIL_EVENT, + struct GNUNET_TESTBED_OperationFailureEventMessage, + controller), + GNUNET_MQ_hd_fixed_size (peer_create_success, + GNUNET_MESSAGE_TYPE_TESTBED_CREATE_PEER_SUCCESS, + struct GNUNET_TESTBED_PeerCreateSuccessEventMessage, + controller), + GNUNET_MQ_hd_fixed_size (peer_event, + GNUNET_MESSAGE_TYPE_TESTBED_PEER_EVENT, + struct GNUNET_TESTBED_PeerEventMessage, + controller), + GNUNET_MQ_hd_var_size (peer_config, + GNUNET_MESSAGE_TYPE_TESTBED_PEER_INFORMATION, + struct GNUNET_TESTBED_PeerConfigurationInformationMessage, + controller), + GNUNET_MQ_hd_var_size (slave_config, + GNUNET_MESSAGE_TYPE_TESTBED_SLAVE_CONFIGURATION, + struct GNUNET_TESTBED_SlaveConfiguration, + controller), + GNUNET_MQ_hd_var_size (link_controllers_result, + GNUNET_MESSAGE_TYPE_TESTBED_LINK_CONTROLLERS_RESULT, + struct GNUNET_TESTBED_ControllerLinkResponse, + controller), + GNUNET_MQ_hd_var_size (barrier_status, + GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_STATUS, + const struct GNUNET_TESTBED_BarrierStatusMsg, + controller), GNUNET_MQ_handler_end () }; struct GNUNET_TESTBED_InitMessage *msg; diff --git a/src/testbed/testbed_api_barriers.c b/src/testbed/testbed_api_barriers.c index ee75e515c..3761fbbdf 100644 --- a/src/testbed/testbed_api_barriers.c +++ b/src/testbed/testbed_api_barriers.c @@ -171,13 +171,13 @@ GNUNET_TESTBED_barrier_wait (const char *name, GNUNET_TESTBED_barrier_wait_cb cb, void *cb_cls) { - GNUNET_MQ_hd_var_size (status, - GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_STATUS, - struct GNUNET_TESTBED_BarrierStatusMsg); struct GNUNET_TESTBED_BarrierWaitHandle *h = GNUNET_new (struct GNUNET_TESTBED_BarrierWaitHandle); struct GNUNET_MQ_MessageHandler handlers[] = { - make_status_handler (h), + GNUNET_MQ_hd_var_size (status, + GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_STATUS, + struct GNUNET_TESTBED_BarrierStatusMsg, + h), GNUNET_MQ_handler_end () }; struct GNUNET_MQ_Envelope *env; diff --git a/src/topology/gnunet-daemon-topology.c b/src/topology/gnunet-daemon-topology.c index f56cd4bc8..69f01e043 100644 --- a/src/topology/gnunet-daemon-topology.c +++ b/src/topology/gnunet-daemon-topology.c @@ -1147,11 +1147,11 @@ run (void *cls, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c) { - GNUNET_MQ_hd_var_size (hello, - GNUNET_MESSAGE_TYPE_HELLO, - struct GNUNET_HELLO_Message); struct GNUNET_MQ_MessageHandler handlers[] = { - make_hello_handler (NULL), + GNUNET_MQ_hd_var_size (hello, + GNUNET_MESSAGE_TYPE_HELLO, + struct GNUNET_HELLO_Message, + NULL), GNUNET_MQ_handler_end () }; unsigned long long opt; diff --git a/src/transport/gnunet-transport-profiler.c b/src/transport/gnunet-transport-profiler.c index 6e2ac6121..dceff7e3b 100644 --- a/src/transport/gnunet-transport-profiler.c +++ b/src/transport/gnunet-transport-profiler.c @@ -509,11 +509,11 @@ run (void *cls, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *mycfg) { - GNUNET_MQ_hd_var_size (dummy, - GNUNET_MESSAGE_TYPE_DUMMY, - struct GNUNET_MessageHeader); struct GNUNET_MQ_MessageHandler handlers[] = { - make_dummy_handler (NULL), + GNUNET_MQ_hd_var_size (dummy, + GNUNET_MESSAGE_TYPE_DUMMY, + struct GNUNET_MessageHeader, + NULL), GNUNET_MQ_handler_end () }; diff --git a/src/transport/gnunet-transport.c b/src/transport/gnunet-transport.c index fc0eada7a..aceaceb87 100644 --- a/src/transport/gnunet-transport.c +++ b/src/transport/gnunet-transport.c @@ -1517,9 +1517,6 @@ run (void *cls, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *mycfg) { - GNUNET_MQ_hd_var_size (dummy, - GNUNET_MESSAGE_TYPE_DUMMY, - struct GNUNET_MessageHeader); int counter = 0; ret = 1; @@ -1630,7 +1627,10 @@ run (void *cls, else if (benchmark_receive) /* -b: Benchmark receiving */ { struct GNUNET_MQ_MessageHandler handlers[] = { - make_dummy_handler (NULL), + GNUNET_MQ_hd_var_size (dummy, + GNUNET_MESSAGE_TYPE_DUMMY, + struct GNUNET_MessageHeader, + NULL), GNUNET_MQ_handler_end () }; diff --git a/src/transport/transport-testing-main.c b/src/transport/transport-testing-main.c index bba37eee8..a79d81cb9 100644 --- a/src/transport/transport-testing-main.c +++ b/src/transport/transport-testing-main.c @@ -442,12 +442,6 @@ connect_check_run (void *cls, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) { - GNUNET_MQ_hd_var_size (test, - GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE, - struct GNUNET_TRANSPORT_TESTING_TestMessage); - GNUNET_MQ_hd_var_size (test2, - GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE2, - struct GNUNET_TRANSPORT_TESTING_TestMessage); struct GNUNET_TRANSPORT_TESTING_ConnectCheckContext *ccc = cls; int ok; @@ -461,8 +455,14 @@ connect_check_run (void *cls, for (unsigned int i=0;inum_peers;i++) { struct GNUNET_MQ_MessageHandler handlers[] = { - make_test_handler (NULL), - make_test2_handler (NULL), + GNUNET_MQ_hd_var_size (test, + GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE, + struct GNUNET_TRANSPORT_TESTING_TestMessage, + NULL), + GNUNET_MQ_hd_var_size (test2, + GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE2, + struct GNUNET_TRANSPORT_TESTING_TestMessage, + NULL), GNUNET_MQ_handler_end() }; ccc->p[i] = GNUNET_TRANSPORT_TESTING_start_peer (ccc->tth, diff --git a/src/transport/transport_api_address_to_string.c b/src/transport/transport_api_address_to_string.c index a2cad07b0..fd30230f7 100644 --- a/src/transport/transport_api_address_to_string.c +++ b/src/transport/transport_api_address_to_string.c @@ -182,13 +182,13 @@ GNUNET_TRANSPORT_address_to_string (const struct GNUNET_CONFIGURATION_Handle *cf GNUNET_TRANSPORT_AddressToStringCallback aluc, void *aluc_cls) { - GNUNET_MQ_hd_var_size (reply, - GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_TO_STRING_REPLY, - struct AddressToStringResultMessage); struct GNUNET_TRANSPORT_AddressToStringContext *alc = GNUNET_new (struct GNUNET_TRANSPORT_AddressToStringContext); struct GNUNET_MQ_MessageHandler handlers[] = { - make_reply_handler (alc), + GNUNET_MQ_hd_var_size (reply, + GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_TO_STRING_REPLY, + struct AddressToStringResultMessage, + alc), GNUNET_MQ_handler_end () }; size_t alen; diff --git a/src/transport/transport_api_blacklist.c b/src/transport/transport_api_blacklist.c index 2835e225f..4b758f9dc 100644 --- a/src/transport/transport_api_blacklist.c +++ b/src/transport/transport_api_blacklist.c @@ -120,11 +120,11 @@ mq_error_handler (void *cls, static void reconnect (struct GNUNET_TRANSPORT_Blacklist *br) { - GNUNET_MQ_hd_fixed_size (query, - GNUNET_MESSAGE_TYPE_TRANSPORT_BLACKLIST_QUERY, - struct BlacklistMessage); struct GNUNET_MQ_MessageHandler handlers[] = { - make_query_handler (br), + GNUNET_MQ_hd_fixed_size (query, + GNUNET_MESSAGE_TYPE_TRANSPORT_BLACKLIST_QUERY, + struct BlacklistMessage, + br), GNUNET_MQ_handler_end () }; struct GNUNET_MQ_Envelope *env; diff --git a/src/transport/transport_api_core.c b/src/transport/transport_api_core.c index 6be9500fb..0705552f9 100644 --- a/src/transport/transport_api_core.c +++ b/src/transport/transport_api_core.c @@ -748,32 +748,32 @@ handle_set_quota (void *cls, static void reconnect (void *cls) { - GNUNET_MQ_hd_var_size (hello, - GNUNET_MESSAGE_TYPE_HELLO, - struct GNUNET_MessageHeader); - GNUNET_MQ_hd_fixed_size (connect, - GNUNET_MESSAGE_TYPE_TRANSPORT_CONNECT, - struct ConnectInfoMessage); - GNUNET_MQ_hd_fixed_size (disconnect, - GNUNET_MESSAGE_TYPE_TRANSPORT_DISCONNECT, - struct DisconnectInfoMessage); - GNUNET_MQ_hd_fixed_size (send_ok, - GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_OK, - struct SendOkMessage); - GNUNET_MQ_hd_var_size (recv, - GNUNET_MESSAGE_TYPE_TRANSPORT_RECV, - struct InboundMessage); - GNUNET_MQ_hd_fixed_size (set_quota, - GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA, - struct QuotaSetMessage); struct GNUNET_TRANSPORT_CoreHandle *h = cls; struct GNUNET_MQ_MessageHandler handlers[] = { - make_hello_handler (h), - make_connect_handler (h), - make_disconnect_handler (h), - make_send_ok_handler (h), - make_recv_handler (h), - make_set_quota_handler (h), + GNUNET_MQ_hd_var_size (hello, + GNUNET_MESSAGE_TYPE_HELLO, + struct GNUNET_MessageHeader, + h), + GNUNET_MQ_hd_fixed_size (connect, + GNUNET_MESSAGE_TYPE_TRANSPORT_CONNECT, + struct ConnectInfoMessage, + h), + GNUNET_MQ_hd_fixed_size (disconnect, + GNUNET_MESSAGE_TYPE_TRANSPORT_DISCONNECT, + struct DisconnectInfoMessage, + h), + GNUNET_MQ_hd_fixed_size (send_ok, + GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_OK, + struct SendOkMessage, + h), + GNUNET_MQ_hd_var_size (recv, + GNUNET_MESSAGE_TYPE_TRANSPORT_RECV, + struct InboundMessage, + h), + GNUNET_MQ_hd_fixed_size (set_quota, + GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA, + struct QuotaSetMessage, + h), GNUNET_MQ_handler_end () }; struct GNUNET_MQ_Envelope *env; diff --git a/src/transport/transport_api_hello_get.c b/src/transport/transport_api_hello_get.c index ec7b544d6..9c3a3e786 100644 --- a/src/transport/transport_api_hello_get.c +++ b/src/transport/transport_api_hello_get.c @@ -167,12 +167,12 @@ mq_error_handler (void *cls, static void reconnect (void *cls) { - GNUNET_MQ_hd_var_size (hello, - GNUNET_MESSAGE_TYPE_HELLO, - struct GNUNET_MessageHeader); struct GNUNET_TRANSPORT_HelloGetHandle *ghh = cls; struct GNUNET_MQ_MessageHandler handlers[] = { - make_hello_handler (ghh), + GNUNET_MQ_hd_var_size (hello, + GNUNET_MESSAGE_TYPE_HELLO, + struct GNUNET_MessageHeader, + ghh), GNUNET_MQ_handler_end () }; struct GNUNET_MQ_Envelope *env; diff --git a/src/transport/transport_api_monitor_peers.c b/src/transport/transport_api_monitor_peers.c index a5c70fcfa..345f2ad60 100644 --- a/src/transport/transport_api_monitor_peers.c +++ b/src/transport/transport_api_monitor_peers.c @@ -344,16 +344,16 @@ mq_error_handler (void *cls, static void do_peer_connect (void *cls) { - GNUNET_MQ_hd_var_size (response, - GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PEER_RESPONSE, - struct PeerIterateResponseMessage); - GNUNET_MQ_hd_fixed_size (response_end, - GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PEER_RESPONSE_END, - struct GNUNET_MessageHeader); struct GNUNET_TRANSPORT_PeerMonitoringContext *pal_ctx = cls; struct GNUNET_MQ_MessageHandler handlers[] = { - make_response_handler (pal_ctx), - make_response_end_handler (pal_ctx), + GNUNET_MQ_hd_var_size (response, + GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PEER_RESPONSE, + struct PeerIterateResponseMessage, + pal_ctx), + GNUNET_MQ_hd_fixed_size (response_end, + GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PEER_RESPONSE_END, + struct GNUNET_MessageHeader, + pal_ctx), GNUNET_MQ_handler_end () }; struct PeerMonitorMessage *msg; diff --git a/src/transport/transport_api_monitor_plugins.c b/src/transport/transport_api_monitor_plugins.c index 01ec2074a..7547a3402 100644 --- a/src/transport/transport_api_monitor_plugins.c +++ b/src/transport/transport_api_monitor_plugins.c @@ -372,16 +372,16 @@ mq_error_handler (void *cls, static void do_plugin_connect (void *cls) { - GNUNET_MQ_hd_var_size (event, - GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PLUGIN_EVENT, - struct TransportPluginMonitorMessage); - GNUNET_MQ_hd_fixed_size (sync, - GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PLUGIN_SYNC, - struct GNUNET_MessageHeader); struct GNUNET_TRANSPORT_PluginMonitor *pm = cls; struct GNUNET_MQ_MessageHandler handlers[] = { - make_event_handler (pm), - make_sync_handler (pm), + GNUNET_MQ_hd_var_size (event, + GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PLUGIN_EVENT, + struct TransportPluginMonitorMessage, + pm), + GNUNET_MQ_hd_fixed_size (sync, + GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PLUGIN_SYNC, + struct GNUNET_MessageHeader, + pm), GNUNET_MQ_handler_end () }; struct GNUNET_MessageHeader *msg; diff --git a/src/util/resolver_api.c b/src/util/resolver_api.c index c4ce1ccc2..481e99157 100644 --- a/src/util/resolver_api.c +++ b/src/util/resolver_api.c @@ -722,12 +722,12 @@ loopback_resolution (void *cls) static void reconnect_task (void *cls) { - GNUNET_MQ_hd_var_size (response, - GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE, - struct GNUNET_MessageHeader); struct GNUNET_MQ_MessageHandler handlers[] = { - make_response_handler (NULL), - GNUNET_MQ_handler_end () + GNUNET_MQ_hd_var_size (response, + GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE, + struct GNUNET_MessageHeader, + NULL), + GNUNET_MQ_handler_end () }; r_task = NULL; diff --git a/src/util/test_client.c b/src/util/test_client.c index 07af5ea35..558a3cf1e 100644 --- a/src/util/test_client.c +++ b/src/util/test_client.c @@ -136,11 +136,11 @@ task (void *cls) socklen_t slens[2]; struct GNUNET_MQ_Envelope *env; struct GNUNET_MessageHeader *msg; - GNUNET_MQ_hd_fixed_size (bounce, - MY_TYPE, - struct GNUNET_MessageHeader); struct GNUNET_MQ_MessageHandler chandlers[] = { - make_bounce_handler (cls), + GNUNET_MQ_hd_fixed_size (bounce, + MY_TYPE, + struct GNUNET_MessageHeader, + cls), GNUNET_MQ_handler_end () }; diff --git a/src/util/test_server.c b/src/util/test_server.c index 6d8fffc69..eac45fc69 100644 --- a/src/util/test_server.c +++ b/src/util/test_server.c @@ -231,11 +231,11 @@ task (void *cls) socklen_t slens[2]; struct GNUNET_MQ_Envelope *env; struct GNUNET_MessageHeader *msg; - GNUNET_MQ_hd_fixed_size (reply, - MY_TYPE, - struct GNUNET_MessageHeader); struct GNUNET_MQ_MessageHandler chandlers[] = { - make_reply_handler (cls), + GNUNET_MQ_hd_fixed_size (reply, + MY_TYPE, + struct GNUNET_MessageHeader, + cls), GNUNET_MQ_handler_end () }; diff --git a/src/util/test_socks.c b/src/util/test_socks.c index d6064afd5..416f32f62 100644 --- a/src/util/test_socks.c +++ b/src/util/test_socks.c @@ -133,11 +133,11 @@ task (void *cls) socklen_t slens[2]; struct GNUNET_MQ_Envelope *env; struct GNUNET_MessageHeader *msg; - GNUNET_MQ_hd_fixed_size (bounce, - MY_TYPE, - struct GNUNET_MessageHeader); struct GNUNET_MQ_MessageHandler chandlers[] = { - make_bounce_handler (cls), + GNUNET_MQ_hd_fixed_size (bounce, + MY_TYPE, + struct GNUNET_MessageHeader, + cls), GNUNET_MQ_handler_end () }; diff --git a/src/vpn/vpn_api.c b/src/vpn/vpn_api.c index ad0b5e9f0..b22b805cd 100644 --- a/src/vpn/vpn_api.c +++ b/src/vpn/vpn_api.c @@ -314,11 +314,11 @@ static void connect_task (void *cls) { struct GNUNET_VPN_Handle *vh = cls; - GNUNET_MQ_hd_var_size (use_ip, - GNUNET_MESSAGE_TYPE_VPN_CLIENT_USE_IP, - struct RedirectToIpResponseMessage); struct GNUNET_MQ_MessageHandler handlers[] = { - make_use_ip_handler (cls), + GNUNET_MQ_hd_var_size (use_ip, + GNUNET_MESSAGE_TYPE_VPN_CLIENT_USE_IP, + struct RedirectToIpResponseMessage, + cls), GNUNET_MQ_handler_end () }; struct GNUNET_VPN_RedirectionRequest *rr;