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.