From f4b0b21092e6939d0ae7f2565e99ca5744acb894 Mon Sep 17 00:00:00 2001 From: Christophe GUERBER Date: Sun, 30 Dec 2018 00:36:03 +0100 Subject: 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 --- tools/asn2wrs.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tools/asn2wrs.py') 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() -- cgit v1.2.3