Simon Kelley | 5954608 | 2012-01-06 20:02:04 +0000 | [diff] [blame^] | 1 | /* dnsmasq is Copyright (c) 2000-2012 Simon Kelley |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 2 | |
| 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 Kelley | 824af85 | 2008-02-12 20:43:05 +0000 | [diff] [blame] | 5 | the Free Software Foundation; version 2 dated June, 1991, or |
| 6 | (at your option) version 3 dated 29 June, 2007. |
| 7 | |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 8 | 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 Kelley | 824af85 | 2008-02-12 20:43:05 +0000 | [diff] [blame] | 12 | |
Simon Kelley | 73a08a2 | 2009-02-05 20:28:08 +0000 | [diff] [blame] | 13 | 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 Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 15 | */ |
| 16 | |
Simon Kelley | 208b65c | 2006-08-05 21:41:37 +0100 | [diff] [blame] | 17 | #define FTABSIZ 150 /* max number of outstanding requests (default) */ |
Simon Kelley | feba5c1 | 2004-07-27 20:28:58 +0100 | [diff] [blame] | 18 | #define MAX_PROCS 20 /* max no children for TCP requests */ |
| 19 | #define CHILD_LIFETIME 150 /* secs 'till terminated (RFC1035 suggests > 120s) */ |
Simon Kelley | 316e273 | 2010-01-22 20:16:09 +0000 | [diff] [blame] | 20 | #define EDNS_PKTSZ 4096 /* default max EDNS.0 UDP packet from RFC5625 */ |
Simon Kelley | 1697269 | 2006-10-16 20:04:18 +0100 | [diff] [blame] | 21 | #define TIMEOUT 10 /* drop UDP queries after TIMEOUT seconds */ |
Simon Kelley | 1f15b81 | 2009-10-13 17:49:32 +0100 | [diff] [blame] | 22 | #define FORWARD_TEST 50 /* try all servers every 50 queries */ |
Simon Kelley | 28866e9 | 2011-02-14 20:19:14 +0000 | [diff] [blame] | 23 | #define FORWARD_TIME 20 /* or 20 seconds */ |
Simon Kelley | 1a6bca8 | 2008-07-11 11:11:42 +0100 | [diff] [blame] | 24 | #define RANDOM_SOCKS 64 /* max simultaneous random ports */ |
Simon Kelley | cdeda28 | 2006-03-16 20:16:06 +0000 | [diff] [blame] | 25 | #define LEASE_RETRY 60 /* on error, retry writing leasefile after LEASE_RETRY seconds */ |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 26 | #define CACHESIZ 150 /* default cache size */ |
Simon Kelley | 316e273 | 2010-01-22 20:16:09 +0000 | [diff] [blame] | 27 | #define MAXLEASES 1000 /* maximum number of DHCP leases */ |
Simon Kelley | 5e9e0ef | 2006-04-17 14:24:29 +0100 | [diff] [blame] | 28 | #define PING_WAIT 3 /* wait for ping address-in-use test */ |
| 29 | #define PING_CACHE_TIME 30 /* Ping test assumed to be valid this long. */ |
Simon Kelley | 849a835 | 2006-06-09 21:02:31 +0100 | [diff] [blame] | 30 | #define DECLINE_BACKOFF 600 /* disable DECLINEd static addresses for this long */ |
Simon Kelley | 5e9e0ef | 2006-04-17 14:24:29 +0100 | [diff] [blame] | 31 | #define DHCP_PACKET_MAX 16384 /* hard limit on DHCP packet size */ |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 32 | #define SMALLDNAME 40 /* most domain names are smaller than this */ |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 33 | #define HOSTSFILE "/etc/hosts" |
Simon Kelley | 44a2a31 | 2004-03-10 20:04:35 +0000 | [diff] [blame] | 34 | #define ETHERSFILE "/etc/ethers" |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 35 | #define RUNFILE "/var/run/dnsmasq.pid" |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 36 | #define DEFLEASE 3600 /* default lease time, 1 hour */ |
| 37 | #define CHUSER "nobody" |
| 38 | #define CHGRP "dip" |
| 39 | #define TFTP_MAX_CONNECTIONS 50 /* max simultaneous connections */ |
| 40 | #define LOG_MAX 5 /* log-queue length */ |
| 41 | #define RANDFILE "/dev/urandom" |
| 42 | #define EDNS0_OPTION_MAC 5 /* dyndns.org temporary assignment */ |
| 43 | #define DNSMASQ_SERVICE "uk.org.thekelleys.dnsmasq" /* DBUS interface specifics */ |
| 44 | #define DNSMASQ_PATH "/uk/org/thekelleys/dnsmasq" |
| 45 | |
| 46 | /* compile-time options: uncomment below to enable or do eg. |
| 47 | make COPTS=-DHAVE_BROKEN_RTC |
| 48 | |
| 49 | HAVE_BROKEN_RTC |
| 50 | define this on embedded systems which don't have an RTC |
| 51 | which keeps time over reboots. Causes dnsmasq to use uptime |
| 52 | for timing, and keep lease lengths rather than expiry times |
| 53 | in its leases file. This also make dnsmasq "flash disk friendly". |
| 54 | Normally, dnsmasq tries very hard to keep the on-disk leases file |
| 55 | up-to-date: rewriting it after every renewal. When HAVE_BROKEN_RTC |
| 56 | is in effect, the lease file is only written when a new lease is |
| 57 | created, or an old one destroyed. (Because those are the only times |
| 58 | it changes.) This vastly reduces the number of file writes, and makes |
| 59 | it viable to keep the lease file on a flash filesystem. |
| 60 | NOTE: when enabling or disabling this, be sure to delete any old |
| 61 | leases file, otherwise dnsmasq may get very confused. |
| 62 | |
| 63 | HAVE_TFTP |
| 64 | define this to get dnsmasq's built-in TFTP server. |
| 65 | |
| 66 | HAVE_DHCP |
| 67 | define this to get dnsmasq's DHCPv4 server. |
| 68 | |
| 69 | HAVE_DHCP6 |
| 70 | define this to get dnsmasq's DHCPv6 server. (implies HAVE_DHCP). |
| 71 | |
| 72 | HAVE_SCRIPT |
| 73 | define this to get the ability to call scripts on lease-change. |
| 74 | |
| 75 | HAVE_LUASCRIPT |
| 76 | define this to get the ability to call Lua script on lease-change. (implies HAVE_SCRIPT) |
| 77 | |
| 78 | HAVE_DBUS |
| 79 | define this if you want to link against libdbus, and have dnsmasq |
| 80 | support some methods to allow (re)configuration of the upstream DNS |
| 81 | servers via DBus. |
| 82 | |
| 83 | HAVE_IDN |
| 84 | define this if you want international domain name support. |
| 85 | NOTE: for backwards compatibility, IDN support is automatically |
| 86 | included when internationalisation support is built, using the |
| 87 | *-i18n makefile targets, even if HAVE_IDN is not explicitly set. |
| 88 | |
| 89 | HAVE_CONNTRACK |
| 90 | define this to include code which propogates conntrack marks from |
| 91 | incoming DNS queries to the corresponding upstream queries. This adds |
| 92 | a build-dependency on libnetfilter_conntrack, but the resulting binary will |
| 93 | still run happily on a kernel without conntrack support. |
| 94 | |
| 95 | NO_IPV6 |
| 96 | NO_TFTP |
| 97 | NO_DHCP |
| 98 | NO_DHCP6 |
| 99 | NO_SCRIPT |
| 100 | NO_LARGEFILE |
| 101 | these are avilable to explictly disable compile time options which would |
| 102 | otherwise be enabled automatically (HAVE_IPV6, >2Gb file sizes) or |
| 103 | which are enabled by default in the distributed source tree. Building dnsmasq |
| 104 | with something like "make COPTS=-DNO_SCRIPT" will do the trick. |
| 105 | |
| 106 | LEASEFILE |
| 107 | CONFFILE |
| 108 | RESOLVFILE |
| 109 | the default locations of these files are determined below, but may be overridden |
| 110 | in a build command line using COPTS. |
| 111 | |
| 112 | */ |
| 113 | |
| 114 | |
| 115 | /* The default set of options to build. Built with these options, dnsmasq |
| 116 | has no library dependencies other than libc */ |
| 117 | |
| 118 | #define HAVE_DHCP |
| 119 | /* #define HAVE_DHCP6 */ |
| 120 | #define HAVE_TFTP |
| 121 | #define HAVE_SCRIPT |
| 122 | /* #define HAVE_LUASCRIPT */ |
| 123 | /* #define HAVE_BROKEN_RTC */ |
| 124 | /* #define HAVE_DBUS */ |
| 125 | /* #define HAVE_IDN */ |
| 126 | /* #define HAVE_CONNTRACK */ |
| 127 | |
| 128 | |
| 129 | |
| 130 | /* Default locations for important system files. */ |
Simon Kelley | 73a08a2 | 2009-02-05 20:28:08 +0000 | [diff] [blame] | 131 | |
| 132 | #ifndef LEASEFILE |
| 133 | # if defined(__FreeBSD__) || defined (__OpenBSD__) || defined(__DragonFly__) || defined(__NetBSD__) |
| 134 | # define LEASEFILE "/var/db/dnsmasq.leases" |
| 135 | # elif defined(__sun__) || defined (__sun) |
| 136 | # define LEASEFILE "/var/cache/dnsmasq.leases" |
Simon Kelley | 572b41e | 2011-02-18 18:11:18 +0000 | [diff] [blame] | 137 | # elif defined(__ANDROID__) |
| 138 | # define LEASEFILE "/data/misc/dhcp/dnsmasq.leases" |
Simon Kelley | 73a08a2 | 2009-02-05 20:28:08 +0000 | [diff] [blame] | 139 | # else |
| 140 | # define LEASEFILE "/var/lib/misc/dnsmasq.leases" |
| 141 | # endif |
Simon Kelley | feba5c1 | 2004-07-27 20:28:58 +0100 | [diff] [blame] | 142 | #endif |
Simon Kelley | 73a08a2 | 2009-02-05 20:28:08 +0000 | [diff] [blame] | 143 | |
| 144 | #ifndef CONFFILE |
| 145 | # if defined(__FreeBSD__) |
| 146 | # define CONFFILE "/usr/local/etc/dnsmasq.conf" |
| 147 | # else |
| 148 | # define CONFFILE "/etc/dnsmasq.conf" |
| 149 | # endif |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 150 | #endif |
Simon Kelley | 73a08a2 | 2009-02-05 20:28:08 +0000 | [diff] [blame] | 151 | |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 152 | #ifndef RESOLVFILE |
| 153 | # if defined(__uClinux__) |
| 154 | # define RESOLVFILE "/etc/config/resolv.conf" |
| 155 | # else |
| 156 | # define RESOLVFILE "/etc/resolv.conf" |
| 157 | # endif |
| 158 | #endif |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 159 | |
Simon Kelley | 3d8df26 | 2005-08-29 12:19:27 +0100 | [diff] [blame] | 160 | |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 161 | |
| 162 | /* platform dependent options: these are determined automatically below |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 163 | |
Simon Kelley | 5e9e0ef | 2006-04-17 14:24:29 +0100 | [diff] [blame] | 164 | HAVE_LINUX_NETWORK |
Simon Kelley | 824af85 | 2008-02-12 20:43:05 +0000 | [diff] [blame] | 165 | HAVE_BSD_NETWORK |
| 166 | HAVE_SOLARIS_NETWORK |
| 167 | define exactly one of these to alter interaction with kernel networking. |
| 168 | |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 169 | HAVE_GETOPT_LONG |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 170 | defined when GNU-sty;e getopt_long available. |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 171 | |
| 172 | HAVE_ARC4RANDOM |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 173 | defined if arc4random() available to get better security from DNS spoofs |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 174 | by using really random ids (OpenBSD) |
| 175 | |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 176 | HAVE_SOCKADDR_SA_LEN |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 177 | defined if struct sockaddr has sa_len field (*BSD) |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 178 | */ |
| 179 | |
| 180 | /* Must preceed __linux__ since uClinux defines __linux__ too. */ |
Simon Kelley | e17fb62 | 2006-01-14 20:33:46 +0000 | [diff] [blame] | 181 | #if defined(__uClinux__) |
Simon Kelley | 5e9e0ef | 2006-04-17 14:24:29 +0100 | [diff] [blame] | 182 | #define HAVE_LINUX_NETWORK |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 183 | #define HAVE_GETOPT_LONG |
| 184 | #undef HAVE_ARC4RANDOM |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 185 | #undef HAVE_SOCKADDR_SA_LEN |
Simon Kelley | 59353a6 | 2004-11-21 19:34:28 +0000 | [diff] [blame] | 186 | /* Never use fork() on uClinux. Note that this is subtly different from the |
| 187 | --keep-in-foreground option, since it also suppresses forking new |
Simon Kelley | 5aabfc7 | 2007-08-29 11:24:47 +0100 | [diff] [blame] | 188 | processes for TCP connections and disables the call-a-script on leasechange |
| 189 | system. It's intended for use on MMU-less kernels. */ |
Simon Kelley | e17fb62 | 2006-01-14 20:33:46 +0000 | [diff] [blame] | 190 | #define NO_FORK |
| 191 | |
| 192 | #elif defined(__UCLIBC__) |
Simon Kelley | 5e9e0ef | 2006-04-17 14:24:29 +0100 | [diff] [blame] | 193 | #define HAVE_LINUX_NETWORK |
Simon Kelley | e17fb62 | 2006-01-14 20:33:46 +0000 | [diff] [blame] | 194 | #if defined(__UCLIBC_HAS_GNU_GETOPT__) || \ |
| 195 | ((__UCLIBC_MAJOR__==0) && (__UCLIBC_MINOR__==9) && (__UCLIBC_SUBLEVEL__<21)) |
| 196 | # define HAVE_GETOPT_LONG |
Simon Kelley | 5e9e0ef | 2006-04-17 14:24:29 +0100 | [diff] [blame] | 197 | #endif |
Simon Kelley | e17fb62 | 2006-01-14 20:33:46 +0000 | [diff] [blame] | 198 | #undef HAVE_ARC4RANDOM |
Simon Kelley | e17fb62 | 2006-01-14 20:33:46 +0000 | [diff] [blame] | 199 | #undef HAVE_SOCKADDR_SA_LEN |
Simon Kelley | 7cebd20 | 2006-05-06 14:13:33 +0100 | [diff] [blame] | 200 | #if !defined(__ARCH_HAS_MMU__) && !defined(__UCLIBC_HAS_MMU__) |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 201 | # define NO_FORK |
| 202 | #endif |
Simon Kelley | 7cebd20 | 2006-05-06 14:13:33 +0100 | [diff] [blame] | 203 | #if defined(__UCLIBC_HAS_IPV6__) |
| 204 | # ifndef IPV6_V6ONLY |
| 205 | # define IPV6_V6ONLY 26 |
| 206 | # endif |
Simon Kelley | e17fb62 | 2006-01-14 20:33:46 +0000 | [diff] [blame] | 207 | #endif |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 208 | |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 209 | /* This is for glibc 2.x */ |
| 210 | #elif defined(__linux__) |
Simon Kelley | 5e9e0ef | 2006-04-17 14:24:29 +0100 | [diff] [blame] | 211 | #define HAVE_LINUX_NETWORK |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 212 | #define HAVE_GETOPT_LONG |
| 213 | #undef HAVE_ARC4RANDOM |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 214 | #undef HAVE_SOCKADDR_SA_LEN |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 215 | |
Simon Kelley | 9e03894 | 2008-05-30 20:06:34 +0100 | [diff] [blame] | 216 | #elif defined(__FreeBSD__) || \ |
| 217 | defined(__OpenBSD__) || \ |
| 218 | defined(__DragonFly__) || \ |
Simon Kelley | 8ef5ada | 2010-06-03 19:42:45 +0100 | [diff] [blame] | 219 | defined(__FreeBSD_kernel__) |
Simon Kelley | 824af85 | 2008-02-12 20:43:05 +0000 | [diff] [blame] | 220 | #define HAVE_BSD_NETWORK |
Simon Kelley | 59353a6 | 2004-11-21 19:34:28 +0000 | [diff] [blame] | 221 | /* Later verions of FreeBSD have getopt_long() */ |
| 222 | #if defined(optional_argument) && defined(required_argument) |
| 223 | # define HAVE_GETOPT_LONG |
Simon Kelley | 59353a6 | 2004-11-21 19:34:28 +0000 | [diff] [blame] | 224 | #endif |
Simon Kelley | 8ef5ada | 2010-06-03 19:42:45 +0100 | [diff] [blame] | 225 | #if !defined(__FreeBSD_kernel__) |
Simon Kelley | 1a6bca8 | 2008-07-11 11:11:42 +0100 | [diff] [blame] | 226 | # define HAVE_ARC4RANDOM |
| 227 | #endif |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 228 | #define HAVE_SOCKADDR_SA_LEN |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 229 | |
| 230 | #elif defined(__APPLE__) |
Simon Kelley | 824af85 | 2008-02-12 20:43:05 +0000 | [diff] [blame] | 231 | #define HAVE_BSD_NETWORK |
Simon Kelley | 316e273 | 2010-01-22 20:16:09 +0000 | [diff] [blame] | 232 | #define HAVE_GETOPT_LONG |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 233 | #define HAVE_ARC4RANDOM |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 234 | #define HAVE_SOCKADDR_SA_LEN |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 235 | /* Define before sys/socket.h is included so we get socklen_t */ |
| 236 | #define _BSD_SOCKLEN_T_ |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 237 | |
| 238 | #elif defined(__NetBSD__) |
Simon Kelley | 824af85 | 2008-02-12 20:43:05 +0000 | [diff] [blame] | 239 | #define HAVE_BSD_NETWORK |
Simon Kelley | fd9fa48 | 2004-10-21 20:24:00 +0100 | [diff] [blame] | 240 | #define HAVE_GETOPT_LONG |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 241 | #undef HAVE_ARC4RANDOM |
Simon Kelley | 9e4abcb | 2004-01-22 19:47:41 +0000 | [diff] [blame] | 242 | #define HAVE_SOCKADDR_SA_LEN |
Simon Kelley | 824af85 | 2008-02-12 20:43:05 +0000 | [diff] [blame] | 243 | |
| 244 | #elif defined(__sun) || defined(__sun__) |
| 245 | #define HAVE_SOLARIS_NETWORK |
Simon Kelley | 7622fc0 | 2009-06-04 20:32:05 +0100 | [diff] [blame] | 246 | #define HAVE_GETOPT_LONG |
Simon Kelley | 824af85 | 2008-02-12 20:43:05 +0000 | [diff] [blame] | 247 | #undef HAVE_ARC4RANDOM |
Simon Kelley | 824af85 | 2008-02-12 20:43:05 +0000 | [diff] [blame] | 248 | #undef HAVE_SOCKADDR_SA_LEN |
Simon Kelley | 7622fc0 | 2009-06-04 20:32:05 +0100 | [diff] [blame] | 249 | #define ETHER_ADDR_LEN 6 |
| 250 | |
Simon Kelley | 824af85 | 2008-02-12 20:43:05 +0000 | [diff] [blame] | 251 | #endif |
| 252 | |
Simon Kelley | e17fb62 | 2006-01-14 20:33:46 +0000 | [diff] [blame] | 253 | /* Decide if we're going to support IPv6 */ |
| 254 | /* We assume that systems which don't have IPv6 |
| 255 | headers don't have ntop and pton either */ |
| 256 | |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 257 | #if defined(INET6_ADDRSTRLEN) && defined(IPV6_V6ONLY) |
Simon Kelley | e17fb62 | 2006-01-14 20:33:46 +0000 | [diff] [blame] | 258 | # define HAVE_IPV6 |
| 259 | # define ADDRSTRLEN INET6_ADDRSTRLEN |
Simon Kelley | e17fb62 | 2006-01-14 20:33:46 +0000 | [diff] [blame] | 260 | #elif defined(INET_ADDRSTRLEN) |
| 261 | # undef HAVE_IPV6 |
| 262 | # define ADDRSTRLEN INET_ADDRSTRLEN |
| 263 | #else |
| 264 | # undef HAVE_IPV6 |
| 265 | # define ADDRSTRLEN 16 /* 4*3 + 3 dots + NULL */ |
| 266 | #endif |
| 267 | |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 268 | |
| 269 | /* rules to implement compile-time option dependencies and |
| 270 | the NO_XXX flags */ |
| 271 | |
| 272 | #ifdef NO_IPV6 |
| 273 | #undef HAVE_IPV6 |
Simon Kelley | 1f15b81 | 2009-10-13 17:49:32 +0100 | [diff] [blame] | 274 | #endif |
| 275 | |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 276 | #ifdef NO_TFTP |
| 277 | #undef HAVE_TFTP |
| 278 | #endif |
| 279 | |
| 280 | #ifdef NO_DHCP |
| 281 | #undef HAVE_DHCP |
| 282 | #undef HAVE_DHCP6 |
| 283 | #endif |
| 284 | |
| 285 | #if defined(NO_DHCP6) || !defined(HAVE_IPV6) |
| 286 | #undef HAVE_DHCP6 |
| 287 | #endif |
| 288 | |
| 289 | /* DHCP6 needs DHCP too */ |
| 290 | #ifdef HAVE_DHCP6 |
| 291 | #define HAVE_DHCP |
| 292 | #endif |
| 293 | |
| 294 | #if defined(NO_SCRIPT) || !defined(HAVE_DHCP) || defined(NO_FORK) |
| 295 | #undef HAVE_SCRIPT |
| 296 | #undef HAVE_LUASCRIPT |
| 297 | #endif |
| 298 | |
| 299 | /* Must HAVE_SCRIPT to HAVE_LUASCRIPT */ |
| 300 | #ifdef HAVE_LUASCRIPT |
| 301 | #define HAVE_SCRIPT |
| 302 | #endif |
| 303 | |
| 304 | |
| 305 | /* Define a string indicating which options are in use. |
| 306 | DNSMASQP_COMPILE_OPTS is only defined in dnsmasq.c */ |
| 307 | |
| 308 | #ifdef DNSMASQ_COMPILE_OPTS |
| 309 | |
| 310 | static char *compile_opts = |
| 311 | #ifndef HAVE_IPV6 |
| 312 | "no-" |
| 313 | #endif |
| 314 | "IPv6 " |
| 315 | #ifndef HAVE_GETOPT_LONG |
| 316 | "no-" |
| 317 | #endif |
| 318 | "GNU-getopt " |
| 319 | #ifdef HAVE_BROKEN_RTC |
| 320 | "no-RTC " |
| 321 | #endif |
| 322 | #ifdef NO_FORK |
| 323 | "no-MMU " |
| 324 | #endif |
| 325 | #ifndef HAVE_DBUS |
| 326 | "no-" |
| 327 | #endif |
| 328 | "DBus " |
| 329 | #ifndef LOCALEDIR |
| 330 | "no-" |
| 331 | #endif |
| 332 | "i18n " |
| 333 | #if !defined(LOCALEDIR) && !defined(HAVE_IDN) |
| 334 | "no-" |
| 335 | #endif |
| 336 | "IDN " |
| 337 | #ifndef HAVE_DHCP |
| 338 | "no-" |
| 339 | #endif |
| 340 | "DHCP " |
| 341 | #if defined(HAVE_DHCP) |
| 342 | # if !defined (HAVE_DHCP6) |
| 343 | "no-" |
| 344 | # endif |
| 345 | "DHCPv6 " |
| 346 | # if !defined(HAVE_SCRIPT) |
| 347 | "no-scripts " |
| 348 | # else |
| 349 | # if !defined(HAVE_LUASCRIPT) |
| 350 | "no-" |
| 351 | # endif |
| 352 | "Lua " |
| 353 | # endif |
| 354 | #endif |
| 355 | #ifndef HAVE_TFTP |
| 356 | "no-" |
| 357 | #endif |
| 358 | "TFTP " |
| 359 | #ifndef HAVE_CONNTRACK |
| 360 | "no-" |
| 361 | #endif |
| 362 | "conntrack"; |
| 363 | |
| 364 | #endif |
| 365 | |
| 366 | |
| 367 | |