From b09983678f5d116d3c8387aaeab4f2dc4deb0454 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Mon, 1 May 2000 17:59:10 +0000 Subject: [PATCH] 145. [cleanup] Added and ISC_LANG_BEGINDECLS/ ISC_LANG_ENDDECLS to header files that had function prototypes, and removed it from those that did not. --- CHANGES | 4 + bin/named/include/named/aclconf.h | 8 +- lib/dns/gen-unix.h | 5 + lib/dns/gen-win32.h | 7 +- lib/dns/include/dns/acl.h | 34 +- lib/dns/include/dns/aclconf.h | 8 +- lib/dns/include/dns/confacl.h | 71 ++- lib/dns/include/dns/confcache.h | 13 +- lib/dns/include/dns/confcommon.h | 116 ++-- lib/dns/include/dns/confctl.h | 49 +- lib/dns/include/dns/confctx.h | 924 +++++++++++++++++------------- lib/dns/include/dns/confip.h | 178 +++--- lib/dns/include/dns/confkeys.h | 291 ++++++---- lib/dns/include/dns/conflog.h | 244 ++++---- lib/dns/include/dns/conflsn.h | 56 +- lib/dns/include/dns/confndc.h | 169 ++++-- lib/dns/include/dns/confparser.h | 22 +- lib/dns/include/dns/confresolv.h | 16 +- lib/dns/include/dns/confrrset.h | 76 +-- lib/dns/include/dns/confview.h | 544 ++++++++++-------- lib/dns/include/dns/confzone.h | 410 +++++++------ lib/dns/include/dns/dbtable.h | 5 + lib/dns/include/dns/events.h | 5 - lib/dns/include/dns/fixedname.h | 5 - lib/dns/include/dns/journal.h | 37 +- lib/dns/include/dns/log.h | 7 +- lib/dns/include/dns/message.h | 16 +- lib/dns/include/dns/peer.h | 134 +++-- 28 files changed, 1990 insertions(+), 1464 deletions(-) diff --git a/CHANGES b/CHANGES index eba60a719f..cf30616c69 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ + 145. [cleanup] Added and ISC_LANG_BEGINDECLS/ + ISC_LANG_ENDDECLS to header files that had function + prototypes, and removed it from those that did not. + 144. [cleanup] libdns header files too numerous to name were made to conform to the same style for multiple inclusion protection. diff --git a/bin/named/include/named/aclconf.h b/bin/named/include/named/aclconf.h index 2a4476c07a..6665d55c84 100644 --- a/bin/named/include/named/aclconf.h +++ b/bin/named/include/named/aclconf.h @@ -18,6 +18,8 @@ #ifndef DNS_ACLCONF_H #define DNS_ACLCONF_H 1 +#include + #include #include #include @@ -33,9 +35,11 @@ typedef struct { ISC_LANG_BEGINDECLS -void dns_aclconfctx_init(dns_aclconfctx_t *ctx); +void +dns_aclconfctx_init(dns_aclconfctx_t *ctx); -void dns_aclconfctx_destroy(dns_aclconfctx_t *ctx); +void +dns_aclconfctx_destroy(dns_aclconfctx_t *ctx); isc_result_t dns_acl_fromconfig(dns_c_ipmatchlist_t *caml, diff --git a/lib/dns/gen-unix.h b/lib/dns/gen-unix.h index a440519c4c..da3b90bb9b 100644 --- a/lib/dns/gen-unix.h +++ b/lib/dns/gen-unix.h @@ -34,6 +34,7 @@ #include #include +#include #define isc_commandline_parse getopt #define isc_commandline_argument optarg @@ -43,6 +44,8 @@ typedef struct { char *filename; } isc_dir_t; +ISC_LANG_BEGINDECLS + static isc_boolean_t start_directory(const char *path, isc_dir_t *dir) { dir->handle = opendir(path); @@ -80,4 +83,6 @@ end_directory(isc_dir_t *dir) { dir->handle = NULL; } +ISC_LANG_ENDDECLS + #endif /* DNS_GEN_UNIX_H */ diff --git a/lib/dns/gen-win32.h b/lib/dns/gen-win32.h index 2a9916592c..5c5b35dbf2 100644 --- a/lib/dns/gen-win32.h +++ b/lib/dns/gen-win32.h @@ -48,7 +48,7 @@ * SUCH DAMAGE. */ -/* $Id: gen-win32.h,v 1.3 2000/04/29 02:01:07 tale Exp $ */ +/* $Id: gen-win32.h,v 1.4 2000/05/01 17:59:02 tale Exp $ */ /* * Principal Authors: Computer Systems Research Group at UC Berkeley @@ -83,6 +83,7 @@ #include #include #include +#include int isc_commandline_index = 1; /* Index into parent argv vector. */ int isc_commandline_option; /* Character checked for validity. */ @@ -97,6 +98,8 @@ isc_boolean_t isc_commandline_reset = ISC_TRUE; /* Reset processing. */ #define BADARG ':' #define ENDOPT "" +ISC_LANG_BEGINDECLS + /* * getopt -- * Parse argc/argv argument vector. @@ -284,4 +287,6 @@ end_directory(isc_dir_t *dir) { FindClose(dir->handle); } +ISC_LANG_ENDDECLS + #endif /* DNS_GEN_WIN32_H */ diff --git a/lib/dns/include/dns/acl.h b/lib/dns/include/dns/acl.h index 8567f1ae8c..5511917a45 100644 --- a/lib/dns/include/dns/acl.h +++ b/lib/dns/include/dns/acl.h @@ -30,9 +30,11 @@ *** Imports ***/ +#include +#include + #include #include -#include /*** *** Types @@ -86,41 +88,51 @@ struct dns_aclenv { ISC_LANG_BEGINDECLS -isc_result_t dns_acl_create(isc_mem_t *mctx, int n, dns_acl_t **target); +isc_result_t +dns_acl_create(isc_mem_t *mctx, int n, dns_acl_t **target); /* * Create a new ACL with room for 'n' elements. * The elements are uninitialized and the length is 0. */ -isc_result_t dns_acl_appendelement(dns_acl_t *acl, dns_aclelement_t *elt); +isc_result_t +dns_acl_appendelement(dns_acl_t *acl, dns_aclelement_t *elt); /* * Append an element to an existing ACL. */ -isc_result_t dns_acl_any(isc_mem_t *mctx, dns_acl_t **target); +isc_result_t +dns_acl_any(isc_mem_t *mctx, dns_acl_t **target); /* * Create a new ACL that matches everything. */ -isc_result_t dns_acl_none(isc_mem_t *mctx, dns_acl_t **target); +isc_result_t +dns_acl_none(isc_mem_t *mctx, dns_acl_t **target); /* * Create a new ACL that matches nothing. */ -void dns_acl_attach(dns_acl_t *source, dns_acl_t **target); +void +dns_acl_attach(dns_acl_t *source, dns_acl_t **target); -void dns_acl_detach(dns_acl_t **aclp); +void +dns_acl_detach(dns_acl_t **aclp); isc_boolean_t dns_aclelement_equal(dns_aclelement_t *ea, dns_aclelement_t *eb); -isc_boolean_t dns_acl_equal(dns_acl_t *a, dns_acl_t *b); +isc_boolean_t +dns_acl_equal(dns_acl_t *a, dns_acl_t *b); -isc_result_t dns_aclenv_init(isc_mem_t *mctx, dns_aclenv_t *env); +isc_result_t +dns_aclenv_init(isc_mem_t *mctx, dns_aclenv_t *env); -void dns_aclenv_copy(dns_aclenv_t *t, dns_aclenv_t *s); +void +dns_aclenv_copy(dns_aclenv_t *t, dns_aclenv_t *s); -void dns_aclenv_destroy(dns_aclenv_t *env); +void +dns_aclenv_destroy(dns_aclenv_t *env); isc_result_t dns_acl_match(isc_netaddr_t *reqaddr, diff --git a/lib/dns/include/dns/aclconf.h b/lib/dns/include/dns/aclconf.h index 2a4476c07a..6665d55c84 100644 --- a/lib/dns/include/dns/aclconf.h +++ b/lib/dns/include/dns/aclconf.h @@ -18,6 +18,8 @@ #ifndef DNS_ACLCONF_H #define DNS_ACLCONF_H 1 +#include + #include #include #include @@ -33,9 +35,11 @@ typedef struct { ISC_LANG_BEGINDECLS -void dns_aclconfctx_init(dns_aclconfctx_t *ctx); +void +dns_aclconfctx_init(dns_aclconfctx_t *ctx); -void dns_aclconfctx_destroy(dns_aclconfctx_t *ctx); +void +dns_aclconfctx_destroy(dns_aclconfctx_t *ctx); isc_result_t dns_acl_fromconfig(dns_c_ipmatchlist_t *caml, diff --git a/lib/dns/include/dns/confacl.h b/lib/dns/include/dns/confacl.h index e81c00ea7f..7ee672bd95 100644 --- a/lib/dns/include/dns/confacl.h +++ b/lib/dns/include/dns/confacl.h @@ -56,6 +56,7 @@ *** Imports ***/ +#include #include #include @@ -108,9 +109,10 @@ struct dns_c_acl_table *** Functions ***/ -isc_result_t dns_c_acltable_new(isc_mem_t *mem, - dns_c_acltable_t **newtable); +ISC_LANG_BEGINDECLS +isc_result_t +dns_c_acltable_new(isc_mem_t *mem, dns_c_acltable_t **newtable); /* * Creates a new ACL table. Returns pointer to the new table through * NEWTABLE paramater. The memory is allocated from the MEM memory pool. @@ -127,8 +129,8 @@ isc_result_t dns_c_acltable_new(isc_mem_t *mem, */ -isc_result_t dns_c_acltable_delete(dns_c_acltable_t **table); - +isc_result_t +dns_c_acltable_delete(dns_c_acltable_t **table); /* * Destroys the table pointed to by *TABLE and all the ACLs in it. The * value of *TABLE can be NULL. @@ -143,10 +145,9 @@ isc_result_t dns_c_acltable_delete(dns_c_acltable_t **table); */ -isc_result_t dns_c_acltable_getacl(dns_c_acltable_t *table, - const char *aclname, - dns_c_acl_t **retval); - +isc_result_t +dns_c_acltable_getacl(dns_c_acltable_t *table, const char *aclname, + dns_c_acl_t **retval); /* * Looks up an ACL by name in the given table. The result is returned * through the parameter RETVAL. The returned ACL must not be modified. @@ -160,9 +161,8 @@ isc_result_t dns_c_acltable_getacl(dns_c_acltable_t *table, * */ -isc_result_t dns_c_acltable_removeacl(dns_c_acltable_t *table, - const char *aclname); - +isc_result_t +dns_c_acltable_removeacl(dns_c_acltable_t *table, const char *aclname); /* * Removes an acl from a table. The acl is looked up by name. * @@ -176,8 +176,8 @@ isc_result_t dns_c_acltable_removeacl(dns_c_acltable_t *table, * */ -void dns_c_acltable_print(FILE *fp, int indent, - dns_c_acltable_t *table); +void +dns_c_acltable_print(FILE *fp, int indent, dns_c_acltable_t *table); /* * Prints the ACL table and the ACLs in it to the give stdio stream. * indent is the indentation level (number of tabs) printed before @@ -188,11 +188,10 @@ void dns_c_acltable_print(FILE *fp, int indent, * indent be a non-negative number * table be a valid acl table. * -*/ - - -isc_result_t dns_c_acltable_clear(dns_c_acltable_t *table); + */ +isc_result_t +dns_c_acltable_clear(dns_c_acltable_t *table); /* * Deletes all the acls from the table. * @@ -204,12 +203,9 @@ isc_result_t dns_c_acltable_clear(dns_c_acltable_t *table); * */ - - -isc_result_t dns_c_acl_new(dns_c_acltable_t *table, - const char *aclname, - isc_boolean_t isspecial, - dns_c_acl_t **newacl); +isc_result_t +dns_c_acl_new(dns_c_acltable_t *table, const char *aclname, + isc_boolean_t isspecial, dns_c_acl_t **newacl); /* * Creates a new ACL. The acl is placed in the given table. If isspecial is * true then the acl is not printed by dns_c_acl_print. The new acl is @@ -227,8 +223,8 @@ isc_result_t dns_c_acl_new(dns_c_acltable_t *table, */ -void dns_c_acl_print(FILE *fp, int indent, - dns_c_acl_t *acl); +void +dns_c_acl_print(FILE *fp, int indent, dns_c_acl_t *acl); /* * Prints out the acl to the stdio stream. The outupt is indented by INDENT * tabs. @@ -240,11 +236,9 @@ void dns_c_acl_print(FILE *fp, int indent, * */ - -isc_result_t dns_c_acl_setipml(dns_c_acl_t *acl, - dns_c_ipmatchlist_t *ipml, - isc_boolean_t deepcopy); - +isc_result_t +dns_c_acl_setipml(dns_c_acl_t *acl, dns_c_ipmatchlist_t *ipml, + isc_boolean_t deepcopy); /* * Sets the ipmatch list of the ACL to the IPML. If DEEPCOPY is true, then * a full copy of IPML is made using the MEM memory pool. In which case the @@ -264,10 +258,9 @@ isc_result_t dns_c_acl_setipml(dns_c_acl_t *acl, * */ - -isc_result_t dns_c_acl_getipmlexpanded(isc_mem_t *mem, dns_c_acl_t *acl, - dns_c_ipmatchlist_t **retval); - +isc_result_t +dns_c_acl_getipmlexpanded(isc_mem_t *mem, dns_c_acl_t *acl, + dns_c_ipmatchlist_t **retval); /* * Retuns a copy through the RETVAL parameter (the caller is responsible * for deleting the returned value) of the given ACLs ipmatch list. Any @@ -287,11 +280,8 @@ isc_result_t dns_c_acl_getipmlexpanded(isc_mem_t *mem, dns_c_acl_t *acl, * */ - - -isc_result_t dns_c_acl_expandacls(dns_c_acltable_t *table, - dns_c_ipmatchlist_t *list); - +isc_result_t +dns_c_acl_expandacls(dns_c_acltable_t *table, dns_c_ipmatchlist_t *list); /* * Goes through all the entires (direct and indirect) of LIST and * expands all references to ACLs using the definitions in TABLE @@ -304,4 +294,7 @@ isc_result_t dns_c_acl_expandacls(dns_c_acltable_t *table, * ISC_R_SUCCESS -- all is well * ISC_R_FAILURE -- some acl(s) couldn't be resolved. */ + +ISC_LANG_ENDDECLS + #endif /* DNS_CONFACL_H */ diff --git a/lib/dns/include/dns/confcache.h b/lib/dns/include/dns/confcache.h index eb5e836880..a3214fab61 100644 --- a/lib/dns/include/dns/confcache.h +++ b/lib/dns/include/dns/confcache.h @@ -50,6 +50,7 @@ *** Imports ***/ +#include #include @@ -66,14 +67,14 @@ struct dns_c_cache /* XXX need this fleshed out */ }; - - - /*** *** Functions ***/ -isc_result_t dns_c_cache_new(isc_mem_t *mem, dns_c_cache_t **cfgres); +ISC_LANG_BEGINDECLS + +isc_result_t +dns_c_cache_new(isc_mem_t *mem, dns_c_cache_t **cfgres); /* * Creates a new cache-config object. * @@ -87,7 +88,8 @@ isc_result_t dns_c_cache_new(isc_mem_t *mem, dns_c_cache_t **cfgres); * */ -isc_result_t dns_c_cache_delete(dns_c_cache_t **cfgres); +isc_result_t +dns_c_cache_delete(dns_c_cache_t **cfgres); /* * Deletes the config-cache object and its contents. * @@ -100,5 +102,6 @@ isc_result_t dns_c_cache_delete(dns_c_cache_t **cfgres); * */ +ISC_LANG_ENDDECLS #endif /* DNS_CONFCACHE_H */ diff --git a/lib/dns/include/dns/confcommon.h b/lib/dns/include/dns/confcommon.h index 4b5fbd2f4a..eef8a9fd50 100644 --- a/lib/dns/include/dns/confcommon.h +++ b/lib/dns/include/dns/confcommon.h @@ -61,15 +61,18 @@ #include #include -#include -#include +#include #include +#include #include +#include #include -/* Constants used in the defintions of default logging channels and - categories */ +/* + * Constants used in the defintions of default logging channels and + * categories. + */ #define DNS_C_DEFAULT_SYSLOG "default_syslog" #define DNS_C_DEFAULT_DEBUG "default_debug" #define DNS_C_DEFAULT_DEBUG_PATH "named.run" @@ -253,6 +256,8 @@ extern FILE *debug_mem_print_stream; /* NULL means stderr */ *** Functions ***/ +ISC_LANG_BEGINDECLS + /* The following dns_c_xxx2string() functions convert the first argument into * a string value and returns that value. If the first argument is not a * legal value, then NULL is returned, unless PRINTABLE is true, in which @@ -263,20 +268,26 @@ extern FILE *debug_mem_print_stream; /* NULL means stderr */ * dns_c_ordering2string((dns_c_ordering_t)0xffff,ISC_TRUE) returns the * value "UNKNOWN_ORDERING" */ -const char * dns_c_ordering2string(dns_c_ordering_t ordering, - isc_boolean_t printable); -const char * dns_c_logseverity2string(dns_c_logseverity_t level, - isc_boolean_t printable); -const char * dns_c_facility2string(int facility, - isc_boolean_t printable); -const char * dns_c_transformat2string(dns_transfer_format_t tform, - isc_boolean_t printable); -const char * dns_c_transport2string(dns_c_trans_t transport, - isc_boolean_t printable); -const char * dns_c_nameseverity2string(dns_severity_t severity, - isc_boolean_t printable); -const char * dns_c_forward2string(dns_c_forw_t forw, - isc_boolean_t printable); +const char * +dns_c_ordering2string(dns_c_ordering_t ordering, isc_boolean_t printable); + +const char * +dns_c_logseverity2string(dns_c_logseverity_t level, isc_boolean_t printable); + +const char * +dns_c_facility2string(int facility, isc_boolean_t printable); + +const char * +dns_c_transformat2string(dns_transfer_format_t tform, isc_boolean_t printable); + +const char * +dns_c_transport2string(dns_c_trans_t transport, isc_boolean_t printable); + +const char * +dns_c_nameseverity2string(dns_severity_t severity, isc_boolean_t printable); + +const char * +dns_c_forward2string(dns_c_forw_t forw, isc_boolean_t printable); /* * The following dns_c_string2xxx() functions will look up the string @@ -284,43 +295,59 @@ const char * dns_c_forward2string(dns_c_forw_t forw, * through the second argument and ISC_R_SUCCESS is returned. If the string * doesn't match a valid value then ISC_R_FAILURE is returned. */ -isc_result_t dns_c_string2ordering(char *name, - dns_c_ordering_t *ordering); -isc_result_t dns_c_string2logseverity(const char *string, - dns_c_logseverity_t *result); -isc_result_t dns_c_string2facility(const char *string, int *res); +isc_result_t +dns_c_string2ordering(char *name, dns_c_ordering_t *ordering); +isc_result_t +dns_c_string2logseverity(const char *string, dns_c_logseverity_t *result); +isc_result_t +dns_c_string2facility(const char *string, int *res); -int dns_c_isanyaddr(isc_sockaddr_t *inaddr); -void dns_c_print_ipaddr(FILE *fp, isc_sockaddr_t *addr); -isc_boolean_t dns_c_need_quote(const char *string); +int +dns_c_isanyaddr(isc_sockaddr_t *inaddr); -void dns_c_printtabs(FILE *fp, int count); -void dns_c_printinunits(FILE *fp, isc_uint32_t val); +void +dns_c_print_ipaddr(FILE *fp, isc_sockaddr_t *addr); -void dns_c_dataclass_tostream(FILE *fp, - dns_rdataclass_t rclass); -void dns_c_datatype_tostream(FILE *fp, - dns_rdatatype_t rtype); +isc_boolean_t +dns_c_need_quote(const char *string); +void +dns_c_printtabs(FILE *fp, int count); -isc_boolean_t dns_c_netaddrisanyaddr(isc_netaddr_t *inaddr); -void dns_c_netaddrprint(FILE *fp, isc_netaddr_t *inaddr); -isc_result_t dns_c_charptoname(isc_mem_t *mem, const char *keyval, - dns_name_t **name); -void dns_c_peer_print(FILE *fp, int indent, - dns_peer_t *peer); -void dns_c_peerlist_print(FILE *fp, int indent, - dns_peerlist_t *peers); -void dns_c_ssutable_print(FILE *fp, int indent, - dns_ssutable_t *ssutable); +void +dns_c_printinunits(FILE *fp, isc_uint32_t val); +void +dns_c_dataclass_tostream(FILE *fp, dns_rdataclass_t rclass); +void +dns_c_datatype_tostream(FILE *fp, dns_rdatatype_t rtype); -isc_result_t dns_c_checkcategory(const char *name); -isc_result_t dns_c_checkmodule(const char *name); +isc_boolean_t +dns_c_netaddrisanyaddr(isc_netaddr_t *inaddr); +void +dns_c_netaddrprint(FILE *fp, isc_netaddr_t *inaddr); + +isc_result_t +dns_c_charptoname(isc_mem_t *mem, const char *keyval, dns_name_t **name); + +void +dns_c_peer_print(FILE *fp, int indent, dns_peer_t *peer); + +void +dns_c_peerlist_print(FILE *fp, int indent, dns_peerlist_t *peers); + +void +dns_c_ssutable_print(FILE *fp, int indent, dns_ssutable_t *ssutable); + +isc_result_t +dns_c_checkcategory(const char *name); + +isc_result_t +dns_c_checkmodule(const char *name); /* * Checks the argument is a known category or module name. * @@ -329,5 +356,6 @@ isc_result_t dns_c_checkmodule(const char *name); * ISC_R_FAILURE if it isn't. */ +ISC_LANG_ENDDECLS #endif /* DNS_CONFCOMMON_H */ diff --git a/lib/dns/include/dns/confctl.h b/lib/dns/include/dns/confctl.h index c0e8ffbe41..8ded3e5dce 100644 --- a/lib/dns/include/dns/confctl.h +++ b/lib/dns/include/dns/confctl.h @@ -57,12 +57,12 @@ #include +#include #include #include #include - #define DNS_C_CONFCTL_MAGIC 0x4363746cU #define DNS_C_CONFCTLLIST_MAGIC 0x4354424cU @@ -71,8 +71,6 @@ #define DNS_C_CONFCTL_VALID(ptr) \ ISC_MAGIC_VALID(ptr, DNS_C_CONFCTL_MAGIC) - - /*** *** Types ***/ @@ -80,8 +78,7 @@ typedef struct dns_c_ctrl dns_c_ctrl_t; typedef struct dns_c_ctrl_list dns_c_ctrllist_t; -struct dns_c_ctrl -{ +struct dns_c_ctrl { isc_uint32_t magic; isc_mem_t *mem; /* where it's memory came from */ @@ -104,25 +101,23 @@ struct dns_c_ctrl }; -struct dns_c_ctrl_list -{ +struct dns_c_ctrl_list { isc_uint32_t magic; isc_mem_t *mem; ISC_LIST(dns_c_ctrl_t) elements; }; - - /*** *** Functions ***/ +ISC_LANG_BEGINDECLS -isc_result_t dns_c_ctrlinet_new(isc_mem_t *mem, dns_c_ctrl_t **control, - isc_sockaddr_t addr, in_port_t port, - dns_c_ipmatchlist_t *iml, - isc_boolean_t copy); +isc_result_t +dns_c_ctrlinet_new(isc_mem_t *mem, dns_c_ctrl_t **control, + isc_sockaddr_t addr, in_port_t port, + dns_c_ipmatchlist_t *iml, isc_boolean_t copy); /* * Creates a new INET control object. If COPY is true then a deep copy is * made of IML, otherwise the value of IML is stored directly in the new @@ -137,10 +132,9 @@ isc_result_t dns_c_ctrlinet_new(isc_mem_t *mem, dns_c_ctrl_t **control, * ISC_R_NOMEMORY -- insufficient memory available */ - -isc_result_t dns_c_ctrlunix_new(isc_mem_t *mem, dns_c_ctrl_t **control, - const char *path, - int perm, uid_t uid, gid_t gid); +isc_result_t +dns_c_ctrlunix_new(isc_mem_t *mem, dns_c_ctrl_t **control, const char *path, + int perm, uid_t uid, gid_t gid); /* * Creates a new UNIX control object. A copy is made of the PATH argument. * @@ -154,8 +148,8 @@ isc_result_t dns_c_ctrlunix_new(isc_mem_t *mem, dns_c_ctrl_t **control, * */ - -isc_result_t dns_c_ctrl_delete(dns_c_ctrl_t **control); +isc_result_t +dns_c_ctrl_delete(dns_c_ctrl_t **control); /* * Deletes the object pointed to by *CONTROL. *CONTROL may be NULL. * @@ -166,8 +160,8 @@ isc_result_t dns_c_ctrl_delete(dns_c_ctrl_t **control); * ISC_R_SUCCESS */ - -void dns_c_ctrl_print(FILE *fp, int indent, dns_c_ctrl_t *ctl); +void +dns_c_ctrl_print(FILE *fp, int indent, dns_c_ctrl_t *ctl); /* * Prints the control object ctl in standard named.conf format. The output * is indented by indent number of tabs. @@ -178,8 +172,8 @@ void dns_c_ctrl_print(FILE *fp, int indent, dns_c_ctrl_t *ctl); * */ - -isc_result_t dns_c_ctrllist_new(isc_mem_t *mem, dns_c_ctrllist_t **newlist); +isc_result_t +dns_c_ctrllist_new(isc_mem_t *mem, dns_c_ctrllist_t **newlist); /* * Creates a new control object list using the MEM memory manager. * @@ -192,8 +186,8 @@ isc_result_t dns_c_ctrllist_new(isc_mem_t *mem, dns_c_ctrllist_t **newlist); * ISC_R_NOMEMORY -- insufficient memory available. */ - -isc_result_t dns_c_ctrllist_delete(dns_c_ctrllist_t **list); +isc_result_t +dns_c_ctrllist_delete(dns_c_ctrllist_t **list); /* * Deletes the control list. The value of *list may be NULL. Sets *list to * NULL when done. @@ -206,8 +200,8 @@ isc_result_t dns_c_ctrllist_delete(dns_c_ctrllist_t **list); * */ -void dns_c_ctrllist_print(FILE *fp, int indent, - dns_c_ctrllist_t *cl); +void +dns_c_ctrllist_print(FILE *fp, int indent, dns_c_ctrllist_t *cl); /* * Prints the control objects inside the list. The output is indented with * indent number of tabs. @@ -217,5 +211,6 @@ void dns_c_ctrllist_print(FILE *fp, int indent, * */ +ISC_LANG_ENDDECLS #endif /* DNS_CONFCTL_H */ diff --git a/lib/dns/include/dns/confctx.h b/lib/dns/include/dns/confctx.h index 4b5d6df8d2..6b940f5d9b 100644 --- a/lib/dns/include/dns/confctx.h +++ b/lib/dns/include/dns/confctx.h @@ -49,9 +49,10 @@ *** Imports ***/ -#include #include +#include #include +#include #include #include @@ -73,8 +74,6 @@ #define DNS_C_CONFCTX_VALID(ptr) ISC_MAGIC_VALID(ptr, DNS_C_CONFIG_MAGIC) #define DNS_C_CONFOPT_VALID(ptr) ISC_MAGIC_VALID(ptr, DNS_C_OPTION_MAGIC) - - /*** *** Types ***/ @@ -82,13 +81,11 @@ typedef struct dns_c_options dns_c_options_t; typedef struct dns_c_ctx dns_c_ctx_t; - /* * The main baby. A pointer to one of these is what the caller gets back * when the parsing routine is called. */ -struct dns_c_ctx -{ +struct dns_c_ctx { isc_uint32_t magic; isc_mem_t *mem; @@ -111,15 +108,11 @@ struct dns_c_ctx dns_c_view_t *currview; }; - - - /* * This structure holds all the values defined by a config file 'options' * statement. If a field is NULL then it has never been set. */ -struct dns_c_options -{ +struct dns_c_options { isc_mem_t *mem; isc_uint32_t magic; @@ -206,576 +199,731 @@ struct dns_c_options dns_c_iplist_t *forwarders; }; - - /*** *** Functions ***/ -isc_result_t dns_c_checkconfig(dns_c_ctx_t *ctx); +ISC_LANG_BEGINDECLS +isc_result_t +dns_c_checkconfig(dns_c_ctx_t *ctx); +isc_result_t +dns_c_ctx_new(isc_mem_t *mem, dns_c_ctx_t **cfg); +isc_result_t +dns_c_ctx_delete(dns_c_ctx_t **cfg); -isc_result_t dns_c_ctx_new(isc_mem_t *mem, dns_c_ctx_t **cfg); -isc_result_t dns_c_ctx_delete(dns_c_ctx_t **cfg); +void +dns_c_ctx_print(FILE *fp, int indent, dns_c_ctx_t *cfg); -void dns_c_ctx_print(FILE *fp, int indent, dns_c_ctx_t *cfg); -void dns_c_ctx_optionsprint(FILE *fp, int indent, - dns_c_options_t *options); -void dns_c_ctx_forwarderprint(FILE *fp, int indent, - dns_c_options_t *options); +void +dns_c_ctx_optionsprint(FILE *fp, int indent, dns_c_options_t *options); +void +dns_c_ctx_forwarderprint(FILE *fp, int indent, dns_c_options_t *options); -isc_result_t dns_c_ctx_setcurrzone(dns_c_ctx_t *cfg, dns_c_zone_t *zone); -dns_c_zone_t *dns_c_ctx_getcurrzone(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setcurrzone(dns_c_ctx_t *cfg, dns_c_zone_t *zone); +dns_c_zone_t * +dns_c_ctx_getcurrzone(dns_c_ctx_t *cfg); -isc_result_t dns_c_ctx_setcurrview(dns_c_ctx_t *cfg, dns_c_view_t *view); -dns_c_view_t *dns_c_ctx_getcurrview(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setcurrview(dns_c_ctx_t *cfg, dns_c_view_t *view); +dns_c_view_t * +dns_c_ctx_getcurrview(dns_c_ctx_t *cfg); -isc_result_t dns_c_ctx_getoptions(dns_c_ctx_t *cfg, - dns_c_options_t **options); -isc_result_t dns_c_ctx_unsetoptions(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_getoptions(dns_c_ctx_t *cfg, dns_c_options_t **options); + +isc_result_t +dns_c_ctx_unsetoptions(dns_c_ctx_t *cfg); /* detach when done with retval */ -isc_result_t dns_c_ctx_getpeerlist(dns_c_ctx_t *cfg, - dns_peerlist_t **retval); +isc_result_t +dns_c_ctx_getpeerlist(dns_c_ctx_t *cfg, dns_peerlist_t **retval); + /* cfg will attach to newval */ -isc_result_t dns_c_ctx_setpeerlist(dns_c_ctx_t *cfg, - dns_peerlist_t *newval); -isc_result_t dns_c_ctx_unsetpeerlist(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setpeerlist(dns_c_ctx_t *cfg, dns_peerlist_t *newval); +isc_result_t +dns_c_ctx_unsetpeerlist(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_getcontrols(dns_c_ctx_t *cfg, dns_c_ctrllist_t **ctrls); -isc_result_t dns_c_ctx_getcontrols(dns_c_ctx_t *cfg, - dns_c_ctrllist_t **ctrls); -isc_result_t dns_c_ctx_setcontrols(dns_c_ctx_t *cfg, - dns_c_ctrllist_t *ctrls); +isc_result_t +dns_c_ctx_setcontrols(dns_c_ctx_t *cfg, dns_c_ctrllist_t *ctrls); /* XXX need unsetcontrols */ +isc_result_t +dns_c_ctx_setlogging(dns_c_ctx_t *cfg, dns_c_logginglist_t *newval, + isc_boolean_t deepcopy); -isc_result_t dns_c_ctx_setlogging(dns_c_ctx_t *cfg, - dns_c_logginglist_t *newval, - isc_boolean_t deepcopy); -isc_result_t dns_c_ctx_getlogging(dns_c_ctx_t *cfg, - dns_c_logginglist_t **retval); -isc_result_t dns_c_ctx_unsetlogging(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_getlogging(dns_c_ctx_t *cfg, dns_c_logginglist_t **retval); +isc_result_t +dns_c_ctx_unsetlogging(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_addfile_channel(dns_c_ctx_t *cfg, const char *name, + dns_c_logchan_t **chan); -isc_result_t dns_c_ctx_addfile_channel(dns_c_ctx_t *cfg, const char *name, - dns_c_logchan_t **chan); -isc_result_t dns_c_ctx_addsyslogchannel(dns_c_ctx_t *cfg, - const char *name, - dns_c_logchan_t **chan); -isc_result_t dns_c_ctx_addnullchannel(dns_c_ctx_t *cfg, const char *name, - dns_c_logchan_t **chan); -isc_result_t dns_c_ctx_addcategory(dns_c_ctx_t *cfg, - const char *catname, - dns_c_logcat_t **newcat); -isc_result_t dns_c_ctx_currchannel(dns_c_ctx_t *cfg, - dns_c_logchan_t **channel); -isc_result_t dns_c_ctx_currcategory(dns_c_ctx_t *cfg, - dns_c_logcat_t **category); -isc_boolean_t dns_c_ctx_channeldefinedp(dns_c_ctx_t *cfg, - const char *name); +isc_result_t +dns_c_ctx_addsyslogchannel(dns_c_ctx_t *cfg, const char *name, + dns_c_logchan_t **chan); +isc_result_t +dns_c_ctx_addnullchannel(dns_c_ctx_t *cfg, const char *name, + dns_c_logchan_t **chan); +isc_result_t +dns_c_ctx_addcategory(dns_c_ctx_t *cfg, const char *catname, + dns_c_logcat_t **newcat); + +isc_result_t +dns_c_ctx_currchannel(dns_c_ctx_t *cfg, dns_c_logchan_t **channel); + +isc_result_t +dns_c_ctx_currcategory(dns_c_ctx_t *cfg, dns_c_logcat_t **category); + +isc_boolean_t +dns_c_ctx_channeldefinedp(dns_c_ctx_t *cfg, const char *name); + +isc_result_t +dns_c_ctx_getkdeflist(dns_c_ctx_t *cfg, dns_c_kdeflist_t **retval); + +isc_result_t +dns_c_ctx_setkdeflist(dns_c_ctx_t *cfg, dns_c_kdeflist_t *newval, + isc_boolean_t deepcopy); -isc_result_t dns_c_ctx_getkdeflist(dns_c_ctx_t *cfg, - dns_c_kdeflist_t **retval); -isc_result_t dns_c_ctx_setkdeflist(dns_c_ctx_t *cfg, - dns_c_kdeflist_t *newval, - isc_boolean_t deepcopy); /* XXX need unsetkdeflist */ -isc_boolean_t dns_c_ctx_keydefinedp(dns_c_ctx_t *ctx, const char *keyname); - - - -isc_result_t dns_c_ctx_settrustedkeys(dns_c_ctx_t *cfg, - dns_c_tkeylist_t *list, - isc_boolean_t copy); - +isc_boolean_t +dns_c_ctx_keydefinedp(dns_c_ctx_t *ctx, const char *keyname); +isc_result_t +dns_c_ctx_settrustedkeys(dns_c_ctx_t *cfg, dns_c_tkeylist_t *list, + isc_boolean_t copy); /* ** */ +isc_result_t +dns_c_ctx_optionsnew(isc_mem_t *mem, dns_c_options_t **options); -isc_result_t dns_c_ctx_optionsnew(isc_mem_t *mem, - dns_c_options_t **options); -isc_result_t dns_c_ctx_optionsdelete(dns_c_options_t **options); +isc_result_t +dns_c_ctx_optionsdelete(dns_c_options_t **options); +isc_result_t +dns_c_ctx_setdirectory(dns_c_ctx_t *ctx, const char *newval); +isc_result_t +dns_c_ctx_getdirectory(dns_c_ctx_t *ctx, char **retval); +isc_result_t +dns_c_ctx_unsetdirectory(dns_c_ctx_t *ctx); -isc_result_t dns_c_ctx_setdirectory(dns_c_ctx_t *ctx, const char *newval); -isc_result_t dns_c_ctx_getdirectory(dns_c_ctx_t *ctx, char **retval); -isc_result_t dns_c_ctx_unsetdirectory(dns_c_ctx_t *ctx); +isc_result_t +dns_c_ctx_setversion(dns_c_ctx_t *ctx, const char *newval); +isc_result_t +dns_c_ctx_getversion(dns_c_ctx_t *ctx, char **retval); -isc_result_t dns_c_ctx_setversion(dns_c_ctx_t *ctx, const char *newval); -isc_result_t dns_c_ctx_getversion(dns_c_ctx_t *ctx, char **retval); -isc_result_t dns_c_ctx_unsetversion(dns_c_ctx_t *ctx); +isc_result_t +dns_c_ctx_unsetversion(dns_c_ctx_t *ctx); +isc_result_t +dns_c_ctx_setdumpfilename(dns_c_ctx_t *ctx, const char *newval); -isc_result_t dns_c_ctx_setdumpfilename(dns_c_ctx_t *ctx, - const char *newval); -isc_result_t dns_c_ctx_getdumpfilename(dns_c_ctx_t *ctx, - char **retval); -isc_result_t dns_c_ctx_unsetdumpfilename(dns_c_ctx_t *ctx); +isc_result_t +dns_c_ctx_getdumpfilename(dns_c_ctx_t *ctx, char **retval); +isc_result_t +dns_c_ctx_unsetdumpfilename(dns_c_ctx_t *ctx); -isc_result_t dns_c_ctx_setpidfilename(dns_c_ctx_t *ctx, - const char *newval); -isc_result_t dns_c_ctx_getpidfilename(dns_c_ctx_t *ctx, - char **retval); -isc_result_t dns_c_ctx_unsetpidfilename(dns_c_ctx_t *ctx); +isc_result_t +dns_c_ctx_setpidfilename(dns_c_ctx_t *ctx, const char *newval); +isc_result_t +dns_c_ctx_getpidfilename(dns_c_ctx_t *ctx, char **retval); -isc_result_t dns_c_ctx_setstatsfilename(dns_c_ctx_t *ctx, - const char *newval); -isc_result_t dns_c_ctx_getstatsfilename(dns_c_ctx_t *ctx, - char **retval); -isc_result_t dns_c_ctx_unsetstatsfilename(dns_c_ctx_t *ctx); +isc_result_t +dns_c_ctx_unsetpidfilename(dns_c_ctx_t *ctx); +isc_result_t +dns_c_ctx_setstatsfilename(dns_c_ctx_t *ctx, const char *newval); -isc_result_t dns_c_ctx_setmemstatsfilename(dns_c_ctx_t *ctx, - const char *newval); -isc_result_t dns_c_ctx_getmemstatsfilename(dns_c_ctx_t *ctx, - char **retval); -isc_result_t dns_c_ctx_unsetmemstatsfilename(dns_c_ctx_t *ctx); +isc_result_t +dns_c_ctx_getstatsfilename(dns_c_ctx_t *ctx, char **retval); +isc_result_t +dns_c_ctx_unsetstatsfilename(dns_c_ctx_t *ctx); -isc_result_t dns_c_ctx_setnamedxfer(dns_c_ctx_t *ctx, - const char *newval); -isc_result_t dns_c_ctx_getnamedxfer(dns_c_ctx_t *ctx, - char **retval); -isc_result_t dns_c_ctx_unsetnamedxfer(dns_c_ctx_t *ctx); +isc_result_t +dns_c_ctx_setmemstatsfilename(dns_c_ctx_t *ctx, const char *newval); +isc_result_t +dns_c_ctx_getmemstatsfilename(dns_c_ctx_t *ctx, char **retval); +isc_result_t +dns_c_ctx_unsetmemstatsfilename(dns_c_ctx_t *ctx); -isc_result_t dns_c_ctx_settransfersin(dns_c_ctx_t *cfg, - isc_int32_t newval); -isc_result_t dns_c_ctx_gettransfersin(dns_c_ctx_t *cfg, - isc_int32_t *retval); -isc_result_t dns_c_ctx_unsettransfersin(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setnamedxfer(dns_c_ctx_t *ctx, const char *newval); +isc_result_t +dns_c_ctx_getnamedxfer(dns_c_ctx_t *ctx, char **retval); +isc_result_t +dns_c_ctx_unsetnamedxfer(dns_c_ctx_t *ctx); -isc_result_t dns_c_ctx_settransfersperns(dns_c_ctx_t *cfg, - isc_int32_t newval); -isc_result_t dns_c_ctx_gettransfersperns(dns_c_ctx_t *cfg, - isc_int32_t *retval); -isc_result_t dns_c_ctx_unsettransfersperns(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_settransfersin(dns_c_ctx_t *cfg, isc_int32_t newval); +isc_result_t +dns_c_ctx_gettransfersin(dns_c_ctx_t *cfg, isc_int32_t *retval); -isc_result_t dns_c_ctx_settransfersout(dns_c_ctx_t *cfg, - isc_int32_t newval); -isc_result_t dns_c_ctx_gettransfersout(dns_c_ctx_t *cfg, - isc_int32_t *retval); -isc_result_t dns_c_ctx_unsettransfersout(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_unsettransfersin(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_settransfersperns(dns_c_ctx_t *cfg, isc_int32_t newval); -isc_result_t dns_c_ctx_setmaxlogsizeixfr(dns_c_ctx_t *cfg, - isc_int32_t newval); -isc_result_t dns_c_ctx_getmaxlogsizeixfr(dns_c_ctx_t *cfg, - isc_int32_t *retval); -isc_result_t dns_c_ctx_unsetmaxlogsizeixfr(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_gettransfersperns(dns_c_ctx_t *cfg, isc_int32_t *retval); +isc_result_t +dns_c_ctx_unsettransfersperns(dns_c_ctx_t *cfg); -isc_result_t dns_c_ctx_setcleaninterval(dns_c_ctx_t *cfg, - isc_int32_t newval); -isc_result_t dns_c_ctx_getcleaninterval(dns_c_ctx_t *cfg, - isc_int32_t *retval); -isc_result_t dns_c_ctx_unsetcleaninterval(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_settransfersout(dns_c_ctx_t *cfg, isc_int32_t newval); +isc_result_t +dns_c_ctx_gettransfersout(dns_c_ctx_t *cfg, isc_int32_t *retval); -isc_result_t dns_c_ctx_setinterfaceinterval(dns_c_ctx_t *cfg, - isc_int32_t newval); -isc_result_t dns_c_ctx_getinterfaceinterval(dns_c_ctx_t *cfg, - isc_int32_t *retval); -isc_result_t dns_c_ctx_unsetinterfaceinterval(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_unsettransfersout(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setmaxlogsizeixfr(dns_c_ctx_t *cfg, isc_int32_t newval); -isc_result_t dns_c_ctx_setstatsinterval(dns_c_ctx_t *cfg, - isc_int32_t newval); -isc_result_t dns_c_ctx_getstatsinterval(dns_c_ctx_t *cfg, - isc_int32_t *retval); -isc_result_t dns_c_ctx_unsetstatsinterval(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_getmaxlogsizeixfr(dns_c_ctx_t *cfg, isc_int32_t *retval); +isc_result_t +dns_c_ctx_unsetmaxlogsizeixfr(dns_c_ctx_t *cfg); -isc_result_t dns_c_ctx_setheartbeatinterval(dns_c_ctx_t *cfg, - isc_int32_t newval); -isc_result_t dns_c_ctx_getheartbeatinterval(dns_c_ctx_t *cfg, - isc_int32_t *retval); -isc_result_t dns_c_ctx_unsetheartbeatinterval(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setcleaninterval(dns_c_ctx_t *cfg, isc_int32_t newval); +isc_result_t +dns_c_ctx_getcleaninterval(dns_c_ctx_t *cfg, isc_int32_t *retval); -isc_result_t dns_c_ctx_setmaxtransfertimein(dns_c_ctx_t *cfg, - isc_int32_t newval); -isc_result_t dns_c_ctx_getmaxtransfertimein(dns_c_ctx_t *cfg, - isc_int32_t *retval); -isc_result_t dns_c_ctx_unsetmaxtransfertimein(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_unsetcleaninterval(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setinterfaceinterval(dns_c_ctx_t *cfg, isc_int32_t newval); -isc_result_t dns_c_ctx_setmaxtransfertimeout(dns_c_ctx_t *cfg, - isc_int32_t newval); -isc_result_t dns_c_ctx_getmaxtransfertimeout(dns_c_ctx_t *cfg, - isc_int32_t *retval); -isc_result_t dns_c_ctx_unsetmaxtransfertimeout(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_getinterfaceinterval(dns_c_ctx_t *cfg, isc_int32_t *retval); +isc_result_t +dns_c_ctx_unsetinterfaceinterval(dns_c_ctx_t *cfg); -isc_result_t dns_c_ctx_setmaxtransferidlein(dns_c_ctx_t *cfg, - isc_int32_t newval); -isc_result_t dns_c_ctx_getmaxtransferidlein(dns_c_ctx_t *cfg, - isc_int32_t *retval); -isc_result_t dns_c_ctx_unsetmaxtransferidlein(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setstatsinterval(dns_c_ctx_t *cfg, isc_int32_t newval); +isc_result_t +dns_c_ctx_getstatsinterval(dns_c_ctx_t *cfg, isc_int32_t *retval); -isc_result_t dns_c_ctx_setmaxtransferidleout(dns_c_ctx_t *cfg, - isc_int32_t newval); -isc_result_t dns_c_ctx_getmaxtransferidleout(dns_c_ctx_t *cfg, - isc_int32_t *retval); -isc_result_t dns_c_ctx_unsetmaxtransferidleout(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_unsetstatsinterval(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setheartbeatinterval(dns_c_ctx_t *cfg, isc_int32_t newval); -isc_result_t dns_c_ctx_setlamettl(dns_c_ctx_t *cfg, isc_int32_t newval); -isc_result_t dns_c_ctx_getlamettl(dns_c_ctx_t *cfg, isc_int32_t *retval); -isc_result_t dns_c_ctx_unsetlamettl(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_getheartbeatinterval(dns_c_ctx_t *cfg, isc_int32_t *retval); +isc_result_t +dns_c_ctx_unsetheartbeatinterval(dns_c_ctx_t *cfg); -isc_result_t dns_c_ctx_settcpclients(dns_c_ctx_t *cfg, - isc_int32_t newval); -isc_result_t dns_c_ctx_gettcpclients(dns_c_ctx_t *cfg, - isc_int32_t *retval); -isc_result_t dns_c_ctx_unsettcpclients(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setmaxtransfertimein(dns_c_ctx_t *cfg, isc_int32_t newval); +isc_result_t +dns_c_ctx_getmaxtransfertimein(dns_c_ctx_t *cfg, isc_int32_t *retval); -isc_result_t dns_c_ctx_setrecursiveclients(dns_c_ctx_t *cfg, - isc_int32_t newval); -isc_result_t dns_c_ctx_getrecursiveclients(dns_c_ctx_t *cfg, - isc_int32_t *retval); -isc_result_t dns_c_ctx_unsetrecursiveclients(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_unsetmaxtransfertimein(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setmaxtransfertimeout(dns_c_ctx_t *cfg, isc_int32_t newval); -isc_result_t dns_c_ctx_setminroots(dns_c_ctx_t *cfg, - isc_int32_t newval); -isc_result_t dns_c_ctx_getminroots(dns_c_ctx_t *cfg, - isc_int32_t *retval); -isc_result_t dns_c_ctx_unsetminroots(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_getmaxtransfertimeout(dns_c_ctx_t *cfg, isc_int32_t *retval); +isc_result_t +dns_c_ctx_unsetmaxtransfertimeout(dns_c_ctx_t *cfg); -isc_result_t dns_c_ctx_setserialqueries(dns_c_ctx_t *cfg, - isc_int32_t newval); -isc_result_t dns_c_ctx_getserialqueries(dns_c_ctx_t *cfg, - isc_int32_t *retval); -isc_result_t dns_c_ctx_unsetserialqueries(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setmaxtransferidlein(dns_c_ctx_t *cfg, isc_int32_t newval); +isc_result_t +dns_c_ctx_getmaxtransferidlein(dns_c_ctx_t *cfg, isc_int32_t *retval); -isc_result_t dns_c_ctx_setdatasize(dns_c_ctx_t *cfg, isc_uint32_t newval); -isc_result_t dns_c_ctx_getdatasize(dns_c_ctx_t *cfg, isc_uint32_t *retval); -isc_result_t dns_c_ctx_unsetdatasize(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_unsetmaxtransferidlein(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setmaxtransferidleout(dns_c_ctx_t *cfg, isc_int32_t newval); -isc_result_t dns_c_ctx_setstacksize(dns_c_ctx_t *cfg, +isc_result_t +dns_c_ctx_getmaxtransferidleout(dns_c_ctx_t *cfg, isc_int32_t *retval); + +isc_result_t +dns_c_ctx_unsetmaxtransferidleout(dns_c_ctx_t *cfg); + +isc_result_t +dns_c_ctx_setlamettl(dns_c_ctx_t *cfg, isc_int32_t newval); + +isc_result_t +dns_c_ctx_getlamettl(dns_c_ctx_t *cfg, isc_int32_t *retval); + +isc_result_t +dns_c_ctx_unsetlamettl(dns_c_ctx_t *cfg); + +isc_result_t +dns_c_ctx_settcpclients(dns_c_ctx_t *cfg, isc_int32_t newval); + +isc_result_t +dns_c_ctx_gettcpclients(dns_c_ctx_t *cfg, isc_int32_t *retval); + +isc_result_t +dns_c_ctx_unsettcpclients(dns_c_ctx_t *cfg); + +isc_result_t +dns_c_ctx_setrecursiveclients(dns_c_ctx_t *cfg, isc_int32_t newval); + +isc_result_t +dns_c_ctx_getrecursiveclients(dns_c_ctx_t *cfg, isc_int32_t *retval); + +isc_result_t +dns_c_ctx_unsetrecursiveclients(dns_c_ctx_t *cfg); + +isc_result_t +dns_c_ctx_setminroots(dns_c_ctx_t *cfg, isc_int32_t newval); + +isc_result_t +dns_c_ctx_getminroots(dns_c_ctx_t *cfg, isc_int32_t *retval); + +isc_result_t +dns_c_ctx_unsetminroots(dns_c_ctx_t *cfg); + +isc_result_t +dns_c_ctx_setserialqueries(dns_c_ctx_t *cfg, isc_int32_t newval); + +isc_result_t +dns_c_ctx_getserialqueries(dns_c_ctx_t *cfg, isc_int32_t *retval); + +isc_result_t +dns_c_ctx_unsetserialqueries(dns_c_ctx_t *cfg); + +isc_result_t +dns_c_ctx_setdatasize(dns_c_ctx_t *cfg, isc_uint32_t newval); + +isc_result_t +dns_c_ctx_getdatasize(dns_c_ctx_t *cfg, isc_uint32_t *retval); + +isc_result_t +dns_c_ctx_unsetdatasize(dns_c_ctx_t *cfg); + +isc_result_t +dns_c_ctx_setstacksize(dns_c_ctx_t *cfg, isc_uint32_t newval); -isc_result_t dns_c_ctx_getstacksize(dns_c_ctx_t *cfg, +isc_result_t +dns_c_ctx_getstacksize(dns_c_ctx_t *cfg, isc_uint32_t *retval); -isc_result_t dns_c_ctx_unsetstacksize(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_unsetstacksize(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setcoresize(dns_c_ctx_t *cfg, isc_uint32_t newval); -isc_result_t dns_c_ctx_setcoresize(dns_c_ctx_t *cfg, isc_uint32_t newval); -isc_result_t dns_c_ctx_getcoresize(dns_c_ctx_t *cfg, isc_uint32_t *retval); -isc_result_t dns_c_ctx_unsetcoresize(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_getcoresize(dns_c_ctx_t *cfg, isc_uint32_t *retval); +isc_result_t +dns_c_ctx_unsetcoresize(dns_c_ctx_t *cfg); -isc_result_t dns_c_ctx_setfiles(dns_c_ctx_t *cfg, isc_uint32_t newval); -isc_result_t dns_c_ctx_getfiles(dns_c_ctx_t *cfg, isc_uint32_t *retval); -isc_result_t dns_c_ctx_unsetfiles(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setfiles(dns_c_ctx_t *cfg, isc_uint32_t newval); +isc_result_t +dns_c_ctx_getfiles(dns_c_ctx_t *cfg, isc_uint32_t *retval); -isc_result_t dns_c_ctx_setmaxncachettl(dns_c_ctx_t *cfg, - isc_uint32_t newval); -isc_result_t dns_c_ctx_getmaxncachettl(dns_c_ctx_t *cfg, - isc_uint32_t *retval); -isc_result_t dns_c_ctx_unsetmaxncachettl(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_unsetfiles(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setmaxncachettl(dns_c_ctx_t *cfg, isc_uint32_t newval); +isc_result_t +dns_c_ctx_getmaxncachettl(dns_c_ctx_t *cfg, isc_uint32_t *retval); -isc_result_t dns_c_ctx_setexpertmode(dns_c_ctx_t *cfg, - isc_boolean_t newval); -isc_result_t dns_c_ctx_getexpertmode(dns_c_ctx_t *cfg, - isc_boolean_t *retval); -isc_result_t dns_c_ctx_unsetexpertmode(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_unsetmaxncachettl(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setexpertmode(dns_c_ctx_t *cfg, isc_boolean_t newval); -isc_result_t dns_c_ctx_setfakeiquery(dns_c_ctx_t *cfg, - isc_boolean_t newval); -isc_result_t dns_c_ctx_getfakeiquery(dns_c_ctx_t *cfg, - isc_boolean_t *retval); -isc_result_t dns_c_ctx_unsetfakeiquery(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_getexpertmode(dns_c_ctx_t *cfg, isc_boolean_t *retval); +isc_result_t +dns_c_ctx_unsetexpertmode(dns_c_ctx_t *cfg); -isc_result_t dns_c_ctx_setrecursion(dns_c_ctx_t *cfg, - isc_boolean_t newval); -isc_result_t dns_c_ctx_getrecursion(dns_c_ctx_t *cfg, - isc_boolean_t *retval); -isc_result_t dns_c_ctx_unsetrecursion(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setfakeiquery(dns_c_ctx_t *cfg, isc_boolean_t newval); +isc_result_t +dns_c_ctx_getfakeiquery(dns_c_ctx_t *cfg, isc_boolean_t *retval); -isc_result_t dns_c_ctx_setfetchglue(dns_c_ctx_t *cfg, - isc_boolean_t newval); -isc_result_t dns_c_ctx_getfetchglue(dns_c_ctx_t *cfg, - isc_boolean_t *retval); -isc_result_t dns_c_ctx_unsetfetchglue(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_unsetfakeiquery(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setrecursion(dns_c_ctx_t *cfg, isc_boolean_t newval); -isc_result_t dns_c_ctx_setnotify(dns_c_ctx_t *cfg, isc_boolean_t newval); -isc_result_t dns_c_ctx_getnotify(dns_c_ctx_t *cfg, isc_boolean_t *retval); -isc_result_t dns_c_ctx_unsetnotify(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_getrecursion(dns_c_ctx_t *cfg, isc_boolean_t *retval); +isc_result_t +dns_c_ctx_unsetrecursion(dns_c_ctx_t *cfg); -isc_result_t dns_c_ctx_sethoststatistics(dns_c_ctx_t *cfg, - isc_boolean_t newval); -isc_result_t dns_c_ctx_gethoststatistics(dns_c_ctx_t *cfg, - isc_boolean_t *retval); -isc_result_t dns_c_ctx_unsethoststatistics(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setfetchglue(dns_c_ctx_t *cfg, isc_boolean_t newval); +isc_result_t +dns_c_ctx_getfetchglue(dns_c_ctx_t *cfg, isc_boolean_t *retval); -isc_result_t dns_c_ctx_setdealloconexit(dns_c_ctx_t *cfg, - isc_boolean_t newval); -isc_result_t dns_c_ctx_getdealloconexit(dns_c_ctx_t *cfg, - isc_boolean_t *retval); -isc_result_t dns_c_ctx_unsetdealloconexit(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_unsetfetchglue(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setnotify(dns_c_ctx_t *cfg, isc_boolean_t newval); -isc_result_t dns_c_ctx_setuseixfr(dns_c_ctx_t *cfg, isc_boolean_t newval); -isc_result_t dns_c_ctx_getuseixfr(dns_c_ctx_t *cfg, isc_boolean_t *retval); -isc_result_t dns_c_ctx_unsetuseixfr(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_getnotify(dns_c_ctx_t *cfg, isc_boolean_t *retval); +isc_result_t +dns_c_ctx_unsetnotify(dns_c_ctx_t *cfg); -isc_result_t dns_c_ctx_setmaintainixfrbase(dns_c_ctx_t *cfg, - isc_boolean_t newval); -isc_result_t dns_c_ctx_getmaintainixfrbase(dns_c_ctx_t *cfg, - isc_boolean_t *retval); -isc_result_t dns_c_ctx_unsetmaintainixfrbase(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_sethoststatistics(dns_c_ctx_t *cfg, isc_boolean_t newval); +isc_result_t +dns_c_ctx_gethoststatistics(dns_c_ctx_t *cfg, isc_boolean_t *retval); -isc_result_t dns_c_ctx_sethasoldclients(dns_c_ctx_t *cfg, - isc_boolean_t newval); -isc_result_t dns_c_ctx_gethasoldclients(dns_c_ctx_t *cfg, - isc_boolean_t *retval); -isc_result_t dns_c_ctx_unsethasoldclients(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_unsethoststatistics(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setdealloconexit(dns_c_ctx_t *cfg, isc_boolean_t newval); -isc_result_t dns_c_ctx_setauthnxdomain(dns_c_ctx_t *cfg, - isc_boolean_t newval); -isc_result_t dns_c_ctx_getauthnxdomain(dns_c_ctx_t *cfg, - isc_boolean_t *retval); -isc_result_t dns_c_ctx_unsetauthnxdomain(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_getdealloconexit(dns_c_ctx_t *cfg, isc_boolean_t *retval); +isc_result_t +dns_c_ctx_unsetdealloconexit(dns_c_ctx_t *cfg); -isc_result_t dns_c_ctx_setmultiplecnames(dns_c_ctx_t *cfg, - isc_boolean_t newval); -isc_result_t dns_c_ctx_getmultiplecnames(dns_c_ctx_t *cfg, - isc_boolean_t *retval); -isc_result_t dns_c_ctx_unsetmultiplecnames(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setuseixfr(dns_c_ctx_t *cfg, isc_boolean_t newval); +isc_result_t +dns_c_ctx_getuseixfr(dns_c_ctx_t *cfg, isc_boolean_t *retval); -isc_result_t dns_c_ctx_setuseidpool(dns_c_ctx_t *cfg, - isc_boolean_t newval); -isc_result_t dns_c_ctx_getuseidpool(dns_c_ctx_t *cfg, - isc_boolean_t *retval); -isc_result_t dns_c_ctx_unsetuseidpool(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_unsetuseixfr(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setmaintainixfrbase(dns_c_ctx_t *cfg, isc_boolean_t newval); -isc_result_t dns_c_ctx_setdialup(dns_c_ctx_t *cfg, isc_boolean_t newval); -isc_result_t dns_c_ctx_getdialup(dns_c_ctx_t *cfg, isc_boolean_t *retval); -isc_result_t dns_c_ctx_unsetdialup(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_getmaintainixfrbase(dns_c_ctx_t *cfg, isc_boolean_t *retval); +isc_result_t +dns_c_ctx_unsetmaintainixfrbase(dns_c_ctx_t *cfg); -isc_result_t dns_c_ctx_setrfc2308type1(dns_c_ctx_t *cfg, - isc_boolean_t newval); -isc_result_t dns_c_ctx_getrfc2308type1(dns_c_ctx_t *cfg, - isc_boolean_t *retval); -isc_result_t dns_c_ctx_unsetrfc2308type1(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_sethasoldclients(dns_c_ctx_t *cfg, isc_boolean_t newval); +isc_result_t +dns_c_ctx_gethasoldclients(dns_c_ctx_t *cfg, isc_boolean_t *retval); -isc_result_t dns_c_ctx_setrequestixfr(dns_c_ctx_t *cfg, +isc_result_t +dns_c_ctx_unsethasoldclients(dns_c_ctx_t *cfg); + +isc_result_t +dns_c_ctx_setauthnxdomain(dns_c_ctx_t *cfg, isc_boolean_t newval); + +isc_result_t +dns_c_ctx_getauthnxdomain(dns_c_ctx_t *cfg, isc_boolean_t *retval); + +isc_result_t +dns_c_ctx_unsetauthnxdomain(dns_c_ctx_t *cfg); + +isc_result_t +dns_c_ctx_setmultiplecnames(dns_c_ctx_t *cfg, isc_boolean_t newval); + +isc_result_t +dns_c_ctx_getmultiplecnames(dns_c_ctx_t *cfg, isc_boolean_t *retval); + +isc_result_t +dns_c_ctx_unsetmultiplecnames(dns_c_ctx_t *cfg); + +isc_result_t +dns_c_ctx_setuseidpool(dns_c_ctx_t *cfg, isc_boolean_t newval); + +isc_result_t +dns_c_ctx_getuseidpool(dns_c_ctx_t *cfg, isc_boolean_t *retval); + +isc_result_t +dns_c_ctx_unsetuseidpool(dns_c_ctx_t *cfg); + +isc_result_t +dns_c_ctx_setdialup(dns_c_ctx_t *cfg, isc_boolean_t newval); + +isc_result_t +dns_c_ctx_getdialup(dns_c_ctx_t *cfg, isc_boolean_t *retval); + +isc_result_t +dns_c_ctx_unsetdialup(dns_c_ctx_t *cfg); + +isc_result_t +dns_c_ctx_setrfc2308type1(dns_c_ctx_t *cfg, isc_boolean_t newval); + +isc_result_t +dns_c_ctx_getrfc2308type1(dns_c_ctx_t *cfg, isc_boolean_t *retval); + +isc_result_t +dns_c_ctx_unsetrfc2308type1(dns_c_ctx_t *cfg); + +isc_result_t +dns_c_ctx_setrequestixfr(dns_c_ctx_t *cfg, isc_boolean_t newval); -isc_result_t dns_c_ctx_getrequestixfr(dns_c_ctx_t *cfg, +isc_result_t +dns_c_ctx_getrequestixfr(dns_c_ctx_t *cfg, isc_boolean_t *retval); -isc_result_t dns_c_ctx_unsetrequestixfr(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_unsetrequestixfr(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setprovideixfr(dns_c_ctx_t *cfg, isc_boolean_t newval); -isc_result_t dns_c_ctx_setprovideixfr(dns_c_ctx_t *cfg, - isc_boolean_t newval); -isc_result_t dns_c_ctx_getprovideixfr(dns_c_ctx_t *cfg, - isc_boolean_t *retval); -isc_result_t dns_c_ctx_unsetprovideixfr(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_getprovideixfr(dns_c_ctx_t *cfg, isc_boolean_t *retval); +isc_result_t +dns_c_ctx_unsetprovideixfr(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_settreatcrasspace(dns_c_ctx_t *cfg, isc_boolean_t newval); -isc_result_t dns_c_ctx_settreatcrasspace(dns_c_ctx_t *cfg, - isc_boolean_t newval); -isc_result_t dns_c_ctx_gettreatcrasspace(dns_c_ctx_t *cfg, - isc_boolean_t *retval); -isc_result_t dns_c_ctx_unsettreatcrasspace(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_gettreatcrasspace(dns_c_ctx_t *cfg, isc_boolean_t *retval); +isc_result_t +dns_c_ctx_unsettreatcrasspace(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_settransfersource(dns_c_ctx_t *ctx, isc_sockaddr_t transfer_source); -isc_result_t dns_c_ctx_settransfersource(dns_c_ctx_t *ctx, - isc_sockaddr_t transfer_source); -isc_result_t dns_c_ctx_gettransfersource(dns_c_ctx_t *ctx, - isc_sockaddr_t *transfer_source); -isc_result_t dns_c_ctx_unsettransfersource(dns_c_ctx_t *ctx); +isc_result_t +dns_c_ctx_gettransfersource(dns_c_ctx_t *ctx, isc_sockaddr_t *transfer_source); +isc_result_t +dns_c_ctx_unsettransfersource(dns_c_ctx_t *ctx); -isc_result_t dns_c_ctx_settransfersourcev6(dns_c_ctx_t *ctx, - isc_sockaddr_t transfer_source_v6); -isc_result_t dns_c_ctx_gettransfersourcev6(dns_c_ctx_t *ctx, - isc_sockaddr_t *transfer_source_v6); -isc_result_t dns_c_ctx_unsettransfersourcev6(dns_c_ctx_t *ctx); +isc_result_t +dns_c_ctx_settransfersourcev6(dns_c_ctx_t *ctx, + isc_sockaddr_t transfer_source_v6); +isc_result_t +dns_c_ctx_gettransfersourcev6(dns_c_ctx_t *ctx, + isc_sockaddr_t *transfer_source_v6); -isc_result_t dns_c_ctx_setquerysource(dns_c_ctx_t *ctx, - isc_sockaddr_t query_source); -isc_result_t dns_c_ctx_getquerysource(dns_c_ctx_t *ctx, - isc_sockaddr_t *query_source); -isc_result_t dns_c_ctx_unsetquerysource(dns_c_ctx_t *ctx); +isc_result_t +dns_c_ctx_unsettransfersourcev6(dns_c_ctx_t *ctx); +isc_result_t +dns_c_ctx_setquerysource(dns_c_ctx_t *ctx, isc_sockaddr_t query_source); -isc_result_t dns_c_ctx_setquerysourcev6(dns_c_ctx_t *ctx, - isc_sockaddr_t query_source_v6); -isc_result_t dns_c_ctx_getquerysourcev6(dns_c_ctx_t *ctx, - isc_sockaddr_t *query_source_v6); -isc_result_t dns_c_ctx_unsetquerysourcev6(dns_c_ctx_t *ctx); +isc_result_t +dns_c_ctx_getquerysource(dns_c_ctx_t *ctx, isc_sockaddr_t *query_source); +isc_result_t +dns_c_ctx_unsetquerysource(dns_c_ctx_t *ctx); -isc_result_t dns_c_ctx_setforward(dns_c_ctx_t *cfg, dns_c_forw_t forward); -isc_result_t dns_c_ctx_getforward(dns_c_ctx_t *cfg, dns_c_forw_t *forward); -isc_result_t dns_c_ctx_unsetforward(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setquerysourcev6(dns_c_ctx_t *ctx, isc_sockaddr_t query_source_v6); +isc_result_t +dns_c_ctx_getquerysourcev6(dns_c_ctx_t *ctx, isc_sockaddr_t *query_source_v6); +isc_result_t +dns_c_ctx_unsetquerysourcev6(dns_c_ctx_t *ctx); -isc_result_t dns_c_ctx_settkeydomain(dns_c_ctx_t *cfg, const char *newval); -isc_result_t dns_c_ctx_settkeydhkey(dns_c_ctx_t *cfg, - const char *newcpval, - isc_int32_t newival); -isc_result_t dns_c_ctx_gettkeydomain(dns_c_ctx_t *cfg, char **retval); -isc_result_t dns_c_ctx_gettkeydhkey(dns_c_ctx_t *cfg, - char **retcpval, isc_int32_t *retival); +isc_result_t +dns_c_ctx_setforward(dns_c_ctx_t *cfg, dns_c_forw_t forward); + +isc_result_t +dns_c_ctx_getforward(dns_c_ctx_t *cfg, dns_c_forw_t *forward); + +isc_result_t +dns_c_ctx_unsetforward(dns_c_ctx_t *cfg); + +isc_result_t +dns_c_ctx_settkeydomain(dns_c_ctx_t *cfg, const char *newval); + +isc_result_t +dns_c_ctx_settkeydhkey(dns_c_ctx_t *cfg, const char *newcpval, + isc_int32_t newival); + +isc_result_t +dns_c_ctx_gettkeydomain(dns_c_ctx_t *cfg, char **retval); + +isc_result_t +dns_c_ctx_gettkeydhkey(dns_c_ctx_t *cfg, char **retcpval, + isc_int32_t *retival); /* XXX need unset version */ +isc_result_t +dns_c_ctx_setalsonotify(dns_c_ctx_t *ctx, dns_c_iplist_t *newval); +isc_result_t +dns_c_ctx_getalsonotify(dns_c_ctx_t *ctx, dns_c_iplist_t **ret); -isc_result_t dns_c_ctx_setalsonotify(dns_c_ctx_t *ctx, - dns_c_iplist_t *newval); -isc_result_t dns_c_ctx_getalsonotify(dns_c_ctx_t *ctx, - dns_c_iplist_t **ret); -isc_result_t dns_c_ctx_unsetalsonotify(dns_c_ctx_t *ctx); +isc_result_t +dns_c_ctx_unsetalsonotify(dns_c_ctx_t *ctx); +isc_result_t +dns_c_ctx_setchecknames(dns_c_ctx_t *cfg, dns_c_trans_t transtype, + dns_severity_t newval); +isc_result_t +dns_c_ctx_getchecknames(dns_c_ctx_t *cfg, dns_c_trans_t transtype, + dns_severity_t *retval); -isc_result_t dns_c_ctx_setchecknames(dns_c_ctx_t *cfg, - dns_c_trans_t transtype, - dns_severity_t newval); -isc_result_t dns_c_ctx_getchecknames(dns_c_ctx_t *cfg, - dns_c_trans_t transtype, - dns_severity_t *retval); -isc_result_t dns_c_ctx_unsetchecknames(dns_c_ctx_t *cfg, - dns_c_trans_t transtype); +isc_result_t +dns_c_ctx_unsetchecknames(dns_c_ctx_t *cfg, dns_c_trans_t transtype); +isc_result_t +dns_c_ctx_settransferformat(dns_c_ctx_t *cfg, dns_transfer_format_t tformat); -isc_result_t dns_c_ctx_settransferformat(dns_c_ctx_t *cfg, - dns_transfer_format_t tformat); -isc_result_t dns_c_ctx_gettransferformat(dns_c_ctx_t *cfg, - dns_transfer_format_t *tformat); -isc_result_t dns_c_ctx_unsettransferformat(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_gettransferformat(dns_c_ctx_t *cfg, dns_transfer_format_t *tformat); +isc_result_t +dns_c_ctx_unsettransferformat(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setallowquery(dns_c_ctx_t *cfg, dns_c_ipmatchlist_t *iml); -isc_result_t dns_c_ctx_setallowquery(dns_c_ctx_t *cfg, - dns_c_ipmatchlist_t *iml); -isc_result_t dns_c_ctx_getallowquery(dns_c_ctx_t *cfg, - dns_c_ipmatchlist_t **list); -isc_result_t dns_c_ctx_unsetallowquery(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_getallowquery(dns_c_ctx_t *cfg, dns_c_ipmatchlist_t **list); +isc_result_t +dns_c_ctx_unsetallowquery(dns_c_ctx_t *cfg); -isc_result_t dns_c_ctx_setallowtransfer(dns_c_ctx_t *cfg, - dns_c_ipmatchlist_t *iml); -isc_result_t dns_c_ctx_getallowtransfer(dns_c_ctx_t *cfg, - dns_c_ipmatchlist_t **list); -isc_result_t dns_c_ctx_unsetallowtransfer(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setallowtransfer(dns_c_ctx_t *cfg, dns_c_ipmatchlist_t *iml); +isc_result_t +dns_c_ctx_getallowtransfer(dns_c_ctx_t *cfg, dns_c_ipmatchlist_t **list); -isc_result_t dns_c_ctx_setallowrecursion(dns_c_ctx_t *cfg, - dns_c_ipmatchlist_t *iml); -isc_result_t dns_c_ctx_getallowrecursion(dns_c_ctx_t *cfg, - dns_c_ipmatchlist_t **list); -isc_result_t dns_c_ctx_unsetallowrecursion(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_unsetallowtransfer(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setallowrecursion(dns_c_ctx_t *cfg, dns_c_ipmatchlist_t *iml); -isc_result_t dns_c_ctx_setblackhole(dns_c_ctx_t *cfg, - dns_c_ipmatchlist_t *iml); -isc_result_t dns_c_ctx_getblackhole(dns_c_ctx_t *cfg, - dns_c_ipmatchlist_t **list); -isc_result_t dns_c_ctx_unsetblackhole(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_getallowrecursion(dns_c_ctx_t *cfg, dns_c_ipmatchlist_t **list); +isc_result_t +dns_c_ctx_unsetallowrecursion(dns_c_ctx_t *cfg); -isc_result_t dns_c_ctx_settopology(dns_c_ctx_t *cfg, - dns_c_ipmatchlist_t *iml); -isc_result_t dns_c_ctx_gettopology(dns_c_ctx_t *cfg, - dns_c_ipmatchlist_t **list); -isc_result_t dns_c_ctx_unsettopology(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setblackhole(dns_c_ctx_t *cfg, dns_c_ipmatchlist_t *iml); +isc_result_t +dns_c_ctx_getblackhole(dns_c_ctx_t *cfg, dns_c_ipmatchlist_t **list); -isc_result_t dns_c_ctx_setsortlist(dns_c_ctx_t *cfg, - dns_c_ipmatchlist_t *iml); -isc_result_t dns_c_ctx_getsortlist(dns_c_ctx_t *cfg, - dns_c_ipmatchlist_t **list); -isc_result_t dns_c_ctx_unsetsortlist(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_unsetblackhole(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_settopology(dns_c_ctx_t *cfg, dns_c_ipmatchlist_t *iml); -isc_result_t dns_c_ctx_setallowupdateforwarding(dns_c_ctx_t *cfg, - dns_c_ipmatchlist_t *iml); -isc_result_t dns_c_ctx_getallowupdateforwarding(dns_c_ctx_t *cfg, - dns_c_ipmatchlist_t **list); -isc_result_t dns_c_ctx_unsetallowupdateforwarding(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_gettopology(dns_c_ctx_t *cfg, dns_c_ipmatchlist_t **list); +isc_result_t +dns_c_ctx_unsettopology(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setsortlist(dns_c_ctx_t *cfg, dns_c_ipmatchlist_t *iml); +isc_result_t +dns_c_ctx_getsortlist(dns_c_ctx_t *cfg, dns_c_ipmatchlist_t **list); -isc_result_t dns_c_ctx_setforwarders(dns_c_ctx_t *cfg, isc_boolean_t copy, - dns_c_iplist_t *iml); -isc_result_t dns_c_ctx_getforwarders(dns_c_ctx_t *cfg, - dns_c_iplist_t **list); -isc_result_t dns_c_ctx_unsetforwarders(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_unsetsortlist(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setallowupdateforwarding(dns_c_ctx_t *cfg, dns_c_ipmatchlist_t *iml); +isc_result_t +dns_c_ctx_getallowupdateforwarding(dns_c_ctx_t *cfg, + dns_c_ipmatchlist_t **list); -isc_result_t dns_c_ctx_addlisten_on(dns_c_ctx_t *cfg, int port, - dns_c_ipmatchlist_t *ml, - isc_boolean_t copy); -isc_result_t dns_c_ctx_getlistenlist(dns_c_ctx_t *cfg, - dns_c_lstnlist_t **ll); +isc_result_t +dns_c_ctx_unsetallowupdateforwarding(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_setforwarders(dns_c_ctx_t *cfg, isc_boolean_t copy, + dns_c_iplist_t *iml); -isc_result_t dns_c_ctx_setrrsetorderlist(dns_c_ctx_t *cfg, - isc_boolean_t copy, - dns_c_rrsolist_t *olist); -isc_result_t dns_c_ctx_getrrsetorderlist(dns_c_ctx_t *cfg, - dns_c_rrsolist_t **olist); +isc_result_t +dns_c_ctx_getforwarders(dns_c_ctx_t *cfg, dns_c_iplist_t **list); +isc_result_t +dns_c_ctx_unsetforwarders(dns_c_ctx_t *cfg); +isc_result_t +dns_c_ctx_addlisten_on(dns_c_ctx_t *cfg, int port, dns_c_ipmatchlist_t *ml, + isc_boolean_t copy); -isc_result_t dns_c_ctx_gettrustedkeys(dns_c_ctx_t *cfg, - dns_c_tkeylist_t **retval); +isc_result_t +dns_c_ctx_getlistenlist(dns_c_ctx_t *cfg, dns_c_lstnlist_t **ll); +isc_result_t +dns_c_ctx_setrrsetorderlist(dns_c_ctx_t *cfg, isc_boolean_t copy, + dns_c_rrsolist_t *olist); +isc_result_t +dns_c_ctx_getrrsetorderlist(dns_c_ctx_t *cfg, dns_c_rrsolist_t **olist); + +isc_result_t +dns_c_ctx_gettrustedkeys(dns_c_ctx_t *cfg, dns_c_tkeylist_t **retval); + +ISC_LANG_ENDDECLS #endif /* DNS_CONFCTX_H */ diff --git a/lib/dns/include/dns/confip.h b/lib/dns/include/dns/confip.h index faa1324a82..ec3ae3db3f 100644 --- a/lib/dns/include/dns/confip.h +++ b/lib/dns/include/dns/confip.h @@ -53,11 +53,12 @@ #include -#include +#include #include #include #include #include +#include #include @@ -75,14 +76,10 @@ #define DNS_C_IPMELEM_VALID(ptr) ISC_MAGIC_VALID(ptr, DNS_C_IPMELEM_MAGIC) #define DNS_C_IPMLIST_VALID(ptr) ISC_MAGIC_VALID(ptr, DNS_C_IPMLIST_MAGIC) - - - /*** *** Types ***/ - typedef struct dns_c_iplist dns_c_iplist_t; typedef struct dns_c_ipmatch_direct dns_c_ipmatch_direct_t ; typedef struct dns_c_ipmatch_indirect dns_c_ipmatch_indirect_t; @@ -104,8 +101,7 @@ struct dns_c_iplist { -struct dns_c_ipmatch_direct -{ +struct dns_c_ipmatch_direct { isc_uint32_t magic; isc_sockaddr_t address; /* XXX IPv6??? */ @@ -114,8 +110,7 @@ struct dns_c_ipmatch_direct -struct dns_c_ipmatch_indirect -{ +struct dns_c_ipmatch_indirect { isc_uint32_t magic; isc_textregion_t refname; /* for acls, mostly. */ @@ -124,8 +119,7 @@ struct dns_c_ipmatch_indirect -struct dns_c_ipmatch_element -{ +struct dns_c_ipmatch_element { isc_uint32_t magic; dns_c_ipmatch_type_t type; @@ -141,8 +135,7 @@ struct dns_c_ipmatch_element }; -struct dns_c_ipmatch_list -{ +struct dns_c_ipmatch_list { isc_uint32_t magic; isc_mem_t *mem; @@ -156,82 +149,113 @@ struct dns_c_ipmatch_list *** Functions ***/ +ISC_LANG_BEGINDECLS + /* * In all the functions below where an isc_mem_t is a parameter, that * paramater will be used for all memory allocation. */ -isc_result_t dns_c_ipmatchelement_new(isc_mem_t *mem, - dns_c_ipmatchelement_t **result); -isc_result_t dns_c_ipmatchelement_delete(isc_mem_t *mem, - dns_c_ipmatchelement_t **ipme); -isc_result_t dns_c_ipmatchelement_copy(isc_mem_t *mem, - dns_c_ipmatchelement_t **dest, - dns_c_ipmatchelement_t *src); -isc_result_t dns_c_ipmatchelement_print(FILE *fp, int indent, - dns_c_ipmatchelement_t *ime); -isc_boolean_t dns_c_ipmatchelement_isneg(dns_c_ipmatchelement_t *elem); +isc_result_t +dns_c_ipmatchelement_new(isc_mem_t *mem, dns_c_ipmatchelement_t **result); -isc_result_t dns_c_ipmatch_negate(dns_c_ipmatchelement_t *ipe); -isc_result_t dns_c_ipmatch_aclnew(isc_mem_t *mem, - dns_c_ipmatchelement_t **result, - const char *aclname); -isc_result_t dns_c_ipmatchkey_new(isc_mem_t *mem, - dns_c_ipmatchelement_t **result, - const char *key); -isc_result_t dns_c_ipmatchany_new(isc_mem_t *mem, - dns_c_ipmatchelement_t **result); -isc_result_t dns_c_ipmatchlocalhost_new(isc_mem_t *mem, - dns_c_ipmatchelement_t **result); -isc_result_t dns_c_ipmatchlocalnets_new(isc_mem_t *mem, - dns_c_ipmatchelement_t **result); -isc_result_t dns_c_ipmatchpattern_new(isc_mem_t *mem, - dns_c_ipmatchelement_t **result, - isc_sockaddr_t address, - isc_uint32_t maskbits); -isc_result_t dns_c_ipmatchindirect_new(isc_mem_t *mem, - dns_c_ipmatchelement_t **result, - dns_c_ipmatchlist_t *iml, - const char *name); +isc_result_t +dns_c_ipmatchelement_delete(isc_mem_t *mem, dns_c_ipmatchelement_t **ipme); -isc_result_t dns_c_ipmatchlist_new(isc_mem_t *mem, - dns_c_ipmatchlist_t **ptr); -isc_result_t dns_c_ipmatchlist_detach(dns_c_ipmatchlist_t **ml); -void dns_c_ipmatchlist_attach(dns_c_ipmatchlist_t *source, - dns_c_ipmatchlist_t **target); -isc_result_t dns_c_ipmatchlist_copy(isc_mem_t *mem, - dns_c_ipmatchlist_t **dest, - dns_c_ipmatchlist_t *src); -isc_result_t dns_c_ipmatchlist_empty(dns_c_ipmatchlist_t *ipml); -isc_result_t dns_c_ipmatchlist_append(dns_c_ipmatchlist_t *dest, - dns_c_ipmatchlist_t *src, - isc_boolean_t negate); -isc_result_t dns_c_ipmatchlist_print(FILE *fp, int indent, - dns_c_ipmatchlist_t *iml); +isc_result_t +dns_c_ipmatchelement_copy(isc_mem_t *mem, dns_c_ipmatchelement_t **dest, + dns_c_ipmatchelement_t *src); +isc_result_t +dns_c_ipmatchelement_print(FILE *fp, int indent, dns_c_ipmatchelement_t *ime); +isc_boolean_t +dns_c_ipmatchelement_isneg(dns_c_ipmatchelement_t *elem); -isc_result_t dns_c_iplist_new(isc_mem_t *mem, int length, - dns_c_iplist_t **newlist); -isc_result_t dns_c_iplist_detach(dns_c_iplist_t **list); -isc_result_t dns_c_iplist_copy(isc_mem_t *mem, dns_c_iplist_t **dest, - dns_c_iplist_t *src); -void dns_c_iplist_attach(dns_c_iplist_t *source, - dns_c_iplist_t **target); -isc_result_t dns_c_iplist_append(dns_c_iplist_t *list, - isc_sockaddr_t newaddr); -isc_result_t dns_c_iplist_remove(dns_c_iplist_t *list, - isc_sockaddr_t newaddr); -void dns_c_iplist_print(FILE *fp, int indent, - dns_c_iplist_t *list); -isc_boolean_t dns_c_iplist_equal(dns_c_iplist_t *list1, - dns_c_iplist_t *list2); +isc_result_t +dns_c_ipmatch_negate(dns_c_ipmatchelement_t *ipe); -isc_boolean_t dns_c_ipmatchelement_equal(dns_c_ipmatchelement_t *e1, - dns_c_ipmatchelement_t *e2); +isc_result_t +dns_c_ipmatch_aclnew(isc_mem_t *mem, dns_c_ipmatchelement_t **result, + const char *aclname); -isc_boolean_t dns_c_ipmatchlist_equal(dns_c_ipmatchlist_t *l1, - dns_c_ipmatchlist_t *l2); +isc_result_t +dns_c_ipmatchkey_new(isc_mem_t *mem, dns_c_ipmatchelement_t **result, + const char *key); + +isc_result_t +dns_c_ipmatchany_new(isc_mem_t *mem, dns_c_ipmatchelement_t **result); + +isc_result_t +dns_c_ipmatchlocalhost_new(isc_mem_t *mem, dns_c_ipmatchelement_t **result); + +isc_result_t +dns_c_ipmatchlocalnets_new(isc_mem_t *mem, dns_c_ipmatchelement_t **result); + +isc_result_t +dns_c_ipmatchpattern_new(isc_mem_t *mem, dns_c_ipmatchelement_t **result, + isc_sockaddr_t address, isc_uint32_t maskbits); + +isc_result_t +dns_c_ipmatchindirect_new(isc_mem_t *mem, dns_c_ipmatchelement_t **result, + dns_c_ipmatchlist_t *iml, const char *name); + +isc_result_t +dns_c_ipmatchlist_new(isc_mem_t *mem, dns_c_ipmatchlist_t **ptr); + +isc_result_t +dns_c_ipmatchlist_detach(dns_c_ipmatchlist_t **ml); + +void +dns_c_ipmatchlist_attach(dns_c_ipmatchlist_t *source, + dns_c_ipmatchlist_t **target); + +isc_result_t +dns_c_ipmatchlist_copy(isc_mem_t *mem, dns_c_ipmatchlist_t **dest, + dns_c_ipmatchlist_t *src); + +isc_result_t +dns_c_ipmatchlist_empty(dns_c_ipmatchlist_t *ipml); + +isc_result_t +dns_c_ipmatchlist_append(dns_c_ipmatchlist_t *dest, dns_c_ipmatchlist_t *src, + isc_boolean_t negate); + +isc_result_t +dns_c_ipmatchlist_print(FILE *fp, int indent, dns_c_ipmatchlist_t *iml); + +isc_result_t +dns_c_iplist_new(isc_mem_t *mem, int length, dns_c_iplist_t **newlist); + +isc_result_t +dns_c_iplist_detach(dns_c_iplist_t **list); + +isc_result_t +dns_c_iplist_copy(isc_mem_t *mem, dns_c_iplist_t **dest, dns_c_iplist_t *src); + +void +dns_c_iplist_attach(dns_c_iplist_t *source, dns_c_iplist_t **target); + +isc_result_t +dns_c_iplist_append(dns_c_iplist_t *list, isc_sockaddr_t newaddr); + +isc_result_t +dns_c_iplist_remove(dns_c_iplist_t *list, isc_sockaddr_t newaddr); + +void +dns_c_iplist_print(FILE *fp, int indent, dns_c_iplist_t *list); + +isc_boolean_t +dns_c_iplist_equal(dns_c_iplist_t *list1, dns_c_iplist_t *list2); + +isc_boolean_t +dns_c_ipmatchelement_equal(dns_c_ipmatchelement_t *e1, + dns_c_ipmatchelement_t *e2); + +isc_boolean_t +dns_c_ipmatchlist_equal(dns_c_ipmatchlist_t *l1, dns_c_ipmatchlist_t *l2); + +ISC_LANG_ENDDECLS #endif /* DNS_CONFIP_H */ diff --git a/lib/dns/include/dns/confkeys.h b/lib/dns/include/dns/confkeys.h index 87acc4405b..306caef4aa 100644 --- a/lib/dns/include/dns/confkeys.h +++ b/lib/dns/include/dns/confkeys.h @@ -55,8 +55,8 @@ #include +#include #include -#include #define DNS_C_TKEY_MAGIC 0x544b4559 /* TKEY */ @@ -77,13 +77,10 @@ #define DNS_C_KEYID_VALID(ptr) ISC_MAGIC_VALID(ptr, DNS_C_KEYID_MAGIC) #define DNS_C_KEYIDLIST_VALID(ptr) ISC_MAGIC_VALID(ptr, DNS_C_KEYIDLIST_MAGIC) - - /*** *** Types ***/ - typedef struct dns_c_pubkey dns_c_pubkey_t; typedef struct dns_c_pklist dns_c_pklist_t; typedef struct dns_c_tkey dns_c_tkey_t; @@ -93,10 +90,10 @@ typedef struct dns_c_kdef_list dns_c_kdeflist_t; typedef struct dns_c_kid dns_c_kid_t; typedef struct dns_c_kid_list dns_c_kidlist_t; - -/* The type for holding a trusted key value. */ -struct dns_c_tkey -{ +/* + * The type for holding a trusted key value. + */ +struct dns_c_tkey { isc_uint32_t magic; isc_mem_t *mem; @@ -106,9 +103,10 @@ struct dns_c_tkey ISC_LINK(dns_c_tkey_t) next; }; -/* A list of trusted keys. */ -struct dns_c_tkey_list -{ +/* + * A list of trusted keys. + */ +struct dns_c_tkey_list { isc_uint32_t magic; isc_mem_t *mem; @@ -116,9 +114,10 @@ struct dns_c_tkey_list }; -/* A public key value */ -struct dns_c_pubkey -{ +/* + * A public key value. + */ +struct dns_c_pubkey { isc_uint32_t magic; isc_mem_t *mem; isc_int32_t flags; @@ -129,9 +128,10 @@ struct dns_c_pubkey ISC_LINK(dns_c_pubkey_t) next; }; -/* A list of pubkeys */ -struct dns_c_pklist -{ +/* + * A list of pubkeys. + */ +struct dns_c_pklist { isc_uint32_t magic; isc_mem_t *mem; @@ -139,9 +139,10 @@ struct dns_c_pklist }; -/* A private key definition from a 'key' statement */ -struct dns_c_kdef -{ +/* + * A private key definition from a 'key' statement. + */ +struct dns_c_kdef { isc_uint32_t magic; isc_mem_t *mem; @@ -152,10 +153,10 @@ struct dns_c_kdef ISC_LINK(dns_c_kdef_t) next; }; - -/* A list of private keys */ -struct dns_c_kdef_list -{ +/* + * A list of private keys. + */ +struct dns_c_kdef_list { isc_uint32_t magic; isc_mem_t *mem; @@ -163,9 +164,10 @@ struct dns_c_kdef_list }; -/* A key id for in a server statement 'keys' list */ -struct dns_c_kid -{ +/* + * A key id for in a server statement 'keys' list. + */ +struct dns_c_kid { isc_uint32_t magic; isc_mem_t *mem; char *keyid; @@ -174,134 +176,169 @@ struct dns_c_kid }; -/* List of key ids for a 'server' statement */ -struct dns_c_kid_list -{ +/* + * List of key ids for a 'server' statement. + */ +struct dns_c_kid_list { isc_mem_t *mem; isc_uint32_t magic; ISC_LIST(dns_c_kid_t) keyids; }; - /*** *** Functions ***/ -isc_result_t dns_c_pklist_new(isc_mem_t *mem, - dns_c_pklist_t **pklist); -isc_result_t dns_c_pklist_delete(dns_c_pklist_t **list); -isc_result_t dns_c_pklist_addpubkey(dns_c_pklist_t *list, - dns_c_pubkey_t *pkey, - isc_boolean_t deepcopy); -isc_result_t dns_c_pklist_findpubkey(dns_c_pklist_t *list, - dns_c_pubkey_t **pubkey, - isc_int32_t flags, - isc_int32_t protocol, - isc_int32_t algorithm, - const char *key); -isc_result_t dns_c_pklist_rmpubkey(dns_c_pklist_t *list, - isc_int32_t flags, - isc_int32_t protocol, - isc_int32_t algorithm, - const char *key); -void dns_c_pklist_print(FILE *fp, int indent, - dns_c_pklist_t *pubkey); +ISC_LANG_BEGINDECLS +isc_result_t +dns_c_pklist_new(isc_mem_t *mem, dns_c_pklist_t **pklist); +isc_result_t +dns_c_pklist_delete(dns_c_pklist_t **list); -isc_result_t dns_c_pubkey_new(isc_mem_t *mem, isc_int32_t flags, - isc_int32_t protocol, - isc_int32_t algorithm, - const char *key, dns_c_pubkey_t **pubkey); -isc_result_t dns_c_pubkey_delete(dns_c_pubkey_t **pubkey); -isc_result_t dns_c_pubkey_copy(isc_mem_t *mem, dns_c_pubkey_t **dest, - dns_c_pubkey_t *src); -isc_boolean_t dns_c_pubkey_equal(dns_c_pubkey_t *k1, dns_c_pubkey_t *k2); -void dns_c_pubkey_print(FILE *fp, int indent, - dns_c_pubkey_t *pubkey); +isc_result_t +dns_c_pklist_addpubkey(dns_c_pklist_t *list, dns_c_pubkey_t *pkey, + isc_boolean_t deepcopy); +isc_result_t +dns_c_pklist_findpubkey(dns_c_pklist_t *list, dns_c_pubkey_t **pubkey, + isc_int32_t flags, isc_int32_t protocol, + isc_int32_t algorithm, const char *key); -isc_result_t dns_c_kidlist_new(isc_mem_t *mem, - dns_c_kidlist_t **list); -isc_result_t dns_c_kidlist_delete(dns_c_kidlist_t **list); -isc_result_t dns_c_kidlist_undef(dns_c_kidlist_t *list, - const char *keyid); -isc_result_t dns_c_kidlist_find(dns_c_kidlist_t *list, - const char *keyid, - dns_c_kid_t **retval); -void dns_c_kidlist_append(dns_c_kidlist_t *list, - dns_c_kid_t *keyid); -void dns_c_kidlist_print(FILE *fp, int indent, - dns_c_kidlist_t *list); -isc_result_t dns_c_kid_new(isc_mem_t *mem, const char *name, - dns_c_kid_t **keyid); +isc_result_t +dns_c_pklist_rmpubkey(dns_c_pklist_t *list, isc_int32_t flags, + isc_int32_t protocol, isc_int32_t algorithm, + const char *key); +void +dns_c_pklist_print(FILE *fp, int indent, dns_c_pklist_t *pubkey); +isc_result_t +dns_c_pubkey_new(isc_mem_t *mem, isc_int32_t flags, isc_int32_t protocol, + isc_int32_t algorithm, const char *key, + dns_c_pubkey_t **pubkey); +isc_result_t +dns_c_pubkey_delete(dns_c_pubkey_t **pubkey); -isc_result_t dns_c_kdeflist_new(isc_mem_t *mem, - dns_c_kdeflist_t **list); -isc_result_t dns_c_kdeflist_delete(dns_c_kdeflist_t **list); -isc_result_t dns_c_kdeflist_copy(isc_mem_t *mem, - dns_c_kdeflist_t **dest, - dns_c_kdeflist_t *src); -isc_result_t dns_c_kdeflist_append(dns_c_kdeflist_t *list, - dns_c_kdef_t *key, isc_boolean_t copy); +isc_result_t +dns_c_pubkey_copy(isc_mem_t *mem, dns_c_pubkey_t **dest, dns_c_pubkey_t *src); -isc_result_t dns_c_kdeflist_undef(dns_c_kdeflist_t *list, - const char *keyid); -isc_result_t dns_c_kdeflist_find(dns_c_kdeflist_t *list, - const char *keyid, - dns_c_kdef_t **retval); -void dns_c_kdeflist_print(FILE *fp, int indent, - dns_c_kdeflist_t *list); +isc_boolean_t +dns_c_pubkey_equal(dns_c_pubkey_t *k1, dns_c_pubkey_t *k2); -isc_result_t dns_c_kdef_new(isc_mem_t *mem, const char *name, - dns_c_kdef_t **keyid); -isc_result_t dns_c_kdef_delete(dns_c_kdef_t **keydef); -isc_result_t dns_c_kdef_copy(isc_mem_t *mem, - dns_c_kdef_t **dest, dns_c_kdef_t *src); +void +dns_c_pubkey_print(FILE *fp, int indent, dns_c_pubkey_t *pubkey); -void dns_c_kdef_print(FILE *fp, int indent, dns_c_kdef_t *keydef); +isc_result_t +dns_c_kidlist_new(isc_mem_t *mem, dns_c_kidlist_t **list); +isc_result_t +dns_c_kidlist_delete(dns_c_kidlist_t **list); -isc_result_t dns_c_kdef_setalgorithm(dns_c_kdef_t *elem, - const char *algorithm); -isc_result_t dns_c_kdef_setsecret(dns_c_kdef_t *elem, - const char *secret); +isc_result_t +dns_c_kidlist_undef(dns_c_kidlist_t *list, const char *keyid); -isc_result_t dns_c_tkeylist_new(isc_mem_t *mem, - dns_c_tkeylist_t **newlist); -isc_result_t dns_c_tkeylist_delete(dns_c_tkeylist_t **list); -isc_result_t dns_c_tkeylist_copy(isc_mem_t *mem, - dns_c_tkeylist_t **dest, - dns_c_tkeylist_t *src); -void dns_c_tkeylist_print(FILE *fp, int indent, - dns_c_tkeylist_t *list); -isc_result_t dns_c_tkeylist_append(dns_c_tkeylist_t *list, - dns_c_tkey_t *element, - isc_boolean_t copy); +isc_result_t +dns_c_kidlist_find(dns_c_kidlist_t *list, const char *keyid, + dns_c_kid_t **retval); -isc_result_t dns_c_tkey_new(isc_mem_t *mem, const char *domain, - isc_int32_t flags, - isc_int32_t protocol, - isc_int32_t algorithm, - const char *key, dns_c_tkey_t **newkey); -isc_result_t dns_c_tkey_delete(dns_c_tkey_t **tkey); -isc_result_t dns_c_tkey_copy(isc_mem_t *mem, - dns_c_tkey_t **dest, dns_c_tkey_t *src); +void +dns_c_kidlist_append(dns_c_kidlist_t *list, dns_c_kid_t *keyid); -isc_result_t dns_c_tkey_getflags(dns_c_tkey_t *tkey, - isc_int32_t *flags); -isc_result_t dns_c_tkey_getprotocol(dns_c_tkey_t *tkey, - isc_int32_t *protocol); -isc_result_t dns_c_tkey_getalgorithm(dns_c_tkey_t *tkey, - isc_int32_t *algorithm); -isc_result_t dns_c_tkey_getkey(dns_c_tkey_t *tkey, - const char **key); -void dns_c_tkey_print(FILE *fp, int indent, dns_c_tkey_t *tkey); +void +dns_c_kidlist_print(FILE *fp, int indent, dns_c_kidlist_t *list); +isc_result_t +dns_c_kid_new(isc_mem_t *mem, const char *name, dns_c_kid_t **keyid); +isc_result_t +dns_c_kdeflist_new(isc_mem_t *mem, dns_c_kdeflist_t **list); + +isc_result_t +dns_c_kdeflist_delete(dns_c_kdeflist_t **list); + +isc_result_t +dns_c_kdeflist_copy(isc_mem_t *mem, dns_c_kdeflist_t **dest, + dns_c_kdeflist_t *src); + +isc_result_t +dns_c_kdeflist_append(dns_c_kdeflist_t *list, dns_c_kdef_t *key, + isc_boolean_t copy); + +isc_result_t +dns_c_kdeflist_undef(dns_c_kdeflist_t *list, const char *keyid); + +isc_result_t +dns_c_kdeflist_find(dns_c_kdeflist_t *list, const char *keyid, + dns_c_kdef_t **retval); + +void +dns_c_kdeflist_print(FILE *fp, int indent, dns_c_kdeflist_t *list); + +isc_result_t +dns_c_kdef_new(isc_mem_t *mem, const char *name, dns_c_kdef_t **keyid); + +isc_result_t +dns_c_kdef_delete(dns_c_kdef_t **keydef); + +isc_result_t +dns_c_kdef_copy(isc_mem_t *mem, dns_c_kdef_t **dest, dns_c_kdef_t *src); + +void +dns_c_kdef_print(FILE *fp, int indent, dns_c_kdef_t *keydef); + +isc_result_t +dns_c_kdef_setalgorithm(dns_c_kdef_t *elem, const char *algorithm); + +isc_result_t +dns_c_kdef_setsecret(dns_c_kdef_t *elem, const char *secret); + +isc_result_t +dns_c_tkeylist_new(isc_mem_t *mem, dns_c_tkeylist_t **newlist); + +isc_result_t +dns_c_tkeylist_delete(dns_c_tkeylist_t **list); + +isc_result_t +dns_c_tkeylist_copy(isc_mem_t *mem, dns_c_tkeylist_t **dest, + dns_c_tkeylist_t *src); + +void +dns_c_tkeylist_print(FILE *fp, int indent, dns_c_tkeylist_t *list); + +isc_result_t +dns_c_tkeylist_append(dns_c_tkeylist_t *list, dns_c_tkey_t *element, + isc_boolean_t copy); + +isc_result_t +dns_c_tkey_new(isc_mem_t *mem, const char *domain, isc_int32_t flags, + isc_int32_t protocol, isc_int32_t algorithm, + const char *key, dns_c_tkey_t **newkey); + +isc_result_t +dns_c_tkey_delete(dns_c_tkey_t **tkey); + +isc_result_t +dns_c_tkey_copy(isc_mem_t *mem, dns_c_tkey_t **dest, dns_c_tkey_t *src); + +isc_result_t +dns_c_tkey_getflags(dns_c_tkey_t *tkey, isc_int32_t *flags); + +isc_result_t +dns_c_tkey_getprotocol(dns_c_tkey_t *tkey, isc_int32_t *protocol); + +isc_result_t +dns_c_tkey_getalgorithm(dns_c_tkey_t *tkey, isc_int32_t *algorithm); + +isc_result_t +dns_c_tkey_getkey(dns_c_tkey_t *tkey, const char **key); + +void +dns_c_tkey_print(FILE *fp, int indent, dns_c_tkey_t *tkey); + +ISC_LANG_ENDDECLS #endif /* DNS_CONFKEYS_H */ diff --git a/lib/dns/include/dns/conflog.h b/lib/dns/include/dns/conflog.h index 81d63cf1ec..6f3b3b0ae4 100644 --- a/lib/dns/include/dns/conflog.h +++ b/lib/dns/include/dns/conflog.h @@ -54,6 +54,7 @@ *** Imports ***/ +#include #include #include @@ -76,9 +77,10 @@ typedef struct dns_c_logchan dns_c_logchan_t; typedef struct dns_c_logcat dns_c_logcat_t; typedef struct dns_c_logging_list dns_c_logginglist_t; -/* The structure that holds the list of channel and category definitions */ -struct dns_c_logging_list -{ +/* + * The structure that holds the list of channel and category definitions. + */ +struct dns_c_logging_list { isc_uint32_t magic; isc_mem_t *mem; @@ -116,8 +118,9 @@ struct dns_c_logchan isc_boolean_t print_severity; isc_boolean_t print_time; - /* Some channels are predefined e.g. default_syslog, in which case - * this is true + /* + * Some channels are predefined e.g. default_syslog, in which case + * this is true. */ isc_boolean_t predefined; @@ -125,10 +128,10 @@ struct dns_c_logchan dns_c_setbits_t setflags; }; - -/* Structure for holding a category definition */ -struct dns_c_logcat -{ +/* + * Structure for holding a category definition. + */ +struct dns_c_logcat { isc_uint32_t magic; isc_mem_t *mem; @@ -146,112 +149,153 @@ struct dns_c_logcat ISC_LINK(dns_c_logcat_t) next; }; - /*** *** Functions ***/ -isc_result_t dns_c_logginglist_new(isc_mem_t *mem, - dns_c_logginglist_t **list); -isc_result_t dns_c_logginglist_delete(dns_c_logginglist_t **list); -void dns_c_logginglist_print(FILE *fp, int indent, - dns_c_logginglist_t *ll, - isc_boolean_t if_predef_too); -isc_result_t dns_c_logginglist_copy(isc_mem_t *mem, - dns_c_logginglist_t **dest, - dns_c_logginglist_t *src); +ISC_LANG_BEGINDECLS -isc_result_t dns_c_logginglist_addchannel(dns_c_logginglist_t *list, - dns_c_logchan_t *newchan, - isc_boolean_t deepcopy); -isc_result_t dns_c_logginglist_addcategory(dns_c_logginglist_t *list, - dns_c_logcat_t *newcat, - isc_boolean_t deepcopy); -isc_result_t dns_c_logginglist_delchannel(dns_c_logginglist_t *list, - const char *name); -isc_result_t dns_c_logginglist_delcategory(dns_c_logginglist_t *list, - const char *name); +isc_result_t +dns_c_logginglist_new(isc_mem_t *mem, dns_c_logginglist_t **list); -isc_result_t dns_c_logginglist_chanbyname(dns_c_logginglist_t *list, - const char *name, - dns_c_logchan_t **chan); -isc_result_t dns_c_logginglist_catbyname(dns_c_logginglist_t *list, - const char *name, - dns_c_logcat_t **cat); +isc_result_t +dns_c_logginglist_delete(dns_c_logginglist_t **list); -isc_result_t dns_c_logchan_new(isc_mem_t *mem, const char *name, - dns_c_logchantype_t ctype, - dns_c_logchan_t **newchan); -isc_result_t dns_c_logchan_delete(dns_c_logchan_t **channel); -isc_result_t dns_c_logchan_copy(isc_mem_t *mem, dns_c_logchan_t **dest, - dns_c_logchan_t *src); -void dns_c_logchan_print(FILE *fp, int indent, - dns_c_logchan_t *logchan, - isc_boolean_t if_predef_too); +void +dns_c_logginglist_print(FILE *fp, int indent, dns_c_logginglist_t *ll, + isc_boolean_t if_predef_too); +isc_result_t +dns_c_logginglist_copy(isc_mem_t *mem, dns_c_logginglist_t **dest, + dns_c_logginglist_t *src); -isc_result_t dns_c_logchan_setpath(dns_c_logchan_t *channel, - const char *path); -isc_result_t dns_c_logchan_setversions(dns_c_logchan_t *channel, - isc_uint32_t versions); -isc_result_t dns_c_logchan_setsize(dns_c_logchan_t *channel, - isc_uint32_t size); -isc_result_t dns_c_logchan_setfacility(dns_c_logchan_t *channel, - int facility); -isc_result_t dns_c_logchan_setseverity(dns_c_logchan_t *channel, - dns_c_logseverity_t severity); -isc_result_t dns_c_logchan_setdebuglevel(dns_c_logchan_t *channel, - isc_int32_t level); -isc_result_t dns_c_logchan_setprintcat(dns_c_logchan_t *channel, - isc_boolean_t newval); -isc_result_t dns_c_logchan_setprintsev(dns_c_logchan_t *channel, - isc_boolean_t newval); -isc_result_t dns_c_logchan_setprinttime(dns_c_logchan_t *channel, - isc_boolean_t newval); -isc_result_t dns_c_logchan_setpredef(dns_c_logchan_t *channel, - isc_boolean_t newval); +isc_result_t +dns_c_logginglist_addchannel(dns_c_logginglist_t *list, + dns_c_logchan_t *newchan, isc_boolean_t deepcopy); -isc_result_t dns_c_logchan_getpath(dns_c_logchan_t *channel, - const char **path); -isc_result_t dns_c_logchan_getversions(dns_c_logchan_t *channel, - isc_uint32_t *versions); -isc_result_t dns_c_logchan_getsize(dns_c_logchan_t *channel, - isc_uint32_t *size); -isc_result_t dns_c_logchan_getfacility(dns_c_logchan_t *channel, - int *facility); -isc_result_t dns_c_logchan_getseverity(dns_c_logchan_t *channel, - dns_c_logseverity_t *severity); -isc_result_t dns_c_logchan_getdebuglevel(dns_c_logchan_t *channel, - isc_int32_t *level); -isc_result_t dns_c_logchan_getprintcat(dns_c_logchan_t *channel, - isc_boolean_t *retval); -isc_result_t dns_c_logchan_getprintsev(dns_c_logchan_t *channel, - isc_boolean_t *retval); -isc_result_t dns_c_logchan_getprinttime(dns_c_logchan_t *channel, - isc_boolean_t *retval); -isc_result_t dns_c_logchan_getpredef(dns_c_logchan_t *channel, - isc_boolean_t *retval); +isc_result_t +dns_c_logginglist_addcategory(dns_c_logginglist_t *list, + dns_c_logcat_t *newcat, isc_boolean_t deepcopy); +isc_result_t +dns_c_logginglist_delchannel(dns_c_logginglist_t *list, const char *name); +isc_result_t +dns_c_logginglist_delcategory(dns_c_logginglist_t *list, const char *name); + +isc_result_t +dns_c_logginglist_chanbyname(dns_c_logginglist_t *list, const char *name, + dns_c_logchan_t **chan); + +isc_result_t +dns_c_logginglist_catbyname(dns_c_logginglist_t *list, const char *name, + dns_c_logcat_t **cat); + +isc_result_t +dns_c_logchan_new(isc_mem_t *mem, const char *name, dns_c_logchantype_t ctype, + dns_c_logchan_t **newchan); + +isc_result_t +dns_c_logchan_delete(dns_c_logchan_t **channel); + +isc_result_t +dns_c_logchan_copy(isc_mem_t *mem, dns_c_logchan_t **dest, + dns_c_logchan_t *src); + +void +dns_c_logchan_print(FILE *fp, int indent, dns_c_logchan_t *logchan, + isc_boolean_t if_predef_too); + +isc_result_t +dns_c_logchan_setpath(dns_c_logchan_t *channel, const char *path); + +isc_result_t +dns_c_logchan_setversions(dns_c_logchan_t *channel, isc_uint32_t versions); + +isc_result_t +dns_c_logchan_setsize(dns_c_logchan_t *channel, isc_uint32_t size); + +isc_result_t +dns_c_logchan_setfacility(dns_c_logchan_t *channel, int facility); + +isc_result_t +dns_c_logchan_setseverity(dns_c_logchan_t *channel, + dns_c_logseverity_t severity); + +isc_result_t +dns_c_logchan_setdebuglevel(dns_c_logchan_t *channel, isc_int32_t level); + +isc_result_t +dns_c_logchan_setprintcat(dns_c_logchan_t *channel, isc_boolean_t newval); + +isc_result_t +dns_c_logchan_setprintsev(dns_c_logchan_t *channel, isc_boolean_t newval); + +isc_result_t +dns_c_logchan_setprinttime(dns_c_logchan_t *channel, isc_boolean_t newval); + +isc_result_t +dns_c_logchan_setpredef(dns_c_logchan_t *channel, isc_boolean_t newval); + +isc_result_t +dns_c_logchan_getpath(dns_c_logchan_t *channel, const char **path); + +isc_result_t +dns_c_logchan_getversions(dns_c_logchan_t *channel, isc_uint32_t *versions); + +isc_result_t +dns_c_logchan_getsize(dns_c_logchan_t *channel, isc_uint32_t *size); + +isc_result_t +dns_c_logchan_getfacility(dns_c_logchan_t *channel, int *facility); + +isc_result_t +dns_c_logchan_getseverity(dns_c_logchan_t *channel, + dns_c_logseverity_t *severity); + +isc_result_t +dns_c_logchan_getdebuglevel(dns_c_logchan_t *channel, isc_int32_t *level); + +isc_result_t +dns_c_logchan_getprintcat(dns_c_logchan_t *channel, isc_boolean_t *retval); + +isc_result_t +dns_c_logchan_getprintsev(dns_c_logchan_t *channel, isc_boolean_t *retval); + +isc_result_t +dns_c_logchan_getprinttime(dns_c_logchan_t *channel, isc_boolean_t *retval); + +isc_result_t +dns_c_logchan_getpredef(dns_c_logchan_t *channel, isc_boolean_t *retval); /* * Logging category */ -isc_result_t dns_c_logcat_new(isc_mem_t *mem, const char *name, - dns_c_logcat_t **newlc); -isc_result_t dns_c_logcat_delete(dns_c_logcat_t **logcat); -void dns_c_logcat_print(FILE *fp, int indent, - dns_c_logcat_t *logcat, - isc_boolean_t if_predef_too); -isc_result_t dns_c_logcat_copy(isc_mem_t *mem, dns_c_logcat_t **dest, - dns_c_logcat_t *src); -isc_result_t dns_c_logcat_addname(dns_c_logcat_t *logcat, - const char *name); -isc_result_t dns_c_logcat_delname(dns_c_logcat_t *logcat, - const char *name); -isc_result_t dns_c_logcat_setpredef(dns_c_logcat_t *logcat, - isc_boolean_t newval); -isc_result_t dns_c_logcat_getpredef(dns_c_logcat_t *logcat, - isc_boolean_t *retval); +isc_result_t +dns_c_logcat_new(isc_mem_t *mem, const char *name, dns_c_logcat_t **newlc); + +isc_result_t +dns_c_logcat_delete(dns_c_logcat_t **logcat); + +void +dns_c_logcat_print(FILE *fp, int indent, dns_c_logcat_t *logcat, + isc_boolean_t if_predef_too); + +isc_result_t +dns_c_logcat_copy(isc_mem_t *mem, dns_c_logcat_t **dest, dns_c_logcat_t *src); + +isc_result_t +dns_c_logcat_addname(dns_c_logcat_t *logcat, const char *name); + +isc_result_t +dns_c_logcat_delname(dns_c_logcat_t *logcat, const char *name); + +isc_result_t +dns_c_logcat_setpredef(dns_c_logcat_t *logcat, isc_boolean_t newval); + +isc_result_t +dns_c_logcat_getpredef(dns_c_logcat_t *logcat, isc_boolean_t *retval); + +ISC_LANG_ENDDECLS #endif /* DNS_CONFLOG_H */ diff --git a/lib/dns/include/dns/conflsn.h b/lib/dns/include/dns/conflsn.h index ca83f58c43..41f57a1c67 100644 --- a/lib/dns/include/dns/conflsn.h +++ b/lib/dns/include/dns/conflsn.h @@ -55,19 +55,18 @@ *** Imports ***/ -#include +#include #include +#include #include -#define DNS_C_LISTEN_MAGIC 0x4c49534eU /* LISN */ +#define DNS_C_LISTEN_MAGIC 0x4c49534eU /* LISN */ #define DNS_C_LLIST_MAGIC 0x4c6c6973U /* Llis */ #define DNS_C_LISTEN_VALID(l) ISC_MAGIC_VALID(l, DNS_C_LISTEN_MAGIC) #define DNS_C_LISTENLIST_VALID(l) ISC_MAGIC_VALID(l, DNS_C_LLIST_MAGIC) - - /*** *** Types ***/ @@ -75,10 +74,10 @@ typedef struct dns_c_lstn_on dns_c_lstnon_t; typedef struct dns_c_lstn_list dns_c_lstnlist_t; - -/* Structure for holing value of a single listen-on statement. */ -struct dns_c_lstn_on -{ +/* + * Structure for holing value of a single listen-on statement. + */ +struct dns_c_lstn_on { isc_mem_t *mem; isc_uint32_t magic; @@ -89,22 +88,24 @@ struct dns_c_lstn_on }; -/* A list of listen-on statements */ -struct dns_c_lstn_list -{ +/* + * A list of listen-on statements. + */ +struct dns_c_lstn_list { isc_mem_t *mem; isc_uint32_t magic; ISC_LIST(dns_c_lstnon_t) elements; }; - /*** *** Functions ***/ -isc_result_t dns_c_lstnlist_new(isc_mem_t *mem, - dns_c_lstnlist_t **llist); +ISC_LANG_BEGINDECLS + +isc_result_t +dns_c_lstnlist_new(isc_mem_t *mem, dns_c_lstnlist_t **llist); /* * Creates a new dns_c_lstnlist_t structure from the allocator pointed to * by MEM, and stores the pointer to the new structure in *LLIST. @@ -118,7 +119,8 @@ isc_result_t dns_c_lstnlist_new(isc_mem_t *mem, * ISC_R_NOMEMORY on allocation failure. */ -isc_result_t dns_c_lstnlist_delete(dns_c_lstnlist_t **llist); +isc_result_t +dns_c_lstnlist_delete(dns_c_lstnlist_t **llist); /* * Deletes the list pointed to by **LLIST, and all the elements in it. * Sets *LLIST to NULL when done. @@ -131,8 +133,8 @@ isc_result_t dns_c_lstnlist_delete(dns_c_lstnlist_t **llist); */ -isc_result_t dns_c_lstnlist_print(FILE *fp, int indent, - dns_c_lstnlist_t *ll); +isc_result_t +dns_c_lstnlist_print(FILE *fp, int indent, dns_c_lstnlist_t *ll); /* * Prints the given the list LL to the stream FP. INDENT number of tabs * preceed each line of output. @@ -144,8 +146,8 @@ isc_result_t dns_c_lstnlist_print(FILE *fp, int indent, */ -isc_result_t dns_c_lstnon_new(isc_mem_t *mem, - dns_c_lstnon_t **listen); +isc_result_t +dns_c_lstnon_new(isc_mem_t *mem, dns_c_lstnon_t **listen); /* * Creates a new dns_c_lstnon_t structure and stores the pointer * in *LISTEN. @@ -159,7 +161,8 @@ isc_result_t dns_c_lstnon_new(isc_mem_t *mem, * ISC_R_NOMEMORY on allocation failure. */ -isc_result_t dns_c_lstnon_delete(dns_c_lstnon_t **listen); +isc_result_t +dns_c_lstnon_delete(dns_c_lstnon_t **listen); /* * Deletes the dns_c_lstnon_t structure pointed to by *LISTEN. * @@ -170,9 +173,9 @@ isc_result_t dns_c_lstnon_delete(dns_c_lstnon_t **listen); * Returns: */ -isc_result_t dns_c_lstnon_setiml(dns_c_lstnon_t *listen, - dns_c_ipmatchlist_t *iml, - isc_boolean_t deepcopy); +isc_result_t +dns_c_lstnon_setiml(dns_c_lstnon_t *listen, dns_c_ipmatchlist_t *iml, + isc_boolean_t deepcopy); /* * Sets the iml field of the structure to the value of the IML * parameter. If deepcopy paramater is true the structure field is @@ -186,10 +189,9 @@ isc_result_t dns_c_lstnon_setiml(dns_c_lstnon_t *listen, * ISC_R_NOMEMORY on allocation failure. */ -isc_result_t dns_c_lstnon_print(FILE *fp, int indent, - dns_c_lstnon_t *lo); - - +isc_result_t +dns_c_lstnon_print(FILE *fp, int indent, dns_c_lstnon_t *lo); +ISC_LANG_ENDDECLS #endif /* DNS_CONFLSN_H */ diff --git a/lib/dns/include/dns/confndc.h b/lib/dns/include/dns/confndc.h index 34f21e7cd0..9b06b2cf9d 100644 --- a/lib/dns/include/dns/confndc.h +++ b/lib/dns/include/dns/confndc.h @@ -18,14 +18,16 @@ #ifndef DNS_CONFNDC_H #define DNS_CONFNDC_H 1 +#include #include #include + #include -#define DNS_C_NDCCTX_MAGIC 0xabcdef01 -#define DNS_C_NDCSERVERLIST_MAGIC 0x12345678 -#define DNS_C_NDCOPTIONS_MAGIC 0x2468ace1 -#define DNS_C_NDCSERVER_MAGIC 0xaaabbbcc +#define DNS_C_NDCCTX_MAGIC 0xabcdef01 +#define DNS_C_NDCSERVERLIST_MAGIC 0x12345678 +#define DNS_C_NDCOPTIONS_MAGIC 0x2468ace1 +#define DNS_C_NDCSERVER_MAGIC 0xaaabbbcc #define DNS_C_NDCCTX_VALID(ptr) ISC_MAGIC_VALID(ptr, DNS_C_NDCCTX_MAGIC) #define DNS_C_NDCOPTIONS_VALID(ptr) \ @@ -35,7 +37,6 @@ #define DNS_C_NDCSERVER_VALID(ptr) \ ISC_MAGIC_VALID(ptr, DNS_C_NDCSERVER_MAGIC) - typedef struct dns_c_ndcctx dns_c_ndcctx_t; typedef struct dns_c_ndcopts dns_c_ndcopts_t; typedef struct dns_c_ndcserver dns_c_ndcserver_t; @@ -76,81 +77,123 @@ struct dns_c_ndcserver { ISC_LINK(dns_c_ndcserver_t) next; }; -/* All the 'set' functions do not delete the replaced value if one exists, +/*** + *** Functions + ***/ + +ISC_LANG_BEGINDECLS + +/* + * All the 'set' functions do not delete the replaced value if one exists, * so if setting a value for a second time, be sure to 'get' the original * value first and do something with it */ -isc_result_t dns_c_ndcctx_new(isc_mem_t *mem, dns_c_ndcctx_t **ctx); -isc_result_t dns_c_ndcctx_destroy(dns_c_ndcctx_t **ctx); -isc_result_t dns_c_ndcctx_setoptions(dns_c_ndcctx_t *ctx, - dns_c_ndcopts_t *opts); -isc_result_t dns_c_ndcctx_getoptions(dns_c_ndcctx_t *ctx, - dns_c_ndcopts_t **opts); -isc_result_t dns_c_ndcctx_setservers(dns_c_ndcctx_t *ctx, - dns_c_ndcserverlist_t *servers); -isc_result_t dns_c_ndcctx_getservers(dns_c_ndcctx_t *ctx, - dns_c_ndcserverlist_t **servers); -isc_result_t dns_c_ndcctx_addserver(dns_c_ndcctx_t *ctx, - dns_c_ndcserver_t **server); -isc_result_t dns_c_ndcctx_getserver(dns_c_ndcctx_t *ctx, const char *name, - dns_c_ndcserver_t **server); -isc_result_t dns_c_ndcctx_getkeys(dns_c_ndcctx_t *ctx, - dns_c_kdeflist_t **list); -isc_result_t dns_c_ndcctx_setkeys(dns_c_ndcctx_t *ctx, - dns_c_kdeflist_t *list); -isc_result_t dns_c_ndcctx_addkey(dns_c_ndcctx_t *ctx, - dns_c_kdef_t **key); +isc_result_t +dns_c_ndcctx_new(isc_mem_t *mem, dns_c_ndcctx_t **ctx); +isc_result_t +dns_c_ndcctx_destroy(dns_c_ndcctx_t **ctx); + +isc_result_t +dns_c_ndcctx_setoptions(dns_c_ndcctx_t *ctx, dns_c_ndcopts_t *opts); + +isc_result_t +dns_c_ndcctx_getoptions(dns_c_ndcctx_t *ctx, dns_c_ndcopts_t **opts); + +isc_result_t +dns_c_ndcctx_setservers(dns_c_ndcctx_t *ctx, dns_c_ndcserverlist_t *servers); + +isc_result_t +dns_c_ndcctx_getservers(dns_c_ndcctx_t *ctx, dns_c_ndcserverlist_t **servers); + +isc_result_t +dns_c_ndcctx_addserver(dns_c_ndcctx_t *ctx, dns_c_ndcserver_t **server); + +isc_result_t +dns_c_ndcctx_getserver(dns_c_ndcctx_t *ctx, const char *name, + dns_c_ndcserver_t **server); + +isc_result_t +dns_c_ndcctx_getkeys(dns_c_ndcctx_t *ctx, dns_c_kdeflist_t **list); + +isc_result_t +dns_c_ndcctx_setkeys(dns_c_ndcctx_t *ctx, dns_c_kdeflist_t *list); + +isc_result_t +dns_c_ndcctx_addkey(dns_c_ndcctx_t *ctx, dns_c_kdef_t **key); /* SERVER LIST */ -isc_result_t dns_c_ndcserverlist_new(isc_mem_t *mem, - dns_c_ndcserverlist_t **servers); -isc_result_t dns_c_ndcserverlist_destroy(dns_c_ndcserverlist_t **servers); -dns_c_ndcserver_t *dns_c_ndcserverlist_first(dns_c_ndcserverlist_t *servers); -dns_c_ndcserver_t *dns_c_ndcserverlist_next(dns_c_ndcserver_t *servers); +isc_result_t +dns_c_ndcserverlist_new(isc_mem_t *mem, dns_c_ndcserverlist_t **servers); +isc_result_t +dns_c_ndcserverlist_destroy(dns_c_ndcserverlist_t **servers); + +dns_c_ndcserver_t * +dns_c_ndcserverlist_first(dns_c_ndcserverlist_t *servers); + +dns_c_ndcserver_t * +dns_c_ndcserverlist_next(dns_c_ndcserver_t *servers); /* SERVER */ -isc_result_t dns_c_ndcserver_new(isc_mem_t *mem, - dns_c_ndcserver_t **server); -isc_result_t dns_c_ndcserver_destroy(dns_c_ndcserver_t **server); -isc_result_t dns_c_ndcserver_setkey(dns_c_ndcserver_t *server, - const char *val); -isc_result_t dns_c_ndcserver_sethost(dns_c_ndcserver_t *server, - const char *val); -isc_result_t dns_c_ndcserver_setname(dns_c_ndcserver_t *server, - const char *val); -isc_result_t dns_c_ndcserver_getkey(dns_c_ndcserver_t *server, - const char **val); -isc_result_t dns_c_ndcserver_gethost(dns_c_ndcserver_t *server, - const char **val); -isc_result_t dns_c_ndcserver_getname(dns_c_ndcserver_t *server, - const char **val); +isc_result_t +dns_c_ndcserver_new(isc_mem_t *mem, dns_c_ndcserver_t **server); +isc_result_t +dns_c_ndcserver_destroy(dns_c_ndcserver_t **server); +isc_result_t +dns_c_ndcserver_setkey(dns_c_ndcserver_t *server, const char *val); +isc_result_t +dns_c_ndcserver_sethost(dns_c_ndcserver_t *server, const char *val); + +isc_result_t +dns_c_ndcserver_setname(dns_c_ndcserver_t *server, const char *val); + +isc_result_t +dns_c_ndcserver_getkey(dns_c_ndcserver_t *server, const char **val); + +isc_result_t +dns_c_ndcserver_gethost(dns_c_ndcserver_t *server, const char **val); + +isc_result_t +dns_c_ndcserver_getname(dns_c_ndcserver_t *server, const char **val); /* OPTIONS */ -isc_result_t dns_c_ndcopts_new(isc_mem_t *mem, dns_c_ndcopts_t **opts); -isc_result_t dns_c_ndcopts_destroy(dns_c_ndcopts_t **opts); -isc_result_t dns_c_ndcopts_getdefserver(dns_c_ndcopts_t *opts, - const char **retval); -isc_result_t dns_c_ndcopts_getdefkey(dns_c_ndcopts_t *opts, - const char **retval); +isc_result_t +dns_c_ndcopts_new(isc_mem_t *mem, dns_c_ndcopts_t **opts); -isc_result_t dns_c_ndcopts_setdefserver(dns_c_ndcopts_t *opts, - const char *newval); -isc_result_t dns_c_ndcopts_setdefkey(dns_c_ndcopts_t *opts, - const char *newval); +isc_result_t +dns_c_ndcopts_destroy(dns_c_ndcopts_t **opts); +isc_result_t +dns_c_ndcopts_getdefserver(dns_c_ndcopts_t *opts, const char **retval); -isc_result_t dns_c_ndcparseconf(const char *filename, isc_mem_t *mem, - dns_c_ndcctx_t **ndcctx); +isc_result_t +dns_c_ndcopts_getdefkey(dns_c_ndcopts_t *opts, const char **retval); -void dns_c_ndcctx_print(FILE *fp, dns_c_ndcctx_t *ctx); -void dns_c_ndcopts_print(FILE *fp, dns_c_ndcopts_t *opts); -void dns_c_ndcserverlist_print(FILE *fp, - dns_c_ndcserverlist_t *servers); -void dns_c_ndcserver_print(FILE *fp, dns_c_ndcserver_t *server); +isc_result_t +dns_c_ndcopts_setdefserver(dns_c_ndcopts_t *opts, const char *newval); +isc_result_t +dns_c_ndcopts_setdefkey(dns_c_ndcopts_t *opts, const char *newval); + +isc_result_t +dns_c_ndcparseconf(const char *filename, isc_mem_t *mem, + dns_c_ndcctx_t **ndcctx); + +void +dns_c_ndcctx_print(FILE *fp, dns_c_ndcctx_t *ctx); + +void +dns_c_ndcopts_print(FILE *fp, dns_c_ndcopts_t *opts); + +void +dns_c_ndcserverlist_print(FILE *fp, dns_c_ndcserverlist_t *servers); + +void +dns_c_ndcserver_print(FILE *fp, dns_c_ndcserver_t *server); + +ISC_LANG_ENDDECLS #endif /* DNS_CONFNDC_H */ diff --git a/lib/dns/include/dns/confparser.h b/lib/dns/include/dns/confparser.h index cc09f9c0e0..a38cc46bfb 100644 --- a/lib/dns/include/dns/confparser.h +++ b/lib/dns/include/dns/confparser.h @@ -54,15 +54,11 @@ *** Imports ***/ +#include #include #include - -/*** - *** Functions - ***/ - /* * Typedefs for the callbacks done while parsing. If the callback functions * return anything other than ISC_R_SUCCESS, then the parse routine @@ -75,8 +71,7 @@ typedef isc_result_t (*dns_c_zonecbk_t)(dns_c_ctx_t *ctx, void *uap); typedef isc_result_t (*dns_c_optscbk_t)(dns_c_ctx_t *ctx, void *uap); -typedef struct dns_c_cbks -{ +typedef struct dns_c_cbks { dns_c_zonecbk_t zonecbk; void *zonecbkuap; @@ -84,10 +79,15 @@ typedef struct dns_c_cbks void *optscbkuap; } dns_c_cbks_t; +/*** + *** Functions + ***/ -isc_result_t dns_c_parse_namedconf(const char *filename, isc_mem_t *mem, - dns_c_ctx_t **configctx, - dns_c_cbks_t *callbacks); +ISC_LANG_BEGINDECLS + +isc_result_t +dns_c_parse_namedconf(const char *filename, isc_mem_t *mem, + dns_c_ctx_t **configctx, dns_c_cbks_t *callbacks); /* * Parse a named confile file. Fills up a new config context with the config @@ -111,4 +111,6 @@ isc_result_t dns_c_parse_namedconf(const char *filename, isc_mem_t *mem, * ISC_R_FAILURE file contains errors. */ +ISC_LANG_ENDDECLS + #endif /* DNS_CONFPARSER_H */ diff --git a/lib/dns/include/dns/confresolv.h b/lib/dns/include/dns/confresolv.h index ff280905f1..f4fe4a45e8 100644 --- a/lib/dns/include/dns/confresolv.h +++ b/lib/dns/include/dns/confresolv.h @@ -50,6 +50,7 @@ *** Imports ***/ +#include #include /*** @@ -58,21 +59,20 @@ typedef struct dns_c_resolv dns_c_resolv_t; -struct dns_c_resolv -{ +struct dns_c_resolv { isc_mem_t *mem; /* XXX need this fleshed out */ }; - - - /*** *** Functions ***/ -isc_result_t dns_c_resolv_new(isc_mem_t *mem, dns_c_resolv_t **cfgres); +ISC_LANG_BEGINDECLS + +isc_result_t +dns_c_resolv_new(isc_mem_t *mem, dns_c_resolv_t **cfgres); /* * Creates a new resolver-config object. * @@ -86,7 +86,8 @@ isc_result_t dns_c_resolv_new(isc_mem_t *mem, dns_c_resolv_t **cfgres); * */ -isc_result_t dns_c_resolv_delete(dns_c_resolv_t **cfgres); +isc_result_t +dns_c_resolv_delete(dns_c_resolv_t **cfgres); /* * Deletes the config-resolv object and its contents. * @@ -99,5 +100,6 @@ isc_result_t dns_c_resolv_delete(dns_c_resolv_t **cfgres); * */ +ISC_LANG_ENDDECLS #endif /* DNS_CONFRESOLV_H */ diff --git a/lib/dns/include/dns/confrrset.h b/lib/dns/include/dns/confrrset.h index 27ca526152..ddb79b3f97 100644 --- a/lib/dns/include/dns/confrrset.h +++ b/lib/dns/include/dns/confrrset.h @@ -44,13 +44,11 @@ *** Imports ***/ -#include - /* XXX these next two are needed by rdatatype.h. It should be fixed to * include them itself. */ -#include -#include +#include +#include #include @@ -58,24 +56,20 @@ #define DNS_C_RRSOLIST_MAGIC 0x5252534c /* RRSL */ -#define DNS_C_RRSO_MAGIC 0x7272736f /* rrso */ +#define DNS_C_RRSO_MAGIC 0x7272736f /* rrso */ #define DNS_C_RRSOLIST_VALID(ptr) ISC_MAGIC_VALID(ptr, DNS_C_RRSOLIST_MAGIC) -#define DNS_C_RRSO_VALID(ptr) ISC_MAGIC_VALID(ptr, DNS_C_RRSO_MAGIC) - - +#define DNS_C_RRSO_VALID(ptr) ISC_MAGIC_VALID(ptr, DNS_C_RRSO_MAGIC) /*** *** Types ***/ - typedef struct dns_c_rrso dns_c_rrso_t; typedef struct dns_c_rrso_list dns_c_rrsolist_t; -struct dns_c_rrso -{ +struct dns_c_rrso { isc_uint32_t magic; isc_mem_t *mem; @@ -88,9 +82,7 @@ struct dns_c_rrso ISC_LINK(dns_c_rrso_t) next; }; - -struct dns_c_rrso_list -{ +struct dns_c_rrso_list { isc_uint32_t magic; isc_mem_t *mem; @@ -99,36 +91,44 @@ struct dns_c_rrso_list }; - /*** *** Functions ***/ +ISC_LANG_BEGINDECLS -isc_result_t dns_c_rrsolist_new(isc_mem_t *mem, - dns_c_rrsolist_t **rval); -isc_result_t dns_c_rrsolist_delete(dns_c_rrsolist_t **list); -isc_result_t dns_c_rrsolist_copy(isc_mem_t *mem, - dns_c_rrsolist_t **dest, - dns_c_rrsolist_t *source); -isc_result_t dns_c_rrsolist_clear(dns_c_rrsolist_t *olist); -isc_result_t dns_c_rrsolist_append(dns_c_rrsolist_t *dest, - dns_c_rrsolist_t *src); +isc_result_t +dns_c_rrsolist_new(isc_mem_t *mem, dns_c_rrsolist_t **rval); -isc_result_t dns_c_rrso_new(isc_mem_t *mem, - dns_c_rrso_t **res, - dns_rdataclass_t oclass, - dns_rdatatype_t otype, - char *name, - dns_c_ordering_t ordering); -isc_result_t dns_c_rrso_delete(dns_c_rrso_t **order); -isc_result_t dns_c_rrso_copy(isc_mem_t *mem, - dns_c_rrso_t **dest, - dns_c_rrso_t *source); -void dns_c_rrsolist_print(FILE *fp, int indent, - dns_c_rrsolist_t *rrlist); -void dns_c_rrso_print(FILE *fp, int indent, - dns_c_rrso_t *rrlist); +isc_result_t +dns_c_rrsolist_delete(dns_c_rrsolist_t **list); +isc_result_t +dns_c_rrsolist_copy(isc_mem_t *mem, dns_c_rrsolist_t **dest, + dns_c_rrsolist_t *source); + +isc_result_t +dns_c_rrsolist_clear(dns_c_rrsolist_t *olist); + +isc_result_t +dns_c_rrsolist_append(dns_c_rrsolist_t *dest, dns_c_rrsolist_t *src); + +isc_result_t +dns_c_rrso_new(isc_mem_t *mem, dns_c_rrso_t **res, dns_rdataclass_t oclass, + dns_rdatatype_t otype, char *name, dns_c_ordering_t ordering); + +isc_result_t +dns_c_rrso_delete(dns_c_rrso_t **order); + +isc_result_t +dns_c_rrso_copy(isc_mem_t *mem, dns_c_rrso_t **dest, dns_c_rrso_t *source); + +void +dns_c_rrsolist_print(FILE *fp, int indent, dns_c_rrsolist_t *rrlist); + +void +dns_c_rrso_print(FILE *fp, int indent, dns_c_rrso_t *rrlist); + +ISC_LANG_ENDDECLS #endif /* DNS_CONFRRSET_H */ diff --git a/lib/dns/include/dns/confview.h b/lib/dns/include/dns/confview.h index 9f27314052..dafc48b65e 100644 --- a/lib/dns/include/dns/confview.h +++ b/lib/dns/include/dns/confview.h @@ -53,11 +53,9 @@ *** Imports ***/ +#include #include -#include -#include - #include #include @@ -87,8 +85,7 @@ typedef struct dns_c_view dns_c_view_t; typedef struct dns_c_viewtable dns_c_viewtable_t; -struct dns_c_viewtable -{ +struct dns_c_viewtable { isc_uint32_t magic; isc_mem_t *mem; @@ -96,9 +93,7 @@ struct dns_c_viewtable ISC_LIST(dns_c_view_t) views; }; - -struct dns_c_view -{ +struct dns_c_view { isc_uint32_t magic; isc_mem_t *mem; @@ -165,33 +160,42 @@ struct dns_c_view ISC_LINK(dns_c_view_t) next; }; - - /*** *** Functions ***/ -isc_result_t dns_c_viewtable_new(isc_mem_t *mem, - dns_c_viewtable_t **viewtable); -isc_result_t dns_c_viewtable_delete(dns_c_viewtable_t **viewtable); -void dns_c_viewtable_print(FILE *fp, int indent, - dns_c_viewtable_t *table); -void dns_c_viewtable_addview(dns_c_viewtable_t *viewtable, - dns_c_view_t *view); -void dns_c_viewtable_rmview(dns_c_viewtable_t *viewtable, - dns_c_view_t *view); -isc_result_t dns_c_viewtable_clear(dns_c_viewtable_t *table); -isc_result_t dns_c_viewtable_viewbyname(dns_c_viewtable_t *viewtable, - const char *viewname, - dns_c_view_t **retval); -isc_result_t dns_c_viewtable_rmviewbyname(dns_c_viewtable_t *viewtable, - const char *name); -isc_result_t dns_c_viewtable_checkviews(dns_c_viewtable_t *viewtable); +ISC_LANG_BEGINDECLS +isc_result_t +dns_c_viewtable_new(isc_mem_t *mem, dns_c_viewtable_t **viewtable); +isc_result_t +dns_c_viewtable_delete(dns_c_viewtable_t **viewtable); + +void +dns_c_viewtable_print(FILE *fp, int indent, dns_c_viewtable_t *table); + +void +dns_c_viewtable_addview(dns_c_viewtable_t *viewtable, dns_c_view_t *view); + +void +dns_c_viewtable_rmview(dns_c_viewtable_t *viewtable, dns_c_view_t *view); + +isc_result_t +dns_c_viewtable_clear(dns_c_viewtable_t *table); + +isc_result_t +dns_c_viewtable_viewbyname(dns_c_viewtable_t *viewtable, const char *viewname, + dns_c_view_t **retval); + +isc_result_t +dns_c_viewtable_rmviewbyname(dns_c_viewtable_t *viewtable, const char *name); + +isc_result_t +dns_c_viewtable_checkviews(dns_c_viewtable_t *viewtable); /* NOTE: For the various get* functions. The caller must not delete the - * refutned value. + * returned value. * * - For functions where retval is a dns_c_ipmatchlist_t * (e.g. dns_c_view_getallowquery) the caller must call @@ -199,259 +203,335 @@ isc_result_t dns_c_viewtable_checkviews(dns_c_viewtable_t *viewtable); * */ -isc_result_t dns_c_view_new(isc_mem_t *mem, const char *name, - dns_rdataclass_t viewclass, - dns_c_view_t **newview); +isc_result_t +dns_c_view_new(isc_mem_t *mem, const char *name, dns_rdataclass_t viewclass, + dns_c_view_t **newview); -isc_result_t dns_c_view_delete(dns_c_view_t **viewptr); -void dns_c_view_print(FILE *fp, int indent, dns_c_view_t *view); -isc_boolean_t dns_c_view_keydefinedp(dns_c_view_t *view, - const char *keyname); +isc_result_t +dns_c_view_delete(dns_c_view_t **viewptr); +void +dns_c_view_print(FILE *fp, int indent, dns_c_view_t *view); -isc_result_t dns_c_view_getname(dns_c_view_t *view, - const char **retval); -isc_result_t dns_c_view_addzone(dns_c_view_t *view, dns_c_zone_t *zone); +isc_boolean_t +dns_c_view_keydefinedp(dns_c_view_t *view, const char *keyname); -isc_result_t dns_c_view_getzonelist(dns_c_view_t *view, - dns_c_zonelist_t **zonelist); -isc_result_t dns_c_view_unsetzonelist(dns_c_view_t *view); +isc_result_t +dns_c_view_getname(dns_c_view_t *view, const char **retval); +isc_result_t +dns_c_view_addzone(dns_c_view_t *view, dns_c_zone_t *zone); -isc_result_t dns_c_view_getviewclass(dns_c_view_t *view, - dns_rdataclass_t *retval); +isc_result_t +dns_c_view_getzonelist(dns_c_view_t *view, dns_c_zonelist_t **zonelist); -isc_result_t dns_c_view_getforward(dns_c_view_t *view, - dns_c_forw_t *retval); -isc_result_t dns_c_view_setforward(dns_c_view_t *view, - dns_c_forw_t newval); -isc_result_t dns_c_view_unsetforward(dns_c_view_t *view); +isc_result_t +dns_c_view_unsetzonelist(dns_c_view_t *view); +isc_result_t +dns_c_view_getviewclass(dns_c_view_t *view, dns_rdataclass_t *retval); -isc_result_t dns_c_view_setforwarders(dns_c_view_t *view, - dns_c_iplist_t *ipl, - isc_boolean_t deepcopy); -isc_result_t dns_c_view_unsetforwarders(dns_c_view_t *view); -isc_result_t dns_c_view_getforwarders(dns_c_view_t *view, - dns_c_iplist_t **ipl); +isc_result_t +dns_c_view_getforward(dns_c_view_t *view, dns_c_forw_t *retval); +isc_result_t +dns_c_view_setforward(dns_c_view_t *view, dns_c_forw_t newval); -isc_result_t dns_c_view_getallowquery(dns_c_view_t *view, - dns_c_ipmatchlist_t **retval); -isc_result_t dns_c_view_setallowquery(dns_c_view_t *view, - dns_c_ipmatchlist_t *newval); -isc_result_t dns_c_view_unsetallowquery(dns_c_view_t *view); +isc_result_t +dns_c_view_unsetforward(dns_c_view_t *view); +isc_result_t +dns_c_view_setforwarders(dns_c_view_t *view, dns_c_iplist_t *ipl, + isc_boolean_t deepcopy); -isc_result_t dns_c_view_getallowupdateforwarding(dns_c_view_t *view, - dns_c_ipmatchlist_t **retval); -isc_result_t dns_c_view_setallowupdateforwarding(dns_c_view_t *view, - dns_c_ipmatchlist_t *newval); -isc_result_t dns_c_view_unsetallowupdateforwarding(dns_c_view_t *view); +isc_result_t +dns_c_view_unsetforwarders(dns_c_view_t *view); +isc_result_t +dns_c_view_getforwarders(dns_c_view_t *view, dns_c_iplist_t **ipl); -isc_result_t dns_c_view_gettransferacl(dns_c_view_t *view, - dns_c_ipmatchlist_t **retval); -isc_result_t dns_c_view_settransferacl(dns_c_view_t *view, - dns_c_ipmatchlist_t *newval); -isc_result_t dns_c_view_unsettransferacl(dns_c_view_t *view); +isc_result_t +dns_c_view_getallowquery(dns_c_view_t *view, dns_c_ipmatchlist_t **retval); +isc_result_t +dns_c_view_setallowquery(dns_c_view_t *view, dns_c_ipmatchlist_t *newval); -isc_result_t dns_c_view_getrecursionacl(dns_c_view_t *view, - dns_c_ipmatchlist_t **retval); -isc_result_t dns_c_view_setrecursionacl(dns_c_view_t *view, - dns_c_ipmatchlist_t *newval); -isc_result_t dns_c_view_unsetrecursionacl(dns_c_view_t *view); +isc_result_t +dns_c_view_unsetallowquery(dns_c_view_t *view); +isc_result_t +dns_c_view_getallowupdateforwarding(dns_c_view_t *view, + dns_c_ipmatchlist_t **retval); -isc_result_t dns_c_view_getsortlist(dns_c_view_t *view, - dns_c_ipmatchlist_t **retval); -isc_result_t dns_c_view_setsortlist(dns_c_view_t *view, - dns_c_ipmatchlist_t *newval); -isc_result_t dns_c_view_unsetsortlist(dns_c_view_t *view); +isc_result_t +dns_c_view_setallowupdateforwarding(dns_c_view_t *view, + dns_c_ipmatchlist_t *newval); +isc_result_t +dns_c_view_unsetallowupdateforwarding(dns_c_view_t *view); -isc_result_t dns_c_view_gettopology(dns_c_view_t *view, - dns_c_ipmatchlist_t **retval); -isc_result_t dns_c_view_settopology(dns_c_view_t *view, - dns_c_ipmatchlist_t *newval); -isc_result_t dns_c_view_unsettopology(dns_c_view_t *view); +isc_result_t +dns_c_view_gettransferacl(dns_c_view_t *view, dns_c_ipmatchlist_t **retval); +isc_result_t +dns_c_view_settransferacl(dns_c_view_t *view, dns_c_ipmatchlist_t *newval); -isc_result_t dns_c_view_getmatchclients(dns_c_view_t *view, - dns_c_ipmatchlist_t **retval); -isc_result_t dns_c_view_setmatchclients(dns_c_view_t *view, - dns_c_ipmatchlist_t *newval); -isc_result_t dns_c_view_unsetmatchclients(dns_c_view_t *view); +isc_result_t +dns_c_view_unsettransferacl(dns_c_view_t *view); +isc_result_t +dns_c_view_getrecursionacl(dns_c_view_t *view, dns_c_ipmatchlist_t **retval); -isc_result_t dns_c_view_getordering(dns_c_view_t *view, - dns_c_rrsolist_t **olist); -isc_result_t dns_c_view_setordering(dns_c_view_t *view, - isc_boolean_t copy, - dns_c_rrsolist_t *olist); -isc_result_t dns_c_view_unsetordering(dns_c_view_t *view, - dns_c_rrsolist_t **olist); +isc_result_t +dns_c_view_setrecursionacl(dns_c_view_t *view, dns_c_ipmatchlist_t *newval); +isc_result_t +dns_c_view_unsetrecursionacl(dns_c_view_t *view); -isc_result_t dns_c_view_setchecknames(dns_c_view_t *view, - dns_c_trans_t transtype, - dns_severity_t newval); -isc_result_t dns_c_view_getchecknames(dns_c_view_t *view, - dns_c_trans_t transtype, - dns_severity_t *retval); -isc_result_t dns_c_view_unsetchecknames(dns_c_view_t *view, - dns_c_trans_t transtype); +isc_result_t +dns_c_view_getsortlist(dns_c_view_t *view, dns_c_ipmatchlist_t **retval); +isc_result_t +dns_c_view_setsortlist(dns_c_view_t *view, dns_c_ipmatchlist_t *newval); +isc_result_t +dns_c_view_unsetsortlist(dns_c_view_t *view); -isc_result_t dns_c_view_getauthnxdomain(dns_c_view_t *view, - isc_boolean_t *retval); -isc_result_t dns_c_view_setauthnxdomain(dns_c_view_t *view, - isc_boolean_t newval); -isc_result_t dns_c_view_unsetauthnxdomain(dns_c_view_t *view); +isc_result_t +dns_c_view_gettopology(dns_c_view_t *view, dns_c_ipmatchlist_t **retval); +isc_result_t +dns_c_view_settopology(dns_c_view_t *view, dns_c_ipmatchlist_t *newval); -isc_result_t dns_c_view_getrecursion(dns_c_view_t *view, - isc_boolean_t *retval); -isc_result_t dns_c_view_setrecursion(dns_c_view_t *view, - isc_boolean_t newval); -isc_result_t dns_c_view_unsetrecursion(dns_c_view_t *view); +isc_result_t +dns_c_view_unsettopology(dns_c_view_t *view); +isc_result_t +dns_c_view_getmatchclients(dns_c_view_t *view, dns_c_ipmatchlist_t **retval); -isc_result_t dns_c_view_getprovideixfr(dns_c_view_t *view, - isc_boolean_t *retval); -isc_result_t dns_c_view_setprovideixfr(dns_c_view_t *view, - isc_boolean_t newval); -isc_result_t dns_c_view_unsetprovideixfr(dns_c_view_t *view); +isc_result_t +dns_c_view_setmatchclients(dns_c_view_t *view, dns_c_ipmatchlist_t *newval); +isc_result_t +dns_c_view_unsetmatchclients(dns_c_view_t *view); -isc_result_t dns_c_view_getrequestixfr(dns_c_view_t *view, - isc_boolean_t *retval); -isc_result_t dns_c_view_setrequestixfr(dns_c_view_t *view, - isc_boolean_t newval); -isc_result_t dns_c_view_unsetrequestixfr(dns_c_view_t *view); +isc_result_t +dns_c_view_getordering(dns_c_view_t *view, dns_c_rrsolist_t **olist); +isc_result_t +dns_c_view_setordering(dns_c_view_t *view, isc_boolean_t copy, + dns_c_rrsolist_t *olist); -isc_result_t dns_c_view_getfetchglue(dns_c_view_t *view, - isc_boolean_t *retval); -isc_result_t dns_c_view_setfetchglue(dns_c_view_t *view, - isc_boolean_t newval); -isc_result_t dns_c_view_unsetfetchglue(dns_c_view_t *view); +isc_result_t +dns_c_view_unsetordering(dns_c_view_t *view, dns_c_rrsolist_t **olist); +isc_result_t +dns_c_view_setchecknames(dns_c_view_t *view, dns_c_trans_t transtype, + dns_severity_t newval); -isc_result_t dns_c_view_getnotify(dns_c_view_t *view, - isc_boolean_t *retval); -isc_result_t dns_c_view_setnotify(dns_c_view_t *view, - isc_boolean_t newval); -isc_result_t dns_c_view_unsetnotify(dns_c_view_t *view); +isc_result_t +dns_c_view_getchecknames(dns_c_view_t *view, dns_c_trans_t transtype, + dns_severity_t *retval); +isc_result_t +dns_c_view_unsetchecknames(dns_c_view_t *view, dns_c_trans_t transtype); -isc_result_t dns_c_view_getrfc2308type1(dns_c_view_t *view, - isc_boolean_t *retval); -isc_result_t dns_c_view_setrfc2308type1(dns_c_view_t *view, - isc_boolean_t newval); -isc_result_t dns_c_view_unsetrfc2308type1(dns_c_view_t *view); +isc_result_t +dns_c_view_getauthnxdomain(dns_c_view_t *view, isc_boolean_t *retval); +isc_result_t +dns_c_view_setauthnxdomain(dns_c_view_t *view, isc_boolean_t newval); +isc_result_t +dns_c_view_unsetauthnxdomain(dns_c_view_t *view); -isc_result_t dns_c_view_settransfersource(dns_c_view_t *view, - isc_sockaddr_t transfer_source); -isc_result_t dns_c_view_gettransfersource(dns_c_view_t *view, - isc_sockaddr_t *transfer_source); -isc_result_t dns_c_view_unsettransfersource(dns_c_view_t *view); +isc_result_t +dns_c_view_getrecursion(dns_c_view_t *view, isc_boolean_t *retval); +isc_result_t +dns_c_view_setrecursion(dns_c_view_t *view, isc_boolean_t newval); -isc_result_t dns_c_view_settransfersourcev6(dns_c_view_t *view, - isc_sockaddr_t transfer_source_v6); -isc_result_t dns_c_view_gettransfersourcev6(dns_c_view_t *view, - isc_sockaddr_t *transfer_source_v6); -isc_result_t dns_c_view_unsettransfersourcev6(dns_c_view_t *view); +isc_result_t +dns_c_view_unsetrecursion(dns_c_view_t *view); +isc_result_t +dns_c_view_getprovideixfr(dns_c_view_t *view, isc_boolean_t *retval); -isc_result_t dns_c_view_setquerysource(dns_c_view_t *view, - isc_sockaddr_t query_source); -isc_result_t dns_c_view_getquerysource(dns_c_view_t *view, - isc_sockaddr_t *query_source); -isc_result_t dns_c_view_unsetquerysource(dns_c_view_t *view); +isc_result_t +dns_c_view_setprovideixfr(dns_c_view_t *view, isc_boolean_t newval); +isc_result_t +dns_c_view_unsetprovideixfr(dns_c_view_t *view); -isc_result_t dns_c_view_setquerysourcev6(dns_c_view_t *view, - isc_sockaddr_t query_source_v6); -isc_result_t dns_c_view_getquerysourcev6(dns_c_view_t *view, - isc_sockaddr_t *query_source_v6); -isc_result_t dns_c_view_unsetquerysourcev6(dns_c_view_t *view); +isc_result_t +dns_c_view_getrequestixfr(dns_c_view_t *view, isc_boolean_t *retval); +isc_result_t +dns_c_view_setrequestixfr(dns_c_view_t *view, isc_boolean_t newval); -isc_result_t dns_c_view_getmaxtransferidleout(dns_c_view_t *view, - isc_int32_t *retval); -isc_result_t dns_c_view_setmaxtransferidleout(dns_c_view_t *view, - isc_int32_t newval); -isc_result_t dns_c_view_unsetmaxtransferidleout(dns_c_view_t *view); +isc_result_t +dns_c_view_unsetrequestixfr(dns_c_view_t *view); +isc_result_t +dns_c_view_getfetchglue(dns_c_view_t *view, isc_boolean_t *retval); -isc_result_t dns_c_view_getmaxtransfertimeout(dns_c_view_t *view, - isc_int32_t *retval); -isc_result_t dns_c_view_setmaxtransfertimeout(dns_c_view_t *view, - isc_int32_t newval); -isc_result_t dns_c_view_unsetmaxtransfertimeout(dns_c_view_t *view); +isc_result_t +dns_c_view_setfetchglue(dns_c_view_t *view, isc_boolean_t newval); +isc_result_t +dns_c_view_unsetfetchglue(dns_c_view_t *view); -isc_result_t dns_c_view_getcleaninterval(dns_c_view_t *view, - isc_int32_t *retval); -isc_result_t dns_c_view_setcleaninterval(dns_c_view_t *view, - isc_int32_t newval); -isc_result_t dns_c_view_unsetcleaninterval(dns_c_view_t *view); +isc_result_t +dns_c_view_getnotify(dns_c_view_t *view, isc_boolean_t *retval); +isc_result_t +dns_c_view_setnotify(dns_c_view_t *view, isc_boolean_t newval); -isc_result_t dns_c_view_getminroots(dns_c_view_t *view, - isc_int32_t *retval); -isc_result_t dns_c_view_setminroots(dns_c_view_t *view, - isc_int32_t newval); -isc_result_t dns_c_view_unsetminroots(dns_c_view_t *view); +isc_result_t +dns_c_view_unsetnotify(dns_c_view_t *view); +isc_result_t +dns_c_view_getrfc2308type1(dns_c_view_t *view, isc_boolean_t *retval); -isc_result_t dns_c_view_getlamettl(dns_c_view_t *view, - isc_int32_t *retval); -isc_result_t dns_c_view_setlamettl(dns_c_view_t *view, - isc_int32_t newval); -isc_result_t dns_c_view_unsetlamettl(dns_c_view_t *view); +isc_result_t +dns_c_view_setrfc2308type1(dns_c_view_t *view, isc_boolean_t newval); +isc_result_t +dns_c_view_unsetrfc2308type1(dns_c_view_t *view); -isc_result_t dns_c_view_getmaxncachettl(dns_c_view_t *view, - isc_int32_t *retval); -isc_result_t dns_c_view_setmaxncachettl(dns_c_view_t *view, - isc_int32_t newval); -isc_result_t dns_c_view_unsetmaxncachettl(dns_c_view_t *view); +isc_result_t +dns_c_view_settransfersource(dns_c_view_t *view, + isc_sockaddr_t transfer_source); +isc_result_t +dns_c_view_gettransfersource(dns_c_view_t *view, + isc_sockaddr_t *transfer_source); -isc_result_t dns_c_view_settransferformat(dns_c_view_t *view, - dns_transfer_format_t tformat); -isc_result_t dns_c_view_gettransferformat(dns_c_view_t *view, - dns_transfer_format_t *tformat); -isc_result_t dns_c_view_unsettransferformat(dns_c_view_t *cfg); +isc_result_t +dns_c_view_unsettransfersource(dns_c_view_t *view); +isc_result_t +dns_c_view_settransfersourcev6(dns_c_view_t *view, + isc_sockaddr_t transfer_source_v6); -/* Caller must not delete retval */ -isc_result_t dns_c_view_getkeydefs(dns_c_view_t *view, - dns_c_kdeflist_t **retval); -isc_result_t dns_c_view_setkeydefs(dns_c_view_t *view, - dns_c_kdeflist_t *newval); -isc_result_t dns_c_view_unsetkeydefs(dns_c_view_t *view); +isc_result_t +dns_c_view_gettransfersourcev6(dns_c_view_t *view, + isc_sockaddr_t *transfer_source_v6); +isc_result_t +dns_c_view_unsettransfersourcev6(dns_c_view_t *view); -/* detach when done with retval */ -isc_result_t dns_c_view_getpeerlist(dns_c_view_t *cfg, - dns_peerlist_t **retval); -/* cfg will attach to newval */ -isc_result_t dns_c_view_setpeerlist(dns_c_view_t *cfg, - dns_peerlist_t *newval); -isc_result_t dns_c_view_unsetpeerlist(dns_c_view_t *cfg); +isc_result_t +dns_c_view_setquerysource(dns_c_view_t *view, isc_sockaddr_t query_source); +isc_result_t +dns_c_view_getquerysource(dns_c_view_t *view, isc_sockaddr_t *query_source); +isc_result_t +dns_c_view_unsetquerysource(dns_c_view_t *view); +isc_result_t +dns_c_view_setquerysourcev6(dns_c_view_t *view, + isc_sockaddr_t query_source_v6); +isc_result_t +dns_c_view_getquerysourcev6(dns_c_view_t *view, + isc_sockaddr_t *query_source_v6); +isc_result_t +dns_c_view_unsetquerysourcev6(dns_c_view_t *view); + +isc_result_t +dns_c_view_getmaxtransferidleout(dns_c_view_t *view, isc_int32_t *retval); + +isc_result_t +dns_c_view_setmaxtransferidleout(dns_c_view_t *view, isc_int32_t newval); + +isc_result_t +dns_c_view_unsetmaxtransferidleout(dns_c_view_t *view); + +isc_result_t +dns_c_view_getmaxtransfertimeout(dns_c_view_t *view, isc_int32_t *retval); + +isc_result_t +dns_c_view_setmaxtransfertimeout(dns_c_view_t *view, isc_int32_t newval); + +isc_result_t +dns_c_view_unsetmaxtransfertimeout(dns_c_view_t *view); + +isc_result_t +dns_c_view_getcleaninterval(dns_c_view_t *view, isc_int32_t *retval); + +isc_result_t +dns_c_view_setcleaninterval(dns_c_view_t *view, isc_int32_t newval); + +isc_result_t +dns_c_view_unsetcleaninterval(dns_c_view_t *view); + +isc_result_t +dns_c_view_getminroots(dns_c_view_t *view, isc_int32_t *retval); + +isc_result_t +dns_c_view_setminroots(dns_c_view_t *view, isc_int32_t newval); + +isc_result_t +dns_c_view_unsetminroots(dns_c_view_t *view); + +isc_result_t +dns_c_view_getlamettl(dns_c_view_t *view, isc_int32_t *retval); + +isc_result_t +dns_c_view_setlamettl(dns_c_view_t *view, isc_int32_t newval); + +isc_result_t +dns_c_view_unsetlamettl(dns_c_view_t *view); + +isc_result_t +dns_c_view_getmaxncachettl(dns_c_view_t *view, isc_int32_t *retval); + +isc_result_t +dns_c_view_setmaxncachettl(dns_c_view_t *view, isc_int32_t newval); + +isc_result_t +dns_c_view_unsetmaxncachettl(dns_c_view_t *view); + +isc_result_t +dns_c_view_settransferformat(dns_c_view_t *view, + dns_transfer_format_t tformat); + +isc_result_t +dns_c_view_gettransferformat(dns_c_view_t *view, + dns_transfer_format_t *tformat); + +isc_result_t +dns_c_view_unsettransferformat(dns_c_view_t *cfg); + +/* + * Caller must not delete retval. + */ +isc_result_t +dns_c_view_getkeydefs(dns_c_view_t *view, dns_c_kdeflist_t **retval); + +isc_result_t +dns_c_view_setkeydefs(dns_c_view_t *view, dns_c_kdeflist_t *newval); + +isc_result_t +dns_c_view_unsetkeydefs(dns_c_view_t *view); + +/* + * Detach when done with retval. + */ +isc_result_t +dns_c_view_getpeerlist(dns_c_view_t *cfg, dns_peerlist_t **retval); + +/* + * cfg will attach to newval. + */ +isc_result_t +dns_c_view_setpeerlist(dns_c_view_t *cfg, dns_peerlist_t *newval); + +isc_result_t +dns_c_view_unsetpeerlist(dns_c_view_t *cfg); #if 0 @@ -459,38 +539,44 @@ isc_result_t dns_c_view_unsetpeerlist(dns_c_view_t *cfg); * XXX waiting to server to implement these items before enabling them */ -isc_result_t dns_c_view_getmaxtransfertimein(dns_c_view_t *view, - isc_int32_t *retval); -isc_result_t dns_c_view_setmaxtransfertimein(dns_c_view_t *view, - isc_int32_t newval); -isc_result_t dns_c_view_unsetmaxtransfertimein(dns_c_view_t *view); +isc_result_t +dns_c_view_getmaxtransfertimein(dns_c_view_t *view, isc_int32_t *retval); +isc_result_t +dns_c_view_setmaxtransfertimein(dns_c_view_t *view, isc_int32_t newval); -isc_result_t dns_c_view_getmaxtransferidlein(dns_c_view_t *view, - isc_int32_t *retval); -isc_result_t dns_c_view_setmaxtransferidlein(dns_c_view_t *view, - isc_int32_t newval); -isc_result_t dns_c_view_unsetmaxtransferidlein(dns_c_view_t *view); +isc_result_t +dns_c_view_unsetmaxtransfertimein(dns_c_view_t *view); +isc_result_t +dns_c_view_getmaxtransferidlein(dns_c_view_t *view, isc_int32_t *retval); -isc_result_t dns_c_view_gettransfersperns(dns_c_view_t *view, - isc_int32_t *retval); -isc_result_t dns_c_view_settransfersperns(dns_c_view_t *view, - isc_int32_t newval); -isc_result_t dns_c_view_unsettransfersperns(dns_c_view_t *view); +isc_result_t +dns_c_view_setmaxtransferidlein(dns_c_view_t *view, isc_int32_t newval); -isc_result_t dns_c_view_getserialqueries(dns_c_view_t *view, - isc_int32_t *retval); -isc_result_t dns_c_view_setserialqueries(dns_c_view_t *view, - isc_int32_t newval); -isc_result_t dns_c_view_unsetserialqueries(dns_c_view_t *view); +isc_result_t +dns_c_view_unsetmaxtransferidlein(dns_c_view_t *view); +isc_result_t +dns_c_view_gettransfersperns(dns_c_view_t *view, isc_int32_t *retval); +isc_result_t +dns_c_view_settransfersperns(dns_c_view_t *view, isc_int32_t newval); + +isc_result_t +dns_c_view_unsettransfersperns(dns_c_view_t *view); + +isc_result_t +dns_c_view_getserialqueries(dns_c_view_t *view, isc_int32_t *retval); + +isc_result_t +dns_c_view_setserialqueries(dns_c_view_t *view, isc_int32_t newval); + +isc_result_t +dns_c_view_unsetserialqueries(dns_c_view_t *view); #endif - - - +ISC_LANG_ENDDECLS #endif /* DNS_CONFVIEW_H */ diff --git a/lib/dns/include/dns/confzone.h b/lib/dns/include/dns/confzone.h index df7c123a17..52d3448715 100644 --- a/lib/dns/include/dns/confzone.h +++ b/lib/dns/include/dns/confzone.h @@ -53,14 +53,9 @@ *** Imports ***/ +#include #include -/* XXX these next two are needed by rdatatype.h. It should be fixed to - * include them itself. - */ -#include -#include - #include #include @@ -71,8 +66,7 @@ #define DNS_C_ZONE_MAGIC 0x7a4f6e45 /* zOnE */ #define DNS_C_ZONELIST_VALID(ptr) ISC_MAGIC_VALID(ptr, DNS_C_ZONELIST_MAGIC) -#define DNS_C_ZONE_VALID(ptr) ISC_MAGIC_VALID(ptr, DNS_C_ZONE_MAGIC) - +#define DNS_C_ZONE_VALID(ptr) ISC_MAGIC_VALID(ptr, DNS_C_ZONE_MAGIC) /*** *** Types @@ -93,25 +87,19 @@ typedef struct dns_c_zonelem dns_c_zonelem_t; typedef struct dns_c_zone_list dns_c_zonelist_t; #endif - -struct dns_c_zonelem -{ +struct dns_c_zonelem { dns_c_zone_t *thezone; ISC_LINK(dns_c_zonelem_t) next; }; - -struct dns_c_zone_list -{ +struct dns_c_zone_list { isc_int32_t magic; isc_mem_t *mem; ISC_LIST(dns_c_zonelem_t) zones; }; - -struct dns_c_master_zone -{ +struct dns_c_master_zone { char *file; dns_severity_t check_names; dns_c_ipmatchlist_t *allow_update; @@ -136,9 +124,7 @@ struct dns_c_master_zone dns_c_setbits_t setflags; }; - -struct dns_c_slave_zone -{ +struct dns_c_slave_zone { char *file; dns_severity_t check_names; dns_c_ipmatchlist_t *allow_update; @@ -168,9 +154,7 @@ struct dns_c_slave_zone dns_c_setbits_t setflags; }; - -struct dns_c_stub_zone -{ +struct dns_c_stub_zone { char *file; dns_severity_t check_names; dns_c_ipmatchlist_t *allow_update; /* should be here??? */ @@ -192,10 +176,7 @@ struct dns_c_stub_zone dns_c_setbits_t setflags; }; - - -struct dns_c_forward_zone -{ +struct dns_c_forward_zone { dns_severity_t check_names; dns_c_forw_t forward; dns_c_iplist_t *forwarders; @@ -203,9 +184,7 @@ struct dns_c_forward_zone dns_c_setbits_t setflags; }; - -struct dns_c_hint_zone -{ +struct dns_c_hint_zone { char *file; dns_severity_t check_names; dns_c_pklist_t *pubkeylist; @@ -213,9 +192,7 @@ struct dns_c_hint_zone dns_c_setbits_t setflags; }; - -struct dns_c_zone -{ +struct dns_c_zone { isc_int32_t magic; isc_mem_t *mem; @@ -239,165 +216,238 @@ struct dns_c_zone isc_boolean_t afteropts; }; - /*** *** Functions ***/ -isc_result_t dns_c_zonelist_new(isc_mem_t *mem, - dns_c_zonelist_t **zlist); -isc_result_t dns_c_zonelist_delete(dns_c_zonelist_t **zlist); -isc_result_t dns_c_zonelist_checkzones(dns_c_zonelist_t *zlist); +ISC_LANG_BEGINDECLS + + +isc_result_t +dns_c_zonelist_new(isc_mem_t *mem, dns_c_zonelist_t **zlist); + +isc_result_t +dns_c_zonelist_delete(dns_c_zonelist_t **zlist); + +isc_result_t +dns_c_zonelist_checkzones(dns_c_zonelist_t *zlist); + #if 0 -dns_c_zone_t *dns_c_zonelist_currzone(dns_c_zonelist_t *zlist); +dns_c_zone_t * +dns_c_zonelist_currzone(dns_c_zonelist_t *zlist); #endif -isc_result_t dns_c_zonelist_find(dns_c_zonelist_t *zlist, - const char *name, dns_c_zone_t **retval); -isc_result_t dns_c_zonelist_rmbyname(dns_c_zonelist_t *zlist, - const char *name); -isc_result_t dns_c_zonelist_addzone(dns_c_zonelist_t *zlist, - dns_c_zone_t *zone); -isc_result_t dns_c_zonelist_rmzone(dns_c_zonelist_t *zlist, - dns_c_zone_t *zone); -void dns_c_zonelist_print(FILE *fp, int indent, - dns_c_zonelist_t *list); -void dns_c_zonelist_printpostopts(FILE *fp, - int indent, - dns_c_zonelist_t *list); -void dns_c_zonelist_printpreopts(FILE *fp, - int indent, - dns_c_zonelist_t *list); +isc_result_t +dns_c_zonelist_find(dns_c_zonelist_t *zlist, const char *name, + dns_c_zone_t **retval); -dns_c_zone_t *dns_c_zonelist_firstzone(dns_c_zonelist_t *list); -dns_c_zone_t *dns_c_zonelist_nextzone(dns_c_zonelist_t *list, - dns_c_zone_t *thezone); +isc_result_t +dns_c_zonelist_rmbyname(dns_c_zonelist_t *zlist, const char *name); +isc_result_t +dns_c_zonelist_addzone(dns_c_zonelist_t *zlist, dns_c_zone_t *zone); +isc_result_t +dns_c_zonelist_rmzone(dns_c_zonelist_t *zlist, dns_c_zone_t *zone); -isc_result_t dns_c_zone_new(isc_mem_t *mem, - dns_c_zonetype_t ztype, dns_rdataclass_t zclass, - const char *name, const char *internalname, - dns_c_zone_t **zone); -isc_result_t dns_c_zone_detach(dns_c_zone_t **zone); -void dns_c_zone_attach(dns_c_zone_t *source, - dns_c_zone_t **target); -void dns_c_zone_print(FILE *fp, int indent, - dns_c_zone_t *zone); -isc_result_t dns_c_zone_setfile(dns_c_zone_t *zone, - const char *newfile); -isc_result_t dns_c_zone_setchecknames(dns_c_zone_t *zone, - dns_severity_t severity); -isc_result_t dns_c_zone_setallowupdateforwarding(dns_c_zone_t *zone, - dns_c_ipmatchlist_t *ipml, - isc_boolean_t deepcopy); -isc_result_t dns_c_zone_setssuauth(dns_c_zone_t *zone, - dns_ssutable_t *ssutable); -isc_result_t dns_c_zone_setallowquery(dns_c_zone_t *zone, - dns_c_ipmatchlist_t *ipml, - isc_boolean_t deepcopy); -isc_result_t dns_c_zone_setallowtransfer(dns_c_zone_t *zone, - dns_c_ipmatchlist_t *ipml, - isc_boolean_t deepcopy); -isc_result_t dns_c_zone_setdialup(dns_c_zone_t *zone, - isc_boolean_t newval); -isc_result_t dns_c_zone_setnotify(dns_c_zone_t *zone, - isc_boolean_t newval); -isc_result_t dns_c_zone_setmaintixfrbase(dns_c_zone_t *zone, - isc_boolean_t newval); -isc_result_t dns_c_zone_setalsonotify(dns_c_zone_t *zone, - dns_c_iplist_t *newval, - isc_boolean_t deepcopy); -isc_result_t dns_c_zone_setixfrbase(dns_c_zone_t *zone, - const char *newval); -isc_result_t dns_c_zone_setixfrtmp(dns_c_zone_t *zone, - const char *newval); -isc_result_t dns_c_zone_addpubkey(dns_c_zone_t *zone, - dns_c_pubkey_t *pubkey, - isc_boolean_t deepcopy); -isc_result_t dns_c_zone_setmasterport(dns_c_zone_t *zone, - in_port_t port); -isc_result_t dns_c_zone_setmasterips(dns_c_zone_t *zone, - dns_c_iplist_t *newval, - isc_boolean_t deepcopy); -isc_result_t dns_c_zone_settransfersource(dns_c_zone_t *zone, - isc_sockaddr_t newval); -isc_result_t dns_c_zone_settransfersourcev6(dns_c_zone_t *zone, - isc_sockaddr_t newval); -isc_result_t dns_c_zone_setmaxtranstimein(dns_c_zone_t *zone, - isc_int32_t newval); -isc_result_t dns_c_zone_setmaxtranstimeout(dns_c_zone_t *zone, - isc_int32_t newval); -isc_result_t dns_c_zone_setmaxtransidlein(dns_c_zone_t *zone, - isc_int32_t newval); -isc_result_t dns_c_zone_setmaxtransidleout(dns_c_zone_t *zone, - isc_int32_t newval); -isc_result_t dns_c_zone_setmaxixfrlog(dns_c_zone_t *zone, - isc_int32_t newval); -isc_result_t dns_c_zone_setforward(dns_c_zone_t *zone, - dns_c_forw_t newval); -isc_result_t dns_c_zone_setforwarders(dns_c_zone_t *zone, - dns_c_iplist_t *ipml, - isc_boolean_t deepcopy); -isc_result_t dns_c_zone_getname(dns_c_zone_t *zone, - const char **retval); -isc_result_t dns_c_zone_getinternalname(dns_c_zone_t *zone, - const char **retval); -isc_result_t dns_c_zone_getfile(dns_c_zone_t *zone, - const char **retval); -isc_result_t dns_c_zone_getchecknames(dns_c_zone_t *zone, - dns_severity_t *retval); -isc_result_t dns_c_zone_getssuauth(dns_c_zone_t *zone, - dns_ssutable_t **ssutable); -isc_result_t dns_c_zone_getallowupdateforwarding(dns_c_zone_t *zone, - dns_c_ipmatchlist_t **retval); -isc_result_t dns_c_zone_getallowquery(dns_c_zone_t *zone, - dns_c_ipmatchlist_t **retval); -isc_result_t dns_c_zone_getallowtransfer(dns_c_zone_t *zone, - dns_c_ipmatchlist_t **retval); -isc_result_t dns_c_zone_getdialup(dns_c_zone_t *zone, - isc_boolean_t *retval); -isc_result_t dns_c_zone_getnotify(dns_c_zone_t *zone, - isc_boolean_t *retval); -isc_result_t dns_c_zone_getmaintixfrbase(dns_c_zone_t *zone, - isc_boolean_t *retval); -isc_result_t dns_c_zone_getalsonotify(dns_c_zone_t *zone, - dns_c_iplist_t **retval); -isc_result_t dns_c_zone_getixfrbase(dns_c_zone_t *zone, - const char **retval); -isc_result_t dns_c_zone_getixfrtmp(dns_c_zone_t *zone, - const char **retval); -isc_result_t dns_c_zone_getpubkeylist(dns_c_zone_t *zone, - dns_c_pklist_t **retval); -isc_result_t dns_c_zone_getmasterport(dns_c_zone_t *zone, - in_port_t *retval); -isc_result_t dns_c_zone_getmasterips(dns_c_zone_t *zone, - dns_c_iplist_t **retval); -isc_result_t dns_c_zone_gettransfersource(dns_c_zone_t *zone, - isc_sockaddr_t *retval); -isc_result_t dns_c_zone_gettransfersourcev6(dns_c_zone_t *zone, - isc_sockaddr_t *retval); -isc_result_t dns_c_zone_getmaxtranstimein(dns_c_zone_t *zone, - isc_int32_t *retval); -isc_result_t dns_c_zone_getmaxtranstimeout(dns_c_zone_t *zone, - isc_int32_t *retval); -isc_result_t dns_c_zone_getmaxtransidlein(dns_c_zone_t *zone, - isc_int32_t *retval); -isc_result_t dns_c_zone_getmaxtransidleout(dns_c_zone_t *zone, - isc_int32_t *retval); -isc_result_t dns_c_zone_getmaxixfrlog(dns_c_zone_t *zone, - isc_int32_t *retval); -isc_result_t dns_c_zone_getforward(dns_c_zone_t *zone, - dns_c_forw_t *retval); -isc_result_t dns_c_zone_getforwarders(dns_c_zone_t *zone, - dns_c_iplist_t **retval); +void +dns_c_zonelist_print(FILE *fp, int indent, dns_c_zonelist_t *list); +void +dns_c_zonelist_printpostopts(FILE *fp, int indent, dns_c_zonelist_t *list); -isc_result_t dns_c_zone_setallowupd(dns_c_zone_t *zone, - dns_c_ipmatchlist_t *ipml, - isc_boolean_t deepcopy); -isc_result_t dns_c_zone_getallowupd(dns_c_zone_t *zone, - dns_c_ipmatchlist_t **retval); -isc_result_t dns_c_zone_unsetallowupd(dns_c_zone_t *zone); +void +dns_c_zonelist_printpreopts(FILE *fp, int indent, dns_c_zonelist_t *list); + +dns_c_zone_t * +dns_c_zonelist_firstzone(dns_c_zonelist_t *list); + +dns_c_zone_t * +dns_c_zonelist_nextzone(dns_c_zonelist_t *list, dns_c_zone_t *thezone); + +isc_result_t +dns_c_zone_new(isc_mem_t *mem, dns_c_zonetype_t ztype, + dns_rdataclass_t zclass, const char *name, + const char *internalname, dns_c_zone_t **zone); + +isc_result_t +dns_c_zone_detach(dns_c_zone_t **zone); + +void +dns_c_zone_attach(dns_c_zone_t *source, dns_c_zone_t **target); + +void +dns_c_zone_print(FILE *fp, int indent, dns_c_zone_t *zone); + +isc_result_t +dns_c_zone_setfile(dns_c_zone_t *zone, const char *newfile); + +isc_result_t +dns_c_zone_setchecknames(dns_c_zone_t *zone, dns_severity_t severity); + +isc_result_t +dns_c_zone_setallowupdateforwarding(dns_c_zone_t *zone, + dns_c_ipmatchlist_t *ipml, + isc_boolean_t deepcopy); + +isc_result_t +dns_c_zone_setssuauth(dns_c_zone_t *zone, dns_ssutable_t *ssutable); + +isc_result_t +dns_c_zone_setallowquery(dns_c_zone_t *zone, dns_c_ipmatchlist_t *ipml, + isc_boolean_t deepcopy); + +isc_result_t +dns_c_zone_setallowtransfer(dns_c_zone_t *zone, dns_c_ipmatchlist_t *ipml, + isc_boolean_t deepcopy); + +isc_result_t +dns_c_zone_setdialup(dns_c_zone_t *zone, isc_boolean_t newval); + +isc_result_t +dns_c_zone_setnotify(dns_c_zone_t *zone, isc_boolean_t newval); + +isc_result_t +dns_c_zone_setmaintixfrbase(dns_c_zone_t *zone, isc_boolean_t newval); + +isc_result_t +dns_c_zone_setalsonotify(dns_c_zone_t *zone, dns_c_iplist_t *newval, + isc_boolean_t deepcopy); + +isc_result_t +dns_c_zone_setixfrbase(dns_c_zone_t *zone, const char *newval); + +isc_result_t +dns_c_zone_setixfrtmp(dns_c_zone_t *zone, const char *newval); + +isc_result_t +dns_c_zone_addpubkey(dns_c_zone_t *zone, dns_c_pubkey_t *pubkey, + isc_boolean_t deepcopy); + +isc_result_t +dns_c_zone_setmasterport(dns_c_zone_t *zone, in_port_t port); + +isc_result_t +dns_c_zone_setmasterips(dns_c_zone_t *zone, dns_c_iplist_t *newval, + isc_boolean_t deepcopy); + +isc_result_t +dns_c_zone_settransfersource(dns_c_zone_t *zone, isc_sockaddr_t newval); + +isc_result_t +dns_c_zone_settransfersourcev6(dns_c_zone_t *zone, isc_sockaddr_t newval); + +isc_result_t +dns_c_zone_setmaxtranstimein(dns_c_zone_t *zone, isc_int32_t newval); + +isc_result_t +dns_c_zone_setmaxtranstimeout(dns_c_zone_t *zone, isc_int32_t newval); + +isc_result_t +dns_c_zone_setmaxtransidlein(dns_c_zone_t *zone, isc_int32_t newval); + +isc_result_t +dns_c_zone_setmaxtransidleout(dns_c_zone_t *zone, isc_int32_t newval); + +isc_result_t +dns_c_zone_setmaxixfrlog(dns_c_zone_t *zone, isc_int32_t newval); + +isc_result_t +dns_c_zone_setforward(dns_c_zone_t *zone, dns_c_forw_t newval); + +isc_result_t +dns_c_zone_setforwarders(dns_c_zone_t *zone, dns_c_iplist_t *ipml, + isc_boolean_t deepcopy); + +isc_result_t +dns_c_zone_getname(dns_c_zone_t *zone, const char **retval); + +isc_result_t +dns_c_zone_getinternalname(dns_c_zone_t *zone, const char **retval); + +isc_result_t +dns_c_zone_getfile(dns_c_zone_t *zone, const char **retval); + +isc_result_t +dns_c_zone_getchecknames(dns_c_zone_t *zone, dns_severity_t *retval); + +isc_result_t +dns_c_zone_getssuauth(dns_c_zone_t *zone, dns_ssutable_t **ssutable); + +isc_result_t +dns_c_zone_getallowupdateforwarding(dns_c_zone_t *zone, + dns_c_ipmatchlist_t **retval); + +isc_result_t +dns_c_zone_getallowquery(dns_c_zone_t *zone, dns_c_ipmatchlist_t **retval); + +isc_result_t +dns_c_zone_getallowtransfer(dns_c_zone_t *zone, dns_c_ipmatchlist_t **retval); + +isc_result_t +dns_c_zone_getdialup(dns_c_zone_t *zone, isc_boolean_t *retval); + +isc_result_t +dns_c_zone_getnotify(dns_c_zone_t *zone, isc_boolean_t *retval); + +isc_result_t +dns_c_zone_getmaintixfrbase(dns_c_zone_t *zone, isc_boolean_t *retval); + +isc_result_t +dns_c_zone_getalsonotify(dns_c_zone_t *zone, dns_c_iplist_t **retval); + +isc_result_t +dns_c_zone_getixfrbase(dns_c_zone_t *zone, const char **retval); + +isc_result_t +dns_c_zone_getixfrtmp(dns_c_zone_t *zone, const char **retval); + +isc_result_t +dns_c_zone_getpubkeylist(dns_c_zone_t *zone, dns_c_pklist_t **retval); + +isc_result_t +dns_c_zone_getmasterport(dns_c_zone_t *zone, in_port_t *retval); + +isc_result_t +dns_c_zone_getmasterips(dns_c_zone_t *zone, dns_c_iplist_t **retval); + +isc_result_t +dns_c_zone_gettransfersource(dns_c_zone_t *zone, isc_sockaddr_t *retval); + +isc_result_t +dns_c_zone_gettransfersourcev6(dns_c_zone_t *zone, isc_sockaddr_t *retval); + +isc_result_t +dns_c_zone_getmaxtranstimein(dns_c_zone_t *zone, isc_int32_t *retval); + +isc_result_t +dns_c_zone_getmaxtranstimeout(dns_c_zone_t *zone, isc_int32_t *retval); + +isc_result_t +dns_c_zone_getmaxtransidlein(dns_c_zone_t *zone, isc_int32_t *retval); + +isc_result_t +dns_c_zone_getmaxtransidleout(dns_c_zone_t *zone, isc_int32_t *retval); + +isc_result_t +dns_c_zone_getmaxixfrlog(dns_c_zone_t *zone, isc_int32_t *retval); + +isc_result_t +dns_c_zone_getforward(dns_c_zone_t *zone, dns_c_forw_t *retval); + +isc_result_t +dns_c_zone_getforwarders(dns_c_zone_t *zone, dns_c_iplist_t **retval); + +isc_result_t +dns_c_zone_setallowupd(dns_c_zone_t *zone, dns_c_ipmatchlist_t *ipml, + isc_boolean_t deepcopy); + +isc_result_t +dns_c_zone_getallowupd(dns_c_zone_t *zone, dns_c_ipmatchlist_t **retval); + +isc_result_t +dns_c_zone_unsetallowupd(dns_c_zone_t *zone); + +ISC_LANG_ENDDECLS #endif /* DNS_CONFZONE_H */ diff --git a/lib/dns/include/dns/dbtable.h b/lib/dns/include/dns/dbtable.h index 2294fb8586..9975bd7562 100644 --- a/lib/dns/include/dns/dbtable.h +++ b/lib/dns/include/dns/dbtable.h @@ -44,6 +44,7 @@ * None. */ +#include #include #include @@ -51,6 +52,8 @@ #define DNS_DBTABLEFIND_NOEXACT 0x01 +ISC_LANG_BEGINDECLS + isc_result_t dns_dbtable_create(isc_mem_t *mctx, dns_rdataclass_t rdclass, dns_dbtable_t **dbtablep); @@ -156,4 +159,6 @@ dns_dbtable_find(dns_dbtable_t *dbtable, dns_name_t *name, * no default and match */ +ISC_LANG_ENDDECLS + #endif /* DNS_DBTABLE_H */ diff --git a/lib/dns/include/dns/events.h b/lib/dns/include/dns/events.h index 29f62dbcf3..9ad5fe42a9 100644 --- a/lib/dns/include/dns/events.h +++ b/lib/dns/include/dns/events.h @@ -19,14 +19,11 @@ #define DNS_EVENTS_H 1 #include -#include /* * Registry of DNS event numbers. */ -ISC_LANG_BEGINDECLS - #define DNS_EVENT_FETCHCONTROL (ISC_EVENTCLASS_DNS + 0) #define DNS_EVENT_FETCHDONE (ISC_EVENTCLASS_DNS + 1) #define DNS_EVENT_VIEWRESSHUTDOWN (ISC_EVENTCLASS_DNS + 2) @@ -54,6 +51,4 @@ ISC_LANG_BEGINDECLS #define DNS_EVENT_FIRSTEVENT (ISC_EVENTCLASS_DNS + 0) #define DNS_EVENT_LASTEVENT (ISC_EVENTCLASS_DNS + 65535) -ISC_LANG_ENDDECLS - #endif /* DNS_EVENTS_H */ diff --git a/lib/dns/include/dns/fixedname.h b/lib/dns/include/dns/fixedname.h index 966aa1db94..be187bd108 100644 --- a/lib/dns/include/dns/fixedname.h +++ b/lib/dns/include/dns/fixedname.h @@ -51,14 +51,11 @@ *****/ #include -#include #include #include #include -ISC_LANG_BEGINDECLS - /***** ***** Types *****/ @@ -82,6 +79,4 @@ struct dns_fixedname { #define dns_fixedname_name(fn) (&((fn)->name)) -ISC_LANG_ENDDECLS - #endif /* DNS_FIXEDNAME_H */ diff --git a/lib/dns/include/dns/journal.h b/lib/dns/include/dns/journal.h index eb7d151a57..d6afeefe86 100644 --- a/lib/dns/include/dns/journal.h +++ b/lib/dns/include/dns/journal.h @@ -30,6 +30,7 @@ *** Imports ***/ +#include #include #include @@ -41,8 +42,6 @@ *** Types ***/ -ISC_LANG_BEGINDECLS - /* * A dns_difftuple_t represents a single RR being added or deleted. * The RR type and class are in the 'rdata' member; the class is always @@ -118,6 +117,8 @@ typedef struct dns_journal dns_journal_t; *** Functions ***/ +ISC_LANG_BEGINDECLS + /**************************************************************************/ /* * Maniuplation of diffs and tuples. @@ -162,7 +163,8 @@ dns_difftuple_copy(dns_difftuple_t *orig, dns_difftuple_t **copyp); * copyp != NULL && *copyp == NULL */ -void dns_diff_init(isc_mem_t *mctx, dns_diff_t *diff); +void +dns_diff_init(isc_mem_t *mctx, dns_diff_t *diff); /* * Initialize a diff. * @@ -174,7 +176,8 @@ void dns_diff_init(isc_mem_t *mctx, dns_diff_t *diff); * '*diff' is a valid, empty diff. */ -void dns_diff_clear(dns_diff_t *diff); +void +dns_diff_clear(dns_diff_t *diff); /* * Clear a diff, destroying all its tuples. * @@ -284,7 +287,8 @@ dns_diff_print(dns_diff_t *diff, FILE *file); * XXX these belong in a general-purpose DNS library */ -isc_uint32_t dns_soa_getserial(dns_rdata_t *rdata); +isc_uint32_t +dns_soa_getserial(dns_rdata_t *rdata); /* * Extract the serial number from the rdata of a SOA record. * @@ -292,7 +296,8 @@ isc_uint32_t dns_soa_getserial(dns_rdata_t *rdata); * rdata refers to the rdata of a well-formed SOA record. */ -void dns_soa_setserial(isc_uint32_t val, dns_rdata_t *rdata); +void +dns_soa_setserial(isc_uint32_t val, dns_rdata_t *rdata); /* * Change the serial number of a SOA record by modifying the * rdata in-place. @@ -413,8 +418,10 @@ dns_journal_write_transaction(dns_journal_t *j, dns_diff_t *diff); * Reading transactions from journals. */ -isc_uint32_t dns_journal_first_serial(dns_journal_t *j); -isc_uint32_t dns_journal_last_serial(dns_journal_t *j); +isc_uint32_t +dns_journal_first_serial(dns_journal_t *j); +isc_uint32_t +dns_journal_last_serial(dns_journal_t *j); /* * Get the first and last addressable serial number in the journal. */ @@ -434,8 +441,10 @@ dns_journal_iter_init(dns_journal_t *j, * DNS_R_RANGE begin_serial is outside the addressable range. */ -isc_result_t dns_journal_first_rr(dns_journal_t *j); -isc_result_t dns_journal_next_rr(dns_journal_t *j); +isc_result_t +dns_journal_first_rr(dns_journal_t *j); +isc_result_t +dns_journal_next_rr(dns_journal_t *j); /* * Position the iterator at the first/next RR in a journal * transaction sequence established using dns_journal_iter_init(). @@ -445,8 +454,9 @@ isc_result_t dns_journal_next_rr(dns_journal_t *j); * */ -void dns_journal_current_rr(dns_journal_t *j, dns_name_t **name, - isc_uint32_t *ttl, dns_rdata_t **rdata); +void +dns_journal_current_rr(dns_journal_t *j, dns_name_t **name, isc_uint32_t *ttl, + dns_rdata_t **rdata); /* * Get the name, ttl, and rdata of the current journal RR. * @@ -480,7 +490,8 @@ dns_journal_rollforward(isc_mem_t *mctx, dns_db_t *db, const char *filename); * others */ -isc_result_t dns_journal_print(isc_mem_t *mctx, const char *filename, FILE *file); +isc_result_t +dns_journal_print(isc_mem_t *mctx, const char *filename, FILE *file); /* For debugging not general use */ isc_result_t diff --git a/lib/dns/include/dns/log.h b/lib/dns/include/dns/log.h index 98d610e4a5..4025e34716 100644 --- a/lib/dns/include/dns/log.h +++ b/lib/dns/include/dns/log.h @@ -15,19 +15,18 @@ * SOFTWARE. */ -/* $Id: log.h,v 1.15 2000/04/29 00:45:26 explorer Exp $ */ +/* $Id: log.h,v 1.16 2000/05/01 17:59:09 tale Exp $ */ /* Principal Authors: DCL */ #ifndef DNS_LOG_H #define DNS_LOG_H 1 +#include #include #include -ISC_LANG_BEGINDECLS - extern isc_log_t *dns_lctx; extern isc_logcategory_t dns_categories[]; extern isc_logmodule_t dns_modules[]; @@ -64,6 +63,8 @@ extern isc_logmodule_t dns_modules[]; #define DNS_LOGMODULE_VALIDATOR (&dns_modules[16]) #define DNS_LOGMODULE_DISPATCH (&dns_modules[17]) +ISC_LANG_BEGINDECLS + void dns_log_init(isc_log_t *lctx); /* diff --git a/lib/dns/include/dns/message.h b/lib/dns/include/dns/message.h index 2b8105d76c..4c56547018 100644 --- a/lib/dns/include/dns/message.h +++ b/lib/dns/include/dns/message.h @@ -22,10 +22,11 @@ *** Imports ***/ -#include -#include +#include #include #include +#include +#include #include #include @@ -93,8 +94,6 @@ * move rdata from one section to another, remove rdata, etc. */ -ISC_LANG_BEGINDECLS - #define DNS_MESSAGEFLAG_QR 0x8000U #define DNS_MESSAGEFLAG_AA 0x0400U #define DNS_MESSAGEFLAG_TC 0x0200U @@ -206,9 +205,14 @@ struct dns_message { isc_region_t *saved; }; +/*** + *** Functions + ***/ + +ISC_LANG_BEGINDECLS + isc_result_t -dns_message_create(isc_mem_t *mctx, unsigned int intent, - dns_message_t **msgp); +dns_message_create(isc_mem_t *mctx, unsigned int intent, dns_message_t **msgp); /* * Create msg structure. diff --git a/lib/dns/include/dns/peer.h b/lib/dns/include/dns/peer.h index a9ffccec7c..6c2e5a1cff 100644 --- a/lib/dns/include/dns/peer.h +++ b/lib/dns/include/dns/peer.h @@ -32,6 +32,7 @@ #include +#include #include #include #include @@ -47,13 +48,11 @@ #define DNS_PEERLIST_VALID(ptr) ISC_MAGIC_VALID(ptr, DNS_PEERLIST_MAGIC) #define DNS_PEER_VALID(ptr) ISC_MAGIC_VALID(ptr, DNS_PEER_MAGIC) - /*** *** Types ***/ -struct dns_peerlist -{ +struct dns_peerlist { isc_uint32_t magic; isc_uint32_t refs; @@ -62,9 +61,7 @@ struct dns_peerlist ISC_LIST(dns_peer_t) elements; }; - -struct dns_peer -{ +struct dns_peer { isc_uint32_t magic; isc_uint32_t refs; @@ -84,66 +81,93 @@ struct dns_peer ISC_LINK(dns_peer_t) next; }; - /*** *** Functions ***/ -isc_result_t dns_peerlist_new(isc_mem_t *mem, - dns_peerlist_t **list); -void dns_peerlist_attach(dns_peerlist_t *source, - dns_peerlist_t **target); -void dns_peerlist_detach(dns_peerlist_t **list); +ISC_LANG_BEGINDECLS -/* After return caller still holds a reference to peer. */ -void dns_peerlist_addpeer(dns_peerlist_t *peers, - dns_peer_t *peer); +isc_result_t +dns_peerlist_new(isc_mem_t *mem, dns_peerlist_t **list); -/* ditto */ -isc_result_t dns_peerlist_peerbyaddr(dns_peerlist_t *peers, - isc_netaddr_t *addr, - dns_peer_t **retval); +void +dns_peerlist_attach(dns_peerlist_t *source, dns_peerlist_t **target); -/* what he said. */ -isc_result_t dns_peerlist_currpeer(dns_peerlist_t *peers, - dns_peer_t **retval); +void +dns_peerlist_detach(dns_peerlist_t **list); +/* + * After return caller still holds a reference to peer. + */ +void +dns_peerlist_addpeer(dns_peerlist_t *peers, dns_peer_t *peer); +/* + * Ditto. */ +isc_result_t +dns_peerlist_peerbyaddr(dns_peerlist_t *peers, isc_netaddr_t *addr, + dns_peer_t **retval); -isc_result_t dns_peer_new(isc_mem_t *mem, - isc_netaddr_t *ipaddr, - dns_peer_t **peer); -isc_result_t dns_peer_attach(dns_peer_t *source, dns_peer_t **target); -isc_result_t dns_peer_detach(dns_peer_t **list); +/* + * What he said. + */ +isc_result_t +dns_peerlist_currpeer(dns_peerlist_t *peers, dns_peer_t **retval); -isc_result_t dns_peer_setbogus(dns_peer_t *peer, - isc_boolean_t newval); -isc_result_t dns_peer_getbogus(dns_peer_t *peer, - isc_boolean_t *retval); -isc_result_t dns_peer_setsupportixfr(dns_peer_t *peer, - isc_boolean_t newval); -isc_result_t dns_peer_getsupportixfr(dns_peer_t *peer, - isc_boolean_t *retval); -isc_result_t dns_peer_setrequestixfr(dns_peer_t *peer, - isc_boolean_t newval); -isc_result_t dns_peer_getrequestixfr(dns_peer_t *peer, - isc_boolean_t *retval); -isc_result_t dns_peer_setprovideixfr(dns_peer_t *peer, - isc_boolean_t newval); -isc_result_t dns_peer_getprovideixfr(dns_peer_t *peer, - isc_boolean_t *retval); -isc_result_t dns_peer_settransfers(dns_peer_t *peer, - isc_int32_t newval); -isc_result_t dns_peer_gettransfers(dns_peer_t *peer, - isc_int32_t *retval); -isc_result_t dns_peer_settransferformat(dns_peer_t *peer, - dns_transfer_format_t newval); -isc_result_t dns_peer_gettransferformat(dns_peer_t *peer, - dns_transfer_format_t *retval); -isc_result_t dns_peer_setkeybycharp(dns_peer_t *peer, - const char *keyval); -isc_result_t dns_peer_getkey(dns_peer_t *peer, dns_name_t **retval); -isc_result_t dns_peer_setkey(dns_peer_t *peer, dns_name_t **keyval); +isc_result_t +dns_peer_new(isc_mem_t *mem, isc_netaddr_t *ipaddr, dns_peer_t **peer); +isc_result_t +dns_peer_attach(dns_peer_t *source, dns_peer_t **target); + +isc_result_t +dns_peer_detach(dns_peer_t **list); + +isc_result_t +dns_peer_setbogus(dns_peer_t *peer, isc_boolean_t newval); + +isc_result_t +dns_peer_getbogus(dns_peer_t *peer, isc_boolean_t *retval); + +isc_result_t +dns_peer_setsupportixfr(dns_peer_t *peer, isc_boolean_t newval); + +isc_result_t +dns_peer_getsupportixfr(dns_peer_t *peer, isc_boolean_t *retval); + +isc_result_t +dns_peer_setrequestixfr(dns_peer_t *peer, isc_boolean_t newval); + +isc_result_t +dns_peer_getrequestixfr(dns_peer_t *peer, isc_boolean_t *retval); + +isc_result_t +dns_peer_setprovideixfr(dns_peer_t *peer, isc_boolean_t newval); + +isc_result_t +dns_peer_getprovideixfr(dns_peer_t *peer, isc_boolean_t *retval); + +isc_result_t +dns_peer_settransfers(dns_peer_t *peer, isc_int32_t newval); + +isc_result_t +dns_peer_gettransfers(dns_peer_t *peer, isc_int32_t *retval); + +isc_result_t +dns_peer_settransferformat(dns_peer_t *peer, dns_transfer_format_t newval); + +isc_result_t +dns_peer_gettransferformat(dns_peer_t *peer, dns_transfer_format_t *retval); + +isc_result_t +dns_peer_setkeybycharp(dns_peer_t *peer, const char *keyval); + +isc_result_t +dns_peer_getkey(dns_peer_t *peer, dns_name_t **retval); + +isc_result_t +dns_peer_setkey(dns_peer_t *peer, dns_name_t **keyval); + +ISC_LANG_ENDDECLS #endif /* DNS_PEER_H */