tmsrp_header_Authorization.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. * Copyright (C) 2009 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 tmsrp_header_Authorization.h
  23. * @brief MSRP header 'Authorization'.
  24. *
  25. * @author Mamadou Diop <diopmamadou [at) doubango (DOT) org>
  26. *
  27. */
  28. #ifndef _TMSRP_HEADER_AUTHORIZATION_H_
  29. #define _TMSRP_HEADER_AUTHORIZATION_H_
  30. #include "tinymsrp_config.h"
  31. #include "tinymsrp/headers/tmsrp_header.h"
  32. TMSRP_BEGIN_DECLS
  33. ////////////////////////////////////////////////////////////////////////////////////////////////////
  34. /// @struct
  35. ///
  36. /// @brief MSRP header 'Authorization' as per RFC 3261 subclause .
  37. ///
  38. /// @par ABNF = Authorization = "Authorization" HCOLON credentials
  39. /// credentials = ("Digest" LWS digest-response) / other-response
  40. /// digest-response = dig-resp *(COMMA dig-resp)
  41. /// dig-resp = username / realm / nonce / digest-uri / dresponse / algorithm / cnonce / opaque / message-qop / nonce-count / auth-param / auts
  42. /// username = "username" EQUAL username-value
  43. /// username-value = quoted-string
  44. /// digest-uri = "uri" EQUAL LDQUOT digest-uri-value RDQUOT
  45. /// digest-uri-value = auth-request-uri ; equal to request-uri as specified by HTTP/1.1
  46. /// message-qop = "qop" EQUAL qop-value
  47. /// cnonce = "cnonce" EQUAL cnonce-value
  48. /// cnonce-value = nonce-value
  49. /// nonce-count = "nc" EQUAL nc-value
  50. /// nc-value = 8LHEX
  51. /// dresponse = "response" EQUAL request-digest
  52. /// request-digest = LDQUOT 32LHEX RDQUOT
  53. /// auth-request-uri = not-defined
  54. ///
  55. /// auth-param = auth-param-name EQUAL ( token / quoted-string )
  56. /// auth-param-name = token
  57. ///
  58. /// other-response = auth-scheme LWS auth-param *(COMMA auth-param)
  59. /// auth-scheme = token
  60. /// auts = "auts" EQUAL auts-param
  61. /// auts-param = LDQUOT auts-value RDQUOT
  62. /// auts-value = <base64 encoding of AUTS>
  63. ///
  64. ////////////////////////////////////////////////////////////////////////////////////////////////////
  65. typedef struct tmsrp_header_Authorization_s {
  66. TMSRP_DECLARE_HEADER;
  67. char* scheme;
  68. char* username;
  69. char* realm;
  70. char* nonce;
  71. char* uri;
  72. char* response;
  73. char* algorithm;
  74. char* cnonce;
  75. char* opaque;
  76. char* qop;
  77. char* nc;
  78. tsk_params_L_t *params;
  79. }
  80. tmsrp_header_Authorization_t;
  81. tmsrp_header_Authorization_t *tmsrp_header_Authorization_parse(const char *data, tsk_size_t size);
  82. TINYMSRP_GEXTERN const tsk_object_def_t *tmsrp_header_Authorization_def_t;
  83. TMSRP_END_DECLS
  84. #endif /* _TMSRP_HEADER_AUTHORIZATION_H_ */