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 2, or (at your
+ 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
#include "platform.h"
#include "gnunet_common.h"
-
-/**
- * The service sends up to GNUNET_SET_ACK_WINDOW messages per client handle,
- * the client should send an ack every GNUNET_SET_ACK_WINDOW/2 messages.
- */
-#define GNUNET_SET_ACK_WINDOW 8
+#define GNUNET_SET_ACK_WINDOW 10
GNUNET_NETWORK_STRUCT_BEGIN
-struct SetCreateMessage
+struct GNUNET_SET_CreateMessage
{
/**
* Type: GNUNET_MESSAGE_TYPE_SET_CREATE
};
-struct ListenMessage
+struct GNUNET_SET_ListenMessage
{
/**
* Type: GNUNET_MESSAGE_TYPE_SET_LISTEN
/**
* Operation type, values of enum GNUNET_SET_OperationType
*/
- uint16_t operation GNUNET_PACKED;
+ uint32_t operation GNUNET_PACKED;
/**
* application id
};
-struct AcceptMessage
+struct GNUNET_SET_AcceptRejectMessage
{
/**
- * Type: GNUNET_MESSAGE_TYPE_SET_ACCEPT
+ * Type: GNUNET_MESSAGE_TYPE_SET_ACCEPT or
+ * GNUNET_MESSAGE_TYPE_SET_REJECT
*/
struct GNUNET_MessageHeader header;
/**
- * Request id that will be sent along with
- * results for the accepted operation.
- * Chosen by the client.
- * Must be 0 if the request has been rejected.
+ * ID of the incoming request we want to accept / reject.
*/
- uint32_t request_id GNUNET_PACKED;
+ uint32_t accept_reject_id GNUNET_PACKED;
/**
- * ID of the incoming request we want to accept / reject.
+ * Request ID to identify responses,
+ * must be 0 if we don't accept the request.
*/
- uint32_t accept_id GNUNET_PACKED;
+ uint32_t request_id GNUNET_PACKED;
};
/**
* A request for an operation with another client.
*/
-struct RequestMessage
+struct GNUNET_SET_RequestMessage
{
/**
* Type: GNUNET_MESSAGE_TYPE_SET_Request.
struct GNUNET_MessageHeader header;
/**
- * ID of the request we want to accept,
- * chosen by the service.
+ * Identity of the requesting peer.
*/
- uint32_t accept_id GNUNET_PACKED;
+ struct GNUNET_PeerIdentity peer_id;
/**
- * Identity of the requesting peer.
+ * ID of the to identify the request when accepting or
+ * rejecting it.
*/
- struct GNUNET_PeerIdentity peer_id;
+ uint32_t accept_id GNUNET_PACKED;
/* rest: nested context message */
};
-struct EvaluateMessage
+struct GNUNET_SET_EvaluateMessage
{
/**
* Type: GNUNET_MESSAGE_TYPE_SET_EVALUATE
/**
* Peer to evaluate the operation with
*/
- struct GNUNET_PeerIdentity peer;
+ struct GNUNET_PeerIdentity target_peer;
/**
* Application id
};
-struct ResultMessage
+struct GNUNET_SET_ResultMessage
{
/**
* Type: GNUNET_MESSAGE_TYPE_SET_RESULT
};
-struct ElementMessage
+struct GNUNET_SET_ElementMessage
{
/**
* Type: GNUNET_MESSAGE_TYPE_SET_ADD or
};
-struct CancelMessage
+/**
+ * Sent to the service by the client
+ * in order to cancel a set operation.
+ */
+struct GNUNET_SET_CancelMessage
{
/**
* Type: GNUNET_MESSAGE_TYPE_SET_CANCEL
struct GNUNET_MessageHeader header;
/**
- * id we want to cancel result belongs to
+ * ID of the request we want to cancel.
*/
uint32_t request_id GNUNET_PACKED;
};
+struct GNUNET_SET_IterResponseMessage
+{
+ /**
+ * Type: GNUNET_MESSAGE_TYPE_SET_ITER_RESPONSE
+ */
+ struct GNUNET_MessageHeader header;
+
+ /**
+ * Type of the element attachted to the message,
+ * if any.
+ */
+ uint16_t element_type GNUNET_PACKED;
+
+ /* rest: element */
+};
+
+struct GNUNET_SET_IterAckMessage
+{
+ /**
+ * Type: GNUNET_MESSAGE_TYPE_SET_ITER_ACK
+ */
+ struct GNUNET_MessageHeader header;
+
+ /**
+ * Non-zero if the service should continue sending elements.
+ */
+ uint32_t send_more;
+};
GNUNET_NETWORK_STRUCT_END