diff options
Diffstat (limited to 'src/conversation/conversation.h')
-rw-r--r-- | src/conversation/conversation.h | 77 |
1 files changed, 23 insertions, 54 deletions
diff --git a/src/conversation/conversation.h b/src/conversation/conversation.h index 69f868e6c..0a9e2b5fb 100644 --- a/src/conversation/conversation.h +++ b/src/conversation/conversation.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file conversation/conversation.h | 22 | * @file conversation/conversation.h |
@@ -30,13 +30,13 @@ | |||
30 | #ifdef __cplusplus | 30 | #ifdef __cplusplus |
31 | extern "C" | 31 | extern "C" |
32 | { | 32 | { |
33 | #if 0 /* keep Emacsens' auto-indent happy */ | 33 | #if 0 /* keep Emacsens' auto-indent happy */ |
34 | } | 34 | } |
35 | #endif | 35 | #endif |
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | 38 | ||
39 | #define MAX_TRANSMIT_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60) | 39 | #define MAX_TRANSMIT_DELAY GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 60) |
40 | 40 | ||
41 | 41 | ||
42 | /** | 42 | /** |
@@ -44,7 +44,7 @@ extern "C" | |||
44 | * bit set if we are making an outgoing call, | 44 | * bit set if we are making an outgoing call, |
45 | * bit unset for local lines. | 45 | * bit unset for local lines. |
46 | */ | 46 | */ |
47 | #define HIGH_BIT ((uint32_t) (1LL << 31)) | 47 | #define HIGH_BIT ((uint32_t)(1LL << 31)) |
48 | 48 | ||
49 | GNUNET_NETWORK_STRUCT_BEGIN | 49 | GNUNET_NETWORK_STRUCT_BEGIN |
50 | 50 | ||
@@ -52,23 +52,20 @@ GNUNET_NETWORK_STRUCT_BEGIN | |||
52 | /** | 52 | /** |
53 | * Message to transmit the audio (between client and helpers). | 53 | * Message to transmit the audio (between client and helpers). |
54 | */ | 54 | */ |
55 | struct AudioMessage | 55 | struct AudioMessage { |
56 | { | ||
57 | /** | 56 | /** |
58 | * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO | 57 | * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO |
59 | */ | 58 | */ |
60 | struct GNUNET_MessageHeader header; | 59 | struct GNUNET_MessageHeader header; |
61 | 60 | ||
62 | /* followed by audio data */ | 61 | /* followed by audio data */ |
63 | |||
64 | }; | 62 | }; |
65 | 63 | ||
66 | 64 | ||
67 | /** | 65 | /** |
68 | * Client -> Service message to register a phone. | 66 | * Client -> Service message to register a phone. |
69 | */ | 67 | */ |
70 | struct ClientPhoneRegisterMessage | 68 | struct ClientPhoneRegisterMessage { |
71 | { | ||
72 | /** | 69 | /** |
73 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_REGISTER | 70 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_REGISTER |
74 | */ | 71 | */ |
@@ -89,8 +86,7 @@ struct ClientPhoneRegisterMessage | |||
89 | /** | 86 | /** |
90 | * Service -> Client message for phone is ringing. | 87 | * Service -> Client message for phone is ringing. |
91 | */ | 88 | */ |
92 | struct ClientPhoneRingMessage | 89 | struct ClientPhoneRingMessage { |
93 | { | ||
94 | /** | 90 | /** |
95 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RING | 91 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RING |
96 | */ | 92 | */ |
@@ -106,15 +102,13 @@ struct ClientPhoneRingMessage | |||
106 | * Who is calling us? | 102 | * Who is calling us? |
107 | */ | 103 | */ |
108 | struct GNUNET_CRYPTO_EcdsaPublicKey caller_id; | 104 | struct GNUNET_CRYPTO_EcdsaPublicKey caller_id; |
109 | |||
110 | }; | 105 | }; |
111 | 106 | ||
112 | 107 | ||
113 | /** | 108 | /** |
114 | * Service <-> Client message for phone was suspended. | 109 | * Service <-> Client message for phone was suspended. |
115 | */ | 110 | */ |
116 | struct ClientPhoneSuspendMessage | 111 | struct ClientPhoneSuspendMessage { |
117 | { | ||
118 | /** | 112 | /** |
119 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_SUSPEND | 113 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_SUSPEND |
120 | */ | 114 | */ |
@@ -125,15 +119,13 @@ struct ClientPhoneSuspendMessage | |||
125 | * talking about. | 119 | * talking about. |
126 | */ | 120 | */ |
127 | uint32_t cid GNUNET_PACKED; | 121 | uint32_t cid GNUNET_PACKED; |
128 | |||
129 | }; | 122 | }; |
130 | 123 | ||
131 | 124 | ||
132 | /** | 125 | /** |
133 | * Service <-> Client message for phone was resumed. | 126 | * Service <-> Client message for phone was resumed. |
134 | */ | 127 | */ |
135 | struct ClientPhoneResumeMessage | 128 | struct ClientPhoneResumeMessage { |
136 | { | ||
137 | /** | 129 | /** |
138 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RESUME | 130 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RESUME |
139 | */ | 131 | */ |
@@ -144,15 +136,13 @@ struct ClientPhoneResumeMessage | |||
144 | * talking about. | 136 | * talking about. |
145 | */ | 137 | */ |
146 | uint32_t cid GNUNET_PACKED; | 138 | uint32_t cid GNUNET_PACKED; |
147 | |||
148 | }; | 139 | }; |
149 | 140 | ||
150 | 141 | ||
151 | /** | 142 | /** |
152 | * Client -> Service pick up phone that is ringing. | 143 | * Client -> Service pick up phone that is ringing. |
153 | */ | 144 | */ |
154 | struct ClientPhonePickupMessage | 145 | struct ClientPhonePickupMessage { |
155 | { | ||
156 | /** | 146 | /** |
157 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICK_UP | 147 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICK_UP |
158 | */ | 148 | */ |
@@ -163,7 +153,6 @@ struct ClientPhonePickupMessage | |||
163 | * talking about. | 153 | * talking about. |
164 | */ | 154 | */ |
165 | uint32_t cid GNUNET_PACKED; | 155 | uint32_t cid GNUNET_PACKED; |
166 | |||
167 | }; | 156 | }; |
168 | 157 | ||
169 | 158 | ||
@@ -171,8 +160,7 @@ struct ClientPhonePickupMessage | |||
171 | * Client <-> Service hang up phone that may or may not be ringing. | 160 | * Client <-> Service hang up phone that may or may not be ringing. |
172 | * Also sent in response to a (failed) `struct ClientCallMessage`. | 161 | * Also sent in response to a (failed) `struct ClientCallMessage`. |
173 | */ | 162 | */ |
174 | struct ClientPhoneHangupMessage | 163 | struct ClientPhoneHangupMessage { |
175 | { | ||
176 | /** | 164 | /** |
177 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP | 165 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP |
178 | */ | 166 | */ |
@@ -183,15 +171,13 @@ struct ClientPhoneHangupMessage | |||
183 | * talking about. | 171 | * talking about. |
184 | */ | 172 | */ |
185 | uint32_t cid GNUNET_PACKED; | 173 | uint32_t cid GNUNET_PACKED; |
186 | |||
187 | }; | 174 | }; |
188 | 175 | ||
189 | 176 | ||
190 | /** | 177 | /** |
191 | * Message Client <-> Service to transmit the audio. | 178 | * Message Client <-> Service to transmit the audio. |
192 | */ | 179 | */ |
193 | struct ClientAudioMessage | 180 | struct ClientAudioMessage { |
194 | { | ||
195 | /** | 181 | /** |
196 | * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO | 182 | * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO |
197 | */ | 183 | */ |
@@ -204,15 +190,13 @@ struct ClientAudioMessage | |||
204 | uint32_t cid GNUNET_PACKED; | 190 | uint32_t cid GNUNET_PACKED; |
205 | 191 | ||
206 | /* followed by audio data */ | 192 | /* followed by audio data */ |
207 | |||
208 | }; | 193 | }; |
209 | 194 | ||
210 | 195 | ||
211 | /** | 196 | /** |
212 | * Client -> Service message to call a phone. | 197 | * Client -> Service message to call a phone. |
213 | */ | 198 | */ |
214 | struct ClientCallMessage | 199 | struct ClientCallMessage { |
215 | { | ||
216 | /** | 200 | /** |
217 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_CALL | 201 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_CALL |
218 | */ | 202 | */ |
@@ -244,8 +228,7 @@ struct ClientCallMessage | |||
244 | * Service -> Client: other peer has picked up the phone, we are | 228 | * Service -> Client: other peer has picked up the phone, we are |
245 | * now talking. | 229 | * now talking. |
246 | */ | 230 | */ |
247 | struct ClientPhonePickedupMessage | 231 | struct ClientPhonePickedupMessage { |
248 | { | ||
249 | /** | 232 | /** |
250 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICKED_UP | 233 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICKED_UP |
251 | */ | 234 | */ |
@@ -256,7 +239,6 @@ struct ClientPhonePickedupMessage | |||
256 | * #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_CALL | 239 | * #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_CALL |
257 | */ | 240 | */ |
258 | uint32_t cid GNUNET_PACKED; | 241 | uint32_t cid GNUNET_PACKED; |
259 | |||
260 | }; | 242 | }; |
261 | 243 | ||
262 | 244 | ||
@@ -264,8 +246,7 @@ struct ClientPhonePickedupMessage | |||
264 | * Information signed in a `struct CadetPhoneRingMessage` | 246 | * Information signed in a `struct CadetPhoneRingMessage` |
265 | * whereby the caller self-identifies to the receiver. | 247 | * whereby the caller self-identifies to the receiver. |
266 | */ | 248 | */ |
267 | struct CadetPhoneRingInfoPS | 249 | struct CadetPhoneRingInfoPS { |
268 | { | ||
269 | /** | 250 | /** |
270 | * Purpose for the signature, must be | 251 | * Purpose for the signature, must be |
271 | * #GNUNET_SIGNATURE_PURPOSE_CONVERSATION_RING. | 252 | * #GNUNET_SIGNATURE_PURPOSE_CONVERSATION_RING. |
@@ -293,8 +274,7 @@ struct CadetPhoneRingInfoPS | |||
293 | * Cadet message to make a phone ring. Sent to the port | 274 | * Cadet message to make a phone ring. Sent to the port |
294 | * of the respective phone. | 275 | * of the respective phone. |
295 | */ | 276 | */ |
296 | struct CadetPhoneRingMessage | 277 | struct CadetPhoneRingMessage { |
297 | { | ||
298 | /** | 278 | /** |
299 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RING | 279 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RING |
300 | */ | 280 | */ |
@@ -319,81 +299,70 @@ struct CadetPhoneRingMessage | |||
319 | * Signature over a `struct CadetPhoneRingInfoPS` | 299 | * Signature over a `struct CadetPhoneRingInfoPS` |
320 | */ | 300 | */ |
321 | struct GNUNET_CRYPTO_EcdsaSignature signature; | 301 | struct GNUNET_CRYPTO_EcdsaSignature signature; |
322 | |||
323 | }; | 302 | }; |
324 | 303 | ||
325 | 304 | ||
326 | /** | 305 | /** |
327 | * Cadet message for hanging up. | 306 | * Cadet message for hanging up. |
328 | */ | 307 | */ |
329 | struct CadetPhoneHangupMessage | 308 | struct CadetPhoneHangupMessage { |
330 | { | ||
331 | /** | 309 | /** |
332 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_HANG_UP | 310 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_HANG_UP |
333 | */ | 311 | */ |
334 | struct GNUNET_MessageHeader header; | 312 | struct GNUNET_MessageHeader header; |
335 | |||
336 | }; | 313 | }; |
337 | 314 | ||
338 | 315 | ||
339 | /** | 316 | /** |
340 | * Cadet message for picking up. | 317 | * Cadet message for picking up. |
341 | */ | 318 | */ |
342 | struct CadetPhonePickupMessage | 319 | struct CadetPhonePickupMessage { |
343 | { | ||
344 | /** | 320 | /** |
345 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_PICK_UP | 321 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_PICK_UP |
346 | */ | 322 | */ |
347 | struct GNUNET_MessageHeader header; | 323 | struct GNUNET_MessageHeader header; |
348 | |||
349 | }; | 324 | }; |
350 | 325 | ||
351 | 326 | ||
352 | /** | 327 | /** |
353 | * Cadet message for phone suspended. | 328 | * Cadet message for phone suspended. |
354 | */ | 329 | */ |
355 | struct CadetPhoneSuspendMessage | 330 | struct CadetPhoneSuspendMessage { |
356 | { | ||
357 | /** | 331 | /** |
358 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_SUSPEND | 332 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_SUSPEND |
359 | */ | 333 | */ |
360 | struct GNUNET_MessageHeader header; | 334 | struct GNUNET_MessageHeader header; |
361 | |||
362 | }; | 335 | }; |
363 | 336 | ||
364 | 337 | ||
365 | /** | 338 | /** |
366 | * Cadet message for phone resumed. | 339 | * Cadet message for phone resumed. |
367 | */ | 340 | */ |
368 | struct CadetPhoneResumeMessage | 341 | struct CadetPhoneResumeMessage { |
369 | { | ||
370 | /** | 342 | /** |
371 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RESUME | 343 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RESUME |
372 | */ | 344 | */ |
373 | struct GNUNET_MessageHeader header; | 345 | struct GNUNET_MessageHeader header; |
374 | |||
375 | }; | 346 | }; |
376 | 347 | ||
377 | 348 | ||
378 | /** | 349 | /** |
379 | * Cadet message to transmit the audio. | 350 | * Cadet message to transmit the audio. |
380 | */ | 351 | */ |
381 | struct CadetAudioMessage | 352 | struct CadetAudioMessage { |
382 | { | ||
383 | /** | 353 | /** |
384 | * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_AUDIO | 354 | * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_AUDIO |
385 | */ | 355 | */ |
386 | struct GNUNET_MessageHeader header; | 356 | struct GNUNET_MessageHeader header; |
387 | 357 | ||
388 | /* followed by audio data */ | 358 | /* followed by audio data */ |
389 | |||
390 | }; | 359 | }; |
391 | 360 | ||
392 | 361 | ||
393 | GNUNET_NETWORK_STRUCT_END | 362 | GNUNET_NETWORK_STRUCT_END |
394 | 363 | ||
395 | 364 | ||
396 | #if 0 /* keep Emacsens' auto-indent happy */ | 365 | #if 0 /* keep Emacsens' auto-indent happy */ |
397 | { | 366 | { |
398 | #endif | 367 | #endif |
399 | #ifdef __cplusplus | 368 | #ifdef __cplusplus |