diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2016-09-03 15:08:13 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2016-09-03 15:08:13 +0000 |
commit | a6533d88996e7570cf04db0d99b6012d25a953d3 (patch) | |
tree | cb1552d6fa59b30201907edc56208f6fe720c283 /util/config_file.h | |
parent | 21d2013cbd382bc99b9c1a31146ec76a2792b92c (diff) | |
download | src-a6533d88996e7570cf04db0d99b6012d25a953d3.tar.gz src-a6533d88996e7570cf04db0d99b6012d25a953d3.zip |
import unbound 1.5.9vendor/unbound/1.5.9
Notes
Notes:
svn path=/vendor/unbound/dist/; revision=305347
svn path=/vendor/unbound/1.5.9/; revision=305348; tag=vendor/unbound/1.5.9
Diffstat (limited to 'util/config_file.h')
-rw-r--r-- | util/config_file.h | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/util/config_file.h b/util/config_file.h index ef823fb88d3a..a51cdb464c0c 100644 --- a/util/config_file.h +++ b/util/config_file.h @@ -44,6 +44,7 @@ struct config_stub; struct config_strlist; struct config_str2list; +struct config_strbytelist; struct module_qstate; struct sock_list; struct ub_packed_rrset_key; @@ -142,6 +143,8 @@ struct config_file { int so_reuseport; /** IP_TRANSPARENT socket option requested on port 53 sockets */ int ip_transparent; + /** IP_FREEBIND socket option request on port 53 sockets */ + int ip_freebind; /** number of interfaces to open. If 0 default all interfaces. */ int num_ifs; @@ -293,6 +296,12 @@ struct config_file { int unblock_lan_zones; /** insecure lan zones (don't validate AS112 zones) */ int insecure_lan_zones; + /** list of zonename, tagbitlist */ + struct config_strbytelist* local_zone_tags; + /** tag list, array with tagname[i] is malloced string */ + char** tagname; + /** number of items in the taglist */ + int num_tags; /** remote control section. enable toggle. */ int remote_control_enable; @@ -358,6 +367,9 @@ struct config_file { /** true to log dnstap FORWARDER_RESPONSE message events */ int dnstap_log_forwarder_response_messages; + /** true to disable DNSSEC lameness check in iterator */ + int disable_dnssec_lame_check; + /** ratelimit 0 is off, otherwise qps (unless overridden) */ int ratelimit; /** number of slabs for ratelimit cache */ @@ -421,6 +433,19 @@ struct config_str2list { char* str2; }; +/** + * List of string, bytestring for config options + */ +struct config_strbytelist { + /** next item in list */ + struct config_strbytelist* next; + /** first string */ + char* str; + /** second bytestring */ + uint8_t* str2; + size_t str2len; +}; + /** List head for strlist processing, used for append operation. */ struct config_strlist_head { /** first in list of text items */ @@ -560,6 +585,17 @@ int cfg_strlist_insert(struct config_strlist** head, char* item); int cfg_str2list_insert(struct config_str2list** head, char* item, char* i2); /** + * Insert string into strbytelist. + * @param head: pointer to str2list head variable. + * @param item: new item. malloced by caller. If NULL the insertion fails. + * @param i2: 2nd string, malloced by caller. If NULL the insertion fails. + * @param i2len: length of the i2 bytestring. + * @return: true on success. + */ +int cfg_strbytelist_insert(struct config_strbytelist** head, char* item, + uint8_t* i2, size_t i2len); + +/** * Find stub in config list, also returns prevptr (for deletion). * @param pp: call routine with pointer to a pointer to the start of the list, * if the stub is found, on exit, the value contains a pointer to the @@ -625,6 +661,54 @@ int cfg_count_numbers(const char* str); int cfg_parse_memsize(const char* str, size_t* res); /** + * Add a tag name to the config. It is added at the end with a new ID value. + * @param cfg: the config structure. + * @param tag: string (which is copied) with the name. + * @return: false on alloc failure. + */ +int config_add_tag(struct config_file* cfg, const char* tag); + +/** + * Find tag ID in the tag list. + * @param cfg: the config structure. + * @param tag: string with tag name to search for. + * @return: 0..(num_tags-1) with tag ID, or -1 if tagname is not found. + */ +int find_tag_id(struct config_file* cfg, const char* tag); + +/** + * parse taglist from string into bytestring with bitlist. + * @param cfg: the config structure (with tagnames) + * @param str: the string to parse. Parse puts 0 bytes in string. + * @param listlen: returns length of in bytes. + * @return malloced bytes with a bitlist of the tags. or NULL on parse error + * or malloc failure. + */ +uint8_t* config_parse_taglist(struct config_file* cfg, char* str, + size_t* listlen); + +/** + * convert tag bitlist to a malloced string with tag names. For debug output. + * @param cfg: the config structure (with tagnames) + * @param taglist: the tag bitlist. + * @param len: length of the tag bitlist. + * @return malloced string or NULL. + */ +char* config_taglist2str(struct config_file* cfg, uint8_t* taglist, + size_t len); + +/** + * see if two taglists intersect (have tags in common). + * @param list1: first tag bitlist. + * @param list1len: length in bytes of first list. + * @param list2: second tag bitlist. + * @param list2len: length in bytes of second list. + * @return true if there are tags in common, 0 if not. + */ +int taglist_intersect(uint8_t* list1, size_t list1len, uint8_t* list2, + size_t list2len); + +/** * Parse local-zone directive into two strings and register it in the config. * @param cfg: to put it in. * @param val: argument strings to local-zone, "example.com nodefault". |