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 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.
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.
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/>.
20 * @file conversation/conversation.h
21 * @brief constants for network protocols
22 * @author Siomon Dieterle
23 * @author Andreas Fuchs
25 #ifndef CONVERSATION_H
26 #define CONVERSATION_H
31 #if 0 /* keep Emacsens' auto-indent happy */
37 #define MAX_TRANSMIT_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60)
41 * Highest bit in a 32-bit unsigned integer,
42 * bit set if we are making an outgoing call,
43 * bit unset for local lines.
45 #define HIGH_BIT ((uint32_t) (1LL << 31))
47 GNUNET_NETWORK_STRUCT_BEGIN
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;
78 uint32_t reserved GNUNET_PACKED;
81 * Phone line / CADET port to register.
83 struct GNUNET_HashCode line_port;
88 * Service -> Client message for phone is ringing.
90 struct ClientPhoneRingMessage
93 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RING
95 struct GNUNET_MessageHeader header;
98 * CID, internal caller ID number used in the future to identify
99 * which active call we are talking about.
101 uint32_t cid GNUNET_PACKED;
106 struct GNUNET_CRYPTO_EcdsaPublicKey caller_id;
112 * Service <-> Client message for phone was suspended.
114 struct ClientPhoneSuspendMessage
117 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_SUSPEND
119 struct GNUNET_MessageHeader header;
122 * CID, internal caller ID to identify which active call we are
125 uint32_t cid GNUNET_PACKED;
131 * Service <-> Client message for phone was resumed.
133 struct ClientPhoneResumeMessage
136 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RESUME
138 struct GNUNET_MessageHeader header;
141 * CID, internal caller ID to identify which active call we are
144 uint32_t cid GNUNET_PACKED;
150 * Client -> Service pick up phone that is ringing.
152 struct ClientPhonePickupMessage
155 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICK_UP
157 struct GNUNET_MessageHeader header;
160 * CID, internal caller ID to identify which active call we are
163 uint32_t cid GNUNET_PACKED;
169 * Client <-> Service hang up phone that may or may not be ringing.
170 * Also sent in response to a (failed) `struct ClientCallMessage`.
172 struct ClientPhoneHangupMessage
175 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP
177 struct GNUNET_MessageHeader header;
180 * CID, internal caller ID to identify which active call we are
183 uint32_t cid GNUNET_PACKED;
189 * Message Client <-> Service to transmit the audio.
191 struct ClientAudioMessage
194 * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO
196 struct GNUNET_MessageHeader header;
199 * CID, internal caller ID to identify which active call we are
202 uint32_t cid GNUNET_PACKED;
204 /* followed by audio data */
210 * Client -> Service message to call a phone.
212 struct ClientCallMessage
215 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_CALL
217 struct GNUNET_MessageHeader header;
222 uint32_t reserved GNUNET_PACKED;
225 * Which peer is hosting the line?
227 struct GNUNET_PeerIdentity target;
230 * Which phone line to call at the peer?
232 struct GNUNET_HashCode line_port;
235 * Identity of the caller.
237 struct GNUNET_CRYPTO_EcdsaPrivateKey caller_id;
242 * Service -> Client: other peer has picked up the phone, we are
245 struct ClientPhonePickedupMessage
248 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICKED_UP
250 struct GNUNET_MessageHeader header;
253 * Call ID of the corresponding
254 * #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_CALL
256 uint32_t cid GNUNET_PACKED;
262 * Information signed in a `struct CadetPhoneRingMessage`
263 * whereby the caller self-identifies to the receiver.
265 struct CadetPhoneRingInfoPS
268 * Purpose for the signature, must be
269 * #GNUNET_SIGNATURE_PURPOSE_CONVERSATION_RING.
271 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
274 * Which port did the call go to?
276 struct GNUNET_HashCode line_port;
279 * Which peer is the call for?
281 struct GNUNET_PeerIdentity target_peer;
284 * When does the signature expire?
286 struct GNUNET_TIME_AbsoluteNBO expiration_time;
291 * Cadet message to make a phone ring. Sent to the port
292 * of the respective phone.
294 struct CadetPhoneRingMessage
297 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RING
299 struct GNUNET_MessageHeader header;
304 uint32_t reserved GNUNET_PACKED;
307 * Who is calling us? (also who is signing).
309 struct GNUNET_CRYPTO_EcdsaPublicKey caller_id;
312 * When does the signature expire?
314 struct GNUNET_TIME_AbsoluteNBO expiration_time;
317 * Signature over a `struct CadetPhoneRingInfoPS`
319 struct GNUNET_CRYPTO_EcdsaSignature signature;
325 * Cadet message for hanging up.
327 struct CadetPhoneHangupMessage
330 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_HANG_UP
332 struct GNUNET_MessageHeader header;
338 * Cadet message for picking up.
340 struct CadetPhonePickupMessage
343 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_PICK_UP
345 struct GNUNET_MessageHeader header;
351 * Cadet message for phone suspended.
353 struct CadetPhoneSuspendMessage
356 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_SUSPEND
358 struct GNUNET_MessageHeader header;
364 * Cadet message for phone resumed.
366 struct CadetPhoneResumeMessage
369 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RESUME
371 struct GNUNET_MessageHeader header;
377 * Cadet message to transmit the audio.
379 struct CadetAudioMessage
382 * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_AUDIO
384 struct GNUNET_MessageHeader header;
386 /* followed by audio data */
391 GNUNET_NETWORK_STRUCT_END
394 #if 0 /* keep Emacsens' auto-indent happy */
401 /* ifndef GNUNET_PROTOCOLS_CONVERSATION_H */
403 /* end of gnunet_protocols_conversation.h */