diff options
-rw-r--r-- | epan/dissectors/packet-h245.c | 16 | ||||
-rwxr-xr-x | tools/asn2wrs.py | 10 |
2 files changed, 16 insertions, 10 deletions
diff --git a/epan/dissectors/packet-h245.c b/epan/dissectors/packet-h245.c index a4ec2f184f..4648b2a8b8 100644 --- a/epan/dissectors/packet-h245.c +++ b/epan/dissectors/packet-h245.c @@ -5979,7 +5979,7 @@ dissect_h245_NoPTAudioTelephonyEventCapability(tvbuff_t *tvb _U_, int offset _U_ static const per_sequence_t NoPTAudioToneCapability_sequence[] = { - { NULL, 0, 0, NULL } + { NULL, ASN1_EXTENSION_ROOT, 0, NULL } }; static int @@ -7031,7 +7031,7 @@ dissect_h245_DepFECData(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, static const per_sequence_t T_mode_rfc2733sameport_sequence[] = { - { NULL, 0, 0, NULL } + { NULL, ASN1_EXTENSION_ROOT, 0, NULL } }; static int @@ -10220,7 +10220,7 @@ dissect_h245_MaintenanceLoopRequest(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_ static const per_sequence_t CommunicationModeRequest_sequence[] = { - { NULL, 0, 0, NULL } + { NULL, ASN1_EXTENSION_ROOT, 0, NULL } }; static int @@ -12327,7 +12327,7 @@ dissect_h245_ResponseMessage(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx static const per_sequence_t MaintenanceLoopOffCommand_sequence[] = { - { NULL, 0, 0, NULL } + { NULL, ASN1_EXTENSION_ROOT, 0, NULL } }; static int @@ -13390,7 +13390,7 @@ dissect_h245_FunctionNotUnderstood(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t static const per_sequence_t MasterSlaveDeterminationRelease_sequence[] = { - { NULL, 0, 0, NULL } + { NULL, ASN1_EXTENSION_ROOT, 0, NULL } }; static int @@ -13489,7 +13489,7 @@ dissect_h245_RequestMultiplexEntryRelease(tvbuff_t *tvb _U_, int offset _U_, asn static const per_sequence_t RequestModeRelease_sequence[] = { - { NULL, 0, 0, NULL } + { NULL, ASN1_EXTENSION_ROOT, 0, NULL } }; static int @@ -14252,7 +14252,7 @@ dissect_h245_FunctionNotSupported(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t static const per_sequence_t T_crcDesired_sequence[] = { - { NULL, 0, 0, NULL } + { NULL, ASN1_EXTENSION_ROOT, 0, NULL } }; static int @@ -14303,7 +14303,7 @@ dissect_h245_MultilinkIndication(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t * static const per_sequence_t LogicalChannelRateRelease_sequence[] = { - { NULL, 0, 0, NULL } + { NULL, ASN1_EXTENSION_ROOT, 0, NULL } }; static int diff --git a/tools/asn2wrs.py b/tools/asn2wrs.py index feaf9f8e11..b256650c5d 100755 --- a/tools/asn2wrs.py +++ b/tools/asn2wrs.py @@ -3929,6 +3929,9 @@ class SeqType (SqType): ext = 'ASN1_EXTENSION_ROOT' else: ext = 'ASN1_NO_EXTENSIONS' + empty_ext_flag = '0' + if (len(self.elt_list)==0) and hasattr(self, 'ext_list') and (len(self.ext_list)==0) and (not hasattr(self, 'elt_list2') or (len(self.elt_list2)==0)): + empty_ext_flag = ext for e in (self.elt_list): f = fname + '/' + e.val.name table += self.out_item(f, e.val, e.optional, ext, ectx) @@ -3943,7 +3946,7 @@ class SeqType (SqType): if (ectx.Ber()): table += " { NULL, 0, 0, 0, NULL }\n};\n" else: - table += " { NULL, 0, 0, NULL }\n};\n" + table += " { NULL, %s, 0, NULL }\n};\n" % (empty_ext_flag) return table #--- SeqOfType ----------------------------------------------------------- @@ -4423,6 +4426,9 @@ class ChoiceType (Type): ext = 'ASN1_EXTENSION_ROOT' else: ext = 'ASN1_NO_EXTENSIONS' + empty_ext_flag = '0' + if (len(self.elt_list)==0) and hasattr(self, 'ext_list') and (len(self.ext_list)==0): + empty_ext_flag = ext for e in (self.elt_list): if (tagval): val = e.GetTag(ectx)[1] else: val = str(cnt) @@ -4437,7 +4443,7 @@ class ChoiceType (Type): if (ectx.Ber()): table += " { 0, NULL, 0, 0, 0, NULL }\n};\n" else: - table += " { 0, NULL, 0, NULL }\n};\n" + table += " { 0, NULL, %s, NULL }\n};\n" % (empty_ext_flag) return table def eth_type_default_body(self, ectx, tname): |