Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing timestamps in PCAP files #25

Open
JulianeFischer opened this issue Jun 11, 2015 · 1 comment
Open

Changing timestamps in PCAP files #25

JulianeFischer opened this issue Jun 11, 2015 · 1 comment

Comments

@JulianeFischer
Copy link

Thanks for introducing access to packet timestamps in Haka (0.2)!

Read access works perfectly fine, but unfortunately changing timestamps does not work for PCAP files.
Here is a minimum working example ("timestamp.lua"):

local raw = require('protocol/raw')

haka.rule{
    hook = raw.events.send_packet,
    eval = function(pkt)

    print("Before: " .. pkt.timestamp.secs)
    pkt.timestamp.secs = pkt.timestamp.secs + 1
    print("After: " .. pkt.timestamp.secs)
end
}

I run hakapcap on a very short PCAP ("testin.pcap"):

hakapcap --no-pass-through -o testout.pcap timestamp.lua testin.pcap

For every packet, I see two output lines, as intented:

Before: 1434009888
After: 1434009889

However, the output PCAP file ("testout.pcap") does not reflect the changes, as the timestamp remains unchanged. In fact, hashing "testin.pcap" and "testout.pcap" results in the same hash value.

@JulianeFischer
Copy link
Author

Any comment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant