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;
60 * The connection status of the service
62 struct ConnectionStatus
65 * The client which is in interaction
67 struct GNUNET_SERVER_Client *client;
70 * The PeerIdentity of the peer
72 struct GNUNET_PeerIdentity peer;
75 * The status (see enum)
81 * Information about a missed call
86 * The PeerIdentity of the peer
88 struct GNUNET_PeerIdentity peer;
91 * The time the call was
93 struct GNUNET_TIME_Absolute time;
101 * Client <-> Server message to initiate a new call
103 struct ClientServerSessionInitiateMessage
106 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_SESSION_INITIATE
108 struct GNUNET_MessageHeader header;
109 struct GNUNET_PeerIdentity peer;
114 * Client <-> Server meessage to accept an incoming call
116 struct ClientServerSessionAcceptMessage
119 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_SESSION_ACCEPT
121 struct GNUNET_MessageHeader header;
126 * Client <-> Server message to reject an incoming call
128 struct ClientServerSessionRejectMessage
131 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_SESSION_REJECT
133 struct GNUNET_MessageHeader header;
139 * Client <-> Server message to terminat a call
141 struct ClientServerSessionTerminateMessage
144 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_SESSION_TERMINATE
146 struct GNUNET_MessageHeader header;
151 * Client <-> Server message to initiate a new call
153 struct ClientServerTestMessage
156 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_TEST
158 struct GNUNET_MessageHeader header;
159 struct GNUNET_PeerIdentity peer;
162 /************************************************************************************************************************
163 * Messages for the Server <-> Client communication
167 * Server <-> Client message to initiate a new call
169 struct ServerClientSessionInitiateMessage
172 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_SESSION_INITIATE
174 struct GNUNET_MessageHeader header;
175 struct GNUNET_PeerIdentity peer;
180 * Server <-> Client meessage to accept an incoming call
182 struct ServerClientSessionAcceptMessage
185 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_SESSION_ACCEPT
187 struct GNUNET_MessageHeader header;
192 * Server <-> Client message to reject an incoming call
194 struct ServerClientSessionRejectMessage
197 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_SESSION_REJECT
199 struct GNUNET_MessageHeader header;
206 * Server <-> Client message to terminat a call
208 struct ServerClientSessionTerminateMessage
211 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_SESSION_TERMINATE
213 struct GNUNET_MessageHeader header;
218 * Server <-> Client message to signalize the client that the service is already in use
220 struct ServerClientServiceBlockedMessage
223 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_SERVICE_BLOCKED
225 struct GNUNET_MessageHeader header;
229 * Server <-> Client message to signalize the client that the called peer is not connected
231 struct ServerClientPeerNotConnectedMessage
234 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_PEER_NOT_CONNECTED
236 struct GNUNET_MessageHeader header;
241 * Server <-> Client message to signalize the client that called peer does not answer
243 struct ServerClientNoAnswerMessage
246 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_NO_ANSWER
248 struct GNUNET_MessageHeader header;
252 * Server <-> Client message to notify client of missed call
254 struct ServerClientMissedCallMessage
257 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_MISSED_CALL
259 struct GNUNET_MessageHeader header;
261 struct MissedCall *missed_call;
266 * Server <-> Client message to signalize the client that there occured an error
268 struct ServerClientErrorMessage
271 * Type is: #define GNUNET_MESSAGE_TYPE_CONVERSATION_SC_ERROR
273 struct GNUNET_MessageHeader header;
278 * Server <-> Client message to notify client of peer being available
280 struct ServerClientPeerAvailableMessage
283 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_PEER_AVAILABLE
285 struct GNUNET_MessageHeader header;
286 struct GNUNET_PeerIdentity peer;
287 struct GNUNET_TIME_Absolute time;
290 /************************************************************************************************************************
291 * Messages for the Mesh communication
294 struct VoIPMeshMessageHeader
299 struct GNUNET_MessageHeader header;
301 struct GNUNET_TIME_Absolute time;
306 * Mesh message to sinal the remote peer the wish to initiate a new call
308 struct MeshSessionInitiateMessage
311 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_SESSION_INITIATE
313 struct GNUNET_MessageHeader header;
315 struct GNUNET_TIME_Absolute time;
316 struct GNUNET_PeerIdentity peer;
320 * Mesh message to signal the remote peer the acceptance of an initiated call
322 struct MeshSessionAcceptMessage
325 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_SESSION_ACCEPT
327 struct GNUNET_MessageHeader header;
329 struct GNUNET_TIME_Absolute time;
334 * Mesh message to reject an a wish to initiate a new call
336 struct MeshSessionRejectMessage
339 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_SESSION_REJECT
341 struct GNUNET_MessageHeader header;
343 struct GNUNET_TIME_Absolute time;
350 * Mesh message to signal a remote peer the terminatation of a call
352 struct MeshSessionTerminateMessage
355 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_SESSION_TERMINATE
357 struct GNUNET_MessageHeader header;
359 struct GNUNET_TIME_Absolute time;
364 * Server <-> Client message to notify client of peer being available
366 struct MeshPeerAvailableMessage
369 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PEER_AVAILABLE
371 struct GNUNET_MessageHeader header;
373 struct GNUNET_TIME_Absolute time;
374 struct GNUNET_PeerIdentity peer;
375 struct GNUNET_TIME_Absolute call;
380 * Messages for the audio communication
385 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_TEST
387 struct GNUNET_MessageHeader header;
390 ////////////////////////////////////////////////////////////
393 * Message to transmit the audio (between client and helpers).
398 * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO
400 struct GNUNET_MessageHeader header;
402 /* followed by audio data */
408 * Client -> Service message to register a phone.
410 struct ClientPhoneRegisterMessage
413 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_REGISTER
415 struct GNUNET_MessageHeader header;
418 * Phone line to register.
420 uint32_t line GNUNET_PACKED;
425 * Service -> Client message for phone is ringing.
427 struct ClientPhoneRingMessage
430 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RING
432 struct GNUNET_MessageHeader header;
437 uint32_t reserved GNUNET_PACKED;
442 struct GNUNET_CRYPTO_EccPublicSignKey caller_id;
448 * Service -> Client message for phone is busy.
450 struct ClientPhoneBusyMessage
453 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_BUSY
455 struct GNUNET_MessageHeader header;
461 * Client -> Service pick up phone that is ringing.
463 struct ClientPhonePickupMessage
466 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICK_UP
468 struct GNUNET_MessageHeader header;
470 /* followed by variable length 0-terminated string with meta data */
476 * Client <-> Service hang up phone that may or may not be ringing.
477 * Also sent in response to a (failed) `struct ClientCallMessage`.
479 struct ClientPhoneHangupMessage
482 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP
484 struct GNUNET_MessageHeader header;
486 /* followed by variable length 0-terminated string with meta data */
492 * Message Client <->Service to transmit the audio.
494 struct ClientAudioMessage
497 * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO
499 struct GNUNET_MessageHeader header;
501 /* followed by audio data */
507 * Client -> Service message to call a phone.
509 struct ClientCallMessage
512 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_CALL
514 struct GNUNET_MessageHeader header;
517 * Which phone line to call at the peer?
519 uint32_t line GNUNET_PACKED;
522 * Which peer is hosting the line?
524 struct GNUNET_PeerIdentity target;
527 * Identity of the caller.
529 struct GNUNET_CRYPTO_EccPrivateKey caller_id;
534 * Service -> Client: other peer has picked up the phone, we are
537 struct ClientPhonePickedupMessage
540 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICKED_UP
542 struct GNUNET_MessageHeader header;
544 /* followed by variable length 0-terminated string with meta data */
550 * Mesh message for phone is ringing.
552 struct MeshPhoneRingMessage
555 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_RING
557 struct GNUNET_MessageHeader header;
560 * Desired target line.
562 uint32_t remote_line GNUNET_PACKED;
565 * Purpose for the signature.
567 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
570 * Who is calling us? (also who is signing).
572 struct GNUNET_CRYPTO_EccPublicSignKey caller_id;
575 * Who are we calling?
577 struct GNUNET_PeerIdentity target;
580 * From where are we calling?
582 struct GNUNET_PeerIdentity source;
585 * When does the signature expire?
587 struct GNUNET_TIME_AbsoluteNBO expiration_time;
590 * Signature on the above.
592 struct GNUNET_CRYPTO_EccSignature signature;
595 * Source line for audio data in the other direction.
597 uint32_t source_line GNUNET_PACKED;
603 * Mesh message for hanging up.
605 struct MeshPhoneHangupMessage
608 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_HANG_UP
610 struct GNUNET_MessageHeader header;
612 /* followed by variable-size 0-terminated reason string */
617 * Mesh message for picking up.
619 struct MeshPhonePickupMessage
622 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_PICK_UP
624 struct GNUNET_MessageHeader header;
626 /* followed by variable-size 0-terminated metadata string */
631 * Mesh message for phone busy.
633 struct MeshPhoneBusyMessage
636 * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_BUSY
638 struct GNUNET_MessageHeader header;
644 * Mesh message to transmit the audio.
646 struct MeshAudioMessage
649 * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_AUDIO
651 struct GNUNET_MessageHeader header;
654 * Target line on the receiving end.
656 uint32_t remote_line;
658 /* followed by audio data */
664 #if 0 /* keep Emacsens' auto-indent happy */
671 /* ifndef GNUNET_PROTOCOLS_CONVERSATION_H */
673 /* end of gnunet_protocols_conversation.h */