forked from aarond10/https_dns_proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoptions.h
More file actions
69 lines (52 loc) · 1.58 KB
/
options.h
File metadata and controls
69 lines (52 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// Holds options that can be supplied via commandline.
#ifndef _OPTIONS_H_
#define _OPTIONS_H_
#include <stdint.h>
struct Options {
const char *listen_addr;
uint16_t listen_port;
// Logfile.
const char *logfile;
int logfd;
int loglevel;
// Whether to fork into background.
int daemonize;
// User/group to drop permissions to if root.
// Not used if running as non-root.
const char *user;
const char *group;
// Derived from the above.
uid_t uid;
gid_t gid;
// DNS servers to look up resolver host (e.g. dns.google)
const char *bootstrap_dns;
int bootstrap_dns_polling_interval;
int ipv4; // if non-zero, will only use AF_INET addresses.
int dscp; // mark packet with DSCP
// Resolver URL prefix to use. Must start with https://.
const char *resolver_url;
// Optional http proxy if required.
// e.g. "socks5://127.0.0.1:1080"
const char *curl_proxy;
// 1 = Use only HTTP/1.1 for limited OpenWRT libcurl (which is not built with HTTP/2 support)
// 2 = Use only HTTP/2 default
// 3 = Use only HTTP/3 QUIC
int use_http_version;
// Print statistic interval
int stats_interval;
// Path to a file containing CA certificates
const char *ca_info;
} __attribute__((aligned(128)));
typedef struct Options options_t;
#ifdef __cplusplus
extern "C" {
#endif
const char * options_sw_version(void);
void options_init(struct Options *opt);
int options_parse_args(struct Options *opt, int argc, char **argv);
void options_show_usage(int argc, char **argv);
void options_cleanup(struct Options *opt);
#ifdef __cplusplus
}
#endif
#endif // _OPTIONS_H_