From 0ba8871c3a9f847c1a9353c93b59283b7bf74efc Mon Sep 17 00:00:00 2001 From: westley Date: Sat, 4 Mar 2017 17:11:33 -0700 Subject: [PATCH] parser soa type --- parser/type.soa.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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));