From 2726e20622cf0df3c205fa2356946c6608cd09a4 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 23 Feb 2017 16:40:20 -0700 Subject: [PATCH 1/2] update README.md --- README.md | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7a433bc..deee12f 100644 --- a/README.md +++ b/README.md @@ -48,19 +48,31 @@ Similar API to `dns.js` and `native-dns-packet`. } ``` -Install +Install with git ------- -You can use git to install v1.x (and get updates) or just v1.0.x (and only get patches). -The API will not break until v2. +You can use git to install v1.x like so: ```bash # latest of v1.x npm install 'git+https://git@git.daplie.com:Daplie/dns-suite#v1' ``` -Don't have git? You can bow down to the gods of the centralized, monopolized, concentrated, dictatornet -(as we like to call it here at Daplie Labs): +If you want to be more specific to v1.0.x or exactly v1.0.2 you can do so like this: + +``` +# latest of v1.0.x +npm install 'git+https://git@git.daplie.com:Daplie/dns-suite#v1.0' + +# exactly v1.0.2 +npm install 'git+https://git@git.daplie.com:Daplie/dns-suite#v1.0.2' +``` + +Install without git +------- + +Don't have git? Well you can also bow down to the gods of the centralized, monopolized, concentrated, dictatornet +(as we like to call it here at Daplie Labs), if that's how you roll: ``` npm install --save dns-suite From 4df82c456ed8d0433f4f4fb2d1049c95de753eff Mon Sep 17 00:00:00 2001 From: Daplie Date: Wed, 8 Mar 2017 17:51:41 -0700 Subject: [PATCH 2/2] added NS record packer --- packer/type.ns.js | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 packer/type.ns.js diff --git a/packer/type.ns.js b/packer/type.ns.js new file mode 100644 index 0000000..6c68dcf --- /dev/null +++ b/packer/type.ns.js @@ -0,0 +1,39 @@ +(function (exports) { +'use strict'; + + +// NS name for the supplied domain. May be label, pointer or any combination + +exports.DNS_PACKER_TYPE_NS = function (ab, dv, total, record) { + if(!record.data){ + throw new Error("no data on NS record"); + } + + + var nsLen = 0; + var rdLenIndex = total; + total +=2; + + // RDATA + // a sequence of labels + + record.data.split('.').forEach(function(label) { + nsLen += 1 + label.length; + + dv.setUint8(total, label.length, false); + total += 1; + + label.split('').forEach(function (ch){ + dv.setUint8(total, ch.charCodeAt(0), false); + total += 1; + }); + }); + + // RDLENGTH + dv.setUint16(rdLenIndex, record.data.length + 1, false); + + + return total; +}; + +}('undefined' !== typeof window ? window : exports));