Permalink
Browse files

Change includedLength to capturedLength

  • Loading branch information...
1 parent a5ee5ea commit af69cf2cc4770a0b21f6addff2cca66002f37784 @kunklejr committed Jan 5, 2012
Showing with 9 additions and 9 deletions.
  1. +2 −2 README.md
  2. +4 −4 lib/pcap-parser.js
  3. +1 −1 package.json
  4. +2 −2 test/pcap-parser.js
View
@@ -51,7 +51,7 @@ event listener would look something like
{
timestampSeconds: 1254722767,
timestampMicroseconds: 492060,
- includedLength: 76,
+ capturedLength: 76,
originalLength: 76
}
@@ -69,7 +69,7 @@ the header fields and packet data.
header: {
timestampSeconds: 1254722767,
timestampMicroseconds: 492060,
- includedLength: 76,
+ capturedLength: 76,
originalLength: 76
},
View
@@ -62,7 +62,7 @@ function parsePacketHeader() {
var header = {
timestampSeconds: buffer.readUInt32LE(0, true),
timestampMicroseconds: buffer.readUInt32LE(4, true),
- includedLength: buffer.readUInt32LE(8, true),
+ capturedLength: buffer.readUInt32LE(8, true),
originalLength: buffer.readUInt32LE(12, true)
};
@@ -79,16 +79,16 @@ function parsePacketHeader() {
function parsePacketBody() {
var buffer = this.buffer;
- if (buffer.length >= this.currentPacketHeader.includedLength) {
- var data = buffer.slice(0, this.currentPacketHeader.includedLength);
+ if (buffer.length >= this.currentPacketHeader.capturedLength) {
+ var data = buffer.slice(0, this.currentPacketHeader.capturedLength);
this.emit('packetData', data);
this.emit('packet', {
header: this.currentPacketHeader,
data: data
});
- this.buffer = buffer.slice(this.currentPacketHeader.includedLength);
+ this.buffer = buffer.slice(this.currentPacketHeader.capturedLength);
this.state = parsePacketHeader;
return true;
}
View
@@ -3,7 +3,7 @@
"description": "Packet capture (PCAP) parser for node",
"keywords": ["pcap", "parser"],
"homepage": "https://github.com/nearinfinity/node-pcap-parser",
- "version": "0.0.1",
+ "version": "0.0.2",
"engines": { "node" : ">=0.6.0" },
"maintainers": [
{ "name": "Jeff Kunkle", "email": "jeff.kunkle@nearinfinity.com" },
View
@@ -36,7 +36,7 @@ vows.describe('pcap-parser').addBatch({
assert.isNotNull(packetHeader);
assert.equal(packetHeader.timestampSeconds, 1254722767);
assert.equal(packetHeader.timestampMicroseconds, 492060);
- assert.equal(packetHeader.includedLength, 76);
+ assert.equal(packetHeader.capturedLength, 76);
assert.equal(packetHeader.originalLength, 76);
}
},
@@ -66,7 +66,7 @@ vows.describe('pcap-parser').addBatch({
assert.equal(packet.data.length, 76);
assert.equal(packet.header.timestampSeconds, 1254722767);
assert.equal(packet.header.timestampMicroseconds, 492060);
- assert.equal(packet.header.includedLength, 76);
+ assert.equal(packet.header.capturedLength, 76);
assert.equal(packet.header.originalLength, 76);
}
},

0 comments on commit af69cf2

Please sign in to comment.