2017-01-27 02:18:46 +00:00
|
|
|
(function (exports) {
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
// Value: Preference
|
|
|
|
// Meaning/Use: Unsigned 16-bit integer
|
|
|
|
//-------------------------------------
|
|
|
|
// Value: Mail Exchanger
|
|
|
|
// Meaning/Use: The name host name that provides the service.
|
|
|
|
// May be a label, pointer or any combination
|
|
|
|
|
2017-02-02 01:28:43 +00:00
|
|
|
// ab is arrayBuffer, packet is Object, Record is Object
|
2017-02-18 02:38:47 +00:00
|
|
|
var unpackLabels = exports.DNS_UNPACK_LABELS || require('../dns.unpack-labels.js').DNS_UNPACK_LABELS;
|
2017-02-17 23:13:57 +00:00
|
|
|
exports.DNS_PARSER_TYPE_MX = function (ab, packet, record) {
|
2017-01-27 02:18:46 +00:00
|
|
|
|
2017-02-02 04:41:33 +00:00
|
|
|
var rdataAb = ab.slice(record.rdstart, record.rdstart + record.rdlength);
|
|
|
|
var dv = new DataView(rdataAb);
|
2017-02-02 01:28:43 +00:00
|
|
|
|
2017-02-03 01:39:32 +00:00
|
|
|
record.priority = dv.getUint16(0, false);
|
|
|
|
record.exchange = unpackLabels(new Uint8Array(ab), record.rdstart+2, { byteLength: 0, cpcount: 0, labels: [], name: '' }).name;
|
|
|
|
|
|
|
|
return record;
|
2017-01-27 02:18:46 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}('undefined' !== typeof window ? window : exports));
|
|
|
|
|