Generate and build M2AP ASN.1 during build time

This commit is contained in:
Robert Schmidt
2022-12-02 15:43:10 +01:00
parent 09b4c65782
commit 2c79b0a438
6 changed files with 388 additions and 52 deletions
+1
View File
@@ -0,0 +1 @@
add_subdirectory(MESSAGES)
@@ -0,0 +1,343 @@
set(M2AP_GRAMMAR ASN1/m2ap-14.0.0.asn)
set(m2ap_source
ANY.c
asn_application.c
asn_bit_data.c
asn_codecs_prim.c
asn_internal.c
asn_random_fill.c
asn_SEQUENCE_OF.c
asn_SET_OF.c
ber_decoder.c
ber_tlv_length.c
ber_tlv_tag.c
BIT_STRING.c
constraints.c
constr_CHOICE.c
constr_SEQUENCE.c
constr_SEQUENCE_OF.c
constr_SET_OF.c
constr_TYPE.c
der_encoder.c
INTEGER.c
M2AP_Active-MBMS-Session-List.c
M2AP_AllocatedSubframesEnd.c
M2AP_AllocationAndRetentionPriority.c
M2AP_BitRate.c
M2AP_Cause.c
M2AP_CauseMisc.c
M2AP_CauseNAS.c
M2AP_CauseProtocol.c
M2AP_CauseRadioNetwork.c
M2AP_CauseTransport.c
M2AP_Cell-Information.c
M2AP_Cell-Information-List.c
M2AP_Common-Subframe-Allocation-Period.c
M2AP_CountingResult.c
M2AP_Criticality.c
M2AP_CriticalityDiagnostics.c
M2AP_CriticalityDiagnostics-IE-List.c
M2AP_ECGI.c
M2AP_ENBConfigurationUpdateAcknowledge.c
M2AP_ENBConfigurationUpdate.c
M2AP_ENBConfigurationUpdateFailure.c
M2AP_ENB-ID.c
M2AP_ENB-MBMS-Configuration-data-ConfigUpdate-Item.c
M2AP_ENB-MBMS-Configuration-data-Item.c
M2AP_ENB-MBMS-Configuration-data-List.c
M2AP_ENB-MBMS-Configuration-data-List-ConfigUpdate.c
M2AP_ENB-MBMS-M2AP-ID.c
M2AP_ENBname.c
M2AP_ErrorIndication.c
M2AP_EUTRANCellIdentifier.c
M2AP_GBR-QosInformation.c
M2AP_GlobalENB-ID.c
M2AP_GlobalMCE-ID.c
M2AP_GTP-TEID.c
M2AP_InitiatingMessage.c
M2AP_IPAddress.c
M2AP_LCID.c
M2AP_M2AP-PDU.c
M2AP_M2SetupFailure.c
M2AP_M2SetupRequest.c
M2AP_M2SetupResponse.c
M2AP_MBMS-Cell-List.c
M2AP_MBMS-Counting-Request-Session.c
M2AP_MBMS-Counting-Request-SessionIE.c
M2AP_MBMS-Counting-Result.c
M2AP_MBMS-Counting-Result-List.c
M2AP_MBMS-E-RAB-QoS-Parameters.c
M2AP_MbmsOverloadNotification.c
M2AP_MbmsSchedulingInformation.c
M2AP_MbmsSchedulingInformationResponse.c
M2AP_MBMS-Service-Area.c
M2AP_MBMS-Service-Area-ID-List.c
M2AP_MBMS-Service-associatedLogicalM2-ConnectionItem.c
M2AP_MBMS-Service-associatedLogicalM2-ConnectionListResAck.c
M2AP_MBMS-Service-associatedLogicalM2-ConnectionListRes.c
M2AP_MbmsServiceCountingFailure.c
M2AP_MbmsServiceCountingRequest.c
M2AP_MbmsServiceCountingResponse.c
M2AP_MbmsServiceCountingResultsReport.c
M2AP_MBMS-Session-ID.c
M2AP_MBMSsessionListPerPMCH-Item.c
M2AP_MBMSsessionsToBeSuspendedListPerPMCH-Item.c
M2AP_MBMS-Suspension-Notification-Item.c
M2AP_MBMS-Suspension-Notification-List.c
M2AP_MBSFN-Area-Configuration-List.c
M2AP_MBSFN-Area-ID.c
M2AP_MBSFN-Subframe-Configuration.c
M2AP_MBSFN-Subframe-ConfigurationList.c
M2AP_MBSFN-SynchronisationArea-ID.c
M2AP_MCCHrelatedBCCH-ConfigPerMBSFNArea.c
M2AP_MCCHrelatedBCCH-ConfigPerMBSFNArea-Item.c
M2AP_MCCH-Update-Time.c
M2AP_MCEConfigurationUpdateAcknowledge.c
M2AP_MCEConfigurationUpdate.c
M2AP_MCEConfigurationUpdateFailure.c
M2AP_MCE-ID.c
M2AP_MCE-MBMS-M2AP-ID.c
M2AP_MCEname.c
M2AP_MCH-Scheduling-Period.c
M2AP_MCH-Scheduling-PeriodExtended2.c
M2AP_MCH-Scheduling-PeriodExtended.c
M2AP_Modification-PeriodExtended.c
M2AP_Modulation-Coding-Scheme2.c
M2AP_Overload-Status-Per-PMCH-List.c
M2AP_PLMN-Identity.c
M2AP_PMCH-Configuration.c
M2AP_PMCH-Configuration-Item.c
M2AP_PMCH-Configuration-List.c
M2AP_PMCH-Overload-Status.c
M2AP_Pre-emptionCapability.c
M2AP_Pre-emptionVulnerability.c
M2AP_Presence.c
M2AP_PriorityLevel.c
M2AP_PrivateIE-Container.c
M2AP_PrivateIE-Field.c
M2AP_PrivateIE-ID.c
M2AP_PrivateMessage.c
M2AP_ProcedureCode.c
M2AP_ProtocolExtensionContainer.c
M2AP_ProtocolExtensionField.c
M2AP_ProtocolIE-Container.c
M2AP_ProtocolIE-ContainerList.c
M2AP_ProtocolIE-ContainerPair.c
M2AP_ProtocolIE-ContainerPairList.c
M2AP_ProtocolIE-Field.c
M2AP_ProtocolIE-FieldPair.c
M2AP_ProtocolIE-ID.c
M2AP_ProtocolIE-Single-Container.c
M2AP_QCI.c
M2AP_Repetition-PeriodExtended.c
M2AP_ResetAcknowledge.c
M2AP_ResetAll.c
M2AP_Reset.c
M2AP_ResetType.c
M2AP_SC-PTM-Information.c
M2AP_SessionStartFailure.c
M2AP_SessionStartRequest.c
M2AP_SessionStartResponse.c
M2AP_SessionStopRequest.c
M2AP_SessionStopResponse.c
M2AP_SessionUpdateFailure.c
M2AP_SessionUpdateRequest.c
M2AP_SessionUpdateResponse.c
M2AP_SFN.c
M2AP_Subcarrier-SpacingMBMS.c
M2AP_SubframeAllocationExtended.c
M2AP_SuccessfulOutcome.c
M2AP_TimeToWait.c
M2AP_TMGI.c
M2AP_TNL-Information.c
M2AP_TriggeringMessage.c
M2AP_TypeOfError.c
M2AP_UnsuccessfulOutcome.c
NativeEnumerated.c
NativeInteger.c
OBJECT_IDENTIFIER.c
OCTET_STRING.c
OPEN_TYPE.c
per_decoder.c
per_encoder.c
per_opentype.c
per_support.c
PrintableString.c
xer_decoder.c
xer_encoder.c
xer_support.c
)
set(m2ap_headers
ANY.h
asn_application.h
asn_bit_data.h
asn_codecs.h
asn_codecs_prim.h
asn_internal.h
asn_ioc.h
asn_random_fill.h
asn_SEQUENCE_OF.h
asn_SET_OF.h
asn_system.h
ber_decoder.h
ber_tlv_length.h
ber_tlv_tag.h
BIT_STRING.h
constraints.h
constr_CHOICE.h
constr_SEQUENCE.h
constr_SEQUENCE_OF.h
constr_SET_OF.h
constr_TYPE.h
der_encoder.h
INTEGER.h
M2AP_Active-MBMS-Session-List.h
M2AP_AllocatedSubframesEnd.h
M2AP_AllocationAndRetentionPriority.h
M2AP_asn_constant.h
M2AP_BitRate.h
M2AP_Cause.h
M2AP_CauseMisc.h
M2AP_CauseNAS.h
M2AP_CauseProtocol.h
M2AP_CauseRadioNetwork.h
M2AP_CauseTransport.h
M2AP_Cell-Information.h
M2AP_Cell-Information-List.h
M2AP_Common-Subframe-Allocation-Period.h
M2AP_CountingResult.h
M2AP_CriticalityDiagnostics.h
M2AP_CriticalityDiagnostics-IE-List.h
M2AP_Criticality.h
M2AP_ECGI.h
M2AP_ENBConfigurationUpdateAcknowledge.h
M2AP_ENBConfigurationUpdateFailure.h
M2AP_ENBConfigurationUpdate.h
M2AP_ENB-ID.h
M2AP_ENB-MBMS-Configuration-data-ConfigUpdate-Item.h
M2AP_ENB-MBMS-Configuration-data-Item.h
M2AP_ENB-MBMS-Configuration-data-List-ConfigUpdate.h
M2AP_ENB-MBMS-Configuration-data-List.h
M2AP_ENB-MBMS-M2AP-ID.h
M2AP_ENBname.h
M2AP_ErrorIndication.h
M2AP_EUTRANCellIdentifier.h
M2AP_GBR-QosInformation.h
M2AP_GlobalENB-ID.h
M2AP_GlobalMCE-ID.h
M2AP_GTP-TEID.h
M2AP_InitiatingMessage.h
M2AP_IPAddress.h
M2AP_LCID.h
M2AP_M2AP-PDU.h
M2AP_M2SetupFailure.h
M2AP_M2SetupRequest.h
M2AP_M2SetupResponse.h
M2AP_MBMS-Cell-List.h
M2AP_MBMS-Counting-Request-Session.h
M2AP_MBMS-Counting-Request-SessionIE.h
M2AP_MBMS-Counting-Result.h
M2AP_MBMS-Counting-Result-List.h
M2AP_MBMS-E-RAB-QoS-Parameters.h
M2AP_MbmsOverloadNotification.h
M2AP_MbmsSchedulingInformation.h
M2AP_MbmsSchedulingInformationResponse.h
M2AP_MBMS-Service-Area.h
M2AP_MBMS-Service-Area-ID-List.h
M2AP_MBMS-Service-associatedLogicalM2-ConnectionItem.h
M2AP_MBMS-Service-associatedLogicalM2-ConnectionListResAck.h
M2AP_MBMS-Service-associatedLogicalM2-ConnectionListRes.h
M2AP_MbmsServiceCountingFailure.h
M2AP_MbmsServiceCountingRequest.h
M2AP_MbmsServiceCountingResponse.h
M2AP_MbmsServiceCountingResultsReport.h
M2AP_MBMS-Session-ID.h
M2AP_MBMSsessionListPerPMCH-Item.h
M2AP_MBMSsessionsToBeSuspendedListPerPMCH-Item.h
M2AP_MBMS-Suspension-Notification-Item.h
M2AP_MBMS-Suspension-Notification-List.h
M2AP_MBSFN-Area-Configuration-List.h
M2AP_MBSFN-Area-ID.h
M2AP_MBSFN-Subframe-Configuration.h
M2AP_MBSFN-Subframe-ConfigurationList.h
M2AP_MBSFN-SynchronisationArea-ID.h
M2AP_MCCHrelatedBCCH-ConfigPerMBSFNArea.h
M2AP_MCCHrelatedBCCH-ConfigPerMBSFNArea-Item.h
M2AP_MCCH-Update-Time.h
M2AP_MCEConfigurationUpdateAcknowledge.h
M2AP_MCEConfigurationUpdateFailure.h
M2AP_MCEConfigurationUpdate.h
M2AP_MCE-ID.h
M2AP_MCE-MBMS-M2AP-ID.h
M2AP_MCEname.h
M2AP_MCH-Scheduling-PeriodExtended2.h
M2AP_MCH-Scheduling-PeriodExtended.h
M2AP_MCH-Scheduling-Period.h
M2AP_Modification-PeriodExtended.h
M2AP_Modulation-Coding-Scheme2.h
M2AP_Overload-Status-Per-PMCH-List.h
M2AP_PLMN-Identity.h
M2AP_PMCH-Configuration.h
M2AP_PMCH-Configuration-Item.h
M2AP_PMCH-Configuration-List.h
M2AP_PMCH-Overload-Status.h
M2AP_Pre-emptionCapability.h
M2AP_Pre-emptionVulnerability.h
M2AP_Presence.h
M2AP_PriorityLevel.h
M2AP_PrivateIE-Container.h
M2AP_PrivateIE-Field.h
M2AP_PrivateIE-ID.h
M2AP_PrivateMessage.h
M2AP_ProcedureCode.h
M2AP_ProtocolExtensionContainer.h
M2AP_ProtocolExtensionField.h
M2AP_ProtocolIE-Container.h
M2AP_ProtocolIE-ContainerList.h
M2AP_ProtocolIE-ContainerPair.h
M2AP_ProtocolIE-ContainerPairList.h
M2AP_ProtocolIE-Field.h
M2AP_ProtocolIE-FieldPair.h
M2AP_ProtocolIE-ID.h
M2AP_ProtocolIE-Single-Container.h
M2AP_QCI.h
M2AP_Repetition-PeriodExtended.h
M2AP_ResetAcknowledge.h
M2AP_ResetAll.h
M2AP_Reset.h
M2AP_ResetType.h
M2AP_SC-PTM-Information.h
M2AP_SessionStartFailure.h
M2AP_SessionStartRequest.h
M2AP_SessionStartResponse.h
M2AP_SessionStopRequest.h
M2AP_SessionStopResponse.h
M2AP_SessionUpdateFailure.h
M2AP_SessionUpdateRequest.h
M2AP_SessionUpdateResponse.h
M2AP_SFN.h
M2AP_Subcarrier-SpacingMBMS.h
M2AP_SubframeAllocationExtended.h
M2AP_SuccessfulOutcome.h
M2AP_TimeToWait.h
M2AP_TMGI.h
M2AP_TNL-Information.h
M2AP_TriggeringMessage.h
M2AP_TypeOfError.h
M2AP_UnsuccessfulOutcome.h
NativeEnumerated.h
NativeInteger.h
OBJECT_IDENTIFIER.h
OCTET_STRING.h
OPEN_TYPE.h
per_decoder.h
per_encoder.h
per_opentype.h
per_support.h
PrintableString.h
xer_decoder.h
xer_encoder.h
xer_support.h
)
+29
View File
@@ -0,0 +1,29 @@
set(M2AP_VERSION 14 0 0)
make_version(M2AP_cc ${M2AP_VERSION})
string(REPLACE ";" "." M2AP_RELEASE "${M2AP_VERSION}")
if(M2AP_RELEASE VERSION_EQUAL "16.3.1")
include(ASN1/m2ap-16.3.1.cmake)
elseif(M2AP_RELEASE VERSION_EQUAL "8.9.0")
include(ASN1/m2ap-8.9.0.cmake)
elseif(M2AP_RELEASE VERSION_EQUAL "11.9.0")
include(ASN1/m2ap-11.9.0.cmake)
elseif(M2AP_RELEASE VERSION_EQUAL "12.9.0")
include(ASN1/m2ap-12.9.0.cmake)
elseif(M2AP_RELEASE VERSION_EQUAL "14.0.0")
include(ASN1/m2ap-14.0.0.cmake)
elseif(M2AP_RELEASE VERSION_EQUAL "15.1.0")
include(ASN1/m2ap-15.1.0.cmake)
else()
message(FATAL_ERROR "unknown M2AP_RELEASE ${M2AP_RELEASE}")
endif()
add_custom_command(OUTPUT ${m2ap_source} ${m2ap_headers}
COMMAND ASN1C_PREFIX=M2AP_ asn1c -gen-PER -no-gen-OER -fcompound-names -no-gen-example -fno-include-deps -D ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${M2AP_GRAMMAR}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${M2AP_GRAMMAR}
COMMENT "Generating M2AP source files from ${CMAKE_CURRENT_SOURCE_DIR}/${M2AP_GRAMMAR}"
)
add_library(asn1_m2ap ${m2ap_source})
target_include_directories(asn1_m2ap PUBLIC "${CMAKE_CURRENT_BINARY_DIR}")
target_compile_options(asn1_m2ap PRIVATE -DASN_DISABLE_OER_SUPPORT -w)