parser soa type

This commit is contained in:
westley 2017-03-04 17:11:33 -07:00
parent 571e4959cf
commit 0ba8871c3a
1 changed files with 16 additions and 1 deletions

View File

@ -9,13 +9,28 @@
// Serial Number Unsigned 32-bit integer // Serial Number Unsigned 32-bit integer
// Refresh Interval Unsigned 32-bit integer // Refresh Interval Unsigned 32-bit integer
// Retry Interval Unsigned 32-bit integer // Retry Interval Unsigned 32-bit integer
// Retry Interval Unsigned 32-bit integer
// Expiration Limit Unsigned 32-bit integer // Expiration Limit Unsigned 32-bit integer
// Minimum TTL Unsigned 32-bit integer // Minimum TTL Unsigned 32-bit integer
exports.DNS_PARSER_TYPE_SOA = function (ab, packet, record) { 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)); }('undefined' !== typeof window ? window : exports));