Conversation
New ChainPanel widget with a chain picker (left) listing every table/chain in the ruleset and a rules table (right) showing the selected chain's rules in ruleset order — position, verdict, live pkt/byte rates, and cumulative totals. Reads like `nft list chain` / `iptables -L <chain>`, complementing the drops-first Firewall tab. - app: new "Chains" TabPane, key 4 (Drops moved to 5), per-tick wiring - demo: enrich synthetic ruleset to 4 chains with ordered rules - css: border-title styling for #chain-panel - README: keybindings, features, and Chains tab section
New opt-in Capture tab that behaves like an interactive tcpdump. Press 'f' to enter a port/protocol filter; fwtop then captures just that traffic and shows three stacked panels (Overview-style): WAN/LAN throughput charts of the matched flow, a per-interface breakdown table, and a live packet list in tcpdump's own format. 's' stops capture. This is the app's first packet-capture source and the only one that captures packets. It shells out to the system tcpdump (one process per interface, matching how firewall.py shells out to nft/iptables) and runs only while the tab is on screen — leaving the tab or unmounting stops it, so no tcpdump lingers and the rest of the app keeps its zero-capture footprint. Capture runs on daemon reader threads writing to a lock-guarded buffer, drained on the UI timer (the Resolver threading model). WAN/LAN classification reuses is_private_ip; interface->zone uses Config.zone_for. Throughput is derived from captured frame lengths, so it approximates rather than matches the kernel interface counters. - models: Packet + CaptureFilter (to_bpf/describe) - sources/capture.py: CaptureSource (tcpdump backend + demo synthesizer) - widgets: CapturePanel (charts + iface table + packet list), FilterModal (first value-returning modal in the app) - app: Capture tab (key 5; Drops -> 6), f/s bindings, tab-driven lifecycle, refresh gated to the active tab - tcss + README: styling, keybindings, features, capture caveat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two new tabs for
fwtop, both on thev0.2.5branch.Chains tab (key
4)A chain-by-chain drill-down of firewall counters. A picker lists every
table/chainin the ruleset (with rule count, highlighted red when actively dropping); selecting one shows that chain's rules in ruleset order — position, verdict, live pkt/byte rates, cumulative totals. Reads likenft list chain/iptables -L <chain>, complementing the drops-first Firewall tab.Capture tab (key
5; Drops moved to6)An interactive, opt-in tcpdump. Press
fto enter a port/protocol filter; fwtop captures just that traffic and shows three Overview-style stacked panels:HH:MM:SS.ffffff iface IP src.port > dst.port: …)sstops capture.Notes on the Capture design
tcpdump(one process per interface, matching howfirewall.pyshells out tonft/iptables) — no new Python dependency.tcpdumplingers and the rest of the app keeps its zero-capture footprint.Resolverthreading model). WAN/LAN classification reusesis_private_ip; interface→zone reusesConfig.zone_for.Verification
sand leaving the tab both stop capture.-e -tt -noutput, and the BPF builder.tcpdump(developed on macOS, demo-only). Worth a manual Linux/root check before relying on it:sudo fwtop, Capture tab, filter tcp port 443, confirm the panels track real traffic andpgrep tcpdumpis empty after leaving the tab.