Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] RRC filters

From: Pascal Quantin <pascal.quantin@xxxxxxxxx>
Date: Sat, 29 Sep 2012 18:57:05 +0200
2012/9/27 Pascal Quantin <pascal.quantin@xxxxxxxxx>
2012/9/26 Anders Broman <a.broman@xxxxxxxxxxxx>
Pascal Quantin skrev 2012-09-26 19:41:


2012/9/25 Lucio Di Giovannantonio <lucio.digiovannantonio@xxxxxxxxx>

Hi pascal, thank you for your resply, maybe "container" could be better?

Regards
Lucio


Hi Lucio,

thanks for your suggestion, I like it. I will wait a few days to see if someone suggests a better wording (or a better approach than my patch proposal in bug 2402 comment 10) and then commit it.

Regards,
Pascal.
For fields like this
    { &hf_rrc_dl_UM_RLC_Mode_01,
      { "dl-UM-RLC-Mode", "rrc.dl_UM_RLC_Mode",
        FT_NONE, BASE_NONE, NULL, 0,
        "DL_UM_RLC_Mode_r5", HFILL }},
    { &hf_rrc_dl_UM_RLC_Mode_02,
      { "dl-UM-RLC-Mode", "rrc.dl_UM_RLC_Mode",
        FT_NONE, BASE_NONE, NULL, 0,
        "DL_UM_RLC_Mode_r6", HFILL }},

Using the blurb or dl_UM_RLC_Mode_01 should be better than the current scheme.

Thanks for the suggestion Anders. I will explore using the blurb and falling back to _container when no blub is available and see what it gives.

Using the examples given by Lucio and Anders and the following patch:
Index: tools/asn2wrs.py
===================================================================
--- tools/asn2wrs.py    (révision 45206)
+++ tools/asn2wrs.py    (copie de travail)
@@ -1581,7 +1581,13 @@
       else:
         blurb = '"%s"' % (t)
       attr = self.eth_hf[f]['attr'].copy()
-      attr['ABBREV'] = '"%s.%s"' % (self.proto, attr['ABBREV'])
+      if attr['TYPE'] == 'FT_NONE':
+        if blurb != 'NULL' and (attr['ABBREV'].lower() in t.lower()):
+          attr['ABBREV'] = '"%s.%s_type"' % (self.proto, t)
+        else:
+          attr['ABBREV'] = '"%s.%s_type"' % (self.proto, attr['ABBREV'])
+      else:
+        attr['ABBREV'] = '"%s.%s"' % (self.proto, attr['ABBREV'])
       if 'BLURB' not in attr:
         attr['BLURB'] = blurb
       fx.write('    { &%s,\n' % (self.eth_hf[f]['fullname']))

the filters become:

    { &hf_rrc_criticalExtensions_117,
      { "criticalExtensions", "rrc.criticalExtensions",
        FT_UINT32, BASE_DEC, VALS(rrc_T_criticalExtensions_117_vals), 0,
        "T_criticalExtensions_117", HFILL }},
    { &hf_rrc_criticalExtensions_118,
      { "criticalExtensions", "rrc.T_criticalExtensions_118_type",
        FT_NONE, BASE_NONE, NULL, 0,
        "T_criticalExtensions_118", HFILL }},
    { &hf_rrc_dl_UM_RLC_Mode_01,
      { "dl-UM-RLC-Mode", "rrc.DL_UM_RLC_Mode_r5_type",
        FT_NONE, BASE_NONE, NULL, 0,
        "DL_UM_RLC_Mode_r5", HFILL }},
    { &hf_rrc_dl_UM_RLC_Mode_02,
      { "dl-UM-RLC-Mode", "rrc.DL_UM_RLC_Mode_r6_type",
        FT_NONE, BASE_NONE, NULL, 0,
        "DL_UM_RLC_Mode_r6", HFILL }},

For now I just systematically rename the FT_NONE filters are those are the one triggering the most incompatible filters. For consistency I was thinking about systematically adding "_type" at the end of the filter (whether we are using the blurb for better filter name or not).
Being a Python newbie, I guess there would be a much smarter way to rename the filters only if they are using conflicting types but I do not have the time to look at it right now. Anyone willing to continue working on it is welcome.

Regards,
Pascal.