rdata_test.c revision 5d51e67c3b4f35c1be742574aacc1d88fe6ed444
/*
* Copyright (C) 1998 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 <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <isc/assertions.h>
#include <dns/compress.h>
int
int quiet = 0;
int c;
int stats = 0;
unsigned int options = 0;
unsigned int parens = 0;
int type;
char outbuf[1024];
char inbuf[1024];
char wirebuf[1024];
int need_eol = 0;
int wire = 0;
switch (c) {
case 'q':
quiet = 1;
break;
case 's':
stats = 1;
break;
case 'w':
wire = 1;
break;
}
}
/* Set up to lex DNS master file. */
&token)) == ISC_R_SUCCESS) {
parens++;
options &= ~ISC_LEXOPT_EOL;
if (parens == 0) {
printf("mismatched parens\n");
exit(1);
}
parens--;
if (parens == 0) {
}
}
continue;
}
if (need_eol) {
need_eol = 0;
continue;
}
continue;
if (result != DNS_R_SUCCESS) {
"dns_rdata_fromtext != DNS_R_SUCCESS\n");
need_eol = 1;
continue;
}
/* Convert to wire and back? */
if (wire) {
!= DNS_R_SUCCESS) {
"dns_rdata_towire != DNS_R_SUCCESS\n");
continue;
}
"dns_rdata_fromwire != DNS_R_SUCCESS\n");
continue;
}
}
else
}
return (0);
}