aboutsummaryrefslogtreecommitdiffstats
path: root/tools/asn2wrs.py
diff options
context:
space:
mode:
authorChristophe GUERBER <christophe.guerber@gmail.com>2019-01-01 14:53:41 +0100
committerMichael Mann <mmann78@netscape.net>2019-01-01 14:59:28 +0000
commitb9473c46f72d7d8d931496d019f0cecb8430ff31 (patch)
treefec1c6a0d5fa28fdddc31e20d2f077a1cee9dc09 /tools/asn2wrs.py
parenta05ba5be694635211486a2e1f131b5ae2ffadc51 (diff)
Fix asn2wrs.py: always add BASE_VAL64_STRING
In some cases (e.g. when a field has a user defined dissection function) the type reported for this field is a 'virtual' one and the latter is not contained in selt.type. Consequently, BASE_VAL64_STRING is not set. Function eth_get_type_attr should return all the attributes of a type and it seems resonable to expect it to return the BASE_VAL64_STRING. This will solve the above mentioned error and may solve any possible issue in other parts that call this function. Change-Id: Iaee9ce5bd30f2a768cfcecf628df23bf1ed54e55 Reviewed-on: https://code.wireshark.org/review/31287 Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'tools/asn2wrs.py')
-rwxr-xr-xtools/asn2wrs.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/tools/asn2wrs.py b/tools/asn2wrs.py
index ca81a8786d..b7f529e627 100755
--- a/tools/asn2wrs.py
+++ b/tools/asn2wrs.py
@@ -707,6 +707,8 @@ class EthCtx:
else:
attr.update(self.type[t]['attr'])
attr.update(self.eth_type[self.type[t]['ethname']]['attr'])
+ if attr['STRINGS'].startswith('VALS64('):
+ attr['DISPLAY'] += '|BASE_VAL64_STRING'
#print " ", attr
return attr
@@ -1320,12 +1322,6 @@ class EthCtx:
use_vals_ext = self.eth_type[ethtype].get('vals_ext')
if (use_vals_ext):
attr['DISPLAY'] += '|BASE_EXT_STRING'
- if ethtype in self.type \
- and self.type[ethtype]['attr'].get('STRINGS') == '$$' \
- and self.eth_type[ethtype]['val'].type == 'IntegerType' \
- and self.eth_type[ethtype]['val'].HasConstraint() \
- and self.eth_type[ethtype]['val'].constr.Needs64b(self):
- attr['DISPLAY'] += '|BASE_VAL64_STRING'
self.eth_hf[nm] = {'fullname' : fullname, 'pdu' : self.field[f]['pdu'],
'ethtype' : ethtype, 'modified' : self.field[f]['modified'],
'attr' : attr.copy(),