2 This file is part of GNUnet.
3 (C) 2013 Christian Grothoff (and other contributing authors)
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., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, 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)
42 /************************************************************************************************************************
43 * Messages for the Client <-> Server communication
53 * Handle for a conversation client.
55 struct GNUNET_SERVER_Client *client;
59 * The connection status of the service
61 struct ConnectionStatus
64 * The client which is in interaction
66 struct GNUNET_SERVER_Client *client;
69 * The PeerIdentity of the peer
71 struct GNUNET_PeerIdentity peer;
74 * The status (see enum)
80 * Information about a missed call
85 * The PeerIdentity of the peer
87 struct GNUNET_PeerIdentity peer;
90 * The time the call was
92 struct GNUNET_TIME_Absolute time;
100 * Client <-> Server message to initiate a new call
102 struct ClientServerSessionInitiateMessage
105 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_SESSION_INITIATE
107 struct GNUNET_MessageHeader header;
108 struct GNUNET_PeerIdentity peer;
113 * Client <-> Server meessage to accept an incoming call
115 struct ClientServerSessionAcceptMessage
118 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_SESSION_ACCEPT
120 struct GNUNET_MessageHeader header;
125 * Client <-> Server message to reject an incoming call
127 struct ClientServerSessionRejectMessage
130 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_SESSION_REJECT
132 struct GNUNET_MessageHeader header;
138 * Client <-> Server message to terminat a call
140 struct ClientServerSessionTerminateMessage
143 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_SESSION_TERMINATE
145 struct GNUNET_MessageHeader header;
150 * Client <-> Server message to initiate a new call
152 struct ClientServerTestMessage
155 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_TEST
157 struct GNUNET_MessageHeader header;
158 struct GNUNET_PeerIdentity peer;
161 /************************************************************************************************************************
162 * Messages for the Server <-> Client communication
166 * Server <-> Client message to initiate a new call
168 struct ServerClientSessionInitiateMessage
171 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_SESSION_INITIATE
173 struct GNUNET_MessageHeader header;
174 struct GNUNET_PeerIdentity peer;
179 * Server <-> Client meessage to accept an incoming call
181 struct ServerClientSessionAcceptMessage
184 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_SESSION_ACCEPT
186 struct GNUNET_MessageHeader header;
191 * Server <-> Client message to reject an incoming call
193 struct ServerClientSessionRejectMessage
196 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_SESSION_REJECT
198 struct GNUNET_MessageHeader header;
205 * Server <-> Client message to terminat a call
207 struct ServerClientSessionTerminateMessage
210 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_SESSION_TERMINATE
212 struct GNUNET_MessageHeader header;
217 * Server <-> Client message to signalize the client that the service is already in use
219 struct ServerClientServiceBlockedMessage
222 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_SERVICE_BLOCKED
224 struct GNUNET_MessageHeader header;
228 * Server <-> Client message to signalize the client that the called peer is not connected
230 struct ServerClientPeerNotConnectedMessage
233 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_PEER_NOT_CONNECTED
235 struct GNUNET_MessageHeader header;
240 * Server <-> Client message to signalize the client that called peer does not answer
242 struct ServerClientNoAnswerMessage
245 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_NO_ANSWER
247 struct GNUNET_MessageHeader header;
251 * Server <-> Client message to notify client of missed call
253 struct ServerClientMissedCallMessage
256 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_MISSED_CALL
258 struct GNUNET_MessageHeader header;
260 struct MissedCall *missed_call;
265 * Server <-> Client message to signalize the client that there occured an error
267 struct ServerClientErrorMessage
270 * Type is: #define GNUNET_MESSAGE_TYPE_CONVERSATION_SC_ERROR
272 struct GNUNET_MessageHeader header;
277 * Server <-> Client message to notify client of peer being available
279 struct ServerClientPeerAvailableMessage
282 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_PEER_AVAILABLE
284 struct GNUNET_MessageHeader header;
285 struct GNUNET_PeerIdentity peer;
286 struct GNUNET_TIME_Absolute time;
289 /************************************************************************************************************************
290 * Messages for the Mesh communication
293 struct VoIPMeshMessageHeader
298 struct GNUNET_MessageHeader header;
300 struct GNUNET_TIME_Absolute time;
305 * Mesh message to sinal the remote peer the wish to initiate a new call
307 struct MeshSessionInitiateMessage
310 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_SESSION_INITIATE
312 struct GNUNET_MessageHeader header;
314 struct GNUNET_TIME_Absolute time;
315 struct GNUNET_PeerIdentity peer;
319 * Mesh message to signal the remote peer the acceptance of an initiated call
321 struct MeshSessionAcceptMessage
324 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_SESSION_ACCEPT
326 struct GNUNET_MessageHeader header;
328 struct GNUNET_TIME_Absolute time;
333 * Mesh message to reject an a wish to initiate a new call
335 struct MeshSessionRejectMessage
338 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_SESSION_REJECT
340 struct GNUNET_MessageHeader header;
342 struct GNUNET_TIME_Absolute time;
349 * Mesh message to signal a remote peer the terminatation of a call
351 struct MeshSessionTerminateMessage
354 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_SESSION_TERMINATE
356 struct GNUNET_MessageHeader header;
358 struct GNUNET_TIME_Absolute time;
363 * Server <-> Client message to notify client of peer being available
365 struct MeshPeerAvailableMessage
368 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PEER_AVAILABLE
370 struct GNUNET_MessageHeader header;
372 struct GNUNET_TIME_Absolute time;
373 struct GNUNET_PeerIdentity peer;
374 struct GNUNET_TIME_Absolute call;
379 * Messages for the audio communication
384 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_TEST
386 struct GNUNET_MessageHeader header;
389 ////////////////////////////////////////////////////////////
392 * Message to transmit the audio (between client and helpers).
397 * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO
399 struct GNUNET_MessageHeader header;
401 /* followed by audio data */
407 * Client -> Service message to register a phone.
409 struct ClientPhoneRegisterMessage
412 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_REGISTER
414 struct GNUNET_MessageHeader header;
417 * Phone line to register.
419 uint32_t line GNUNET_PACKED;
424 * Service -> Client message for phone is ringing.
426 struct ClientPhoneRingMessage
429 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RING
431 struct GNUNET_MessageHeader header;
436 uint32_t reserved GNUNET_PACKED;
441 struct GNUNET_CRYPTO_EccPublicSignKey caller_id;
447 * Service -> Client message for phone is busy.
449 struct ClientPhoneBusyMessage
452 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_BUSY
454 struct GNUNET_MessageHeader header;
460 * Client -> Service pick up phone that is ringing.
462 struct ClientPhonePickupMessage
465 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICK_UP
467 struct GNUNET_MessageHeader header;
469 /* followed by variable length 0-terminated string with meta data */
475 * Client <-> Service hang up phone that may or may not be ringing.
476 * Also sent in response to a (failed) `struct ClientCallMessage`.
478 struct ClientPhoneHangupMessage
481 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP
483 struct GNUNET_MessageHeader header;
485 /* followed by variable length 0-terminated string with meta data */
491 * Message Client <->Service to transmit the audio.
493 struct ClientAudioMessage
496 * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO
498 struct GNUNET_MessageHeader header;
500 /* followed by audio data */
506 * Client -> Service message to call a phone.
508 struct ClientCallMessage
511 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_CALL
513 struct GNUNET_MessageHeader header;
516 * Which phone line to call at the peer?
518 uint32_t line GNUNET_PACKED;
521 * Which peer is hosting the line?
523 struct GNUNET_PeerIdentity target;
526 * Identity of the caller.
528 struct GNUNET_CRYPTO_EccPrivateKey caller_id;
533 * Service -> Client: other peer has picked up the phone, we are
536 struct ClientPhonePickedupMessage
539 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICKED_UP
541 struct GNUNET_MessageHeader header;
543 /* followed by variable length 0-terminated string with meta data */
549 * Mesh message for phone is ringing.
551 struct MeshPhoneRingMessage
554 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_RING
556 struct GNUNET_MessageHeader header;
559 * Desired target line.
561 uint32_t line GNUNET_PACKED;
564 * Purpose for the signature.
566 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
569 * Who is calling us? (also who is signing).
571 struct GNUNET_CRYPTO_EccPublicSignKey caller_id;
574 * Who are we calling?
576 struct GNUNET_PeerIdentity target;
579 * From where are we calling?
581 struct GNUNET_PeerIdentity source;
584 * When does the signature expire?
586 struct GNUNET_TIME_AbsoluteNBO expiration_time;
589 * Signature on the above.
591 struct GNUNET_CRYPTO_EccSignature signature;
597 * Mesh message for hanging up.
599 struct MeshPhoneHangupMessage
602 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_HANG_UP
604 struct GNUNET_MessageHeader header;
606 /* followed by variable-size 0-terminated reason string */
611 * Mesh message for picking up.
613 struct MeshPhonePickupMessage
616 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_PICK_UP
618 struct GNUNET_MessageHeader header;
620 /* followed by variable-size 0-terminated metadata string */
625 * Mesh message for phone busy.
627 struct MeshPhoneBusyMessage
630 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_BUSY
632 struct GNUNET_MessageHeader header;
638 * Mesh message to transmit the audio.
640 struct MeshAudioMessage
643 * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_AUDIO
645 struct GNUNET_MessageHeader header;
647 /* followed by audio data */
653 #if 0 /* keep Emacsens' auto-indent happy */
660 /* ifndef GNUNET_PROTOCOLS_CONVERSATION_H */
662 /* end of gnunet_protocols_conversation.h */