|
@ -31,13 +31,17 @@ pdns.unpackHeader = function (i) { |
|
|
|
|
|
|
|
|
pdns._unpackLabels = exports.DNS_UNPACK_LABELS || require('./dns.unpack-labels.js').DNS_UNPACK_LABELS; |
|
|
pdns._unpackLabels = exports.DNS_UNPACK_LABELS || require('./dns.unpack-labels.js').DNS_UNPACK_LABELS; |
|
|
|
|
|
|
|
|
|
|
|
var optWarned = false; |
|
|
pdns.unpackOpt = function (ab, packet, rec) { |
|
|
pdns.unpackOpt = function (ab, packet, rec) { |
|
|
var dv; |
|
|
var dv; |
|
|
|
|
|
|
|
|
// https://tools.ietf.org/html/rfc6891#section-6
|
|
|
// https://tools.ietf.org/html/rfc6891#section-6
|
|
|
console.log('OPT is not yet supported'); |
|
|
if (!optWarned) { |
|
|
|
|
|
console.warn('OPT is not yet supported'); |
|
|
|
|
|
optWarned = true; |
|
|
|
|
|
} |
|
|
if ('undefined' !== typeof packet.edns_version) { |
|
|
if ('undefined' !== typeof packet.edns_version) { |
|
|
console.warn("More that one OPT, should respond with FORMERR, but not implmentede"); |
|
|
console.warn("More that one OPT, should respond with FORMERR, but not implemented"); |
|
|
} |
|
|
} |
|
|
if (packet.name) { |
|
|
if (packet.name) { |
|
|
console.warn("name '" + packet.name + "' should not exist for type OPT 0x29 41"); |
|
|
console.warn("name '" + packet.name + "' should not exist for type OPT 0x29 41"); |
|
@ -60,11 +64,11 @@ pdns.unpackOpt = function (ab, packet, rec) { |
|
|
packet.edns_version = dv.getUint8(1, false); |
|
|
packet.edns_version = dv.getUint8(1, false); |
|
|
packet.do = dv.getUint8(2, false) & 0x8000; // 1000 0000
|
|
|
packet.do = dv.getUint8(2, false) & 0x8000; // 1000 0000
|
|
|
packet.z = dv.getUint16(2, false) & 0x7FFF; // 0111 1111
|
|
|
packet.z = dv.getUint16(2, false) & 0x7FFF; // 0111 1111
|
|
|
/* |
|
|
/* |
|
|
"edns_options": [], |
|
|
"edns_options": [], |
|
|
"payload": 4096, |
|
|
"payload": 4096, |
|
|
"edns_version": 0, |
|
|
"edns_version": 0, |
|
|
"do": 0 |
|
|
"do": 0 |
|
|
*/ |
|
|
*/ |
|
|
}; |
|
|
}; |
|
|
pdns.unpack = function (ab) { |
|
|
pdns.unpack = function (ab) { |
|
|