summaryrefslogtreecommitdiff
path: root/src/set/set.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/set/set.h')
-rw-r--r--src/set/set.h62
1 files changed, 21 insertions, 41 deletions
diff --git a/src/set/set.h b/src/set/set.h
index ad2200de9..7ec3e6cb2 100644
--- a/src/set/set.h
+++ b/src/set/set.h
@@ -29,17 +29,12 @@
29#include "platform.h" 29#include "platform.h"
30#include "gnunet_common.h" 30#include "gnunet_common.h"
31 31
32 32#define GNUNET_SET_ACK_WINDOW 10
33/**
34 * The service sends up to GNUNET_SET_ACK_WINDOW messages per client handle,
35 * the client should send an ack every GNUNET_SET_ACK_WINDOW/2 messages.
36 */
37#define GNUNET_SET_ACK_WINDOW 8
38 33
39 34
40GNUNET_NETWORK_STRUCT_BEGIN 35GNUNET_NETWORK_STRUCT_BEGIN
41 36
42struct SetCreateMessage 37struct GNUNET_SET_CreateMessage
43{ 38{
44 /** 39 /**
45 * Type: GNUNET_MESSAGE_TYPE_SET_CREATE 40 * Type: GNUNET_MESSAGE_TYPE_SET_CREATE
@@ -54,7 +49,7 @@ struct SetCreateMessage
54}; 49};
55 50
56 51
57struct ListenMessage 52struct GNUNET_SET_ListenMessage
58{ 53{
59 /** 54 /**
60 * Type: GNUNET_MESSAGE_TYPE_SET_LISTEN 55 * Type: GNUNET_MESSAGE_TYPE_SET_LISTEN
@@ -74,32 +69,31 @@ struct ListenMessage
74}; 69};
75 70
76 71
77struct AcceptMessage 72struct GNUNET_SET_AcceptRejectMessage
78{ 73{
79 /** 74 /**
80 * Type: GNUNET_MESSAGE_TYPE_SET_ACCEPT 75 * Type: GNUNET_MESSAGE_TYPE_SET_ACCEPT or
76 * GNUNET_MESSAGE_TYPE_SET_REJECT
81 */ 77 */
82 struct GNUNET_MessageHeader header; 78 struct GNUNET_MessageHeader header;
83 79
84 /** 80 /**
85 * Request id that will be sent along with 81 * ID of the incoming request we want to accept / reject.
86 * results for the accepted operation.
87 * Chosen by the client.
88 * Must be 0 if the request has been rejected.
89 */ 82 */
90 uint32_t request_id GNUNET_PACKED; 83 uint32_t accept_reject_id GNUNET_PACKED;
91 84
92 /** 85 /**
93 * ID of the incoming request we want to accept / reject. 86 * Request ID to identify responses,
87 * must be 0 if we don't accept the request.
94 */ 88 */
95 uint32_t accept_id GNUNET_PACKED; 89 uint32_t request_id GNUNET_PACKED;
96}; 90};
97 91
98 92
99/** 93/**
100 * A request for an operation with another client. 94 * A request for an operation with another client.
101 */ 95 */
102struct RequestMessage 96struct GNUNET_SET_RequestMessage
103{ 97{
104 /** 98 /**
105 * Type: GNUNET_MESSAGE_TYPE_SET_Request. 99 * Type: GNUNET_MESSAGE_TYPE_SET_Request.
@@ -107,21 +101,21 @@ struct RequestMessage
107 struct GNUNET_MessageHeader header; 101 struct GNUNET_MessageHeader header;
108 102
109 /** 103 /**
110 * ID of the request we want to accept, 104 * Identity of the requesting peer.
111 * chosen by the service.
112 */ 105 */
113 uint32_t accept_id GNUNET_PACKED; 106 struct GNUNET_PeerIdentity peer_id;
114 107
115 /** 108 /**
116 * Identity of the requesting peer. 109 * ID of the to identify the request when accepting or
110 * rejecting it.
117 */ 111 */
118 struct GNUNET_PeerIdentity peer_id; 112 uint32_t accept_id GNUNET_PACKED;
119 113
120 /* rest: nested context message */ 114 /* rest: nested context message */
121}; 115};
122 116
123 117
124struct EvaluateMessage 118struct GNUNET_SET_EvaluateMessage
125{ 119{
126 /** 120 /**
127 * Type: GNUNET_MESSAGE_TYPE_SET_EVALUATE 121 * Type: GNUNET_MESSAGE_TYPE_SET_EVALUATE
@@ -136,7 +130,7 @@ struct EvaluateMessage
136 /** 130 /**
137 * Peer to evaluate the operation with 131 * Peer to evaluate the operation with
138 */ 132 */
139 struct GNUNET_PeerIdentity peer; 133 struct GNUNET_PeerIdentity target_peer;
140 134
141 /** 135 /**
142 * Application id 136 * Application id
@@ -157,7 +151,7 @@ struct EvaluateMessage
157}; 151};
158 152
159 153
160struct ResultMessage 154struct GNUNET_SET_ResultMessage
161{ 155{
162 /** 156 /**
163 * Type: GNUNET_MESSAGE_TYPE_SET_RESULT 157 * Type: GNUNET_MESSAGE_TYPE_SET_RESULT
@@ -184,7 +178,7 @@ struct ResultMessage
184}; 178};
185 179
186 180
187struct ElementMessage 181struct GNUNET_SET_ElementMessage
188{ 182{
189 /** 183 /**
190 * Type: GNUNET_MESSAGE_TYPE_SET_ADD or 184 * Type: GNUNET_MESSAGE_TYPE_SET_ADD or
@@ -200,20 +194,6 @@ struct ElementMessage
200}; 194};
201 195
202 196
203struct CancelMessage
204{
205 /**
206 * Type: GNUNET_MESSAGE_TYPE_SET_CANCEL
207 */
208 struct GNUNET_MessageHeader header;
209
210 /**
211 * id we want to cancel result belongs to
212 */
213 uint32_t request_id GNUNET_PACKED;
214};
215
216
217GNUNET_NETWORK_STRUCT_END 197GNUNET_NETWORK_STRUCT_END
218 198
219#endif 199#endif