Fast, lightweight, easy-to-extend, easy-to-test, pure JavaScript (ES5.1) implementation for DNS / mDNS.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

17 lines
638 B

(function (exports) {
'use strict';
// Pointer records are the opposite of A and AAAA and are
// used in Reverse Map zone files to map an IP address (IPv4 or IPv6)
// to a host name.
// FORMAT:
// ame ttl class rr name
// 15 IN PTR www.example.com.
var unpackLabels = exports.DNS_UNPACK_LABELS || require('../dns.unpack-labels.js').DNS_UNPACK_LABELS;
exports.DNS_PARSER_TYPE_PTR = function (ab, pack, record) {
record.data = unpackLabels(new Uint8Array(ab), record.rdstart, { byteLength: 0, cpcount: 0, labels: [], name: '' }).name;
return record;
};
}('undefined' !== typeof window ? window : exports));