diff options
Diffstat (limited to 'tinyMSRP/include/tinymsrp/session')
-rw-r--r-- | tinyMSRP/include/tinymsrp/session/tmsrp_config.h | 65 | ||||
-rw-r--r-- | tinyMSRP/include/tinymsrp/session/tmsrp_data.h | 93 | ||||
-rw-r--r-- | tinyMSRP/include/tinymsrp/session/tmsrp_receiver.h | 71 | ||||
-rw-r--r-- | tinyMSRP/include/tinymsrp/session/tmsrp_sender.h | 67 |
4 files changed, 296 insertions, 0 deletions
diff --git a/tinyMSRP/include/tinymsrp/session/tmsrp_config.h b/tinyMSRP/include/tinymsrp/session/tmsrp_config.h new file mode 100644 index 0000000..931f1f7 --- /dev/null +++ b/tinyMSRP/include/tinymsrp/session/tmsrp_config.h @@ -0,0 +1,65 @@ +/*
+* Copyright (C) 2009 Mamadou Diop.
+*
+* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
+*
+* This file is part of Open Source Doubango Framework.
+*
+* DOUBANGO is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* DOUBANGO is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with DOUBANGO.
+*
+*/
+
+/**@file tmsrp_media.h
+ * @brief MSRP Session config.
+ *
+ * @author Mamadou Diop <diopmamadou(at)doubango.org>
+ *
+ * @date Created: Sat Nov 8 16:54:58 2009 mdiop
+ */
+#ifndef TINYMSRP_CONFIG_H
+#define TINYMSRP_CONFIG_H
+
+#include "tinymsrp_config.h"
+
+#include "tinymsrp/headers/tmsrp_header_From-Path.h"
+#include "tinymsrp/headers/tmsrp_header_To-Path.h"
+
+#include "tsk_object.h"
+
+TMSRP_BEGIN_DECLS
+
+#ifndef TMSRP_MAX_CHUNK_SIZE
+# define TMSRP_MAX_CHUNK_SIZE 2048
+#endif
+
+typedef struct tmsrp_config_s
+{
+ TSK_DECLARE_OBJECT;
+
+ tmsrp_header_To_Path_t* To_Path;
+ tmsrp_header_From_Path_t* From_Path;
+
+ tsk_bool_t Failure_Report;
+ tsk_bool_t Success_Report;
+ tsk_bool_t OMA_Final_Report;
+}
+tmsrp_config_t;
+
+TINYMSRP_API tmsrp_config_t* tmsrp_config_create();
+
+TINYMSRP_GEXTERN const tsk_object_def_t *tmsrp_config_def_t;
+
+TMSRP_END_DECLS
+
+#endif /* TINYMSRP_CONFIG_H */
diff --git a/tinyMSRP/include/tinymsrp/session/tmsrp_data.h b/tinyMSRP/include/tinymsrp/session/tmsrp_data.h new file mode 100644 index 0000000..3864179 --- /dev/null +++ b/tinyMSRP/include/tinymsrp/session/tmsrp_data.h @@ -0,0 +1,93 @@ +/*
+* Copyright (C) 2009 Mamadou Diop.
+*
+* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
+*
+* This file is part of Open Source Doubango Framework.
+*
+* DOUBANGO is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* DOUBANGO is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with DOUBANGO.
+*
+*/
+
+/**@file tmsrp_data.h
+ * @brief MSRP input/output data.
+ *
+ * @author Mamadou Diop <diopmamadou(at)doubango.org>
+ *
+ * @date Created: Sat Nov 8 16:54:58 2009 mdiop
+ */
+#ifndef TINYMSRP_DATA_H
+#define TINYMSRP_DATA_H
+
+#include "tinymsrp_config.h"
+
+#include "tinymsrp/tmsrp_message.h"
+
+#include "tsk_buffer.h"
+
+TMSRP_BEGIN_DECLS
+
+#define TMSRP_DATA(self) ((tmsrp_data_t*)(self))
+#define TMSRP_DATA_IS_OUTGOING(self) (TMSRP_DATA(self)->outgoing)
+
+
+typedef struct tmsrp_data_s
+{
+ TSK_DECLARE_OBJECT;
+
+ tsk_bool_t outgoing;
+ tsk_bool_t isOK;
+
+ char* id;
+ char* ctype;
+ char* wctype;
+}
+tmsrp_data_t;
+
+#define TMSRP_DECLARE_DATA tmsrp_data_t data
+typedef tsk_list_t tmsrp_datas_L_t;
+
+typedef struct tmsrp_data_in_s
+{
+ TMSRP_DECLARE_DATA;
+
+ tsk_buffer_t* buffer;
+}
+tmsrp_data_in_t;
+
+int tmsrp_data_in_put(tmsrp_data_in_t* self, const void* pdata, tsk_size_t size);
+tmsrp_message_t* tmsrp_data_in_get(tmsrp_data_in_t* self);
+
+typedef struct tmsrp_data_out_s
+{
+ TMSRP_DECLARE_DATA;
+
+ FILE* file;
+ tsk_buffer_t* message;
+ tsk_size_t size; // File/message size
+}
+tmsrp_data_out_t;
+
+tmsrp_data_in_t* tmsrp_data_in_create();
+tmsrp_data_out_t* tmsrp_data_out_create(const void* pdata, tsk_size_t size);
+tmsrp_data_out_t* tmsrp_data_out_file_create(const char* filepath);
+
+tsk_buffer_t* tmsrp_data_out_get(tmsrp_data_out_t* self);
+
+TINYMSRP_GEXTERN const tsk_object_def_t *tmsrp_data_in_def_t;
+TINYMSRP_GEXTERN const tsk_object_def_t *tmsrp_data_out_def_t;
+
+TMSRP_END_DECLS
+
+#endif /* TINYMSRP_DATA_H */
diff --git a/tinyMSRP/include/tinymsrp/session/tmsrp_receiver.h b/tinyMSRP/include/tinymsrp/session/tmsrp_receiver.h new file mode 100644 index 0000000..fa7366a --- /dev/null +++ b/tinyMSRP/include/tinymsrp/session/tmsrp_receiver.h @@ -0,0 +1,71 @@ +/*
+* Copyright (C) 2009 Mamadou Diop.
+*
+* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
+*
+* This file is part of Open Source Doubango Framework.
+*
+* DOUBANGO is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* DOUBANGO is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with DOUBANGO.
+*
+*/
+
+/**@file tmsrp_receiver.h
+ * @brief MSRP receiver.
+ *
+ * @author Mamadou Diop <diopmamadou(at)doubango.org>
+ *
+ * @date Created: Sat Nov 8 16:54:58 2009 mdiop
+ */
+#ifndef TINYMSRP_RECEIVER_H
+#define TINYMSRP_RECEIVER_H
+
+#include "tinymsrp_config.h"
+
+#include "tinymsrp/session/tmsrp_data.h"
+#include "tinymsrp/session/tmsrp_config.h"
+
+#include "tinymsrp/tmsrp_event.h"
+
+#include "tnet_types.h"
+#include "tnet_transport.h"
+
+TMSRP_BEGIN_DECLS
+
+typedef struct tmsrp_receiver_s
+{
+ TSK_DECLARE_OBJECT;
+
+ tmsrp_data_in_t* data_in;
+ tmsrp_config_t* config;
+ tnet_fd_t fd;
+ tsk_buffer_t* buffer;
+
+ struct {
+ tmsrp_event_cb_f func;
+ const void* data;
+ } callback;
+}
+tmsrp_receiver_t;
+
+TINYMSRP_API tmsrp_receiver_t* tmsrp_receiver_create(tmsrp_config_t* config, tnet_fd_t fd);
+TINYMSRP_API int tmsrp_receiver_set_fd(tmsrp_receiver_t* self, tnet_fd_t fd);
+TINYMSRP_API int tmsrp_receiver_recv(tmsrp_receiver_t* self, const void* data, tsk_size_t size);
+TINYMSRP_API int tmsrp_receiver_start(tmsrp_receiver_t* self, const void* callback_data, tmsrp_event_cb_f func);
+TINYMSRP_API int tmsrp_receiver_stop(tmsrp_receiver_t* self);
+
+TINYMSRP_GEXTERN const tsk_object_def_t *tmsrp_receiver_def_t;
+
+TMSRP_END_DECLS
+
+#endif /* TINYMSRP_RECEIVER_H */
diff --git a/tinyMSRP/include/tinymsrp/session/tmsrp_sender.h b/tinyMSRP/include/tinymsrp/session/tmsrp_sender.h new file mode 100644 index 0000000..0ce0e27 --- /dev/null +++ b/tinyMSRP/include/tinymsrp/session/tmsrp_sender.h @@ -0,0 +1,67 @@ +/*
+* Copyright (C) 2009 Mamadou Diop.
+*
+* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
+*
+* This file is part of Open Source Doubango Framework.
+*
+* DOUBANGO is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* DOUBANGO is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with DOUBANGO.
+*
+*/
+
+/**@file tmsrp_sender.h
+ * @brief MSRP sender.
+ *
+ * @author Mamadou Diop <diopmamadou(at)doubango.org>
+ *
+ * @date Created: Sat Nov 8 16:54:58 2009 mdiop
+ */
+#ifndef TINYMSRP_SENDER_H
+#define TINYMSRP_SENDER_H
+
+#include "tinymsrp_config.h"
+
+#include "tinymsrp/session/tmsrp_data.h"
+#include "tinymsrp/session/tmsrp_config.h"
+
+#include "tnet_types.h"
+
+#include "tsk_runnable.h"
+
+TMSRP_BEGIN_DECLS
+
+typedef struct tmsrp_sender_s
+{
+ TSK_DECLARE_RUNNABLE;
+
+ tmsrp_datas_L_t* outgoingList;
+ tmsrp_config_t* config;
+ tnet_fd_t fd;
+ uint64_t chunck_duration;
+}
+tmsrp_sender_t;
+
+TINYMSRP_API tmsrp_sender_t* tmsrp_sender_create(tmsrp_config_t* config, tnet_fd_t fd);
+
+TINYMSRP_API int tmsrp_sender_set_fd(tmsrp_sender_t* self, tnet_fd_t fd);
+TINYMSRP_API int tmsrp_sender_start(tmsrp_sender_t* self);
+TINYMSRP_API int tsmrp_sender_send_data(tmsrp_sender_t* self, const void* data, tsk_size_t size, const char* ctype, const char* wctype);
+TINYMSRP_API int tsmrp_sender_send_file(tmsrp_sender_t* self, const char* filepath);
+TINYMSRP_API int tmsrp_sender_stop(tmsrp_sender_t* self);
+
+TINYMSRP_GEXTERN const tsk_object_def_t *tmsrp_sender_def_t;
+
+TMSRP_END_DECLS
+
+#endif /* TINYMSRP_SENDER_H */
|