[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r29449 - gnunet/src/multicast
From: |
gnunet |
Subject: |
[GNUnet-SVN] r29449 - gnunet/src/multicast |
Date: |
Sat, 21 Sep 2013 11:51:18 +0200 |
Author: grothoff
Date: 2013-09-21 11:51:18 +0200 (Sat, 21 Sep 2013)
New Revision: 29449
Added:
gnunet/src/multicast/multicast.h
Modified:
gnunet/src/multicast/multicast_api.c
Log:
towards multicast IPC messages
Added: gnunet/src/multicast/multicast.h
===================================================================
--- gnunet/src/multicast/multicast.h (rev 0)
+++ gnunet/src/multicast/multicast.h 2013-09-21 09:51:18 UTC (rev 29449)
@@ -0,0 +1,279 @@
+/*
+ This file is part of GNUnet.
+ (C) 2012, 2013 Christian Grothoff (and other contributing authors)
+
+ GNUnet is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3, or (at your
+ option) any later version.
+
+ GNUnet is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNUnet; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @file multicast/multicast.h
+ * @brief multicast IPC messages
+ * @author Christian Grothoff
+ */
+#ifndef MULTICAST_H
+#define MULTICAST_H
+
+GNUNET_NETWORK_STRUCT_BEGIN
+
+
+/**
+ * Message sent from the client to the service to notify the service
+ * about a join decision.
+ */
+struct MulticastJoinDecisionMessage
+{
+
+ /**
+ *
+ */
+ struct GNUNET_MessageHeader header;
+
+ /**
+ * Unique ID that identifies the associated join test.
+ */
+ uint32_t uid;
+
+ /**
+ * #GNUNET_YES if the peer was admitted.
+ */
+ int32_t is_admitted;
+
+ /**
+ * Number of relays given.
+ */
+ uint32_t relay_count;
+
+ /* followed by 'relay_count' peer identities */
+
+ /* followed by the join response message */
+
+};
+
+
+/**
+ * Message sent from the client to the service to notify the service
+ * about the result of a membership test.
+ */
+struct MulticastMembershipTestResponseMessage
+{
+
+ /**
+ *
+ */
+ struct GNUNET_MessageHeader header;
+
+ /**
+ * Unique ID that identifies the associated membership test.
+ */
+ uint32_t uid;
+
+ /**
+ * #GNUNET_YES if the peer is a member, #GNUNET_NO if peer was not a member,
+ * #GNUNET_SYSERR if we cannot answer the test.
+ */
+ int32_t is_admitted;
+
+};
+
+
+/**
+ * Message sent from the client to the service to give the service
+ * a replayed message.
+ */
+struct MulticastReplayResponseMessage
+{
+
+ /**
+ *
+ */
+ struct GNUNET_MessageHeader header;
+
+ /**
+ * Unique ID that identifies the associated replay session.
+ */
+ uint32_t uid;
+
+ /**
+ * An `enum GNUNET_MULTICAST_ReplayErrorCode` identifying issues (in NBO).
+ */
+ int32_t error_code;
+
+ /* followed by replayed message */
+
+};
+
+
+/**
+ * Message sent from the client to the service to notify the service
+ * about the end of a replay session.
+ */
+struct MulticastReplayEndMessage
+{
+
+ /**
+ *
+ */
+ struct GNUNET_MessageHeader header;
+
+ /**
+ * Unique ID that identifies the associated replay session.
+ */
+ uint32_t uid;
+
+};
+
+
+/**
+ * Message sent from the client to the service to notify the service
+ * about the starting of a multicast group with this peers as its origin.
+ */
+struct MulticastOriginStartMessage
+{
+
+ /**
+ *
+ */
+ struct GNUNET_MessageHeader header;
+
+ /**
+ * Always zero.
+ */
+ uint32_t reserved;
+
+ /**
+ * Private, non-ephemeral key for the mutlicast group.
+ */
+ struct GNUNET_CRYPTO_EccPrivateKey group_key;
+
+ /**
+ * Last fragment ID, used to continue counting fragments if we resume
operating
+ * a group.
+ */
+ uint64_t last_fragment_id;
+
+};
+
+
+/**
+ * Message sent from the client to the service to broadcast to all group
+ * members.
+ */
+struct MulticastBroadcastMessage
+{
+
+ /**
+ *
+ */
+ struct GNUNET_MessageHeader header;
+
+ /**
+ * #GNUNET_OK normally, #GNUNET_SYSERR if the origin aborted the
+ * transmission.
+ */
+ int32_t status;
+
+ /**
+ * Message ID.
+ */
+ uint64_t message_id;
+
+ /**
+ * Group generation.
+ */
+ uint64_t group_generation;
+
+ /**
+ * Total message size.
+ */
+ uint64_t total_size;
+
+};
+
+
+/**
+ * Message sent from the client to the service to join a multicast group.
+ */
+struct MulticastJoinMessage
+{
+
+ /**
+ *
+ */
+ struct GNUNET_MessageHeader header;
+
+ /**
+ * Number of relays we (think) we already know about.
+ */
+ uint32_t relay_count;
+
+ /**
+ * Public non-ephemeral key of the mutlicast group.
+ */
+ struct GNUNET_CRYPTO_EccPublicSignKey group_key;
+
+ /**
+ * Our private key for the group.
+ */
+ struct GNUNET_CRYPTO_EccPrivateKey member_key;
+
+ /* followed by 'relay_count' `struct GNUNET_PeerIdentity`s */
+
+};
+
+
+
+/**
+ * Message sent from the client to the service OR the service to the
+ * client asking for a message fragment to be replayed.
+ */
+struct MulticastReplayRequestMessage
+{
+
+ /**
+ *
+ */
+ struct GNUNET_MessageHeader header;
+
+ /**
+ * Replay request ID.
+ */
+ uint32_t uid;
+
+ /**
+ *
+ */
+ uint64_t message_id;
+
+ /**
+ *
+ */
+ uint64_t fragment_offset;
+
+ /**
+ *
+ */
+ uint64_t flags;
+
+};
+
+
+
+
+
+GNUNET_NETWORK_STRUCT_END
+
+#endif
+/* end of multicast.h */
Modified: gnunet/src/multicast/multicast_api.c
===================================================================
--- gnunet/src/multicast/multicast_api.c 2013-09-21 09:50:57 UTC (rev
29448)
+++ gnunet/src/multicast/multicast_api.c 2013-09-21 09:51:18 UTC (rev
29449)
@@ -272,8 +272,6 @@
* @param cfg Configuration to use.
* @param priv_key ECC key that will be used to sign messages for this
* multicast session; public key is used to identify the multicast
group;
- * FIXME: we'll likely want to use NOT the p521 curve here, but a
cheaper
- * one in the future.
* @param last_fragment_id Last fragment ID to continue counting fragments from
* when restarting the origin. 0 for a new group.
* @param join_cb Function called to approve / disapprove joining of a peer.
@@ -318,7 +316,7 @@
* @param origin Handle to the multicast group.
* @param message_id Application layer ID for the message. Opaque to
multicast.
* @param group_generation Group generation of the message. Documented in
- * GNUNET_MULTICAST_MessageHeader.
+ * `struct GNUNET_MULTICAST_MessageHeader`.
* @param size Number of bytes to transmit.
* FIXME: Needed? The end of the message can be flagged with a last
fragment flag.
* @param notify Function to call to get the message.
@@ -405,7 +403,7 @@
const struct GNUNET_CRYPTO_EccPublicSignKey
*group_key,
const struct GNUNET_CRYPTO_EccPrivateKey
*member_key,
const struct GNUNET_PeerIdentity *origin,
- size_t relay_count,
+ uint32_t relay_count,
const struct GNUNET_PeerIdentity *relays,
const struct GNUNET_MessageHeader *join_request,
GNUNET_MULTICAST_JoinCallback join_cb,
@@ -451,7 +449,7 @@
/**
- * Request a message fr to be replayed.
+ * Request a message fragment to be replayed.
*
* Useful if messages below the @e max_known_fragment_id given when joining are
* needed and not known to the client.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r29449 - gnunet/src/multicast,
gnunet <=