-fix build system issues
[oweals/gnunet.git] / src / conversation / conversation.h
index 12a62c1f7f0cf38ef37cba690cde933b9c137444..bc78400f1e83a323cd13d4ae91dd2dc0ac4f4851 100644 (file)
@@ -39,369 +39,332 @@ extern "C"
 #define MAX_TRANSMIT_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60)
 
 
-/************************************************************************************************************************
-* Messages for the Client <-> Server communication
-*/
-
-
 /**
- * VoipClient.
+ * Message to transmit the audio (between client and helpers).
  */
-struct VoipClient
+struct AudioMessage
 {
   /**
-   * Handle for a conversation client.
+   * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO
    */
-  struct GNUNET_SERVER_Client *client;
-};
-
-/**
-* The connection status of the service
-*/
-struct ConnectionStatus
-{
-       /**
-       * The client which is in interaction
-       */
-  struct GNUNET_SERVER_Client *client;
-
-       /**
-       * The PeerIdentity of the peer
-       */
-  struct GNUNET_PeerIdentity peer;
-
-       /**
-       * The status (see enum)
-       */
-  int status;
-};
-
-/**
-* Information about a missed call
-*/
-struct MissedCall
-{
-       /**
-       * The PeerIdentity of the peer
-       */
-  struct GNUNET_PeerIdentity peer;
+  struct GNUNET_MessageHeader header;
 
-       /**
-       * The time the call was
-       */
-  struct GNUNET_TIME_Absolute time;
+  /* followed by audio data */
 
 };
 
 
-
-
 /**
- * Client <-> Server message to initiate a new call
+ * Client -> Service message to register a phone.
  */
-struct ClientServerSessionInitiateMessage
+struct ClientPhoneRegisterMessage
 {
   /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_SESSION_INITIATE 
+   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_REGISTER
    */
   struct GNUNET_MessageHeader header;
-  struct GNUNET_PeerIdentity peer;
+
+  /**
+   * Phone line to register.
+   */
+  uint32_t line GNUNET_PACKED;
 };
 
 
 /**
- * Client <-> Server meessage to accept an incoming call
+ * Service -> Client message for phone is ringing.
  */
-struct ClientServerSessionAcceptMessage
+struct ClientPhoneRingMessage
 {
   /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_SESSION_ACCEPT 
+   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RING
    */
   struct GNUNET_MessageHeader header;
-};
 
+  /**
+   * CID, internal caller ID to identify which active call we are
+   * talking about.
+   */
+  uint32_t cid GNUNET_PACKED;
 
-/**
- * Client <-> Server message to reject an incoming call
- */
-struct ClientServerSessionRejectMessage
-{
   /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_SESSION_REJECT
+   * Who is calling us?
    */
-  struct GNUNET_MessageHeader header;
-  int reason;
+  struct GNUNET_CRYPTO_EcdsaPublicKey caller_id;
+
 };
 
 
 /**
- * Client <-> Server message to terminat a call
+ * Service <-> Client message for phone was suspended.
  */
-struct ClientServerSessionTerminateMessage
+struct ClientPhoneSuspendMessage
 {
   /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_SESSION_TERMINATE 
+   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_SUSPEND
    */
   struct GNUNET_MessageHeader header;
+
+  /**
+   * CID, internal caller ID to identify which active call we are
+   * talking about.
+   */
+  uint32_t cid GNUNET_PACKED;
+
 };
 
 
 /**
- * Client <-> Server message to initiate a new call
+ * Service <-> Client message for phone was resumed.
  */
-struct ClientServerTestMessage
+struct ClientPhoneResumeMessage
 {
   /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_TEST 
+   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RESUME
    */
   struct GNUNET_MessageHeader header;
-  struct GNUNET_PeerIdentity peer;
+
+  /**
+   * CID, internal caller ID to identify which active call we are
+   * talking about.
+   */
+  uint32_t cid GNUNET_PACKED;
+
 };
 
-/************************************************************************************************************************
-* Messages for the Server <-> Client communication
-*/
 
 /**
- * Server <-> Client message to initiate a new call
+ * Client -> Service pick up phone that is ringing.
  */
