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/>.
18 SPDX-License-Identifier: AGPL3.0-or-later
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 ( \
40 GNUNET_TIME_UNIT_SECONDS, 60)
44 * Highest bit in a 32-bit unsigned integer,
45 * bit set if we are making an outgoing call,
46 * bit unset for local lines.
48 #define HIGH_BIT ((uint32_t) (1LL << 31))
50 GNUNET_NETWORK_STRUCT_BEGIN
54 * Message to transmit the audio (between client and helpers).
59 * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO
61 struct GNUNET_MessageHeader header;
63 /* 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;
113 * Service <-> Client message for phone was suspended.
115 struct ClientPhoneSuspendMessage
118 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_SUSPEND
120 struct GNUNET_MessageHeader header;
123 * CID, internal caller ID to identify which active call we are
126 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;
149 * Client -> Service pick up phone that is ringing.
151 struct ClientPhonePickupMessage
154 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICK_UP
156 struct GNUNET_MessageHeader header;
159 * CID, internal caller ID to identify which active call we are
162 uint32_t cid GNUNET_PACKED;
167 * Client <-> Service hang up phone that may or may not be ringing.
168 * Also sent in response to a (failed) `struct ClientCallMessage`.
170 struct ClientPhoneHangupMessage
173 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP
175 struct GNUNET_MessageHeader header;
178 * CID, internal caller ID to identify which active call we are
181 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 */
206 * Client -> Service message to call a phone.
208 struct ClientCallMessage
211 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_CALL
213 struct GNUNET_MessageHeader header;
218 uint32_t reserved GNUNET_PACKED;
221 * Which peer is hosting the line?
223 struct GNUNET_PeerIdentity target;
226 * Which phone line to call at the peer?
228 struct GNUNET_HashCode line_port;
231 * Identity of the caller.
233 struct GNUNET_CRYPTO_EcdsaPrivateKey caller_id;
238 * Service -> Client: other peer has picked up the phone, we are
241 struct ClientPhonePickedupMessage
244 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICKED_UP
246 struct GNUNET_MessageHeader header;
249 * Call ID of the corresponding
250 * #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_CALL
252 uint32_t cid GNUNET_PACKED;
257 * Information signed in a `struct CadetPhoneRingMessage`
258 * whereby the caller self-identifies to the receiver.
260 struct CadetPhoneRingInfoPS
263 * Purpose for the signature, must be
264 * #GNUNET_SIGNATURE_PURPOSE_CONVERSATION_RING.
266 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
269 * Which port did the call go to?
271 struct GNUNET_HashCode line_port;
274 * Which peer is the call for?
276 struct GNUNET_PeerIdentity target_peer;
279 * When does the signature expire?
281 struct GNUNET_TIME_AbsoluteNBO expiration_time;
286 * Cadet message to make a phone ring. Sent to the port
287 * of the respective phone.
289 struct CadetPhoneRingMessage
292 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RING
294 struct GNUNET_MessageHeader header;
299 uint32_t reserved GNUNET_PACKED;
302 * Who is calling us? (also who is signing).
304 struct GNUNET_CRYPTO_EcdsaPublicKey caller_id;
307 * When does the signature expire?
309 struct GNUNET_TIME_AbsoluteNBO expiration_time;
312 * Signature over a `struct CadetPhoneRingInfoPS`
314 struct GNUNET_CRYPTO_EcdsaSignature signature;
319 * Cadet message for hanging up.
321 struct CadetPhoneHangupMessage
324 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_HANG_UP
326 struct GNUNET_MessageHeader header;
331 * Cadet message for picking up.
333 struct CadetPhonePickupMessage
336 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_PICK_UP
338 struct GNUNET_MessageHeader header;
343 * Cadet message for phone suspended.
345 struct CadetPhoneSuspendMessage
348 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_SUSPEND
350 struct GNUNET_MessageHeader header;
355 * Cadet message for phone resumed.
357 struct CadetPhoneResumeMessage
360 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RESUME
362 struct GNUNET_MessageHeader header;
367 * Cadet message to transmit the audio.
369 struct CadetAudioMessage
372 * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_AUDIO
374 struct GNUNET_MessageHeader header;
376 /* followed by audio data */
380 GNUNET_NETWORK_STRUCT_END
383 #if 0 /* keep Emacsens' auto-indent happy */
390 /* ifndef GNUNET_PROTOCOLS_CONVERSATION_H */
392 /* end of gnunet_protocols_conversation.h */