From dc93ade1436f619a90a9eee7d98ff91ecaccb6ab Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Wed, 1 Jul 2020 16:50:45 +0200 Subject: Return some sanity to DNS handling --- shared/config-parser.h | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'shared/config-parser.h') 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); -- cgit v1.2.3