parser soa type
This commit is contained in:
parent
571e4959cf
commit
0ba8871c3a
|
@ -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));
|
||||||
|
|
Loading…
Reference in New Issue