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
60 lines (45 loc) · 1.31 KB
/
options.h
File metadata and controls
60 lines (45 loc) · 1.31 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
// 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;
// Hack to fix OpenWRT issues due to dropping of HTTP/2 support from libcurl.
int use_http_1_1;
};
typedef struct Options options_t;
#ifdef __cplusplus
extern "C" {
#endif
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_