From e8edc20080395468d451c628852a70d575cb89b2 Mon Sep 17 00:00:00 2001 From: dwes7 Date: Wed, 1 Feb 2017 20:32:01 -0700 Subject: [PATCH] NS record type parser complete. --- dns.type.ns.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dns.type.ns.js b/dns.type.ns.js index 47f9acc..b432395 100644 --- a/dns.type.ns.js +++ b/dns.type.ns.js @@ -1,13 +1,15 @@ (function (exports) { 'use strict'; + // Comes in variable lengths. It is the name of the primary Master for the Domain. // For example 'ns1.example.com' // It may be a label, pointer or any combination +var unpackLabels = exports.DNS_UNPACK_LABELS || require('./dns.unpack-labels.js').DNS_UNPACK_LABELS; -exports.DNS_TYPE_NS = function (rdata) { - +exports.DNS_TYPE_NS = function (ab , packet, record) { + return unpackLabels(new Uint8Array(ab), record.rdstart, { byteLength: 0, cpcount: 0, labels: [], name: '' }).name; };