Permalink
Browse files

Add src and dst mac address to http session

  • Loading branch information...
1 parent 884430d commit 1bc0328a75b9e28b8403b64dc8788e7709b1362e @kunklejr kunklejr committed Nov 28, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 pcap.js
View
@@ -1510,21 +1510,25 @@ TCP_tracker.prototype.track_next = function (key, packet) {
};
TCP_tracker.prototype.track_packet = function (packet) {
- var ip, tcp, src, dst, key, session, self = this;
+ var ip, tcp, src, src_mac, dst, dst_mac, key, session, self = this;
if (packet.link && packet.link.ip && packet.link.ip.tcp) {
ip = packet.link.ip;
tcp = ip.tcp;
src = ip.saddr + ":" + tcp.sport;
+ src_mac = packet.link.shost;
dst = ip.daddr + ":" + tcp.dport;
+ dst_mac = packet.link.dhost;
key = this.make_session_key(src, dst);
session = this.sessions[key];
if (tcp.flags.syn && !tcp.flags.ack) {
if (session === undefined) {
this.sessions[key] = {
src: src, // the side the sent the initial SYN
+ src_mac: src_mac,
dst: dst, // the side that the initial SYN was sent to
+ dst_mac: dst_mac,
syn_time: packet.pcap_header.time_ms,
state: "SYN_SENT",
key: key, // so we can easily remove ourselves

0 comments on commit 1bc0328

Please sign in to comment.