diff options
Diffstat (limited to 'src/conversation/conversation.h')
-rw-r--r-- | src/conversation/conversation.h | 394 |
1 files changed, 0 insertions, 394 deletions
diff --git a/src/conversation/conversation.h b/src/conversation/conversation.h deleted file mode 100644 index d244f5163..000000000 --- a/src/conversation/conversation.h +++ /dev/null | |||
@@ -1,394 +0,0 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | Copyright (C) 2013-2016 GNUnet e.V. | ||
4 | |||
5 | GNUnet is free software: you can redistribute it and/or modify it | ||
6 | under the terms of the GNU Affero General Public License as published | ||
7 | by the Free Software Foundation, either version 3 of the License, | ||
8 | or (at your option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | Affero General Public License for more details. | ||
14 | |||
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/>. | ||
17 | |||
18 | SPDX-License-Identifier: AGPL3.0-or-later | ||
19 | */ | ||
20 | |||
21 | /** | ||
22 | * @file conversation/conversation.h | ||
23 | * @brief constants for network protocols | ||
24 | * @author Siomon Dieterle | ||
25 | * @author Andreas Fuchs | ||
26 | */ | ||
27 | #ifndef CONVERSATION_H | ||
28 | #define CONVERSATION_H | ||
29 | |||
30 | #include "gnunet_identity_service.h" | ||
31 | |||
32 | #ifdef __cplusplus | ||
33 | extern "C" | ||
34 | { | ||
35 | #if 0 /* keep Emacsens' auto-indent happy */ | ||
36 | } | ||
37 | #endif | ||
38 | #endif | ||
39 | |||
40 | |||
41 | #define MAX_TRANSMIT_DELAY GNUNET_TIME_relative_multiply ( \ | ||
42 | GNUNET_TIME_UNIT_SECONDS, 60) | ||
43 | |||
44 | |||
45 | /** | ||
46 | * Highest bit in a 32-bit unsigned integer, | ||
47 | * bit set if we are making an outgoing call, | ||
48 | * bit unset for local lines. | ||
49 | */ | ||
50 | #define HIGH_BIT ((uint32_t) (1LL << 31)) | ||
51 | |||
52 | GNUNET_NETWORK_STRUCT_BEGIN | ||
53 | |||
54 | |||
55 | /** | ||
56 | * Message to transmit the audio (between client and helpers). | ||
57 | */ | ||
58 | struct AudioMessage | ||
59 | { | ||
60 | /** | ||
61 | * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO | ||
62 | */ | ||
63 | struct GNUNET_MessageHeader header; | ||
64 | |||
65 | /* followed by audio data */ | ||
66 | }; | ||
67 | |||
68 | |||
69 | /** | ||
70 | * Client -> Service message to register a phone. | ||
71 | */ | ||
72 | struct ClientPhoneRegisterMessage | ||
73 | { | ||
74 | /** | ||
75 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_REGISTER | ||
76 | */ | ||
77 | struct GNUNET_MessageHeader header; | ||
78 | |||
79 | /** | ||
80 | * Always zero. | ||
81 | */ | ||
82 | uint32_t reserved GNUNET_PACKED; | ||
83 | |||
84 | /** | ||
85 | * Phone line / CADET port to register. | ||
86 | */ | ||
87 | struct GNUNET_HashCode line_port; | ||
88 | }; | ||
89 | |||
90 | |||
91 | /** | ||
92 | * Service -> Client message for phone is ringing. | ||
93 | */ | ||
94 | struct ClientPhoneRingMessage | ||
95 | { | ||
96 | /** | ||
97 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RING | ||
98 | */ | ||
99 | struct GNUNET_MessageHeader header; | ||
100 | |||
101 | /** | ||
102 | * CID, internal caller ID number used in the future to identify | ||
103 | * which active call we are talking about. | ||
104 | */ | ||
105 | uint32_t cid GNUNET_PACKED; | ||
106 | |||
107 | /** | ||
108 | * Who is calling us? | ||
109 | */ | ||
110 | struct GNUNET_IDENTITY_PublicKey caller_id; | ||
111 | }; | ||
112 | |||
113 | |||
114 | /** | ||
115 | * Service <-> Client message for phone was suspended. | ||
116 | */ | ||
117 | struct ClientPhoneSuspendMessage | ||
118 | { | ||
119 | /** | ||
120 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_SUSPEND | ||
121 | */ | ||
122 | struct GNUNET_MessageHeader header; | ||
123 | |||
124 | /** | ||
125 | * CID, internal caller ID to identify which active call we are | ||
126 | * talking about. | ||
127 | */ | ||
128 | uint32_t cid GNUNET_PACKED; | ||
129 | }; | ||
130 | |||
131 | |||
132 | /** | ||
133 | * Service <-> Client message for phone was resumed. | ||
134 | */ | ||
135 | struct ClientPhoneResumeMessage | ||
136 | { | ||
137 | /** | ||
138 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RESUME | ||
139 | */ | ||
140 | struct GNUNET_MessageHeader header; | ||
141 | |||
142 | /** | ||
143 | * CID, internal caller ID to identify which active call we are | ||
144 | * talking about. | ||
145 | */ | ||
146 | uint32_t cid GNUNET_PACKED; | ||
147 | }; | ||
148 | |||
149 | |||
150 | /** | ||
151 | * Client -> Service pick up phone that is ringing. | ||
152 | */ | ||
153 | struct ClientPhonePickupMessage | ||
154 | { | ||
155 | /** | ||
156 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICK_UP | ||
157 | */ | ||
158 | struct GNUNET_MessageHeader header; | ||
159 | |||
160 | /** | ||
161 | * CID, internal caller ID to identify which active call we are | ||
162 | * talking about. | ||
163 | */ | ||
164 | uint32_t cid GNUNET_PACKED; | ||
165 | }; | ||
166 | |||
167 | |||
168 | /** | ||
169 | * Client <-> Service hang up phone that may or may not be ringing. | ||
170 | * Also sent in response to a (failed) `struct ClientCallMessage`. | ||
171 | */ | ||
172 | struct ClientPhoneHangupMessage | ||
173 | { | ||
174 | /** | ||
175 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP | ||
176 | */ | ||
177 | struct GNUNET_MessageHeader header; | ||
178 | |||
179 | /** | ||
180 | * CID, internal caller ID to identify which active call we are | ||
181 | * talking about. | ||
182 | */ | ||
183 | uint32_t cid GNUNET_PACKED; | ||
184 | }; | ||
185 | |||
186 | |||
187 | /** | ||
188 | * Message Client <-> Service to transmit the audio. | ||
189 | */ | ||
190 | struct ClientAudioMessage | ||
191 | { | ||
192 | /** | ||
193 | * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO | ||
194 | */ | ||
195 | struct GNUNET_MessageHeader header; | ||
196 | |||
197 | /** | ||
198 | * CID, internal caller ID to identify which active call we are | ||
199 | * sending data to. | ||
200 | */ | ||
201 | uint32_t cid GNUNET_PACKED; | ||
202 | |||
203 | /* followed by audio data */ | ||
204 | }; | ||
205 | |||
206 | |||
207 | /** | ||
208 | * Client -> Service message to call a phone. | ||
209 | */ | ||
210 | struct ClientCallMessage | ||
211 | { | ||
212 | /** | ||
213 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_CALL | ||
214 | */ | ||
215 | struct GNUNET_MessageHeader header; | ||
216 | |||
217 | /** | ||
218 | * Always zero. | ||
219 | */ | ||
220 | uint32_t reserved GNUNET_PACKED; | ||
221 | |||
222 | /** | ||
223 | * Which peer is hosting the line? | ||
224 | */ | ||
225 | struct GNUNET_PeerIdentity target; | ||
226 | |||
227 | /** | ||
228 | * Which phone line to call at the peer? | ||
229 | */ | ||
230 | struct GNUNET_HashCode line_port; | ||
231 | |||
232 | /** | ||
233 | * Identity of the caller. | ||
234 | */ | ||
235 | struct GNUNET_IDENTITY_PrivateKey caller_id; | ||
236 | }; | ||
237 | |||
238 | |||
239 | /** | ||
240 | * Service -> Client: other peer has picked up the phone, we are | ||
241 | * now talking. | ||
242 | */ | ||
243 | struct ClientPhonePickedupMessage | ||
244 | { | ||
245 | /** | ||
246 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICKED_UP | ||
247 | */ | ||
248 | struct GNUNET_MessageHeader header; | ||
249 | |||
250 | /** | ||
251 | * Call ID of the corresponding | ||
252 | * #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_CALL | ||
253 | */ | ||
254 | uint32_t cid GNUNET_PACKED; | ||
255 | }; | ||
256 | |||
257 | |||
258 | /** | ||
259 | * Information signed in a `struct CadetPhoneRingMessage` | ||
260 | * whereby the caller self-identifies to the receiver. | ||
261 | */ | ||
262 | struct CadetPhoneRingInfoPS | ||
263 | { | ||
264 | /** | ||
265 | * Purpose for the signature, must be | ||
266 | * #GNUNET_SIGNATURE_PURPOSE_CONVERSATION_RING. | ||
267 | */ | ||
268 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; | ||
269 | |||
270 | /** | ||
271 | * Which port did the call go to? | ||
272 | */ | ||
273 | struct GNUNET_HashCode line_port; | ||
274 | |||
275 | /** | ||
276 | * Which peer is the call for? | ||
277 | */ | ||
278 | struct GNUNET_PeerIdentity target_peer; | ||
279 | |||
280 | /** | ||
281 | * When does the signature expire? | ||
282 | */ | ||
283 | struct GNUNET_TIME_AbsoluteNBO expiration_time; | ||
284 | }; | ||
285 | |||
286 | |||
287 | /** | ||
288 | * Cadet message to make a phone ring. Sent to the port | ||
289 | * of the respective phone. | ||
290 | */ | ||
291 | struct CadetPhoneRingMessage | ||
292 | { | ||
293 | /** | ||
294 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RING | ||
295 | */ | ||
296 | struct GNUNET_MessageHeader header; | ||
297 | |||
298 | /** | ||
299 | * Always zero. | ||
300 | */ | ||
301 | uint32_t reserved GNUNET_PACKED; | ||
302 | |||
303 | /** | ||
304 | * Who is calling us? (also who is signing). | ||
305 | */ | ||
306 | struct GNUNET_IDENTITY_PublicKey caller_id; | ||
307 | |||
308 | /** | ||
309 | * When does the signature expire? | ||
310 | */ | ||
311 | struct GNUNET_TIME_AbsoluteNBO expiration_time; | ||
312 | |||
313 | /** | ||
314 | * Signature over a `struct CadetPhoneRingInfoPS` | ||
315 | */ | ||
316 | struct GNUNET_IDENTITY_Signature signature; | ||
317 | }; | ||
318 | |||
319 | |||
320 | /** | ||
321 | * Cadet message for hanging up. | ||
322 | */ | ||
323 | struct CadetPhoneHangupMessage | ||
324 | { | ||
325 | /** | ||
326 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_HANG_UP | ||
327 | */ | ||
328 | struct GNUNET_MessageHeader header; | ||
329 | }; | ||
330 | |||
331 | |||
332 | /** | ||
333 | * Cadet message for picking up. | ||
334 | */ | ||
335 | struct CadetPhonePickupMessage | ||
336 | { | ||
337 | /** | ||
338 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_PICK_UP | ||
339 | */ | ||
340 | struct GNUNET_MessageHeader header; | ||
341 | }; | ||
342 | |||
343 | |||
344 | /** | ||
345 | * Cadet message for phone suspended. | ||
346 | */ | ||
347 | struct CadetPhoneSuspendMessage | ||
348 | { | ||
349 | /** | ||
350 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_SUSPEND | ||
351 | */ | ||
352 | struct GNUNET_MessageHeader header; | ||
353 | }; | ||
354 | |||
355 | |||
356 | /** | ||
357 | * Cadet message for phone resumed. | ||
358 | */ | ||
359 | struct CadetPhoneResumeMessage | ||
360 | { | ||
361 | /** | ||
362 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RESUME | ||
363 | */ | ||
364 | struct GNUNET_MessageHeader header; | ||
365 | }; | ||
366 | |||
367 | |||
368 | /** | ||
369 | * Cadet message to transmit the audio. | ||
370 | */ | ||
371 | struct CadetAudioMessage | ||
372 | { | ||
373 | /** | ||
374 | * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_AUDIO | ||
375 | */ | ||
376 | struct GNUNET_MessageHeader header; | ||
377 | |||
378 | /* followed by audio data */ | ||
379 | }; | ||
380 | |||
381 | |||
382 | GNUNET_NETWORK_STRUCT_END | ||
383 | |||
384 | |||
385 | #if 0 /* keep Emacsens' auto-indent happy */ | ||
386 | { | ||
387 | #endif | ||
388 | #ifdef __cplusplus | ||
389 | } | ||
390 | #endif | ||
391 | |||
392 | /* ifndef GNUNET_PROTOCOLS_CONVERSATION_H */ | ||
393 | #endif | ||
394 | /* end of gnunet_protocols_conversation.h */ | ||