diff --git a/bin/dnssec/dnssec-signzone.c b/bin/dnssec/dnssec-signzone.c index b299ef9970..7a44377e84 100644 --- a/bin/dnssec/dnssec-signzone.c +++ b/bin/dnssec/dnssec-signzone.c @@ -21,22 +21,20 @@ #include #include -#include -#include #include -#include #include -#include #include #include -#include #include -#include -#include -#include #include #include +#include +#include +#include +#include +#include +#include #include #include #include @@ -44,15 +42,13 @@ #include #include #include -#include -#include #include -#include #include +#include #include -#include #include +#include /*#define USE_ZONESTATUS*/ diff --git a/bin/named/query.c b/bin/named/query.c index 1d06b2c705..82e0d6363f 100644 --- a/bin/named/query.c +++ b/bin/named/query.c @@ -17,15 +17,13 @@ #include -#include #include -#include -#include -#include -#include -#include #include #include +#include +#include +#include +#include #include #include @@ -38,13 +36,14 @@ #include #include #include -#include #include #include #include +#include #include -#include +#include #include +#include #include #include diff --git a/bin/tests/signer.c b/bin/tests/signer.c index b299ef9970..7a44377e84 100644 --- a/bin/tests/signer.c +++ b/bin/tests/signer.c @@ -21,22 +21,20 @@ #include #include -#include -#include #include -#include #include -#include #include #include -#include #include -#include -#include -#include #include #include +#include +#include +#include +#include +#include +#include #include #include #include @@ -44,15 +42,13 @@ #include #include #include -#include -#include #include -#include #include +#include #include -#include #include +#include /*#define USE_ZONESTATUS*/ diff --git a/lib/dns/adb.c b/lib/dns/adb.c index 58ca16b5a4..a56b366e9e 100644 --- a/lib/dns/adb.c +++ b/lib/dns/adb.c @@ -57,6 +57,7 @@ #include #include #include +#include #include #include diff --git a/lib/dns/byaddr.c b/lib/dns/byaddr.c index c90a98c0ab..1df6a15674 100644 --- a/lib/dns/byaddr.c +++ b/lib/dns/byaddr.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include @@ -38,6 +37,7 @@ #include #include #include +#include #include /* diff --git a/lib/dns/cache.c b/lib/dns/cache.c index ef47bc29ef..853be219e6 100644 --- a/lib/dns/cache.c +++ b/lib/dns/cache.c @@ -15,14 +15,12 @@ * SOFTWARE. */ -/* $Id: cache.c,v 1.19 2000/04/28 01:23:49 gson Exp $ */ +/* $Id: cache.c,v 1.20 2000/05/02 03:53:51 tale Exp $ */ #include #include -#include -#include #include #include #include @@ -33,6 +31,7 @@ #include #include #include +#include #include #define CACHE_MAGIC 0x24242424U /* $$$$. */ diff --git a/lib/dns/compress.c b/lib/dns/compress.c index 133698f4a4..34693a30d5 100644 --- a/lib/dns/compress.c +++ b/lib/dns/compress.c @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: compress.c,v 1.29 2000/04/28 01:09:56 halley Exp $ */ +/* $Id: compress.c,v 1.30 2000/05/02 03:53:52 tale Exp $ */ #define DNS_NAME_USEINLINE 1 @@ -30,6 +30,7 @@ #include #include #include +#include #define CCTX_MAGIC 0x43435458U /* CCTX */ #define VALID_CCTX(x) ((x) != NULL && (x)->magic == CCTX_MAGIC) diff --git a/lib/dns/config/confcache.c b/lib/dns/config/confcache.c index 055ac76952..fa8e6c5f3e 100644 --- a/lib/dns/config/confcache.c +++ b/lib/dns/config/confcache.c @@ -15,18 +15,17 @@ * SOFTWARE. */ -/* $Id: confcache.c,v 1.5 2000/03/28 22:58:14 brister Exp $ */ +/* $Id: confcache.c,v 1.6 2000/05/02 03:54:04 tale Exp $ */ #include #include -#include +#include #include "confpvt.h" isc_result_t -dns_c_cache_new(isc_mem_t *mem, dns_c_cache_t **cfgcache) -{ +dns_c_cache_new(isc_mem_t *mem, dns_c_cache_t **cfgcache) { (void) mem ; (void) cfgcache; /* lint */ @@ -35,12 +34,10 @@ dns_c_cache_new(isc_mem_t *mem, dns_c_cache_t **cfgcache) return (ISC_R_SUCCESS); } - isc_result_t -dns_c_cache_delete(dns_c_cache_t **cfgcache) -{ +dns_c_cache_delete(dns_c_cache_t **cfgcache) { (void) cfgcache ; /* lint */ - + /* XXX nothin yet */ return (ISC_R_SUCCESS); diff --git a/lib/dns/config/confresolv.c b/lib/dns/config/confresolv.c index 45b8a6c090..6bb74cc129 100644 --- a/lib/dns/config/confresolv.c +++ b/lib/dns/config/confresolv.c @@ -15,20 +15,21 @@ * SOFTWARE. */ -/* $Id: confresolv.c,v 1.5 2000/03/28 22:58:23 brister Exp $ */ +/* $Id: confresolv.c,v 1.6 2000/05/02 03:54:05 tale Exp $ */ #include -#include -#include +#include +#include +#include #include "confpvt.h" isc_result_t -dns_c_resolv_new(isc_mem_t *mem, dns_c_resolv_t **cfgres) -{ - (void) mem; (void) cfgres; +dns_c_resolv_new(isc_mem_t *mem, dns_c_resolv_t **cfgres) { + UNUSED(mem); + UNUSED(cfgres); /* XXX nothing yet */ @@ -37,9 +38,9 @@ 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) -{ - (void) cfgres; +dns_c_resolv_delete(dns_c_resolv_t **cfgres) { + UNUSED(cfgres); + /* XXX nothin yet */ return (ISC_R_SUCCESS); diff --git a/lib/dns/dbtable.c b/lib/dns/dbtable.c index 1507bdfb9a..e40f3a0a6d 100644 --- a/lib/dns/dbtable.c +++ b/lib/dns/dbtable.c @@ -16,7 +16,7 @@ */ /* - * $Id: dbtable.c,v 1.16 2000/04/19 18:49:10 halley Exp $ + * $Id: dbtable.c,v 1.17 2000/05/02 03:53:52 tale Exp $ */ /* @@ -25,13 +25,13 @@ #include -#include #include #include #include #include #include +#include struct dns_dbtable { /* Unlocked. */ @@ -123,8 +123,7 @@ dns_dbtable_create(isc_mem_t *mctx, dns_rdataclass_t rdclass, static inline void dbtable_free(dns_dbtable_t *dbtable) { /* - * Caller must ensure that it is safe to - * call. + * Caller must ensure that it is safe to call. */ RWLOCK(&dbtable->tree_lock, isc_rwlocktype_write); @@ -216,6 +215,7 @@ dns_dbtable_remove(dns_dbtable_t *dbtable, dns_db_t *db) { * be verified. With the current rbt.c this is expensive to do, * because effectively two find operations are being done, but * deletion is relatively infrequent. + * XXXDCL ... this could be cheaper now with dns_rbt_deletenode. */ RWLOCK(&dbtable->tree_lock, isc_rwlocktype_write); diff --git a/lib/dns/dnssec.c b/lib/dns/dnssec.c index 30e9b48e91..14a22f6ea2 100644 --- a/lib/dns/dnssec.c +++ b/lib/dns/dnssec.c @@ -16,7 +16,7 @@ */ /* - * $Id: dnssec.c,v 1.32 2000/04/28 02:08:26 marka Exp $ + * $Id: dnssec.c,v 1.33 2000/05/02 03:53:52 tale Exp $ * Principal Author: Brian Wellington */ @@ -26,26 +26,24 @@ #include #include -#include #include -#include #include #include -#include #include #include #include #include +#include #include #include #include #include -#include #include +#include #include -#include -#include /* for DNS_TSIG_FUDGE */ +#include +#include /* for DNS_TSIG_FUDGE */ #include #include @@ -68,14 +66,18 @@ typedef struct digestctx { isc_uint8_t type; } digestctx_t; -static isc_result_t digest_callback(void *arg, isc_region_t *data); -static isc_result_t keyname_to_name(char *keyname, isc_mem_t *mctx, - dns_name_t *name); -static int rdata_compare_wrapper(const void *rdata1, const void *rdata2); -static isc_result_t rdataset_to_sortedarray(dns_rdataset_t *set, - isc_mem_t *mctx, - dns_rdata_t **rdata, int *nrdata); +static isc_result_t +digest_callback(void *arg, isc_region_t *data); +static isc_result_t +keyname_to_name(char *keyname, isc_mem_t *mctx, dns_name_t *name); + +static int +rdata_compare_wrapper(const void *rdata1, const void *rdata2); + +static isc_result_t +rdataset_to_sortedarray(dns_rdataset_t *set, isc_mem_t *mctx, + dns_rdata_t **rdata, int *nrdata); static isc_result_t digest_callback(void *arg, isc_region_t *data) { diff --git a/lib/dns/include/dns/a6.h b/lib/dns/include/dns/a6.h index 55691b1071..5be729f234 100644 --- a/lib/dns/include/dns/a6.h +++ b/lib/dns/include/dns/a6.h @@ -23,7 +23,6 @@ #include #include #include -#include #include diff --git a/lib/dns/include/dns/adb.h b/lib/dns/include/dns/adb.h index a3c4e00b54..8babd5ceb9 100644 --- a/lib/dns/include/dns/adb.h +++ b/lib/dns/include/dns/adb.h @@ -22,7 +22,6 @@ ***** Module Info *****/ - /* * DNS Address Database * @@ -80,7 +79,6 @@ #include #include #include -#include #include #include #include diff --git a/lib/dns/include/dns/byaddr.h b/lib/dns/include/dns/byaddr.h index 728b7e37de..d60ea32bb8 100644 --- a/lib/dns/include/dns/byaddr.h +++ b/lib/dns/include/dns/byaddr.h @@ -52,7 +52,6 @@ #include #include -#include ISC_LANG_BEGINDECLS diff --git a/lib/dns/include/dns/cache.h b/lib/dns/include/dns/cache.h index d2de23660a..146e9f1b82 100644 --- a/lib/dns/include/dns/cache.h +++ b/lib/dns/include/dns/cache.h @@ -55,7 +55,6 @@ #include #include -#include ISC_LANG_BEGINDECLS diff --git a/lib/dns/include/dns/confcommon.h b/lib/dns/include/dns/confcommon.h index eef8a9fd50..523f20a744 100644 --- a/lib/dns/include/dns/confcommon.h +++ b/lib/dns/include/dns/confcommon.h @@ -63,7 +63,6 @@ #include #include #include -#include #include #include diff --git a/lib/dns/include/dns/db.h b/lib/dns/include/dns/db.h index 2634c12265..00de7573ee 100644 --- a/lib/dns/include/dns/db.h +++ b/lib/dns/include/dns/db.h @@ -62,7 +62,6 @@ #include #include -#include #include #include diff --git a/lib/dns/include/dns/dbiterator.h b/lib/dns/include/dns/dbiterator.h index 4d99e08a63..ae614f09d5 100644 --- a/lib/dns/include/dns/dbiterator.h +++ b/lib/dns/include/dns/dbiterator.h @@ -65,7 +65,6 @@ #include #include -#include ISC_LANG_BEGINDECLS diff --git a/lib/dns/include/dns/dbtable.h b/lib/dns/include/dns/dbtable.h index 9975bd7562..dbc4837cb1 100644 --- a/lib/dns/include/dns/dbtable.h +++ b/lib/dns/include/dns/dbtable.h @@ -47,7 +47,6 @@ #include #include -#include #include #define DNS_DBTABLEFIND_NOEXACT 0x01 diff --git a/lib/dns/include/dns/dispatch.h b/lib/dns/include/dns/dispatch.h index e91f69fec4..fa09121907 100644 --- a/lib/dns/include/dns/dispatch.h +++ b/lib/dns/include/dns/dispatch.h @@ -56,7 +56,6 @@ #include #include -#include ISC_LANG_BEGINDECLS diff --git a/lib/dns/include/dns/fixedname.h b/lib/dns/include/dns/fixedname.h index be187bd108..237e5ae78a 100644 --- a/lib/dns/include/dns/fixedname.h +++ b/lib/dns/include/dns/fixedname.h @@ -54,7 +54,6 @@ #include #include -#include /***** ***** Types diff --git a/lib/dns/include/dns/journal.h b/lib/dns/include/dns/journal.h index d6afeefe86..e9a8875459 100644 --- a/lib/dns/include/dns/journal.h +++ b/lib/dns/include/dns/journal.h @@ -33,7 +33,6 @@ #include #include -#include #include #include #include diff --git a/lib/dns/include/dns/keytable.h b/lib/dns/include/dns/keytable.h index d3f14ea246..1ae12beb74 100644 --- a/lib/dns/include/dns/keytable.h +++ b/lib/dns/include/dns/keytable.h @@ -42,10 +42,8 @@ #include #include -#include #include -#include #include diff --git a/lib/dns/include/dns/log.h b/lib/dns/include/dns/log.h index 4025e34716..5007c21d37 100644 --- a/lib/dns/include/dns/log.h +++ b/lib/dns/include/dns/log.h @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: log.h,v 1.16 2000/05/01 17:59:09 tale Exp $ */ +/* $Id: log.h,v 1.17 2000/05/02 03:54:08 tale Exp $ */ /* Principal Authors: DCL */ @@ -25,8 +25,6 @@ #include #include -#include - extern isc_log_t *dns_lctx; extern isc_logcategory_t dns_categories[]; extern isc_logmodule_t dns_modules[]; diff --git a/lib/dns/include/dns/master.h b/lib/dns/include/dns/master.h index 00e7d08543..de8a001349 100644 --- a/lib/dns/include/dns/master.h +++ b/lib/dns/include/dns/master.h @@ -27,7 +27,6 @@ #include #include -#include #include #include #include @@ -38,40 +37,43 @@ ISC_LANG_BEGINDECLS *** Function ***/ -isc_result_t dns_master_loadfile(const char *master_file, - dns_name_t *top, - dns_name_t *origin, - dns_rdataclass_t zclass, - isc_boolean_t age_ttl, - int *soacount, - int *nscount, - dns_rdatacallbacks_t *callbacks, - isc_mem_t *mctx); +isc_result_t +dns_master_loadfile(const char *master_file, + dns_name_t *top, + dns_name_t *origin, + dns_rdataclass_t zclass, + isc_boolean_t age_ttl, + int *soacount, + int *nscount, + dns_rdatacallbacks_t *callbacks, + isc_mem_t *mctx); -isc_result_t dns_master_loadstream(FILE *stream, - dns_name_t *top, - dns_name_t *origin, - dns_rdataclass_t zclass, - isc_boolean_t age_ttl, - int *soacount, - int *nscount, - dns_rdatacallbacks_t *callbacks, - isc_mem_t *mctx); +isc_result_t +dns_master_loadstream(FILE *stream, + dns_name_t *top, + dns_name_t *origin, + dns_rdataclass_t zclass, + isc_boolean_t age_ttl, + int *soacount, + int *nscount, + dns_rdatacallbacks_t *callbacks, + isc_mem_t *mctx); -isc_result_t dns_master_loadbuffer(isc_buffer_t *buffer, - dns_name_t *top, - dns_name_t *origin, - dns_rdataclass_t zclass, - isc_boolean_t age_ttl, - int *soacount, - int *nscount, - dns_rdatacallbacks_t *callbacks, - isc_mem_t *mctx); +isc_result_t +dns_master_loadbuffer(isc_buffer_t *buffer, + dns_name_t *top, + dns_name_t *origin, + dns_rdataclass_t zclass, + isc_boolean_t age_ttl, + int *soacount, + int *nscount, + dns_rdatacallbacks_t *callbacks, + isc_mem_t *mctx); /* * Loads a RFC 1305 master file from a file, stream, or buffer into rdatasets - * and then calls 'callbacks->commit' to commit the rdatasets. Rdata memory belongs - * to dns_master_load and will be reused / released when the callback + * and then calls 'callbacks->commit' to commit the rdatasets. Rdata memory + * belongs to dns_master_load and will be reused / released when the callback * completes. dns_load_master will abort if callbacks->commit returns * any value other than ISC_R_SUCCESS. * diff --git a/lib/dns/include/dns/masterdump.h b/lib/dns/include/dns/masterdump.h index f7b433687f..1cee176aa9 100644 --- a/lib/dns/include/dns/masterdump.h +++ b/lib/dns/include/dns/masterdump.h @@ -28,7 +28,6 @@ #include #include -#include #include #include diff --git a/lib/dns/include/dns/message.h b/lib/dns/include/dns/message.h index 4c56547018..df8c270c18 100644 --- a/lib/dns/include/dns/message.h +++ b/lib/dns/include/dns/message.h @@ -29,7 +29,6 @@ #include #include -#include #include #include #include diff --git a/lib/dns/include/dns/name.h b/lib/dns/include/dns/name.h index bce10965c5..afdd709126 100644 --- a/lib/dns/include/dns/name.h +++ b/lib/dns/include/dns/name.h @@ -76,7 +76,6 @@ #include #include -#include #include diff --git a/lib/dns/include/dns/ncache.h b/lib/dns/include/dns/ncache.h index e9ca03a677..553a5b82b9 100644 --- a/lib/dns/include/dns/ncache.h +++ b/lib/dns/include/dns/ncache.h @@ -49,7 +49,6 @@ #include #include -#include ISC_LANG_BEGINDECLS diff --git a/lib/dns/include/dns/nxt.h b/lib/dns/include/dns/nxt.h index f4cb5fe2d2..4c8152c155 100644 --- a/lib/dns/include/dns/nxt.h +++ b/lib/dns/include/dns/nxt.h @@ -20,12 +20,10 @@ #include -#include +#define DNS_NXT_BUFFERSIZE (256 + 16) ISC_LANG_BEGINDECLS -#define DNS_NXT_BUFFERSIZE (256 + 16) - isc_result_t dns_buildnxtrdata(dns_db_t *db, dns_dbversion_t *version, dns_dbnode_t *node, dns_name_t *target, diff --git a/lib/dns/include/dns/rbt.h b/lib/dns/include/dns/rbt.h index 2176c74927..6bd2527a1e 100644 --- a/lib/dns/include/dns/rbt.h +++ b/lib/dns/include/dns/rbt.h @@ -19,7 +19,6 @@ #define DNS_RBT_H 1 #include -#include #include #include diff --git a/lib/dns/include/dns/rdatalist.h b/lib/dns/include/dns/rdatalist.h index 3d568eb41d..3b1e918b12 100644 --- a/lib/dns/include/dns/rdatalist.h +++ b/lib/dns/include/dns/rdatalist.h @@ -46,9 +46,6 @@ #include #include -#include - -ISC_LANG_BEGINDECLS /* * Clients may use this type directly. @@ -62,6 +59,8 @@ struct dns_rdatalist { ISC_LINK(dns_rdatalist_t) link; }; +ISC_LANG_BEGINDECLS + void dns_rdatalist_init(dns_rdatalist_t *rdatalist); /* diff --git a/lib/dns/include/dns/rdataset.h b/lib/dns/include/dns/rdataset.h index 63800b8376..f0cab6d14d 100644 --- a/lib/dns/include/dns/rdataset.h +++ b/lib/dns/include/dns/rdataset.h @@ -56,7 +56,6 @@ #include #include -#include ISC_LANG_BEGINDECLS diff --git a/lib/dns/include/dns/rdatasetiter.h b/lib/dns/include/dns/rdatasetiter.h index e313f059c4..a1d5341f68 100644 --- a/lib/dns/include/dns/rdatasetiter.h +++ b/lib/dns/include/dns/rdatasetiter.h @@ -66,7 +66,6 @@ #include #include -#include ISC_LANG_BEGINDECLS diff --git a/lib/dns/include/dns/request.h b/lib/dns/include/dns/request.h index a43f02e34f..bf97c4bad6 100644 --- a/lib/dns/include/dns/request.h +++ b/lib/dns/include/dns/request.h @@ -44,7 +44,6 @@ #include #include -#include #define DNS_REQUESTOPT_TCP 0x00000001U diff --git a/lib/dns/include/dns/resolver.h b/lib/dns/include/dns/resolver.h index b39887fe42..e405ace453 100644 --- a/lib/dns/include/dns/resolver.h +++ b/lib/dns/include/dns/resolver.h @@ -53,7 +53,6 @@ #include #include #include -#include ISC_LANG_BEGINDECLS @@ -309,7 +308,6 @@ dns_resolver_createfetch(dns_resolver_t *res, dns_name_t *name, * * Many other values are possible, all of which indicate failure. */ - void dns_resolver_cancelfetch(dns_fetch_t *fetch); @@ -343,9 +341,15 @@ dns_resolver_destroyfetch(dns_fetch_t **fetchp); * *fetchp == NULL. */ -dns_dispatch_t * dns_resolver_dispatchv4(dns_resolver_t *resolver); -dns_dispatch_t * dns_resolver_dispatchv6(dns_resolver_t *resolver); -isc_socketmgr_t * dns_resolver_socketmgr(dns_resolver_t *resolver); +dns_dispatch_t * +dns_resolver_dispatchv4(dns_resolver_t *resolver); + +dns_dispatch_t * +dns_resolver_dispatchv6(dns_resolver_t *resolver); + +isc_socketmgr_t * +dns_resolver_socketmgr(dns_resolver_t *resolver); + ISC_LANG_ENDDECLS #endif /* DNS_RESOLVER_H */ diff --git a/lib/dns/include/dns/result.h b/lib/dns/include/dns/result.h index c4a1230668..fe2bc2bc2c 100644 --- a/lib/dns/include/dns/result.h +++ b/lib/dns/include/dns/result.h @@ -19,12 +19,17 @@ #define DNS_RESULT_H 1 #include -#include #include #include -ISC_LANG_BEGINDECLS +/* + * Nothing in this file truly depends on , but the + * DNS result codes are considered to be publicly derived from + * the ISC result codes, so including this file buys you the ISC_R_ + * namespace too. + */ +#include /* * DNS library result codes @@ -115,9 +120,16 @@ ISC_LANG_BEGINDECLS #define DNS_RESULT_ISRCODE(result) \ (ISC_RESULTCLASS_INCLASS(ISC_RESULTCLASS_DNSRCODE, (result))) -char * dns_result_totext(isc_result_t); -void dns_result_register(void); -dns_rcode_t dns_result_torcode(isc_result_t result); +ISC_LANG_BEGINDECLS + +char * +dns_result_totext(isc_result_t); + +void +dns_result_register(void); + +dns_rcode_t +dns_result_torcode(isc_result_t result); ISC_LANG_ENDDECLS diff --git a/lib/dns/include/dns/rootns.h b/lib/dns/include/dns/rootns.h index 87bfa1fb4f..a5cc8302c1 100644 --- a/lib/dns/include/dns/rootns.h +++ b/lib/dns/include/dns/rootns.h @@ -19,15 +19,14 @@ #define DNS_ROOTNS_H 1 #include -#include -#include #include ISC_LANG_BEGINDECLS -isc_result_t dns_rootns_create(isc_mem_t *mctx, dns_rdataclass_t rdclass, - const char *filename, dns_db_t **target); +isc_result_t +dns_rootns_create(isc_mem_t *mctx, dns_rdataclass_t rdclass, + const char *filename, dns_db_t **target); ISC_LANG_ENDDECLS diff --git a/lib/dns/include/dns/validator.h b/lib/dns/include/dns/validator.h index 9fb3bfe2b5..7b5e555179 100644 --- a/lib/dns/include/dns/validator.h +++ b/lib/dns/include/dns/validator.h @@ -45,14 +45,10 @@ * Drafts: */ -#include #include #include #include -#include - -ISC_LANG_BEGINDECLS /* * A dns_validatorevent_t is sent when a 'validation' completes. @@ -72,6 +68,8 @@ typedef struct dns_validatorevent { dns_message_t * message; } dns_validatorevent_t; +ISC_LANG_BEGINDECLS + isc_result_t dns_validator_create(dns_view_t *view, dns_name_t *name, dns_rdatatype_t type, dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset, diff --git a/lib/dns/include/dns/view.h b/lib/dns/include/dns/view.h index 656c25d123..cf6f25a914 100644 --- a/lib/dns/include/dns/view.h +++ b/lib/dns/include/dns/view.h @@ -59,7 +59,6 @@ * Standards: * None. */ -#include #include #include #include @@ -67,7 +66,6 @@ #include #include -#include ISC_LANG_BEGINDECLS diff --git a/lib/dns/include/dns/zone.h b/lib/dns/include/dns/zone.h index 9f73cbc361..87241c6af7 100644 --- a/lib/dns/include/dns/zone.h +++ b/lib/dns/include/dns/zone.h @@ -25,15 +25,13 @@ #include #include #include -#include #include -#include -#include -#include -#include -#include #include +#include +#include +#include +#include typedef enum { dns_zone_none, @@ -57,8 +55,8 @@ ISC_LANG_BEGINDECLS *** Functions ***/ -isc_result_t dns_zone_create(dns_zone_t **zonep, isc_mem_t *mctx); - +isc_result_t +dns_zone_create(dns_zone_t **zonep, isc_mem_t *mctx); /* * Creates a new empty zone and attach to it. * @@ -75,7 +73,8 @@ isc_result_t dns_zone_create(dns_zone_t **zonep, isc_mem_t *mctx); * ISC_R_UNEXPECTED */ -void dns_zone_setclass(dns_zone_t *zone, dns_rdataclass_t rdclass); +void +dns_zone_setclass(dns_zone_t *zone, dns_rdataclass_t rdclass); /* * Sets the class of a zone. This operation can only be performed * once on a zone. @@ -87,7 +86,8 @@ void dns_zone_setclass(dns_zone_t *zone, dns_rdataclass_t rdclass); * 'rdclass' != dns_rdataclass_none. */ -dns_rdataclass_t dns_zone_getclass(dns_zone_t *zone); +dns_rdataclass_t +dns_zone_getclass(dns_zone_t *zone); /* * Returns the current zone class. * @@ -95,7 +95,8 @@ dns_rdataclass_t dns_zone_getclass(dns_zone_t *zone); * 'zone' to be a valid initalised zone. */ -void dns_zone_settype(dns_zone_t *zone, dns_zonetype_t type); +void +dns_zone_settype(dns_zone_t *zone, dns_zonetype_t type); /* * Sets the zone type. This operation can only be performed once on * a zone. @@ -107,7 +108,8 @@ void dns_zone_settype(dns_zone_t *zone, dns_zonetype_t type); * 'type' != dns_zone_none */ -void dns_zone_setview(dns_zone_t *zone, dns_view_t *view); +void +dns_zone_setview(dns_zone_t *zone, dns_view_t *view); /* * Associate the zone with a view. * @@ -115,7 +117,8 @@ void dns_zone_setview(dns_zone_t *zone, dns_view_t *view); * 'zone' to be a valid initalised zone. */ -dns_view_t *dns_zone_getview(dns_zone_t *zone); +dns_view_t * +dns_zone_getview(dns_zone_t *zone); /* * Returns the zone's associated view. * @@ -123,7 +126,8 @@ dns_view_t *dns_zone_getview(dns_zone_t *zone); * 'zone' to be a valid initalised zone. */ -isc_result_t dns_zone_setorigin(dns_zone_t *zone, dns_name_t *origin); +isc_result_t +dns_zone_setorigin(dns_zone_t *zone, dns_name_t *origin); /* * Sets the zones origin to 'origin'. * @@ -136,7 +140,8 @@ isc_result_t dns_zone_setorigin(dns_zone_t *zone, dns_name_t *origin); * ISC_R_NOMEMORY */ -dns_name_t * dns_zone_getorigin(dns_zone_t *zone); +dns_name_t * +dns_zone_getorigin(dns_zone_t *zone); /* * Returns the value of the origin. * @@ -144,7 +149,8 @@ dns_name_t * dns_zone_getorigin(dns_zone_t *zone); * 'zone' to be a valid initalised zone. */ -isc_result_t dns_zone_setdatabase(dns_zone_t *zone, const char *database); +isc_result_t +dns_zone_setdatabase(dns_zone_t *zone, const char *database); /* * Sets the name of the database to be loaded. * For databases loaded from MASTER files this corresponds to the @@ -159,7 +165,8 @@ isc_result_t dns_zone_setdatabase(dns_zone_t *zone, const char *database); * ISC_R_SUCCESS */ -isc_result_t dns_zone_load(dns_zone_t *zone); +isc_result_t +dns_zone_load(dns_zone_t *zone); /* * Cause the database to be loaded from its backing store. * Confirm that the mimimum requirements for the zone type are @@ -175,7 +182,8 @@ isc_result_t dns_zone_load(dns_zone_t *zone); * Any result value from dns_db_load(). */ -void dns_zone_checkservers(dns_zone_t *zone); +void +dns_zone_checkservers(dns_zone_t *zone); /* * Initiate a consistancy check of the zones servers. * XXX MPA to be implemented. @@ -184,7 +192,8 @@ void dns_zone_checkservers(dns_zone_t *zone); * 'zone' to be a valid initalised zone. */ -void dns_zone_checkparents(dns_zone_t *zone); +void +dns_zone_checkparents(dns_zone_t *zone); /* * Initiate a consistancy check of the zone and the parent zone servers. * XXX MPA to be implemented. @@ -193,7 +202,8 @@ void dns_zone_checkparents(dns_zone_t *zone); * 'zone' to be a valid initalised zone. */ -void dns_zone_checkchildren(dns_zone_t *zone); +void +dns_zone_checkchildren(dns_zone_t *zone); /* * Initiate a consistancy check of the child delegations from this zone. * XXX MPA to be implemented. @@ -202,7 +212,8 @@ void dns_zone_checkchildren(dns_zone_t *zone); * 'zone' to be a valid initalised zone. */ -void dns_zone_checkglue(dns_zone_t *zone); +void +dns_zone_checkglue(dns_zone_t *zone); /* * Initiate a consistancy check of the glue records in this zone. * XXX MPA to be implemented. @@ -211,7 +222,8 @@ void dns_zone_checkglue(dns_zone_t *zone); * 'zone' to be a valid initalised zone. */ -void dns_zone_attach(dns_zone_t *source, dns_zone_t **target); +void +dns_zone_attach(dns_zone_t *source, dns_zone_t **target); /* * Attach 'zone' to 'target' incrementing its external * reference count. @@ -221,7 +233,8 @@ void dns_zone_attach(dns_zone_t *source, dns_zone_t **target); * 'target' to be non NULL and '*target' to be NULL. */ -void dns_zone_detach(dns_zone_t **zonep); +void +dns_zone_detach(dns_zone_t **zonep); /* * Detach from a zone decrementing its external reference count. * If this was the last external reference to the zone it will be @@ -231,7 +244,8 @@ void dns_zone_detach(dns_zone_t **zonep); * 'zonep' to point to a valid initalised zone. */ -void dns_zone_iattach(dns_zone_t *source, dns_zone_t **target); +void +dns_zone_iattach(dns_zone_t *source, dns_zone_t **target); /* * Attach 'zone' to 'target' incrementing its internal * reference count. This is intended for use by operations @@ -243,7 +257,8 @@ void dns_zone_iattach(dns_zone_t *source, dns_zone_t **target); * 'target' to be non NULL and '*target' to be NULL. */ -void dns_zone_idetach(dns_zone_t **zonep); +void +dns_zone_idetach(dns_zone_t **zonep); /* * Detach from a zone decrementing its internal reference count. * If there are no more internal or external references to the @@ -253,8 +268,8 @@ void dns_zone_idetach(dns_zone_t **zonep); * 'zonep' to point to a valid initalised zone. */ -void dns_zone_setflag(dns_zone_t *zone, unsigned int flags, - isc_boolean_t value); +void +dns_zone_setflag(dns_zone_t *zone, unsigned int flags, isc_boolean_t value); /* * Sets ('value' == 'ISC_TRUE') / clears ('value' == 'IS_FALSE') * zone flags. Valid flag bits are DNS_ZONE_F_*. @@ -263,7 +278,8 @@ void dns_zone_setflag(dns_zone_t *zone, unsigned int flags, * 'zone' to be a valid initalised zone. */ -isc_result_t dns_zone_adddbarg(dns_zone_t *zone, char *arg); +isc_result_t +dns_zone_adddbarg(dns_zone_t *zone, char *arg); /* * Add 'arg' to the end of the list of database arguements. * No attempt in made to validate the arguements. @@ -277,7 +293,8 @@ isc_result_t dns_zone_adddbarg(dns_zone_t *zone, char *arg); * ISC_R_SUCCESS */ -void dns_zone_cleardbargs(dns_zone_t *zone); +void +dns_zone_cleardbargs(dns_zone_t *zone); /* * Clear all database arguements. * @@ -285,7 +302,8 @@ void dns_zone_cleardbargs(dns_zone_t *zone); * 'zone' to be a valid initalised zone. */ -isc_result_t dns_zone_getdb(dns_zone_t *zone, dns_db_t **dbp); +isc_result_t +dns_zone_getdb(dns_zone_t *zone, dns_db_t **dbp); /* * Attach the database to '*dbp' if it exists otherwise * return DNS_R_NOTLOADED. @@ -299,7 +317,8 @@ isc_result_t dns_zone_getdb(dns_zone_t *zone, dns_db_t **dbp); * DNS_R_NOTLOADED */ -isc_result_t dns_zone_setdbtype(dns_zone_t *zone, char *db_type); +isc_result_t +dns_zone_setdbtype(dns_zone_t *zone, char *db_type); /* * Sets the database type. Current database types are: "rbt", "rbt64". * 'db_type' is not checked to see if it is a valid database type. @@ -313,11 +332,12 @@ isc_result_t dns_zone_setdbtype(dns_zone_t *zone, char *db_type); * ISC_R_SUCCESS */ -void dns_zone_validate(dns_zone_t *zone); +void +dns_zone_validate(dns_zone_t *zone); +/* XXX MPA */ - /* XXX MPA */ - -void dns_zone_expire(dns_zone_t *zone); +void +dns_zone_expire(dns_zone_t *zone); /* * Mark the zone as expired. If the zone requires dumping cause it to * be initiated. Set the refresh and retry intervals to there default @@ -327,7 +347,8 @@ void dns_zone_expire(dns_zone_t *zone); * 'zone' to be a valid initalised zone. */ -void dns_zone_refresh(dns_zone_t *zone); +void +dns_zone_refresh(dns_zone_t *zone); /* * Initiate zone up to date checks. The zone must already be being * managed. @@ -336,7 +357,8 @@ void dns_zone_refresh(dns_zone_t *zone); * 'zone' to be a valid initalised zone. */ -isc_result_t dns_zone_dump(dns_zone_t *zone); +isc_result_t +dns_zone_dump(dns_zone_t *zone); /* * Write the zone to database. * @@ -344,7 +366,8 @@ isc_result_t dns_zone_dump(dns_zone_t *zone); * 'zone' to be a valid initalised zone. */ -isc_result_t dns_zone_dumptostream(dns_zone_t *zone, FILE *fd); +isc_result_t +dns_zone_dumptostream(dns_zone_t *zone, FILE *fd); /* * Write the zone to stream 'fd'. * @@ -353,7 +376,8 @@ isc_result_t dns_zone_dumptostream(dns_zone_t *zone, FILE *fd); * 'fd' to be a stream open for writing. */ -void dns_zone_maintenance(dns_zone_t *zone); +void +dns_zone_maintenance(dns_zone_t *zone); /* * Perform regular maintenace on the zone. This is called as a * result of a zone being managed. @@ -362,8 +386,9 @@ void dns_zone_maintenance(dns_zone_t *zone); * 'zone' to be a valid initalised zone. */ -isc_result_t dns_zone_setmasters(dns_zone_t *zone, isc_sockaddr_t *masters, - isc_uint32_t count); +isc_result_t +dns_zone_setmasters(dns_zone_t *zone, isc_sockaddr_t *masters, + isc_uint32_t count); /* * Add a master server to the end of the set of master servers for * the zone. @@ -380,8 +405,9 @@ isc_result_t dns_zone_setmasters(dns_zone_t *zone, isc_sockaddr_t *masters, * ISC_R_NOMEMORY */ -isc_result_t dns_zone_setnotifyalso(dns_zone_t *zone, isc_sockaddr_t *notify, - isc_uint32_t count); +isc_result_t +dns_zone_setnotifyalso(dns_zone_t *zone, isc_sockaddr_t *notify, + isc_uint32_t count); /* * Add a server to the end of the list of additional servers to be * notified when a zone changes. @@ -398,10 +424,12 @@ isc_result_t dns_zone_setnotifyalso(dns_zone_t *zone, isc_sockaddr_t *notify, * ISC_R_NOMEMORY */ -void dns_zone_unmount(dns_zone_t *zone); +void +dns_zone_unmount(dns_zone_t *zone); /* XXX MPA */ -void dns_zone_unload(dns_zone_t *zone); +void +dns_zone_unload(dns_zone_t *zone); /* * detach the database from the zone structure. * @@ -409,8 +437,8 @@ void dns_zone_unload(dns_zone_t *zone); * 'zone' to be a valid initalised zone. */ -void dns_zone_setoption(dns_zone_t *zone, unsigned int option, - isc_boolean_t value); +void +dns_zone_setoption(dns_zone_t *zone, unsigned int option, isc_boolean_t value); /* * Set given options on ('value' == ISC_TRUE) or off ('value' == * ISC_FALSE). @@ -419,7 +447,8 @@ void dns_zone_setoption(dns_zone_t *zone, unsigned int option, * 'zone' to be a valid initalised zone. */ -void dns_zone_clearoption(dns_zone_t *zone, unsigned int option); +void +dns_zone_clearoption(dns_zone_t *zone, unsigned int option); /* * Clear the given options from the zone and allow system wide value * to be used. @@ -428,7 +457,8 @@ void dns_zone_clearoption(dns_zone_t *zone, unsigned int option); * 'zone' to be a valid initalised zone. */ -unsigned int dns_zone_getoptions(dns_zone_t *zone); +unsigned int +dns_zone_getoptions(dns_zone_t *zone); /* * Return which options a set. * @@ -436,8 +466,9 @@ unsigned int dns_zone_getoptions(dns_zone_t *zone); * 'zone' to be a valid initalised zone. */ -void dns_zone_setrefresh(dns_zone_t *zone, isc_uint32_t refresh, - isc_uint32_t retry); +void +dns_zone_setrefresh(dns_zone_t *zone, isc_uint32_t refresh, + isc_uint32_t retry); /* * Set the refresh and retry values. Normally this are set as a * result of loading the zone (dns_zone_load). @@ -492,7 +523,8 @@ dns_zone_getxfrsource6(dns_zone_t *zone); * 'zone' to be a valid initalised zone. */ -void dns_zone_setqueryacl(dns_zone_t *zone, dns_acl_t *acl); +void +dns_zone_setqueryacl(dns_zone_t *zone, dns_acl_t *acl); /* * Sets the query acl list for the zone. * @@ -501,7 +533,8 @@ void dns_zone_setqueryacl(dns_zone_t *zone, dns_acl_t *acl); * 'acl' to be initalised. */ -void dns_zone_setupdateacl(dns_zone_t *zone, dns_acl_t *acl); +void +dns_zone_setupdateacl(dns_zone_t *zone, dns_acl_t *acl); /* * Sets the update acl list for the zone. * @@ -510,7 +543,8 @@ void dns_zone_setupdateacl(dns_zone_t *zone, dns_acl_t *acl); * 'acl' to be initalised. */ -void dns_zone_setxfracl(dns_zone_t *zone, dns_acl_t *acl); +void +dns_zone_setxfracl(dns_zone_t *zone, dns_acl_t *acl); /* * Sets the transfer acl list for the zone. * @@ -519,7 +553,8 @@ void dns_zone_setxfracl(dns_zone_t *zone, dns_acl_t *acl); * 'acl' to be initalised. */ -dns_acl_t * dns_zone_getqueryacl(dns_zone_t *zone); +dns_acl_t * +dns_zone_getqueryacl(dns_zone_t *zone); /* * Returns the current query acl or NULL. * @@ -531,7 +566,8 @@ dns_acl_t * dns_zone_getqueryacl(dns_zone_t *zone); * NULL */ -dns_acl_t * dns_zone_getupdateacl(dns_zone_t *zone); +dns_acl_t * +dns_zone_getupdateacl(dns_zone_t *zone); /* * Returns the current update acl or NULL. * @@ -543,7 +579,8 @@ dns_acl_t * dns_zone_getupdateacl(dns_zone_t *zone); * NULL */ -dns_acl_t * dns_zone_getxfracl(dns_zone_t *zone); +dns_acl_t * +dns_zone_getxfracl(dns_zone_t *zone); /* * Returns the current transfer acl or NULL. * @@ -555,7 +592,8 @@ dns_acl_t * dns_zone_getxfracl(dns_zone_t *zone); * NULL */ -void dns_zone_clearupdateacl(dns_zone_t *zone); +void +dns_zone_clearupdateacl(dns_zone_t *zone); /* * Clear the current update acl. * @@ -563,7 +601,8 @@ void dns_zone_clearupdateacl(dns_zone_t *zone); * 'zone' to be initalised. */ -void dns_zone_clearqueryacl(dns_zone_t *zone); +void +dns_zone_clearqueryacl(dns_zone_t *zone); /* * Clear the current query acl. * @@ -571,7 +610,8 @@ void dns_zone_clearqueryacl(dns_zone_t *zone); * 'zone' to be initalised. */ -void dns_zone_clearxfracl(dns_zone_t *zone); +void +dns_zone_clearxfracl(dns_zone_t *zone); /* * Clear the current transfer acl. * @@ -579,7 +619,8 @@ void dns_zone_clearxfracl(dns_zone_t *zone); * 'zone' to be initalised. */ -void dns_zone_setchecknames(dns_zone_t *zone, dns_severity_t severity); +void +dns_zone_setchecknames(dns_zone_t *zone, dns_severity_t severity); /* * Set the severity of name checking when loading a zone. * @@ -587,7 +628,8 @@ void dns_zone_setchecknames(dns_zone_t *zone, dns_severity_t severity); * 'zone' to be initalised. */ -dns_severity_t dns_zone_getchecknames(dns_zone_t *zone); +dns_severity_t +dns_zone_getchecknames(dns_zone_t *zone); /* * Return the current severity of name checking. * @@ -595,16 +637,24 @@ dns_severity_t dns_zone_getchecknames(dns_zone_t *zone); * 'zone' to be initalised. */ -void dns_zone_setjournalsize(dns_zone_t *zone, isc_int32_t size); -isc_int32_t dns_zone_getjournalsize(dns_zone_t *zone); +void +dns_zone_setjournalsize(dns_zone_t *zone, isc_int32_t size); -void dns_zone_setresolver(dns_zone_t *zone, dns_resolver_t *resolver); -void dns_zone_setrequestmgr(dns_zone_t *zone, dns_requestmgr_t *requestmgr); -void dns_zone_setadb(dns_zone_t *zone, dns_adb_t *adb); +isc_int32_t +dns_zone_getjournalsize(dns_zone_t *zone); +void +dns_zone_setresolver(dns_zone_t *zone, dns_resolver_t *resolver); -isc_result_t dns_zone_notifyreceive(dns_zone_t *zone, isc_sockaddr_t *from, - dns_message_t *msg); +void +dns_zone_setrequestmgr(dns_zone_t *zone, dns_requestmgr_t *requestmgr); + +void +dns_zone_setadb(dns_zone_t *zone, dns_adb_t *adb); + +isc_result_t +dns_zone_notifyreceive(dns_zone_t *zone, isc_sockaddr_t *from, + dns_message_t *msg); void dns_zone_setmaxxfrin(dns_zone_t *zone, isc_uint32_t maxxfrin); @@ -617,7 +667,8 @@ dns_zone_setmaxxfrin(dns_zone_t *zone, isc_uint32_t maxxfrin); * 'xfrtime' to be non zero. */ -isc_uint32_t dns_zone_getmaxxfrin(dns_zone_t *zone); +isc_uint32_t +dns_zone_getmaxxfrin(dns_zone_t *zone); /* * Returns the maximum transfer time for this zone. This will be * either the value set by the last call to dns_zone_setmaxxfrin() or @@ -638,7 +689,8 @@ dns_zone_setmaxxfrout(dns_zone_t *zone, isc_uint32_t maxxfrout); * 'xfrtime' to be non zero. */ -isc_uint32_t dns_zone_getmaxxfrout(dns_zone_t *zone); +isc_uint32_t +dns_zone_getmaxxfrout(dns_zone_t *zone); /* * Returns the maximum transfer time for this zone. This will be * either the value set by the last call to dns_zone_setmaxxfrout() or @@ -648,8 +700,8 @@ isc_uint32_t dns_zone_getmaxxfrout(dns_zone_t *zone); * 'zone' to be valid initialised zone. */ -isc_result_t dns_zone_setjournal(dns_zone_t *zone, const char *journal); - +isc_result_t +dns_zone_setjournal(dns_zone_t *zone, const char *journal); /* * Sets the filename used for journaling updates / IXFR transfers. * The default journal name is set by dns_zone_setdatabase() to be @@ -664,8 +716,8 @@ isc_result_t dns_zone_setjournal(dns_zone_t *zone, const char *journal); * ISC_R_NOMEMORY */ -char * dns_zone_getjournal(dns_zone_t *zone); - +char * +dns_zone_getjournal(dns_zone_t *zone); /* * Returns the journal name associated with this zone. * If not journal has been set this will be NULL. @@ -674,7 +726,8 @@ char * dns_zone_getjournal(dns_zone_t *zone); * 'zone' to be valid initialised zone. */ -dns_zonetype_t dns_zone_gettype(dns_zone_t *zone); +dns_zonetype_t +dns_zone_gettype(dns_zone_t *zone); /* * Returns the type of the zone (master/slave/etc.) * @@ -703,7 +756,8 @@ dns_zone_gettask(dns_zone_t *zone, isc_task_t **target); * 'target' to be != NULL && '*target' == NULL. */ -const char *dns_zone_getdatabase(dns_zone_t *zone); +const char * +dns_zone_getdatabase(dns_zone_t *zone); /* * Gets the name of the database. For databases loaded from * master files, this corresponds to the file name of the master file. @@ -712,7 +766,8 @@ const char *dns_zone_getdatabase(dns_zone_t *zone); * 'zone' to be valid initialised zone. */ -void dns_zone_notify(dns_zone_t *zone); +void +dns_zone_notify(dns_zone_t *zone); /* * Generate notify events for this zone. * @@ -721,8 +776,7 @@ void dns_zone_notify(dns_zone_t *zone); */ isc_result_t -dns_zone_replacedb(dns_zone_t *zone, dns_db_t *db, - isc_boolean_t dump); +dns_zone_replacedb(dns_zone_t *zone, dns_db_t *db, isc_boolean_t dump); /* * Replace the database of "zone" with a new database "db". * @@ -742,7 +796,6 @@ dns_zone_replacedb(dns_zone_t *zone, dns_db_t *db, isc_boolean_t dns_zone_equal(dns_zone_t *oldzone, dns_zone_t *newzone); - /* * Tests whether the configuration of two zones is equal. * Zone contents and state information is not tested. @@ -809,7 +862,8 @@ dns_zone_getmctx(dns_zone_t *zone); * Get the memory context of a zone. */ -dns_zonemgr_t *dns_zone_getmgr(dns_zone_t *zone); +dns_zonemgr_t * +dns_zone_getmgr(dns_zone_t *zone); isc_result_t dns_zonemgr_create(isc_mem_t *mctx, isc_taskmgr_t *taskmgr, diff --git a/lib/dns/keytable.c b/lib/dns/keytable.c index 58d500cdeb..2293ab0d17 100644 --- a/lib/dns/keytable.c +++ b/lib/dns/keytable.c @@ -20,17 +20,16 @@ #include #include -#include #include #include #include -#include #include #include #include #include #include +#include #include diff --git a/lib/dns/message.c b/lib/dns/message.c index 26d0f7f386..786f076b04 100644 --- a/lib/dns/message.c +++ b/lib/dns/message.c @@ -24,22 +24,22 @@ #include #include -#include #include #include #include #include -#include -#include -#include -#include -#include -#include #include -#include #include #include +#include +#include +#include +#include +#include +#include +#include +#include #include #define DNS_MESSAGE_OPCODE_MASK 0x7800U diff --git a/lib/dns/nxt.c b/lib/dns/nxt.c index 33c863fa85..24e0d81910 100644 --- a/lib/dns/nxt.c +++ b/lib/dns/nxt.c @@ -19,18 +19,18 @@ #include -#include #include -#include -#include #include #include +#include +#include #include +#include #include #include -#include -#include +#include +#include #define check_result(op, msg) \ do { result = (op); \ diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c index baa845e6f2..37589197b7 100644 --- a/lib/dns/rbtdb.c +++ b/lib/dns/rbtdb.c @@ -25,24 +25,23 @@ #include #include -#include -#include #include #include #include -#include -#include -#include #include #include -#include +#include #include -#include +#include +#include +#include #include #include #include -#include +#include +#include +#include #ifdef DNS_RBTDB_VERSION64 #include "rbtdb64.h" diff --git a/lib/dns/request.c b/lib/dns/request.c index 7055bd3347..17ac7ff963 100644 --- a/lib/dns/request.c +++ b/lib/dns/request.c @@ -17,7 +17,6 @@ #include -#include #include #include #include @@ -32,6 +31,7 @@ #include #include #include +#include #define REQUESTMGR_MAGIC 0x5271754dU /* RquM */ #define VALID_REQUESTMGR(mgr) ((mgr) != NULL && \ diff --git a/lib/dns/sec/dst/bsafe_link.c b/lib/dns/sec/dst/bsafe_link.c index a3e0b94e6d..bab993e79e 100644 --- a/lib/dns/sec/dst/bsafe_link.c +++ b/lib/dns/sec/dst/bsafe_link.c @@ -19,7 +19,7 @@ /* * Principal Author: Brian Wellington - * $Id: bsafe_link.c,v 1.14 2000/04/28 01:10:41 halley Exp $ + * $Id: bsafe_link.c,v 1.15 2000/05/02 03:54:14 tale Exp $ */ #include @@ -37,6 +37,8 @@ #include +#include + #include "dst_internal.h" #include "dst_parse.h" diff --git a/lib/dns/sec/dst/dst_internal.h b/lib/dns/sec/dst/dst_internal.h index 28025ba478..9027f71d70 100644 --- a/lib/dns/sec/dst/dst_internal.h +++ b/lib/dns/sec/dst/dst_internal.h @@ -26,7 +26,6 @@ #include "../rename.h" #include -#include ISC_LANG_BEGINDECLS @@ -86,7 +85,9 @@ struct dst_func { extern dst_func *dst_t_func[DST_MAX_ALGS]; -/* suffixes for key file names */ +/* + * Suffixes for key file names. + */ #define PRIVATE_KEY "private" #define PUBLIC_KEY "key" @@ -94,32 +95,42 @@ extern dst_func *dst_t_func[DST_MAX_ALGS]; #define DST_HASH_SIZE 20 /* RIPEMD160 & SHA-1 are 20 bytes, MD5 is 16 */ #endif -void dst_s_hmacmd5_init(void); -void dst_s_bsafersa_init(void); -void dst_s_openssldsa_init(void); -void dst_s_openssldh_init(void); +void +dst_s_hmacmd5_init(void); +void +dst_s_bsafersa_init(void); +void +dst_s_openssldsa_init(void); +void +dst_s_openssldh_init(void); -/* support functions */ +/* + * Support functions. + */ +int +dst_s_calculate_bits(const unsigned char *str, const int max_bits); +isc_uint16_t +dst_s_id_calc(const unsigned char *key, const int keysize); +int +dst_s_build_filename(char *filename, const char *name, isc_uint16_t id, + int alg, const char *suffix, size_t filename_length); -int dst_s_calculate_bits(const unsigned char *str, const int max_bits); -isc_uint16_t dst_s_id_calc(const unsigned char *key, const int keysize); -int dst_s_build_filename(char *filename, const char *name, - isc_uint16_t id, int alg, - const char *suffix, - size_t filename_length); - - -/* digest functions */ -isc_result_t dst_s_md5(const unsigned int mode, void **context, - isc_region_t *data, isc_buffer_t *digest, - isc_mem_t *mctx); - - -/* memory allocators using the DST memory pool */ -void * dst_mem_alloc(size_t size); -void dst_mem_free(void *ptr); -void * dst_mem_realloc(void *ptr, size_t size); +/* + * Digest functions. + */ +isc_result_t +dst_s_md5(const unsigned int mode, void **context, isc_region_t *data, + isc_buffer_t *digest, isc_mem_t *mctx); +/* + * Memory allocators using the DST memory pool. + */ +void * +dst_mem_alloc(size_t size); +void +dst_mem_free(void *ptr); +void * +dst_mem_realloc(void *ptr, size_t size); ISC_LANG_ENDDECLS diff --git a/lib/dns/sec/dst/hmac_link.c b/lib/dns/sec/dst/hmac_link.c index 800cae021c..a986ad04cc 100644 --- a/lib/dns/sec/dst/hmac_link.c +++ b/lib/dns/sec/dst/hmac_link.c @@ -17,7 +17,7 @@ /* * Principal Author: Brian Wellington - * $Id: hmac_link.c,v 1.21 2000/04/28 01:10:46 halley Exp $ + * $Id: hmac_link.c,v 1.22 2000/05/02 03:54:15 tale Exp $ */ #include @@ -34,6 +34,8 @@ #include #include +#include + #include "dst_internal.h" #include "dst_parse.h" @@ -55,36 +57,45 @@ typedef struct hmackey { static struct dst_func hmacmd5_functions; -static isc_result_t dst_hmacmd5_sign(const unsigned int mode, - dst_key_t *key, - void **context, isc_region_t *data, - isc_buffer_t *sig, isc_mem_t *mctx); -static isc_result_t dst_hmacmd5_verify(const unsigned int mode, - dst_key_t *key, - void **context, isc_region_t *data, - isc_region_t *sig, isc_mem_t *mctx); -static isc_boolean_t dst_hmacmd5_compare(const dst_key_t *key1, - const dst_key_t *key2); -static isc_result_t dst_hmacmd5_generate(dst_key_t *key, int exp, - isc_mem_t *mctx); -static isc_boolean_t dst_hmacmd5_isprivate(const dst_key_t *key); -static void dst_hmacmd5_destroy(void *key, isc_mem_t *mctx); -static isc_result_t dst_hmacmd5_to_dns(const dst_key_t *in_key, - isc_buffer_t *data); -static isc_result_t dst_hmacmd5_from_dns(dst_key_t *key, isc_buffer_t *data, - isc_mem_t *mctx); -static isc_result_t dst_hmacmd5_to_file(const dst_key_t *key); -static isc_result_t dst_hmacmd5_from_file(dst_key_t *key, - const isc_uint16_t id, - isc_mem_t *mctx); +static isc_result_t +dst_hmacmd5_sign(const unsigned int mode, dst_key_t *key, + void **context, isc_region_t *data, isc_buffer_t *sig, + isc_mem_t *mctx); + +static isc_result_t +dst_hmacmd5_verify(const unsigned int mode, dst_key_t *key, void **context, + isc_region_t *data, isc_region_t *sig, isc_mem_t *mctx); + +static isc_boolean_t +dst_hmacmd5_compare(const dst_key_t *key1, const dst_key_t *key2); + +static isc_result_t +dst_hmacmd5_generate(dst_key_t *key, int exp, isc_mem_t *mctx); + +static isc_boolean_t +dst_hmacmd5_isprivate(const dst_key_t *key); + +static void +dst_hmacmd5_destroy(void *key, isc_mem_t *mctx); + +static isc_result_t +dst_hmacmd5_to_dns(const dst_key_t *in_key, isc_buffer_t *data); + +static isc_result_t +dst_hmacmd5_from_dns(dst_key_t *key, isc_buffer_t *data, isc_mem_t *mctx); + +static isc_result_t +dst_hmacmd5_to_file(const dst_key_t *key); + +static isc_result_t +dst_hmacmd5_from_file(dst_key_t *key, const isc_uint16_t id, isc_mem_t *mctx); /* * dst_s_hmacmd5_init() * Sets up function pointers for HMAC-MD5 related functions */ void -dst_s_hmacmd5_init() -{ +dst_s_hmacmd5_init() { REQUIRE(dst_t_func[DST_ALG_HMACMD5] == NULL); dst_t_func[DST_ALG_HMACMD5] = &hmacmd5_functions; memset(&hmacmd5_functions, 0, sizeof(struct dst_func)); @@ -243,12 +254,11 @@ dst_hmacmd5_verify(const unsigned int mode, dst_key_t *key, void **context, */ static isc_boolean_t dst_hmacmd5_isprivate(const dst_key_t *key) { - key = key; /* suppress warning */ + UNUSED(key); return (ISC_TRUE); } - /* * dst_hmacmd5_to_dns * Converts key from HMAC to DNS rdata (raw bytes) @@ -259,7 +269,6 @@ dst_hmacmd5_isprivate(const dst_key_t *key) { * ISC_R_SUCCESS Success * !ISC_R_SUCCESS Failure */ - static isc_result_t dst_hmacmd5_to_dns(const dst_key_t *key, isc_buffer_t *data) { HMAC_Key *hkey; @@ -284,7 +293,6 @@ dst_hmacmd5_to_dns(const dst_key_t *key, isc_buffer_t *data) { return (ISC_R_SUCCESS); } - /* * dst_hmacmd5_from_dns * Converts from a DNS KEY RR format to an HMAC-MD5 KEY. @@ -329,7 +337,9 @@ dst_hmacmd5_from_dns(dst_key_t *key, isc_buffer_t *data, isc_mem_t *mctx) { keylen = r.length; } - /* XOR key with ipad and opad values */ + /* + * XOR key with ipad and opad values. + */ for (i = 0; i < HMAC_LEN; i++) { hkey->ipad[i] ^= HMAC_IPAD; hkey->opad[i] ^= HMAC_OPAD; @@ -387,7 +397,6 @@ dst_hmacmd5_to_file(const dst_key_t *key) { * ISC_R_SUCCESS Success * !ISC_R_SUCCESS Failure */ - static isc_result_t dst_hmacmd5_from_file(dst_key_t *key, const isc_uint16_t id, isc_mem_t *mctx) { dst_private_t priv; @@ -432,7 +441,6 @@ dst_hmacmd5_destroy(void *key, isc_mem_t *mctx) { isc_mem_put(mctx, hkey, sizeof(HMAC_Key)); } - /* * dst_hmacmd5_generate * Creates an HMAC-MD5 key. If the specified size is more than 512 @@ -445,7 +453,6 @@ dst_hmacmd5_destroy(void *key, isc_mem_t *mctx) { * ISC_R_SUCCESS Success * !ISC_R_SUCCESS Failure */ - static isc_result_t dst_hmacmd5_generate(dst_key_t *key, int unused, isc_mem_t *mctx) { isc_buffer_t b; @@ -453,7 +460,7 @@ dst_hmacmd5_generate(dst_key_t *key, int unused, isc_mem_t *mctx) { int bytes; unsigned char data[HMAC_LEN]; - unused = unused; /* make the compiler happy */ + UNUSED(unused); bytes = (key->key_size + 7) / 8; if (bytes > 64) { @@ -473,7 +480,6 @@ dst_hmacmd5_generate(dst_key_t *key, int unused, isc_mem_t *mctx) { return (ret); } - /************************************************************************** * dst_hmacmd5_compare * Compare two keys for equality. @@ -485,8 +491,8 @@ static isc_boolean_t dst_hmacmd5_compare(const dst_key_t *key1, const dst_key_t *key2) { HMAC_Key *hkey1, *hkey2; - hkey1 = (HMAC_Key *) key1->opaque; - hkey2 = (HMAC_Key *) key2->opaque; + hkey1 = (HMAC_Key *)key1->opaque; + hkey2 = (HMAC_Key *)key2->opaque; if (hkey1 == NULL && hkey2 == NULL) return (ISC_TRUE); diff --git a/lib/dns/sec/dst/include/dst/dst.h b/lib/dns/sec/dst/include/dst/dst.h index 3741618614..91c12f09a9 100644 --- a/lib/dns/sec/dst/include/dst/dst.h +++ b/lib/dns/sec/dst/include/dst/dst.h @@ -8,8 +8,6 @@ #include #include -#include - ISC_LANG_BEGINDECLS /*** @@ -59,13 +57,17 @@ typedef void * dst_context_t; *** Functions ***/ +isc_boolean_t +dst_supported_algorithm(const int alg); /* * Check that a given algorithm is supported */ -isc_boolean_t -dst_supported_algorithm(const int alg); -/* Sign a block of data. +isc_result_t +dst_sign(const unsigned int mode, dst_key_t *key, dst_context_t *context, + isc_region_t *data, isc_buffer_t *sig); +/* + * Sign a block of data. * * Requires: * "mode" is some combination of DST_SIGMODE_INIT, DST_SIGMODE_UPDATE, @@ -79,11 +81,12 @@ dst_supported_algorithm(const int alg); * All allocated memory will be freed after the FINAL call. "sig" * will contain a signature if all operations completed successfully. */ -isc_result_t -dst_sign(const unsigned int mode, dst_key_t *key, dst_context_t *context, - isc_region_t *data, isc_buffer_t *sig); -/* Verify a signature on a block of data. +isc_result_t +dst_verify(const unsigned int mode, dst_key_t *key, dst_context_t *context, + isc_region_t *data, isc_region_t *sig); +/* + * Verify a signature on a block of data. * * Requires: * "mode" is some combination of DST_SIGMODE_INIT, DST_SIGMODE_UPDATE, @@ -96,11 +99,12 @@ dst_sign(const unsigned int mode, dst_key_t *key, dst_context_t *context, * Ensures: * All allocated memory will be freed after the FINAL call. */ -isc_result_t -dst_verify(const unsigned int mode, dst_key_t *key, dst_context_t *context, - isc_region_t *data, isc_region_t *sig); -/* Digest a block of data. +isc_result_t +dst_digest(const unsigned int mode, const unsigned int alg, + dst_context_t *context, isc_region_t *data, isc_buffer_t *digest); +/* + * Digest a block of data. * * Requires: * "mode" is some combination of DST_SIGMODE_INIT, DST_SIGMODE_UPDATE, @@ -114,27 +118,27 @@ dst_verify(const unsigned int mode, dst_key_t *key, dst_context_t *context, * All allocated memory will be freed after the FINAL call. "digest" * will contain a digest if all operations completed successfully. */ -isc_result_t -dst_digest(const unsigned int mode, const unsigned int alg, - dst_context_t *context, isc_region_t *data, isc_buffer_t *digest); +isc_result_t +dst_computesecret(const dst_key_t *pub, const dst_key_t *priv, + isc_buffer_t *secret); /* - * dst_computesecret - * A function to compute a shared secret from two (Diffie-Hellman) keys. + * A function to compute a shared secret from two (Diffie-Hellman) keys. * * Requires: - * "pub" is a valid key that can be used to derive a shared secret - * "priv" is a valid private key that can be used to derive a shared secret - * "secret" is a valid buffer + * "pub" is a valid key that can be used to derive a shared secret + * "priv" is a valid private key that can be used to derive a shared secret + * "secret" is a valid buffer * * Ensures: * If successful, secret will contain the derived shared secret. */ -isc_result_t -dst_computesecret(const dst_key_t *pub, const dst_key_t *priv, - isc_buffer_t *secret); -/* Reads a key from permanent storage. +isc_result_t +dst_key_fromfile(const char *name, const isc_uint16_t id, const int alg, + const int type, isc_mem_t *mctx, dst_key_t **keyp); +/* + * Reads a key from permanent storage. * * Requires: * "name" is not NULL. @@ -147,20 +151,22 @@ dst_computesecret(const dst_key_t *pub, const dst_key_t *priv, * Ensures: * If successful, *keyp will contain a valid key. */ -isc_result_t -dst_key_fromfile(const char *name, const isc_uint16_t id, const int alg, - const int type, isc_mem_t *mctx, dst_key_t **keyp); -/* Writes a key to permanent storage. +isc_result_t +dst_key_tofile(const dst_key_t *key, const int type); +/* + * Writes a key to permanent storage. * * Requires: * "key" is a valid key. * "type" is either DST_TYPE_PUBLIC, DST_TYPE_PRIVATE, or both. */ -isc_result_t -dst_key_tofile(const dst_key_t *key, const int type); -/* Converts a DNS KEY record into a DST key. +isc_result_t +dst_key_fromdns(const char *name, isc_buffer_t *source, isc_mem_t *mctx, + dst_key_t **keyp); +/* + * Converts a DNS KEY record into a DST key. * * Requires: * "name" is not NULL. @@ -172,11 +178,11 @@ dst_key_tofile(const dst_key_t *key, const int type); * If successful, *keyp will contain a valid key, and the consumed * pointer in data will be advanced. */ -isc_result_t -dst_key_fromdns(const char *name, isc_buffer_t *source, isc_mem_t *mctx, - dst_key_t **keyp); -/* Converts a DST key into a DNS KEY record. +isc_result_t +dst_key_todns(const dst_key_t *key, isc_buffer_t *target); +/* + * Converts a DST key into a DNS KEY record. * * Requires: * "key" is a valid key. @@ -185,10 +191,13 @@ dst_key_fromdns(const char *name, isc_buffer_t *source, isc_mem_t *mctx, * Ensures: * If successful, the used pointer in 'target' is advanced by at least 4. */ -isc_result_t -dst_key_todns(const dst_key_t *key, isc_buffer_t *target); -/* Converts a buffer containing DNS KEY RDATA into a DST key. +isc_result_t +dst_key_frombuffer(const char *name, const int alg, const int flags, + const int protocol, isc_buffer_t *source, isc_mem_t *mctx, + dst_key_t **keyp); +/* + * Converts a buffer containing DNS KEY RDATA into a DST key. * * Requires: * "name" is not NULL. @@ -201,12 +210,11 @@ dst_key_todns(const dst_key_t *key, isc_buffer_t *target); * If successful, *keyp will contain a valid key, and the consumed * pointer in source will be advanced. */ -isc_result_t -dst_key_frombuffer(const char *name, const int alg, const int flags, - const int protocol, isc_buffer_t *source, isc_mem_t *mctx, - dst_key_t **keyp); -/* Converts a DST key into DNS KEY RDATA format. +isc_result_t +dst_key_tobuffer(const dst_key_t *key, isc_buffer_t *target); +/* + * Converts a DST key into DNS KEY RDATA format. * * Requires: * "key" is a valid key. @@ -215,10 +223,13 @@ dst_key_frombuffer(const char *name, const int alg, const int flags, * Ensures: * If successful, the used pointer in 'target' is advanced. */ -isc_result_t -dst_key_tobuffer(const dst_key_t *key, isc_buffer_t *target); -/* Generate a DST key (or keypair) +isc_result_t +dst_key_generate(const char *name, const int alg, const int bits, + const int param, const int flags, const int protocol, + isc_mem_t *mctx, dst_key_t **keyp); +/* + * Generate a DST key (or keypair) * * Requires: * "name" is not NULL @@ -229,30 +240,31 @@ dst_key_tobuffer(const dst_key_t *key, isc_buffer_t *target); * Ensures: * If successful, *keyp will contain a valid key. */ -isc_result_t -dst_key_generate(const char *name, const int alg, const int bits, - const int param, const int flags, const int protocol, - isc_mem_t *mctx, dst_key_t **keyp); -/* Compares two DST keys. - * - * Requires: - * "key1" is a valid key. - * "key2" is a valid key. - */ isc_boolean_t dst_key_compare(const dst_key_t *key1, const dst_key_t *key2); - -/* Compares the parameters of two DST keys. +/* + * Compares two DST keys. * * Requires: * "key1" is a valid key. * "key2" is a valid key. */ + isc_boolean_t dst_key_paramcompare(const dst_key_t *key1, const dst_key_t *key2); +/* + * Compares the parameters of two DST keys. + * + * Requires: + * "key1" is a valid key. + * "key2" is a valid key. + */ -/* Free a DST key. +void +dst_key_free(dst_key_t *key); +/* + * Free a DST key. * * Requires: * "key" is a valid key. @@ -260,10 +272,9 @@ dst_key_paramcompare(const dst_key_t *key1, const dst_key_t *key2); * Ensures: * All memory associated with "key" will be freed. */ -void -dst_key_free(dst_key_t *key); -/* Accessor functions to obtain key fields. +/* + * Accessor functions to obtain key fields. * * Require: * "key" is a valid key. @@ -295,20 +306,10 @@ dst_key_iszonekey(const dst_key_t *key); isc_boolean_t dst_key_isnullkey(const dst_key_t *key); -/* Computes the size of a signature generated by the given key. - * - * Requires: - * "key" is a valid key. - * "n" is not NULL - * - * Returns: - * ISC_R_SUCCESS - * DST_R_UNSUPPORTEDALG - */ isc_result_t dst_sig_size(const dst_key_t *key, unsigned int *n); - -/* Computes the size of a shared secret generated by the given key. +/* + * Computes the size of a signature generated by the given key. * * Requires: * "key" is a valid key. @@ -318,10 +319,25 @@ dst_sig_size(const dst_key_t *key, unsigned int *n); * ISC_R_SUCCESS * DST_R_UNSUPPORTEDALG */ + isc_result_t dst_secret_size(const dst_key_t *key, unsigned int *n); +/* + * Computes the size of a shared secret generated by the given key. + * + * Requires: + * "key" is a valid key. + * "n" is not NULL + * + * Returns: + * ISC_R_SUCCESS + * DST_R_UNSUPPORTEDALG + */ -/* Generate random data. +isc_result_t +dst_random_get(const unsigned int wanted, isc_buffer_t *data); +/* + * Generate random data. * * Requires: * "data" is a valid buffer, with at least "wanted" bytes available. @@ -330,8 +346,6 @@ dst_secret_size(const dst_key_t *key, unsigned int *n); * <= wanted bytes will be written to "data", and the used pointer will * be advanced. */ -isc_result_t -dst_random_get(const unsigned int wanted, isc_buffer_t *data); ISC_LANG_ENDDECLS diff --git a/lib/dns/sec/dst/include/dst/result.h b/lib/dns/sec/dst/include/dst/result.h index 50bf49304d..37e13416b2 100644 --- a/lib/dns/sec/dst/include/dst/result.h +++ b/lib/dns/sec/dst/include/dst/result.h @@ -19,10 +19,15 @@ #define DST_RESULT_H 1 #include -#include #include -ISC_LANG_BEGINDECLS +/* + * Nothing in this file truly depends on , but the + * DST result codes are considered to be publicly derived from + * the ISC result codes, so including this file buys you the ISC_R_ + * namespace too. + */ +#include #define DST_R_UNSUPPORTEDALG (ISC_RESULTCLASS_DST + 0) #define DST_R_UNSUPPORTEDTYPE (ISC_RESULTCLASS_DST + 1) @@ -47,9 +52,13 @@ ISC_LANG_BEGINDECLS #define DST_R_NRESULTS 20 /* Number of results */ +ISC_LANG_BEGINDECLS -char * dst_result_totext(isc_result_t); -void dst_result_register(void); +char * +dst_result_totext(isc_result_t); + +void +dst_result_register(void); ISC_LANG_ENDDECLS diff --git a/lib/dns/sec/dst/openssl_link.c b/lib/dns/sec/dst/openssl_link.c index 3252413ba9..a25a3c5610 100644 --- a/lib/dns/sec/dst/openssl_link.c +++ b/lib/dns/sec/dst/openssl_link.c @@ -19,7 +19,7 @@ /* * Principal Author: Brian Wellington - * $Id: openssl_link.c,v 1.17 2000/04/28 01:10:48 halley Exp $ + * $Id: openssl_link.c,v 1.18 2000/05/02 03:54:15 tale Exp $ */ #include @@ -36,6 +36,8 @@ #include #include +#include + #include "dst_internal.h" #include "dst_parse.h" @@ -46,32 +48,40 @@ static struct dst_func openssl_functions; -static isc_result_t dst_openssl_sign(const unsigned int mode, - dst_key_t *key, - void **context, isc_region_t *data, - isc_buffer_t *sig, isc_mem_t *mctx); -static isc_result_t dst_openssl_verify(const unsigned int mode, - dst_key_t *key, - void **context, isc_region_t *data, - isc_region_t *sig, isc_mem_t *mctx); -static isc_boolean_t dst_openssl_compare(const dst_key_t *key1, - const dst_key_t *key2); -static isc_result_t dst_openssl_generate(dst_key_t *key, int unused, - isc_mem_t *mctx); -static isc_boolean_t dst_openssl_isprivate(const dst_key_t *key); -static void dst_openssl_destroy(void *key, isc_mem_t *mctx); -static isc_result_t dst_openssl_to_dns(const dst_key_t *in_key, - isc_buffer_t *data); -static isc_result_t dst_openssl_from_dns(dst_key_t *key, isc_buffer_t *data, - isc_mem_t *mctx); -static isc_result_t dst_openssl_to_file(const dst_key_t *key); -static isc_result_t dst_openssl_from_file(dst_key_t *key, - const isc_uint16_t id, - isc_mem_t *mctx); +static isc_result_t +dst_openssl_sign(const unsigned int mode, dst_key_t *key, void **context, + isc_region_t *data, isc_buffer_t *sig, isc_mem_t *mctx); -static int BN_bn2bin_fixed(BIGNUM *bn, unsigned char *buf, - int size); +static isc_result_t +dst_openssl_verify(const unsigned int mode, dst_key_t *key, void **context, + isc_region_t *data, isc_region_t *sig, isc_mem_t *mctx); +static isc_boolean_t +dst_openssl_compare(const dst_key_t *key1, const dst_key_t *key2); + +static isc_result_t +dst_openssl_generate(dst_key_t *key, int unused, isc_mem_t *mctx); + +static isc_boolean_t +dst_openssl_isprivate(const dst_key_t *key); + +static void +dst_openssl_destroy(void *key, isc_mem_t *mctx); + +static isc_result_t +dst_openssl_to_dns(const dst_key_t *in_key, isc_buffer_t *data); + +static isc_result_t +dst_openssl_from_dns(dst_key_t *key, isc_buffer_t *data, isc_mem_t *mctx); + +static isc_result_t +dst_openssl_to_file(const dst_key_t *key); + +static isc_result_t +dst_openssl_from_file(dst_key_t *key, const isc_uint16_t id, isc_mem_t *mctx); + +static int +BN_bn2bin_fixed(BIGNUM *bn, unsigned char *buf, int size); /* * dst_s_openssldsa_init() @@ -620,4 +630,4 @@ BN_bn2bin_fixed(BIGNUM *bn, unsigned char *buf, int size) { return (size); } -#endif +#endif /* OPENSSL */ diff --git a/lib/dns/sec/dst/openssldh_link.c b/lib/dns/sec/dst/openssldh_link.c index 214c6af3c7..585f046b7c 100644 --- a/lib/dns/sec/dst/openssldh_link.c +++ b/lib/dns/sec/dst/openssldh_link.c @@ -19,7 +19,7 @@ /* * Principal Author: Brian Wellington - * $Id: openssldh_link.c,v 1.10 2000/04/28 01:10:49 halley Exp $ + * $Id: openssldh_link.c,v 1.11 2000/05/02 03:54:16 tale Exp $ */ #include @@ -38,6 +38,8 @@ #include #include +#include + #include "dst_internal.h" #include "dst_parse.h" @@ -687,4 +689,4 @@ BN_fromhex(BIGNUM *b, const char *str) { RUNTIME_CHECK(out != NULL); } -#endif +#endif /* OPENSSL */ diff --git a/lib/dns/tkey.c b/lib/dns/tkey.c index be86cd0f4d..52806d35df 100644 --- a/lib/dns/tkey.c +++ b/lib/dns/tkey.c @@ -16,24 +16,19 @@ */ /* - * $Id: tkey.c,v 1.31 2000/04/28 02:08:29 marka Exp $ + * $Id: tkey.c,v 1.32 2000/05/02 03:53:57 tale Exp $ * Principal Author: Brian Wellington */ - #include #include #include -#include #include -#include -#include #include #include #include -#include #include #include #include @@ -47,6 +42,7 @@ #include #include #include +#include #include #include diff --git a/lib/dns/tsig.c b/lib/dns/tsig.c index c773438354..c520a9949b 100644 --- a/lib/dns/tsig.c +++ b/lib/dns/tsig.c @@ -16,35 +16,31 @@ */ /* - * $Id: tsig.c,v 1.53 2000/04/28 01:10:22 halley Exp $ + * $Id: tsig.c,v 1.54 2000/05/02 03:53:58 tale Exp $ * Principal Author: Brian Wellington */ - #include #include #include -#include #include -#include -#include #include #include -#include #include #include #include #include #include -#include #include +#include #include #include #include #include +#include #include #include diff --git a/lib/dns/validator.c b/lib/dns/validator.c index ce634abb76..7039c969cc 100644 --- a/lib/dns/validator.c +++ b/lib/dns/validator.c @@ -17,17 +17,14 @@ #include -#include #include #include #include #include -#include #include #include #include -#include #include #include #include @@ -38,9 +35,11 @@ #include #include #include -#include #include +#include #include +#include +#include #include #include diff --git a/lib/dns/view.c b/lib/dns/view.c index c5d25505f6..880885d4ab 100644 --- a/lib/dns/view.c +++ b/lib/dns/view.c @@ -19,28 +19,25 @@ #include -#include -#include #include -#include -#include #include -#include #include #include #include -#include #include +#include #include #include #include #include #include #include -#include #include +#include +#include #include +#include #include #include #include diff --git a/lib/dns/zone.c b/lib/dns/zone.c index aaca815408..d8a1855b1c 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -15,24 +15,22 @@ * SOFTWARE. */ -/* $Id: zone.c,v 1.104 2000/04/28 17:18:19 marka Exp $ */ +/* $Id: zone.c,v 1.105 2000/05/02 03:54:01 tale Exp $ */ #include #include #include -#include -#include +#include #include #include +#include #include #include -#include #include #include #include -#include #include #include @@ -51,8 +49,9 @@ #include #include #include -#include #include +#include +#include #include #include #include diff --git a/lib/dns/zt.c b/lib/dns/zt.c index c09741c965..b67614f811 100644 --- a/lib/dns/zt.c +++ b/lib/dns/zt.c @@ -17,13 +17,12 @@ #include -#include #include #include -#include #include #include +#include #include #include diff --git a/lib/omapi/auth.c b/lib/omapi/auth.c index 45d08d7787..c6dc9ba4d6 100644 --- a/lib/omapi/auth.c +++ b/lib/omapi/auth.c @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: auth.c,v 1.4 2000/04/28 02:08:15 tale Exp $ */ +/* $Id: auth.c,v 1.5 2000/05/02 03:54:17 tale Exp $ */ /* Principal Author: DCL */ @@ -44,6 +44,8 @@ #include #include +#include + #include typedef struct auth auth_t; diff --git a/lib/omapi/protocol.c b/lib/omapi/protocol.c index 331aba4a86..fc71d1c064 100644 --- a/lib/omapi/protocol.c +++ b/lib/omapi/protocol.c @@ -25,8 +25,9 @@ #include /* random */ #include /* memset */ -#include -#include +#include + +#include #include