Don't enable dnsmasq IPSET functionality on 2.4 kernel
[tomato.git] / release / src / router / radvd / defaults.h
blob89cd7f772e1c1a32a3440f74fa7232cb49b8b024
1 /*
3 * Authors:
4 * Lars Fenneberg <lf@elemental.net>
6 * This software is Copyright 1996,1997 by the above mentioned author(s),
7 * All Rights Reserved.
9 * The license which is distributed with this software in the file COPYRIGHT
10 * applies to this software. If your distribution is missing this file, you
11 * may request it from <pekkas@netcore.fi>.
15 #ifndef DEFAULTS_H
16 #define DEFAULTS_H
18 #include "config.h"
19 #include "includes.h"
20 #include "radvd.h"
22 /* maximum message size for incoming and outgoing RSs and RAs */
23 #define MSG_SIZE_RECV 1500
24 #define MSG_SIZE_SEND 1452
26 #define MAX2(X,Y) ( (( X ) >= ( Y )) ? ( X ) : ( Y ))
29 /* Router Configuration Variables: */
31 /* For each multicast interface: */
33 #define DFLT_IgnoreIfMissing 1
34 #define DFLT_AdvSendAdv 0
35 #define DFLT_MaxRtrAdvInterval 600
36 #define DFLT_MinRtrAdvInterval(iface) (0.33 * (iface)->MaxRtrAdvInterval)
37 #define DFLT_AdvManagedFlag 0
38 #define DFLT_AdvOtherConfigFlag 0
39 #define DFLT_AdvLinkMTU 0
40 #define DFLT_AdvReachableTime 0
41 #define DFLT_AdvRetransTimer 0
42 #define DFLT_AdvCurHopLimit 64 /* as per RFC 1700 or the
43 next incarnation of it :) */
44 #define DFLT_AdvDefaultLifetime(iface) MAX2(1, (int)(3.0 * (iface)->MaxRtrAdvInterval))
45 #define DFLT_MinDelayBetweenRAs MIN_DELAY_BETWEEN_RAS
46 #define DFLT_AdvDefaultPreference 0
48 /* Options sent with RA */
50 #define DFLT_AdvSourceLLAddress 1
52 /* Each prefix has an associated: */
54 #define DFLT_AdvValidLifetime 86400 /* seconds */
55 #define DFLT_AdvOnLinkFlag 1
56 #define DFLT_AdvPreferredLifetime 14400 /* seconds */
57 #define DFLT_AdvAutonomousFlag 1
58 #define DFLT_DeprecatePrefixFlag 0
59 #define DFLT_DecrementLifetimesFlag 0
61 /* Each route has an associated: */
62 #define DFLT_AdvRouteLifetime(iface) (3 * (iface)->MaxRtrAdvInterval)
64 #define DFLT_AdvRoutePreference 0 /* medium*/
65 #define DFLT_RemoveRouteFlag 1
67 /* RDNSS */
68 #define DFLT_AdvRDNSSLifetime(iface) (iface)->MaxRtrAdvInterval
69 #define DFLT_FlushRDNSSFlag 1
71 /* DNSSL */
72 #define DFLT_AdvDNSSLLifetime(iface) (iface)->MaxRtrAdvInterval
73 #define DFLT_FlushDNSSLFlag 1
75 /* Protocol (RFC4861) constants: */
77 /* Router constants: */
79 #define MAX_INITIAL_RTR_ADVERT_INTERVAL 16
80 #define MAX_INITIAL_RTR_ADVERTISEMENTS 3
81 #define MAX_FINAL_RTR_ADVERTISEMENTS 3
82 #define MIN_DELAY_BETWEEN_RAS 3.0
83 #define MIN_DELAY_BETWEEN_RAS_MIPv6 (30.0/1000.0)
84 #define MAX_RA_DELAY_TIME (1000.0/2.0) /* milliseconds */
86 /* Host constants: */
88 #define MAX_RTR_SOLICITATION_DELAY 1
89 #define RTR_SOLICITATION_INTERVAL 4
90 #define MAX_RTR_SOLICITATIONS 3
92 /* Node constants: */
94 #define MAX_MULTICAST_SOLICIT 3
95 #define MAX_UNICAST_SOLICIT 3
96 #define MAX_ANYCAST_DELAY_TIME 1
97 #define MAX_NEIGHBOR_ADVERTISEMENT 3
98 #define REACHABLE_TIME 30000 /* milliseconds */
99 #define RETRANS_TIMER 1000 /* milliseconds */
100 #define DELAY_FIRST_PROBE_TIME 5
101 #define MIN_RANDOM_FACTOR (1.0/2.0)
102 #define MAX_RANDOM_FACTOR (3.0/2.0)
104 /* MAX and MIN (RFC4861), Mobile IPv6 extensions will override if in use */
106 #define MIN_MaxRtrAdvInterval 4
107 #define MAX_MaxRtrAdvInterval 1800
109 #define MIN_MinRtrAdvInterval 3
110 #define MAX_MinRtrAdvInterval(iface) (0.75 * (iface)->MaxRtrAdvInterval)
112 #define MIN_AdvDefaultLifetime(iface) (MAX2(1,(iface)->MaxRtrAdvInterval))
113 #define MAX_AdvDefaultLifetime 9000
115 #define MIN_AdvLinkMTU 1280
116 #define MAX_AdvLinkMTU 131072
118 #define MIN_AdvReachableTime 100
119 #define MAX_AdvReachableTime 3600000 /* 1 hour in milliseconds */
121 #define MIN_AdvRetransTimer 10
122 #define MAX_AdvRetransTimer 3600000
124 #define MIN_AdvCurHopLimit 2
125 #define MAX_AdvCurHopLimit 255
127 #define MAX_PrefixLen 128
129 /* SLAAC (RFC4862) Constants and Derived Values */
130 #define MIN_AdvValidLifetime 7203 /* slight >2 hours in secs */
133 * Mobile IPv6 extensions, off by default
136 #define DFLT_AdvRouterAddr 0
137 #define DFLT_AdvHomeAgentFlag 0
138 #define DFLT_AdvIntervalOpt 0
139 #define DFLT_AdvHomeAgentInfo 0
141 /* Option types (defined also at least in glibc 2.2's netinet/icmp6.h) */
143 #ifndef ND_OPT_RTR_ADV_INTERVAL
144 #define ND_OPT_RTR_ADV_INTERVAL 7
145 #endif
146 #ifndef ND_OPT_HOME_AGENT_INFO
147 #define ND_OPT_HOME_AGENT_INFO 8
148 #endif
150 /* de-facto codepoint used by many implementations was '9',
151 the official IANA assignment is '24' */
152 #undef ND_OPT_ROUTE_INFORMATION
153 #define ND_OPT_ROUTE_INFORMATION 24
155 /* XXX: some libc's like KAME already had nd_opt_route_info! */
156 struct nd_opt_route_info_local /* route information */
158 uint8_t nd_opt_ri_type;
159 uint8_t nd_opt_ri_len;
160 uint8_t nd_opt_ri_prefix_len;
161 uint8_t nd_opt_ri_flags_reserved;
162 uint32_t nd_opt_ri_lifetime;
163 struct in6_addr nd_opt_ri_prefix;
166 /* the reserved field is 8 bits and we're interested of the middle two: 000xx000 */
167 #define ND_OPT_RI_PRF_SHIFT 3
168 #define ND_OPT_RI_PRF_MASK (3 << ND_OPT_RI_PRF_SHIFT) /* 00011000 = 0x18 */
170 #undef ND_OPT_RDNSS_INFORMATION
171 #define ND_OPT_RDNSS_INFORMATION 25
173 /* */
174 struct nd_opt_rdnss_info_local
176 uint8_t nd_opt_rdnssi_type;
177 uint8_t nd_opt_rdnssi_len;
178 uint16_t nd_opt_rdnssi_pref_flag_reserved;
179 uint32_t nd_opt_rdnssi_lifetime;
180 struct in6_addr nd_opt_rdnssi_addr1;
181 struct in6_addr nd_opt_rdnssi_addr2;
182 struct in6_addr nd_opt_rdnssi_addr3;
184 /* pref/flag/reserved field : yyyyx00000000000 (big endian) - 00000000yyyyx000 (little indian); where yyyy = pref, x = flag */
185 #if BYTE_ORDER == BIG_ENDIAN
186 #define ND_OPT_RDNSSI_PREF_SHIFT 12
187 #else
188 #define ND_OPT_RDNSSI_PREF_SHIFT 4
189 #endif
190 #define ND_OPT_RDNSSI_PREF_MASK (0xf << ND_OPT_RDNSSI_PREF_SHIFT)
192 #undef ND_OPT_DNSSL_INFORMATION
193 #define ND_OPT_DNSSL_INFORMATION 31
195 /* */
196 struct nd_opt_dnssl_info_local
198 uint8_t nd_opt_dnssli_type;
199 uint8_t nd_opt_dnssli_len;
200 uint16_t nd_opt_dnssli_reserved;
201 uint32_t nd_opt_dnssli_lifetime;
202 unsigned char nd_opt_dnssli_suffixes[];
205 /* Flags */
207 #ifndef ND_RA_FLAG_HOME_AGENT
208 #define ND_RA_FLAG_HOME_AGENT 0x20
209 #endif
210 #ifndef ND_OPT_PI_FLAG_RADDR
211 #define ND_OPT_PI_FLAG_RADDR 0x20
212 #endif
213 #ifndef ND_OPT_RDNSSI_FLAG_S
214 #if BYTE_ORDER == BIG_ENDIAN
215 #define ND_OPT_RDNSSI_FLAG_S 0x0800
216 #else
217 #define ND_OPT_RDNSSI_FLAG_S 0x0008
218 #endif
219 #endif
221 /* Configurable values */
223 #define DFLT_HomeAgentPreference 0
224 #define DFLT_HomeAgentLifetime(iface) ((iface)->AdvDefaultLifetime)
226 /* Other */
228 #define MIN_MinRtrAdvInterval_MIPv6 (3.0/100.0)
229 #define MIN_MaxRtrAdvInterval_MIPv6 (7.0/100.0)
230 #define RTR_SOLICITATION_INTERVAL_MIPv6 1 /* Recommended value by MIPv6 */
232 #define Cautious_MaxRtrAdvInterval (2.0/10.0)
233 #define Cautious_MaxRtrAdvInterval_Leeway (2.0/100.0)
235 #define MIN_HomeAgentLifetime 1 /* 0 must NOT be used */
236 #define MAX_HomeAgentLifetime 65520 /* 18.2 hours in secs */
238 /* #define MAX_RTR_SOLICITATIONS This MAY be ignored by MIPv6 */
240 /* NEMO extensions, off by default */
241 #define DFLT_AdvMobRtrSupportFlag 0
243 /* Flags */
245 #ifndef ND_OPT_HAI_FLAG_SUPPORT_MR
246 #if BYTE_ORDER == BIG_ENDIAN
247 #define ND_OPT_HAI_FLAG_SUPPORT_MR 0x8000
248 #else /* BYTE_ORDER == LITTLE_ENDIAN */
249 #define ND_OPT_HAI_FLAG_SUPPORT_MR 0x0080
250 #endif
251 #endif
253 #endif