mdns_opts.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /**
  2. * @file
  3. * MDNS responder
  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_OPTS_H
  38. #define LWIP_HDR_APPS_MDNS_OPTS_H
  39. #include "lwip/opt.h"
  40. /**
  41. * @defgroup mdns_opts Options
  42. * @ingroup mdns
  43. * @{
  44. */
  45. /**
  46. * LWIP_MDNS_RESPONDER==1: Turn on multicast DNS module. UDP must be available for MDNS
  47. * transport. IGMP is needed for IPv4 multicast.
  48. */
  49. #ifndef LWIP_MDNS_RESPONDER
  50. #define LWIP_MDNS_RESPONDER 0
  51. #endif /* LWIP_MDNS_RESPONDER */
  52. /** The maximum number of services per netif */
  53. #ifndef MDNS_MAX_SERVICES
  54. #define MDNS_MAX_SERVICES 1
  55. #endif
  56. /** The minimum delay between probes in ms. RFC 6762 require 250ms.
  57. * In noisy WiFi environment, adding 30-50ms to this value help a lot for
  58. * a successful Apple BCT tests.
  59. */
  60. #ifndef MDNS_PROBE_DELAY_MS
  61. #define MDNS_PROBE_DELAY_MS 250
  62. #endif
  63. /** The maximum number of received packets stored in chained list of known
  64. * answers for pending truncated questions. This value define the size of
  65. * the MDNS_PKTS mempool.
  66. * Up to MDNS_MAX_STORED_PKTS pbuf can be stored in addition to TC questions
  67. * that are pending.
  68. */
  69. #ifndef MDNS_MAX_STORED_PKTS
  70. #define MDNS_MAX_STORED_PKTS 4
  71. #endif
  72. /** Payload size allocated for each outgoing UDP packet. Will be allocated with
  73. * PBUF_RAM and freed after packet was sent.
  74. * According to RFC 6762, there is no reason to retain the 512 bytes restriction
  75. * for link-local multicast packet.
  76. * 512 bytes isn't enough when 2 services need to be probed.
  77. */
  78. #ifndef MDNS_OUTPUT_PACKET_SIZE
  79. #define MDNS_OUTPUT_PACKET_SIZE ((MDNS_MAX_SERVICES == 1) ? 512 : 1450)
  80. #endif
  81. /** MDNS_RESP_USENETIF_EXTCALLBACK==1: register an ext_callback on the netif
  82. * to automatically restart probing/announcing on status or address change.
  83. */
  84. #ifndef MDNS_RESP_USENETIF_EXTCALLBACK
  85. #define MDNS_RESP_USENETIF_EXTCALLBACK LWIP_NETIF_EXT_STATUS_CALLBACK
  86. #endif
  87. /**
  88. * LWIP_MDNS_SEARCH==1: Turn on search over multicast DNS module.
  89. */
  90. #ifndef LWIP_MDNS_SEARCH
  91. #define LWIP_MDNS_SEARCH 1
  92. #endif
  93. /** The maximum number of running requests */
  94. #ifndef MDNS_MAX_REQUESTS
  95. #define MDNS_MAX_REQUESTS 2
  96. #endif
  97. /**
  98. * MDNS_DEBUG: Enable debugging for multicast DNS.
  99. */
  100. #ifndef MDNS_DEBUG
  101. #define MDNS_DEBUG LWIP_DBG_OFF
  102. #endif
  103. /**
  104. * @}
  105. */
  106. #endif /* LWIP_HDR_APPS_MDNS_OPTS_H */