This commit is contained in:
AJ ONeal 2017-01-21 03:38:25 -07:00
부모 3bbada69aa
커밋 676dbabfbc
1개의 변경된 파일7개의 추가작업 그리고 4개의 파일을 삭제

파일 보기

@ -8,7 +8,9 @@ pdns.unpackHeader = function (i) {
// i is one element from a Uint16Array (as a 16-bit unsigned integer)
var header = {
qr: (i & 0x8000) >> 15 // Query Response (0 is question, 1 is response)
id: 0 // added here to preserve console.log order
, qr: (i & 0x8000) >> 15 // Query Response (0 is question, 1 is response)
, opcode: (i & 0x7800) >> 11 // 0 is question
, aa: (i & 0x400) >> 10 // Authoritative Answer (response-only)
, tc: (i & 0x200) >> 9 // TrunCated - expect another packet with same (?) id
@ -47,8 +49,7 @@ pdns.unpackQname = function (ui8) {
var len;
var q = {
byteLength: 0
, name: ''
name: ''
, type: 0
, class: 0
};
@ -192,6 +193,8 @@ pdns.unpack = function (ab) {
answers.push(q);
}
header.id = id;
console.log('qdcount', qdcount);
header.questions = [];
for (i = 0; i < qdcount; i += 1) {
@ -216,5 +219,5 @@ pdns.unpack = function (ab) {
unpackAnswer(header.additional);
}
console.log('packet', header);
console.log('[packet]', header);
};