wire_test.c revision 0c27b3fe77ac1d5094ba3521e8142d9e7973133f
/*
* Copyright (C) 1999-2001, 2004, 2005, 2007, 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/.
*/
#include <config.h>
#include <stdlib.h>
#include <isc/commandline.h>
int parseflags = 0;
static void
static isc_result_t
static inline void
if (result != ISC_R_SUCCESS) {
exit(1);
}
}
static int
fromhex(char c) {
if (c >= '0' && c <= '9')
return (c - '0');
else if (c >= 'a' && c <= 'f')
return (c - 'a' + 10);
else if (c >= 'A' && c <= 'F')
return (c - 'A' + 10);
exit(3);
/* NOTREACHED */
}
static void
usage(void) {
}
static isc_result_t
isc_buffer_t b;
int len = 1024;
do {
break;
}
0, &b);
if (result == ISC_R_NOSPACE) {
len *= 2;
} else if (result == ISC_R_SUCCESS)
} while (result == ISC_R_NOSPACE);
return (result);
}
int
isc_uint8_t c;
FILE *f;
int ch;
#define CMDLINE_FLAGS "bdm:prst"
/*
* Process memory debugging argument first.
*/
switch (ch) {
case 'm':
break;
default:
break;
}
}
switch (ch) {
case 'b':
break;
case 'd':
break;
case 'm':
break;
case 'p':
break;
case 'r':
break;
case 's':
break;
case 't':
break;
default:
usage();
exit(1);
}
}
if (argc >= 1) {
if (f == NULL) {
exit(1);
}
} else
f = stdin;
if (rawdata) {
}
} else {
char s[BUFSIZ];
while (*rp != '\0') {
if (*rp == '#')
break;
len++;
}
rp++;
}
if (len == 0U)
continue;
if (len % 2 != 0U) {
(unsigned long)len);
exit(1);
}
rp = s;
for (i = 0; i < len; i += 2) {
c *= 16;
}
}
}
if (need_close)
fclose(f);
if (tcp) {
while (isc_buffer_remaininglength(input) != 0) {
unsigned int tcplen;
exit(1);
}
exit(1);
}
}
} else
if (printmemstats)
return (0);
}
static void
int i;
if (result == DNS_R_RECOVERABLE)
if (printmemstats)
if (dorender) {
/*
* XXXMLG
* Changing this here is a hack, and should not be done in
* reasonable application code, ever.
*/
for (i = 0; i < DNS_SECTION_MAX; i++)
DNS_SECTION_QUESTION, 0);
"dns_message_rendersection(QUESTION) failed");
DNS_SECTION_ANSWER, 0);
"dns_message_rendersection(ANSWER) failed");
"dns_message_rendersection(AUTHORITY) failed");
"dns_message_rendersection(ADDITIONAL) failed");
printf("Message rendered.\n");
if (printmemstats)
&message);
}
}