• Bi-Ruei, Chiu's avatar
    Fix code generated from ASN.1 of F1AP v15.4.0 failed to be compiled · 4e7edb05
    Bi-Ruei, Chiu authored
    ProtocolExtensionField.c generated from the following excerpt from ASN.1 of F1AP v15.4.0 :
    
    RRC-Version ::= SEQUENCE {
        latest-RRC-Version BIT STRING (SIZE(3)),
        iE-Extensions      ProtocolExtensionContainer { { RRC-Version-ExtIEs } } OPTIONAL}
    
    RRC-Version-ExtIEs F1AP-PROTOCOL-EXTENSION ::= {
        {ID id-latest-RRC-Version-Enhanced CRITICALITY ignore EXTENSION OCTET STRING (SIZE(3)) PRESENCE optional },
        ...
    }
    
    failed to be compiled because asn_PER_memb_OCTET_STRING_SIZE_3__constr_31 is not generated.
    
    The reason is constraints of types used in information object sets are not processed in asn1fix() stage
    so it's constraint, i.e. (SIZE(3)) in this case, is not generated.
    
    With this fix, OCTET STRING (SIZE(3)) used in ASN.1 of F1AP v15.4.0 can be correctly processed
    and generated code can be compiled.
    
    However, this fix does not work for all sorts of types.
    
    For example, if information object refer to a type like this : SEQUENCE (SIZE(3)) OF INTEGER
    it will be failed to compiled because asn_IOS_RRC_Version_ExtIEs_1_rows[] refers to non-existing
    asn_DEF_SEQUENCE_OF.
    4e7edb05
asn1fix.c 13.8 KB