asn1c: The new version per_decode NGAP protocol NGSetupResopnse error
Hi,When using aper_decode to decode the following hexadecimal string, it prompts a decoding failure. It can be encoded into this hexadecimal string using XER format XML, but it cannot be decoded onto the PDU. The old version of asn1c can decode the following hexadecimal string. Has the decoding file been modified. Thanks!
This version can decode asn1c-vlm_master.zip
asn file used wireshark,
- NGAP-CommonDataTypes.asn
- NGAP-Constants.asn
- NGAP-Containers.asn
- NGAP-IEs.asn
- NGAP-PDU-Contents.asn
- NGAP-PDU-Descriptions.asn
The command to generate NGAP PDU structure source code is as follows:
ASN1C_PREFIX=NGAP_ asn1c -pdu=all -fcompound-names -findirect-choice -fno-include-deps ./asn_file/ngap/*.asn
hexstring:201500520000040001000a03803567732d616d663000600008000064f62902004000564001ff0050002c3064f629000010080000010064f629000010080000020064f629000010080000030064f62900001008000004
old asn1c decode xer pdu :
<NGAP-PDU>
<successfulOutcome>
<procedureCode>21</procedureCode>
<criticality><reject/></criticality>
<value>
<NGSetupResponse>
<protocolIEs>
<NGSetupResponseIEs>
<id>1</id>
<criticality><reject/></criticality>
<value>
<AMFName>5gs-amf0</AMFName>
</value>
</NGSetupResponseIEs>
<NGSetupResponseIEs>
<id>96</id>
<criticality><reject/></criticality>
<value>
<ServedGUAMIList>
<ServedGUAMIItem>
<gUAMI>
<pLMNIdentity>64 F6 29</pLMNIdentity>
<aMFRegionID>
00000010
</aMFRegionID>
<aMFSetID>
0000000001
</aMFSetID>
<aMFPointer>
000000
</aMFPointer>
</gUAMI>
</ServedGUAMIItem>
</ServedGUAMIList>
</value>
</NGSetupResponseIEs>
<NGSetupResponseIEs>
<id>86</id>
<criticality><ignore/></criticality>
<value>
<RelativeAMFCapacity>255</RelativeAMFCapacity>
</value>
</NGSetupResponseIEs>
<NGSetupResponseIEs>
<id>80</id>
<criticality><reject/></criticality>
<value>
<PLMNSupportList>
<PLMNSupportItem>
<pLMNIdentity>64 F6 29</pLMNIdentity>
<sliceSupportList>
<SliceSupportItem>
<s-NSSAI>
<sST>01</sST>
<sD>00 00 01</sD>
</s-NSSAI>
</SliceSupportItem>
</sliceSupportList>
</PLMNSupportItem>
<PLMNSupportItem>
<pLMNIdentity>64 F6 29</pLMNIdentity>
<sliceSupportList>
<SliceSupportItem>
<s-NSSAI>
<sST>01</sST>
<sD>00 00 02</sD>
</s-NSSAI>
</SliceSupportItem>
</sliceSupportList>
</PLMNSupportItem>
<PLMNSupportItem>
<pLMNIdentity>64 F6 29</pLMNIdentity>
<sliceSupportList>
<SliceSupportItem>
<s-NSSAI>
<sST>01</sST>
<sD>00 00 03</sD>
</s-NSSAI>
</SliceSupportItem>
</sliceSupportList>
</PLMNSupportItem>
<PLMNSupportItem>
<pLMNIdentity>64 F6 29</pLMNIdentity>
<sliceSupportList>
<SliceSupportItem>
<s-NSSAI>
<sST>01</sST>
<sD>00 00 04</sD>
</s-NSSAI>
</SliceSupportItem>
</sliceSupportList>
</PLMNSupportItem>
</PLMNSupportList>
</value>
</NGSetupResponseIEs>
</protocolIEs>
</NGSetupResponse>
</value>
</successfulOutcome>
</NGAP-PDU>
old asn1c asn_print:
SuccessfulOutcome ::= {
procedureCode: 21
criticality: 0 (reject)
value: NGSetupResponse ::= {
protocolIEs: ProtocolIE-Container ::= {
NGSetupResponseIEs ::= {
id: 1
criticality: 0 (reject)
value: 5gs-amf0
}
NGSetupResponseIEs ::= {
id: 96
criticality: 0 (reject)
value: ServedGUAMIList ::= {
ServedGUAMIItem ::= {
gUAMI: GUAMI ::= {
pLMNIdentity: 64 F6 29
aMFRegionID: 02
aMFSetID: 00 40 (6 bits unused)
aMFPointer: 00 (2 bits unused)
}
}
}
}
NGSetupResponseIEs ::= {
id: 86
criticality: 1 (ignore)
value: 255
}
NGSetupResponseIEs ::= {
id: 80
criticality: 0 (reject)
value: PLMNSupportList ::= {
PLMNSupportItem ::= {
pLMNIdentity: 64 F6 29
sliceSupportList: SliceSupportList ::= {
SliceSupportItem ::= {
s-NSSAI: S-NSSAI ::= {
sST: 01
sD: 00 00 01
}
}
}
}
PLMNSupportItem ::= {
pLMNIdentity: 64 F6 29
sliceSupportList: SliceSupportList ::= {
SliceSupportItem ::= {
s-NSSAI: S-NSSAI ::= {
sST: 01
sD: 00 00 02
}
}
}
}
PLMNSupportItem ::= {
pLMNIdentity: 64 F6 29
sliceSupportList: SliceSupportList ::= {
SliceSupportItem ::= {
s-NSSAI: S-NSSAI ::= {
sST: 01
sD: 00 00 03
}
}
}
}
PLMNSupportItem ::= {
pLMNIdentity: 64 F6 29
sliceSupportList: SliceSupportList ::= {
SliceSupportItem ::= {
s-NSSAI: S-NSSAI ::= {
sST: 01
sD: 00 00 04
}
}
}
}
}
}
}
}
}
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 30 (15 by maintainers)
Commit
5fa129cmay also be related given the comments there.You are right!
Here’s what I found after retesting the scenario: Initially, I reverted the commit 998e7ea. When I attempted to decode, the operation failed and returned a status code of 2. Subsequently, I reapplied the 998e7ea commit and then reverted the 5fa129c commit. This time, the decoding process succeeded. This indicates that the 5fa129c commit introduced an issue specifically with decoding the OCTET STRING type. When inspecting the value of cval->range_fits, it displayed as 7.