dns_query_set.c 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * Asterisk -- An open source telephony toolkit.
  3. *
  4. * Copyright (C) 2015, Digium, Inc.
  5. *
  6. * Joshua Colp <jcolp@digium.com>
  7. *
  8. * See http://www.asterisk.org for more information about
  9. * the Asterisk project. Please do not directly contact
  10. * any of the maintainers of this project for assistance;
  11. * the project provides a web site, mailing lists and IRC
  12. * channels for your use.
  13. *
  14. * This program is free software, distributed under the terms of
  15. * the GNU General Public License Version 2. See the LICENSE file
  16. * at the top of the source tree.
  17. */
  18. /*! \file
  19. *
  20. * \brief DNS Query Set API
  21. *
  22. * \author Joshua Colp <jcolp@digium.com>
  23. */
  24. /*** MODULEINFO
  25. <support_level>core</support_level>
  26. ***/
  27. #include "asterisk.h"
  28. ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
  29. #include "asterisk/vector.h"
  30. #include "asterisk/astobj2.h"
  31. #include "asterisk/dns_core.h"
  32. #include "asterisk/dns_query_set.h"
  33. /*! \brief A set of DNS queries */
  34. struct ast_dns_query_set {
  35. /*! \brief DNS queries */
  36. AST_VECTOR(, struct ast_dns_query *) queries;
  37. /*! \brief The total number of completed queries */
  38. unsigned int queries_completed;
  39. /*! \brief Callback to invoke upon completion */
  40. ast_dns_query_set_callback callback;
  41. /*! \brief User-specific data */
  42. void *user_data;
  43. };
  44. struct ast_dns_query_set *ast_dns_query_set_create(void)
  45. {
  46. return NULL;
  47. }
  48. int ast_dns_query_set_add(struct ast_dns_query_set *query_set, const char *name, int rr_type, int rr_class)
  49. {
  50. return -1;
  51. }
  52. size_t ast_dns_query_set_num_queries(const struct ast_dns_query_set *query_set)
  53. {
  54. return 0;
  55. }
  56. struct ast_dns_query *ast_dns_query_set_get(const struct ast_dns_query_set *query_set, unsigned int index)
  57. {
  58. return NULL;
  59. }
  60. void *ast_dns_query_set_get_data(const struct ast_dns_query_set *query_set)
  61. {
  62. return query_set->user_data;
  63. }
  64. void ast_dns_query_set_resolve_async(struct ast_dns_query_set *query_set, ast_dns_query_set_callback callback, void *data)
  65. {
  66. query_set->callback = callback;
  67. query_set->user_data = ao2_bump(data);
  68. }
  69. void ast_query_set_resolve(struct ast_dns_query_set *query_set)
  70. {
  71. }
  72. int ast_dns_query_set_resolve_cancel(struct ast_dns_query_set *query_set)
  73. {
  74. return -1;
  75. }
  76. void ast_dns_query_set_free(struct ast_dns_query_set *query_set)
  77. {
  78. }