const struct GNUNET_MessageHeader *join_msg,
struct GNUNET_MULTICAST_JoinHandle *jh)
{
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Member sent a join request.\n");
-
+
}
+int notify (void *cls,
+ size_t *data_size,
+ void *data)
+{
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Member sents message to origin.\n");
+
+ char text[] = "ping";
+ *data_size = strlen(text);
+ GNUNET_memcpy(data, text, *data_size);
+
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "len: %i.\n", strlen(text));
+
+ return GNUNET_YES;
+}
+
- static void
+ static void
member_join_decision (void *cls,
int is_admitted,
const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_PeerIdentity *relays,
const struct GNUNET_MessageHeader *join_msg)
{
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ struct GNUNET_MULTICAST_MemberTransmitHandle *req;
+
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Member received a decision from origin: %s\n", (GNUNET_YES == is_admitted)?"accepted":"rejected");
-
- result = GNUNET_OK;
- GNUNET_SCHEDULER_shutdown ();
+
+ if (GNUNET_YES == is_admitted)
+ {
+ req = GNUNET_MULTICAST_member_to_origin (member,
+ 0,
+ notify,
+ NULL);
+ }
}
- static void
+ static void
member_replay_frag ()
{
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"member replay frag...\n");
}
result = GNUNET_OK;
}
- static void
+ static void
origin_replay_frag (void *cls,
- const struct GNUNET_CRYPTO_EcdsaPublicKey *member_pub_key,
- uint64_t fragment_id,
- uint64_t flags,
- struct GNUNET_MULTICAST_ReplayHandle *rh)
+ const struct GNUNET_CRYPTO_EcdsaPublicKey *member_pub_key,
+ uint64_t fragment_id,
+ uint64_t flags,
+ struct GNUNET_MULTICAST_ReplayHandle *rh)
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "origin replay fraq msg\n");
}
- static void
+ static void
origin_replay_msg (void *cls,
- const struct GNUNET_CRYPTO_EcdsaPublicKey *member_pub_key,
- uint64_t message_id,
- uint64_t fragment_offset,
- uint64_t flags,
- struct GNUNET_MULTICAST_ReplayHandle *rh)
+ const struct GNUNET_CRYPTO_EcdsaPublicKey *member_pub_key,
+ uint64_t message_id,
+ uint64_t fragment_offset,
+ uint64_t flags,
+ struct GNUNET_MULTICAST_ReplayHandle *rh)
{
-
+
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "origin replay msg\n");
}