rename flag_auth,flag_trunc to flag_aa,flag_tc

Fixes: https://github.com/mafintosh/dns-packet/issues/27
This commit is contained in:
silverwind 2018-01-30 19:50:17 +01:00
parent 44718b2f31
commit 84589e7026
No known key found for this signature in database
GPG Key ID: 2E62B41C93869443
3 changed files with 6 additions and 5 deletions

View File

@ -1,3 +1,4 @@
# Version 4.0.0 - yyyy-mm-dd # Version 4.0.0 - yyyy-mm-dd
- Changed the decoded value of TXT records to an array of Buffers. This is to accomodate DNS-SD records which rely on the individual strings record being separated. - Changed the decoded value of TXT records to an array of Buffers. This is to accomodate DNS-SD records which rely on the individual strings record being separated.
- Renamed the `flag_trunc` and `flag_auth` to `flag_tc` and `flag_aa` to match the names of these in the dns standards.

View File

@ -141,8 +141,8 @@ header.decode = function (buf, offset) {
flags: flags & 32767, flags: flags & 32767,
flag_qr: ((flags >> 15) & 0x1) === 1, flag_qr: ((flags >> 15) & 0x1) === 1,
opcode: opcodes.toString((flags >> 11) & 0xf), opcode: opcodes.toString((flags >> 11) & 0xf),
flag_auth: ((flags >> 10) & 0x1) === 1, flag_aa: ((flags >> 10) & 0x1) === 1,
flag_trunc: ((flags >> 9) & 0x1) === 1, flag_tc: ((flags >> 9) & 0x1) === 1,
flag_rd: ((flags >> 8) & 0x1) === 1, flag_rd: ((flags >> 8) & 0x1) === 1,
flag_ra: ((flags >> 7) & 0x1) === 1, flag_ra: ((flags >> 7) & 0x1) === 1,
flag_z: ((flags >> 6) & 0x1) === 1, flag_z: ((flags >> 6) & 0x1) === 1,

View File

@ -234,9 +234,9 @@ tape('rcode', function (t) {
const val = packet.decode(buf) const val = packet.decode(buf)
t.ok(val.type === 'response', 'decode type') t.ok(val.type === 'response', 'decode type')
t.ok(val.opcode === 'QUERY', 'decode opcode') t.ok(val.opcode === 'QUERY', 'decode opcode')
t.ok(val.flag_qr === true, 'decode flag_auth') t.ok(val.flag_qr === true, 'decode flag_qr')
t.ok(val.flag_auth === true, 'decode flag_auth') t.ok(val.flag_aa === true, 'decode flag_aa')
t.ok(val.flag_trunc === false, 'decode flag_trunc') t.ok(val.flag_tc === false, 'decode flag_tc')
t.ok(val.flag_rd === false, 'decode flag_rd') t.ok(val.flag_rd === false, 'decode flag_rd')
t.ok(val.flag_ra === true, 'decode flag_ra') t.ok(val.flag_ra === true, 'decode flag_ra')
t.ok(val.flag_z === false, 'decode flag_z') t.ok(val.flag_z === false, 'decode flag_z')