Skip to content

Add traffic count utility scripts#21

Open
keilogic wants to merge 1 commit into
SuperCowPowers:masterfrom
keilogic:utility-count-scripts
Open

Add traffic count utility scripts#21
keilogic wants to merge 1 commit into
SuperCowPowers:masterfrom
keilogic:utility-count-scripts

Conversation

@keilogic

@keilogic keilogic commented Jun 1, 2026

Copy link
Copy Markdown

Summary

  • add external_hosts to count outbound external destination hosts from live traffic or a pcap
  • add protocol_counts to summarize IP/transport protocol usage from the packet stream
  • share the counting logic in chains.utils.traffic_counts and cover it with focused tests

Fixes #3.

Verification

  • py -m py_compile setup.py chains\utils\traffic_counts.py chains\utils\traffic_counts_test.py scripts\external_hosts scripts\protocol_counts
  • py -m pytest chains\utils\traffic_counts_test.py -q
  • py -m flake8 setup.py chains\utils\traffic_counts.py chains\utils\traffic_counts_test.py scripts\external_hosts scripts\protocol_counts
  • py setup.py --name
  • git diff --check

Note: running the scripts against the bundled pcaps was not possible in this local Windows/Python 3.13 environment because the current base branch imports native capture dependencies (pcapy / netifaces) that are not installed here. The new counting helper tests avoid those native 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 some utility scripts

1 participant