ldns_dnssec_rrs *rrs)
{
if (!rrs) {
- fprintf(out, "<void>");
+ if ((fmt->flags & LDNS_COMMENT_LAYOUT))
+ fprintf(out, "; <void>");
} else {
if (rrs->rr) {
ldns_rr_print_fmt(out, fmt, rrs->rr);
bool show_soa)
{
if (!rrsets) {
- fprintf(out, "<void>\n");
+ if ((fmt->flags & LDNS_COMMENT_LAYOUT))
+ fprintf(out, "; <void>\n");
} else {
if (rrsets->rrs &&
(show_soa ||
if(name->rrsets) {
ldns_dnssec_rrsets_print_soa_fmt(out, fmt,
name->rrsets, true, show_soa);
- } else {
+ } else if ((fmt->flags & LDNS_COMMENT_LAYOUT)) {
fprintf(out, ";; Empty nonterminal: ");
ldns_rdf_print(out, name->name);
fprintf(out, "\n");
ldns_dnssec_rrs_print_fmt(out, fmt,
name->nsec_signatures);
}
- } else {
- fprintf(out, "<void>\n");
+ } else if ((fmt->flags & LDNS_COMMENT_LAYOUT)) {
+ fprintf(out, "; <void>\n");
}
}
while (node != LDNS_RBTREE_NULL) {
name = (ldns_dnssec_name *) node->data;
ldns_dnssec_name_print_soa_fmt(out, fmt, name, print_soa);
- fprintf(out, ";\n");
+ if ((fmt->flags & LDNS_COMMENT_LAYOUT))
+ fprintf(out, ";\n");
node = ldns_rbtree_next(node);
}
}
{
if (zone) {
if (zone->soa) {
- fprintf(out, ";; Zone: ");
+ if ((fmt->flags & LDNS_COMMENT_LAYOUT))
+ fprintf(out, ";; Zone: ");
ldns_rdf_print(out,
ldns_dnssec_name_name(zone->soa));
- fprintf(out, "\n;\n");
+ if ((fmt->flags & LDNS_COMMENT_LAYOUT))
+ fprintf(out, "\n;\n");
ldns_dnssec_rrsets_print_fmt(out, fmt,
ldns_dnssec_name_find_rrset(
zone->soa,
LDNS_RR_TYPE_SOA),
false);
- fprintf(out, ";\n");
+ if ((fmt->flags & LDNS_COMMENT_LAYOUT))
+ fprintf(out, ";\n");
}
if (zone->names) {
usage(FILE *fp, const char *prog) {
fprintf(fp, "%s [OPTIONS] zonefile key [key [key]]\n", prog);
fprintf(fp, " signs the zone with the given key(s)\n");
+ fprintf(fp, " -b\t\tuse layout in signed zone and print comments DNSSEC records\n");
fprintf(fp, " -d\t\tused keys are not added to the zone\n");
fprintf(fp, " -e <date>\texpiration date\n");
fprintf(fp, " -f <file>\toutput zone to file (default <name>.signed)\n");
fprintf(fp, "\t\t-t [number] number of hash iterations\n");
fprintf(fp, "\t\t-s [string] salt\n");
fprintf(fp, "\t\t-p set the opt-out flag on all nsec3 rrs\n");
- fprintf(fp, "\t\t-u include the unhashed NSEC3 names as comments "
- "in the zone\n");
fprintf(fp, "\n");
fprintf(fp, " keys must be specified by their base name (usually K<name>+<alg>+<id>),\n");
fprintf(fp, " i.e. WITHOUT the .private extension.\n");
OPENSSL_config(NULL);
- while ((c = getopt(argc, argv, "a:de:f:i:k:lno:ps:t:uvAE:K:")) != -1) {
+ while ((c = getopt(argc, argv, "a:bde:f:i:k:lno:ps:t:vAE:K:")) != -1) {
switch (c) {
case 'a':
nsec3_algorithm = (uint8_t) atoi(optarg);
break;
+ case 'b':
+ fmt.flags |= LDNS_COMMENT_BUBBLEBABBLE;
+ fmt.flags |= LDNS_COMMENT_FLAGS;
+ fmt.flags |= LDNS_COMMENT_NSEC3_CHAIN;
+ fmt.flags |= LDNS_COMMENT_LAYOUT;
+ hashmap = (ldns_rbtree_t **)&fmt.data;
+ break;
case 'd':
add_keys = false;
break;
usage(stderr, prog);
exit(EXIT_FAILURE);
}
-
break;
case 'p':
nsec3_flags = nsec3_flags | LDNS_NSEC3_VARS_OPTOUT_MASK;
}
nsec3_iterations = (uint16_t) nsec3_iterations_cmd;
break;
- case 'u':
- fmt.flags |= LDNS_COMMENT_NSEC3_CHAIN;
- hashmap = (ldns_rbtree_t **)&fmt.data;
- break;
default:
usage(stderr, prog);
exit(EXIT_SUCCESS);
#define LDNS_COMMENT_FLAGS 0x20
/** Show the unhashed owner and next owner names for NSEC3 RR's as comment */
#define LDNS_COMMENT_NSEC3_CHAIN 0x40
+/** Print mark up */
+#define LDNS_COMMENT_LAYOUT 0x80
/**
* Output format specifier