aboutsummaryrefslogtreecommitdiff
path: root/src/set/set.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2014-11-27 09:50:41 +0000
committerChristian Grothoff <christian@grothoff.org>2014-11-27 09:50:41 +0000
commit44bb721ef043f99e97d60231438b9e71104d99d7 (patch)
tree476330cbfe2031fa3e3daecf8bf3c45a5156b800 /src/set/set.h
parentbf716069e987193e1ee0d06bbc4af245e6ffa821 (diff)
downloadgnunet-44bb721ef043f99e97d60231438b9e71104d99d7.tar.gz
gnunet-44bb721ef043f99e97d60231438b9e71104d99d7.zip
eliminating useless salt argument, salt can be generated inside of gnunet-service-set
Diffstat (limited to 'src/set/set.h')
-rw-r--r--src/set/set.h83
1 files changed, 53 insertions, 30 deletions
diff --git a/src/set/set.h b/src/set/set.h
index 09d1120f0..be3a7a0c6 100644
--- a/src/set/set.h
+++ b/src/set/set.h
@@ -17,11 +17,11 @@
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20
21/** 20/**
22 * @author Florian Dold
23 * @file set/set.h 21 * @file set/set.h
24 * @brief messages used for the set api 22 * @brief messages used for the set api
23 * @author Florian Dold
24 * @author Christian Grothoff
25 */ 25 */
26#ifndef SET_H 26#ifndef SET_H
27#define SET_H 27#define SET_H
@@ -29,6 +29,9 @@
29#include "platform.h" 29#include "platform.h"
30#include "gnunet_common.h" 30#include "gnunet_common.h"
31 31
32/**
33 * FIXME
34 */
32#define GNUNET_SET_ACK_WINDOW 10 35#define GNUNET_SET_ACK_WINDOW 10
33 36
34 37
@@ -37,27 +40,26 @@ GNUNET_NETWORK_STRUCT_BEGIN
37struct GNUNET_SET_CreateMessage 40struct GNUNET_SET_CreateMessage
38{ 41{
39 /** 42 /**
40 * Type: GNUNET_MESSAGE_TYPE_SET_CREATE 43 * Type: #GNUNET_MESSAGE_TYPE_SET_CREATE
41 */ 44 */
42 struct GNUNET_MessageHeader header; 45 struct GNUNET_MessageHeader header;
43 46
44 /** 47 /**
45 * Operation type, values of enum GNUNET_SET_OperationType 48 * Operation type, values of `enum GNUNET_SET_OperationType`
46 */ 49 */
47 // FIXME: use 32_t for 'enum'. 50 uint32_t operation GNUNET_PACKED;
48 uint16_t operation GNUNET_PACKED;
49}; 51};
50 52
51 53
52struct GNUNET_SET_ListenMessage 54struct GNUNET_SET_ListenMessage
53{ 55{
54 /** 56 /**
55 * Type: GNUNET_MESSAGE_TYPE_SET_LISTEN 57 * Type: #GNUNET_MESSAGE_TYPE_SET_LISTEN
56 */ 58 */
57 struct GNUNET_MessageHeader header; 59 struct GNUNET_MessageHeader header;
58 60
59 /** 61 /**
60 * Operation type, values of enum GNUNET_SET_OperationType 62 * Operation type, values of `enum GNUNET_SET_OperationType`
61 */ 63 */
62 uint32_t operation GNUNET_PACKED; 64 uint32_t operation GNUNET_PACKED;
63 65
@@ -69,11 +71,10 @@ struct GNUNET_SET_ListenMessage
69}; 71};
70 72
71 73
72struct GNUNET_SET_AcceptRejectMessage 74struct GNUNET_SET_AcceptMessage
73{ 75{
74 /** 76 /**
75 * Type: GNUNET_MESSAGE_TYPE_SET_ACCEPT or 77 * Type: #GNUNET_MESSAGE_TYPE_SET_ACCEPT
76 * GNUNET_MESSAGE_TYPE_SET_REJECT
77 */ 78 */
78 struct GNUNET_MessageHeader header; 79 struct GNUNET_MessageHeader header;
79 80
@@ -90,9 +91,30 @@ struct GNUNET_SET_AcceptRejectMessage
90 91
91 /** 92 /**
92 * How should results be sent to us? 93 * How should results be sent to us?
93 * See enum GNUNET_SET_ResultMode. 94 * See `enum GNUNET_SET_ResultMode`.
95 */
96 uint32_t result_mode GNUNET_PACKED;
97};
98
99
100struct GNUNET_SET_RejectMessage
101{
102 /**
103 * Type: #GNUNET_MESSAGE_TYPE_SET_REJECT
104 */
105 struct GNUNET_MessageHeader header;
106
107 /**
108 * ID of the incoming request we want to accept / reject.
109 */
110 uint32_t accept_reject_id GNUNET_PACKED;
111
112 /**
113 * Request ID to identify responses,
114 * must be 0 if we don't accept the request.
94 */ 115 */
95 uint16_t result_mode GNUNET_PACKED; 116 uint32_t request_id GNUNET_PACKED;
117
96}; 118};
97 119
98 120
@@ -102,21 +124,21 @@ struct GNUNET_SET_AcceptRejectMessage
102struct GNUNET_SET_RequestMessage 124struct GNUNET_SET_RequestMessage
103{ 125{
104 /** 126 /**
105 * Type: GNUNET_MESSAGE_TYPE_SET_Request. 127 * Type: #GNUNET_MESSAGE_TYPE_SET_REQUEST.
106 */ 128 */
107 struct GNUNET_MessageHeader header; 129 struct GNUNET_MessageHeader header;
108 130
109 /** 131 /**
110 * Identity of the requesting peer.
111 */
112 struct GNUNET_PeerIdentity peer_id;
113
114 /**
115 * ID of the to identify the request when accepting or 132 * ID of the to identify the request when accepting or
116 * rejecting it. 133 * rejecting it.
117 */ 134 */
118 uint32_t accept_id GNUNET_PACKED; 135 uint32_t accept_id GNUNET_PACKED;
119 136
137 /**
138 * Identity of the requesting peer.
139 */
140 struct GNUNET_PeerIdentity peer_id;
141
120 /* rest: nested context message */ 142 /* rest: nested context message */
121}; 143};
122 144
@@ -124,7 +146,7 @@ struct GNUNET_SET_RequestMessage
124struct GNUNET_SET_EvaluateMessage 146struct GNUNET_SET_EvaluateMessage
125{ 147{
126 /** 148 /**
127 * Type: GNUNET_MESSAGE_TYPE_SET_EVALUATE 149 * Type: #GNUNET_MESSAGE_TYPE_SET_EVALUATE
128 */ 150 */
129 struct GNUNET_MessageHeader header; 151 struct GNUNET_MessageHeader header;
130 152
@@ -144,15 +166,15 @@ struct GNUNET_SET_EvaluateMessage
144 struct GNUNET_HashCode app_id; 166 struct GNUNET_HashCode app_id;
145 167
146 /** 168 /**
147 * Salt to use for the operation 169 * Salt to use for the operation.
148 */ 170 */
149 uint16_t salt GNUNET_PACKED; 171 uint32_t salt GNUNET_PACKED;
150 172
151 /** 173 /**
152 * How should results be sent to us? 174 * How should results be sent to us?
153 * See enum GNUNET_SET_ResultMode. 175 * See `enum GNUNET_SET_ResultMode`.
154 */ 176 */
155 uint16_t result_mode GNUNET_PACKED; 177 uint32_t result_mode GNUNET_PACKED;
156 178
157 /* rest: inner message */ 179 /* rest: inner message */
158}; 180};
@@ -161,7 +183,7 @@ struct GNUNET_SET_EvaluateMessage
161struct GNUNET_SET_ResultMessage 183struct GNUNET_SET_ResultMessage
162{ 184{
163 /** 185 /**
164 * Type: GNUNET_MESSAGE_TYPE_SET_RESULT 186 * Type: #GNUNET_MESSAGE_TYPE_SET_RESULT
165 */ 187 */
166 struct GNUNET_MessageHeader header; 188 struct GNUNET_MessageHeader header;
167 189
@@ -188,8 +210,8 @@ struct GNUNET_SET_ResultMessage
188struct GNUNET_SET_ElementMessage 210struct GNUNET_SET_ElementMessage
189{ 211{
190 /** 212 /**
191 * Type: GNUNET_MESSAGE_TYPE_SET_ADD or 213 * Type: #GNUNET_MESSAGE_TYPE_SET_ADD or
192 * GNUNET_MESSAGE_TYPE_SET_REMOVE 214 * #GNUNET_MESSAGE_TYPE_SET_REMOVE
193 */ 215 */
194 struct GNUNET_MessageHeader header; 216 struct GNUNET_MessageHeader header;
195 217
@@ -208,7 +230,7 @@ struct GNUNET_SET_ElementMessage
208struct GNUNET_SET_CancelMessage 230struct GNUNET_SET_CancelMessage
209{ 231{
210 /** 232 /**
211 * Type: GNUNET_MESSAGE_TYPE_SET_CANCEL 233 * Type: #GNUNET_MESSAGE_TYPE_SET_CANCEL
212 */ 234 */
213 struct GNUNET_MessageHeader header; 235 struct GNUNET_MessageHeader header;
214 236
@@ -218,10 +240,11 @@ struct GNUNET_SET_CancelMessage
218 uint32_t request_id GNUNET_PACKED; 240 uint32_t request_id GNUNET_PACKED;
219}; 241};
220 242
243
221struct GNUNET_SET_IterResponseMessage 244struct GNUNET_SET_IterResponseMessage
222{ 245{
223 /** 246 /**
224 * Type: GNUNET_MESSAGE_TYPE_SET_ITER_RESPONSE 247 * Type: #GNUNET_MESSAGE_TYPE_SET_ITER_RESPONSE
225 */ 248 */
226 struct GNUNET_MessageHeader header; 249 struct GNUNET_MessageHeader header;
227 250
@@ -237,7 +260,7 @@ struct GNUNET_SET_IterResponseMessage
237struct GNUNET_SET_IterAckMessage 260struct GNUNET_SET_IterAckMessage
238{ 261{
239 /** 262 /**
240 * Type: GNUNET_MESSAGE_TYPE_SET_ITER_ACK 263 * Type: #GNUNET_MESSAGE_TYPE_SET_ITER_ACK
241 */ 264 */
242 struct GNUNET_MessageHeader header; 265 struct GNUNET_MessageHeader header;
243 266