This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Help: wireshark crashes after adding preference code to my dissector

0

I wanted to add some options in the preference window for my dissector. This is the code I have added to the "proto_register" function:

module_t *dan_lte_sdk_module;

proto_dan_lte_sdk = proto_register_protocol ("DAN LTE SDK Protocol", "Dan LTE SDK", "dan_lte_sdk");

register_init_routine(dan_defragment_init);

proto_register_field_array (proto_dan_lte_sdk, hf, array_length (hf)); proto_register_subtree_array (ett, array_length (ett)); register_dissector("dan_lte_sdk", dissect_dan_lte_sdk, proto_dan_lte_sdk);

dan_lte_sdk_module = prefs_register_protocol(proto_dan_lte_sdk, NULL);

prefs_register_bool_preference(dan_lte_sdk_module, "Dissect_MAC_Payload", "Dissect MAC Layer from Data Payload", "In Uplink and Downlink data packets, dissect MAC heaser layer " "Disabling MAC dissection will disable RLC dissection automaticly", &global_dan_lte_sdk_dissect_MAC);

prefs_register_bool_preference(dan_lte_sdk_module, "Dissect_RLC_Payload", "Dissect RLC Layer from Data Payload", "In Uplink and Downlink data packets, dissect RLC heaser layer ", &global_dan_lte_sdk_dissect_RLC);

It works fine until I add those two (even one of them) “prefs_register_bool_preference” functions. What did I do wrong?

I get a “Runtime Error!” for wireshark.exe Removing those function fixes it back.

Thanks

Yosi

asked 26 Jan ‘11, 01:19

Yosi's gravatar image

Yosi
6235
accept rate: 0%


One Answer:

1
 * Make sure that only lower-case ASCII letters, numbers,
 * underscores, and dots appear in the preference name.

answered 26 Jan '11, 03:53

Jaap's gravatar image

Jaap ♦
11.7k16101
accept rate: 14%