diff --git a/parser/type.soa.js b/parser/type.soa.js index b468e8a..762a67a 100644 --- a/parser/type.soa.js +++ b/parser/type.soa.js @@ -9,13 +9,28 @@ // Serial Number Unsigned 32-bit integer // Refresh Interval Unsigned 32-bit integer // Retry 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));