From 88e6779641b53b81a8f4b37dba99758ca2dcb95b Mon Sep 17 00:00:00 2001 From: dwes7 Date: Wed, 1 Feb 2017 20:37:28 -0700 Subject: [PATCH] finished PTR parser --- dns.type.ptr.js | 5 +++-- samples/aaaa-0.mdns.bin | Bin 0 -> 42 bytes samples/aaaa-1.mdns.bin | Bin 0 -> 42 bytes 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 samples/aaaa-0.mdns.bin create mode 100644 samples/aaaa-1.mdns.bin diff --git a/dns.type.ptr.js b/dns.type.ptr.js index 0fa96b2..87190b7 100644 --- a/dns.type.ptr.js +++ b/dns.type.ptr.js @@ -10,8 +10,9 @@ // ame ttl class rr name // 15 IN PTR www.example.com. -exports.DNS_TYPE_PTR = function (rdata) { - +var unpackLabels = exports.DNS_UNPACK_LABELS || require('./dns.unpack-labels.js').DNS_UNPACK_LABELS; +exports.DNS_TYPE_PTR = function (ab, pack, record) { + return unpackLabels(new Uint8Array(ab), record.rdstart, { byteLength: 0, cpcount: 0, labels: [], name: '' }).name; }; }('undefined' !== typeof window ? window : exports)); diff --git a/samples/aaaa-0.mdns.bin b/samples/aaaa-0.mdns.bin new file mode 100644 index 0000000000000000000000000000000000000000..19d46151e539c42955c10e047715a90c53185825 GIT binary patch literal 42 pcmZ1@%BaA=$N&P2yqN`Nx;gpDi8&eh#U%_3G9U>}0k9+k0|1+`22B6} literal 0 HcmV?d00001 diff --git a/samples/aaaa-1.mdns.bin b/samples/aaaa-1.mdns.bin new file mode 100644 index 0000000000000000000000000000000000000000..8d2457fc51ee8daeadaf198ee32b9a5418fee748 GIT binary patch literal 42 pcmbPl$f&@;$N&P2yqN`Nx;gpDi8&eh#U%_3G9U>}0k9+k0|1^223!CD literal 0 HcmV?d00001