add A record parser
This commit is contained in:
parent
96a851e5ad
commit
267342c82c
|
@ -27,7 +27,7 @@ exports.DNS_RDATA_PARSE = function (ab, packet, record) {
|
|||
|
||||
try {
|
||||
parser = exports['DNS_TYPE_' + record.typeName]
|
||||
|| require('./dns.type.' + record.typeName.toLowerCase());
|
||||
|| require('./dns.type.' + record.typeName.toLowerCase())['DNS_TYPE_' + record.typeName];
|
||||
}
|
||||
catch (e) { /*console.error(e)*/ }
|
||||
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
(function (exports) {
|
||||
'use strict';
|
||||
|
||||
exports.DNS_TYPE_A = function (rdata) {
|
||||
var ui8 = new Uint8Array(rdata);
|
||||
|
||||
// i.e. 127.0.0.1
|
||||
return ui8[0] + '.' + ui8[1] + '.' + ui8[2] + '.' + ui8[3];
|
||||
};
|
||||
|
||||
}('undefined' !== typeof window ? window : exports));
|
Loading…
Reference in New Issue