From 38e65c6c5268614b482d1234fea76cda11811044 Mon Sep 17 00:00:00 2001 From: Gabor X Toth <*@tg-x.net> Date: Fri, 15 Jan 2016 22:12:31 +0000 Subject: psyc/multicast: var names --- src/include/gnunet_multicast_service.h | 18 ++++---- src/include/gnunet_psyc_service.h | 26 ++++++------ src/multicast/gnunet-service-multicast.c | 72 ++++++++++++++++---------------- src/multicast/multicast.h | 12 +++--- src/multicast/multicast_api.c | 18 ++++---- src/multicast/test_multicast.c | 2 +- src/psyc/gnunet-service-psyc.c | 54 ++++++++++++------------ src/psyc/psyc.h | 2 +- src/psyc/psyc_api.c | 20 ++++----- src/psycutil/psyc_message.c | 8 ++-- 10 files changed, 117 insertions(+), 115 deletions(-) diff --git a/src/include/gnunet_multicast_service.h b/src/include/gnunet_multicast_service.h index 9bbc69243..a4da495a3 100644 --- a/src/include/gnunet_multicast_service.h +++ b/src/include/gnunet_multicast_service.h @@ -179,7 +179,7 @@ struct GNUNET_MULTICAST_RequestHeader /** * Public key of the sending member. */ - struct GNUNET_CRYPTO_EcdsaPublicKey member_key; + struct GNUNET_CRYPTO_EcdsaPublicKey member_pub_key; /** * ECC signature of the request fragment. @@ -285,7 +285,7 @@ GNUNET_MULTICAST_join_decision (struct GNUNET_MULTICAST_JoinHandle *jh, * * @param cls * Closure. - * @param member_key + * @param member_pub_key * Public key of the member requesting join. * @param join_msg * Application-dependent join message from the new member. @@ -294,7 +294,7 @@ GNUNET_MULTICAST_join_decision (struct GNUNET_MULTICAST_JoinHandle *jh, */ typedef void (*GNUNET_MULTICAST_JoinRequestCallback) (void *cls, - const struct GNUNET_CRYPTO_EcdsaPublicKey *member_key, + const struct GNUNET_CRYPTO_EcdsaPublicKey *member_pub_key, const struct GNUNET_MessageHeader *join_msg, struct GNUNET_MULTICAST_JoinHandle *jh); @@ -398,7 +398,7 @@ struct GNUNET_MULTICAST_ReplayHandle; * @param cls * Closure (set from GNUNET_MULTICAST_origin_start() * or GNUNET_MULTICAST_member_join()). - * @param member_key + * @param member_pub_key * The member requesting replay. * @param fragment_id * Which message fragment should be replayed. @@ -409,7 +409,7 @@ struct GNUNET_MULTICAST_ReplayHandle; */ typedef void (*GNUNET_MULTICAST_ReplayFragmentCallback) (void *cls, - const struct GNUNET_CRYPTO_EcdsaPublicKey *member_key, + const struct GNUNET_CRYPTO_EcdsaPublicKey *member_pub_key, uint64_t fragment_id, uint64_t flags, struct GNUNET_MULTICAST_ReplayHandle *rh); @@ -425,7 +425,7 @@ typedef void * @param cls * Closure (set from GNUNET_MULTICAST_origin_start() * or GNUNET_MULTICAST_member_join()). - * @param member_key + * @param member_pub_key * The member requesting replay. * @param message_id * Which message should be replayed. @@ -438,7 +438,7 @@ typedef void */ typedef void (*GNUNET_MULTICAST_ReplayMessageCallback) (void *cls, - const struct GNUNET_CRYPTO_EcdsaPublicKey *member_key, + const struct GNUNET_CRYPTO_EcdsaPublicKey *member_pub_key, uint64_t message_id, uint64_t fragment_offset, uint64_t flags, @@ -697,7 +697,7 @@ GNUNET_MULTICAST_origin_stop (struct GNUNET_MULTICAST_Origin *origin, * Configuration to use. * @param group_key * ECC public key that identifies the group to join. - * @param member_key + * @param member_pub_key * ECC key that identifies the member * and used to sign requests sent to the origin. * @param origin @@ -736,7 +736,7 @@ GNUNET_MULTICAST_origin_stop (struct GNUNET_MULTICAST_Origin *origin, struct GNUNET_MULTICAST_Member * GNUNET_MULTICAST_member_join (const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_CRYPTO_EddsaPublicKey *group_key, - const struct GNUNET_CRYPTO_EcdsaPrivateKey *member_key, + const struct GNUNET_CRYPTO_EcdsaPrivateKey *member_pub_key, const struct GNUNET_PeerIdentity *origin, uint16_t relay_count, const struct GNUNET_PeerIdentity *relays, diff --git a/src/include/gnunet_psyc_service.h b/src/include/gnunet_psyc_service.h index 526a70f01..57134baf5 100644 --- a/src/include/gnunet_psyc_service.h +++ b/src/include/gnunet_psyc_service.h @@ -258,7 +258,7 @@ struct GNUNET_PSYC_MessageHeader * Sending slave's public key. * Not set if the message is from the master. */ - struct GNUNET_CRYPTO_EcdsaPublicKey slave_key; + struct GNUNET_CRYPTO_EcdsaPublicKey slave_pub_key; /* Followed by concatenated PSYC message parts: * messages with GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_* types @@ -351,7 +351,7 @@ struct GNUNET_PSYC_JoinRequestMessage /** * Public key of the joining slave. */ - struct GNUNET_CRYPTO_EcdsaPublicKey slave_key; + struct GNUNET_CRYPTO_EcdsaPublicKey slave_pub_key; /* Followed by struct GNUNET_MessageHeader join_request */ }; @@ -377,7 +377,7 @@ struct GNUNET_PSYC_JoinDecisionMessage * Only set when the master is sending the decision, * not set when a slave is receiving it. */ - struct GNUNET_CRYPTO_EcdsaPublicKey slave_key; + struct GNUNET_CRYPTO_EcdsaPublicKey slave_pub_key; /* Followed by struct GNUNET_MessageHeader join_response */ }; @@ -544,7 +544,7 @@ typedef void * * @param cls * Closure. - * @param slave_key + * @param slave_pub_key * Public key of the slave sending the message. * Only set for channel master. * @param message_id @@ -564,7 +564,7 @@ typedef void */ typedef void (*GNUNET_PSYC_MessagePartCallback) (void *cls, - const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_key, + const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_pub_key, uint64_t message_id, uint32_t flags, uint64_t data_offset, @@ -576,7 +576,7 @@ typedef void * * @param cls * Closure. - * @param slave_key + * @param slave_pub_key * Public key of the slave requesting join. * @param join_msg * Join message sent along with the request. @@ -586,7 +586,7 @@ typedef void typedef void (*GNUNET_PSYC_JoinRequestCallback) (void *cls, const struct GNUNET_PSYC_JoinRequestMessage *req, - const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_key, + const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_pub_key, const struct GNUNET_PSYC_Message *join_msg, struct GNUNET_PSYC_JoinHandle *jh); @@ -920,7 +920,7 @@ enum GNUNET_PSYC_SlaveJoinFlags * Configuration to use. * @param channel_pub_key * ECC public key that identifies the channel we wish to join. - * @param slave_key + * @param slave_pub_key * ECC private-public key pair that identifies the slave, and * used by multicast to sign the join request and subsequent unicast * requests sent to the master. @@ -951,7 +951,7 @@ enum GNUNET_PSYC_SlaveJoinFlags struct GNUNET_PSYC_Slave * GNUNET_PSYC_slave_join (const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_CRYPTO_EddsaPublicKey *channel_pub_key, - const struct GNUNET_CRYPTO_EcdsaPrivateKey *slave_key, + const struct GNUNET_CRYPTO_EcdsaPrivateKey *slave_pub_key, enum GNUNET_PSYC_SlaveJoinFlags flags, const struct GNUNET_PeerIdentity *origin, uint32_t relay_count, @@ -1085,7 +1085,7 @@ GNUNET_PSYC_slave_get_channel (struct GNUNET_PSYC_Slave *slave); * * @param channel * Channel handle. - * @param slave_key + * @param slave_pub_key * Identity of channel slave to add. * @param announced_at * ID of the message that announced the membership change. @@ -1101,7 +1101,7 @@ GNUNET_PSYC_slave_get_channel (struct GNUNET_PSYC_Slave *slave); */ void GNUNET_PSYC_channel_slave_add (struct GNUNET_PSYC_Channel *channel, - const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_key, + const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_pub_key, uint64_t announced_at, uint64_t effective_since, GNUNET_ResultCallback result_cb, @@ -1127,7 +1127,7 @@ GNUNET_PSYC_channel_slave_add (struct GNUNET_PSYC_Channel *channel, * * @param channel * Channel handle. - * @param slave_key + * @param slave_pub_key * Identity of channel slave to remove. * @param announced_at * ID of the message that announced the membership change. @@ -1142,7 +1142,7 @@ GNUNET_PSYC_channel_slave_add (struct GNUNET_PSYC_Channel *channel, void GNUNET_PSYC_channel_slave_remove (struct GNUNET_PSYC_Channel *channel, const struct GNUNET_CRYPTO_EcdsaPublicKey - *slave_key, + *slave_pub_key, uint64_t announced_at, GNUNET_ResultCallback result_cb, void *cls); diff --git a/src/multicast/gnunet-service-multicast.c b/src/multicast/gnunet-service-multicast.c index 4d2868669..39789360c 100644 --- a/src/multicast/gnunet-service-multicast.c +++ b/src/multicast/gnunet-service-multicast.c @@ -157,17 +157,17 @@ struct Channel /** * Public key of the target group. */ - struct GNUNET_CRYPTO_EddsaPublicKey group_key; + struct GNUNET_CRYPTO_EddsaPublicKey group_pub_key; /** - * Hash of @a group_key. + * Hash of @a group_pub_key. */ - struct GNUNET_HashCode group_key_hash; + struct GNUNET_HashCode group_pub_hash; /** * Public key of the joining member. */ - struct GNUNET_CRYPTO_EcdsaPublicKey member_key; + struct GNUNET_CRYPTO_EcdsaPublicKey member_pub_key; /** * Remote peer identity. @@ -735,7 +735,7 @@ cadet_notify_transmit_ready (void *cls, size_t buf_size, void *buf) } else if (0 == --chn->msgs_pending) { - client_send_ack (&chn->group_key_hash); + client_send_ack (&chn->group_pub_hash); } return msg_size; } @@ -770,10 +770,10 @@ cadet_send_channel (struct Channel *chn, const struct GNUNET_MessageHeader *msg) * * @param peer * Peer to connect to. - * @param group_key + * @param group_pub_key * Public key of group the channel belongs to. - * @param group_key_hash - * Hash of @a group_key. + * @param group_pub_hash + * Hash of @a group_pub_key. * * @return Channel. */ @@ -782,15 +782,15 @@ cadet_channel_create (struct Group *grp, struct GNUNET_PeerIdentity *peer) { struct Channel *chn = GNUNET_malloc (sizeof (*chn)); chn->grp = grp; - chn->group_key = grp->pub_key; - chn->group_key_hash = grp->pub_key_hash; + chn->group_pub_key = grp->pub_key; + chn->group_pub_hash = grp->pub_key_hash; chn->peer = *peer; chn->direction = DIR_OUTGOING; chn->join_status = JOIN_WAITING; chn->channel = GNUNET_CADET_channel_create (cadet, chn, &chn->peer, GNUNET_APPLICATION_TYPE_MULTICAST, GNUNET_CADET_OPTION_RELIABLE); - GNUNET_CONTAINER_multihashmap_put (channels_out, &chn->group_key_hash, chn, + GNUNET_CONTAINER_multihashmap_put (channels_out, &chn->group_pub_hash, chn, GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); return chn; } @@ -817,13 +817,13 @@ cadet_send_join_request (struct Member *mem) static int cadet_send_join_decision_cb (void *cls, - const struct GNUNET_HashCode *group_key_hash, + const struct GNUNET_HashCode *group_pub_hash, void *channel) { const struct MulticastJoinDecisionMessageHeader *hdcsn = cls; struct Channel *chn = channel; - if (0 == memcmp (&hdcsn->member_key, &chn->member_key, sizeof (chn->member_key)) + if (0 == memcmp (&hdcsn->member_pub_key, &chn->member_pub_key, sizeof (chn->member_pub_key)) && 0 == memcmp (&hdcsn->peer, &chn->peer, sizeof (chn->peer))) { cadet_send_channel (chn, &hdcsn->header); @@ -958,7 +958,7 @@ client_recv_member_join (void *cls, struct GNUNET_SERVER_Client *client, GNUNET_CRYPTO_ecdsa_key_get_public (&msg->member_key, &mem_pub_key); GNUNET_CRYPTO_hash (&mem_pub_key, sizeof (mem_pub_key), &mem_pub_key_hash); - GNUNET_CRYPTO_hash (&msg->group_key, sizeof (msg->group_key), &pub_key_hash); + GNUNET_CRYPTO_hash (&msg->group_pub_key, sizeof (msg->group_pub_key), &pub_key_hash); struct GNUNET_CONTAINER_MultiHashMap * grp_mem = GNUNET_CONTAINER_multihashmap_get (group_members, &pub_key_hash); @@ -979,7 +979,7 @@ client_recv_member_join (void *cls, struct GNUNET_SERVER_Client *client, grp = &mem->grp; grp->is_origin = GNUNET_NO; - grp->pub_key = msg->group_key; + grp->pub_key = msg->group_pub_key; grp->pub_key_hash = pub_key_hash; if (NULL == grp_mem) @@ -1046,13 +1046,13 @@ client_recv_member_join (void *cls, struct GNUNET_SERVER_Client *client, req = GNUNET_malloc (sizeof (*req) + join_msg_size); req->header.size = htons (sizeof (*req) + join_msg_size); req->header.type = htons (GNUNET_MESSAGE_TYPE_MULTICAST_JOIN_REQUEST); - req->group_key = grp->pub_key; + req->group_pub_key = grp->pub_key; req->peer = this_peer; - GNUNET_CRYPTO_ecdsa_key_get_public (&mem->priv_key, &req->member_key); + GNUNET_CRYPTO_ecdsa_key_get_public (&mem->priv_key, &req->member_pub_key); if (0 < join_msg_size) memcpy (&req[1], join_msg, join_msg_size); - req->member_key = mem->pub_key; + req->member_pub_key = mem->pub_key; req->purpose.size = htonl (msg_size - sizeof (req->header) - sizeof (req->reserved) @@ -1128,7 +1128,7 @@ client_recv_join_decision (void *cls, struct GNUNET_SERVER_Client *client, if (NULL != grp_mem) { struct GNUNET_HashCode member_key_hash; - GNUNET_CRYPTO_hash (&hdcsn->member_key, sizeof (hdcsn->member_key), + GNUNET_CRYPTO_hash (&hdcsn->member_pub_key, sizeof (hdcsn->member_pub_key), &member_key_hash); mem = GNUNET_CONTAINER_multihashmap_get (grp_mem, &member_key_hash); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, @@ -1215,11 +1215,11 @@ client_recv_multicast_request (void *cls, struct GNUNET_SERVER_Client *client, /* FIXME: yucky, should use separate message structs for P2P and CS! */ out = (struct GNUNET_MULTICAST_RequestHeader *) GNUNET_copy_message (m); - out->member_key = mem->pub_key; + out->member_pub_key = mem->pub_key; out->fragment_id = GNUNET_ntohll (++mem->max_fragment_id); out->purpose.size = htonl (ntohs (out->header.size) - sizeof (out->header) - - sizeof (out->member_key) + - sizeof (out->member_pub_key) - sizeof (out->signature)); out->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_MULTICAST_REQUEST); @@ -1551,26 +1551,26 @@ cadet_recv_join_request (void *cls, if (GNUNET_OK != GNUNET_CRYPTO_ecdsa_verify (GNUNET_SIGNATURE_PURPOSE_MULTICAST_REQUEST, &req->purpose, &req->signature, - &req->member_key)) + &req->member_pub_key)) { GNUNET_break_op (0); return GNUNET_SYSERR; } - struct GNUNET_HashCode group_key_hash; - GNUNET_CRYPTO_hash (&req->group_key, sizeof (req->group_key), &group_key_hash); + struct GNUNET_HashCode group_pub_hash; + GNUNET_CRYPTO_hash (&req->group_pub_key, sizeof (req->group_pub_key), &group_pub_hash); struct Channel *chn = GNUNET_malloc (sizeof *chn); chn->channel = channel; - chn->group_key = req->group_key; - chn->group_key_hash = group_key_hash; - chn->member_key = req->member_key; + chn->group_pub_key = req->group_pub_key; + chn->group_pub_hash = group_pub_hash; + chn->member_pub_key = req->member_pub_key; chn->peer = req->peer; chn->join_status = JOIN_WAITING; - GNUNET_CONTAINER_multihashmap_put (channels_in, &chn->group_key_hash, chn, + GNUNET_CONTAINER_multihashmap_put (channels_in, &chn->group_pub_hash, chn, GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); - client_send_all (&group_key_hash, m); + client_send_all (&group_pub_hash, m); return GNUNET_OK; } @@ -1670,13 +1670,13 @@ cadet_recv_message (void *cls, if (GNUNET_OK != GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_PURPOSE_MULTICAST_MESSAGE, &msg->purpose, &msg->signature, - &chn->group_key)) + &chn->group_pub_key)) { GNUNET_break_op (0); return GNUNET_SYSERR; } - client_send_all (&chn->group_key_hash, m); + client_send_all (&chn->group_pub_hash, m); return GNUNET_OK; } @@ -1706,7 +1706,7 @@ cadet_recv_request (void *cls, } if (ntohl (req->purpose.size) != (size - sizeof (req->header) - - sizeof (req->member_key) + - sizeof (req->member_pub_key) - sizeof (req->signature))) { GNUNET_break_op (0); @@ -1715,13 +1715,13 @@ cadet_recv_request (void *cls, if (GNUNET_OK != GNUNET_CRYPTO_ecdsa_verify (GNUNET_SIGNATURE_PURPOSE_MULTICAST_REQUEST, &req->purpose, &req->signature, - &req->member_key)) + &req->member_pub_key)) { GNUNET_break_op (0); return GNUNET_SYSERR; } - client_send_origin (&chn->group_key_hash, m); + client_send_origin (&chn->group_pub_hash, m); return GNUNET_OK; } @@ -1745,7 +1745,7 @@ cadet_recv_replay_request (void *cls, struct Channel *chn = *ctx; memcpy (&rep, m, sizeof (rep)); - memcpy (&rep.member_key, &chn->member_key, sizeof (chn->member_key)); + memcpy (&rep.member_pub_key, &chn->member_pub_key, sizeof (chn->member_pub_key)); struct GNUNET_CONTAINER_MultiHashMap * grp_replay_req = GNUNET_CONTAINER_multihashmap_get (replay_req_cadet, @@ -1763,7 +1763,7 @@ cadet_recv_replay_request (void *cls, GNUNET_CONTAINER_multihashmap_put (grp_replay_req, &key_hash, chn, GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); - client_send_random (&chn->group_key_hash, &rep.header); + client_send_random (&chn->group_pub_hash, &rep.header); return GNUNET_OK; } diff --git a/src/multicast/multicast.h b/src/multicast/multicast.h index 207f9f729..2d32bd6cf 100644 --- a/src/multicast/multicast.h +++ b/src/multicast/multicast.h @@ -63,12 +63,12 @@ struct MulticastJoinRequestMessage /** * Public key of the target group. */ - struct GNUNET_CRYPTO_EddsaPublicKey group_key; + struct GNUNET_CRYPTO_EddsaPublicKey group_pub_key; /** * Public key of the joining member. */ - struct GNUNET_CRYPTO_EcdsaPublicKey member_key; + struct GNUNET_CRYPTO_EcdsaPublicKey member_pub_key; /** * Peer identity of the joining member. @@ -128,7 +128,7 @@ struct MulticastJoinDecisionMessageHeader * C->S: Public key of the member requesting join. * S->C: Unused. */ - struct GNUNET_CRYPTO_EcdsaPublicKey member_key; + struct GNUNET_CRYPTO_EcdsaPublicKey member_pub_key; /* Followed by struct MulticastJoinDecisionMessage */ }; @@ -176,7 +176,7 @@ struct MulticastReplayRequestMessage * S->C: Public key of the member requesting replay. * C->S: Unused. */ - struct GNUNET_CRYPTO_EcdsaPublicKey member_key; + struct GNUNET_CRYPTO_EcdsaPublicKey member_pub_key; /** * ID of the message that is being requested. @@ -286,7 +286,7 @@ struct MulticastMemberJoinMessage uint32_t relay_count GNUNET_PACKED; - struct GNUNET_CRYPTO_EddsaPublicKey group_key; + struct GNUNET_CRYPTO_EddsaPublicKey group_pub_key; struct GNUNET_CRYPTO_EcdsaPrivateKey member_key; @@ -354,7 +354,7 @@ struct MulticastJoinMessage /** * Public non-ephemeral key of the mutlicast group. */ - struct GNUNET_CRYPTO_EddsaPublicKey group_key; + struct GNUNET_CRYPTO_EddsaPublicKey group_pub_key; /** * Our private key for the group. diff --git a/src/multicast/multicast_api.c b/src/multicast/multicast_api.c index 774a8bf70..e50711060 100644 --- a/src/multicast/multicast_api.c +++ b/src/multicast/multicast_api.c @@ -163,7 +163,7 @@ struct GNUNET_MULTICAST_JoinHandle /** * Public key of the member requesting join. */ - struct GNUNET_CRYPTO_EcdsaPublicKey member_key; + struct GNUNET_CRYPTO_EcdsaPublicKey member_pub_key; /** * Peer identity of the member requesting join. @@ -254,9 +254,9 @@ group_recv_join_request (void *cls, jmsg = NULL; jh = GNUNET_malloc (sizeof (*jh)); jh->group = grp; - jh->member_key = jreq->member_key; + jh->member_pub_key = jreq->member_pub_key; jh->peer = jreq->peer; - grp->join_req_cb (grp->cb_cls, &jreq->member_key, jmsg, jh); + grp->join_req_cb (grp->cb_cls, &jreq->member_pub_key, jmsg, jh); } @@ -366,7 +366,7 @@ group_recv_replay_request (void *cls, struct GNUNET_MULTICAST_ReplayHandle * rh = GNUNET_malloc (sizeof (*rh)); rh->grp = grp; rh->req = *rep; - grp->replay_frag_cb (grp->cb_cls, &rep->member_key, + grp->replay_frag_cb (grp->cb_cls, &rep->member_pub_key, GNUNET_ntohll (rep->fragment_id), GNUNET_ntohll (rep->flags), rh); } @@ -378,7 +378,7 @@ group_recv_replay_request (void *cls, struct GNUNET_MULTICAST_ReplayHandle * rh = GNUNET_malloc (sizeof (*rh)); rh->grp = grp; rh->req = *rep; - grp->replay_msg_cb (grp->cb_cls, &rep->member_key, + grp->replay_msg_cb (grp->cb_cls, &rep->member_pub_key, GNUNET_ntohll (rep->message_id), GNUNET_ntohll (rep->fragment_offset), GNUNET_ntohll (rep->flags), rh); @@ -615,7 +615,7 @@ GNUNET_MULTICAST_join_decision (struct GNUNET_MULTICAST_JoinHandle *join, hdcsn->header.size = htons (sizeof (*hdcsn) + sizeof (*dcsn) + relay_size + join_resp_size); hdcsn->header.type = htons (GNUNET_MESSAGE_TYPE_MULTICAST_JOIN_DECISION); - hdcsn->member_key = join->member_key; + hdcsn->member_pub_key = join->member_pub_key; hdcsn->peer = join->peer; dcsn = (struct MulticastJoinDecisionMessage *) &hdcsn[1]; @@ -995,7 +995,7 @@ GNUNET_MULTICAST_origin_to_all_cancel (struct GNUNET_MULTICAST_OriginTransmitHan */ struct GNUNET_MULTICAST_Member * GNUNET_MULTICAST_member_join (const struct GNUNET_CONFIGURATION_Handle *cfg, - const struct GNUNET_CRYPTO_EddsaPublicKey *group_key, + const struct GNUNET_CRYPTO_EddsaPublicKey *group_pub_key, const struct GNUNET_CRYPTO_EcdsaPrivateKey *member_key, const struct GNUNET_PeerIdentity *origin, uint16_t relay_count, @@ -1017,7 +1017,7 @@ GNUNET_MULTICAST_member_join (const struct GNUNET_CONFIGURATION_Handle *cfg, join = GNUNET_malloc (sizeof (*join) + relay_size + join_msg_size); join->header.size = htons (sizeof (*join) + relay_size + join_msg_size); join->header.type = htons (GNUNET_MESSAGE_TYPE_MULTICAST_MEMBER_JOIN); - join->group_key = *group_key; + join->group_pub_key = *group_pub_key; join->member_key = *member_key; join->origin = *origin; join->relay_count = ntohl (relay_count); @@ -1122,6 +1122,7 @@ GNUNET_MULTICAST_member_replay_fragment (struct GNUNET_MULTICAST_Member *mem, uint64_t flags) { member_replay_request (mem, fragment_id, 0, 0, flags); + // FIXME: return } @@ -1150,6 +1151,7 @@ GNUNET_MULTICAST_member_replay_message (struct GNUNET_MULTICAST_Member *mem, uint64_t flags) { member_replay_request (mem, 0, message_id, fragment_offset, flags); + // FIXME: return } diff --git a/src/multicast/test_multicast.c b/src/multicast/test_multicast.c index 083af2ecc..4aa944df1 100644 --- a/src/multicast/test_multicast.c +++ b/src/multicast/test_multicast.c @@ -432,7 +432,7 @@ origin_recv_request (void *cls, if (++ocls->n != ocls->msgs_expected) return; - GNUNET_assert (0 == memcmp (&req->member_key, + GNUNET_assert (0 == memcmp (&req->member_pub_key, &member_pub_key, sizeof (member_pub_key))); diff --git a/src/psyc/gnunet-service-psyc.c b/src/psyc/gnunet-service-psyc.c index 827f3d79b..fa9e6b1d0 100644 --- a/src/psyc/gnunet-service-psyc.c +++ b/src/psyc/gnunet-service-psyc.c @@ -315,7 +315,7 @@ struct Master /** * Incoming join requests from multicast. - * member_key -> struct GNUNET_MULTICAST_JoinHandle * + * member_pub_key -> struct GNUNET_MULTICAST_JoinHandle * */ struct GNUNET_CONTAINER_MultiHashMap *join_reqs; @@ -697,7 +697,7 @@ client_send_result (struct GNUNET_SERVER_Client *client, uint64_t op_id, */ struct JoinMemTestClosure { - struct GNUNET_CRYPTO_EcdsaPublicKey slave_key; + struct GNUNET_CRYPTO_EcdsaPublicKey slave_pub_key; struct Channel *chn; struct GNUNET_MULTICAST_JoinHandle *jh; struct GNUNET_PSYC_JoinRequestMessage *join_msg; @@ -716,10 +716,10 @@ join_mem_test_cb (void *cls, int64_t result, if (GNUNET_NO == result && GNUNET_YES == jcls->chn->is_master) { /* Pass on join request to client if this is a master channel */ struct Master *mst = (struct Master *) jcls->chn; - struct GNUNET_HashCode slave_key_hash; - GNUNET_CRYPTO_hash (&jcls->slave_key, sizeof (jcls->slave_key), - &slave_key_hash); - GNUNET_CONTAINER_multihashmap_put (mst->join_reqs, &slave_key_hash, jcls->jh, + struct GNUNET_HashCode slave_pub_hash; + GNUNET_CRYPTO_hash (&jcls->slave_pub_key, sizeof (jcls->slave_pub_key), + &slave_pub_hash); + GNUNET_CONTAINER_multihashmap_put (mst->join_reqs, &slave_pub_hash, jcls->jh, GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); client_send_msg (jcls->chn, &jcls->join_msg->header); } @@ -744,7 +744,7 @@ join_mem_test_cb (void *cls, int64_t result, */ static void mcast_recv_join_request (void *cls, - const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_key, + const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_pub_key, const struct GNUNET_MessageHeader *join_msg, struct GNUNET_MULTICAST_JoinHandle *jh) { @@ -770,17 +770,17 @@ mcast_recv_join_request (void *cls, req = GNUNET_malloc (sizeof (*req) + join_msg_size); req->header.size = htons (sizeof (*req) + join_msg_size); req->header.type = htons (GNUNET_MESSAGE_TYPE_PSYC_JOIN_REQUEST); - req->slave_key = *slave_key; + req->slave_pub_key = *slave_pub_key; if (0 < join_msg_size) memcpy (&req[1], join_msg, join_msg_size); struct JoinMemTestClosure *jcls = GNUNET_malloc (sizeof (*jcls)); - jcls->slave_key = *slave_key; + jcls->slave_pub_key = *slave_pub_key; jcls->chn = chn; jcls->jh = jh; jcls->join_msg = req; - GNUNET_PSYCSTORE_membership_test (store, &chn->pub_key, slave_key, + GNUNET_PSYCSTORE_membership_test (store, &chn->pub_key, slave_pub_key, chn->max_message_id, 0, &join_mem_test_cb, jcls); } @@ -878,13 +878,13 @@ store_recv_fragment_replay_result (void *cls, int64_t result, */ static void mcast_recv_replay_fragment (void *cls, - const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_key, + const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_pub_key, uint64_t fragment_id, uint64_t flags, struct GNUNET_MULTICAST_ReplayHandle *rh) { struct Channel *chn = cls; - GNUNET_PSYCSTORE_fragment_get (store, &chn->pub_key, slave_key, + GNUNET_PSYCSTORE_fragment_get (store, &chn->pub_key, slave_pub_key, fragment_id, fragment_id, &store_recv_fragment_replay, &store_recv_fragment_replay_result, rh); @@ -896,14 +896,14 @@ mcast_recv_replay_fragment (void *cls, */ static void mcast_recv_replay_message (void *cls, - const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_key, + const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_pub_key, uint64_t message_id, uint64_t fragment_offset, uint64_t flags, struct GNUNET_MULTICAST_ReplayHandle *rh) { struct Channel *chn = cls; - GNUNET_PSYCSTORE_message_get (store, &chn->pub_key, slave_key, + GNUNET_PSYCSTORE_message_get (store, &chn->pub_key, slave_pub_key, message_id, message_id, 1, NULL, &store_recv_fragment_replay, &store_recv_fragment_replay_result, rh); @@ -1029,7 +1029,7 @@ client_send_mcast_req (struct Master *mst, pmsg->message_id = req->request_id; pmsg->fragment_offset = req->fragment_offset; pmsg->flags = htonl (GNUNET_PSYC_MESSAGE_REQUEST); - pmsg->slave_key = req->member_key; + pmsg->slave_pub_key = req->member_pub_key; memcpy (&pmsg[1], &req[1], size - sizeof (*req)); client_send_msg (chn, &pmsg->header); @@ -1535,7 +1535,7 @@ mcast_recv_request (void *cls, struct Master *mst = cls; uint16_t size = ntohs (req->header.size); - char *str = GNUNET_CRYPTO_ecdsa_public_key_to_string (&req->member_key); + char *str = GNUNET_CRYPTO_ecdsa_public_key_to_string (&req->member_pub_key); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%p Received multicast request of size %u from %s.\n", mst, size, str); @@ -1745,10 +1745,10 @@ client_recv_slave_join (void *cls, struct GNUNET_SERVER_Client *client, uint16_t req_size = ntohs (req->header.size); struct GNUNET_CRYPTO_EcdsaPublicKey slv_pub_key; - struct GNUNET_HashCode pub_key_hash, slv_pub_key_hash; + struct GNUNET_HashCode pub_key_hash, slv_pub_hash; GNUNET_CRYPTO_ecdsa_key_get_public (&req->slave_key, &slv_pub_key); - GNUNET_CRYPTO_hash (&slv_pub_key, sizeof (slv_pub_key), &slv_pub_key_hash); + GNUNET_CRYPTO_hash (&slv_pub_key, sizeof (slv_pub_key), &slv_pub_hash); GNUNET_CRYPTO_hash (&req->channel_pub_key, sizeof (req->channel_pub_key), &pub_key_hash); struct GNUNET_CONTAINER_MultiHashMap * @@ -1758,14 +1758,14 @@ client_recv_slave_join (void *cls, struct GNUNET_SERVER_Client *client, if (NULL != chn_slv) { - slv = GNUNET_CONTAINER_multihashmap_get (chn_slv, &slv_pub_key_hash); + slv = GNUNET_CONTAINER_multihashmap_get (chn_slv, &slv_pub_hash); } if (NULL == slv) { slv = GNUNET_new (struct Slave); slv->priv_key = req->slave_key; slv->pub_key = slv_pub_key; - slv->pub_key_hash = slv_pub_key_hash; + slv->pub_key_hash = slv_pub_hash; slv->origin = req->origin; slv->relay_count = ntohl (req->relay_count); slv->join_flags = ntohl (req->flags); @@ -1928,20 +1928,20 @@ client_recv_join_decision (void *cls, struct GNUNET_SERVER_Client *client, ? (struct GNUNET_MessageHeader *) &dcsn[1] : NULL; - struct GNUNET_HashCode slave_key_hash; - GNUNET_CRYPTO_hash (&dcsn->slave_key, sizeof (dcsn->slave_key), - &slave_key_hash); + struct GNUNET_HashCode slave_pub_hash; + GNUNET_CRYPTO_hash (&dcsn->slave_pub_key, sizeof (dcsn->slave_pub_key), + &slave_pub_hash); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%p Got join decision (%d) from client for channel %s..\n", mst, jcls.is_admitted, GNUNET_h2s (&chn->pub_key_hash)); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%p ..and slave %s.\n", - mst, GNUNET_h2s (&slave_key_hash)); + mst, GNUNET_h2s (&slave_pub_hash)); - GNUNET_CONTAINER_multihashmap_get_multiple (mst->join_reqs, &slave_key_hash, + GNUNET_CONTAINER_multihashmap_get_multiple (mst->join_reqs, &slave_pub_hash, &mcast_send_join_decision, &jcls); - GNUNET_CONTAINER_multihashmap_remove_all (mst->join_reqs, &slave_key_hash); + GNUNET_CONTAINER_multihashmap_remove_all (mst->join_reqs, &slave_pub_hash); GNUNET_SERVER_receive_done (client, GNUNET_OK); } @@ -2326,7 +2326,7 @@ client_recv_membership_store (void *cls, struct GNUNET_SERVER_Client *client, "%p did_join: %u, announced_at: %" PRIu64 ", effective_since: %" PRIu64 "\n", chn, req->did_join, announced_at, effective_since); - GNUNET_PSYCSTORE_membership_store (store, &chn->pub_key, &req->slave_key, + GNUNET_PSYCSTORE_membership_store (store, &chn->pub_key, &req->slave_pub_key, req->did_join, announced_at, effective_since, 0, /* FIXME: group_generation */ &store_recv_membership_store_result, op); diff --git a/src/psyc/psyc.h b/src/psyc/psyc.h index cc7475df7..5e8fd4920 100644 --- a/src/psyc/psyc.h +++ b/src/psyc/psyc.h @@ -118,7 +118,7 @@ struct ChannelMembershipStoreRequest uint64_t op_id GNUNET_PACKED; - struct GNUNET_CRYPTO_EcdsaPublicKey slave_key; + struct GNUNET_CRYPTO_EcdsaPublicKey slave_pub_key; uint64_t announced_at GNUNET_PACKED; diff --git a/src/psyc/psyc_api.c b/src/psyc/psyc_api.c index c9d74f3c8..4e3d9fd7f 100644 --- a/src/psyc/psyc_api.c +++ b/src/psyc/psyc_api.c @@ -148,7 +148,7 @@ struct GNUNET_PSYC_Slave struct GNUNET_PSYC_JoinHandle { struct GNUNET_PSYC_Master *mst; - struct GNUNET_CRYPTO_EcdsaPublicKey slave_key; + struct GNUNET_CRYPTO_EcdsaPublicKey slave_pub_key; }; @@ -470,10 +470,10 @@ master_recv_join_request (void *cls, struct GNUNET_PSYC_JoinHandle *jh = GNUNET_malloc (sizeof (*jh)); jh->mst = mst; - jh->slave_key = req->slave_key; + jh->slave_pub_key = req->slave_pub_key; if (NULL != mst->join_req_cb) - mst->join_req_cb (mst->cb_cls, req, &req->slave_key, join_msg, jh); + mst->join_req_cb (mst->cb_cls, req, &req->slave_pub_key, join_msg, jh); } @@ -756,7 +756,7 @@ GNUNET_PSYC_join_decision (struct GNUNET_PSYC_JoinHandle *jh, dcsn->header.size = htons (sizeof (*dcsn) + relay_size + join_resp_size); dcsn->header.type = htons (GNUNET_MESSAGE_TYPE_PSYC_JOIN_DECISION); dcsn->is_admitted = htonl (is_admitted); - dcsn->slave_key = jh->slave_key; + dcsn->slave_pub_key = jh->slave_pub_key; if (0 < join_resp_size) memcpy (&dcsn[1], join_resp, join_resp_size); @@ -1045,7 +1045,7 @@ GNUNET_PSYC_slave_get_channel (struct GNUNET_PSYC_Slave *slv) * * @param chn * Channel handle. - * @param slave_key + * @param slave_pub_key * Identity of channel slave to add. * @param announced_at * ID of the message that announced the membership change. @@ -1061,7 +1061,7 @@ GNUNET_PSYC_slave_get_channel (struct GNUNET_PSYC_Slave *slv) */ void GNUNET_PSYC_channel_slave_add (struct GNUNET_PSYC_Channel *chn, - const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_key, + const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_pub_key, uint64_t announced_at, uint64_t effective_since, GNUNET_ResultCallback result_cb, @@ -1070,7 +1070,7 @@ GNUNET_PSYC_channel_slave_add (struct GNUNET_PSYC_Channel *chn, struct ChannelMembershipStoreRequest *req = GNUNET_malloc (sizeof (*req)); req->header.type = htons (GNUNET_MESSAGE_TYPE_PSYC_CHANNEL_MEMBERSHIP_STORE); req->header.size = htons (sizeof (*req)); - req->slave_key = *slave_key; + req->slave_pub_key = *slave_pub_key; req->announced_at = GNUNET_htonll (announced_at); req->effective_since = GNUNET_htonll (effective_since); req->did_join = GNUNET_YES; @@ -1100,7 +1100,7 @@ GNUNET_PSYC_channel_slave_add (struct GNUNET_PSYC_Channel *chn, * * @param chn * Channel handle. - * @param slave_key + * @param slave_pub_key * Identity of channel slave to remove. * @param announced_at * ID of the message that announced the membership change. @@ -1114,7 +1114,7 @@ GNUNET_PSYC_channel_slave_add (struct GNUNET_PSYC_Channel *chn, */ void GNUNET_PSYC_channel_slave_remove (struct GNUNET_PSYC_Channel *chn, - const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_key, + const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_pub_key, uint64_t announced_at, GNUNET_ResultCallback result_cb, void *cls) @@ -1122,7 +1122,7 @@ GNUNET_PSYC_channel_slave_remove (struct GNUNET_PSYC_Channel *chn, struct ChannelMembershipStoreRequest *req = GNUNET_malloc (sizeof (*req)); req->header.type = htons (GNUNET_MESSAGE_TYPE_PSYC_CHANNEL_MEMBERSHIP_STORE); req->header.size = htons (sizeof (*req)); - req->slave_key = *slave_key; + req->slave_pub_key = *slave_pub_key; req->announced_at = GNUNET_htonll (announced_at); req->did_join = GNUNET_NO; req->op_id = GNUNET_htonll (GNUNET_CLIENT_MANAGER_op_add (chn->client, diff --git a/src/psycutil/psyc_message.c b/src/psycutil/psyc_message.c index 8c214d2b6..2bdd4497a 100644 --- a/src/psycutil/psyc_message.c +++ b/src/psycutil/psyc_message.c @@ -135,7 +135,7 @@ struct GNUNET_PSYC_ReceiveHandle /** * Public key of the slave from which a message is being received. */ - struct GNUNET_CRYPTO_EcdsaPublicKey slave_key; + struct GNUNET_CRYPTO_EcdsaPublicKey slave_pub_key; /** * State of the currently being received message from the PSYC service. @@ -913,7 +913,7 @@ GNUNET_PSYC_receive_message (struct GNUNET_PSYC_ReceiveHandle *recv, { recv->message_id = GNUNET_ntohll (msg->message_id); recv->flags = flags; - recv->slave_key = msg->slave_key; + recv->slave_pub_key = msg->slave_pub_key; recv->mod_value_size = 0; recv->mod_value_size_expected = 0; } @@ -1099,7 +1099,7 @@ GNUNET_PSYC_receive_message (struct GNUNET_PSYC_ReceiveHandle *recv, } if (NULL != recv->message_part_cb) - recv->message_part_cb (recv->cb_cls, &recv->slave_key, + recv->message_part_cb (recv->cb_cls, &recv->slave_pub_key, recv->message_id, recv->flags, 0, // FIXME: data_offset pmsg); @@ -1180,7 +1180,7 @@ struct ParseMessageClosure static void parse_message_part_cb (void *cls, - const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_key, + const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_pub_key, uint64_t message_id, uint32_t flags, uint64_t data_offset, const struct GNUNET_MessageHeader *msg) { -- cgit v1.2.3