-rps: merge duplicate functions
[oweals/gnunet.git] / src / conversation / conversation.h
index e2316984ad5a2a761dbd4ac3dba7b1a191d69fa0..aaeed1df3c82b127552641f29ba41ac32c17d57b 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2013 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2013 GNUnet e.V.
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -14,8 +14,8 @@
 
      You should have received a copy of the GNU General Public License
      along with GNUnet; see the file COPYING.  If not, write to the
-     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-     Boston, MA 02111-1307, USA.
+     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+     Boston, MA 02110-1301, USA.
 */
 
 /**
@@ -82,9 +82,10 @@ struct ClientPhoneRingMessage
   struct GNUNET_MessageHeader header;
 
   /**
-   * Always zero.
+   * CID, internal caller ID to identify which active call we are
+   * talking about.
    */
-  uint32_t reserved GNUNET_PACKED;
+  uint32_t cid GNUNET_PACKED;
 
   /**
    * Who is calling us?
@@ -95,15 +96,40 @@ struct ClientPhoneRingMessage
 
 
 /**
- * Service -> Client message for phone is busy.
+ * Service <-> Client message for phone was suspended.
  */
-struct ClientPhoneBusyMessage
+struct ClientPhoneSuspendMessage
 {
   /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_BUSY
+   * 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;
+
+};
+
+
+/**
+ * Service <-> Client message for phone was resumed.
+ */
+struct ClientPhoneResumeMessage
+{
+  /**
+   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RESUME
+   */
+  struct GNUNET_MessageHeader header;
+
+  /**
+   * CID, internal caller ID to identify which active call we are
+   * talking about.
+   */
+  uint32_t cid GNUNET_PACKED;
+
 };
 
 
@@ -117,7 +143,11 @@ struct ClientPhonePickupMessage
    */
   struct GNUNET_MessageHeader header;
 
-  /* followed by variable length 0-terminated string with meta data */
+  /**
+   * CID, internal caller ID to identify which active call we are
+   * talking about.
+   */
+  uint32_t cid GNUNET_PACKED;
 
 };
 
@@ -133,7 +163,11 @@ struct ClientPhoneHangupMessage
    */
   struct GNUNET_MessageHeader header;
 
-  /* followed by variable length 0-terminated string with meta data */
+  /**
+   * CID, internal caller ID to identify which active call we are
+   * talking about.
+   */
+  uint32_t cid GNUNET_PACKED;
 
 };
 
@@ -148,6 +182,12 @@ struct ClientAudioMessage
    */
   struct GNUNET_MessageHeader header;
 
+  /**
+   * CID, internal caller ID to identify which active call we are
+   * sending data to.
+   */
+  uint32_t cid GNUNET_PACKED;
+
   /* followed by audio data */
 
 };
@@ -191,18 +231,16 @@ struct ClientPhonePickedupMessage
    */
   struct GNUNET_MessageHeader header;
 
-  /* followed by variable length 0-terminated string with meta data */
-
 };
 
 
 /**
- * Mesh message for phone is ringing.
+ * Cadet message for phone is ringing.
  */
-struct MeshPhoneRingMessage
+struct CadetPhoneRingMessage
 {
   /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_RING
+   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RING
    */
   struct GNUNET_MessageHeader header;
 
@@ -250,40 +288,38 @@ struct MeshPhoneRingMessage
 
 
 /**
- * Mesh message for hanging up.
+ * Cadet message for hanging up.
  */
-struct MeshPhoneHangupMessage
+struct CadetPhoneHangupMessage
 {
   /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_HANG_UP
+   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_HANG_UP
    */
   struct GNUNET_MessageHeader header;
 
-  /* followed by variable-size 0-terminated reason string */
 };
 
 
 /**
- * Mesh message for picking up.
+ * Cadet message for picking up.
  */
-struct MeshPhonePickupMessage
+struct CadetPhonePickupMessage
 {
   /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_PICK_UP
+   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_PICK_UP
    */
   struct GNUNET_MessageHeader header;
 
-  /* followed by variable-size 0-terminated metadata string */
 };
 
 
 /**
- * Mesh message for phone busy.
+ * Cadet message for phone suspended.
  */
-struct MeshPhoneBusyMessage
+struct CadetPhoneSuspendMessage
 {
   /**
-   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_BUSY
+   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_SUSPEND
    */
   struct GNUNET_MessageHeader header;
 
@@ -291,19 +327,37 @@ struct MeshPhoneBusyMessage
 
 
 /**
- * Mesh message to transmit the audio.
+ * Cadet message for phone resumed.
  */
-struct MeshAudioMessage
+struct CadetPhoneResumeMessage
 {
   /**
-   * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_AUDIO
+   * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RESUME
+   */
+  struct GNUNET_MessageHeader header;
+
+};
+
+
+/**
+ * Cadet message to transmit the audio.
+ */
+struct CadetAudioMessage
+{
+  /**
+   * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_AUDIO
    */
   struct GNUNET_MessageHeader header;
 
   /**
    * Target line on the receiving end.
    */
-  uint32_t remote_line;
+  uint32_t remote_line GNUNET_PACKED;
+
+  /**
+   * The source line sending this data
+   */
+  uint32_t source_line GNUNET_PACKED;
 
   /* followed by audio data */