trtp_rtcp_sdes_item.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
  3. *
  4. * Contact: Mamadou Diop <diopmamadou(at)doubango.org>
  5. *
  6. * This file is part of Open Source Doubango Framework.
  7. *
  8. * DOUBANGO is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * DOUBANGO is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with DOUBANGO.
  20. *
  21. */
  22. #ifndef TINYRTP_RTCP_SDES_ITEM_H
  23. #define TINYRTP_RTCP_SDES_ITEM_H
  24. #include "tinyrtp_config.h"
  25. #include "tsk_list.h"
  26. #include "tsk_buffer.h"
  27. #define TRTP_RTCP_SDES_ITEM_MIN_SIZE 2 /* Type + Length */
  28. #define TRTP_RTCP_SDES_ITEM(self) ((trtp_rtcp_sdes_item_t*)(self))
  29. TRTP_BEGIN_DECLS
  30. // RFC 3550 12.2 SDES Types
  31. typedef enum trtp_rtcp_sdes_item_type_e {
  32. trtp_rtcp_sdes_item_type_end = 0, /**< end of SDES list */
  33. trtp_rtcp_sdes_item_type_cname = 1, /**< canonical name*/
  34. trtp_rtcp_sdes_item_type_name = 2, /**< user name */
  35. trtp_rtcp_sdes_item_type_email = 3, /**< user's electronic mail address*/
  36. trtp_rtcp_sdes_item_type_phone = 4, /**< user's phone number */
  37. trtp_rtcp_sdes_item_type_loc = 5, /**< geographic user location*/
  38. trtp_rtcp_sdes_item_type_tool = 6, /**< name of application or tool*/
  39. trtp_rtcp_sdes_item_type_note = 7, /**< notice about the source*/
  40. trtp_rtcp_sdes_item_type_priv = 8, /**< private extensions*/
  41. }
  42. trtp_rtcp_sdes_item_type_t;
  43. typedef struct trtp_rtcp_sdes_item_s {
  44. TSK_DECLARE_OBJECT;
  45. trtp_rtcp_sdes_item_type_t type;
  46. tsk_buffer_t *data;
  47. }
  48. trtp_rtcp_sdes_item_t;
  49. typedef tsk_list_t trtp_rtcp_sdes_items_L_t; /**< List of @ref trtp_rtcp_sdes_item_t elements */
  50. trtp_rtcp_sdes_item_t* trtp_rtcp_sdes_item_create(trtp_rtcp_sdes_item_type_t type, const void* data, uint8_t length);
  51. trtp_rtcp_sdes_item_t* trtp_rtcp_sdes_item_deserialize(const void* data, tsk_size_t size);
  52. tsk_buffer_t* trtp_rtcp_sdes_item_serialize(const trtp_rtcp_sdes_item_t* self);
  53. int trtp_rtcp_sdes_item_serialize_to(const trtp_rtcp_sdes_item_t* self, void* data, tsk_size_t size);
  54. tsk_size_t trtp_rtcp_sdes_item_get_size(const trtp_rtcp_sdes_item_t* self);
  55. TRTP_END_DECLS
  56. #endif /* TINYRTP_RTCP_SDES_ITEM_H */