#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;
-};
-
-/**
- * Client <-> Server meessage to accept an incoming call
- */
-struct ClientServerSessionAcceptMessage
-{
/**
- * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_SESSION_ACCEPT
+ * Phone line to register.
*/
- struct GNUNET_MessageHeader header;
+ uint32_t line GNUNET_PACKED;
};
/**
- * Client <-> Server message to reject an incoming call
+ * Service -> Client message for phone is ringing.
*/
-struct ClientServerSessionRejectMessage
+struct ClientPhoneRingMessage
{
/**
- * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_SESSION_REJECT
+ * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RING
*/
struct GNUNET_MessageHeader header;
- int reason;
-};
+ /**
+ * Always zero.
+ */
+ uint32_t reserved GNUNET_PACKED;
-/**
- * Client <-> Server message to terminat a call
- */
-struct ClientServerSessionTerminateMessage
-{
/**
- * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_SESSION_TERMINATE
+ * Who is calling us?
*/
- struct GNUNET_MessageHeader header;
+ struct GNUNET_CRYPTO_EccPublicSignKey caller_id;
+
};
/**
- * Client <-> Server message to initiate a new call
+ * Service -> Client message for phone is busy.
*/
-struct ClientServerTestMessage
+struct ClientPhoneBusyMessage
{
/**
- * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_TEST
+ * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_BUSY
*/
struct GNUNET_MessageHeader header;
- struct GNUNET_PeerIdentity peer;
+
};
-/************************************************************************************************************************
-* 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;
+
+ /* followed by variable length 0-terminated string with meta data */
+
};
/**
- * 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;
+
+ /* followed by variable length 0-terminated string with meta data */
+
};
/**
- * 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;
+
+ /* 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_EccPrivateKey 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;
+
+ /* followed by variable length 0-terminated string with meta data */
+
};
+
/**
- * 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;
-};
-
-/**
- * Server <-> Client message to signalize the client that there occured an error
- */
-struct ServerClientErrorMessage
-{
/**
- * Type is: #define GNUNET_MESSAGE_TYPE_CONVERSATION_SC_ERROR
+ * Desired target line.
*/
- struct GNUNET_MessageHeader header;
-};
+ uint32_t remote_line GNUNET_PACKED;
+ /**
+ * Purpose for the signature.
+ */
+ struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
-/**
- * Server <-> Client message to notify client of peer being available
- */
-struct ServerClientPeerAvailableMessage
-{
/**
- * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_SC_PEER_AVAILABLE
+ * Who is calling us? (also who is signing).
*/
- struct GNUNET_MessageHeader header;
- struct GNUNET_PeerIdentity peer;
- struct GNUNET_TIME_Absolute time;
-};
+ struct GNUNET_CRYPTO_EccPublicSignKey caller_id;
-/************************************************************************************************************************
-* Messages for the Mesh communication
-*/
+ /**
+ * Who are we calling?
+ */
+ struct GNUNET_PeerIdentity target;
-struct VoIPMeshMessageHeader
-{
/**
- * Type is:
+ * From where are we calling?
*/
- struct GNUNET_MessageHeader header;
- int SequenceNumber;
- struct GNUNET_TIME_Absolute time;
-};
+ struct GNUNET_PeerIdentity source;
+ /**
+ * When does the signature expire?
+ */
+ struct GNUNET_TIME_AbsoluteNBO expiration_time;
-/**
- * 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
+ * Signature on the above.
*/
- struct GNUNET_MessageHeader header;
- int SequenceNumber;
- struct GNUNET_TIME_Absolute time;
- struct GNUNET_PeerIdentity peer;
-};
+ struct GNUNET_CRYPTO_EccSignature signature;
-/**
- * Mesh message to signal the remote peer the acceptance of an initiated call
- */
-struct MeshSessionAcceptMessage
-{
/**
- * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_SESSION_ACCEPT
+ * Source line for audio data in the other direction.
*/
- struct GNUNET_MessageHeader header;
- int SequenceNumber;
- struct GNUNET_TIME_Absolute time;
+ uint32_t source_line GNUNET_PACKED;
+
};
/**
- * Mesh message to reject an a wish to initiate a new call
+ * Mesh message for hanging up.
*/
-struct MeshSessionRejectMessage
+struct MeshPhoneHangupMessage
{
/**
- * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_SESSION_REJECT
+ * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_HANG_UP
*/
struct GNUNET_MessageHeader header;
- int SequenceNumber;
- struct GNUNET_TIME_Absolute time;
- int reason;
- int notify;
+
+ /* followed by variable-size 0-terminated reason string */
};
/**
- * Mesh message to signal a remote peer the terminatation of a call
+ * Mesh message for picking up.
*/
-struct MeshSessionTerminateMessage
+struct MeshPhonePickupMessage
{
/**
- * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_SESSION_TERMINATE
+ * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_PICK_UP
*/
struct GNUNET_MessageHeader header;
- int SequenceNumber;
- struct GNUNET_TIME_Absolute time;
+
+ /* followed by variable-size 0-terminated metadata string */
};
/**
- * Server <-> Client message to notify client of peer being available
+ * Mesh message for phone busy.
*/
-struct MeshPeerAvailableMessage
+struct MeshPhoneBusyMessage
{
/**
- * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PEER_AVAILABLE
+ * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_BUSY
*/
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;
-};
-
-/**
- * Message to transmit the audio
- */
-struct AudioMessage
-{
/**
- * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO
+ * Target line on the receiving end.
*/
- struct GNUNET_MessageHeader header;
- int32_t SequenceNumber;
- struct GNUNET_TIME_Absolute time;
- int32_t length;
- int32_t encrypted;
- uint8_t audio[200];
+ uint32_t remote_line;
+
+ /* followed by audio data */
};
+
#if 0 /* keep Emacsens' auto-indent happy */
{
#endif