Skip to content

Commit

Permalink
HevConfig: Cleanup DNS configs.
Browse files Browse the repository at this point in the history
  • Loading branch information
heiher committed May 11, 2021
1 parent 4551970 commit 1661cc5
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 48 deletions.
3 changes: 0 additions & 3 deletions conf/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ tunnel:
address: 'fc00::2'
gateway: 'fc00::1'
prefix: 126
# Domain name service
dns:
port: 53

socks5:
# Socks5 server port
Expand Down
43 changes: 0 additions & 43 deletions src/hev-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ static char tun_ipv6_address[64];
static char tun_ipv6_gateway[64];
static unsigned int tun_ipv6_prefix;

static unsigned int tun_dns_port = 53;

static struct sockaddr_in6 socks5_address;

static char log_file[1024];
Expand Down Expand Up @@ -126,39 +124,6 @@ hev_config_parse_tunnel_ipv6 (yaml_document_t *doc, yaml_node_t *base)
return 0;
}

static int
hev_config_parse_tunnel_dns (yaml_document_t *doc, yaml_node_t *base)
{
yaml_node_pair_t *pair;

if (!base || YAML_MAPPING_NODE != base->type)
return -1;

for (pair = base->data.mapping.pairs.start;
pair < base->data.mapping.pairs.top; pair++) {
yaml_node_t *node;
const char *key, *value;

if (!pair->key || !pair->value)
break;

node = yaml_document_get_node (doc, pair->key);
if (!node || YAML_SCALAR_NODE != node->type)
break;
key = (const char *)node->data.scalar.value;

node = yaml_document_get_node (doc, pair->value);
if (!node || YAML_SCALAR_NODE != node->type)
break;
value = (const char *)node->data.scalar.value;

if (0 == strcmp (key, "port"))
tun_dns_port = strtoul (value, NULL, 10);
}

return 0;
}

static int
hev_config_parse_tunnel (yaml_document_t *doc, yaml_node_t *base)
{
Expand Down Expand Up @@ -196,8 +161,6 @@ hev_config_parse_tunnel (yaml_document_t *doc, yaml_node_t *base)
hev_config_parse_tunnel_ipv4 (doc, node);
else if (0 == strcmp (key, "ipv6"))
hev_config_parse_tunnel_ipv6 (doc, node);
else if (0 == strcmp (key, "dns"))
hev_config_parse_tunnel_dns (doc, node);
}
}

Expand Down Expand Up @@ -447,12 +410,6 @@ hev_config_get_tunnel_ipv6_prefix (void)
return tun_ipv6_prefix;
}

unsigned int
hev_config_get_tunnel_dns_port (void)
{
return tun_dns_port;
}

struct sockaddr *
hev_config_get_socks5_address (socklen_t *addr_len)
{
Expand Down
2 changes: 0 additions & 2 deletions src/hev-config.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ const char *hev_config_get_tunnel_ipv6_address (void);
const char *hev_config_get_tunnel_ipv6_gateway (void);
unsigned int hev_config_get_tunnel_ipv6_prefix (void);

unsigned int hev_config_get_tunnel_dns_port (void);

struct sockaddr *hev_config_get_socks5_address (socklen_t *addr_len);

const char *hev_config_get_misc_pid_file (void);
Expand Down

0 comments on commit 1661cc5

Please sign in to comment.