/*
* Copyright (C) 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/.
*/
/*
* Portions of this code were adapted from dnstap-ldns:
*
* Copyright (c) 2014 by Farsight Security, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <config.h>
#include <stdlib.h>
#include <isc/commandline.h>
#include <dns/fixedname.h>
#include <dns/masterdump.h>
if (result != ISC_R_SUCCESS) { \
isc_result_totext(result)); \
goto cleanup; \
} \
} while (0)
ISC_PLATFORM_NORETURN_PRE static void
static void
exit(1);
}
static void
usage(void) {
}
static void
isc_buffer_t *b = NULL;
if (b == NULL)
fatal("out of memory");
(char *) isc_buffer_base(b));
if (b != NULL)
isc_buffer_free(&b);
}
static void
isc_buffer_t *b = NULL;
if (b == NULL)
fatal("out of memory");
for (;;) {
isc_buffer_reserve(&b, textlen);
if (b == NULL)
fatal("out of memory");
if (result == ISC_R_NOSPACE) {
textlen *= 2;
continue;
} else if (result == ISC_R_SUCCESS) {
printf("%.*s",
(int) isc_buffer_usedlength(b),
(char *) isc_buffer_base(b));
isc_buffer_free(&b);
} else {
isc_buffer_free(&b);
}
break;
}
}
if (b != NULL)
isc_buffer_free(&b);
}
static void
return;
if (!first)
printf("---\n");
else
if (frame->has_identity)
if (frame->has_version)
return;
printf("message:\n");
m->type);
return;
}
}
} else
printf(" message_size: 0b\n");
if (m->has_socket_family) {
m->socket_family);
}
if (m->has_query_address) {
}
if (m->has_response_address) {
}
if (m->has_query_port)
if (m->has_response_port)
if (m->has_query_zone) {
isc_buffer_t b;
if (result == ISC_R_SUCCESS) {
printf(" query_zone: ");
printf("\n");
}
}
? "query_message_data"
: "response_message_data");
? "query_message"
: "response_message");
}
};
int
isc_buffer_t *b = NULL;
switch (ch) {
case 'm':
break;
case 'p':
break;
case 'y':
dns_master_indentstr = " ";
dns_master_indent = 2;
break;
default:
usage();
exit(1);
}
}
if (argc < 1)
fatal("no file specified");
"dns_dt_openfile");
for (;;) {
if (result == ISC_R_NOMORE)
break;
else
if (b != NULL)
isc_buffer_free(&b);
if (b == NULL)
fatal("out of memory");
if (result != ISC_R_SUCCESS) {
isc_buffer_free(&b);
continue;
}
if (yaml) {
print_yaml(dt);
} else if (printmessage) {
} else {
}
}
if (b != NULL)
isc_buffer_free(&b);
}