Remove ex-print-zone.c
This commit is contained in:
parent
f267181a1f
commit
eb3104250b
8
Makefile
8
Makefile
@ -24,8 +24,7 @@ LIBOBJ = util.o
|
||||
|
||||
BIN = ldnssec-keygen ldnssec-sign-dnskey
|
||||
MAN1 = ldnssec-keygen.1
|
||||
BINEX = ex-print-zone
|
||||
OBJ = ${BIN:=.o} ${BINEX:=.o} ${LIBOBJ}
|
||||
OBJ = ${BIN:=.o} ${LIBOBJ}
|
||||
SRC = ${OBJ:.o=.c}
|
||||
DIST = COPYING Makefile ${LIBHDR} ${SRC}
|
||||
|
||||
@ -38,10 +37,10 @@ LDNS_LIBS = -L/usr/local/lib -lldns
|
||||
.c.o:
|
||||
${CC} ${CFLAGS} ${LDNS_INCS} -c $<
|
||||
|
||||
all: ${BINEX} ${BIN}
|
||||
all: ${BIN}
|
||||
|
||||
clean:
|
||||
rm -f ${BIN} ${BINEX} ${OBJ} ${P}-${V}.tgz
|
||||
rm -f ${BIN} ${OBJ} ${P}-${V}.tgz
|
||||
|
||||
dist: clean
|
||||
pax -ws ',^,${P}-${V}/,' ${DIST} | gzip >${P}-${V}.tgz
|
||||
@ -62,4 +61,3 @@ util.o: util.h
|
||||
|
||||
ldnssec-keygen: ldnssec-keygen.o ${LIBOBJ}
|
||||
ldnssec-sign-dnskey: ldnssec-sign-dnskey.o ${LIBOBJ}
|
||||
ex-print-zone: ex-print-zone.o ${LIBOBJ}
|
||||
|
@ -1,80 +0,0 @@
|
||||
/*
|
||||
* ldnssec-utils
|
||||
*
|
||||
* Written in 2021 by Lucas
|
||||
*
|
||||
* To the extent possible under law, the author(s) have dedicated all
|
||||
* copyright and related and neighboring rights to this software to the
|
||||
* public domain worldwide. This software is distributed without any
|
||||
* warranty.
|
||||
*
|
||||
* You should have received a copy of the CC0 Public Domain Dedication
|
||||
* along with this software. If not, see
|
||||
* <http://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
*/
|
||||
|
||||
#include <err.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <ldns/ldns.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
static void
|
||||
usage(void)
|
||||
{
|
||||
fprintf(stderr, "usage: %s [-f zone]\n", getprogname());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
ldns_zone *zone;
|
||||
ldns_status s;
|
||||
FILE *fp;
|
||||
char *filename;
|
||||
int ch, line_nr;
|
||||
|
||||
fp = NULL;
|
||||
filename = NULL;
|
||||
while ((ch = getopt(argc, argv, "f:")) != -1) {
|
||||
switch (ch) {
|
||||
case 'f':
|
||||
if (fp != NULL)
|
||||
errx(1, "-f can be used only once");
|
||||
filename = optarg;
|
||||
fp = fopen(filename, "r");
|
||||
if (fp == NULL)
|
||||
err(1, "fopen");
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
}
|
||||
}
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
if (fp == NULL) {
|
||||
filename = "(stdin)";
|
||||
fp = stdin;
|
||||
}
|
||||
|
||||
fatal_check_minimum_ldns_revision();
|
||||
|
||||
s = ldns_zone_new_frm_fp_l(&zone, fp, NULL, LDNS_DEFAULT_TTL,
|
||||
LDNS_RR_CLASS_IN, &line_nr);
|
||||
if (s != LDNS_STATUS_OK)
|
||||
errx(1, "ldns_zone_new_frm_fp_l: file %s line %d: %s",
|
||||
filename, line_nr, ldns_get_errorstr_by_id(s));
|
||||
if (fp != stdin)
|
||||
(void)fclose(fp);
|
||||
|
||||
ldns_zone_print(stdout, zone);
|
||||
|
||||
ldns_zone_deep_free(zone);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user