diff options
author | David Härdeman <david@hardeman.nu> | 2020-07-01 16:50:45 +0200 |
---|---|---|
committer | David Härdeman <david@hardeman.nu> | 2020-07-01 16:50:45 +0200 |
commit | dc93ade1436f619a90a9eee7d98ff91ecaccb6ab (patch) | |
tree | 7437c9ba5cb2a51be24d9e4a37605248edb983ba /shared/config-parser.h | |
parent | 86727730b8e4cfce2a4ecf2e787c8bf7f57af924 (diff) |
Return some sanity to DNS handling
Diffstat (limited to 'shared/config-parser.h')
-rw-r--r-- | shared/config-parser.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/shared/config-parser.h b/shared/config-parser.h index ffce5d4..d84f9fe 100644 --- a/shared/config-parser.h +++ b/shared/config-parser.h @@ -42,7 +42,10 @@ struct server_config { struct list_head locals; struct list_head remotes; struct list_head rcons; + struct list_head dnslookups; + struct gaicb **gcbs; + struct sigevent dns_sev; }; enum cfg_value_type { @@ -54,17 +57,13 @@ enum cfg_value_type { CFG_VAL_TYPE_BOOL, }; -typedef void (*notification_cb_t)(struct server_config *scfg, bool done); - struct dns_async { char name[FQDN_STR_LEN + 1]; char port[PORT_STR_LEN + 1]; + bool pending; struct addrinfo req; struct gaicb gcb; - struct sigevent sev; - void (*cb)(struct dns_async *); - notification_cb_t notification_cb; - void *priv; + struct list_head *target_list; struct list_head list; }; @@ -85,11 +84,14 @@ struct cfg_value { }; }; +void scfg_async_dns_result(struct server_config *scfg); + bool scfg_validate(struct server_config *scfg, const char **error); -bool scfg_parse(struct server_config *scfg, char *buf, - notification_cb_t notification_cb, unsigned *lineno, - const char **error); +bool scfg_async_dns_start(struct server_config *scfg); + +bool scfg_parse(struct server_config *scfg, char *buf, bool async, + unsigned *lineno, const char **error); void scfg_delete(struct server_config *scfg); |