Skip to content

Conversation

@dehydr8
Copy link
Member

@dehydr8 dehydr8 commented Jan 24, 2026

Summary

Adds APIs to programmatically enable/disable protocols and heuristic dissectors at runtime, similar to Wireshark's "Enabled Protocols" dialog (Ctrl+Shift+E).

closes #25

Motivation

Captures using heuristic dissectors (like mac_nr_udp for 5G NR over UDP) weren't being decoded because these dissectors are disabled by default.

Changes

  • Added listProtocols() / setProtocolEnabled() / setProtocolEnabledByName()
  • Added listHeuristicDissectors() / setHeuristicEnabled()
  • Each heuristic includes protocol_id to build hierarchical UI matching Wireshark

Usage

wg.set_heuristic_enabled("mac_nr_udp", true);
wg.load("nr.pcapng", data);

For building an "Enabled Protocols" dialog

// Get all protocols and heuristics
const protocols = wg.list_protocols();
const heuristics = wg.list_heuristic_dissectors();

// Group heuristics under their parent protocols (using protocol_id)
const protocolsWithHeuristics = protocols.map(proto => ({
  ...proto,
  heuristics: heuristics.filter(h => h.protocol_id === proto.id)
}));

@dehydr8 dehydr8 self-assigned this Jan 24, 2026
@dehydr8 dehydr8 added the enhancement New feature or request label Jan 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Question] How to enable heuristic dissectors?

2 participants