mdns_domain.h 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /**
  2. * @file
  3. * MDNS responder - domain related functionalities
  4. */
  5. /*
  6. * Copyright (c) 2015 Verisure Innovation AB
  7. * All rights reserved.
  8. *
  9. * Redistribution and use in source and binary forms, with or without modification,
  10. * are permitted provided that the following conditions are met:
  11. *
  12. * 1. Redistributions of source code must retain the above copyright notice,
  13. * this list of conditions and the following disclaimer.
  14. * 2. Redistributions in binary form must reproduce the above copyright notice,
  15. * this list of conditions and the following disclaimer in the documentation
  16. * and/or other materials provided with the distribution.
  17. * 3. The name of the author may not be used to endorse or promote products
  18. * derived from this software without specific prior written permission.
  19. *
  20. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
  21. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  22. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
  23. * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  24. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
  25. * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  26. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  27. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  28. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
  29. * OF SUCH DAMAGE.
  30. *
  31. * This file is part of the lwIP TCP/IP stack.
  32. *
  33. * Author: Erik Ekman <erik@kryo.se>
  34. * Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
  35. *
  36. */
  37. #ifndef LWIP_HDR_APPS_MDNS_DOMAIN_H
  38. #define LWIP_HDR_APPS_MDNS_DOMAIN_H
  39. #include "lwip/apps/mdns_opts.h"
  40. #include "lwip/apps/mdns_priv.h"
  41. #ifdef __cplusplus
  42. extern "C" {
  43. #endif
  44. #if LWIP_MDNS_RESPONDER
  45. /* Domain methods - also visible for unit tests */
  46. err_t mdns_domain_add_label(struct mdns_domain *domain, const char *label, u8_t len);
  47. err_t mdns_domain_add_domain(struct mdns_domain *domain, struct mdns_domain *source);
  48. err_t mdns_domain_add_string(struct mdns_domain *domain, const char *source);
  49. u16_t mdns_readname(struct pbuf *p, u16_t offset, struct mdns_domain *domain);
  50. void mdns_domain_debug_print(struct mdns_domain *domain);
  51. int mdns_domain_eq(struct mdns_domain *a, struct mdns_domain *b);
  52. #if LWIP_IPV4
  53. err_t mdns_build_reverse_v4_domain(struct mdns_domain *domain, const ip4_addr_t *addr);
  54. #endif
  55. #if LWIP_IPV6
  56. err_t mdns_build_reverse_v6_domain(struct mdns_domain *domain, const ip6_addr_t *addr);
  57. #endif
  58. err_t mdns_build_host_domain(struct mdns_domain *domain, struct mdns_host *mdns);
  59. err_t mdns_build_dnssd_domain(struct mdns_domain *domain);
  60. err_t mdns_build_service_domain(struct mdns_domain *domain, struct mdns_service *service, int include_name);
  61. #if LWIP_MDNS_SEARCH
  62. err_t mdns_build_request_domain(struct mdns_domain *domain, struct mdns_request *request, int include_name);
  63. #endif
  64. u16_t mdns_compress_domain(struct pbuf *pbuf, u16_t *offset, struct mdns_domain *domain);
  65. err_t mdns_write_domain(struct mdns_outpacket *outpkt, struct mdns_domain *domain);
  66. #endif /* LWIP_MDNS_RESPONDER */
  67. #ifdef __cplusplus
  68. }
  69. #endif
  70. #endif /* LWIP_HDR_APPS_MDNS_DOMAIN_H */