trace: add snaplen and BPF filter fields to trace modal - #241
Open
mfoxworthy wants to merge 1 commit into
Open
Conversation
Add two optional fields to the trace dialog: - Snap Length: preset buttons (96/512/65535) + free-form number input. Omitted from POST body when value is 65535 (tcpdump default). - BPF Filter: text input with placeholder. Omitted when empty. Updates Trace.ts hook types to accept both new optional fields. Signed-off-by: Mike Foxworthy <mike.foxworthy@gmail.com>
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
Extends the Trace dialog with two new optional fields, matching the new
snaplenandfilterparameters added to the gateway (wlan-cloud-ucentralgw#441) and AP handler (wlan-ucentral-schema#101).Snap Length — limits bytes captured per packet, reducing pcap file size. Preset buttons for the three most common values (96 = headers only, 512 = headers + small payloads, 65535 = full packet) plus a free-form number input. Omitted from the POST body when set to 65535 (tcpdump's default).
BPF Filter — text input for a tcpdump BPF expression, e.g.
host 192.168.1.1 and port 443. Omitted from the POST body when empty.Changes
src/hooks/Network/Trace.ts— addedsnaplen?: numberandfilter?: stringto both union members of thestartTracetypesrc/components/Modals/TraceModal/index.tsx— new form fields with preset buttons, NaN/range guard on snaplen,numberOfPacketsfield name corrected (was sendingpacketsdue to a pre-existing@ts-ignore)public/locales/{en,de,es,fr,pt}/translation.json— addedcontroller.trace.snaplenandcontroller.trace.filterkeys to all five localesTesting
Tested against a self-hosted OWGW with the companion gateway build. Trace with
snaplen: 96returned a valid pcap with capture length 96. Traces using the existing Duration/Packets modes are unaffected.