1 /* 2 * util/config_file.h - reads and stores the config file for unbound. 3 * 4 * Copyright (c) 2007, NLnet Labs. All rights reserved. 5 * 6 * This software is open source. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: 11 * 12 * Redistributions of source code must retain the above copyright notice, 13 * this list of conditions and the following disclaimer. 14 * 15 * Redistributions in binary form must reproduce the above copyright notice, 16 * this list of conditions and the following disclaimer in the documentation 17 * and/or other materials provided with the distribution. 18 * 19 * Neither the name of the NLNET LABS nor the names of its contributors may 20 * be used to endorse or promote products derived from this software without 21 * specific prior written permission. 22 * 23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 29 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 30 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 31 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 32 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 */ 35 36 /** 37 * \file 38 * 39 * This file contains functions for the config file. 40 */ 41 42 #ifndef UTIL_CONFIG_FILE_H 43 #define UTIL_CONFIG_FILE_H 44 struct config_stub; 45 struct config_auth; 46 struct config_view; 47 struct config_strlist; 48 struct config_str2list; 49 struct config_str3list; 50 struct config_strbytelist; 51 struct module_qstate; 52 struct sock_list; 53 struct ub_packed_rrset_key; 54 struct regional; 55 56 /** List head for strlist processing, used for append operation. */ 57 struct config_strlist_head { 58 /** first in list of text items */ 59 struct config_strlist* first; 60 /** last in list of text items */ 61 struct config_strlist* last; 62 }; 63 64 /** 65 * The configuration options. 66 * Strings are malloced. 67 */ 68 struct config_file { 69 /** verbosity level as specified in the config file */ 70 int verbosity; 71 72 /** statistics interval (in seconds) */ 73 int stat_interval; 74 /** if false, statistics values are reset after printing them */ 75 int stat_cumulative; 76 /** if true, the statistics are kept in greater detail */ 77 int stat_extended; 78 79 /** number of threads to create */ 80 int num_threads; 81 82 /** port on which queries are answered. */ 83 int port; 84 /** do ip4 query support. */ 85 int do_ip4; 86 /** do ip6 query support. */ 87 int do_ip6; 88 /** prefer ip4 upstream queries. */ 89 int prefer_ip4; 90 /** prefer ip6 upstream queries. */ 91 int prefer_ip6; 92 /** do udp query support. */ 93 int do_udp; 94 /** do tcp query support. */ 95 int do_tcp; 96 /** max number of queries on a reuse connection. */ 97 size_t max_reuse_tcp_queries; 98 /** timeout for REUSE entries in milliseconds. */ 99 int tcp_reuse_timeout; 100 /** timeout in milliseconds for TCP queries to auth servers. */ 101 int tcp_auth_query_timeout; 102 /** tcp upstream queries (no UDP upstream queries) */ 103 int tcp_upstream; 104 /** udp upstream enabled when no UDP downstream is enabled (do_udp no)*/ 105 int udp_upstream_without_downstream; 106 /** maximum segment size of tcp socket which queries are answered */ 107 int tcp_mss; 108 /** maximum segment size of tcp socket for outgoing queries */ 109 int outgoing_tcp_mss; 110 /** tcp idle timeout, in msec */ 111 int tcp_idle_timeout; 112 /** do edns tcp keepalive */ 113 int do_tcp_keepalive; 114 /** tcp keepalive timeout, in msec */ 115 int tcp_keepalive_timeout; 116 117 /** private key file for dnstcp-ssl service (enabled if not NULL) */ 118 char* ssl_service_key; 119 /** public key file for dnstcp-ssl service */ 120 char* ssl_service_pem; 121 /** port on which to provide ssl service */ 122 int ssl_port; 123 /** if outgoing tcp connections use SSL */ 124 int ssl_upstream; 125 /** cert bundle for outgoing connections */ 126 char* tls_cert_bundle; 127 /** should the system certificate store get added to the cert bundle */ 128 int tls_win_cert; 129 /** additional tls ports */ 130 struct config_strlist* tls_additional_port; 131 /** secret key used to encrypt and decrypt TLS session ticket */ 132 struct config_strlist_head tls_session_ticket_keys; 133 /** TLS ciphers */ 134 char* tls_ciphers; 135 /** TLS chiphersuites (TLSv1.3) */ 136 char* tls_ciphersuites; 137 /** if SNI is to be used */ 138 int tls_use_sni; 139 140 /** port on which to provide DNS over HTTPS service */ 141 int https_port; 142 /** endpoint for HTTP service */ 143 char* http_endpoint; 144 /** MAX_CONCURRENT_STREAMS HTTP/2 setting */ 145 uint32_t http_max_streams; 146 /** maximum size of all HTTP2 query buffers combined. */ 147 size_t http_query_buffer_size; 148 /** maximum size of all HTTP2 response buffers combined. */ 149 size_t http_response_buffer_size; 150 /** set TCP_NODELAY option for http sockets */ 151 int http_nodelay; 152 /** Disable TLS for http sockets downstream */ 153 int http_notls_downstream; 154 155 /** outgoing port range number of ports (per thread) */ 156 int outgoing_num_ports; 157 /** number of outgoing tcp buffers per (per thread) */ 158 size_t outgoing_num_tcp; 159 /** number of incoming tcp buffers per (per thread) */ 160 size_t incoming_num_tcp; 161 /** allowed udp port numbers, array with 0 if not allowed */ 162 int* outgoing_avail_ports; 163 164 /** EDNS buffer size to use */ 165 size_t edns_buffer_size; 166 /** size of the stream wait buffers, max */ 167 size_t stream_wait_size; 168 /** number of bytes buffer size for DNS messages */ 169 size_t msg_buffer_size; 170 /** size of the message cache */ 171 size_t msg_cache_size; 172 /** slabs in the message cache. */ 173 size_t msg_cache_slabs; 174 /** number of queries every thread can service */ 175 size_t num_queries_per_thread; 176 /** number of msec to wait before items can be jostled out */ 177 size_t jostle_time; 178 /** size of the rrset cache */ 179 size_t rrset_cache_size; 180 /** slabs in the rrset cache */ 181 size_t rrset_cache_slabs; 182 /** host cache ttl in seconds */ 183 int host_ttl; 184 /** number of slabs in the infra host cache */ 185 size_t infra_cache_slabs; 186 /** max number of hosts in the infra cache */ 187 size_t infra_cache_numhosts; 188 /** min value for infra cache rtt */ 189 int infra_cache_min_rtt; 190 /** keep probing hosts that are down */ 191 int infra_keep_probing; 192 /** delay close of udp-timeouted ports, if 0 no delayclose. in msec */ 193 int delay_close; 194 /** udp_connect enable uses UDP connect to mitigate ICMP side channel */ 195 int udp_connect; 196 197 /** the target fetch policy for the iterator */ 198 char* target_fetch_policy; 199 /** percent*10, how many times in 1000 to pick from the fastest 200 * destinations */ 201 int fast_server_permil; 202 /** number of fastest server to select from */ 203 size_t fast_server_num; 204 205 /** automatic interface for incoming messages. Uses ipv6 remapping, 206 * and recvmsg/sendmsg ancillary data to detect interfaces, boolean */ 207 int if_automatic; 208 /** SO_RCVBUF size to set on port 53 UDP socket */ 209 size_t so_rcvbuf; 210 /** SO_SNDBUF size to set on port 53 UDP socket */ 211 size_t so_sndbuf; 212 /** SO_REUSEPORT requested on port 53 sockets */ 213 int so_reuseport; 214 /** IP_TRANSPARENT socket option requested on port 53 sockets */ 215 int ip_transparent; 216 /** IP_FREEBIND socket option request on port 53 sockets */ 217 int ip_freebind; 218 /** IP_TOS socket option requested on port 53 sockets */ 219 int ip_dscp; 220 221 /** number of interfaces to open. If 0 default all interfaces. */ 222 int num_ifs; 223 /** interface description strings (IP addresses) */ 224 char **ifs; 225 226 /** number of outgoing interfaces to open. 227 * If 0 default all interfaces. */ 228 int num_out_ifs; 229 /** outgoing interface description strings (IP addresses) */ 230 char **out_ifs; 231 232 /** the root hints */ 233 struct config_strlist* root_hints; 234 /** the stub definitions, linked list */ 235 struct config_stub* stubs; 236 /** the forward zone definitions, linked list */ 237 struct config_stub* forwards; 238 /** the auth zone definitions, linked list */ 239 struct config_auth* auths; 240 /** the views definitions, linked list */ 241 struct config_view* views; 242 /** list of donotquery addresses, linked list */ 243 struct config_strlist* donotqueryaddrs; 244 #ifdef CLIENT_SUBNET 245 /** list of servers we send edns-client-subnet option to and 246 * accept option from, linked list */ 247 struct config_strlist* client_subnet; 248 /** list of zones we send edns-client-subnet option for */ 249 struct config_strlist* client_subnet_zone; 250 /** opcode assigned by IANA for edns0-client-subnet option */ 251 uint16_t client_subnet_opcode; 252 /** Do not check whitelist if incoming query contains an ECS record */ 253 int client_subnet_always_forward; 254 /** Subnet length we are willing to give up privacy for */ 255 uint8_t max_client_subnet_ipv4; 256 uint8_t max_client_subnet_ipv6; 257 /** Minimum subnet length we are willing to answer */ 258 uint8_t min_client_subnet_ipv4; 259 uint8_t min_client_subnet_ipv6; 260 /** Max number of nodes in the ECS radix tree */ 261 uint32_t max_ecs_tree_size_ipv4; 262 uint32_t max_ecs_tree_size_ipv6; 263 #endif 264 /** list of access control entries, linked list */ 265 struct config_str2list* acls; 266 /** use default localhost donotqueryaddr entries */ 267 int donotquery_localhost; 268 269 /** list of tcp connection limitss, linked list */ 270 struct config_str2list* tcp_connection_limits; 271 272 /** harden against very small edns buffer sizes */ 273 int harden_short_bufsize; 274 /** harden against very large query sizes */ 275 int harden_large_queries; 276 /** harden against spoofed glue (out of zone data) */ 277 int harden_glue; 278 /** harden against receiving no DNSSEC data for trust anchor */ 279 int harden_dnssec_stripped; 280 /** harden against queries that fall under known nxdomain names */ 281 int harden_below_nxdomain; 282 /** harden the referral path, query for NS,A,AAAA and validate */ 283 int harden_referral_path; 284 /** harden against algorithm downgrade */ 285 int harden_algo_downgrade; 286 /** use 0x20 bits in query as random ID bits */ 287 int use_caps_bits_for_id; 288 /** 0x20 whitelist, domains that do not use capsforid */ 289 struct config_strlist* caps_whitelist; 290 /** strip away these private addrs from answers, no DNS Rebinding */ 291 struct config_strlist* private_address; 292 /** allow domain (and subdomains) to use private address space */ 293 struct config_strlist* private_domain; 294 /** what threshold for unwanted action. */ 295 size_t unwanted_threshold; 296 /** the number of seconds maximal TTL used for RRsets and messages */ 297 int max_ttl; 298 /** the number of seconds minimum TTL used for RRsets and messages */ 299 int min_ttl; 300 /** the number of seconds maximal negative TTL for SOA in auth */ 301 int max_negative_ttl; 302 /** if prefetching of messages should be performed. */ 303 int prefetch; 304 /** if prefetching of DNSKEYs should be performed. */ 305 int prefetch_key; 306 /** deny queries of type ANY with an empty answer */ 307 int deny_any; 308 309 /** chrootdir, if not "" or chroot will be done */ 310 char* chrootdir; 311 /** username to change to, if not "". */ 312 char* username; 313 /** working directory */ 314 char* directory; 315 /** filename to log to. */ 316 char* logfile; 317 /** pidfile to write pid to. */ 318 char* pidfile; 319 320 /** should log messages be sent to syslogd */ 321 int use_syslog; 322 /** log timestamp in ascii UTC */ 323 int log_time_ascii; 324 /** log queries with one line per query */ 325 int log_queries; 326 /** log replies with one line per reply */ 327 int log_replies; 328 /** tag log_queries and log_replies for filtering */ 329 int log_tag_queryreply; 330 /** log every local-zone hit **/ 331 int log_local_actions; 332 /** log servfails with a reason */ 333 int log_servfail; 334 /** log identity to report */ 335 char* log_identity; 336 337 /** do not report identity (id.server, hostname.bind) */ 338 int hide_identity; 339 /** do not report version (version.server, version.bind) */ 340 int hide_version; 341 /** do not report trustanchor (trustanchor.unbound) */ 342 int hide_trustanchor; 343 /** do not report the User-Agent HTTP header */ 344 int hide_http_user_agent; 345 /** identity, hostname is returned if "". */ 346 char* identity; 347 /** version, package version returned if "". */ 348 char* version; 349 /** User-Agent for HTTP header */ 350 char* http_user_agent; 351 /** nsid */ 352 char *nsid_cfg_str; 353 uint8_t *nsid; 354 uint16_t nsid_len; 355 356 /** the module configuration string */ 357 char* module_conf; 358 359 /** files with trusted DS and DNSKEYs in zonefile format, list */ 360 struct config_strlist* trust_anchor_file_list; 361 /** list of trustanchor keys, linked list */ 362 struct config_strlist* trust_anchor_list; 363 /** files with 5011 autotrust tracked keys */ 364 struct config_strlist* auto_trust_anchor_file_list; 365 /** files with trusted DNSKEYs in named.conf format, list */ 366 struct config_strlist* trusted_keys_file_list; 367 /** insecure domain list */ 368 struct config_strlist* domain_insecure; 369 /** send key tag query */ 370 int trust_anchor_signaling; 371 /** enable root key sentinel */ 372 int root_key_sentinel; 373 374 /** if not 0, this value is the validation date for RRSIGs */ 375 int32_t val_date_override; 376 /** the minimum for signature clock skew */ 377 int32_t val_sig_skew_min; 378 /** the maximum for signature clock skew */ 379 int32_t val_sig_skew_max; 380 /** max number of query restarts, number of IPs to probe */ 381 int32_t val_max_restart; 382 /** this value sets the number of seconds before revalidating bogus */ 383 int bogus_ttl; 384 /** should validator clean additional section for secure msgs */ 385 int val_clean_additional; 386 /** log bogus messages by the validator */ 387 int val_log_level; 388 /** squelch val_log_level to log - this is library goes to callback */ 389 int val_log_squelch; 390 /** should validator allow bogus messages to go through */ 391 int val_permissive_mode; 392 /** use cached NSEC records to synthesise (negative) answers */ 393 int aggressive_nsec; 394 /** ignore the CD flag in incoming queries and refuse them bogus data */ 395 int ignore_cd; 396 /** serve expired entries and prefetch them */ 397 int serve_expired; 398 /** serve expired entries until TTL after expiration */ 399 int serve_expired_ttl; 400 /** reset serve expired TTL after failed update attempt */ 401 int serve_expired_ttl_reset; 402 /** TTL for the serve expired replies */ 403 int serve_expired_reply_ttl; 404 /** serve expired entries only after trying to update the entries and this 405 * timeout (in milliseconds) is reached */ 406 int serve_expired_client_timeout; 407 /** serve original TTLs rather than decrementing ones */ 408 int serve_original_ttl; 409 /** nsec3 maximum iterations per key size, string */ 410 char* val_nsec3_key_iterations; 411 /** if zonemd failures are permitted, only logged */ 412 int zonemd_permissive_mode; 413 /** autotrust add holddown time, in seconds */ 414 unsigned int add_holddown; 415 /** autotrust del holddown time, in seconds */ 416 unsigned int del_holddown; 417 /** autotrust keep_missing time, in seconds. 0 is forever. */ 418 unsigned int keep_missing; 419 /** permit small holddown values, allowing 5011 rollover very fast */ 420 int permit_small_holddown; 421 422 /** size of the key cache */ 423 size_t key_cache_size; 424 /** slabs in the key cache. */ 425 size_t key_cache_slabs; 426 /** size of the neg cache */ 427 size_t neg_cache_size; 428 429 /** local zones config */ 430 struct config_str2list* local_zones; 431 /** local zones nodefault list */ 432 struct config_strlist* local_zones_nodefault; 433 #ifdef USE_IPSET 434 /** local zones ipset list */ 435 struct config_strlist* local_zones_ipset; 436 #endif 437 /** do not add any default local zone */ 438 int local_zones_disable_default; 439 /** local data RRs configured */ 440 struct config_strlist* local_data; 441 /** local zone override types per netblock */ 442 struct config_str3list* local_zone_overrides; 443 /** unblock lan zones (reverse lookups for AS112 zones) */ 444 int unblock_lan_zones; 445 /** insecure lan zones (don't validate AS112 zones) */ 446 int insecure_lan_zones; 447 /** list of zonename, tagbitlist */ 448 struct config_strbytelist* local_zone_tags; 449 /** list of aclname, tagbitlist */ 450 struct config_strbytelist* acl_tags; 451 /** list of aclname, tagname, localzonetype */ 452 struct config_str3list* acl_tag_actions; 453 /** list of aclname, tagname, redirectdata */ 454 struct config_str3list* acl_tag_datas; 455 /** list of aclname, view*/ 456 struct config_str2list* acl_view; 457 /** list of IP-netblock, tagbitlist */ 458 struct config_strbytelist* respip_tags; 459 /** list of response-driven access control entries, linked list */ 460 struct config_str2list* respip_actions; 461 /** RRs configured for response-driven access controls */ 462 struct config_str2list* respip_data; 463 /** tag list, array with tagname[i] is malloced string */ 464 char** tagname; 465 /** number of items in the taglist */ 466 int num_tags; 467 468 /** remote control section. enable toggle. */ 469 int remote_control_enable; 470 /** the interfaces the remote control should listen on */ 471 struct config_strlist_head control_ifs; 472 /** if the use-cert option is set */ 473 int control_use_cert; 474 /** port number for the control port */ 475 int control_port; 476 /** private key file for server */ 477 char* server_key_file; 478 /** certificate file for server */ 479 char* server_cert_file; 480 /** private key file for unbound-control */ 481 char* control_key_file; 482 /** certificate file for unbound-control */ 483 char* control_cert_file; 484 485 /** Python script file */ 486 struct config_strlist* python_script; 487 488 /** Dynamic library file */ 489 struct config_strlist* dynlib_file; 490 491 /** Use systemd socket activation. */ 492 int use_systemd; 493 494 /** daemonize, i.e. fork into the background. */ 495 int do_daemonize; 496 497 /* minimal response when positive answer */ 498 int minimal_responses; 499 500 /* RRSet roundrobin */ 501 int rrset_roundrobin; 502 503 /* wait time for unknown server in msec */ 504 int unknown_server_time_limit; 505 506 /* maximum UDP response size */ 507 size_t max_udp_size; 508 509 /* DNS64 prefix */ 510 char* dns64_prefix; 511 512 /* Synthetize all AAAA record despite the presence of an authoritative one */ 513 int dns64_synthall; 514 /** ignore AAAAs for these domain names and use A record anyway */ 515 struct config_strlist* dns64_ignore_aaaa; 516 517 /** true to enable dnstap support */ 518 int dnstap; 519 /** using bidirectional frame streams if true */ 520 int dnstap_bidirectional; 521 /** dnstap socket path */ 522 char* dnstap_socket_path; 523 /** dnstap IP */ 524 char* dnstap_ip; 525 /** dnstap TLS enable */ 526 int dnstap_tls; 527 /** dnstap tls server authentication name */ 528 char* dnstap_tls_server_name; 529 /** dnstap server cert bundle */ 530 char* dnstap_tls_cert_bundle; 531 /** dnstap client key for client authentication */ 532 char* dnstap_tls_client_key_file; 533 /** dnstap client cert for client authentication */ 534 char* dnstap_tls_client_cert_file; 535 /** true to send "identity" via dnstap */ 536 int dnstap_send_identity; 537 /** true to send "version" via dnstap */ 538 int dnstap_send_version; 539 /** dnstap "identity", hostname is used if "". */ 540 char* dnstap_identity; 541 /** dnstap "version", package version is used if "". */ 542 char* dnstap_version; 543 544 /** true to log dnstap RESOLVER_QUERY message events */ 545 int dnstap_log_resolver_query_messages; 546 /** true to log dnstap RESOLVER_RESPONSE message events */ 547 int dnstap_log_resolver_response_messages; 548 /** true to log dnstap CLIENT_QUERY message events */ 549 int dnstap_log_client_query_messages; 550 /** true to log dnstap CLIENT_RESPONSE message events */ 551 int dnstap_log_client_response_messages; 552 /** true to log dnstap FORWARDER_QUERY message events */ 553 int dnstap_log_forwarder_query_messages; 554 /** true to log dnstap FORWARDER_RESPONSE message events */ 555 int dnstap_log_forwarder_response_messages; 556 557 /** true to disable DNSSEC lameness check in iterator */ 558 int disable_dnssec_lame_check; 559 560 /** ratelimit for ip addresses. 0 is off, otherwise qps (unless overridden) */ 561 int ip_ratelimit; 562 /** number of slabs for ip_ratelimit cache */ 563 size_t ip_ratelimit_slabs; 564 /** memory size in bytes for ip_ratelimit cache */ 565 size_t ip_ratelimit_size; 566 /** ip_ratelimit factor, 0 blocks all, 10 allows 1/10 of traffic */ 567 int ip_ratelimit_factor; 568 569 /** ratelimit for domains. 0 is off, otherwise qps (unless overridden) */ 570 int ratelimit; 571 /** number of slabs for ratelimit cache */ 572 size_t ratelimit_slabs; 573 /** memory size in bytes for ratelimit cache */ 574 size_t ratelimit_size; 575 /** ratelimits for domain (exact match) */ 576 struct config_str2list* ratelimit_for_domain; 577 /** ratelimits below domain */ 578 struct config_str2list* ratelimit_below_domain; 579 /** ratelimit factor, 0 blocks all, 10 allows 1/10 of traffic */ 580 int ratelimit_factor; 581 /** minimise outgoing QNAME and hide original QTYPE if possible */ 582 int qname_minimisation; 583 /** minimise QNAME in strict mode, minimise according to RFC. 584 * Do not apply fallback */ 585 int qname_minimisation_strict; 586 /** SHM data - true if shm is enabled */ 587 int shm_enable; 588 /** SHM data - key for the shm */ 589 int shm_key; 590 591 /** list of EDNS client string entries, linked list */ 592 struct config_str2list* edns_client_strings; 593 /** EDNS opcode to use for EDNS client strings */ 594 uint16_t edns_client_string_opcode; 595 596 /** DNSCrypt */ 597 /** true to enable dnscrypt */ 598 int dnscrypt; 599 /** port on which to provide dnscrypt service */ 600 int dnscrypt_port; 601 /** provider name 2.dnscrypt-cert.example.com */ 602 char* dnscrypt_provider; 603 /** dnscrypt secret keys 1.key */ 604 struct config_strlist* dnscrypt_secret_key; 605 /** dnscrypt provider certs 1.cert */ 606 struct config_strlist* dnscrypt_provider_cert; 607 /** dnscrypt provider certs 1.cert which have been rotated and should not be 608 * advertised through DNS's providername TXT record but are required to be 609 * able to handle existing traffic using the old cert. */ 610 struct config_strlist* dnscrypt_provider_cert_rotated; 611 /** memory size in bytes for dnscrypt shared secrets cache */ 612 size_t dnscrypt_shared_secret_cache_size; 613 /** number of slabs for dnscrypt shared secrets cache */ 614 size_t dnscrypt_shared_secret_cache_slabs; 615 /** memory size in bytes for dnscrypt nonces cache */ 616 size_t dnscrypt_nonce_cache_size; 617 /** number of slabs for dnscrypt nonces cache */ 618 size_t dnscrypt_nonce_cache_slabs; 619 620 /** EDNS padding according to RFC7830 and RFC8467 */ 621 /** true to enable padding of responses (default: on) */ 622 int pad_responses; 623 /** block size with which to pad encrypted responses (default: 468) */ 624 size_t pad_responses_block_size; 625 /** true to enable padding of queries (default: on) */ 626 int pad_queries; 627 /** block size with which to pad encrypted queries (default: 128) */ 628 size_t pad_queries_block_size; 629 630 /** IPsec module */ 631 #ifdef USE_IPSECMOD 632 /** false to bypass the IPsec module */ 633 int ipsecmod_enabled; 634 /** whitelisted domains for ipsecmod */ 635 struct config_strlist* ipsecmod_whitelist; 636 /** path to external hook */ 637 char* ipsecmod_hook; 638 /** true to proceed even with a bogus IPSECKEY */ 639 int ipsecmod_ignore_bogus; 640 /** max TTL for the A/AAAA records that call the hook */ 641 int ipsecmod_max_ttl; 642 /** false to proceed even when ipsecmod_hook fails */ 643 int ipsecmod_strict; 644 #endif 645 646 /* cachedb module */ 647 #ifdef USE_CACHEDB 648 /** backend DB name */ 649 char* cachedb_backend; 650 /** secret seed for hash key calculation */ 651 char* cachedb_secret; 652 #ifdef USE_REDIS 653 /** redis server's IP address or host name */ 654 char* redis_server_host; 655 /** redis server's TCP port */ 656 int redis_server_port; 657 /** timeout (in ms) for communication with the redis server */ 658 int redis_timeout; 659 /** set timeout on redis records based on DNS response ttl */ 660 int redis_expire_records; 661 #endif 662 #endif 663 664 /* ipset module */ 665 #ifdef USE_IPSET 666 char* ipset_name_v4; 667 char* ipset_name_v6; 668 #endif 669 }; 670 671 /** from cfg username, after daemonize setup performed */ 672 extern uid_t cfg_uid; 673 /** from cfg username, after daemonize setup performed */ 674 extern gid_t cfg_gid; 675 /** debug and enable small timeouts */ 676 extern int autr_permit_small_holddown; 677 /** size (in bytes) of stream wait buffers max */ 678 extern size_t stream_wait_max; 679 /** size (in bytes) of all total HTTP2 query buffers max */ 680 extern size_t http2_query_buffer_max; 681 /** size (in bytes) of all total HTTP2 response buffers max */ 682 extern size_t http2_response_buffer_max; 683 684 /** 685 * Stub config options 686 */ 687 struct config_stub { 688 /** next in list */ 689 struct config_stub* next; 690 /** domain name (in text) of the stub apex domain */ 691 char* name; 692 /** list of stub nameserver hosts (domain name) */ 693 struct config_strlist* hosts; 694 /** list of stub nameserver addresses (IP address) */ 695 struct config_strlist* addrs; 696 /** if stub-prime is set */ 697 int isprime; 698 /** if forward-first is set (failover to without if fails) */ 699 int isfirst; 700 /** use SSL for queries to this stub */ 701 int ssl_upstream; 702 /*** no cache */ 703 int no_cache; 704 }; 705 706 /** 707 * Auth config options 708 */ 709 struct config_auth { 710 /** next in list */ 711 struct config_auth* next; 712 /** domain name (in text) of the auth apex domain */ 713 char* name; 714 /** list of masters */ 715 struct config_strlist* masters; 716 /** list of urls */ 717 struct config_strlist* urls; 718 /** list of allow-notify */ 719 struct config_strlist* allow_notify; 720 /** zonefile (or NULL) */ 721 char* zonefile; 722 /** provide downstream answers */ 723 int for_downstream; 724 /** provide upstream answers */ 725 int for_upstream; 726 /** fallback to recursion to authorities if zone expired and other 727 * reasons perhaps (like, query bogus) */ 728 int fallback_enabled; 729 /** this zone is used to create local-zone policies */ 730 int isrpz; 731 /** rpz tags (or NULL) */ 732 uint8_t* rpz_taglist; 733 /** length of the taglist (in bytes) */ 734 size_t rpz_taglistlen; 735 /** Override RPZ action for this zone, regardless of zone content */ 736 char* rpz_action_override; 737 /** Log when this RPZ policy is applied */ 738 int rpz_log; 739 /** Display this name in the log when RPZ policy is applied */ 740 char* rpz_log_name; 741 /** Always reply with this CNAME target if the cname override action is 742 * used */ 743 char* rpz_cname; 744 /** Check ZONEMD records for this zone */ 745 int zonemd_check; 746 /** Reject absence of ZONEMD records, zone must have one */ 747 int zonemd_reject_absence; 748 }; 749 750 /** 751 * View config options 752 */ 753 struct config_view { 754 /** next in list */ 755 struct config_view* next; 756 /** view name */ 757 char* name; 758 /** local zones */ 759 struct config_str2list* local_zones; 760 /** local data RRs */ 761 struct config_strlist* local_data; 762 /** local zones nodefault list */ 763 struct config_strlist* local_zones_nodefault; 764 #ifdef USE_IPSET 765 /** local zones ipset list */ 766 struct config_strlist* local_zones_ipset; 767 #endif 768 /** Fallback to global local_zones when there is no match in the view 769 * view specific tree. 1 for yes, 0 for no */ 770 int isfirst; 771 /** predefined actions for particular IP address responses */ 772 struct config_str2list* respip_actions; 773 /** data complementing the 'redirect' response IP actions */ 774 struct config_str2list* respip_data; 775 }; 776 777 /** 778 * List of strings for config options 779 */ 780 struct config_strlist { 781 /** next item in list */ 782 struct config_strlist* next; 783 /** config option string */ 784 char* str; 785 }; 786 787 /** 788 * List of two strings for config options 789 */ 790 struct config_str2list { 791 /** next item in list */ 792 struct config_str2list* next; 793 /** first string */ 794 char* str; 795 /** second string */ 796 char* str2; 797 }; 798 799 /** 800 * List of three strings for config options 801 */ 802 struct config_str3list { 803 /** next item in list */ 804 struct config_str3list* next; 805 /** first string */ 806 char* str; 807 /** second string */ 808 char* str2; 809 /** third string */ 810 char* str3; 811 }; 812 813 814 /** 815 * List of string, bytestring for config options 816 */ 817 struct config_strbytelist { 818 /** next item in list */ 819 struct config_strbytelist* next; 820 /** first string */ 821 char* str; 822 /** second bytestring */ 823 uint8_t* str2; 824 size_t str2len; 825 }; 826 827 /** 828 * Create config file structure. Filled with default values. 829 * @return: the new structure or NULL on memory error. 830 */ 831 struct config_file* config_create(void); 832 833 /** 834 * Create config file structure for library use. Filled with default values. 835 * @return: the new structure or NULL on memory error. 836 */ 837 struct config_file* config_create_forlib(void); 838 839 /** 840 * Read the config file from the specified filename. 841 * @param config: where options are stored into, must be freshly created. 842 * @param filename: name of configfile. If NULL nothing is done. 843 * @param chroot: if not NULL, the chroot dir currently in use (for include). 844 * @return: false on error. In that case errno is set, ENOENT means 845 * file not found. 846 */ 847 int config_read(struct config_file* config, const char* filename, 848 const char* chroot); 849 850 /** 851 * Destroy the config file structure. 852 * @param config: to delete. 853 */ 854 void config_delete(struct config_file* config); 855 856 /** 857 * Apply config to global constants; this routine is called in single thread. 858 * @param config: to apply. Side effect: global constants change. 859 */ 860 void config_apply(struct config_file* config); 861 862 /** 863 * Find username, sets cfg_uid and cfg_gid. 864 * @param config: the config structure. 865 */ 866 void config_lookup_uid(struct config_file* config); 867 868 /** 869 * Set the given keyword to the given value. 870 * @param config: where to store config 871 * @param option: option name, including the ':' character. 872 * @param value: value, this string is copied if needed, or parsed. 873 * The caller owns the value string. 874 * @return 0 on error (malloc or syntax error). 875 */ 876 int config_set_option(struct config_file* config, const char* option, 877 const char* value); 878 879 /** 880 * Call print routine for the given option. 881 * @param cfg: config. 882 * @param opt: option name without trailing :. 883 * This is different from config_set_option. 884 * @param func: print func, called as (str, arg) for every data element. 885 * @param arg: user argument for print func. 886 * @return false if the option name is not supported (syntax error). 887 */ 888 int config_get_option(struct config_file* cfg, const char* opt, 889 void (*func)(char*,void*), void* arg); 890 891 /** 892 * Get an option and return strlist 893 * @param cfg: config file 894 * @param opt: option name. 895 * @param list: list is returned here. malloced, caller must free it. 896 * @return 0=OK, 1=syntax error, 2=malloc failed. 897 */ 898 int config_get_option_list(struct config_file* cfg, const char* opt, 899 struct config_strlist** list); 900 901 /** 902 * Get an option and collate results into string 903 * @param cfg: config file 904 * @param opt: option name. 905 * @param str: string. malloced, caller must free it. 906 * @return 0=OK, 1=syntax error, 2=malloc failed. 907 */ 908 int config_get_option_collate(struct config_file* cfg, const char* opt, 909 char** str); 910 911 /** 912 * function to print to a file, use as func with config_get_option. 913 * @param line: text to print. \n appended. 914 * @param arg: pass a FILE*, like stdout. 915 */ 916 void config_print_func(char* line, void* arg); 917 918 /** 919 * function to collate the text strings into a strlist_head. 920 * @param line: text to append. 921 * @param arg: pass a strlist_head structure. zeroed on start. 922 */ 923 void config_collate_func(char* line, void* arg); 924 925 /** 926 * take a strlist_head list and return a malloc string. separated with newline. 927 * @param list: strlist first to collate. zeroes return "". 928 * @return NULL on malloc failure. Or if malloc failure happened in strlist. 929 */ 930 char* config_collate_cat(struct config_strlist* list); 931 932 /** 933 * Append text at end of list. 934 * @param list: list head. zeroed at start. 935 * @param item: new item. malloced by caller. if NULL the insertion fails. 936 * @return true on success. 937 * on fail the item is free()ed. 938 */ 939 int cfg_strlist_append(struct config_strlist_head* list, char* item); 940 941 /** 942 * Searches the end of a string list and appends the given text. 943 * @param head: pointer to strlist head variable. 944 * @param item: new item. malloced by caller. if NULL the insertion fails. 945 * @return true on success. 946 */ 947 int cfg_strlist_append_ex(struct config_strlist** head, char* item); 948 949 /** 950 * Find string in strlist. 951 * @param head: pointer to strlist head variable. 952 * @param item: the item to search for. 953 * @return: the element in the list when found, NULL otherwise. 954 */ 955 struct config_strlist* cfg_strlist_find(struct config_strlist* head, 956 const char* item); 957 958 /** 959 * Insert string into strlist. 960 * @param head: pointer to strlist head variable. 961 * @param item: new item. malloced by caller. If NULL the insertion fails. 962 * @return: true on success. 963 * on fail, the item is free()d. 964 */ 965 int cfg_strlist_insert(struct config_strlist** head, char* item); 966 967 /** insert with region for allocation. */ 968 int cfg_region_strlist_insert(struct regional* region, 969 struct config_strlist** head, char* item); 970 971 /** 972 * Insert string into str2list. 973 * @param head: pointer to str2list head variable. 974 * @param item: new item. malloced by caller. If NULL the insertion fails. 975 * @param i2: 2nd string, malloced by caller. If NULL the insertion fails. 976 * @return: true on success. 977 * on fail, the item and i2 are free()d. 978 */ 979 int cfg_str2list_insert(struct config_str2list** head, char* item, char* i2); 980 981 /** 982 * Insert string into str3list. 983 * @param head: pointer to str3list head variable. 984 * @param item: new item. malloced by caller. If NULL the insertion fails. 985 * @param i2: 2nd string, malloced by caller. If NULL the insertion fails. 986 * @param i3: 3rd string, malloced by caller. If NULL the insertion fails. 987 * @return: true on success. 988 */ 989 int cfg_str3list_insert(struct config_str3list** head, char* item, char* i2, 990 char* i3); 991 992 /** 993 * Insert string into strbytelist. 994 * @param head: pointer to strbytelist head variable. 995 * @param item: new item. malloced by caller. If NULL the insertion fails. 996 * @param i2: 2nd string, malloced by caller. If NULL the insertion fails. 997 * @param i2len: length of the i2 bytestring. 998 * @return: true on success. 999 */ 1000 int cfg_strbytelist_insert(struct config_strbytelist** head, char* item, 1001 uint8_t* i2, size_t i2len); 1002 1003 /** 1004 * Find stub in config list, also returns prevptr (for deletion). 1005 * @param pp: call routine with pointer to a pointer to the start of the list, 1006 * if the stub is found, on exit, the value contains a pointer to the 1007 * next pointer that points to the found element (or to the list start 1008 * pointer if it is the first element). 1009 * @param nm: name of stub to find. 1010 * @return: pointer to config_stub if found, or NULL if not found. 1011 */ 1012 struct config_stub* cfg_stub_find(struct config_stub*** pp, const char* nm); 1013 1014 /** 1015 * Delete items in config string list. 1016 * @param list: list. 1017 */ 1018 void config_delstrlist(struct config_strlist* list); 1019 1020 /** 1021 * Delete items in config double string list. 1022 * @param list: list. 1023 */ 1024 void config_deldblstrlist(struct config_str2list* list); 1025 1026 /** 1027 * Delete items in config triple string list. 1028 * @param list: list. 1029 */ 1030 void config_deltrplstrlist(struct config_str3list* list); 1031 1032 /** delete string array */ 1033 void config_del_strarray(char** array, int num); 1034 1035 /** delete stringbytelist */ 1036 void config_del_strbytelist(struct config_strbytelist* list); 1037 1038 /** 1039 * Delete a stub item 1040 * @param p: stub item 1041 */ 1042 void config_delstub(struct config_stub* p); 1043 1044 /** 1045 * Delete items in config stub list. 1046 * @param list: list. 1047 */ 1048 void config_delstubs(struct config_stub* list); 1049 1050 /** 1051 * Delete an auth item 1052 * @param p: auth item 1053 */ 1054 void config_delauth(struct config_auth* p); 1055 1056 /** 1057 * Delete items in config auth list. 1058 * @param list: list. 1059 */ 1060 void config_delauths(struct config_auth* list); 1061 1062 /** 1063 * Delete a view item 1064 * @param p: view item 1065 */ 1066 void config_delview(struct config_view* p); 1067 1068 /** 1069 * Delete items in config view list. 1070 * @param list: list. 1071 */ 1072 void config_delviews(struct config_view* list); 1073 1074 /** check if config for remote control turns on IP-address interface 1075 * with certificates or a named pipe without certificates. */ 1076 int options_remote_is_address(struct config_file* cfg); 1077 1078 /** 1079 * Convert 14digit to time value 1080 * @param str: string of 14 digits 1081 * @return time value or 0 for error. 1082 */ 1083 time_t cfg_convert_timeval(const char* str); 1084 1085 /** 1086 * Count number of values in the string. 1087 * format ::= (sp num)+ sp 1088 * num ::= [-](0-9)+ 1089 * sp ::= (space|tab)* 1090 * 1091 * @param str: string 1092 * @return: 0 on parse error, or empty string, else 1093 * number of integer values in the string. 1094 */ 1095 int cfg_count_numbers(const char* str); 1096 1097 /** 1098 * Convert a 'nice' memory or file size into a bytecount 1099 * From '100k' to 102400. and so on. Understands kKmMgG. 1100 * k=1024, m=1024*1024, g=1024*1024*1024. 1101 * @param str: string 1102 * @param res: result is stored here, size in bytes. 1103 * @return: true if parsed correctly, or 0 on a parse error (and an error 1104 * is logged). 1105 */ 1106 int cfg_parse_memsize(const char* str, size_t* res); 1107 1108 /** 1109 * Parse nsid from string into binary nsid. nsid is either a hexidecimal 1110 * string or an ascii string prepended with ascii_ in which case the 1111 * characters after ascii_ are simply copied. 1112 * @param str: the string to parse. 1113 * @param nsid_len: returns length of nsid in bytes. 1114 * @return malloced bytes or NULL on parse error or malloc failure. 1115 */ 1116 uint8_t* cfg_parse_nsid(const char* str, uint16_t* nsid_len); 1117 1118 /** 1119 * Add a tag name to the config. It is added at the end with a new ID value. 1120 * @param cfg: the config structure. 1121 * @param tag: string (which is copied) with the name. 1122 * @return: false on alloc failure. 1123 */ 1124 int config_add_tag(struct config_file* cfg, const char* tag); 1125 1126 /** 1127 * Find tag ID in the tag list. 1128 * @param cfg: the config structure. 1129 * @param tag: string with tag name to search for. 1130 * @return: 0..(num_tags-1) with tag ID, or -1 if tagname is not found. 1131 */ 1132 int find_tag_id(struct config_file* cfg, const char* tag); 1133 1134 /** 1135 * parse taglist from string into bytestring with bitlist. 1136 * @param cfg: the config structure (with tagnames) 1137 * @param str: the string to parse. Parse puts 0 bytes in string. 1138 * @param listlen: returns length of in bytes. 1139 * @return malloced bytes with a bitlist of the tags. or NULL on parse error 1140 * or malloc failure. 1141 */ 1142 uint8_t* config_parse_taglist(struct config_file* cfg, char* str, 1143 size_t* listlen); 1144 1145 /** 1146 * convert tag bitlist to a malloced string with tag names. For debug output. 1147 * @param cfg: the config structure (with tagnames) 1148 * @param taglist: the tag bitlist. 1149 * @param len: length of the tag bitlist. 1150 * @return malloced string or NULL. 1151 */ 1152 char* config_taglist2str(struct config_file* cfg, uint8_t* taglist, 1153 size_t len); 1154 1155 /** 1156 * see if two taglists intersect (have tags in common). 1157 * @param list1: first tag bitlist. 1158 * @param list1len: length in bytes of first list. 1159 * @param list2: second tag bitlist. 1160 * @param list2len: length in bytes of second list. 1161 * @return true if there are tags in common, 0 if not. 1162 */ 1163 int taglist_intersect(uint8_t* list1, size_t list1len, const uint8_t* list2, 1164 size_t list2len); 1165 1166 /** 1167 * Parse local-zone directive into two strings and register it in the config. 1168 * @param cfg: to put it in. 1169 * @param val: argument strings to local-zone, "example.com nodefault". 1170 * @return: false on failure 1171 */ 1172 int cfg_parse_local_zone(struct config_file* cfg, const char* val); 1173 1174 /** 1175 * Mark "number" or "low-high" as available or not in ports array. 1176 * @param str: string in input 1177 * @param allow: give true if this range is permitted. 1178 * @param avail: the array from cfg. 1179 * @param num: size of the array (65536). 1180 * @return: true if parsed correctly, or 0 on a parse error (and an error 1181 * is logged). 1182 */ 1183 int cfg_mark_ports(const char* str, int allow, int* avail, int num); 1184 1185 /** 1186 * Get a condensed list of ports returned. allocated. 1187 * @param cfg: config file. 1188 * @param avail: the available ports array is returned here. 1189 * @return: number of ports in array or 0 on error. 1190 */ 1191 int cfg_condense_ports(struct config_file* cfg, int** avail); 1192 1193 /** 1194 * Apply system specific port range policy. 1195 * @param cfg: config file. 1196 * @param num: size of the array (65536). 1197 */ 1198 void cfg_apply_local_port_policy(struct config_file* cfg, int num); 1199 1200 /** 1201 * Scan ports available 1202 * @param avail: the array from cfg. 1203 * @param num: size of the array (65536). 1204 * @return the number of ports available for use. 1205 */ 1206 int cfg_scan_ports(int* avail, int num); 1207 1208 /** 1209 * Convert a filename to full pathname in original filesys 1210 * @param fname: the path name to convert. 1211 * Must not be null or empty. 1212 * @param cfg: config struct for chroot and chdir (if set). 1213 * @param use_chdir: if false, only chroot is applied. 1214 * @return pointer to malloced buffer which is: [chroot][chdir]fname 1215 * or NULL on malloc failure. 1216 */ 1217 char* fname_after_chroot(const char* fname, struct config_file* cfg, 1218 int use_chdir); 1219 1220 /** 1221 * Convert a ptr shorthand into a full reverse-notation PTR record. 1222 * @param str: input string, "IP name" 1223 * @return: malloced string "reversed-ip-name PTR name" 1224 */ 1225 char* cfg_ptr_reverse(char* str); 1226 1227 /** 1228 * Append text to the error info for validation. 1229 * @param qstate: query state. 1230 * @param str: copied into query region and appended. 1231 * Failures to allocate are logged. 1232 */ 1233 void errinf(struct module_qstate* qstate, const char* str); 1234 1235 /** 1236 * Append text to error info: from 1.2.3.4 1237 * @param qstate: query state. 1238 * @param origin: sock list with origin of trouble. 1239 * Every element added. 1240 * If NULL: nothing is added. 1241 * if 0len element: 'from cache' is added. 1242 */ 1243 void errinf_origin(struct module_qstate* qstate, struct sock_list *origin); 1244 1245 /** 1246 * Append text to error info: for RRset name type class 1247 * @param qstate: query state. 1248 * @param rr: rrset_key. 1249 */ 1250 void errinf_rrset(struct module_qstate* qstate, struct ub_packed_rrset_key *rr); 1251 1252 /** 1253 * Append text to error info: str dname 1254 * @param qstate: query state. 1255 * @param str: explanation string 1256 * @param dname: the dname. 1257 */ 1258 void errinf_dname(struct module_qstate* qstate, const char* str, 1259 uint8_t* dname); 1260 1261 /** 1262 * Create error info in string. For validation failures. 1263 * @param qstate: query state. 1264 * @return string or NULL on malloc failure (already logged). 1265 * This string is malloced and has to be freed by caller. 1266 */ 1267 char* errinf_to_str_bogus(struct module_qstate* qstate); 1268 1269 /** 1270 * Create error info in string. For other servfails. 1271 * @param qstate: query state. 1272 * @return string or NULL on malloc failure (already logged). 1273 * This string is malloced and has to be freed by caller. 1274 */ 1275 char* errinf_to_str_servfail(struct module_qstate* qstate); 1276 1277 /** 1278 * Used during options parsing 1279 */ 1280 struct config_parser_state { 1281 /** name of file being parser */ 1282 char* filename; 1283 /** line number in the file, starts at 1 */ 1284 int line; 1285 /** number of errors encountered */ 1286 int errors; 1287 /** the result of parsing is stored here. */ 1288 struct config_file* cfg; 1289 /** the current chroot dir (or NULL if none) */ 1290 const char* chroot; 1291 }; 1292 1293 /** global config parser object used during config parsing */ 1294 extern struct config_parser_state* cfg_parser; 1295 /** init lex state */ 1296 void init_cfg_parse(void); 1297 /** lex in file */ 1298 extern FILE* ub_c_in; 1299 /** lex out file */ 1300 extern FILE* ub_c_out; 1301 /** the yacc lex generated parse function */ 1302 int ub_c_parse(void); 1303 /** the lexer function */ 1304 int ub_c_lex(void); 1305 /** wrap function */ 1306 int ub_c_wrap(void); 1307 /** parsing helpers: print error with file and line numbers */ 1308 void ub_c_error(const char* msg); 1309 /** parsing helpers: print error with file and line numbers */ 1310 void ub_c_error_msg(const char* fmt, ...) ATTR_FORMAT(printf, 1, 2); 1311 1312 #ifdef UB_ON_WINDOWS 1313 /** 1314 * Obtain registry string (if it exists). 1315 * @param key: key string 1316 * @param name: name of value to fetch. 1317 * @return malloced string with the result or NULL if it did not 1318 * exist on an error (logged with log_err) was encountered. 1319 */ 1320 char* w_lookup_reg_str(const char* key, const char* name); 1321 1322 /** Modify directory in options for module file name */ 1323 void w_config_adjust_directory(struct config_file* cfg); 1324 #endif /* UB_ON_WINDOWS */ 1325 1326 /** debug option for unit tests. */ 1327 extern int fake_dsa, fake_sha1; 1328 1329 /** see if interface is https, its port number == the https port number */ 1330 int if_is_https(const char* ifname, const char* port, int https_port); 1331 1332 /** 1333 * Return true if the config contains settings that enable https. 1334 * @param cfg: config information. 1335 * @return true if https ports are used for server. 1336 */ 1337 int cfg_has_https(struct config_file* cfg); 1338 1339 #ifdef USE_LINUX_IP_LOCAL_PORT_RANGE 1340 #define LINUX_IP_LOCAL_PORT_RANGE_PATH "/proc/sys/net/ipv4/ip_local_port_range" 1341 #endif 1342 1343 #endif /* UTIL_CONFIG_FILE_H */ 1344 1345