aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorkukosa <kukosa@f5534014-38df-0310-8fa8-9805f1628bb7>2007-07-30 08:01:59 +0000
committerkukosa <kukosa@f5534014-38df-0310-8fa8-9805f1628bb7>2007-07-30 08:01:59 +0000
commitfd4b04c3fb47e90c7cbb0a907109fc131fdc894d (patch)
treed28654291f462760aca4ef6985e6ea5946ec91c1 /tools
parent7abe4e71a6f5f73b46c6d4b207f544d5f9d205de (diff)
H.450 regenerated from original ASN.1 sources
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22417 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'tools')
-rwxr-xr-xtools/asn2wrs.py56
1 files changed, 28 insertions, 28 deletions
diff --git a/tools/asn2wrs.py b/tools/asn2wrs.py
index e4757202d3..23505e6e52 100755
--- a/tools/asn2wrs.py
+++ b/tools/asn2wrs.py
@@ -1263,9 +1263,10 @@ class EthCtx:
if self.type[t]['import']:
continue
m = self.type[t]['module']
- if not self.all_tags.has_key(m):
- self.all_tags[m] = {}
- self.all_tags[m][t] = self.type[t]['val'].GetTTag(self)
+ if not self.Per():
+ if not self.all_tags.has_key(m):
+ self.all_tags[m] = {}
+ self.all_tags[m][t] = self.type[t]['val'].GetTTag(self)
if not self.all_type_attr.has_key(m):
self.all_type_attr[m] = {}
self.all_type_attr[m][t] = self.eth_get_type_attr(t).copy()
@@ -4176,20 +4177,31 @@ class ChoiceType (Type):
#print "Choice IndetermTag()=%s" % (str(not self.HasOwnTag()))
return not self.HasOwnTag()
- def get_vals(self, ectx):
+ def detect_tagval(self, ectx):
tagval = False
- if (ectx.Ber()):
- lst = self.elt_list[:]
- if hasattr(self, 'ext_list'):
- lst.extend(self.ext_list)
- if (len(lst) > 0):
- t = lst[0].GetTag(ectx)[0]
- tagval = True
- if (t == 'BER_CLASS_UNI'):
+ lst = self.elt_list[:]
+ if hasattr(self, 'ext_list'):
+ lst.extend(self.ext_list)
+ if (len(lst) > 0) and (not ectx.Per() or lst[0].HasOwnTag()):
+ t = lst[0].GetTag(ectx)[0]
+ tagval = True
+ else:
+ t = ''
+ tagval = False
+ if (t == 'BER_CLASS_UNI'):
+ tagval = False
+ for e in (lst):
+ if not ectx.Per() or e.HasOwnTag():
+ tt = e.GetTag(ectx)[0]
+ else:
+ tt = ''
+ tagval = False
+ if (tt != t):
tagval = False
- for e in (lst):
- if (e.GetTag(ectx)[0] != t):
- tagval = False
+ return tagval
+
+ def get_vals(self, ectx):
+ tagval = self.detect_tagval(ectx)
vals = []
cnt = 0
for e in (self.elt_list):
@@ -4260,19 +4272,7 @@ class ChoiceType (Type):
# end out_item()
#print "eth_type_default_table(tname='%s')" % (tname)
fname = ectx.eth_type[tname]['ref'][0]
- tagval = False
- if (ectx.Ber()):
- lst = self.elt_list[:]
- if hasattr(self, 'ext_list'):
- lst.extend(self.ext_list)
- if (len(lst) > 0):
- t = lst[0].GetTag(ectx)[0]
- tagval = True
- if (t == 'BER_CLASS_UNI'):
- tagval = False
- for e in (lst):
- if (e.GetTag(ectx)[0] != t):
- tagval = False
+ tagval = self.detect_tagval(ectx)
if (ectx.Ber()):
if (ectx.NewBer()):
table = "static const %(ER)s_choice_t %(TABLE)s[] = {\n"