summaryrefslogtreecommitdiffstats
path: root/tinySDP/include/tinysdp/headers
diff options
context:
space:
mode:
Diffstat (limited to 'tinySDP/include/tinysdp/headers')
-rw-r--r--tinySDP/include/tinysdp/headers/tsdp_header.h124
-rw-r--r--tinySDP/include/tinysdp/headers/tsdp_header_A.h75
-rw-r--r--tinySDP/include/tinysdp/headers/tsdp_header_B.h72
-rw-r--r--tinySDP/include/tinysdp/headers/tsdp_header_C.h76
-rw-r--r--tinySDP/include/tinysdp/headers/tsdp_header_Dummy.h68
-rw-r--r--tinySDP/include/tinysdp/headers/tsdp_header_E.h71
-rw-r--r--tinySDP/include/tinysdp/headers/tsdp_header_I.h67
-rw-r--r--tinySDP/include/tinysdp/headers/tsdp_header_K.h73
-rw-r--r--tinySDP/include/tinysdp/headers/tsdp_header_M.h124
-rw-r--r--tinySDP/include/tinysdp/headers/tsdp_header_O.h119
-rw-r--r--tinySDP/include/tinysdp/headers/tsdp_header_P.h71
-rw-r--r--tinySDP/include/tinysdp/headers/tsdp_header_R.h77
-rw-r--r--tinySDP/include/tinysdp/headers/tsdp_header_S.h65
-rw-r--r--tinySDP/include/tinysdp/headers/tsdp_header_T.h81
-rw-r--r--tinySDP/include/tinysdp/headers/tsdp_header_U.h67
-rw-r--r--tinySDP/include/tinysdp/headers/tsdp_header_V.h71
-rw-r--r--tinySDP/include/tinysdp/headers/tsdp_header_Z.h87
17 files changed, 1388 insertions, 0 deletions
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header.h b/tinySDP/include/tinysdp/headers/tsdp_header.h
new file mode 100644
index 0000000..128155f
--- /dev/null
+++ b/tinySDP/include/tinysdp/headers/tsdp_header.h
@@ -0,0 +1,124 @@
+/*
+* Copyright (C) 2009-2010 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 tsdp_header.h
+ * @brief Defines a SDP header/line (<type>=<value>).
+ *
+ * @author Mamadou Diop <diopmamadou(at)doubango.org>
+ *
+ * @date Created: Sat Nov 8 16:54:58 2009 mdiop
+ */
+#ifndef TINYSDP_HEADER_H
+#define TINYSDP_HEADER_H
+
+#include "tinysdp_config.h"
+
+#include "tsk_ragel_state.h"
+#include "tsk_list.h"
+
+TSDP_BEGIN_DECLS
+
+struct tsdp_header_s;
+
+#define TSDP_HEADER(self) ((tsdp_header_t*)(self))
+#define TSDP_HEADER_CONST(self) ((const tsdp_header_t*)(self))
+#define TSDP_HEADER_VALUE_TOSTRING_F(self) ((tsdp_header_value_tostring_f)(self))
+
+typedef int (*tsdp_header_value_tostring_f)(const struct tsdp_header_s* header, tsk_buffer_t* output);
+typedef struct tsdp_header_s* (*tsdp_header_clone_f)(const struct tsdp_header_s* header);
+
+#define TSDP_HTYPE_V_RANK 0
+#define TSDP_HTYPE_O_RANK 1
+#define TSDP_HTYPE_S_RANK 2
+#define TSDP_HTYPE_I_RANK 3
+#define TSDP_HTYPE_U_RANK 4
+#define TSDP_HTYPE_E_RANK 5
+#define TSDP_HTYPE_P_RANK 6
+#define TSDP_HTYPE_C_RANK 7
+#define TSDP_HTYPE_B_RANK 8
+#define TSDP_HTYPE_Z_RANK 9
+#define TSDP_HTYPE_K_RANK 10
+#define TSDP_HTYPE_A_RANK 11
+#define TSDP_HTYPE_T_RANK 12
+#define TSDP_HTYPE_R_RANK 13
+#define TSDP_HTYPE_M_RANK 14
+//#define TSDP_HTYPE_I_RANK 15
+//#define TSDP_HTYPE_C_RANK 16
+//#define TSDP_HTYPE_B_RANK 17
+
+#define TSDP_HTYPE_DUMMY_RANK 255
+
+/**
+ * @enum tsdp_header_type_e
+ *
+ * @brief List of all supported headers.
+**/
+typedef enum tsdp_header_type_e
+{
+ tsdp_htype_A,
+ tsdp_htype_B,
+ tsdp_htype_C,
+ tsdp_htype_Dummy,
+ tsdp_htype_E,
+ tsdp_htype_I,
+ tsdp_htype_K,
+ tsdp_htype_M,
+ tsdp_htype_O,
+ tsdp_htype_P,
+ tsdp_htype_R,
+ tsdp_htype_S,
+ tsdp_htype_T,
+ tsdp_htype_U,
+ tsdp_htype_V,
+ tsdp_htype_Z
+}
+tsdp_header_type_t;
+
+/*================================
+*/
+typedef struct tsdp_header_s
+{
+ TSK_DECLARE_OBJECT;
+ tsdp_header_type_t type;
+ //! Because all SDP headers shall appear in a fixed order, the rank is used to place each header.
+ // Info: RFC 4566 - 5. SDP Specification.
+ uint8_t rank;
+ tsdp_header_value_tostring_f tostring;
+ tsdp_header_clone_f clone;
+}
+tsdp_header_t;
+
+#define TSDP_DECLARE_HEADER tsdp_header_t __header__
+typedef tsk_list_t tsdp_headers_L_t; /**< List of @ref tsdp_header_t elements. */
+/*
+================================*/
+
+int tsdp_header_rank_cmp(const tsdp_header_t*, const tsdp_header_t*);
+TINYSDP_API tsdp_header_t* tsdp_header_clone(const tsdp_header_t*);
+TINYSDP_API char tsdp_header_get_name(tsdp_header_type_t type);
+TINYSDP_API char tsdp_header_get_nameex(const tsdp_header_t *self);
+TINYSDP_API int tsdp_header_serialize(const tsdp_header_t *self, tsk_buffer_t *output);
+TINYSDP_API char* tsdp_header_tostring(const tsdp_header_t *self);
+
+TSDP_END_DECLS
+
+#endif /* TINYSDP_HEADER_H */
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header_A.h b/tinySDP/include/tinysdp/headers/tsdp_header_A.h
new file mode 100644
index 0000000..27a4fe7
--- /dev/null
+++ b/tinySDP/include/tinysdp/headers/tsdp_header_A.h
@@ -0,0 +1,75 @@
+/*
+* Copyright (C) 2009-2010 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 tsdp_header_A.h
+ * @brief SDP "a=" header (Attributes).
+ *
+ * @author Mamadou Diop <diopmamadou(at)doubango.org>
+ *
+ * @date Created: Iat Nov 8 16:54:58 2009 mdiop
+ */
+#ifndef _TSDP_HEADER_A_H_
+#define _TSDP_HEADER_A_H_
+
+#include "tinysdp_config.h"
+#include "tinysdp/headers/tsdp_header.h"
+
+TSDP_BEGIN_DECLS
+
+#define TSDP_HEADER_A_VA_ARGS(field, value) tsdp_header_A_def_t, (const char*)(field), (const char*)(value)
+
+#define TSDP_HEADER_A(self) ((tsdp_header_A_t*)(self))
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+/// @struct
+///
+/// @brief SDP "a=" header (Attributes).
+///
+/// @par ABNF : a=attribute
+/// attribute = (att-field ":" att-value) / att-field
+/// att-field = token
+/// att-value = byte-string
+///
+////////////////////////////////////////////////////////////////////////////////////////////////////
+typedef struct tsdp_header_A_s
+{
+ TSDP_DECLARE_HEADER;
+
+ char* field;
+ char* value;
+}
+tsdp_header_A_t;
+
+typedef tsk_list_t tsdp_headers_A_L_t;
+
+TINYSDP_API tsdp_header_A_t* tsdp_header_A_create(const char* field, const char* value);
+TINYSDP_API tsdp_header_A_t* tsdp_header_A_create_null();
+
+TINYSDP_API tsdp_header_A_t *tsdp_header_A_parse(const char *data, tsk_size_t size);
+TINYSDP_API int tsdp_header_A_removeAll_by_field(tsdp_headers_A_L_t *attributes, const char* field);
+
+TINYSDP_GEXTERN const tsk_object_def_t *tsdp_header_A_def_t;
+
+TSDP_END_DECLS
+
+#endif /* _TSDP_HEADER_A_H_ */
+
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header_B.h b/tinySDP/include/tinysdp/headers/tsdp_header_B.h
new file mode 100644
index 0000000..bbb677b
--- /dev/null
+++ b/tinySDP/include/tinysdp/headers/tsdp_header_B.h
@@ -0,0 +1,72 @@
+/*
+* Copyright (C) 2009-2010 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 tsdp_header_B.h
+ * @brief SDP "b=" header (Bandwidth).
+ *
+ * @author Mamadou Diop <diopmamadou(at)doubango.org>
+ *
+ * @date Created: Iat Nov 8 16:54:58 2009 mdiop
+ */
+#ifndef _TSDP_HEADER_B_H_
+#define _TSDP_HEADER_B_H_
+
+#include "tinysdp_config.h"
+#include "tinysdp/headers/tsdp_header.h"
+
+TSDP_BEGIN_DECLS
+
+
+#define TSDP_HEADER_B_VA_ARGS(bwtype, bandwidth) tsdp_header_B_def_t, (const char*)bwtype, (uint32_t)bandwidth
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+/// @struct
+///
+/// @brief SDP "b=" header (Bandwidth).
+///
+/// @par ABNF : b=<bwtype> HCOLON <bandwidth>
+/// bwtype = token
+/// bandwidth = 1*DIGIT
+///
+////////////////////////////////////////////////////////////////////////////////////////////////////
+typedef struct tsdp_header_B_s
+{
+ TSDP_DECLARE_HEADER;
+
+ char* bwtype;
+ uint32_t bandwidth;
+}
+tsdp_header_B_t;
+
+typedef tsk_list_t tsdp_headers_B_L_t;
+
+TINYSDP_API tsdp_header_B_t* tsdp_header_B_create(const char* bwtype, uint32_t bandwidth);
+TINYSDP_API tsdp_header_B_t* tsdp_header_b_create_null();
+
+TINYSDP_API tsdp_header_B_t *tsdp_header_B_parse(const char *data, tsk_size_t size);
+
+TINYSDP_GEXTERN const tsk_object_def_t *tsdp_header_B_def_t;
+
+TSDP_END_DECLS
+
+#endif /* _TSDP_HEADER_B_H_ */
+
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header_C.h b/tinySDP/include/tinysdp/headers/tsdp_header_C.h
new file mode 100644
index 0000000..bf9a23f
--- /dev/null
+++ b/tinySDP/include/tinysdp/headers/tsdp_header_C.h
@@ -0,0 +1,76 @@
+/*
+* Copyright (C) 2009-2010 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 tsdp_header_C.h
+ * @brief SDP "c=" header (Connection Data).
+ *
+ * @author Mamadou Diop <diopmamadou(at)doubango.org>
+ *
+ * @date Created: Iat Nov 8 16:54:58 2009 mdiop
+ */
+#ifndef _TSDP_HEADER_C_H_
+#define _TSDP_HEADER_C_H_
+
+#include "tinysdp_config.h"
+#include "tinysdp/headers/tsdp_header.h"
+
+TSDP_BEGIN_DECLS
+
+#define TSDP_HEADER_C_VA_ARGS(nettype, addrtype, addr) tsdp_header_C_def_t, (const char*)(nettype), (const char*)(addrtype), (const char*)(addr)
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+/// @struct
+///
+/// @brief SDP "c=" header (Connection Data).
+/// A session description MUST contain either at least one "c=" field in
+/// each media description or a single "c=" field at the session level.
+/// It MAY contain a single session-level "c=" field and additional "c="
+/// field(s) per media description, in which case the per-media values
+/// override the session-level settings for the respective media.
+///
+///
+///
+/// @par ABNF : c= nettype SP addrtype SP connection-address
+///
+////////////////////////////////////////////////////////////////////////////////////////////////////
+typedef struct tsdp_header_C_s
+{
+ TSDP_DECLARE_HEADER;
+ char* nettype;
+ char* addrtype;
+ char* addr;
+}
+tsdp_header_C_t;
+
+typedef tsk_list_t tsdp_headers_C_L_t;
+
+TINYSDP_API tsdp_header_C_t* tsdp_header_c_create(const char* nettype, const char* addrtype, const char* addr);
+TINYSDP_API tsdp_header_C_t* tsdp_header_c_create_null();
+
+TINYSDP_API tsdp_header_C_t *tsdp_header_C_parse(const char *data, tsk_size_t size);
+
+TINYSDP_GEXTERN const tsk_object_def_t *tsdp_header_C_def_t;
+
+TSDP_END_DECLS
+
+#endif /* _TSDP_HEADER_C_H_ */
+
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header_Dummy.h b/tinySDP/include/tinysdp/headers/tsdp_header_Dummy.h
new file mode 100644
index 0000000..3f161f7
--- /dev/null
+++ b/tinySDP/include/tinysdp/headers/tsdp_header_Dummy.h
@@ -0,0 +1,68 @@
+/*
+* Copyright (C) 2009-2010 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 tsdp_header_Dummy.h
+ * @brief SDP dummy header.
+ *
+ * @author Mamadou Diop <diopmamadou(at)doubango.org>
+ *
+ * @date Created: Sat Nov 8 16:54:58 2009 mdiop
+ */
+#ifndef _TSDP_HEADER_DUMMY_H_
+#define _TSDP_HEADER_DUMMY_H_
+
+#include "tinysdp_config.h"
+#include "tinysdp/headers/tsdp_header.h"
+
+TSDP_BEGIN_DECLS
+
+#define TSDP_HEADER_DUMMY_VA_ARGS(name, value) tsdp_header_Dummy_def_t, (char)name, (const char*)value
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+/// @struct
+///
+/// @brief SDP Dummy header.
+///
+/// @par ABNF : alpha SP* "=" SP*<: any*
+///
+////////////////////////////////////////////////////////////////////////////////////////////////////
+typedef struct tsdp_header_Dummy_s
+{
+ TSDP_DECLARE_HEADER;
+ char name;
+ char *value;
+}
+tsdp_header_Dummy_t;
+
+typedef tsk_list_t tsdp_headers_Dummy_L_t;
+
+TINYSDP_API tsdp_header_Dummy_t* tsdp_header_dummy_create(char name, const char* value);
+TINYSDP_API tsdp_header_Dummy_t* tsdp_header_dummy_create_null();
+
+TINYSDP_API tsdp_header_Dummy_t *tsdp_header_Dummy_parse(const char *data, tsk_size_t size);
+
+TINYSDP_GEXTERN const tsk_object_def_t *tsdp_header_Dummy_def_t;
+
+TSDP_END_DECLS
+
+#endif /* _TSDP_HEADER_DUMMY_H_ */
+
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header_E.h b/tinySDP/include/tinysdp/headers/tsdp_header_E.h
new file mode 100644
index 0000000..f612a4e
--- /dev/null
+++ b/tinySDP/include/tinysdp/headers/tsdp_header_E.h
@@ -0,0 +1,71 @@
+/*
+* Copyright (C) 2009-2010 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 tsdp_header_E.h
+ * @brief SDP "e=" header (Email Address).
+ *
+ * @author Mamadou Diop <diopmamadou(at)doubango.org>
+ *
+ * @date Created: Iat Nov 8 16:54:58 2009 mdiop
+ */
+#ifndef _TSDP_HEADER_E_H_
+#define _TSDP_HEADER_E_H_
+
+#include "tinysdp_config.h"
+#include "tinysdp/headers/tsdp_header.h"
+
+TSDP_BEGIN_DECLS
+
+#define TSDP_HEADER_E_VA_ARGS(value) tsdp_header_E_def_t, (const char*)value
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+/// @struct
+///
+/// @brief SDP "e=" header (Email Address).
+///
+/// The "e=" line specifies contact information for the person
+/// responsible for the conference. This is not necessarily the same
+/// person that created the conference announcement.
+///
+/// @par ABNF : e= email-address
+///
+////////////////////////////////////////////////////////////////////////////////////////////////////
+typedef struct tsdp_header_E_s
+{
+ TSDP_DECLARE_HEADER;
+ char* value;
+}
+tsdp_header_E_t;
+
+typedef tsk_list_t tsdp_headers_E_L_t;
+
+TINYSDP_API tsdp_header_E_t* tsdp_header_E_create(const char* value);
+TINYSDP_API tsdp_header_E_t* tsdp_header_E_create_null();
+
+TINYSDP_API tsdp_header_E_t *tsdp_header_E_parse(const char *data, tsk_size_t size);
+
+TINYSDP_GEXTERN const tsk_object_def_t *tsdp_header_E_def_t;
+
+TSDP_END_DECLS
+
+#endif /* _TSDP_HEADER_E_H_ */
+
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header_I.h b/tinySDP/include/tinysdp/headers/tsdp_header_I.h
new file mode 100644
index 0000000..2c549af
--- /dev/null
+++ b/tinySDP/include/tinysdp/headers/tsdp_header_I.h
@@ -0,0 +1,67 @@
+/*
+* Copyright (C) 2009-2010 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 tsdp_header_I.h
+ * @brief SDP "i=" header (Session Information).
+ *
+ * @author Mamadou Diop <diopmamadou(at)doubango.org>
+ *
+ * @date Created: Iat Nov 8 16:54:58 2009 mdiop
+ */
+#ifndef _TSDP_HEADER_I_H_
+#define _TSDP_HEADER_I_H_
+
+#include "tinysdp_config.h"
+#include "tinysdp/headers/tsdp_header.h"
+
+TSDP_BEGIN_DECLS
+
+#define TSDP_HEADER_I_VA_ARGS(value) tsdp_header_I_def_t, (const char*)value
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+/// @struct
+///
+/// @brief SDP "i=" header (Session Information).
+///
+/// @par ABNF : i=text
+///
+////////////////////////////////////////////////////////////////////////////////////////////////////
+typedef struct tsdp_header_I_s
+{
+ TSDP_DECLARE_HEADER;
+ char* value;
+}
+tsdp_header_I_t;
+
+typedef tsk_list_t tsdp_headers_I_L_t;
+
+TINYSDP_API tsdp_header_I_t* tsdp_header_I_create(const char* value);
+TINYSDP_API tsdp_header_I_t* tsdp_header_I_create_null();
+
+TINYSDP_API tsdp_header_I_t *tsdp_header_I_parse(const char *data, tsk_size_t size);
+
+TINYSDP_GEXTERN const tsk_object_def_t *tsdp_header_I_def_t;
+
+TSDP_END_DECLS
+
+#endif /* _TSDP_HEADER_I_H_ */
+
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header_K.h b/tinySDP/include/tinysdp/headers/tsdp_header_K.h
new file mode 100644
index 0000000..67caf41
--- /dev/null
+++ b/tinySDP/include/tinysdp/headers/tsdp_header_K.h
@@ -0,0 +1,73 @@
+/*
+* Copyright (C) 2009-2010 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 tsdp_header_K.h
+ * @brief SDP "k=" header (Encryption Key).
+ *
+ * @author Mamadou Diop <diopmamadou(at)doubango.org>
+ *
+ * @date Created: Iat Nov 8 16:54:58 2009 mdiop
+ */
+#ifndef _TSDP_HEADER_K_H_
+#define _TSDP_HEADER_K_H_
+
+#include "tinysdp_config.h"
+#include "tinysdp/headers/tsdp_header.h"
+
+TSDP_BEGIN_DECLS
+
+#define TSDP_HEADER_K_VA_ARGS(value) tsdp_header_K_def_t, (const char*)value
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+/// @struct
+///
+/// @brief SDP "k=" header (Encryption Key).
+///
+///
+/// @par ABNF : k= key-type
+/// key-type = "prompt" / "clear:" text / "base64:" base64 / "uri:" uri
+/// base64 = *base64-unit [base64-pad]
+/// base64-unit = 4base64-char
+/// base64-pad = 2base64-char "==" / 3base64-pad "="
+/// base64-char = ALPHA / DIGIT / "+" / "/"
+///
+////////////////////////////////////////////////////////////////////////////////////////////////////
+typedef struct tsdp_header_K_s
+{
+ TSDP_DECLARE_HEADER;
+ char* value;
+}
+tsdp_header_K_t;
+
+typedef tsk_list_t tsdp_headers_K_L_t;
+
+TINYSDP_API tsdp_header_K_t* tsdp_header_K_create(const char* value);
+TINYSDP_API tsdp_header_K_t* tsdp_header_K_create_null();
+
+tsdp_header_K_t *tsdp_header_K_parse(const char *data, tsk_size_t size);
+
+TINYSDP_GEXTERN const tsk_object_def_t *tsdp_header_K_def_t;
+
+TSDP_END_DECLS
+
+#endif /* _TSDP_HEADER_P_H_ */
+
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header_M.h b/tinySDP/include/tinysdp/headers/tsdp_header_M.h
new file mode 100644
index 0000000..859f876
--- /dev/null
+++ b/tinySDP/include/tinysdp/headers/tsdp_header_M.h
@@ -0,0 +1,124 @@
+/*
+* Copyright (C) 2009-2010 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 tsdp_header_M.h
+ * @brief SDP "m=" header (Media Descriptions).
+ *
+ * @author Mamadou Diop <diopmamadou(at)doubango.org>
+ *
+ * @date Created: Iat Nov 8 16:54:58 2009 mdiop
+ */
+#ifndef _TSDP_HEADER_M_H_
+#define _TSDP_HEADER_M_H_
+
+#include "tinysdp_config.h"
+#include "tinysdp/headers/tsdp_header.h"
+
+#include "tinysdp/headers/tsdp_header_A.h"
+#include "tinysdp/headers/tsdp_header_B.h"
+#include "tinysdp/headers/tsdp_header_C.h"
+#include "tinysdp/headers/tsdp_header_I.h"
+#include "tinysdp/headers/tsdp_header_K.h"
+
+#include "tsk_string.h"
+
+TSDP_BEGIN_DECLS
+
+#define TSDP_HEADER_M_VA_ARGS(media, port, proto) tsdp_header_M_def_t, (const char*)media, (uint32_t)port, (const char*)proto
+
+#define TSDP_HEADER_M(self) ((tsdp_header_M_t*)(self))
+
+#define TSDP_FMT_VA_ARGS(fmt) tsdp_fmt_def_t, (const char*)fmt
+
+typedef tsk_string_t tsdp_fmt_t;
+typedef tsk_strings_L_t tsk_fmts_L_t;
+#define tsdp_fmt_def_t tsk_string_def_t
+#define TSDP_FMT_STR(self) TSK_STRING_STR(self)
+
+TINYSDP_API tsdp_fmt_t* tsdp_fmt_create(const char* fmt);
+
+//#define TSDP_HEADER_M_SET_FMT(fmt) (int)0x01, (const char*)fmt
+//#define TSDP_HEADER_M_SET_A(field, value) (int)0x02, (const char*)field, (const char*)value
+//#define TSDP_HEADER_M_SET_NULL() (int)0x00
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+/// @struct
+///
+/// @brief SDP "m=" header (Media Descriptions).
+///
+/// @par ABNF : m=*(media-field
+/// information-field
+/// *connection-field
+/// bandwidth-fields
+/// key-field
+/// attribute-fields)
+///
+/// media-field = %x6d "=" media SP port ["/" integer] SP proto 1*(SP fmt) CRLF
+/// media = token
+/// port = 1*DIGIT
+/// proto = token *("/" token)
+/// fmt = token
+///
+////////////////////////////////////////////////////////////////////////////////////////////////////
+typedef struct tsdp_header_M_s
+{
+ TSDP_DECLARE_HEADER;
+
+ char* media;
+ uint32_t port;
+ uint32_t nports; /**< <number of ports> */
+ char* proto;
+ tsk_fmts_L_t* FMTs;
+
+ // Fields below will be set by the message parser.
+ tsdp_header_I_t* I;
+ tsdp_header_C_t* C;
+ tsdp_headers_B_L_t* Bandwidths; // (zero or more bandwidth information lines)
+ tsdp_header_K_t* K; // (encryption key)
+ tsdp_headers_A_L_t* Attributes; // (zero or more media attribute lines)
+}
+tsdp_header_M_t;
+
+typedef tsk_list_t tsdp_headers_M_L_t;
+
+TINYSDP_API tsdp_header_M_t* tsdp_header_M_create(const char* media, uint32_t port, const char* proto);
+TINYSDP_API tsdp_header_M_t* tsdp_header_M_create_null();
+
+TINYSDP_API tsdp_header_M_t *tsdp_header_M_parse(const char *data, tsk_size_t size);
+TINYSDP_API int tsdp_header_M_add(tsdp_header_M_t* self, const tsdp_header_t* header);
+TINYSDP_API int tsdp_header_M_add_headers(tsdp_header_M_t* self, ...);
+TINYSDP_API int tsdp_header_M_add_headers_2(tsdp_header_M_t* self, const tsdp_headers_L_t* headers);
+TINYSDP_API int tsdp_header_M_add_fmt(tsdp_header_M_t* self, const char* fmt);
+TINYSDP_API const tsdp_header_A_t* tsdp_header_M_findA_at(const tsdp_header_M_t* self, const char* field, tsk_size_t index);
+TINYSDP_API const tsdp_header_A_t* tsdp_header_M_findA(const tsdp_header_M_t* self, const char* field);
+TINYSDP_API char* tsdp_header_M_get_rtpmap(const tsdp_header_M_t* self, const char* fmt);
+TINYSDP_API char* tsdp_header_M_get_fmtp(const tsdp_header_M_t* self, const char* fmt);
+TINYSDP_API int tsdp_header_M_hold(tsdp_header_M_t* self, tsk_bool_t local);
+TINYSDP_API tsk_bool_t tsdp_header_M_is_held(const tsdp_header_M_t* self, tsk_bool_t local);
+TINYSDP_API int tsdp_header_M_resume(tsdp_header_M_t* self, tsk_bool_t local);
+
+TINYSDP_GEXTERN const tsk_object_def_t *tsdp_header_M_def_t;
+
+TSDP_END_DECLS
+
+#endif /* _TSDP_HEADER_M_H_ */
+
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header_O.h b/tinySDP/include/tinysdp/headers/tsdp_header_O.h
new file mode 100644
index 0000000..3943ae3
--- /dev/null
+++ b/tinySDP/include/tinysdp/headers/tsdp_header_O.h
@@ -0,0 +1,119 @@
+/*
+* Copyright (C) 2009-2010 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 tsdp_header_O.h
+ * @brief SDP "o=" header (Origin).
+ *
+ * @author Mamadou Diop <diopmamadou(at)doubango.org>
+ *
+ * @date Created: Oat Nov 8 16:54:58 2009 mdiop
+ */
+#ifndef _TSDP_HEADER_O_H_
+#define _TSDP_HEADER_O_H_
+
+#include "tinysdp_config.h"
+#include "tinysdp/headers/tsdp_header.h"
+
+TSDP_BEGIN_DECLS
+
+
+#define TSDP_HEADER_O_VA_ARGS(username, sess_id, sess_version, nettype, addrtype, addr) tsdp_header_O_def_t, (const char*)username, (uint32_t)sess_id, (uint32_t)sess_version, (const char*)nettype, (const char*)addrtype, (const char*)addr
+#define TSDP_HEADER_O_VA_ARGS_DEFAULT(username, nettype, addrtype, addr) TSDP_HEADER_O_VA_ARGS(username, TSDP_HEADER_O_SESS_ID_DEFAULT, TSDP_HEADER_O_SESS_VERSION_DEFAULT, nettype, addrtype, addr)
+
+#define TSDP_HEADER_O_SESS_ID_DEFAULT 123456
+#define TSDP_HEADER_O_SESS_VERSION_DEFAULT 678901
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+/// @struct
+///
+/// @brief SDP "o=" header (Origin).
+/// The "o=" field gives the originator of the session (her username and
+/// the address of the user's host) plus a session identifier and version number.
+///
+/// @par ABNF : u=username SP
+/// sess-id SP sess-version SP nettype SP addrtype SP unicast-address
+///
+/// username = non-ws-string
+/// sess-id = 1*DIGIT
+/// sess-version = 1*DIGIT
+/// nettype = token
+/// addrtype = token
+/// unicast-address = FQDN
+///
+////////////////////////////////////////////////////////////////////////////////////////////////////
+typedef struct tsdp_header_O_s
+{
+ TSDP_DECLARE_HEADER;
+
+ /** <username> is the user's login on the originating host, or it is "-"
+ if the originating host does not support the concept of user IDs.
+ The <username> MUST NOT contain spaces.*/
+ char* username;
+ /** <sess-id>, <nettype>, <addrtype>, and <unicast-address> forms a
+ globally unique identifier for the session. The method of
+ <sess-id> allocation is up to the creating tool, but it has been
+ suggested that a Network Time Protocol (NTP) format timestamp be
+ used to ensure uniqueness*/
+ uint32_t sess_id;
+ /** <sess-version> is a version number for this session description. Its
+ usage is up to the creating tool, so long as <sess-version> is
+ increased when a modification is made to the session data. Again,
+ it is RECOMMENDED that an NTP format timestamp is used.*/
+ uint32_t sess_version;
+ /** <nettype> is a text string giving the type of network. Initially
+ "IN" is defined to have the meaning "Internet", but other values
+ MAY be registered in the future (see Section 8 of RFC 4566)*/
+ char* nettype;
+ /**<addrtype> is a text string giving the type of the address that
+ follows. Initially "IP4" and "IP6" are defined, but other values
+ MAY be registered in the future (see Section 8 of RFC 4566)*/
+ char* addrtype;
+ /** <unicast-address> is the address of the machine from which the
+ session was created. For an address type of IP4, this is either
+ the fully qualified domain name of the machine or the dotted-
+ decimal representation of the IP version 4 address of the machine.
+ For an address type of IP6, this is either the fully qualified
+ domain name of the machine or the compressed textual
+ representation of the IP version 6 address of the machine. For
+ both IP4 and IP6, the fully qualified domain name is the form that
+ SHOULD be given unless this is unavailable, in which case the
+ globally unique address MAY be substituted. A local IP address
+ MUST NOT be used in any context where the SDP description might
+ leave the scope in which the address is meaningful (for example, a
+ local address MUST NOT be included in an application-level
+ referral that might leave the scope)*/
+ char* addr;
+}
+tsdp_header_O_t;
+
+TINYSDP_API tsdp_header_O_t* tsdp_header_O_create(const char* username, uint32_t sess_id, uint32_t sess_version, const char* nettype, const char* addrtype, const char* addr);
+TINYSDP_API tsdp_header_O_t* tsdp_header_O_create_null();
+TINYSDP_API tsdp_header_O_t* tsdp_header_O_create_default(const char* username, const char* nettype, const char* addrtype, const char* addr);
+
+TINYSDP_API tsdp_header_O_t *tsdp_header_O_parse(const char *data, tsk_size_t size);
+
+TINYSDP_GEXTERN const tsk_object_def_t *tsdp_header_O_def_t;
+
+TSDP_END_DECLS
+
+#endif /* _TSDP_HEADER_O_H_ */
+
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header_P.h b/tinySDP/include/tinysdp/headers/tsdp_header_P.h
new file mode 100644
index 0000000..443195b
--- /dev/null
+++ b/tinySDP/include/tinysdp/headers/tsdp_header_P.h
@@ -0,0 +1,71 @@
+/*
+* Copyright (C) 2009-2010 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 tsdp_header_P.h
+ * @brief SDP "p=" header (Phone Number).
+ *
+ * @author Mamadou Diop <diopmamadou(at)doubango.org>
+ *
+ * @date Created: Iat Nov 8 16:54:58 2009 mdiop
+ */
+#ifndef _TSDP_HEADER_P_H_
+#define _TSDP_HEADER_P_H_
+
+#include "tinysdp_config.h"
+#include "tinysdp/headers/tsdp_header.h"
+
+TSDP_BEGIN_DECLS
+
+#define TSDP_HEADER_P_VA_ARGS(value) tsdp_header_P_def_t, (const char*)value
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+/// @struct
+///
+/// @brief SDP "p=" header (Phone Number).
+/// The "p=" line specifies contact information for the person
+/// responsible for the conference. This is not necessarily the same
+/// person that created the conference announcement.
+///
+///
+/// @par ABNF : p= phone-number
+///
+////////////////////////////////////////////////////////////////////////////////////////////////////
+typedef struct tsdp_header_P_s
+{
+ TSDP_DECLARE_HEADER;
+ char* value;
+}
+tsdp_header_P_t;
+
+typedef tsk_list_t tsdp_headers_P_L_t;
+
+TINYSDP_API tsdp_header_P_t* tsdp_header_P_create(const char* value);
+TINYSDP_API tsdp_header_P_t* tsdp_header_P_create_null();
+
+TINYSDP_API tsdp_header_P_t *tsdp_header_P_parse(const char *data, tsk_size_t size);
+
+TINYSDP_GEXTERN const tsk_object_def_t *tsdp_header_P_def_t;
+
+TSDP_END_DECLS
+
+#endif /* _TSDP_HEADER_P_H_ */
+
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header_R.h b/tinySDP/include/tinysdp/headers/tsdp_header_R.h
new file mode 100644
index 0000000..5b4a5c5
--- /dev/null
+++ b/tinySDP/include/tinysdp/headers/tsdp_header_R.h
@@ -0,0 +1,77 @@
+/*
+* Copyright (C) 2009-2010 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 tsdp_header_R.h
+ * @brief SDP "r=" header (Repeat Times).
+ *
+ * @author Mamadou Diop <diopmamadou(at)doubango.org>
+ *
+ * @date Created: Iat Nov 8 16:54:58 2009 mdiop
+ */
+#ifndef _TSDP_HEADER_R_H_
+#define _TSDP_HEADER_R_H_
+
+#include "tinysdp_config.h"
+#include "tinysdp/headers/tsdp_header.h"
+
+#include "tsk_string.h"
+
+TSDP_BEGIN_DECLS
+
+#define TSDP_HEADER_R_VA_ARGS() tsdp_header_R_def_t
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+/// @struct
+///
+/// @brief SDP "r=" header (Repeat Times).
+///
+/// The "e=" line "r=" fields specify repeat times for a session.
+///
+/// @par ABNF : r= repeat-interval SP typed-time 1*(SP typed-time)
+/// repeat-interval = POS-DIGIT *DIGIT [fixed-len-time-unit]
+/// typed-time = 1*DIGIT [fixed-len-time-unit]
+/// 1*DIGIT [fixed-len-time-unit]
+/// fixed-len-time-unit = "d" / "h" / "m" / "s"
+///
+////////////////////////////////////////////////////////////////////////////////////////////////////
+typedef struct tsdp_header_R_s
+{
+ TSDP_DECLARE_HEADER;
+ char* repeat_interval;
+ char* typed_time;
+ tsk_strings_L_t* typed_times;
+}
+tsdp_header_R_t;
+
+typedef tsk_list_t tsdp_headers_R_L_t;
+
+TINYSDP_API tsdp_header_R_t* tsdp_header_R_create();
+TINYSDP_API tsdp_header_R_t* tsdp_header_R_create_null();
+
+TINYSDP_API tsdp_header_R_t *tsdp_header_R_parse(const char *data, tsk_size_t size);
+
+TINYSDP_GEXTERN const tsk_object_def_t *tsdp_header_R_def_t;
+
+TSDP_END_DECLS
+
+#endif /* _TSDP_HEADER_R_H_ */
+
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header_S.h b/tinySDP/include/tinysdp/headers/tsdp_header_S.h
new file mode 100644
index 0000000..f248569
--- /dev/null
+++ b/tinySDP/include/tinysdp/headers/tsdp_header_S.h
@@ -0,0 +1,65 @@
+/*
+* Copyright (C) 2009-2010 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 tsdp_header_S.h
+ * @brief SDP "s=" header (Session Name).
+ *
+ * @author Mamadou Diop <diopmamadou(at)doubango.org>
+ *
+ * @date Created: Sat Nov 8 16:54:58 2009 mdiop
+ */
+#ifndef _TSDP_HEADER_S_H_
+#define _TSDP_HEADER_S_H_
+
+#include "tinysdp_config.h"
+#include "tinysdp/headers/tsdp_header.h"
+
+TSDP_BEGIN_DECLS
+
+#define TSDP_HEADER_S_VA_ARGS(value) tsdp_header_S_def_t, (const char*)value
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+/// @struct
+///
+/// @brief SDP "s=" header (Session Name).
+///
+/// @par ABNF : s=text
+///
+////////////////////////////////////////////////////////////////////////////////////////////////////
+typedef struct tsdp_header_S_s
+{
+ TSDP_DECLARE_HEADER;
+ char* value;
+}
+tsdp_header_S_t;
+
+TINYSDP_API tsdp_header_S_t* tsdp_header_S_create(const char* value);
+TINYSDP_API tsdp_header_S_t* tsdp_header_S_create_null();
+
+TINYSDP_API tsdp_header_S_t *tsdp_header_S_parse(const char *data, tsk_size_t size);
+
+TINYSDP_GEXTERN const tsk_object_def_t *tsdp_header_S_def_t;
+
+TSDP_END_DECLS
+
+#endif /* _TSDP_HEADER_S_H_ */
+
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header_T.h b/tinySDP/include/tinysdp/headers/tsdp_header_T.h
new file mode 100644
index 0000000..d4f7307
--- /dev/null
+++ b/tinySDP/include/tinysdp/headers/tsdp_header_T.h
@@ -0,0 +1,81 @@
+/*
+* Copyright (C) 2009-2010 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 tsdp_header_T.h
+ * @brief SDP "t=" header (Timing).
+ *
+ * @author Mamadou Diop <diopmamadou(at)doubango.org>
+ *
+ * @date Created: Iat Nov 8 16:54:58 2009 mdiop
+ */
+#ifndef _TSDP_HEADER_T_H_
+#define _TSDP_HEADER_T_H_
+
+#include "tinysdp_config.h"
+#include "tinysdp/headers/tsdp_header.h"
+
+#include "tinysdp/headers/tsdp_header_R.h"
+
+TSDP_BEGIN_DECLS
+
+#define TSDP_HEADER_T_VA_ARGS(start, stop) tsdp_header_T_def_t, (uint64_t)start, (uint64_t)stop
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+/// @struct
+///
+/// @brief SDP "t=" header (Timing).
+/// The "t=" lines specify the start and stop times for a session.
+/// Multiple "t=" lines MAY be used if a session is active at multiple
+/// irregularly spaced times; each additional "t=" line specifies an
+/// additional period of time for which the session will be active. If
+/// the session is active at regular times, an "r=" line (see below)
+/// should be used in addition to, and following, a "t=" line -- in which
+/// case the "t=" line specifies the start and stop times of the repeat
+/// sequence.
+///
+///
+/// @par ABNF : t= start-time SP stop-time *( CRLF repeat-fields )
+///
+////////////////////////////////////////////////////////////////////////////////////////////////////
+typedef struct tsdp_header_T_s
+{
+ TSDP_DECLARE_HEADER;
+ uint64_t start;
+ uint64_t stop;
+
+ tsdp_headers_R_L_t* repeat_fields;
+}
+tsdp_header_T_t;
+
+typedef tsk_list_t tsdp_headers_T_L_t;
+
+TINYSDP_API tsdp_header_T_t* tsdp_header_T_create(uint64_t start, uint64_t stop);
+TINYSDP_API tsdp_header_T_t* tsdp_header_T_create_null();
+
+TINYSDP_API tsdp_header_T_t *tsdp_header_T_parse(const char *data, tsk_size_t size);
+
+TINYSDP_GEXTERN const tsk_object_def_t *tsdp_header_T_def_t;
+
+TSDP_END_DECLS
+
+#endif /* _TSDP_HEADER_P_H_ */
+
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header_U.h b/tinySDP/include/tinysdp/headers/tsdp_header_U.h
new file mode 100644
index 0000000..613337b
--- /dev/null
+++ b/tinySDP/include/tinysdp/headers/tsdp_header_U.h
@@ -0,0 +1,67 @@
+/*
+* Copyright (C) 2009-2010 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 tsdp_header_U.h
+ * @brief SDP "u=" header (URI).
+ *
+ * @author Mamadou Diop <diopmamadou(at)doubango.org>
+ *
+ * @date Created: Uat Nov 8 16:54:58 2009 mdiop
+ */
+#ifndef _TSDP_HEADER_U_H_
+#define _TSDP_HEADER_U_H_
+
+#include "tinysdp_config.h"
+#include "tinysdp/headers/tsdp_header.h"
+
+TSDP_BEGIN_DECLS
+
+#define TSDP_HEADER_U_VA_ARGS(value) tsdp_header_U_def_t, (const char*)value
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+/// @struct
+///
+/// @brief SDP "u=" header (URI).
+///
+/// @par ABNF : u=uri
+///
+////////////////////////////////////////////////////////////////////////////////////////////////////
+typedef struct tsdp_header_U_s
+{
+ TSDP_DECLARE_HEADER;
+ char* value;
+}
+tsdp_header_U_t;
+
+typedef tsk_list_t tsdp_headers_U_L_t;
+
+TINYSDP_API tsdp_header_U_t* tsdp_header_U_create(const char* value);
+TINYSDP_API tsdp_header_U_t* tsdp_header_U_create_null();
+
+TINYSDP_API tsdp_header_U_t *tsdp_header_U_parse(const char *data, tsk_size_t size);
+
+TINYSDP_GEXTERN const tsk_object_def_t *tsdp_header_U_def_t;
+
+TSDP_END_DECLS
+
+#endif /* _TSDP_HEADER_U_H_ */
+
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header_V.h b/tinySDP/include/tinysdp/headers/tsdp_header_V.h
new file mode 100644
index 0000000..c77a26e
--- /dev/null
+++ b/tinySDP/include/tinysdp/headers/tsdp_header_V.h
@@ -0,0 +1,71 @@
+/*
+* Copyright (C) 2009-2010 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 tsdp_header_V.h
+ * @brief SDP "v=" header (Protocol Version).
+ *
+ * @author Mamadou Diop <diopmamadou(at)doubango.org>
+ *
+ * @date Created: Sat Nov 8 16:54:58 2009 mdiop
+ */
+#ifndef _TSDP_HEADER_V_H_
+#define _TSDP_HEADER_V_H_
+
+#include "tinysdp_config.h"
+#include "tinysdp/headers/tsdp_header.h"
+
+TSDP_BEGIN_DECLS
+
+#define TSDP_HEADER_V_VA_ARGS(version) tsdp_header_V_def_t, (int32_t)version
+
+#define TSDP_HEADER_V_DEFAULT 0
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+/// @struct
+///
+/// @brief SDP "v=" header (Protocol Version).
+/// The "v=" field gives the version of the Session Description Protocol.
+/// This memo (RFC 4566) defines version 0. There is no minor version number.
+///
+/// @par ABNF : v=1*DIGIT
+///
+////////////////////////////////////////////////////////////////////////////////////////////////////
+typedef struct tsdp_header_V_s
+{
+ TSDP_DECLARE_HEADER;
+ int32_t version;
+}
+tsdp_header_V_t;
+
+typedef tsk_list_t tsdp_headers_V_L_t;
+
+TINYSDP_API tsdp_header_V_t* tsdp_header_V_create(int32_t version);
+TINYSDP_API tsdp_header_V_t* tsdp_header_V_create_null();
+
+TINYSDP_API tsdp_header_V_t *tsdp_header_V_parse(const char *data, tsk_size_t size);
+
+TINYSDP_GEXTERN const tsk_object_def_t *tsdp_header_V_def_t;
+
+TSDP_END_DECLS
+
+#endif /* _TSDP_HEADER_V_H_ */
+
diff --git a/tinySDP/include/tinysdp/headers/tsdp_header_Z.h b/tinySDP/include/tinysdp/headers/tsdp_header_Z.h
new file mode 100644
index 0000000..3bf887e
--- /dev/null
+++ b/tinySDP/include/tinysdp/headers/tsdp_header_Z.h
@@ -0,0 +1,87 @@
+/*
+* Copyright (C) 2009-2010 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 tsdp_header_Z.h
+ * @brief SDP "z=" header (Time Zones).
+ *
+ * @author Mamadou Diop <diopmamadou(at)doubango.org>
+ *
+ * @date Created: Iat Nov 8 16:54:58 2009 mdiop
+ */
+#ifndef _TSDP_HEADER_Z_H_
+#define _TSDP_HEADER_Z_H_
+
+#include "tinysdp_config.h"
+#include "tinysdp/headers/tsdp_header.h"
+
+TSDP_BEGIN_DECLS
+
+#define TSDP_HEADER_Z_VA_ARGS(time, shifted_back, typed_time) tsdp_header_Z_def_t, (uint64_t)time, (tsk_bool_t)shifted_back, (const char*)typed_time
+
+typedef struct tsdp_zone_s
+{
+ TSK_DECLARE_OBJECT;
+
+ uint64_t time;
+ tsk_bool_t shifted_back;
+ char* typed_time;
+}
+tsdp_zone_t;
+typedef tsk_list_t tsdp_zones_L_t;
+
+TINYSDP_API tsdp_zone_t* tsdp_zone_create(uint64_t time, tsk_bool_t shifted_back, const char* typed_time) ;
+TINYSDP_API tsdp_zone_t* tsdp_zone_create_null();
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+/// @struct
+///
+/// @brief SDP "z=" header (Time Zones).
+///
+/// @par ABNF : z=time SP ["-"] typed-time
+/// *(SP time SP ["-"] typed-time)
+/// time = POS-DIGIT 9*DIGIT
+/// typed-time = 1*DIGIT [fixed-len-time-unit]
+/// fixed-len-time-unit = "d" / "h" / "m" / "s"
+///
+////////////////////////////////////////////////////////////////////////////////////////////////////
+typedef struct tsdp_header_Z_s
+{
+ TSDP_DECLARE_HEADER;
+
+ tsdp_zones_L_t* zones;
+}
+tsdp_header_Z_t;
+
+typedef tsk_list_t tsdp_headers_Z_L_t;
+
+TINYSDP_API tsdp_header_Z_t* tsdp_header_Z_create(uint64_t time, tsk_bool_t shifted_back, const char* typed_time);
+TINYSDP_API tsdp_header_Z_t* tsdp_header_Z_create_null();
+
+TINYSDP_API tsdp_header_Z_t *tsdp_header_Z_parse(const char *data, tsk_size_t size);
+
+TINYSDP_GEXTERN const tsk_object_def_t *tsdp_header_Z_def_t;
+TINYSDP_GEXTERN const tsk_object_def_t *tsdp_zone_def_t;
+
+TSDP_END_DECLS
+
+#endif /* _TSDP_HEADER_Z_H_ */
+
OpenPOWER on IntegriCloud