1 /*
2  * Copyright (c) 2008-2020, OARC, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  *
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in
14  *    the documentation and/or other materials provided with the
15  *    distribution.
16  *
17  * 3. Neither the name of the copyright holder nor the names of its
18  *    contributors may be used to endorse or promote products derived
19  *    from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  */
34 
35 #ifndef __dsc_config_hooks_h
36 #define __dsc_config_hooks_h
37 
38 #include "dataset_opt.h"
39 #include "geoip.h"
40 
41 enum dnstap_via {
42     dnstap_via_file,
43     dnstap_via_unixsock,
44     dnstap_via_tcp,
45     dnstap_via_udp,
46 };
47 
48 extern const char** KnownTLDS;
49 
50 int  open_interface(const char* interface);
51 int  open_dnstap(enum dnstap_via via, const char* file_or_ip, const char* port, const char* user, const char* group, const char* umask);
52 int  set_bpf_program(const char* s);
53 int  add_local_address(const char* s, const char* m);
54 int  set_run_dir(const char* dir);
55 int  set_pid_file(const char* s);
56 int  set_statistics_interval(const char* s);
57 int  add_dataset(const char* name, const char* layer_ignored, const char* firstname, const char* firstindexer, const char* secondname, const char* secondindexer, const char* filtername, dataset_opt opts);
58 int  set_bpf_vlan_tag_byte_order(const char* which);
59 int  set_match_vlan(const char* s);
60 int  set_minfree_bytes(const char* s);
61 int  set_output_format(const char* output_format);
62 void set_dump_reports_on_exit(void);
63 int  set_geoip_v4_dat(const char* dat, int options);
64 int  set_geoip_v6_dat(const char* dat, int options);
65 int  set_geoip_asn_v4_dat(const char* dat, int options);
66 int  set_geoip_asn_v6_dat(const char* dat, int options);
67 int  set_asn_indexer_backend(enum geoip_backend backend);
68 int  set_country_indexer_backend(enum geoip_backend backend);
69 int  set_maxminddb_asn(const char* file);
70 int  set_maxminddb_country(const char* file);
71 int  set_pcap_buffer_size(const char* s);
72 void set_no_wait_interval(void);
73 int  set_pt_timeout(const char* s);
74 void set_drop_ip_fragments(void);
75 int  set_dns_port(const char* s);
76 int  set_response_time_mode(const char* s);
77 int  set_response_time_max_queries(const char* s);
78 int  set_response_time_full_mode(const char* s);
79 int  set_response_time_max_seconds(const char* s);
80 int  set_response_time_max_sec_mode(const char* s);
81 int  set_response_time_bucket_size(const char* s);
82 int  load_knowntlds(const char* file);
83 
84 #endif /* __dsc_config_hooks_h */
85