diff options
author | Christophe GUERBER <christophe.guerber@gmail.com> | 2018-12-30 00:36:03 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2018-12-30 07:43:51 +0000 |
commit | f4b0b21092e6939d0ae7f2565e99ca5744acb894 (patch) | |
tree | 5a6f5ddf954f4dccd35828a62b3f4d8de29281cf /tools/asn2wrs.py | |
parent | aaf709da67942087470f98f0fc5ba92faf15176a (diff) |
Fixes ASN.1 generation for VALS using 64 bits
VALS generation did not take into account the constraints on integers.
We now generate VALS if no constraints are present and VALS64 if the
interger needs 64 bits.
Change-Id: Ia044ee1ba1bd5b45554c19a458876e20110b1b7f
Reviewed-on: https://code.wireshark.org/review/31252
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'tools/asn2wrs.py')
-rwxr-xr-x | tools/asn2wrs.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/asn2wrs.py b/tools/asn2wrs.py index 7b57b9fcd4..9bf4d3a2d9 100755 --- a/tools/asn2wrs.py +++ b/tools/asn2wrs.py @@ -1202,7 +1202,10 @@ class EthCtx: if (use_ext): self.eth_type[nm]['attr']['STRINGS'] = '&%s_ext' % (self.eth_vals_nm(nm)) else: - self.eth_type[nm]['attr']['STRINGS'] = 'VALS(%s)' % (self.eth_vals_nm(nm)) + if self.eth_type[nm]['val'].HasConstraint() and self.eth_type[nm]['val'].constr.Needs64b(self): + self.eth_type[nm]['attr']['STRINGS'] = 'VALS64(%s)' % (self.eth_vals_nm(nm)) + else: + self.eth_type[nm]['attr']['STRINGS'] = 'VALS(%s)' % (self.eth_vals_nm(nm)) self.eth_type[nm]['attr'].update(self.conform.use_item('ETYPE_ATTR', nm)) for t in self.eth_type_ord: bits = self.eth_type[t]['val'].eth_named_bits() |