aboutsummaryrefslogtreecommitdiff
path: root/src/set/set.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2014-11-27 11:35:42 +0000
committerChristian Grothoff <christian@grothoff.org>2014-11-27 11:35:42 +0000
commit2b0e3f9ba871095d003fc078eee75b5eda6fc8b8 (patch)
treeb37e6f7d930ca23b0743bda4a76f82aa7c794e13 /src/set/set.h
parent393b5b11525badff59ff6df0572c5cdf42c1587c (diff)
downloadgnunet-2b0e3f9ba871095d003fc078eee75b5eda6fc8b8.tar.gz
gnunet-2b0e3f9ba871095d003fc078eee75b5eda6fc8b8.zip
again, do not pass salt around, code cleanup, etc.
Diffstat (limited to 'src/set/set.h')
-rw-r--r--src/set/set.h65
1 files changed, 44 insertions, 21 deletions
diff --git a/src/set/set.h b/src/set/set.h
index be3a7a0c6..f3aedff4f 100644
--- a/src/set/set.h
+++ b/src/set/set.h
@@ -37,6 +37,11 @@
37 37
38GNUNET_NETWORK_STRUCT_BEGIN 38GNUNET_NETWORK_STRUCT_BEGIN
39 39
40/**
41 * Message sent by the client to the service to ask starting
42 * a new set to perform operations with. Includes the desired
43 * set operation type.
44 */
40struct GNUNET_SET_CreateMessage 45struct GNUNET_SET_CreateMessage
41{ 46{
42 /** 47 /**
@@ -51,6 +56,11 @@ struct GNUNET_SET_CreateMessage
51}; 56};
52 57
53 58
59/**
60 * Message sent by the client to the service to start listening for
61 * incoming requests to perform a certain type of set operation for a
62 * certain type of application.
63 */
54struct GNUNET_SET_ListenMessage 64struct GNUNET_SET_ListenMessage
55{ 65{
56 /** 66 /**
@@ -71,6 +81,10 @@ struct GNUNET_SET_ListenMessage
71}; 81};
72 82
73 83
84/**
85 * Message sent by a listening client to the service to accept
86 * performing the operation with the other peer.
87 */
74struct GNUNET_SET_AcceptMessage 88struct GNUNET_SET_AcceptMessage
75{ 89{
76 /** 90 /**
@@ -79,13 +93,12 @@ struct GNUNET_SET_AcceptMessage
79 struct GNUNET_MessageHeader header; 93 struct GNUNET_MessageHeader header;
80 94
81 /** 95 /**
82 * ID of the incoming request we want to accept / reject. 96 * ID of the incoming request we want to accept.
83 */ 97 */
84 uint32_t accept_reject_id GNUNET_PACKED; 98 uint32_t accept_reject_id GNUNET_PACKED;
85 99
86 /** 100 /**
87 * Request ID to identify responses, 101 * Request ID to identify responses.
88 * must be 0 if we don't accept the request.
89 */ 102 */
90 uint32_t request_id GNUNET_PACKED; 103 uint32_t request_id GNUNET_PACKED;
91 104
@@ -97,6 +110,10 @@ struct GNUNET_SET_AcceptMessage
97}; 110};
98 111
99 112
113/**
114 * Message sent by a listening client to the service to reject
115 * performing the operation with the other peer.
116 */
100struct GNUNET_SET_RejectMessage 117struct GNUNET_SET_RejectMessage
101{ 118{
102 /** 119 /**
@@ -105,16 +122,10 @@ struct GNUNET_SET_RejectMessage
105 struct GNUNET_MessageHeader header; 122 struct GNUNET_MessageHeader header;
106 123
107 /** 124 /**
108 * ID of the incoming request we want to accept / reject. 125 * ID of the incoming request we want to reject.
109 */ 126 */
110 uint32_t accept_reject_id GNUNET_PACKED; 127 uint32_t accept_reject_id GNUNET_PACKED;
111 128
112 /**
113 * Request ID to identify responses,
114 * must be 0 if we don't accept the request.
115 */
116 uint32_t request_id GNUNET_PACKED;
117
118}; 129};
119 130
120 131
@@ -143,6 +154,11 @@ struct GNUNET_SET_RequestMessage
143}; 154};
144 155
145 156
157/**
158 * Message sent by client to service to initiate a set operation as a
159 * client (not as listener). A set (which determines the operation
160 * type) must already exist in association with this client.
161 */
146struct GNUNET_SET_EvaluateMessage 162struct GNUNET_SET_EvaluateMessage
147{ 163{
148 /** 164 /**
@@ -151,9 +167,10 @@ struct GNUNET_SET_EvaluateMessage
151 struct GNUNET_MessageHeader header; 167 struct GNUNET_MessageHeader header;
152 168
153 /** 169 /**
154 * id of our evaluate, chosen by the client 170 * How should results be sent to us?
171 * See `enum GNUNET_SET_ResultMode`.
155 */ 172 */
156 uint32_t request_id GNUNET_PACKED; 173 uint32_t result_mode GNUNET_PACKED;
157 174
158 /** 175 /**
159 * Peer to evaluate the operation with 176 * Peer to evaluate the operation with
@@ -166,17 +183,13 @@ struct GNUNET_SET_EvaluateMessage
166 struct GNUNET_HashCode app_id; 183 struct GNUNET_HashCode app_id;
167 184
168 /** 185 /**
169 * Salt to use for the operation. 186 * Id of our set to evaluate, chosen implicitly by the client when it
170 */ 187 * calls #GNUNE_SET_commit().
171 uint32_t salt GNUNET_PACKED;
172
173 /**
174 * How should results be sent to us?
175 * See `enum GNUNET_SET_ResultMode`.
176 */ 188 */
177 uint32_t result_mode GNUNET_PACKED; 189 uint32_t request_id GNUNET_PACKED;
178 190
179 /* rest: inner message */ 191 /* rest: context message, that is, application-specific
192 message to convince listener to pick up */
180}; 193};
181 194
182 195
@@ -207,6 +220,10 @@ struct GNUNET_SET_ResultMessage
207}; 220};
208 221
209 222
223/**
224 * Message sent by client to the service to add or remove
225 * an element to/from the set.
226 */
210struct GNUNET_SET_ElementMessage 227struct GNUNET_SET_ElementMessage
211{ 228{
212 /** 229 /**
@@ -215,8 +232,14 @@ struct GNUNET_SET_ElementMessage
215 */ 232 */
216 struct GNUNET_MessageHeader header; 233 struct GNUNET_MessageHeader header;
217 234
235 /**
236 * Type of the element to add or remove.
237 */
218 uint16_t element_type GNUNET_PACKED; 238 uint16_t element_type GNUNET_PACKED;
219 239
240 /**
241 * For alignment, always zero.
242 */
220 uint16_t reserved GNUNET_PACKED; 243 uint16_t reserved GNUNET_PACKED;
221 244
222 /* rest: the actual element */ 245 /* rest: the actual element */