Wireshark-dev: [Wireshark-dev] [PATCH] Add heur_dissector_delete

From: Mike Duigou <wireshark@xxxxxxxxxx>
Date: Tue, 26 Jun 2007 09:52:10 -0700
Enclosed is a patch which adds 'heur_dissector_delete' to epan/packet.[ch]

This allows dynamic removal of heuristic dissectors based upon preferences.

An example of use in a prefs reinit function :

if( gUDP_HEUR ) {
  if( !udp_register_done ) {
      g_message( "Registering UDP Heuristic dissector" );
      heur_dissector_add("udp", dissect_jxta_UDP_heur, proto_jxta);
      udp_register_done = TRUE;
  }
else {
  if( udp_register_done ) {
      g_message( "Deregistering UDP Heuristic dissector" );
heur_dissector_delete("udp", dissect_jxta_UDP_heur, proto_jxta);
      udp_register_done = FALSE;
  }
}

The patch also includes an incidental patch to call_dissector which avoids potentially infinite recursion if the 'data' dissector returns 0.

Mike

Attachment: heur_dissector_delete.patch.gz
Description: GNU Zip compressed data