Wireshark mailing list archives
Re: asn2wrs: autodetection for 64 bits X constrained integers
From: Pascal Quantin <pascal.quantin () gmail com>
Date: Wed, 25 Oct 2017 12:29:38 +0200
Hi Pavel, 2017-10-25 8:34 GMT+02:00 Pavel Strnad <strnadp () tiscali cz>:
Hi list,
can we improve auto detection for 64b variant of constrained integers?
In the master branch we handle the cases of integers over/under +/- 2^32
but
what about MIX.. and ..MAX constants?
There are such dissectors in our current source tree: h245, t125, x509,..
that should use 64b instead of current 32b.
Can we use patch like bellow to improve it?
diff --git a/tools/asn2wrs.py b/tools/asn2wrs.py index
76cd10c674..6788bf09cd 100755
--- a/tools/asn2wrs.py
+++ b/tools/asn2wrs.py
@@ -3618,8 +3618,9 @@ class Constraint (Node):
def Needs64b(self, ectx):
(minv, maxv, ext) = self.GetValue(ectx)
- if (str(minv).isdigit() or ((str(minv)[0] == "-") and
str(minv)[1:].isdigit())) \
- and str(maxv).isdigit() and (abs(int(maxv) - int(minv)) >= 2**32):
+ if ((str(minv).isdigit() or ((str(minv)[0] == "-") and
str(minv)[1:].isdigit())) \
+ and str(maxv).isdigit() and (abs(int(maxv) - int(minv)) >= 2**32))
\
+ or (maxv == 'MAX') or (minv == 'MIN'):
return True
return False
This sounds reasonable. See https://code.wireshark.org/review/24049 Best regards, Pascal.
___________________________________________________________________________ Sent via: Wireshark-dev mailing list <wireshark-dev () wireshark org> Archives: https://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev mailto:wireshark-dev-request () wireshark org?subject=unsubscribe
Current thread:
- asn2wrs: autodetection for 64 bits X constrained integers Pavel Strnad (Oct 24)
- Re: asn2wrs: autodetection for 64 bits X constrained integers Pascal Quantin (Oct 25)
- Re: asn2wrs: autodetection for 64 bits X constrained integers Pavel Strnad (Oct 25)
- Re: asn2wrs: autodetection for 64 bits X constrained integers Pascal Quantin (Oct 25)
