2012/9/27 Pascal Quantin <pascal.quan...@gmail.com>

> 2012/9/26 Anders Broman <a.bro...@bredband.net>
>
>>  Pascal Quantin skrev 2012-09-26 19:41:
>>
>>
>>
>> 2012/9/25 Lucio Di Giovannantonio <lucio.digiovannanto...@gmail.com>
>>
>>>
>>> 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.
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@wireshark.org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-requ...@wireshark.org?subject=unsubscribe

Reply via email to