2 This file is part of GNUnet.
3 Copyright (C) 2013 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))
51 * Message to transmit the audio (between client and helpers).
56 * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO
58 struct GNUNET_MessageHeader header;
60 /* followed by audio data */
66 * Client -> Service message to register a phone.
68 struct ClientPhoneRegisterMessage
71 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_REGISTER
73 struct GNUNET_MessageHeader header;
76 * Phone line to register.
78 uint32_t line GNUNET_PACKED;
83 * Service -> Client message for phone is ringing.
85 struct ClientPhoneRingMessage
88 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RING
90 struct GNUNET_MessageHeader header;
93 * CID, internal caller ID to identify which active call we are
96 uint32_t cid GNUNET_PACKED;
101 struct GNUNET_CRYPTO_EcdsaPublicKey caller_id;
107 * Service <-> Client message for phone was suspended.
109 struct ClientPhoneSuspendMessage
112 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_SUSPEND
114 struct GNUNET_MessageHeader header;
117 * CID, internal caller ID to identify which active call we are
120 uint32_t cid GNUNET_PACKED;
126 * Service <-> Client message for phone was resumed.
128 struct ClientPhoneResumeMessage
131 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RESUME
133 struct GNUNET_MessageHeader header;
136 * CID, internal caller ID to identify which active call we are
139 uint32_t cid GNUNET_PACKED;
145 * Client -> Service pick up phone that is ringing.
147 struct ClientPhonePickupMessage
150 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICK_UP
152 struct GNUNET_MessageHeader header;
155 * CID, internal caller ID to identify which active call we are
158 uint32_t cid GNUNET_PACKED;
164 * Client <-> Service hang up phone that may or may not be ringing.
165 * Also sent in response to a (failed) `struct ClientCallMessage`.
167 struct ClientPhoneHangupMessage
170 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP
172 struct GNUNET_MessageHeader header;
175 * CID, internal caller ID to identify which active call we are
178 uint32_t cid GNUNET_PACKED;
184 * Message Client <->Service to transmit the audio.
186 struct ClientAudioMessage
189 * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO
191 struct GNUNET_MessageHeader header;
194 * CID, internal caller ID to identify which active call we are
197 uint32_t cid GNUNET_PACKED;
199 /* followed by audio data */
205 * Client -> Service message to call a phone.
207 struct ClientCallMessage
210 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_CALL
212 struct GNUNET_MessageHeader header;
215 * Which phone line to call at the peer?
217 uint32_t line GNUNET_PACKED;
220 * Which peer is hosting the line?
222 struct GNUNET_PeerIdentity target;
225 * Identity of the caller.
227 struct GNUNET_CRYPTO_EcdsaPrivateKey caller_id;
232 * Service -> Client: other peer has picked up the phone, we are
235 struct ClientPhonePickedupMessage
238 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICKED_UP
240 struct GNUNET_MessageHeader header;
246 * Cadet message for phone is ringing.
248 struct CadetPhoneRingMessage
251 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RING
253 struct GNUNET_MessageHeader header;
256 * Desired target line.
258 uint32_t remote_line GNUNET_PACKED;
261 * Purpose for the signature.
263 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
266 * Who is calling us? (also who is signing).
268 struct GNUNET_CRYPTO_EcdsaPublicKey caller_id;
271 * Who are we calling?
273 struct GNUNET_PeerIdentity target;
276 * From where are we calling?
278 struct GNUNET_PeerIdentity source;
281 * When does the signature expire?
283 struct GNUNET_TIME_AbsoluteNBO expiration_time;
286 * Signature on the above.
288 struct GNUNET_CRYPTO_EcdsaSignature signature;
291 * Source line for audio data in the other direction.
293 uint32_t source_line GNUNET_PACKED;
299 * Cadet message for hanging up.
301 struct CadetPhoneHangupMessage
304 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_HANG_UP
306 struct GNUNET_MessageHeader header;
312 * Cadet message for picking up.
314 struct CadetPhonePickupMessage
317 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_PICK_UP
319 struct GNUNET_MessageHeader header;
325 * Cadet message for phone suspended.
327 struct CadetPhoneSuspendMessage
330 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_SUSPEND
332 struct GNUNET_MessageHeader header;
338 * Cadet message for phone resumed.
340 struct CadetPhoneResumeMessage
343 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RESUME
345 struct GNUNET_MessageHeader header;
351 * Cadet message to transmit the audio.
353 struct CadetAudioMessage
356 * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_AUDIO
358 struct GNUNET_MessageHeader header;
361 * Target line on the receiving end.
363 uint32_t remote_line GNUNET_PACKED;
366 * The source line sending this data
368 uint32_t source_line GNUNET_PACKED;
370 /* followed by audio data */
376 #if 0 /* keep Emacsens' auto-indent happy */
383 /* ifndef GNUNET_PROTOCOLS_CONVERSATION_H */
385 /* end of gnunet_protocols_conversation.h */