-struct ServerClientSessionInitiateMessage
+struct ClientPhonePickupMessage
 {
   /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_SESSION_INITIATE
+   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICK_UP
    */
   struct GNUNET_MessageHeader header;
-  struct GNUNET_PeerIdentity peer;
+
+  /**
+   * CID, internal caller ID to identify which active call we are
+   * talking about.
+   */
+  uint32_t cid GNUNET_PACKED;
+
 };
 
 
 /**
- * Server <-> Client meessage to accept an incoming call
+ * Client <-> Service hang up phone that may or may not be ringing.
+ * Also sent in response to a (failed) `struct ClientCallMessage`.
  */
-struct ServerClientSessionAcceptMessage
+struct ClientPhoneHangupMessage
 {
   /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_SESSION_ACCEPT 
+   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP
    */
   struct GNUNET_MessageHeader header;
+
+  /**
+   * CID, internal caller ID to identify which active call we are
+   * talking about.
+   */
+  uint32_t cid GNUNET_PACKED;
+
 };
 
 
 /**
- * Server <-> Client message to reject an incoming call
+ * Message Client <->Service to transmit the audio.
  */
-struct ServerClientSessionRejectMessage
+struct ClientAudioMessage
 {
   /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_SESSION_REJECT 
+   * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO
    */
   struct GNUNET_MessageHeader header;
-  int reason;
-  int notify;
+
+  /**
+   * CID, internal caller ID to identify which active call we are
+   * sending data to.
+   */
+  uint32_t cid GNUNET_PACKED;
+
+  /* followed by audio data */
+
 };
 
 
 /**
- * Server <-> Client message to terminat a call
+ * Client -> Service message to call a phone.
  */
-struct ServerClientSessionTerminateMessage
+struct ClientCallMessage
 {
   /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_SESSION_TERMINATE 
+   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_CALL
    */
   struct GNUNET_MessageHeader header;
-};
 
+  /**
+   * Which phone line to call at the peer?
+   */
+  uint32_t line GNUNET_PACKED;
 
-/**
- * Server <-> Client message to signalize the client that the service is already in use
- */
-struct ServerClientServiceBlockedMessage
-{
   /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_SERVICE_BLOCKED
+   * Which peer is hosting the line?
    */
-  struct GNUNET_MessageHeader header;
-};
+  struct GNUNET_PeerIdentity target;
 
-/**
- * Server <-> Client message to signalize the client that the called peer is not connected
- */
-struct ServerClientPeerNotConnectedMessage
-{
   /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_PEER_NOT_CONNECTED 
+   * Identity of the caller.
    */
-  struct GNUNET_MessageHeader header;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey caller_id;
 };
 
 
 /**
- * Server <-> Client message to signalize the client that called peer does not answer
+ * Service -> Client: other peer has picked up the phone, we are
+ * now talking.
  */
-struct ServerClientNoAnswerMessage
+struct ClientPhonePickedupMessage
 {
   /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_NO_ANSWER
+   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICKED_UP
    */
   struct GNUNET_MessageHeader header;
+
 };
 
+
 /**
- * Server <-> Client message to notify client of missed call
+ * Mesh message for phone is ringing.
  */
-struct ServerClientMissedCallMessage
+struct MeshPhoneRingMessage
 {
   /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_MISSED_CALL 
+   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_RING
    */
   struct GNUNET_MessageHeader header;
-  int number;
-  struct MissedCall *missed_call;
-};
 
+  /**
+   * Desired target line.
+   */
+  uint32_t remote_line GNUNET_PACKED;
 
-/**
- * Server <-> Client message to signalize the client that there occured an error
- */
-struct ServerClientErrorMessage
-{
   /**
-   * Type is: #define GNUNET_MESSAGE_TYPE_CONVERSATION_SC_ERROR 
+   * Purpose for the signature.
    */
-  struct GNUNET_MessageHeader header;
-};
+  struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
 
+  /**
+   * Who is calling us? (also who is signing).
+   */
+  struct GNUNET_CRYPTO_EcdsaPublicKey caller_id;
 
