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))
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;
78 * Phone line to register.
80 uint32_t line GNUNET_PACKED;
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 to identify which active call we are
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;
217 * Which phone line to call at the peer?
219 uint32_t line GNUNET_PACKED;
222 * Which peer is hosting the line?
224 struct GNUNET_PeerIdentity target;
227 * Identity of the caller.
229 struct GNUNET_CRYPTO_EcdsaPrivateKey caller_id;
234 * Service -> Client: other peer has picked up the phone, we are
237 struct ClientPhonePickedupMessage
240 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICKED_UP
242 struct GNUNET_MessageHeader header;
248 * Cadet message for phone is ringing.
250 struct CadetPhoneRingMessage
253 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RING
255 struct GNUNET_MessageHeader header;
258 * Desired target line.
260 uint32_t remote_line GNUNET_PACKED;
263 * Purpose for the signature.
265 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
268 * Who is calling us? (also who is signing).
270 struct GNUNET_CRYPTO_EcdsaPublicKey caller_id;
273 * Who are we calling?
275 struct GNUNET_PeerIdentity target;
278 * From where are we calling?
280 struct GNUNET_PeerIdentity source;
283 * When does the signature expire?
285 struct GNUNET_TIME_AbsoluteNBO expiration_time;
288 * Signature on the above.
290 struct GNUNET_CRYPTO_EcdsaSignature signature;
293 * Source line for audio data in the other direction.
295 uint32_t source_line GNUNET_PACKED;
301 * Cadet message for hanging up.
303 struct CadetPhoneHangupMessage
306 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_HANG_UP
308 struct GNUNET_MessageHeader header;
314 * Cadet message for picking up.
316 struct CadetPhonePickupMessage
319 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_PICK_UP
321 struct GNUNET_MessageHeader header;
327 * Cadet message for phone suspended.
329 struct CadetPhoneSuspendMessage
332 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_SUSPEND
334 struct GNUNET_MessageHeader header;
340 * Cadet message for phone resumed.
342 struct CadetPhoneResumeMessage
345 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RESUME
347 struct GNUNET_MessageHeader header;
353 * Cadet message to transmit the audio.
355 struct CadetAudioMessage
358 * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_AUDIO
360 struct GNUNET_MessageHeader header;
363 * Target line on the receiving end.
365 uint32_t remote_line GNUNET_PACKED;
368 * The source line sending this data
370 uint32_t source_line GNUNET_PACKED;
372 /* followed by audio data */
377 GNUNET_NETWORK_STRUCT_END
380 #if 0 /* keep Emacsens' auto-indent happy */
387 /* ifndef GNUNET_PROTOCOLS_CONVERSATION_H */
389 /* end of gnunet_protocols_conversation.h */