From 2e703d7b610e2ecac2e23f1cbb2e456f70ec0d3c Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Tue, 10 Jan 2017 10:40:47 -0800 Subject: [PATCH] [master] expand the flags field in dns_master_style 4550. [cleanup] Increased the number of available master file output style flags from 32 to 64. [RT #44043] --- CHANGES | 3 +++ lib/dns/include/dns/masterdump.h | 37 +++++++++++++++++--------------- lib/dns/include/dns/rdata.h | 10 ++++----- lib/dns/include/dns/types.h | 1 + lib/dns/masterdump.c | 5 +++-- lib/dns/message.c | 3 ++- 6 files changed, 34 insertions(+), 25 deletions(-) diff --git a/CHANGES b/CHANGES index d632a45d80..256f52b9c2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +4550. [cleanup] Increased the number of available master file + output style flags from 32 to 64. [RT #44043] + 4549. [func] Added support for the EDNS TCP Keepalive option (RFC 7828). [RT #42126] diff --git a/lib/dns/include/dns/masterdump.h b/lib/dns/include/dns/masterdump.h index 5b5d6cf4d1..42fc84b166 100644 --- a/lib/dns/include/dns/masterdump.h +++ b/lib/dns/include/dns/masterdump.h @@ -40,7 +40,7 @@ typedef struct dns_master_style dns_master_style_t; */ /*% Omit the owner name when possible. */ -#define DNS_STYLEFLAG_OMIT_OWNER 0x00010000U +#define DNS_STYLEFLAG_OMIT_OWNER 0x000010000ULL /*% * Omit the TTL when possible. If DNS_STYLEFLAG_TTL is @@ -58,53 +58,56 @@ typedef struct dns_master_style dns_master_style_t; * versions of BIND which use the SOA MINTTL as a * default TTL value. */ -#define DNS_STYLEFLAG_OMIT_TTL 0x00020000U +#define DNS_STYLEFLAG_OMIT_TTL 0x000020000ULL /*% Omit the class when possible. */ -#define DNS_STYLEFLAG_OMIT_CLASS 0x00040000U +#define DNS_STYLEFLAG_OMIT_CLASS 0x000040000ULL /*% Output $TTL directives. */ -#define DNS_STYLEFLAG_TTL 0x00080000U +#define DNS_STYLEFLAG_TTL 0x000080000ULL /*% * Output $ORIGIN directives and print owner names relative to * the origin when possible. */ -#define DNS_STYLEFLAG_REL_OWNER 0x00100000U +#define DNS_STYLEFLAG_REL_OWNER 0x000100000ULL /*% Print domain names in RR data in relative form when possible. For this to take effect, DNS_STYLEFLAG_REL_OWNER must also be set. */ -#define DNS_STYLEFLAG_REL_DATA 0x00200000U +#define DNS_STYLEFLAG_REL_DATA 0x000200000ULL /*% Print the trust level of each rdataset. */ -#define DNS_STYLEFLAG_TRUST 0x00400000U +#define DNS_STYLEFLAG_TRUST 0x000400000ULL /*% Print negative caching entries. */ -#define DNS_STYLEFLAG_NCACHE 0x00800000U +#define DNS_STYLEFLAG_NCACHE 0x000800000ULL /*% Never print the TTL. */ -#define DNS_STYLEFLAG_NO_TTL 0x01000000U +#define DNS_STYLEFLAG_NO_TTL 0x001000000ULL /*% Never print the CLASS. */ -#define DNS_STYLEFLAG_NO_CLASS 0x02000000U +#define DNS_STYLEFLAG_NO_CLASS 0x002000000ULL /*% Report re-signing time. */ -#define DNS_STYLEFLAG_RESIGN 0x04000000U +#define DNS_STYLEFLAG_RESIGN 0x004000000ULL /*% Don't printout the cryptographic parts of DNSSEC records. */ -#define DNS_STYLEFLAG_NOCRYPTO 0x08000000U +#define DNS_STYLEFLAG_NOCRYPTO 0x008000000ULL /*% Comment out data by prepending with ";" */ -#define DNS_STYLEFLAG_COMMENTDATA 0x10000000U +#define DNS_STYLEFLAG_COMMENTDATA 0x010000000ULL /*% Print TTL with human-readable units. */ -#define DNS_STYLEFLAG_TTL_UNITS 0x20000000U +#define DNS_STYLEFLAG_TTL_UNITS 0x020000000ULL /*% Indent output. */ -#define DNS_STYLEFLAG_INDENT 0x40000000U +#define DNS_STYLEFLAG_INDENT 0x040000000ULL /*% Output in YAML style. */ -#define DNS_STYLEFLAG_YAML 0x80000000U +#define DNS_STYLEFLAG_YAML 0x080000000ULL + +/*% Print ECS cache entries as comments (reserved for future use). */ +#define DNS_STYLEFLAG_ECSCACHE 0x100000000ULL ISC_LANG_BEGINDECLS @@ -399,7 +402,7 @@ dns_master_dumpnode(isc_mem_t *mctx, dns_db_t *db, dns_dbversion_t *version, dns_dbnode_t *node, const dns_name_t *name, const dns_master_style_t *style, const char *filename); -unsigned int +dns_masterstyle_flags_t dns_master_styleflags(const dns_master_style_t *style); isc_result_t diff --git a/lib/dns/include/dns/rdata.h b/lib/dns/include/dns/rdata.h index 7647230bd9..acedf6d1f4 100644 --- a/lib/dns/include/dns/rdata.h +++ b/lib/dns/include/dns/rdata.h @@ -156,17 +156,17 @@ struct dns_rdata { /*% Split the rdata into multiple lines to try to keep it within the "width". */ -#define DNS_STYLEFLAG_MULTILINE 0x00000001U +#define DNS_STYLEFLAG_MULTILINE 0x00000001ULL /*% Output explanatory comments. */ -#define DNS_STYLEFLAG_COMMENT 0x00000002U -#define DNS_STYLEFLAG_RRCOMMENT 0x00000004U +#define DNS_STYLEFLAG_COMMENT 0x00000002ULL +#define DNS_STYLEFLAG_RRCOMMENT 0x00000004ULL /*% Output KEYDATA in human readable format. */ -#define DNS_STYLEFLAG_KEYDATA 0x00000008U +#define DNS_STYLEFLAG_KEYDATA 0x00000008ULL /*% Output textual RR type and RDATA in RFC 3597 unknown format */ -#define DNS_STYLEFLAG_UNKNOWNFORMAT 0x00000010U +#define DNS_STYLEFLAG_UNKNOWNFORMAT 0x00000010ULL #define DNS_RDATA_DOWNCASE DNS_NAME_DOWNCASE #define DNS_RDATA_CHECKNAMES DNS_NAME_CHECKNAMES diff --git a/lib/dns/include/dns/types.h b/lib/dns/include/dns/types.h index fe0a7a21dd..0cfb5984db 100644 --- a/lib/dns/include/dns/types.h +++ b/lib/dns/include/dns/types.h @@ -95,6 +95,7 @@ typedef isc_uint16_t dns_keytag_t; typedef struct dns_loadctx dns_loadctx_t; typedef struct dns_loadmgr dns_loadmgr_t; typedef struct dns_masterrawheader dns_masterrawheader_t; +typedef isc_uint64_t dns_masterstyle_flags_t; typedef struct dns_message dns_message_t; typedef isc_uint16_t dns_messageid_t; typedef isc_region_t dns_label_t; diff --git a/lib/dns/masterdump.c b/lib/dns/masterdump.c index 18d41a6cd0..6b24c83040 100644 --- a/lib/dns/masterdump.c +++ b/lib/dns/masterdump.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -57,7 +58,7 @@ } while (0) struct dns_master_style { - unsigned int flags; /* DNS_STYLEFLAG_* */ + dns_masterstyle_flags_t flags; /* DNS_STYLEFLAG_* */ unsigned int ttl_column; unsigned int class_column; unsigned int type_column; @@ -2067,7 +2068,7 @@ dns_master_dumpnode(isc_mem_t *mctx, dns_db_t *db, dns_dbversion_t *version, return (result); } -unsigned int +dns_masterstyle_flags_t dns_master_styleflags(const dns_master_style_t *style) { REQUIRE(style != NULL); return (style->flags); diff --git a/lib/dns/message.c b/lib/dns/message.c index d1bb26ec8d..37a9649ded 100644 --- a/lib/dns/message.c +++ b/lib/dns/message.c @@ -3299,7 +3299,8 @@ dns_message_sectiontotext(dns_message_t *msg, dns_section_t section, dns_rdataset_t *rdataset; isc_result_t result = ISC_R_SUCCESS; isc_boolean_t seensoa = ISC_FALSE; - unsigned int sflags, saveindent; + unsigned int saveindent; + dns_masterstyle_flags_t sflags; REQUIRE(DNS_MESSAGE_VALID(msg)); REQUIRE(target != NULL);