Comparing version 0.0.5 to 0.0.6
@@ -1,3 +0,2 @@ | ||
var inherits = require('util').inherits, | ||
EventEmitter = require('events').EventEmitter; | ||
var EventEmitter = require('events').EventEmitter; | ||
@@ -4,0 +3,0 @@ var addon = require('../build/Release/cap'); |
@@ -170,10 +170,10 @@ // Link Layer Protocols ======================================================== | ||
// 8-bit Traffic Class | ||
info.class = ((b[offset] & 0x0F) << 4) + ((b[++offset] & 0xF0) >> 4); | ||
ret.info.class = ((b[offset] & 0x0F) << 4) + ((b[++offset] & 0xF0) >> 4); | ||
// 20-bit Flow Label | ||
info.flowLabel = ((b[offset] & 0x0F) << 16) + b.readUInt16BE(++offset, true); | ||
ret.info.flowLabel = ((b[offset] & 0x0F) << 16) + b.readUInt16BE(++offset, true); | ||
offset += 2; | ||
// 16-bit Payload Length | ||
info.payloadlen = b.readUInt16BE(offset, true); | ||
ret.info.payloadlen = b.readUInt16BE(offset, true); | ||
offset += 2; | ||
@@ -207,3 +207,3 @@ | ||
// TODO: parse extensions | ||
if (curHeader === 0 || curHeader == 43 || curHeader === 60 | ||
if (curHeader === 0 || curHeader === 43 || curHeader === 60 | ||
|| curHeader === 135) { | ||
@@ -238,3 +238,3 @@ // Header Extension Length field is in 8-byte units | ||
offset || (offset = 0); | ||
var type, code, checksum; | ||
var type, code, checksum, i, j; | ||
@@ -402,7 +402,7 @@ var ret = { | ||
addrs = new Array(nAddrs); | ||
for (var i = 0; i < nAddrs; ++i) { | ||
for (i = 0; i < nAddrs; ++i) { | ||
addr = ''; | ||
for (i = 0; i < 4; ++i) { | ||
for (j = 0; j < 4; ++j) { | ||
addr += b[offset++]; | ||
if (i < 3) | ||
if (j < 3) | ||
addr += '.'; | ||
@@ -419,3 +419,3 @@ } | ||
checksum: checksum, | ||
lifetime: mtu, | ||
lifetime: lifetime, | ||
addrs: addrs | ||
@@ -422,0 +422,0 @@ }; |
{ "name": "cap", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"author": "Brian White <mscdex@mscdex.net>", | ||
@@ -4,0 +4,0 @@ "description": "A cross-platform binding for performing packet capturing with node.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
304967
874