Skip to content

Add follow mode for growing pcap files#18

Open
keilogic wants to merge 1 commit into
SuperCowPowers:masterfrom
keilogic:live-updating-pcap
Open

Add follow mode for growing pcap files#18
keilogic wants to merge 1 commit into
SuperCowPowers:masterfrom
keilogic:live-updating-pcap

Conversation

@keilogic

@keilogic keilogic commented Jun 1, 2026

Copy link
Copy Markdown

Summary

  • add explicit follow_file support to PacketStreamer so pcap files can be polled for appended packets after EOF
  • reopen followed pcap files and skip packets already yielded, while preserving the default one-shot pcap-file behavior
  • expose --follow / --follow-timeout in the simple packet print example and document the live-updating pcap usage
  • add a fake-pcap unit test covering appended-packet behavior without requiring libpcap locally

Fixes #12.

Verification

  • py -m py_compile chains\sources\packet_streamer.py chains\sources\packet_streamer_follow_file_test.py examples\simple_packet_print.py
  • py -m flake8 chains\sources\packet_streamer.py chains\sources\packet_streamer_follow_file_test.py examples\simple_packet_print.py
  • py -m pytest chains\sources\packet_streamer_follow_file_test.py -q
  • git diff --check

Note: full local collection is still limited on my Windows/Python 3.13 environment because the current base branch imports pcapy directly and pcapy is not installed there. The new follow-mode test injects a fake pcapy module so the follow/reopen behavior is covered without native libpcap dependencies.

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

Successfully merging this pull request may close these issues.

Add reading live-updating .pcap file as it's getting updated.

1 participant