diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-07-25 16:21:08 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-07-25 16:21:08 +0000 |
commit | 59a1974b48463e363442bd4e8f81741ee86d4123 (patch) | |
tree | 0ff840b29d0075a99b72344b911de0fc0b7893cd /src/core/gnunet-service-core_kx.c | |
parent | 0b426b77cec77e80f10611614caf0689db2014b8 (diff) | |
download | gnunet-59a1974b48463e363442bd4e8f81741ee86d4123.tar.gz gnunet-59a1974b48463e363442bd4e8f81741ee86d4123.zip |
-preparatory steps for transport API change
Diffstat (limited to 'src/core/gnunet-service-core_kx.c')
-rw-r--r-- | src/core/gnunet-service-core_kx.c | 45 |
1 files changed, 41 insertions, 4 deletions
diff --git a/src/core/gnunet-service-core_kx.c b/src/core/gnunet-service-core_kx.c index f2d3e0492..6a71099ae 100644 --- a/src/core/gnunet-service-core_kx.c +++ b/src/core/gnunet-service-core_kx.c | |||
@@ -1608,6 +1608,41 @@ GSC_KX_handle_encrypted_message (struct GSC_KeyExchangeInfo *kx, | |||
1608 | 1608 | ||
1609 | 1609 | ||
1610 | /** | 1610 | /** |
1611 | * Obtain the array of message handlers provided by KX. | ||
1612 | * | ||
1613 | * @return NULL-entry terminated array of handlers | ||
1614 | */ | ||
1615 | const struct GNUNET_MQ_MessageHandler * | ||
1616 | GSC_KX_get_handlers (void) | ||
1617 | { | ||
1618 | #if 0 | ||
1619 | GNUNET_MQ_hd_fixed_size (ephemeral_key, | ||
1620 | GNUNET_MESSAGE_TYPE_CORE_EPHEMERAL_KEY, | ||
1621 | struct EphemeralKeyMessage); | ||
1622 | GNUNET_MQ_hd_fixed_size (ping, | ||
1623 | PING, | ||
1624 | struct PingMessage); | ||
1625 | GNUNET_MQ_hd_fixed_size (pong, | ||
1626 | PING, | ||
1627 | struct PongMessage); | ||
1628 | GNUNET_MQ_hd_var_size (encrypted, | ||
1629 | PING, | ||
1630 | struct ping); | ||
1631 | #endif | ||
1632 | static struct GNUNET_MQ_MessageHandler handlers[] = { | ||
1633 | #if 0 | ||
1634 | make_ephemeral_key_handler (), | ||
1635 | make_ping_handler (), | ||
1636 | make_pong_handler (), | ||
1637 | make_encrypted_handler (), | ||
1638 | #endif | ||
1639 | GNUNET_MQ_handler_end() | ||
1640 | }; | ||
1641 | return handlers; | ||
1642 | } | ||
1643 | |||
1644 | |||
1645 | /** | ||
1611 | * Deliver P2P message to interested clients. | 1646 | * Deliver P2P message to interested clients. |
1612 | * Invokes send twice, once for clients that want the full message, and once | 1647 | * Invokes send twice, once for clients that want the full message, and once |
1613 | * for clients that only want the header | 1648 | * for clients that only want the header |
@@ -1641,10 +1676,12 @@ deliver_message (void *cls, | |||
1641 | GSC_SESSIONS_confirm_typemap (dmc->peer, m); | 1676 | GSC_SESSIONS_confirm_typemap (dmc->peer, m); |
1642 | return GNUNET_OK; | 1677 | return GNUNET_OK; |
1643 | default: | 1678 | default: |
1644 | GSC_CLIENTS_deliver_message (dmc->peer, m, | 1679 | GSC_CLIENTS_deliver_message (dmc->peer, |
1680 | m, | ||
1645 | ntohs (m->size), | 1681 | ntohs (m->size), |
1646 | GNUNET_CORE_OPTION_SEND_FULL_INBOUND); | 1682 | GNUNET_CORE_OPTION_SEND_FULL_INBOUND); |
1647 | GSC_CLIENTS_deliver_message (dmc->peer, m, | 1683 | GSC_CLIENTS_deliver_message (dmc->peer, |
1684 | m, | ||
1648 | sizeof (struct GNUNET_MessageHeader), | 1685 | sizeof (struct GNUNET_MessageHeader), |
1649 | GNUNET_CORE_OPTION_SEND_HDR_INBOUND); | 1686 | GNUNET_CORE_OPTION_SEND_HDR_INBOUND); |
1650 | } | 1687 | } |
@@ -1686,8 +1723,8 @@ sign_ephemeral_key () | |||
1686 | current_ekm.origin_identity = GSC_my_identity; | 1723 | current_ekm.origin_identity = GSC_my_identity; |
1687 | GNUNET_assert (GNUNET_OK == | 1724 | GNUNET_assert (GNUNET_OK == |
1688 | GNUNET_CRYPTO_eddsa_sign (my_private_key, | 1725 | GNUNET_CRYPTO_eddsa_sign (my_private_key, |
1689 | ¤t_ekm.purpose, | 1726 | ¤t_ekm.purpose, |
1690 | ¤t_ekm.signature)); | 1727 | ¤t_ekm.signature)); |
1691 | } | 1728 | } |
1692 | 1729 | ||
1693 | 1730 | ||