txcap_auid.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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 txcap_auid.h
  23. * @brief XCAP AUID manager.
  24. *
  25. * @author Mamadou Diop <diopmamadou [at) doubango (DOT) org>
  26. *
  27. */
  28. #ifndef TINYXCAP_TXCAP_AUID_H
  29. #define TINYXCAP_TXCAP_AUID_H
  30. #include "tinyxcap_config.h"
  31. #include "tsk_list.h"
  32. TXCAP_BEGIN_DECLS
  33. /*== xcap-caps ==*/
  34. #define TXCAP_AUID_IETF_XCAP_CAPS_ID "xcap-caps"
  35. #define TXCAP_AUID_IETF_XCAP_CAPS_MIME_TYPE "application/xcap-caps+xml"
  36. #define TXCAP_AUID_IETF_XCAP_CAPS_NS "urn:ietf:params:xml:ns:xcap-caps"
  37. #define TXCAP_AUID_IETF_XCAP_CAPS_DOC "index"
  38. /*== resource-lists ==*/
  39. #define TXCAP_AUID_IETF_RESOURCE_LISTS_ID "resource-lists"
  40. #define TXCAP_AUID_IETF_RESOURCE_LISTS_MIME_TYPE "application/resource-lists+xml"
  41. #define TXCAP_AUID_IETF_RESOURCE_LISTS_NS "urn:ietf:params:xml:ns:resource-lists"
  42. #define TXCAP_AUID_IETF_RESOURCE_LISTS_DOC "index"
  43. /*== rls-services ==*/
  44. #define TXCAP_AUID_IETF_RLS_SERVICES_ID "rls-services"
  45. #define TXCAP_AUID_IETF_RLS_SERVICES_MIME_TYPE "application/rls-services+xml"
  46. #define TXCAP_AUID_IETF_RLS_SERVICES_NS "urn:ietf:params:xml:ns:resource-lists"
  47. #define TXCAP_AUID_IETF_RLS_SERVICES_DOC "index"
  48. /*== pres-rules ==*/
  49. #define TXCAP_AUID_IETF_PRES_RULES_ID "pres-rules"
  50. #define TXCAP_AUID_IETF_PRES_RULES_MIME_TYPE "application/auth-policy+xml"
  51. #define TXCAP_AUID_IETF_PRES_RULES_NS "urn:ietf:params:xml:ns:pres-rules"
  52. #define TXCAP_AUID_IETF_PRES_RULES_DOC "index"
  53. /*== pidf-manipulation ==*/
  54. #define TXCAP_AUID_IETF_PIDF_MANIPULATION_ID "pidf-manipulation"
  55. #define TXCAP_AUID_IETF_PIDF_MANIPULATION_MIME_TYPE "application/pidf+xml"
  56. #define TXCAP_AUID_IETF_PIDF_MANIPULATION_NS "urn:ietf:params:xml:ns:pidf"
  57. #define TXCAP_AUID_IETF_PIDF_MANIPULATION_DOC "index"
  58. /*== org.openmobilealliance.pres-rules ==*/
  59. #define TXCAP_AUID_OMA_PRES_RULES_ID "org.openmobilealliance.pres-rules"
  60. #define TXCAP_AUID_OMA_PRES_RULES_MIME_TYPE "application/auth-policy+xml"
  61. #define TXCAP_AUID_OMA_PRES_RULES_NS "urn:ietf:params:xml:ns:common-policy"
  62. #define TXCAP_AUID_OMA_PRES_RULES_DOC "pres-rules"
  63. /*== directory ==*/
  64. #define TXCAP_AUID_IETF_DIRECTORY_ID "directory"
  65. #define TXCAP_AUID_IETF_DIRECTORY_MIME_TYPE "application/directory+xml"
  66. #define TXCAP_AUID_IETF_DIRECTORY_NS "urn:ietf:params:xml:ns:xcap-directory"
  67. #define TXCAP_AUID_IETF_DIRECTORY_DOC "directory.xml"
  68. /*== org.openmobilealliance.xcap-directory ==*/
  69. #define TXCAP_AUID_OMA_DIRECTORY_ID "org.openmobilealliance.xcap-directory"
  70. #define TXCAP_AUID_OMA_DIRECTORY_MIME_TYPE "application/vnd.oma.xcap-directory+xml"
  71. #define TXCAP_AUID_OMA_DIRECTORY_NS "urn:oma:xml:xdm:xcap-directory"
  72. #define TXCAP_AUID_OMA_DIRECTORY_DOC "directory.xml"
  73. /*== org.openmobilealliance.pres-content ==*/
  74. #define TXCAP_AUID_OMA_PRES_CONTENT_ID "org.openmobilealliance.pres-content"
  75. #define TXCAP_AUID_OMA_PRES_CONTENT_MIME_TYPE "application/vnd.oma.pres-content+xml"
  76. #define TXCAP_AUID_OMA_PRES_CONTENT_NS "urn:oma:xml:prs:pres-content"
  77. #define TXCAP_AUID_OMA_PRES_CONTENT_DOC "oma_status-icon/rcs_status_icon"
  78. /*== org.openmobilealliance.conv-history ==*/
  79. #define TXCAP_AUID_OMA_CONV_HISTORY_ID "org.openmobilealliance.conv-history"
  80. #define TXCAP_AUID_OMA_CONV_HISTORY_MIME_TYPE "application/vnd.oma.im.history-list+xml"
  81. #define TXCAP_AUID_OMA_CONV_HISTORY_NS "urn:oma:xml:im:history-list"
  82. #define TXCAP_AUID_OMA_CONV_HISTORY_DOC "conv-history"
  83. /*== org.openmobilealliance.deferred-list ==*/
  84. #define TXCAP_AUID_OMA_DEFERRED_LIST_ID "org.openmobilealliance.deferred-list"
  85. #define TXCAP_AUID_OMA_DEFERRED_LIST_MIME_TYPE "application/vnd.oma.im.deferred-list+xml"
  86. #define TXCAP_AUID_OMA_DEFERRED_LIST_NS "urn:oma:xml:im:history-list"
  87. #define TXCAP_AUID_OMA_DEFERRED_LIST_DOC "deferred-list"
  88. /*== org.openmobilealliance.group-usage-list ==*/
  89. #define TXCAP_AUID_OMA_SHARED_GROUPS_ID "org.openmobilealliance.group-usage-list"
  90. #define TXCAP_AUID_OMA_SHARED_GROUPS_MIME_TYPE "application/vnd.oma.group-usage-list+xml"
  91. #define TXCAP_AUID_OMA_SHARED_GROUPS_NS "urn:ietf:params:xml:ns:resource-lists"
  92. #define TXCAP_AUID_OMA_SHARED_GROUPS_DOC "index"
  93. /** List of supported AUIDs.
  94. */
  95. typedef enum txcap_auid_type_e {
  96. tauid_dummy, /**< any auid */
  97. tauid_ietf_xcap_caps, /**< xcap-caps */
  98. tauid_ietf_resource_lists, /**< resource-lists */
  99. tauid_ietf_rls_services, /**< rls-services */
  100. tauid_ietf_pres_rules, /**< pres-rules */
  101. tauid_ietf_directory, /**< directory */
  102. tauid_oma_conv_history, /**< org.openmobilealliance.conv-history */
  103. tauid_oma_pres_rules, /**< org.openmobilealliance.pres-rules */
  104. tauid_oma_directory, /**< org.openmobilealliance.xcap-directory */
  105. tauid_oma_deferred_list, /**< org.openmobilealliance.deferred-list */
  106. tauid_oma_pres_content, /**< org.openmobilealliance.pres-content*/
  107. tauid_oma_shared_groups /**< org.openmobilealliance.group-usage-list */
  108. }
  109. txcap_auid_type_t;
  110. /** XCAP AUID.
  111. */
  112. typedef struct txcap_auid_s {
  113. TSK_DECLARE_OBJECT;
  114. txcap_auid_type_t type;
  115. char* id; /**< The id of the AUID (e.g. 'xcap-caps' or 'rls-services' or 'resource-lists' or ...)*/
  116. char* mime_type; /**< The default MIME-type of the document associated to this auid. */
  117. char* ns; /**< The namespace associated to this auid. */
  118. char* document_name; /**< The default name of the document associated to this auid. */
  119. tsk_bool_t global; /**< Indicates the auid scope. */
  120. }
  121. txcap_auid_t;
  122. typedef tsk_list_t txcap_auids_L_t;
  123. TINYXCAP_API int txcap_auid_register(txcap_auids_L_t* auids, const char* id, const char* mime_type, const char* ns, const char* document_name, tsk_bool_t is_global);
  124. txcap_auid_t* txcap_auid_get_by_id(txcap_auids_L_t* auids, const char* id);
  125. int txcap_auids_init(txcap_auids_L_t** auids);
  126. TINYXCAP_GEXTERN const tsk_object_def_t *txcap_auid_def_t;
  127. TXCAP_END_DECLS
  128. #endif // TINYXCAP_TXCAP_AUID_H