blob: ecefb871576ff7d4748728dd1f2281406d72652e [file] [log] [blame]
Simon Kelleyd1ced3a2018-01-01 22:18:03 +00001/* dnsmasq is Copyright (c) 2000-2018 Simon Kelley
Simon Kelley9e4abcb2004-01-22 19:47:41 +00002
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
Simon Kelley824af852008-02-12 20:43:05 +00005 the Free Software Foundation; version 2 dated June, 1991, or
6 (at your option) version 3 dated 29 June, 2007.
7
Simon Kelley9e4abcb2004-01-22 19:47:41 +00008 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
Simon Kelley824af852008-02-12 20:43:05 +000012
Simon Kelley73a08a22009-02-05 20:28:08 +000013 You should have received a copy of the GNU General Public License
14 along with this program. If not, see <http://www.gnu.org/licenses/>.
Simon Kelley9e4abcb2004-01-22 19:47:41 +000015*/
16
Simon Kelley208b65c2006-08-05 21:41:37 +010017#define FTABSIZ 150 /* max number of outstanding requests (default) */
Simon Kelleyfeba5c12004-07-27 20:28:58 +010018#define MAX_PROCS 20 /* max no children for TCP requests */
19#define CHILD_LIFETIME 150 /* secs 'till terminated (RFC1035 suggests > 120s) */
Simon Kelley25cf5e32015-01-09 15:53:03 +000020#define TCP_MAX_QUERIES 100 /* Maximum number of queries per incoming TCP connection */
Simon Kelley09b768e2016-12-22 22:16:58 +000021#define TCP_BACKLOG 32 /* kernel backlog limit for TCP connections */
Simon Kelley316e2732010-01-22 20:16:09 +000022#define EDNS_PKTSZ 4096 /* default max EDNS.0 UDP packet from RFC5625 */
Simon Kelleya77cec82015-05-08 16:25:38 +010023#define SAFE_PKTSZ 1280 /* "go anywhere" UDP packet size */
Josh Soref730c6742017-02-06 16:14:04 +000024#define KEYBLOCK_LEN 40 /* choose to minimise fragmentation when storing DNSSEC keys */
Simon Kelley7fa836e2014-02-10 20:11:24 +000025#define DNSSEC_WORK 50 /* Max number of queries to validate one question */
Simon Kelley16972692006-10-16 20:04:18 +010026#define TIMEOUT 10 /* drop UDP queries after TIMEOUT seconds */
Simon Kelley1f15b812009-10-13 17:49:32 +010027#define FORWARD_TEST 50 /* try all servers every 50 queries */
Simon Kelley28866e92011-02-14 20:19:14 +000028#define FORWARD_TIME 20 /* or 20 seconds */
Simon Kelleyc1a4e252018-01-19 22:00:05 +000029#define UDP_TEST_TIME 60 /* How often to reset our idea of max packet size. */
Simon Kelleyb9702602016-05-03 22:34:06 +010030#define SERVERS_LOGGED 30 /* Only log this many servers when logging state */
Hannu Nyman3e2496f2017-02-11 13:44:08 +000031#define LOCALS_LOGGED 8 /* Only log this many local addresses when logging state */
Simon Kelley1a6bca82008-07-11 11:11:42 +010032#define RANDOM_SOCKS 64 /* max simultaneous random ports */
Simon Kelleycdeda282006-03-16 20:16:06 +000033#define LEASE_RETRY 60 /* on error, retry writing leasefile after LEASE_RETRY seconds */
Simon Kelley9e4abcb2004-01-22 19:47:41 +000034#define CACHESIZ 150 /* default cache size */
RinSatsuki28de3872015-01-10 15:22:21 +000035#define TTL_FLOOR_LIMIT 3600 /* don't allow --min-cache-ttl to raise TTL above this under any circumstances */
Simon Kelley316e2732010-01-22 20:16:09 +000036#define MAXLEASES 1000 /* maximum number of DHCP leases */
Simon Kelley5e9e0ef2006-04-17 14:24:29 +010037#define PING_WAIT 3 /* wait for ping address-in-use test */
38#define PING_CACHE_TIME 30 /* Ping test assumed to be valid this long. */
Simon Kelley849a8352006-06-09 21:02:31 +010039#define DECLINE_BACKOFF 600 /* disable DECLINEd static addresses for this long */
Simon Kelley5e9e0ef2006-04-17 14:24:29 +010040#define DHCP_PACKET_MAX 16384 /* hard limit on DHCP packet size */
Simon Kelley1fbe4d22014-03-01 20:03:47 +000041#define SMALLDNAME 50 /* most domain names are smaller than this */
42#define CNAME_CHAIN 10 /* chains longer than this atr dropped for loop protection */
Simon Kelley9e4abcb2004-01-22 19:47:41 +000043#define HOSTSFILE "/etc/hosts"
Simon Kelley44a2a312004-03-10 20:04:35 +000044#define ETHERSFILE "/etc/ethers"
Simon Kelleyc72daea2012-01-05 21:33:27 +000045#define DEFLEASE 3600 /* default lease time, 1 hour */
46#define CHUSER "nobody"
47#define CHGRP "dip"
48#define TFTP_MAX_CONNECTIONS 50 /* max simultaneous connections */
49#define LOG_MAX 5 /* log-queue length */
50#define RANDFILE "/dev/urandom"
Simon Kelleyad094272012-08-10 17:10:54 +010051#define DNSMASQ_SERVICE "uk.org.thekelleys.dnsmasq" /* Default - may be overridden by config */
Simon Kelleyc72daea2012-01-05 21:33:27 +000052#define DNSMASQ_PATH "/uk/org/thekelleys/dnsmasq"
Simon Kelley4f7b3042012-11-28 21:27:02 +000053#define AUTH_TTL 600 /* default TTL for auth DNS */
54#define SOA_REFRESH 1200 /* SOA refresh default */
55#define SOA_RETRY 180 /* SOA retry default */
56#define SOA_EXPIRY 1209600 /* SOA expiry default */
Simon Kelleyb5ea1cc2014-07-29 16:34:14 +010057#define LOOP_TEST_DOMAIN "test" /* domain for loop testing, "test" is reserved by RFC 2606 and won't therefore clash */
58#define LOOP_TEST_TYPE T_TXT
Simon Kelley4f7b3042012-11-28 21:27:02 +000059
Simon Kelleyc72daea2012-01-05 21:33:27 +000060/* compile-time options: uncomment below to enable or do eg.
61 make COPTS=-DHAVE_BROKEN_RTC
62
63HAVE_BROKEN_RTC
64 define this on embedded systems which don't have an RTC
65 which keeps time over reboots. Causes dnsmasq to use uptime
66 for timing, and keep lease lengths rather than expiry times
67 in its leases file. This also make dnsmasq "flash disk friendly".
68 Normally, dnsmasq tries very hard to keep the on-disk leases file
69 up-to-date: rewriting it after every renewal. When HAVE_BROKEN_RTC
70 is in effect, the lease file is only written when a new lease is
71 created, or an old one destroyed. (Because those are the only times
72 it changes.) This vastly reduces the number of file writes, and makes
73 it viable to keep the lease file on a flash filesystem.
74 NOTE: when enabling or disabling this, be sure to delete any old
75 leases file, otherwise dnsmasq may get very confused.
76
77HAVE_TFTP
78 define this to get dnsmasq's built-in TFTP server.
79
80HAVE_DHCP
81 define this to get dnsmasq's DHCPv4 server.
82
83HAVE_DHCP6
84 define this to get dnsmasq's DHCPv6 server. (implies HAVE_DHCP).
85
86HAVE_SCRIPT
87 define this to get the ability to call scripts on lease-change.
88
89HAVE_LUASCRIPT
90 define this to get the ability to call Lua script on lease-change. (implies HAVE_SCRIPT)
91
92HAVE_DBUS
93 define this if you want to link against libdbus, and have dnsmasq
94 support some methods to allow (re)configuration of the upstream DNS
95 servers via DBus.
96
97HAVE_IDN
Petr Menšíkd203af42017-05-10 21:41:57 +010098 define this if you want international domain name 2003 support.
Simon Kelley43cdf1c2017-05-21 22:12:44 +010099
Petr Menšíkd203af42017-05-10 21:41:57 +0100100HAVE_LIBIDN2
101 define this if you want international domain name 2008 support.
102
Simon Kelleyc72daea2012-01-05 21:33:27 +0000103HAVE_CONNTRACK
Josh Soref730c6742017-02-06 16:14:04 +0000104 define this to include code which propagates conntrack marks from
Simon Kelleyc72daea2012-01-05 21:33:27 +0000105 incoming DNS queries to the corresponding upstream queries. This adds
106 a build-dependency on libnetfilter_conntrack, but the resulting binary will
107 still run happily on a kernel without conntrack support.
108
Jason A. Donenfeld13d86c72013-02-22 18:20:53 +0000109HAVE_IPSET
110 define this to include the ability to selectively add resolved ip addresses
111 to given ipsets.
112
Simon Kelley4820dce2012-12-18 18:30:30 +0000113HAVE_AUTH
114 define this to include the facility to act as an authoritative DNS
115 server for one or more zones.
116
Simon Kelley063efb32014-06-17 19:49:31 +0100117HAVE_DNSSEC
118 include DNSSEC validator.
Simon Kelley4820dce2012-12-18 18:30:30 +0000119
Simon Kelleyb5ea1cc2014-07-29 16:34:14 +0100120HAVE_LOOP
121 include functionality to probe for and remove DNS forwarding loops.
122
Simon Kelley04918052015-01-26 11:23:43 +0000123HAVE_INOTIFY
124 use the Linux inotify facility to efficiently re-read configuration files.
Simon Kelleyb5ea1cc2014-07-29 16:34:14 +0100125
Kevin Darbyshire-Bryant7ac9ae12016-09-09 20:52:08 +0100126NO_ID
127 Don't report *.bind CHAOS info to clients, forward such requests upstream instead.
Simon Kelleyc72daea2012-01-05 21:33:27 +0000128NO_IPV6
129NO_TFTP
130NO_DHCP
131NO_DHCP6
132NO_SCRIPT
133NO_LARGEFILE
Simon Kelley4820dce2012-12-18 18:30:30 +0000134NO_AUTH
Simon Kelley04918052015-01-26 11:23:43 +0000135NO_INOTIFY
klemens43517fc2017-02-19 15:53:37 +0000136 these are available to explicitly disable compile time options which would
Simon Kelleyc72daea2012-01-05 21:33:27 +0000137 otherwise be enabled automatically (HAVE_IPV6, >2Gb file sizes) or
138 which are enabled by default in the distributed source tree. Building dnsmasq
139 with something like "make COPTS=-DNO_SCRIPT" will do the trick.
Simon Kelley063efb32014-06-17 19:49:31 +0100140NO_GMP
141 Don't use and link against libgmp, Useful if nettle is built with --enable-mini-gmp.
142
Simon Kelleyc72daea2012-01-05 21:33:27 +0000143LEASEFILE
144CONFFILE
145RESOLVFILE
146 the default locations of these files are determined below, but may be overridden
147 in a build command line using COPTS.
148
149*/
150
Simon Kelleyc979fa02014-01-21 13:45:17 +0000151/* Defining this builds a binary which handles time differently and works better on a system without a
152 stable RTC (it uses uptime, not epoch time) and writes the DHCP leases file less often to avoid flash wear.
153*/
154
155/* #define HAVE_BROKEN_RTC */
Simon Kelleyc72daea2012-01-05 21:33:27 +0000156
157/* The default set of options to build. Built with these options, dnsmasq
158 has no library dependencies other than libc */
159
160#define HAVE_DHCP
Simon Kelley07933802012-02-14 20:55:25 +0000161#define HAVE_DHCP6
Simon Kelleyc72daea2012-01-05 21:33:27 +0000162#define HAVE_TFTP
163#define HAVE_SCRIPT
Simon Kelley4820dce2012-12-18 18:30:30 +0000164#define HAVE_AUTH
Simon Kelley3ddad242013-03-21 17:56:06 +0000165#define HAVE_IPSET
Simon Kelleyb5ea1cc2014-07-29 16:34:14 +0100166#define HAVE_LOOP
Simon Kelleyc979fa02014-01-21 13:45:17 +0000167
168/* Build options which require external libraries.
169
170 Defining HAVE_<opt>_STATIC as _well_ as HAVE_<opt> will link the library statically.
171
172 You can use "make COPTS=-DHAVE_<opt>" instead of editing these.
173*/
174
Simon Kelleyc72daea2012-01-05 21:33:27 +0000175/* #define HAVE_LUASCRIPT */
Simon Kelleyc72daea2012-01-05 21:33:27 +0000176/* #define HAVE_DBUS */
177/* #define HAVE_IDN */
Petr Menšíkd203af42017-05-10 21:41:57 +0100178/* #define HAVE_LIBIDN2 */
Simon Kelleyc72daea2012-01-05 21:33:27 +0000179/* #define HAVE_CONNTRACK */
Simon Kelley65d1e3b2014-01-08 11:00:01 +0000180/* #define HAVE_DNSSEC */
181
Simon Kelleyc72daea2012-01-05 21:33:27 +0000182
183/* Default locations for important system files. */
Simon Kelley73a08a22009-02-05 20:28:08 +0000184
185#ifndef LEASEFILE
186# if defined(__FreeBSD__) || defined (__OpenBSD__) || defined(__DragonFly__) || defined(__NetBSD__)
187# define LEASEFILE "/var/db/dnsmasq.leases"
188# elif defined(__sun__) || defined (__sun)
189# define LEASEFILE "/var/cache/dnsmasq.leases"
Simon Kelley572b41e2011-02-18 18:11:18 +0000190# elif defined(__ANDROID__)
191# define LEASEFILE "/data/misc/dhcp/dnsmasq.leases"
Simon Kelley73a08a22009-02-05 20:28:08 +0000192# else
193# define LEASEFILE "/var/lib/misc/dnsmasq.leases"
194# endif
Simon Kelleyfeba5c12004-07-27 20:28:58 +0100195#endif
Simon Kelley73a08a22009-02-05 20:28:08 +0000196
197#ifndef CONFFILE
198# if defined(__FreeBSD__)
199# define CONFFILE "/usr/local/etc/dnsmasq.conf"
200# else
201# define CONFFILE "/etc/dnsmasq.conf"
202# endif
Simon Kelley9e4abcb2004-01-22 19:47:41 +0000203#endif
Simon Kelley73a08a22009-02-05 20:28:08 +0000204
Simon Kelleyc72daea2012-01-05 21:33:27 +0000205#ifndef RESOLVFILE
206# if defined(__uClinux__)
207# define RESOLVFILE "/etc/config/resolv.conf"
208# else
209# define RESOLVFILE "/etc/resolv.conf"
210# endif
211#endif
Simon Kelley9e4abcb2004-01-22 19:47:41 +0000212
Simon Kelley55d290a2012-06-29 20:58:32 +0100213#ifndef RUNFILE
214# if defined(__ANDROID__)
215# define RUNFILE "/data/dnsmasq.pid"
216# else
217# define RUNFILE "/var/run/dnsmasq.pid"
218# endif
219#endif
Simon Kelleyc72daea2012-01-05 21:33:27 +0000220
221/* platform dependent options: these are determined automatically below
Simon Kelley9e4abcb2004-01-22 19:47:41 +0000222
Simon Kelley5e9e0ef2006-04-17 14:24:29 +0100223HAVE_LINUX_NETWORK
Simon Kelley824af852008-02-12 20:43:05 +0000224HAVE_BSD_NETWORK
225HAVE_SOLARIS_NETWORK
226 define exactly one of these to alter interaction with kernel networking.
227
Simon Kelley9e4abcb2004-01-22 19:47:41 +0000228HAVE_GETOPT_LONG
Simon Kelleyda632e72012-03-26 11:14:05 +0100229 defined when GNU-style getopt_long available.
Simon Kelley9e4abcb2004-01-22 19:47:41 +0000230
Simon Kelley9e4abcb2004-01-22 19:47:41 +0000231HAVE_SOCKADDR_SA_LEN
Simon Kelleyc72daea2012-01-05 21:33:27 +0000232 defined if struct sockaddr has sa_len field (*BSD)
Simon Kelley9e4abcb2004-01-22 19:47:41 +0000233*/
234
Josh Soref730c6742017-02-06 16:14:04 +0000235/* Must precede __linux__ since uClinux defines __linux__ too. */
Simon Kelleye17fb622006-01-14 20:33:46 +0000236#if defined(__uClinux__)
Simon Kelley5e9e0ef2006-04-17 14:24:29 +0100237#define HAVE_LINUX_NETWORK
Simon Kelley9e4abcb2004-01-22 19:47:41 +0000238#define HAVE_GETOPT_LONG
Simon Kelley9e4abcb2004-01-22 19:47:41 +0000239#undef HAVE_SOCKADDR_SA_LEN
Simon Kelley59353a62004-11-21 19:34:28 +0000240/* Never use fork() on uClinux. Note that this is subtly different from the
241 --keep-in-foreground option, since it also suppresses forking new
Simon Kelley5aabfc72007-08-29 11:24:47 +0100242 processes for TCP connections and disables the call-a-script on leasechange
243 system. It's intended for use on MMU-less kernels. */
Simon Kelleye17fb622006-01-14 20:33:46 +0000244#define NO_FORK
245
246#elif defined(__UCLIBC__)
Simon Kelley5e9e0ef2006-04-17 14:24:29 +0100247#define HAVE_LINUX_NETWORK
Simon Kelleye17fb622006-01-14 20:33:46 +0000248#if defined(__UCLIBC_HAS_GNU_GETOPT__) || \
249 ((__UCLIBC_MAJOR__==0) && (__UCLIBC_MINOR__==9) && (__UCLIBC_SUBLEVEL__<21))
250# define HAVE_GETOPT_LONG
Simon Kelley5e9e0ef2006-04-17 14:24:29 +0100251#endif
Simon Kelleye17fb622006-01-14 20:33:46 +0000252#undef HAVE_SOCKADDR_SA_LEN
Simon Kelley7cebd202006-05-06 14:13:33 +0100253#if !defined(__ARCH_HAS_MMU__) && !defined(__UCLIBC_HAS_MMU__)
Simon Kelley9e4abcb2004-01-22 19:47:41 +0000254# define NO_FORK
255#endif
Simon Kelley7cebd202006-05-06 14:13:33 +0100256#if defined(__UCLIBC_HAS_IPV6__)
257# ifndef IPV6_V6ONLY
258# define IPV6_V6ONLY 26
259# endif
Simon Kelleye17fb622006-01-14 20:33:46 +0000260#endif
Simon Kelley9e4abcb2004-01-22 19:47:41 +0000261
Simon Kelley9e4abcb2004-01-22 19:47:41 +0000262/* This is for glibc 2.x */
263#elif defined(__linux__)
Simon Kelley5e9e0ef2006-04-17 14:24:29 +0100264#define HAVE_LINUX_NETWORK
Simon Kelley9e4abcb2004-01-22 19:47:41 +0000265#define HAVE_GETOPT_LONG
Simon Kelley9e4abcb2004-01-22 19:47:41 +0000266#undef HAVE_SOCKADDR_SA_LEN
Simon Kelley9e4abcb2004-01-22 19:47:41 +0000267
Simon Kelley9e038942008-05-30 20:06:34 +0100268#elif defined(__FreeBSD__) || \
269 defined(__OpenBSD__) || \
270 defined(__DragonFly__) || \
Simon Kelley8ef5ada2010-06-03 19:42:45 +0100271 defined(__FreeBSD_kernel__)
Simon Kelley824af852008-02-12 20:43:05 +0000272#define HAVE_BSD_NETWORK
Josh Soref730c6742017-02-06 16:14:04 +0000273/* Later versions of FreeBSD have getopt_long() */
Simon Kelley59353a62004-11-21 19:34:28 +0000274#if defined(optional_argument) && defined(required_argument)
275# define HAVE_GETOPT_LONG
Simon Kelley59353a62004-11-21 19:34:28 +0000276#endif
Simon Kelley9e4abcb2004-01-22 19:47:41 +0000277#define HAVE_SOCKADDR_SA_LEN
Simon Kelley9e4abcb2004-01-22 19:47:41 +0000278
279#elif defined(__APPLE__)
Simon Kelley824af852008-02-12 20:43:05 +0000280#define HAVE_BSD_NETWORK
Simon Kelley316e2732010-01-22 20:16:09 +0000281#define HAVE_GETOPT_LONG
Simon Kelley9e4abcb2004-01-22 19:47:41 +0000282#define HAVE_SOCKADDR_SA_LEN
Simon Kelley9e4abcb2004-01-22 19:47:41 +0000283/* Define before sys/socket.h is included so we get socklen_t */
284#define _BSD_SOCKLEN_T_
Simon Kelley6dbdc972013-10-28 14:22:57 +0000285/* Select the RFC_3542 version of the IPv6 socket API.
286 Define before netinet6/in6.h is included. */
287#define __APPLE_USE_RFC_3542
Chen Yufei993f8cb2014-07-08 22:40:03 +0100288#define NO_IPSET
Simon Kelley6dbdc972013-10-28 14:22:57 +0000289
Simon Kelley9e4abcb2004-01-22 19:47:41 +0000290#elif defined(__NetBSD__)
Simon Kelley824af852008-02-12 20:43:05 +0000291#define HAVE_BSD_NETWORK
Simon Kelleyfd9fa482004-10-21 20:24:00 +0100292#define HAVE_GETOPT_LONG
Simon Kelley9e4abcb2004-01-22 19:47:41 +0000293#define HAVE_SOCKADDR_SA_LEN
Simon Kelley824af852008-02-12 20:43:05 +0000294
295#elif defined(__sun) || defined(__sun__)
296#define HAVE_SOLARIS_NETWORK
Simon Kelley7622fc02009-06-04 20:32:05 +0100297#define HAVE_GETOPT_LONG
Simon Kelley824af852008-02-12 20:43:05 +0000298#undef HAVE_SOCKADDR_SA_LEN
Simon Kelley7622fc02009-06-04 20:32:05 +0100299#define ETHER_ADDR_LEN 6
300
Simon Kelley824af852008-02-12 20:43:05 +0000301#endif
302
Simon Kelleye17fb622006-01-14 20:33:46 +0000303/* Decide if we're going to support IPv6 */
304/* We assume that systems which don't have IPv6
305 headers don't have ntop and pton either */
306
Simon Kelleyc72daea2012-01-05 21:33:27 +0000307#if defined(INET6_ADDRSTRLEN) && defined(IPV6_V6ONLY)
Simon Kelleye17fb622006-01-14 20:33:46 +0000308# define HAVE_IPV6
309# define ADDRSTRLEN INET6_ADDRSTRLEN
Simon Kelleyb5a7ff42013-04-25 11:03:47 +0100310#else
311# if !defined(INET_ADDRSTRLEN)
312# define INET_ADDRSTRLEN 16 /* 4*3 + 3 dots + NULL */
313# endif
Simon Kelleye17fb622006-01-14 20:33:46 +0000314# undef HAVE_IPV6
315# define ADDRSTRLEN INET_ADDRSTRLEN
Simon Kelleye17fb622006-01-14 20:33:46 +0000316#endif
317
Simon Kelleyc72daea2012-01-05 21:33:27 +0000318
319/* rules to implement compile-time option dependencies and
320 the NO_XXX flags */
321
322#ifdef NO_IPV6
323#undef HAVE_IPV6
Simon Kelley1f15b812009-10-13 17:49:32 +0100324#endif
325
Simon Kelleyc72daea2012-01-05 21:33:27 +0000326#ifdef NO_TFTP
327#undef HAVE_TFTP
328#endif
329
330#ifdef NO_DHCP
331#undef HAVE_DHCP
332#undef HAVE_DHCP6
333#endif
334
335#if defined(NO_DHCP6) || !defined(HAVE_IPV6)
336#undef HAVE_DHCP6
337#endif
338
339/* DHCP6 needs DHCP too */
340#ifdef HAVE_DHCP6
341#define HAVE_DHCP
342#endif
343
Simon Kelley33702ab2015-12-28 23:17:15 +0000344#if defined(NO_SCRIPT) || defined(NO_FORK)
Simon Kelleyc72daea2012-01-05 21:33:27 +0000345#undef HAVE_SCRIPT
346#undef HAVE_LUASCRIPT
347#endif
348
349/* Must HAVE_SCRIPT to HAVE_LUASCRIPT */
350#ifdef HAVE_LUASCRIPT
351#define HAVE_SCRIPT
352#endif
353
Simon Kelley4820dce2012-12-18 18:30:30 +0000354#ifdef NO_AUTH
355#undef HAVE_AUTH
356#endif
Simon Kelleyc72daea2012-01-05 21:33:27 +0000357
Simon Kelleyc4a09372014-06-02 20:30:07 +0100358#if defined(NO_IPSET)
Jason A. Donenfeld13d86c72013-02-22 18:20:53 +0000359#undef HAVE_IPSET
360#endif
361
Simon Kelleyb5ea1cc2014-07-29 16:34:14 +0100362#ifdef NO_LOOP
363#undef HAVE_LOOP
364#endif
365
Simon Kelley04918052015-01-26 11:23:43 +0000366#if defined (HAVE_LINUX_NETWORK) && !defined(NO_INOTIFY)
367#define HAVE_INOTIFY
368#endif
369
Simon Kelleyc72daea2012-01-05 21:33:27 +0000370/* Define a string indicating which options are in use.
Josh Soref730c6742017-02-06 16:14:04 +0000371 DNSMASQ_COMPILE_OPTS is only defined in dnsmasq.c */
Simon Kelleyc72daea2012-01-05 21:33:27 +0000372
373#ifdef DNSMASQ_COMPILE_OPTS
374
375static char *compile_opts =
376#ifndef HAVE_IPV6
377"no-"
378#endif
379"IPv6 "
380#ifndef HAVE_GETOPT_LONG
381"no-"
382#endif
383"GNU-getopt "
384#ifdef HAVE_BROKEN_RTC
385"no-RTC "
386#endif
387#ifdef NO_FORK
388"no-MMU "
389#endif
390#ifndef HAVE_DBUS
391"no-"
392#endif
393"DBus "
394#ifndef LOCALEDIR
395"no-"
396#endif
397"i18n "
Simon Kelley43cdf1c2017-05-21 22:12:44 +0100398#if defined(HAVE_LIBIDN2)
Petr Menšíkd203af42017-05-10 21:41:57 +0100399"IDN2 "
Simon Kelley43cdf1c2017-05-21 22:12:44 +0100400#else
401 #if !defined(HAVE_IDN)
402"no-"
403 #endif
404"IDN "
405#endif
Simon Kelleyc72daea2012-01-05 21:33:27 +0000406#ifndef HAVE_DHCP
407"no-"
408#endif
409"DHCP "
410#if defined(HAVE_DHCP)
411# if !defined (HAVE_DHCP6)
412 "no-"
413# endif
414 "DHCPv6 "
Simon Kelleya93b02e2017-04-16 20:38:22 +0100415#endif
416#if !defined(HAVE_SCRIPT)
Simon Kelleyc72daea2012-01-05 21:33:27 +0000417 "no-scripts "
Simon Kelleya93b02e2017-04-16 20:38:22 +0100418#else
419# if !defined(HAVE_LUASCRIPT)
420 "no-"
Simon Kelleyc72daea2012-01-05 21:33:27 +0000421# endif
Simon Kelleya93b02e2017-04-16 20:38:22 +0100422 "Lua "
Simon Kelleyc72daea2012-01-05 21:33:27 +0000423#endif
424#ifndef HAVE_TFTP
425"no-"
426#endif
427"TFTP "
428#ifndef HAVE_CONNTRACK
429"no-"
430#endif
Simon Kelley4820dce2012-12-18 18:30:30 +0000431"conntrack "
Jason A. Donenfeld13d86c72013-02-22 18:20:53 +0000432#ifndef HAVE_IPSET
433"no-"
434#endif
435"ipset "
Simon Kelley4820dce2012-12-18 18:30:30 +0000436#ifndef HAVE_AUTH
437"no-"
438#endif
Simon Kelley0fc2f312014-01-08 10:26:58 +0000439"auth "
440#ifndef HAVE_DNSSEC
441"no-"
442#endif
Simon Kelleyb5ea1cc2014-07-29 16:34:14 +0100443"DNSSEC "
Kevin Darbyshire-Bryant7ac9ae12016-09-09 20:52:08 +0100444#ifdef NO_ID
445"no-ID "
446#endif
Simon Kelleyb5ea1cc2014-07-29 16:34:14 +0100447#ifndef HAVE_LOOP
448"no-"
449#endif
Simon Kelley04918052015-01-26 11:23:43 +0000450"loop-detect "
451#ifndef HAVE_INOTIFY
452"no-"
453#endif
454"inotify";
Simon Kelley0fc2f312014-01-08 10:26:58 +0000455
Simon Kelleyc72daea2012-01-05 21:33:27 +0000456
457#endif
458
459
460