dns-suite.js/parser/type.soa.js

37 lines
1.1 KiB
JavaScript

(function (exports) {
'use strict';
// TODO. Not yet implemented
// Value Meaning/Use
// Primary NS Variable length. The name of the Primary Master for the domain. May be a label, pointer, or any combination
// Admin MB Variable length. The administrator's mailbox. May be a label, pointer, or any combination
// Serial Number Unsigned 32-bit integer
// Refresh Interval Unsigned 32-bit integer
// Retry Interval Unsigned 32-bit integer
// Expiration Limit Unsigned 32-bit integer
// Minimum TTL Unsigned 32-bit integer
exports.DNS_PARSER_TYPE_SOA = function (ab, packet, record) {
var rdataAb = ab.slice(record.rdstart, record.rdstart + record.rdlength);
var dv = new DataView(rdataAb)
// Serial Number
record.sn = dv.getUint32(dv.byteLength - 20);
// Refresh Interval
record.ref = dv.getUint32(dv.byteLength - 16);
// Retry Interval
record.ret = dv.getUint32(dv.byteLength - 12);
// Expiration Limit
record.ex = dv.getUint32(dv.byteLength - 8);
// Minimum TTL
record.nx = dv.getUint32(dv.byteLength - 4);
return record;
};
}('undefined' !== typeof window ? window : exports));