cleanup
This commit is contained in:
parent
bb87a2ea63
commit
2f87cd3797
|
@ -72,14 +72,14 @@ pdns.unpack = function (ab) {
|
|||
function unpackQuestion(ab, dv, ui8, total) {
|
||||
var ototal = total;
|
||||
var q = pdns._unpackLabels(ui8, total, {
|
||||
name: ''
|
||||
, type: 0
|
||||
, typeName: ''
|
||||
, class: 0
|
||||
, className: ''
|
||||
, byteLength: 0
|
||||
, labels: []
|
||||
, cpcount: 0
|
||||
name: '' // ex: daplie.com
|
||||
, type: 0 // ex: 1
|
||||
, typeName: '' // ex: A
|
||||
, class: 0 // ex: 1
|
||||
, className: '' // ex: IN
|
||||
, byteLength: 0 // the total byte length (including pointers, but not their labels)
|
||||
, labels: [] // an array of the labels individually
|
||||
, cpcount: 0 // the number of compression pointers traversed
|
||||
});
|
||||
//console.log('unpackQuestion QNAME:');
|
||||
//console.log(q);
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
(function (exports) {
|
||||
'use strict';
|
||||
|
||||
// TODO. Not yet implemented
|
||||
|
||||
// Value: Preference
|
||||
// Meaning/Use: Unsigned 16-bit integer
|
||||
//-------------------------------------
|
||||
|
@ -14,21 +12,14 @@
|
|||
var unpackLabels = exports.DNS_UNPACK_LABELS || require('./dns.unpack-labels.js').DNS_UNPACK_LABELS;
|
||||
exports.DNS_TYPE_MX = function (ab, packet, record) {
|
||||
|
||||
|
||||
var rdataAb = ab.slice(record.rdstart, record.rdstart + record.rdlength)
|
||||
var rdataAb = ab.slice(record.rdstart, record.rdstart + record.rdlength);
|
||||
var dv = new DataView(rdataAb);
|
||||
|
||||
var s = {
|
||||
return {
|
||||
priority: dv.getUint16(0, false)
|
||||
, exchange: unpackLabels(new Uint8Array(ab), record.rdstart+2, { byteLength: 0, cpcount: 0, labels: [], name: '' }).name
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
return s;
|
||||
|
||||
|
||||
};
|
||||
|
||||
}('undefined' !== typeof window ? window : exports));
|
||||
|
|
Loading…
Reference in New Issue