2 This file is part of GNUnet.
3 Copyright (C) 2013-2016 GNUnet e.V.
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU 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.
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.
17 * @file conversation/conversation.h
18 * @brief constants for network protocols
19 * @author Siomon Dieterle
20 * @author Andreas Fuchs
22 #ifndef CONVERSATION_H
23 #define CONVERSATION_H
28 #if 0 /* keep Emacsens' auto-indent happy */
34 #define MAX_TRANSMIT_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60)
38 * Highest bit in a 32-bit unsigned integer,
39 * bit set if we are making an outgoing call,
40 * bit unset for local lines.
42 #define HIGH_BIT ((uint32_t) (1LL << 31))
44 GNUNET_NETWORK_STRUCT_BEGIN
48 * Message to transmit the audio (between client and helpers).
53 * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO
55 struct GNUNET_MessageHeader header;
57 /* followed by audio data */
63 * Client -> Service message to register a phone.
65 struct ClientPhoneRegisterMessage
68 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_REGISTER
70 struct GNUNET_MessageHeader header;
75 uint32_t reserved GNUNET_PACKED;
78 * Phone line / CADET port to register.
80 struct GNUNET_HashCode line_port;
85 * Service -> Client message for phone is ringing.
87 struct ClientPhoneRingMessage
90 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RING
92 struct GNUNET_MessageHeader header;
95 * CID, internal caller ID number used in the future to identify
96 * which active call we are talking about.
98 uint32_t cid GNUNET_PACKED;
103 struct GNUNET_CRYPTO_EcdsaPublicKey caller_id;
109 * Service <-> Client message for phone was suspended.
111 struct ClientPhoneSuspendMessage
114 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_SUSPEND
116 struct GNUNET_MessageHeader header;
119 * CID, internal caller ID to identify which active call we are
122 uint32_t cid GNUNET_PACKED;
128 * Service <-> Client message for phone was resumed.
130 struct ClientPhoneResumeMessage
133 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RESUME
135 struct GNUNET_MessageHeader header;
138 * CID, internal caller ID to identify which active call we are
141 uint32_t cid GNUNET_PACKED;
147 * Client -> Service pick up phone that is ringing.
149 struct ClientPhonePickupMessage
152 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICK_UP
154 struct GNUNET_MessageHeader header;
157 * CID, internal caller ID to identify which active call we are
160 uint32_t cid GNUNET_PACKED;
166 * Client <-> Service hang up phone that may or may not be ringing.
167 * Also sent in response to a (failed) `struct ClientCallMessage`.
169 struct ClientPhoneHangupMessage
172 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP
174 struct GNUNET_MessageHeader header;
177 * CID, internal caller ID to identify which active call we are
180 uint32_t cid GNUNET_PACKED;
186 * Message Client <-> Service to transmit the audio.
188 struct ClientAudioMessage
191 * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO
193 struct GNUNET_MessageHeader header;
196 * CID, internal caller ID to identify which active call we are
199 uint32_t cid GNUNET_PACKED;
201 /* followed by audio data */
207 * Client -> Service message to call a phone.
209 struct ClientCallMessage
212 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_CALL
214 struct GNUNET_MessageHeader header;
219 uint32_t reserved GNUNET_PACKED;
222 * Which peer is hosting the line?
224 struct GNUNET_PeerIdentity target;
227 * Which phone line to call at the peer?
229 struct GNUNET_HashCode line_port;
232 * Identity of the caller.
234 struct GNUNET_CRYPTO_EcdsaPrivateKey caller_id;
239 * Service -> Client: other peer has picked up the phone, we are
242 struct ClientPhonePickedupMessage
245 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICKED_UP
247 struct GNUNET_MessageHeader header;
250 * Call ID of the corresponding
251 * #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_CALL
253 uint32_t cid GNUNET_PACKED;
259 * Information signed in a `struct CadetPhoneRingMessage`
260 * whereby the caller self-identifies to the receiver.
262 struct CadetPhoneRingInfoPS
265 * Purpose for the signature, must be
266 * #GNUNET_SIGNATURE_PURPOSE_CONVERSATION_RING.
268 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
271 * Which port did the call go to?
273 struct GNUNET_HashCode line_port;
276 * Which peer is the call for?
278 struct GNUNET_PeerIdentity target_peer;
281 * When does the signature expire?
283 struct GNUNET_TIME_AbsoluteNBO expiration_time;
288 * Cadet message to make a phone ring. Sent to the port
289 * of the respective phone.
291 struct CadetPhoneRingMessage
294 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RING
296 struct GNUNET_MessageHeader header;
301 uint32_t reserved GNUNET_PACKED;
304 * Who is calling us? (also who is signing).
306 struct GNUNET_CRYPTO_EcdsaPublicKey caller_id;
309 * When does the signature expire?
311 struct GNUNET_TIME_AbsoluteNBO expiration_time;
314 * Signature over a `struct CadetPhoneRingInfoPS`
316 struct GNUNET_CRYPTO_EcdsaSignature signature;
322 * Cadet message for hanging up.
324 struct CadetPhoneHangupMessage
327 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_HANG_UP
329 struct GNUNET_MessageHeader header;
335 * Cadet message for picking up.
337 struct CadetPhonePickupMessage
340 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_PICK_UP
342 struct GNUNET_MessageHeader header;
348 * Cadet message for phone suspended.
350 struct CadetPhoneSuspendMessage
353 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_SUSPEND
355 struct GNUNET_MessageHeader header;
361 * Cadet message for phone resumed.
363 struct CadetPhoneResumeMessage
366 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RESUME
368 struct GNUNET_MessageHeader header;
374 * Cadet message to transmit the audio.
376 struct CadetAudioMessage
379 * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_AUDIO
381 struct GNUNET_MessageHeader header;
383 /* followed by audio data */
388 GNUNET_NETWORK_STRUCT_END
391 #if 0 /* keep Emacsens' auto-indent happy */
398 /* ifndef GNUNET_PROTOCOLS_CONVERSATION_H */
400 /* end of gnunet_protocols_conversation.h */