mirror of https://github.com/dnomd343/ClearDNS
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
988 B
52 lines
988 B
2 years ago
|
#ifndef _CONFIG_H_
|
||
|
#define _CONFIG_H_
|
||
2 years ago
|
|
||
|
#include "common.h"
|
||
|
|
||
|
typedef struct {
|
||
|
uint16_t port;
|
||
|
uint8_t verify; // bool value
|
||
|
uint8_t parallel; // bool value
|
||
|
char **bootstrap;
|
||
|
char **fallback;
|
||
|
char **primary;
|
||
|
} upstream_config;
|
||
|
|
||
|
typedef struct {
|
||
|
uint16_t port;
|
||
|
char **gfwlist;
|
||
|
char **china_ip;
|
||
|
char **chinalist;
|
||
|
} diverter_config;
|
||
|
|
||
|
typedef struct {
|
||
|
uint32_t size;
|
||
|
uint8_t enable; // bool value
|
||
|
uint8_t optimistic; // bool value
|
||
|
} cache_config;
|
||
|
|
||
|
typedef struct {
|
||
|
uint16_t port;
|
||
|
uint8_t enable;
|
||
|
char *username;
|
||
|
char *password;
|
||
|
} adguard_config;
|
||
|
|
||
|
typedef struct {
|
||
|
uint16_t port;
|
||
|
cache_config cache;
|
||
|
upstream_config domestic;
|
||
|
upstream_config foreign;
|
||
|
diverter_config diverter;
|
||
|
adguard_config adguard;
|
||
|
uint32_t **reject;
|
||
|
char **hosts;
|
||
|
char **ttl;
|
||
|
} cleardns_config;
|
||
|
|
||
2 years ago
|
cleardns_config* config_init();
|
||
|
void config_dump(cleardns_config *config);
|
||
|
void config_free(cleardns_config *config);
|
||
2 years ago
|
|
||
|
#endif
|