Commit ea4d349e authored by Bob Halley's avatar Bob Halley
Browse files

add dns_name_iswildcard() test

parent 4bf3395d
......@@ -61,9 +61,10 @@ main(int argc, char *argv[]) {
isc_boolean_t concatenate = ISC_FALSE;
isc_boolean_t got_name = ISC_FALSE;
isc_boolean_t check_absolute = ISC_FALSE;
isc_boolean_t check_wildcard = ISC_FALSE;
int ch;
while ((ch = getopt(argc, argv, "acq")) != -1) {
while ((ch = getopt(argc, argv, "acqw")) != -1) {
switch (ch) {
case 'a':
check_absolute = ISC_TRUE;
......@@ -74,6 +75,9 @@ main(int argc, char *argv[]) {
case 'q':
quiet = ISC_TRUE;
break;
case 'w':
check_wildcard = ISC_TRUE;
break;
}
}
......@@ -165,6 +169,12 @@ main(int argc, char *argv[]) {
else
printf("relative\n");
}
if (check_wildcard && dns_name_countlabels(name) > 0) {
if (dns_name_iswildcard(name))
printf("wildcard\n");
else
printf("not wildcard\n");
}
dns_name_toregion(name, &r);
if (!quiet) {
print_wirename(&r);
......@@ -188,6 +198,14 @@ main(int argc, char *argv[]) {
else
printf("relative\n");
}
if (check_wildcard &&
dns_name_countlabels(name) > 0) {
if (dns_name_iswildcard(name))
printf("wildcard\n");
else
printf("not "
"wildcard\n");
}
dns_name_toregion(name, &r);
if (!quiet) {
print_wirename(&r);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment