Changeset 754 for pjproject/trunk/pjlib-util/include/pjlib-util/resolver.h
- Timestamp:
- Oct 8, 2006 1:56:07 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib-util/include/pjlib-util/resolver.h
r753 r754 31 31 32 32 /** 33 * @defgroup PJ_DNS_RESOLVER Asynchronous DNS Server Resolution34 * @ingroup PJ LIB_UTIL33 * @defgroup PJ_DNS_RESOLVER DNS Asynchronous/Caching Resolution Engine 34 * @ingroup PJ_DNS 35 35 * @{ 36 36 * … … 133 133 * 134 134 * Note that a single response entry will occupy about 600-700 bytes of 135 * pool memory. 135 * pool memory (the PJ_DNS_RESOLVER_RES_BUF_SIZE value plus internal 136 * structure). 136 137 * 137 138 * Application can work around this problem by doing one of these: … … 149 150 * The PJLIB-UTIL resolver was built from the information in the following 150 151 * standards: 151 * - RFC 1035: "Domain names - implementation and specification" 152 * - RFC 2782: "A DNS RR for specifying the location of services (DNS SRV)" 153 */ 154 155 156 /* 157 * CONFIGURATIONS 158 */ 159 160 /** 161 * Maximum numbers of DNS nameservers that can be configured in resolver. 162 */ 163 #ifndef PJ_DNS_RESOLVER_MAX_NS 164 # define PJ_DNS_RESOLVER_MAX_NS 16 165 #endif 166 167 168 /** 169 * Default retransmission delay, in miliseconds. The combination of 170 * retransmission delay and count determines the query timeout. 171 * 172 * Default: 2000 (2 seconds, according to RFC 1035) 173 */ 174 #ifndef PJ_DNS_RESOLVER_QUERY_RETRANSMIT_DELAY 175 # define PJ_DNS_RESOLVER_QUERY_RETRANSMIT_DELAY 2000 176 #endif 177 178 179 /** 180 * Maximum number of transmissions before timeout is declared for 181 * the query. 182 * 183 * Default: 2 184 */ 185 #ifndef PJ_DNS_RESOLVER_QUERY_RETRANSMIT_COUNT 186 # define PJ_DNS_RESOLVER_QUERY_RETRANSMIT_COUNT 5 187 #endif 188 189 190 /** 191 * Maximum life-time of DNS response in the resolver response cache, 192 * in seconds. If the value is zero, then DNS response caching will be 193 * disabled. 194 * 195 * Default is 300 seconds (5 minutes). 196 * 197 * @see PJ_DNS_RESOLVER_INVALID_TTL 198 */ 199 #ifndef PJ_DNS_RESOLVER_MAX_TTL 200 # define PJ_DNS_RESOLVER_MAX_TTL (5*60) 201 #endif 202 203 /** 204 * The life-time of invalid DNS response in the resolver response cache. 205 * An invalid DNS response is a response without an answer. These 206 * responses can be put in the cache too to minimize message round-trip. 207 * 208 * Default: 0 (which means, invalid DNS response will not be cached). 209 * 210 * @see PJ_DNS_RESOLVER_MAX_TTL 211 */ 212 #ifndef PJ_DNS_RESOLVER_INVALID_TTL 213 # define PJ_DNS_RESOLVER_INVALID_TTL 60 214 #endif 215 216 /** 217 * The interval on which nameservers which are known to be good to be 218 * probed again to determine whether they are still good. Note that 219 * this applies to both active nameserver (the one currently being used) 220 * and idle nameservers (good nameservers that are not currently selected). 221 * The probing to query the "goodness" of nameservers involves sending 222 * the same query to multiple servers, so it's probably not a good idea 223 * to send this probing too often. 224 * 225 * Default: 600 (ten minutes) 226 * 227 * @see PJ_DNS_RESOLVER_BAD_NS_TTL 228 */ 229 #ifndef PJ_DNS_RESOLVER_GOOD_NS_TTL 230 # define PJ_DNS_RESOLVER_GOOD_NS_TTL (10*60) 231 #endif 232 233 /** 234 * The interval on which nameservers which known to be bad to be probed 235 * again to determine whether it is still bad. 236 * 237 * Default: 600 (ten minutes) 238 * 239 * @see PJ_DNS_RESOLVER_GOOD_NS_TTL 240 */ 241 #ifndef PJ_DNS_RESOLVER_BAD_NS_TTL 242 # define PJ_DNS_RESOLVER_BAD_NS_TTL (1*60) 243 #endif 244 245 246 /** 247 * Maximum size of UDP packet. RFC 1035 states that maximum size of 248 * DNS packet carried over UDP is 512 bytes. 249 * 250 * Default: 512 byes 251 */ 252 #ifndef PJ_DNS_RESOLVER_MAX_UDP_SIZE 253 # define PJ_DNS_RESOLVER_MAX_UDP_SIZE 512 254 #endif 255 256 257 /** 258 * Size of memory pool allocated for each individual DNS response cache. 259 * This value here should be more or less the same as maximum UDP packet 260 * size (PJ_DNS_RESOLVER_MAX_UDP_SIZE), since the DNS replicator function 261 * (#pj_dns_packet_dup()) is also capable of performing name compressions. 262 * 263 * Default: 512 (as a broad guidance, 400 is good for 4 SRV entries). 264 */ 265 #ifndef PJ_DNS_RESOLVER_RES_BUF_SIZE 266 # define PJ_DNS_RESOLVER_RES_BUF_SIZE 512 267 #endif 152 * - <A HREF="http://www.faqs.org/rfcs/rfc1035.html"> 153 * RFC 1035: "Domain names - implementation and specification"</A> 154 * - <A HREF="http://www.faqs.org/rfcs/rfc2782.html"> 155 * RFC 2782: "A DNS RR for specifying the location of services (DNS SRV)" 156 * </A> 157 */ 268 158 269 159
Note: See TracChangeset
for help on using the changeset viewer.