tsdp_header_K.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Copyright (C) 2010-2011 Mamadou Diop.
  3. *
  4. * Contact: Mamadou Diop <diopmamadou(at)doubango[dot]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. /**@file tsdp_header_K.h
  23. * @brief SDP "k=" header (Encryption Key).
  24. *
  25. * @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
  26. *
  27. *
  28. */
  29. #ifndef _TSDP_HEADER_K_H_
  30. #define _TSDP_HEADER_K_H_
  31. #include "tinysdp_config.h"
  32. #include "tinysdp/headers/tsdp_header.h"
  33. TSDP_BEGIN_DECLS
  34. #define TSDP_HEADER_K_VA_ARGS(value) tsdp_header_K_def_t, (const char*)value
  35. ////////////////////////////////////////////////////////////////////////////////////////////////////
  36. /// @struct
  37. ///
  38. /// @brief SDP "k=" header (Encryption Key).
  39. ///
  40. ///
  41. /// @par ABNF : k= key-type
  42. /// key-type = "prompt" / "clear:" text / "base64:" base64 / "uri:" uri
  43. /// base64 = *base64-unit [base64-pad]
  44. /// base64-unit = 4base64-char
  45. /// base64-pad = 2base64-char "==" / 3base64-pad "="
  46. /// base64-char = ALPHA / DIGIT / "+" / "/"
  47. ///
  48. ////////////////////////////////////////////////////////////////////////////////////////////////////
  49. typedef struct tsdp_header_K_s {
  50. TSDP_DECLARE_HEADER;
  51. char* value;
  52. }
  53. tsdp_header_K_t;
  54. typedef tsk_list_t tsdp_headers_K_L_t;
  55. TINYSDP_API tsdp_header_K_t* tsdp_header_K_create(const char* value);
  56. TINYSDP_API tsdp_header_K_t* tsdp_header_K_create_null();
  57. tsdp_header_K_t *tsdp_header_K_parse(const char *data, tsk_size_t size);
  58. TINYSDP_GEXTERN const tsk_object_def_t *tsdp_header_K_def_t;
  59. TSDP_END_DECLS
  60. #endif /* _TSDP_HEADER_P_H_ */