Skip to content

trace: add snaplen and BPF filter fields to trace modal - #241

Open
mfoxworthy wants to merge 1 commit into
Telecominfraproject:mainfrom
mfoxworthy:feature/trace-snaplen-filter
Open

trace: add snaplen and BPF filter fields to trace modal#241
mfoxworthy wants to merge 1 commit into
Telecominfraproject:mainfrom
mfoxworthy:feature/trace-snaplen-filter

Conversation

@mfoxworthy

Copy link
Copy Markdown

Summary

Extends the Trace dialog with two new optional fields, matching the new snaplen and filter parameters 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 — added snaplen?: number and filter?: string to both union members of the startTrace type
  • src/components/Modals/TraceModal/index.tsx — new form fields with preset buttons, NaN/range guard on snaplen, numberOfPackets field name corrected (was sending packets due to a pre-existing @ts-ignore)
  • public/locales/{en,de,es,fr,pt}/translation.json — added controller.trace.snaplen and controller.trace.filter keys to all five locales

Testing

Tested against a self-hosted OWGW with the companion gateway build. Trace with snaplen: 96 returned a valid pcap with capture length 96. Traces using the existing Duration/Packets modes are unaffected.

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>
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.

1 participant