Wireshark-dev: Re: [Wireshark-dev] When is the preference variable updated?
Hi, If you look in epan/prefs.h you can see that the second argument is a callback function prefs_register_protocol(int
id, void (*apply_cb)(void)); In packet-sip.c sip_module = prefs_register_protocol(proto_sip, proto_reg_handoff_sip); So
proto_reg_handoff_sip is called every time the preference is changed and at startup so you need to arrange To handle the value there. Regards Anders From: wireshark-dev-bounces@xxxxxxxxxxxxx [mailto:wireshark-dev-bounces@xxxxxxxxxxxxx]
On Behalf Of Paul Offord Hi, Frankly I feel a bit stupid asking this but I've been trying to figure it out for about 6 hours and I think I need help. I have a dissector which I register like this: static int tmsvc_port = 0; void proto_register_tmsvc(void) { module_t *tmsvc_module; proto_tmsvc = proto_register_protocol("TM Syncro Service", "TmSyncro", "tmsvc"); tmsvc_module = prefs_register_protocol(proto_tmsvc, NULL); prefs_register_uint_preference(tmsvc_module, "port", "TmSyncro service port", "When set to a value greater than 0 the TmSyncro service is started and accessible via the port number" 10, &tmsvc_port); } Immediately after the prefs_register_uint_preference call I check the tmsvc_port value and its still 0 (and I've tried other initialisation values and they remain unchanged). I was expecting tmsvc_port to be set to the
value I last set by editing the preferences through the Wireshark menu system. If I check with Menu -> Edit -> Preferences -> Protocols -> TmSyncro sure enough the value I last set is there. When does my variable get updated? Or alternatively, how can I retrieve the saved preference value? Thanks and regards...Paul Paul Offord FBCS CITP
|
- Follow-Ups:
- Re: [Wireshark-dev] When is the preference variable updated?
- From: Paul Offord
- Re: [Wireshark-dev] When is the preference variable updated?
- References:
- [Wireshark-dev] When is the preference variable updated?
- From: Paul Offord
- [Wireshark-dev] When is the preference variable updated?
- Prev by Date: [Wireshark-dev] When is the preference variable updated?
- Next by Date: Re: [Wireshark-dev] When is the preference variable updated?
- Previous by thread: [Wireshark-dev] When is the preference variable updated?
- Next by thread: Re: [Wireshark-dev] When is the preference variable updated?
- Index(es):
- Get Wireshark
- Download
- Code of Conduct