-/**
- * Server <-> Client message to notify client of peer being available
- */
-struct ServerClientPeerAvailableMessage
-{
   /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_PEER_AVAILABLE
+   * Who are we calling?
    */
-  struct GNUNET_MessageHeader header;
-  struct GNUNET_PeerIdentity peer;
-  struct GNUNET_TIME_Absolute time;
-};
+  struct GNUNET_PeerIdentity target;
 
-/************************************************************************************************************************
-* Messages for the Mesh communication
-*/
+  /**
+   * From where are we calling?
+   */
+  struct GNUNET_PeerIdentity source;
 
-struct VoIPMeshMessageHeader
-{
   /**
-   * Type is: 
+   * When does the signature expire?
    */
-  struct GNUNET_MessageHeader header;
-  int SequenceNumber;
-  struct GNUNET_TIME_Absolute time;
-};
+  struct GNUNET_TIME_AbsoluteNBO expiration_time;
 
+  /**
+   * Signature on the above.
+   */
+  struct GNUNET_CRYPTO_EcdsaSignature signature;
 
-/**
- * Mesh message to sinal the remote peer the wish to initiate a new call
- */
-struct MeshSessionInitiateMessage
-{
   /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_SESSION_INITIATE
+   * Source line for audio data in the other direction.
    */
-  struct GNUNET_MessageHeader header;
-  int SequenceNumber;
-  struct GNUNET_TIME_Absolute time;
-  struct GNUNET_PeerIdentity peer;
+  uint32_t source_line GNUNET_PACKED;
+
 };
 
+
 /**
- * Mesh message to signal the remote peer the acceptance of an initiated call
+ * Mesh message for hanging up.
  */
-struct MeshSessionAcceptMessage
+struct MeshPhoneHangupMessage
 {
   /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_SESSION_ACCEPT
+   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_HANG_UP
    */
   struct GNUNET_MessageHeader header;
-  int SequenceNumber;
-  struct GNUNET_TIME_Absolute time;
+
 };
 
 
 /**
- * Mesh message to reject an a wish to initiate a new call
+ * Mesh message for picking up.
  */
-struct MeshSessionRejectMessage
+struct MeshPhonePickupMessage
 {
   /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_SESSION_REJECT 
+   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_PICK_UP
    */
   struct GNUNET_MessageHeader header;
-  int SequenceNumber;
-  struct GNUNET_TIME_Absolute time;
-  int reason;
-  int notify;
+
 };
 
 
 /**
- * Mesh message to signal a remote peer the terminatation of a call
+ * Mesh message for phone suspended.
  */
-struct MeshSessionTerminateMessage
+struct MeshPhoneSuspendMessage
 {
   /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_SESSION_TERMINATE 
+   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_SUSPEND
    */
   struct GNUNET_MessageHeader header;
-  int SequenceNumber;
-  struct GNUNET_TIME_Absolute time;
+
 };
 
 
 /**
- * Server <-> Client message to notify client of peer being available
+ * Mesh message for phone resumed.
  */
-struct MeshPeerAvailableMessage
+struct MeshPhoneResumeMessage
 {
   /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PEER_AVAILABLE 
+   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_RESUME
    */
   struct GNUNET_MessageHeader header;
-  int SequenceNumber;
-  struct GNUNET_TIME_Absolute time;
-  struct GNUNET_PeerIdentity peer;
-  struct GNUNET_TIME_Absolute call;
+
 };
 
 
 /**
- * Messages for the audio communication
+ * Mesh message to transmit the audio.
  */
-struct TestMessage
+struct MeshAudioMessage
 {
   /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_TEST 
+   * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_AUDIO
    */
   struct GNUNET_MessageHeader header;
-};
 
+  /**
+   * Target line on the receiving end.
+   */
+  uint32_t remote_line GNUNET_PACKED;
 
-/**
- * Message to transmit the audio
- */
-struct AudioMessage
-{
   /**
-   * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO
+   * The source line sending this data
    */
-  struct GNUNET_MessageHeader header;
+  uint32_t source_line GNUNET_PACKED;
 
   /* followed by audio data */
 
 };
 
 
+
 #if 0                          /* keep Emacsens' auto-indent happy */
 {
 #endif