1/* dnsmasq is Copyright (c) 2000 Simon Kelley
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
5   the Free Software Foundation; version 2 dated June, 1991.
6
7   This program is distributed in the hope that it will be useful,
8   but WITHOUT ANY WARRANTY; without even the implied warranty of
9   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10   GNU General Public License for more details.
11*/
12
13/* Author's email: simon@thekelleys.org.uk */
14
15#define VERSION "1.10"
16
17#define FTABSIZ 20 /* max number of outstanding requests */
18#define CACHESIZ 150 /* default cache size */
19#define MAXTOK 50 /* token in DHCP leases */
20#define SMALLDNAME 40 /* most domain names are smaller than this */
21#define CONFFILE "/etc/dnsmasq.conf"
22#define HOSTSFILE "/etc/hosts"
23#define RESOLVFILE "/etc/resolv.conf"
24#define RUNFILE "/var/run/dnsmasq.pid"
25#define CHUSER "nobody"
26#define IP6INTERFACES "/proc/net/if_inet6"
27
28/* Follows system specific switches. If you run on a
29   new system, you may want to edit these.
30   May replace this with Autoconf one day.
31
32HAVE_IPV6
33   define this to include IPv6 support. There's very little to be gained
34   by leaving IPv6 support out, but this flag should enable compilation
35   against a libc which doesn't support IPv6
36
37HAVE_LINUX_IPV6_PROC
38   define this to do IPv6 interface discovery using
39   proc/net/if_inet6 ala LINUX.
40
41HAVE_GETOPT_LONG
42   define this if you have GNU libc or GNU getopt.
43
44HAVE_BROKEN_SOCKADDR_IN6
45   we provide our own declaration of sockaddr_in6,
46   since old versions of glibc are broken.
47
48HAVE_ARC4RANDOM
49   define this if you have arc4random() to get better security from DNS spoofs
50   by using really random ids (OpenBSD)
51
52HAVE_RANDOM
53   define this if you have the 4.2BSD random() function (and its
54   associated srandom() function), which is at least as good as (if not
55   better than) the rand() function.
56
57HAVE_DEV_RANDOM
58   define this if you have the /dev/random device, which gives truly
59   random numbers but may run out of random numbers.
60
61HAVE_DEV_URANDOM
62   define this if you have the /dev/urandom device, which gives
63   semi-random numbers when it runs out of truly random numbers.
64
65HAVE_SOCKADDR_SA_LEN
66   define this if struct sockaddr has sa_len field (*BSD)
67
68HAVE_FORK
69  define this if unless you don't want dnsmasq to fork while
70  backgrounding itself. Undefing it is only useful on uCLinux.
71
72NOTES:
73   For Linux you should define
74      HAVE_IPV6
75      HAVE_LINUX_IPV6_PROC
76      HAVE_GETOPT_LONG
77      HAVE_RANDOM
78      HAVE_DEV_RANDOM
79      HAVE_DEV_URANDOM
80   you should NOT define
81      HAVE_ARC4RANDOM
82      HAVE_SOCKADDR_SA_LEN
83   and you MAY have to define
84     HAVE_BROKEN_SOCKADDR_IN6 - if you have an old libc6.
85
86   For *BSD systems you should define
87     HAVE_IPV6
88     HAVE_SOCKADDR_SA_LEN
89     HAVE_RANDOM
90   you should NOT define
91     HAVE_LINUX_IPV6_PROC
92     HAVE_BROKEN_SOCKADDR_IN6
93   and you MAY define
94     HAVE_ARC4RANDOM - OpenBSD and FreeBSD
95     HAVE_DEV_URANDOM - OpenBSD and FreeBSD
96     HAVE_DEV_RANDOM - FreeBSD (OpenBSD with hardware random number generator)
97     HAVE_GETOPT_LONG - only if you link GNU getopt.
98
99   For all *nix systems _other_ than uClinux you should define
100     HAVE_FORK
101*/
102
103/* Must preceed __linux__ dince uClinux defines __linux__ too. */
104#if defined(__uClinux__)
105#undef HAVE_IPV6
106#undef HAVE_LINUX_IPV6_PROC
107#define HAVE_GETOPT_LONG
108#undef HAVE_ARC4RANDOM
109#define HAVE_RANDOM
110#define HAVE_DEV_URANDOM
111#define HAVE_DEV_RANDOM
112#undef HAVE_SOCKADDR_SA_LEN
113#undef HAVE_BROKEN_SOCKADDR_IN6
114#undef HAVE_FORK
115#define HAVE_FILE_SYSTEM
116
117#undef RESOLVFILE
118#define RESOLVFILE "/etc/config/resolv.conf"
119
120#elif defined(__linux__)
121#define HAVE_IPV6
122#define HAVE_LINUX_IPV6_PROC
123#define HAVE_GETOPT_LONG
124#undef HAVE_ARC4RANDOM
125#define HAVE_RANDOM
126#define HAVE_DEV_URANDOM
127#define HAVE_DEV_RANDOM
128#undef HAVE_SOCKADDR_SA_LEN
129#define HAVE_BROKEN_SOCKADDR_IN6
130#define HAVE_FORK
131#define HAVE_FILE_SYSTEM
132
133#elif defined(__FreeBSD__) || defined(__OpenBSD__)
134#define HAVE_IPV6
135#undef HAVE_LINUX_IPV6_PROC
136#undef HAVE_GETOPT_LONG
137#define HAVE_ARC4RANDOM
138#define HAVE_RANDOM
139#define HAVE_DEV_URANDOM
140#define HAVE_SOCKADDR_SA_LEN
141#undef HAVE_BROKEN_SOCKADDR_IN6
142#define HAVE_FORK
143#define HAVE_FILE_SYSTEM
144
145#elif defined(__NetBSD__)
146#define HAVE_IPV6
147#undef HAVE_LINUX_IPV6_PROC
148#undef HAVE_GETOPT_LONG
149#undef HAVE_ARC4RANDOM
150#define HAVE_RANDOM
151#undef HAVE_DEV_URANDOM
152#undef HAVE_DEV_RANDOM
153#define HAVE_SOCKADDR_SA_LEN
154#undef HAVE_BROKEN_SOCKADDR_IN6
155#define HAVE_FORK
156#define HAVE_FILE_SYSTEM
157
158/* env "LIBS=-lsocket -lnsl" make */
159#elif defined(__sun) || defined(__sun__)
160#define HAVE_IPV6
161#undef HAVE_LINUX_IPV6_PROC
162#undef HAVE_GETOPT_LONG
163#undef HAVE_ARC4RANDOM
164#define HAVE_RANDOM
165#undef HAVE_DEV_URANDOM
166#undef HAVE_DEV_RANDOM
167#undef HAVE_SOCKADDR_SA_LEN
168#undef HAVE_BROKEN_SOCKADDR_IN6
169#define HAVE_FORK
170#define HAVE_FILE_SYSTEM
171
172#endif
173
174
175
176
177