finished TXT record type packer.
This commit is contained in:
parent
937e93d1df
commit
d00f83c625
|
@ -10,24 +10,32 @@ exports.DNS_PACKER_TYPE_TXT = function (ab, dv, total, record) {
|
||||||
|
|
||||||
var txtLen = 0;
|
var txtLen = 0;
|
||||||
var rdLenIndex = total;
|
var rdLenIndex = total;
|
||||||
total += 2;
|
total += 3;
|
||||||
|
|
||||||
// RDATA
|
// RDATA
|
||||||
|
console.log("what is my record data: " + typeof record.data[0]);
|
||||||
|
console.log("what are my labels? ");
|
||||||
|
// var res = record.data[0].split(" ");
|
||||||
|
// console.log("Res: " + res);
|
||||||
|
|
||||||
record.data.split('.').forEach(funtion(label){
|
console.log("for each rdata");
|
||||||
txtLen += 1 + label.length;
|
record.data.forEach(function(str){
|
||||||
|
|
||||||
dv.setUint8(total, label.length, false);
|
str.split('').forEach(function(ch){
|
||||||
total += 1;
|
|
||||||
|
|
||||||
label.split('').forEach(function (ch) {
|
|
||||||
|
txtLen += 1;
|
||||||
|
// console.log(chcim);
|
||||||
dv.setUint8(total, ch.charCodeAt(0), false);
|
dv.setUint8(total, ch.charCodeAt(0), false);
|
||||||
total += 1;
|
total += 1;
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log("txt rdata length is: " + txtLen);
|
||||||
dv.setUint16(rdLenIndex, record.data.length + 1, flase);s
|
dv.setUint16(rdLenIndex, txtLen+1, false);
|
||||||
|
dv.setUint8(rdLenIndex+2, txtLen, false);
|
||||||
|
// total +=1;
|
||||||
|
|
||||||
return total;
|
return total;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue