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
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 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 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
22 * @file conversation/conversation.h
23 * @brief constants for network protocols
24 * @author Siomon Dieterle
25 * @author Andreas Fuchs
27 #ifndef CONVERSATION_H
28 #define CONVERSATION_H
33 #if 0 /* keep Emacsens' auto-indent happy */
39 #define MAX_TRANSMIT_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60)
43 * Highest bit in a 32-bit unsigned integer,
44 * bit set if we are making an outgoing call,
45 * bit unset for local lines.
47 #define HIGH_BIT ((uint32_t) (1LL << 31))
49 GNUNET_NETWORK_STRUCT_BEGIN
53 * Message to transmit the audio (between client and helpers).
58 * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO
60 struct GNUNET_MessageHeader header;
62 /* followed by audio data */
68 * Client -> Service message to register a phone.
70 struct ClientPhoneRegisterMessage
73 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_REGISTER
75 struct GNUNET_MessageHeader header;
80 uint32_t reserved GNUNET_PACKED;
83 * Phone line / CADET port to register.
85 struct GNUNET_HashCode line_port;
90 * Service -> Client message for phone is ringing.
92 struct ClientPhoneRingMessage
95 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RING
97 struct GNUNET_MessageHeader header;
100 * CID, internal caller ID number used in the future to identify
101 * which active call we are talking about.
103 uint32_t cid GNUNET_PACKED;
108 struct GNUNET_CRYPTO_EcdsaPublicKey caller_id;
114 * Service <-> Client message for phone was suspended.
116 struct ClientPhoneSuspendMessage
119 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_SUSPEND
121 struct GNUNET_MessageHeader header;
124 * CID, internal caller ID to identify which active call we are
127 uint32_t cid GNUNET_PACKED;
133 * Service <-> Client message for phone was resumed.
135 struct ClientPhoneResumeMessage
138 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RESUME
140 struct GNUNET_MessageHeader header;
143 * CID, internal caller ID to identify which active call we are
146 uint32_t cid GNUNET_PACKED;
152 * Client -> Service pick up phone that is ringing.
154 struct ClientPhonePickupMessage
157 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICK_UP
159 struct GNUNET_MessageHeader header;
162 * CID, internal caller ID to identify which active call we are
165 uint32_t cid GNUNET_PACKED;
171 * Client <-> Service hang up phone that may or may not be ringing.
172 * Also sent in response to a (failed) `struct ClientCallMessage`.
174 struct ClientPhoneHangupMessage
177 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP
179 struct GNUNET_MessageHeader header;
182 * CID, internal caller ID to identify which active call we are
185 uint32_t cid GNUNET_PACKED;
191 * Message Client <-> Service to transmit the audio.
193 struct ClientAudioMessage
196 * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO
198 struct GNUNET_MessageHeader header;
201 * CID, internal caller ID to identify which active call we are
204 uint32_t cid GNUNET_PACKED;
206 /* followed by audio data */
212 * Client -> Service message to call a phone.
214 struct ClientCallMessage
217 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_CALL
219 struct GNUNET_MessageHeader header;
224 uint32_t reserved GNUNET_PACKED;
227 * Which peer is hosting the line?
229 struct GNUNET_PeerIdentity target;
232 * Which phone line to call at the peer?
234 struct GNUNET_HashCode line_port;
237 * Identity of the caller.
239 struct GNUNET_CRYPTO_EcdsaPrivateKey caller_id;
244 * Service -> Client: other peer has picked up the phone, we are
247 struct ClientPhonePickedupMessage
250 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICKED_UP
252 struct GNUNET_MessageHeader header;
255 * Call ID of the corresponding
256 * #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_CALL
258 uint32_t cid GNUNET_PACKED;
264 * Information signed in a `struct CadetPhoneRingMessage`
265 * whereby the caller self-identifies to the receiver.
267 struct CadetPhoneRingInfoPS
270 * Purpose for the signature, must be
271 * #GNUNET_SIGNATURE_PURPOSE_CONVERSATION_RING.
273 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
276 * Which port did the call go to?
278 struct GNUNET_HashCode line_port;
281 * Which peer is the call for?
283 struct GNUNET_PeerIdentity target_peer;
286 * When does the signature expire?
288 struct GNUNET_TIME_AbsoluteNBO expiration_time;
293 * Cadet message to make a phone ring. Sent to the port
294 * of the respective phone.
296 struct CadetPhoneRingMessage
299 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RING
301 struct GNUNET_MessageHeader header;
306 uint32_t reserved GNUNET_PACKED;
309 * Who is calling us? (also who is signing).
311 struct GNUNET_CRYPTO_EcdsaPublicKey caller_id;
314 * When does the signature expire?
316 struct GNUNET_TIME_AbsoluteNBO expiration_time;
319 * Signature over a `struct CadetPhoneRingInfoPS`
321 struct GNUNET_CRYPTO_EcdsaSignature signature;
327 * Cadet message for hanging up.
329 struct CadetPhoneHangupMessage
332 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_HANG_UP
334 struct GNUNET_MessageHeader header;
340 * Cadet message for picking up.
342 struct CadetPhonePickupMessage
345 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_PICK_UP
347 struct GNUNET_MessageHeader header;
353 * Cadet message for phone suspended.
355 struct CadetPhoneSuspendMessage
358 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_SUSPEND
360 struct GNUNET_MessageHeader header;
366 * Cadet message for phone resumed.
368 struct CadetPhoneResumeMessage
371 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RESUME
373 struct GNUNET_MessageHeader header;
379 * Cadet message to transmit the audio.
381 struct CadetAudioMessage
384 * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_AUDIO
386 struct GNUNET_MessageHeader header;
388 /* followed by audio data */
393 GNUNET_NETWORK_STRUCT_END
396 #if 0 /* keep Emacsens' auto-indent happy */
403 /* ifndef GNUNET_PROTOCOLS_CONVERSATION_H */
405 /* end of gnunet_protocols_conversation.h */