diff options
Diffstat (limited to 'src/social/social_api.c')
-rw-r--r-- | src/social/social_api.c | 171 |
1 files changed, 76 insertions, 95 deletions
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) | |||
1155 | { | 1155 | { |
1156 | struct GNUNET_SOCIAL_Place *plc = &hst->plc; | 1156 | struct GNUNET_SOCIAL_Place *plc = &hst->plc; |
1157 | 1157 | ||
1158 | GNUNET_MQ_hd_fixed_size (host_enter_ack, | ||
1159 | GNUNET_MESSAGE_TYPE_SOCIAL_HOST_ENTER_ACK, | ||
1160 | struct HostEnterAck); | ||
1161 | |||
1162 | GNUNET_MQ_hd_var_size (host_enter_request, | ||
1163 | GNUNET_MESSAGE_TYPE_PSYC_JOIN_REQUEST, | ||
1164 | struct GNUNET_PSYC_JoinRequestMessage); | ||
1165 | |||
1166 | GNUNET_MQ_hd_var_size (host_message, | ||
1167 | GNUNET_MESSAGE_TYPE_PSYC_MESSAGE, | ||
1168 | struct GNUNET_PSYC_MessageHeader); | ||
1169 | |||
1170 | GNUNET_MQ_hd_fixed_size (place_message_ack, | ||
1171 | GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_ACK, | ||
1172 | struct GNUNET_MessageHeader); | ||
1173 | |||
1174 | GNUNET_MQ_hd_var_size (place_history_result, | ||
1175 | GNUNET_MESSAGE_TYPE_PSYC_HISTORY_RESULT, | ||
1176 | struct GNUNET_OperationResultMessage); | ||
1177 | |||
1178 | GNUNET_MQ_hd_var_size (place_state_result, | ||
1179 | GNUNET_MESSAGE_TYPE_PSYC_STATE_RESULT, | ||
1180 | struct GNUNET_OperationResultMessage); | ||
1181 | |||
1182 | GNUNET_MQ_hd_var_size (place_result, | ||
1183 | GNUNET_MESSAGE_TYPE_PSYC_RESULT_CODE, | ||
1184 | struct GNUNET_OperationResultMessage); | ||
1185 | |||
1186 | struct GNUNET_MQ_MessageHandler handlers[] = { | 1158 | struct GNUNET_MQ_MessageHandler handlers[] = { |
1187 | make_host_enter_ack_handler (hst), | 1159 | GNUNET_MQ_hd_fixed_size (host_enter_ack, |
1188 | make_host_enter_request_handler (hst), | 1160 | GNUNET_MESSAGE_TYPE_SOCIAL_HOST_ENTER_ACK, |
1189 | make_host_message_handler (plc), | 1161 | struct HostEnterAck, |
1190 | make_place_message_ack_handler (plc), | 1162 | hst), |
1191 | make_place_history_result_handler (plc), | 1163 | GNUNET_MQ_hd_var_size (host_enter_request, |
1192 | make_place_state_result_handler (plc), | 1164 | GNUNET_MESSAGE_TYPE_PSYC_JOIN_REQUEST, |
1193 | make_place_result_handler (plc), | 1165 | struct GNUNET_PSYC_JoinRequestMessage, |
1166 | hst), | ||
1167 | GNUNET_MQ_hd_var_size (host_message, | ||
1168 | GNUNET_MESSAGE_TYPE_PSYC_MESSAGE, | ||
1169 | struct GNUNET_PSYC_MessageHeader, | ||
1170 | hst), | ||
1171 | GNUNET_MQ_hd_fixed_size (place_message_ack, | ||
1172 | GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_ACK, | ||
1173 | struct GNUNET_MessageHeader, | ||
1174 | plc), | ||
1175 | GNUNET_MQ_hd_var_size (place_history_result, | ||
1176 | GNUNET_MESSAGE_TYPE_PSYC_HISTORY_RESULT, | ||
1177 | struct GNUNET_OperationResultMessage, | ||
1178 | plc), | ||
1179 | GNUNET_MQ_hd_var_size (place_state_result, | ||
1180 | GNUNET_MESSAGE_TYPE_PSYC_STATE_RESULT, | ||
1181 | struct GNUNET_OperationResultMessage, | ||
1182 | plc), | ||
1183 | GNUNET_MQ_hd_var_size (place_result, | ||
1184 | GNUNET_MESSAGE_TYPE_PSYC_RESULT_CODE, | ||
1185 | struct GNUNET_OperationResultMessage, | ||
1186 | plc), | ||
1194 | GNUNET_MQ_handler_end () | 1187 | GNUNET_MQ_handler_end () |
1195 | }; | 1188 | }; |
1196 | 1189 | ||
@@ -1664,42 +1657,35 @@ guest_connect (struct GNUNET_SOCIAL_Guest *gst) | |||
1664 | { | 1657 | { |
1665 | struct GNUNET_SOCIAL_Place *plc = &gst->plc; | 1658 | struct GNUNET_SOCIAL_Place *plc = &gst->plc; |
1666 | 1659 | ||
1667 | GNUNET_MQ_hd_fixed_size (guest_enter_ack, | ||
1668 | GNUNET_MESSAGE_TYPE_SOCIAL_GUEST_ENTER_ACK, | ||
1669 | struct GNUNET_PSYC_CountersResultMessage); | ||
1670 | |||
1671 | GNUNET_MQ_hd_var_size (guest_enter_decision, | ||
1672 | GNUNET_MESSAGE_TYPE_PSYC_JOIN_DECISION, | ||
1673 | struct GNUNET_PSYC_JoinDecisionMessage); | ||
1674 | |||
1675 | GNUNET_MQ_hd_var_size (place_message, | ||
1676 | GNUNET_MESSAGE_TYPE_PSYC_MESSAGE, | ||
1677 | struct GNUNET_PSYC_MessageHeader); | ||
1678 | |||
1679 | GNUNET_MQ_hd_fixed_size (place_message_ack, | ||
1680 | GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_ACK, | ||
1681 | struct GNUNET_MessageHeader); | ||
1682 | |||
1683 | GNUNET_MQ_hd_var_size (place_history_result, | ||
1684 | GNUNET_MESSAGE_TYPE_PSYC_HISTORY_RESULT, | ||
1685 | struct GNUNET_OperationResultMessage); | ||
1686 | |||
1687 | GNUNET_MQ_hd_var_size (place_state_result, | ||
1688 | GNUNET_MESSAGE_TYPE_PSYC_STATE_RESULT, | ||
1689 | struct GNUNET_OperationResultMessage); | ||
1690 | |||
1691 | GNUNET_MQ_hd_var_size (place_result, | ||
1692 | GNUNET_MESSAGE_TYPE_PSYC_RESULT_CODE, | ||
1693 | struct GNUNET_OperationResultMessage); | ||
1694 | |||
1695 | struct GNUNET_MQ_MessageHandler handlers[] = { | 1660 | struct GNUNET_MQ_MessageHandler handlers[] = { |
1696 | make_guest_enter_ack_handler (gst), | 1661 | GNUNET_MQ_hd_fixed_size (guest_enter_ack, |
1697 | make_guest_enter_decision_handler (gst), | 1662 | GNUNET_MESSAGE_TYPE_SOCIAL_GUEST_ENTER_ACK, |
1698 | make_place_message_handler (plc), | 1663 | struct GNUNET_PSYC_CountersResultMessage, |
1699 | make_place_message_ack_handler (plc), | 1664 | gst), |
1700 | make_place_history_result_handler (plc), | 1665 | GNUNET_MQ_hd_var_size (guest_enter_decision, |
1701 | make_place_state_result_handler (plc), | 1666 | GNUNET_MESSAGE_TYPE_PSYC_JOIN_DECISION, |
1702 | make_place_result_handler (plc), | 1667 | struct GNUNET_PSYC_JoinDecisionMessage, |
1668 | gst), | ||
1669 | GNUNET_MQ_hd_var_size (place_message, | ||
1670 | GNUNET_MESSAGE_TYPE_PSYC_MESSAGE, | ||
1671 | struct GNUNET_PSYC_MessageHeader, | ||
1672 | plc), | ||
1673 | GNUNET_MQ_hd_fixed_size (place_message_ack, | ||
1674 | GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_ACK, | ||
1675 | struct GNUNET_MessageHeader, | ||
1676 | plc), | ||
1677 | GNUNET_MQ_hd_var_size (place_history_result, | ||
1678 | GNUNET_MESSAGE_TYPE_PSYC_HISTORY_RESULT, | ||
1679 | struct GNUNET_OperationResultMessage, | ||
1680 | plc), | ||
1681 | GNUNET_MQ_hd_var_size (place_state_result, | ||
1682 | GNUNET_MESSAGE_TYPE_PSYC_STATE_RESULT, | ||
1683 | struct GNUNET_OperationResultMessage, | ||
1684 | plc), | ||
1685 | GNUNET_MQ_hd_var_size (place_result, | ||
1686 | GNUNET_MESSAGE_TYPE_PSYC_RESULT_CODE, | ||
1687 | struct GNUNET_OperationResultMessage, | ||
1688 | plc), | ||
1703 | GNUNET_MQ_handler_end () | 1689 | GNUNET_MQ_handler_end () |
1704 | }; | 1690 | }; |
1705 | 1691 | ||
@@ -2579,32 +2565,27 @@ app_disconnected (void *cls, enum GNUNET_MQ_Error error) | |||
2579 | static void | 2565 | static void |
2580 | app_connect (struct GNUNET_SOCIAL_App *app) | 2566 | app_connect (struct GNUNET_SOCIAL_App *app) |
2581 | { | 2567 | { |
2582 | GNUNET_MQ_hd_var_size (app_ego, | ||
2583 | GNUNET_MESSAGE_TYPE_SOCIAL_APP_EGO, | ||
2584 | struct AppEgoMessage); | ||
2585 | |||
2586 | GNUNET_MQ_hd_fixed_size (app_ego_end, | ||
2587 | GNUNET_MESSAGE_TYPE_SOCIAL_APP_EGO_END, | ||
2588 | struct GNUNET_MessageHeader); | ||
2589 | |||
2590 | GNUNET_MQ_hd_var_size (app_place, | ||
2591 | GNUNET_MESSAGE_TYPE_SOCIAL_APP_PLACE, | ||
2592 | struct AppPlaceMessage); | ||
2593 | |||
2594 | GNUNET_MQ_hd_fixed_size (app_place_end, | ||
2595 | GNUNET_MESSAGE_TYPE_SOCIAL_APP_PLACE_END, | ||
2596 | struct GNUNET_MessageHeader); | ||
2597 | |||
2598 | GNUNET_MQ_hd_var_size (app_result, | ||
2599 | GNUNET_MESSAGE_TYPE_PSYC_RESULT_CODE, | ||
2600 | struct GNUNET_OperationResultMessage); | ||
2601 | |||
2602 | struct GNUNET_MQ_MessageHandler handlers[] = { | 2568 | struct GNUNET_MQ_MessageHandler handlers[] = { |
2603 | make_app_ego_handler (app), | 2569 | GNUNET_MQ_hd_var_size (app_ego, |
2604 | make_app_ego_end_handler (app), | 2570 | GNUNET_MESSAGE_TYPE_SOCIAL_APP_EGO, |
2605 | make_app_place_handler (app), | 2571 | struct AppEgoMessage, |
2606 | make_app_place_end_handler (app), | 2572 | app), |
2607 | make_app_result_handler (app), | 2573 | GNUNET_MQ_hd_fixed_size (app_ego_end, |
2574 | GNUNET_MESSAGE_TYPE_SOCIAL_APP_EGO_END, | ||
2575 | struct GNUNET_MessageHeader, | ||
2576 | app), | ||
2577 | GNUNET_MQ_hd_var_size (app_place, | ||
2578 | GNUNET_MESSAGE_TYPE_SOCIAL_APP_PLACE, | ||
2579 | struct AppPlaceMessage, | ||
2580 | app), | ||
2581 | GNUNET_MQ_hd_fixed_size (app_place_end, | ||
2582 | GNUNET_MESSAGE_TYPE_SOCIAL_APP_PLACE_END, | ||
2583 | struct GNUNET_MessageHeader, | ||
2584 | app), | ||
2585 | GNUNET_MQ_hd_var_size (app_result, | ||
2586 | GNUNET_MESSAGE_TYPE_PSYC_RESULT_CODE, | ||
2587 | struct GNUNET_OperationResultMessage, | ||
2588 | app), | ||
2608 | GNUNET_MQ_handler_end () | 2589 | GNUNET_MQ_handler_end () |
2609 | }; | 2590 | }; |
2610 | 2591 | ||