Skip to content

Commit

Permalink
Added unpack.uint64
Browse files Browse the repository at this point in the history
  • Loading branch information
mattstevens committed Aug 15, 2010
1 parent 56015f3 commit bb15a9b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pcap.js
Expand Up @@ -122,6 +122,18 @@ var unpack = {
raw_packet[offset + 3]
);
},
uint64: function (raw_packet, offset) {
return (
(raw_packet[offset] * 72057594037927936) +
(raw_packet[offset + 1] * 281474976710656) +
(raw_packet[offset + 2] * 1099511627776) +
(raw_packet[offset + 3] * 4294967296) +
(raw_packet[offset + 4] * 16777216) +
(raw_packet[offset + 5] * 65536) +
(raw_packet[offset + 6] * 256) +
raw_packet[offset + 7]
);
},
ipv4_addr: function (raw_packet, offset) {
return [
raw_packet[offset],
Expand Down

0 comments on commit bb15a9b

Please sign in to comment.