/*
* Copyright (C) 1998-2001, 2003-2005, 2007, 2009, 2015, 2016 Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* $Id: name_test.c,v 1.43 2009/09/02 23:48:01 tbox Exp $ */
#include <config.h>
#include <stdlib.h>
#include <isc/commandline.h>
#include <dns/fixedname.h>
static void
printf("<empty wire name>\n");
return;
}
printf("\n");
}
static void
isc_region_t r;
char s[1000];
isc_buffer_init(&source, s, sizeof(s));
if (dns_name_countlabels(name) > 0)
else
if (result == ISC_R_SUCCESS) {
isc_buffer_usedregion(&source, &r);
if (r.length > 0)
else
printf("<empty text name>\n");
} else
}
int
char s[1000];
isc_region_t r;
unsigned int downcase = 0;
int ch;
switch (ch) {
case 'a':
break;
case 'c':
break;
case 'd':
break;
case 'i':
break;
case 'q':
break;
case 's':
break;
case 'w':
break;
}
}
if (argc > 0) {
else {
dns_rootname, 0, NULL);
if (result != 0) {
"dns_name_fromtext() failed: %d\n",
result);
exit(1);
}
}
} else if (concatenate)
else
if (argc >= 1) {
else {
0, NULL);
if (result != 0) {
"dns_name_fromtext() failed: %d\n",
result);
exit(1);
}
}
} else
len--;
}
if (len > 0U)
else {
else
}
if (result != ISC_R_SUCCESS) {
else
continue;
}
if (dns_name_isabsolute(name))
printf("absolute\n");
else
printf("relative\n");
}
if (dns_name_iswildcard(name))
printf("wildcard\n");
else
printf("not wildcard\n");
}
dns_name_toregion(name, &r);
if (!quiet) {
print_wirename(&r);
printf("%u labels, %u bytes.\n",
}
if (concatenate) {
if (got_name) {
printf("Concatenating.\n");
NULL);
if (result == ISC_R_SUCCESS) {
if (check_absolute &&
dns_name_countlabels(name) > 0) {
if (dns_name_isabsolute(name))
printf("absolute\n");
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);
printf("%u labels, "
"%u bytes.\n",
r.length);
}
} else
printf("%s\n",
} else
}
isc_buffer_init(&source, s, sizeof(s));
if (dns_name_countlabels(name) > 0)
else
if (result == ISC_R_SUCCESS) {
isc_buffer_usedregion(&source, &r);
if (r.length > 0)
else
printf("<empty text name>\n");
if (!quiet) {
}
} else
if (test_downcase) {
if (inplace) {
} else {
}
if (!quiet) {
dns_name_toregion(down, &r);
print_wirename(&r);
printf("%u labels, %u bytes.\n",
r.length);
}
isc_buffer_init(&source, s, sizeof(s));
}
int order;
unsigned int nlabels;
&nlabels);
if (!quiet) {
if (order < 0)
printf("<");
else if (order > 0)
printf(">");
else
printf("=");
switch (namereln) {
case dns_namereln_contains:
printf(", contains");
break;
case dns_namereln_subdomain:
printf(", subdomain");
break;
printf(", common ancestor");
break;
default:
break;
}
if (namereln != dns_namereln_none &&
printf("\n");
}
printf("dns_name_equal() returns %s\n",
}
printf("\n prefix = ");
printf(" suffix = ");
}
if (concatenate) {
if (got_name)
else
}
}
return (0);
}