aboutsummaryrefslogtreecommitdiff
path: root/src/psyc/psyc_api.c
diff options
context:
space:
mode:
authorGabor X Toth <*@tg-x.net>2014-07-27 13:17:03 +0000
committerGabor X Toth <*@tg-x.net>2014-07-27 13:17:03 +0000
commitb63820a52b63d264bead047d0d6f4b76a94c4030 (patch)
treea678202b91694d3582ae61c57a7badac483693d1 /src/psyc/psyc_api.c
parent2f0367bf715c7c0abd12b3e167f329311a35f6e2 (diff)
downloadgnunet-b63820a52b63d264bead047d0d6f4b76a94c4030.tar.gz
gnunet-b63820a52b63d264bead047d0d6f4b76a94c4030.zip
psyc: membership store
Diffstat (limited to 'src/psyc/psyc_api.c')
-rw-r--r--src/psyc/psyc_api.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/psyc/psyc_api.c b/src/psyc/psyc_api.c
index a43b1ef5f..ca25b1b01 100644
--- a/src/psyc/psyc_api.c
+++ b/src/psyc/psyc_api.c
@@ -810,12 +810,14 @@ GNUNET_PSYC_channel_slave_add (struct GNUNET_PSYC_Channel *chn,
810 uint64_t announced_at, 810 uint64_t announced_at,
811 uint64_t effective_since) 811 uint64_t effective_since)
812{ 812{
813 struct ChannelSlaveAddRequest *add = GNUNET_malloc (sizeof (*add)); 813 struct ChannelMembershipStoreRequest *req = GNUNET_malloc (sizeof (*req));
814 add->header.type = htons (GNUNET_MESSAGE_TYPE_PSYC_CHANNEL_SLAVE_ADD); 814 req->header.type = htons (GNUNET_MESSAGE_TYPE_PSYC_CHANNEL_MEMBERSHIP_STORE);
815 add->header.size = htons (sizeof (*add)); 815 req->header.size = htons (sizeof (*req));
816 add->announced_at = GNUNET_htonll (announced_at); 816 req->slave_key = *slave_key;
817 add->effective_since = GNUNET_htonll (effective_since); 817 req->announced_at = GNUNET_htonll (announced_at);
818 GNUNET_CLIENT_MANAGER_transmit (chn->client, &add->header); 818 req->effective_since = GNUNET_htonll (effective_since);
819 req->did_join = GNUNET_YES;
820 GNUNET_CLIENT_MANAGER_transmit (chn->client, &req->header);
819} 821}
820 822
821 823
@@ -845,11 +847,13 @@ GNUNET_PSYC_channel_slave_remove (struct GNUNET_PSYC_Channel *chn,
845 const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_key, 847 const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_key,
846 uint64_t announced_at) 848 uint64_t announced_at)
847{ 849{
848 struct ChannelSlaveRemoveRequest *rm = GNUNET_malloc (sizeof (*rm)); 850 struct ChannelMembershipStoreRequest *req = GNUNET_malloc (sizeof (*req));
849 rm->header.type = htons (GNUNET_MESSAGE_TYPE_PSYC_CHANNEL_SLAVE_RM); 851 req->header.type = htons (GNUNET_MESSAGE_TYPE_PSYC_CHANNEL_MEMBERSHIP_STORE);
850 rm->header.size = htons (sizeof (*rm)); 852 req->header.size = htons (sizeof (*req));
851 rm->announced_at = GNUNET_htonll (announced_at); 853 req->slave_key = *slave_key;
852 GNUNET_CLIENT_MANAGER_transmit (chn->client, &rm->header); 854 req->announced_at = GNUNET_htonll (announced_at);
855 req->did_join = GNUNET_NO;
856 GNUNET_CLIENT_MANAGER_transmit (chn->client, &req->header);
853} 857}
854 858
855 859