Commit 468ff455 authored by Bob Halley's avatar Bob Halley
Browse files

add decompression context

parent 9192e92f
...@@ -29,6 +29,9 @@ ...@@ -29,6 +29,9 @@
#include <dns/types.h> #include <dns/types.h>
#include <dns/result.h> #include <dns/result.h>
#include <dns/name.h> #include <dns/name.h>
#include <dns/compress.h>
dns_decompress_t dctx;
static void static void
print_wirename(isc_region_t *name) { print_wirename(isc_region_t *name) {
...@@ -83,7 +86,7 @@ getname(isc_buffer_t *source) { ...@@ -83,7 +86,7 @@ getname(isc_buffer_t *source) {
isc_buffer_init(&text, c, 255, ISC_BUFFERTYPE_TEXT); isc_buffer_init(&text, c, 255, ISC_BUFFERTYPE_TEXT);
current = source->current; current = source->current;
result = dns_name_fromwire(&name, source, NULL, ISC_FALSE, &target); result = dns_name_fromwire(&name, source, &dctx, ISC_FALSE, &target);
if (result == DNS_R_SUCCESS) { if (result == DNS_R_SUCCESS) {
dns_name_toregion(&name, &r); dns_name_toregion(&name, &r);
...@@ -155,7 +158,10 @@ main(int argc, char *argv[]) { ...@@ -155,7 +158,10 @@ main(int argc, char *argv[]) {
if (need_close) if (need_close)
fclose(f); fclose(f);
dctx.allowed = DNS_COMPRESS_GLOBAL14 | DNS_COMPRESS_GLOBAL16;
dns_name_init(&dctx.owner_name);
isc_buffer_init(&source, b, 255, ISC_BUFFERTYPE_BINARY); isc_buffer_init(&source, b, 255, ISC_BUFFERTYPE_BINARY);
isc_buffer_add(&source, bp - b); isc_buffer_add(&source, bp - b);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment