aboutsummaryrefslogtreecommitdiffstats
path: root/tools/asn2wrs.py
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2019-04-04 14:49:57 +0200
committerAnders Broman <a.broman58@gmail.com>2019-04-04 13:26:33 +0000
commit7edadf9ce38d3c983d8911200aa46f49ade26f2e (patch)
treebc747e60a2b59d2e9bab81889f7f00c222a19bd1 /tools/asn2wrs.py
parentb0b02ec245b694251488c80cb605dddf66512b03 (diff)
asn2wrs: Improve filtername of named bits.
Change-Id: Ie22137e95c8752a0783e3e9ff99b45c0b79b0d4a Reviewed-on: https://code.wireshark.org/review/32714 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'tools/asn2wrs.py')
-rwxr-xr-xtools/asn2wrs.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/asn2wrs.py b/tools/asn2wrs.py
index aa978b25fa..2554e71070 100755
--- a/tools/asn2wrs.py
+++ b/tools/asn2wrs.py
@@ -1612,8 +1612,13 @@ class EthCtx:
fx.write(' %(TYPE)s, %(DISPLAY)s, %(STRINGS)s, %(BITMASK)s,\n' % attr)
fx.write(' %(BLURB)s, HFILL }},\n' % attr)
for nb in self.named_bit:
+ flt_str = nb['ethname']
+ # cut out hf_
+ flt_str = flt_str[3:]
+ flt_str = flt_str.replace('_' , '.')
+ #print("filter string=%s" % (flt_str))
fx.write(' { &%s,\n' % (nb['ethname']))
- fx.write(' { "%s", "%s.%s",\n' % (nb['name'], self.proto, nb['name']))
+ fx.write(' { "%s", "%s",\n' % (nb['name'], flt_str))
fx.write(' %s, %s, %s, %s,\n' % (nb['ftype'], nb['display'], nb['strings'], nb['bitmask']))
fx.write(' NULL, HFILL }},\n')
self.output.file_close(fx)
@@ -5525,7 +5530,7 @@ class BitStringType (Type):
# Fill the table with "spare_bit" for "un named bits"
if (int(e.val) != 0) and (expected_bit_no != int(e.val)):
while ( expected_bit_no < int(e.val)):
- bits.append((expected_bit_no, ("spare_bit_%u" % (expected_bit_no))))
+ bits.append((expected_bit_no, ("spare_bit%u" % (expected_bit_no))))
expected_bit_no = expected_bit_no + 1
#print ("Adding named bits to list %s bit no %d" % (e.ident, int (e.val)))
bits.append((int(e.val), e.ident))