Merge remote-tracking branch 'jgras/topic/jgras/fix-packet-lag'

* jgras/topic/jgras/fix-packet-lag:
  Introduce get_packet_lag()
  Add btest for get_current_packet_ts()
  Introduce get_current_packet_ts to fix packet lag
This commit is contained in:
Arne Welzel 2024-12-10 18:26:31 +01:00
commit 77465a90b5
8 changed files with 83 additions and 3 deletions

View file

@ -0,0 +1,5 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
network_time_init network time: 1362692526.869344
network_time_init packet ts: 1362692526.869344
conn_state_remove network time: 1362692527.080972
conn_state_remove packet ts: 0.0

View file

@ -0,0 +1,17 @@
# @TEST-DOC: Test get_current_packet_ts() in comparison with network_time().
# @TEST-EXEC: zeek -b -r $TRACES/http/get.trace %INPUT > output
# @TEST-EXEC: TEST_DIFF_CANONIFIER= btest-diff output
event network_time_init()
{
print fmt("network_time_init network time: %s", network_time());
print fmt("network_time_init packet ts: %s", get_current_packet_ts());
}
# Note: Gracefully closed connections will be actually removed after
# tcp_close_delay (default 5 secs).
event connection_state_remove(c: connection)
{
print fmt("conn_state_remove network time: %s", network_time());
print fmt("conn_state_remove packet ts: %s", get_current_packet_ts());
}

View file

@ -1 +1 @@
2a63b457f24133a845c2020a321b7cbc05262291
4359bd2c0e776dce08f7eca30d3d34cfe3e1d98b