name_test.c revision 4bc30f45a225947a298f706a8522c9d30915d137
/*
* Copyright (C) 1998, 1999 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
#include <config.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <isc/assertions.h>
static void
printf("\n");
}
int
char s[1000];
unsigned char b[255];
unsigned char o[255];
unsigned char c[255];
isc_region_t r;
argc--;
argv++;
if (argc > 0) {
else {
dns_rootname, 0,
&target);
if (result != 0) {
"dns_name_fromtext() failed: %d\n",
result);
exit(1);
}
}
} else
if (argc > 1) {
else {
dns_rootname, 0,
&target);
if (result != 0) {
"dns_name_fromtext() failed: %d\n",
result);
exit(1);
}
}
} else
&target);
if (result == DNS_R_SUCCESS) {
dns_name_toregion(&name, &r);
#ifndef QUIET
print_wirename(&r);
printf("%u labels, %u bytes.\n",
r.length);
#endif
} else
if (result == DNS_R_SUCCESS) {
isc_buffer_init(&source, s, sizeof s,
if (result == DNS_R_SUCCESS) {
isc_buffer_used(&source, &r);
#ifndef QUIET
#endif
} else
}
#ifndef QUIET
int i;
if (i < 0)
printf("<, ");
else if (i > 0)
printf(">, ");
else
printf("=, ");
if (!b)
printf("not ");
printf("subdomain\n");
}
#endif
}
return (0);
}