diff options
Diffstat (limited to 'src/set/set.h')
-rw-r--r-- | src/set/set.h | 62 |
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 | ||
40 | GNUNET_NETWORK_STRUCT_BEGIN | 35 | GNUNET_NETWORK_STRUCT_BEGIN |
41 | 36 | ||
42 | struct SetCreateMessage | 37 | struct 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 | ||
57 | struct ListenMessage | 52 | struct 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 | ||
77 | struct AcceptMessage | 72 | struct 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 | */ |
102 | struct RequestMessage | 96 | struct 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 | ||
124 | struct EvaluateMessage | 118 | struct 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 | ||
160 | struct ResultMessage | 154 | struct 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 | ||
187 | struct ElementMessage | 181 | struct 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 | ||
203 | struct 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 | |||
217 | GNUNET_NETWORK_STRUCT_END | 197 | GNUNET_NETWORK_STRUCT_END |
218 | 198 | ||
219 | #endif | 199 | #endif |