Commit 21a252a2 authored by Robert Schmidt's avatar Robert Schmidt

Generate and build M3AP ASN.1 during build time

parent 2c79b0a4
......@@ -454,50 +454,10 @@ target_link_libraries(m2ap PRIVATE lte_rrc nr_rrc)
target_include_directories(m2ap PRIVATE "${M2AP_DIR}")
#M3AP
# Same limitation as described in RRC/S1AP: unknown generated file list
# so we generate it at cmake time
##############
add_list1_option(M3AP_RELEASE R14 "M3AP ASN.1 grammar version" R14)
set(M3AP_DIR ${OPENAIR3_DIR}/M3AP)
if (${M3AP_RELEASE} STREQUAL "R8")
make_version(M3AP_VERSION 8 9 0)
set(M3AP_ASN_FILES m3ap-8.9.0.asn1)
elseif (${M3AP_RELEASE} STREQUAL "R11")
make_version(M3AP_VERSION 11 9 0)
set(M3AP_ASN_FILES m3ap-11.9.0.asn1)
elseif (${M3AP_RELEASE} STREQUAL "R12")
make_version(M3AP_VERSION 12 9 0)
set(M3AP_ASN_FILES m3ap-12.9.0.asn1)
elseif (${M3AP_RELEASE} STREQUAL "R14")
make_version(M3AP_VERSION 14 0 0)
set(M3AP_ASN_FILES m3ap-14.0.0.asn1)
elseif (${M3AP_RELEASE} STREQUAL "R15")
make_version(M3AP_VERSION 15 1 0)
set(M3AP_ASN_FILES m3ap-15.1.0.asn1)
endif(${M3AP_RELEASE} STREQUAL "R8")
add_definitions(-DM3AP_VERSION=${M3AP_VERSION})
set(M3AP_ASN_DIR ${M3AP_DIR}/MESSAGES/ASN1/${M3AP_RELEASE})
set(M3AP_C_DIR ${asn1_generated_dir}/M3AP_${M3AP_RELEASE})
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
set(m3_cmd ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "M3AP_" -fno-include-deps "${M3AP_C_DIR}")
compile_asn1("${M3AP_ASN_DIR}/${M3AP_ASN_FILES}" "${m3_cmd}" m3_flag)
file(GLOB M3AP_source ${M3AP_C_DIR}/*.c)
add_library(M3AP_LIB
${M3AP_source}
add_library(m3ap
${M3AP_DIR}/m3ap_common.c
)
add_dependencies(M3AP_LIB m3_flag)
target_link_libraries(M3AP_LIB PRIVATE asn1_nr_rrc asn1_lte_rrc)
include_directories ("${M3AP_C_DIR}")
include_directories ("${M3AP_DIR}")
add_library(M3AP_ENB
${M3AP_DIR}/m3ap_decoder.c
${M3AP_DIR}/m3ap_encoder.c
${M3AP_DIR}/m3ap_MCE_handler.c
......@@ -511,10 +471,11 @@ add_library(M3AP_ENB
${M3AP_DIR}/m3ap_itti_messaging.c
${M3AP_DIR}/m3ap_ids.c
${M3AP_DIR}/m3ap_timers.c
)
add_dependencies(M3AP_ENB m3_flag)
target_link_libraries(M3AP_ENB PRIVATE asn1_nr_rrc asn1_lte_rrc)
)
target_link_libraries(m3ap PUBLIC asn1_m3ap)
target_link_libraries(m3ap PRIVATE m2ap)
target_link_libraries(m3ap PRIVATE asn1_nr_rrc asn1_lte_rrc)
target_include_directories(m3ap PUBLIC "${M3AP_DIR}")
#X2AP
##############
......@@ -1754,7 +1715,6 @@ add_library(L2
${ENB_APP_SRC}
${MCE_APP_SRC}
)
add_dependencies(L2 m3_flag)
target_link_libraries(L2 PRIVATE f1ap x2ap s1ap lte_rrc m2ap)
target_link_libraries(L2 PRIVATE asn1_nr_rrc asn1_lte_rrc)
......@@ -1836,8 +1796,7 @@ set (MME_APP_SRC
${OPENAIR3_DIR}/MME_APP/mme_config.c
)
add_library(MME_APP ${MME_APP_SRC})
add_dependencies(MME_APP m3_flag)
target_link_libraries(MME_APP PRIVATE m2ap)
target_link_libraries(MME_APP PRIVATE m2ap m3ap)
target_link_libraries(MME_APP PRIVATE asn1_nr_rrc asn1_lte_rrc)
set(SCTP_SRC
......@@ -2369,7 +2328,7 @@ add_dependencies(lte-softmodem oai_iqplayer)
target_link_libraries(lte-softmodem PRIVATE
-Wl,--start-group
lte_rrc nr_rrc s1ap m2ap x2ap M3AP_LIB M3AP_ENB GTPV1U f1ap SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB
lte_rrc nr_rrc s1ap m2ap x2ap m3ap GTPV1U f1ap SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB
PHY_COMMON PHY PHY_RU L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB
${RAL_LIB} ${NAS_UE_LIB} ITTI
-Wl,--end-group z dl)
......@@ -2409,7 +2368,7 @@ add_dependencies(ocp-enb oai_iqplayer coding params_libconfig rfsimulator)
target_link_libraries (ocp-enb
-Wl,--start-group
lte_rrc nr_rrc s1ap f1ap m2ap x2ap M3AP_LIB M3AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB
lte_rrc nr_rrc s1ap f1ap m2ap x2ap m3ap GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB
PHY_COMMON PHY PHY_RU L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB MISC_NFAPI_LTE_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB SIMU_COMMON
${RAL_LIB} ${NAS_UE_LIB} ITTI
-Wl,--end-group z dl)
......@@ -2465,7 +2424,7 @@ if (NOT ${NOS1})
endif()
target_link_libraries(lte-uesoftmodem PRIVATE
-Wl,--start-group
lte_rrc nr_rrc s1ap x2ap m2ap M3AP_LIB M3AP_ENB
lte_rrc nr_rrc s1ap x2ap m2ap m3ap
SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON
PHY_UE PHY_RU L2_UE L2_LTE SIMU_COMMON SIMU NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB
${RAL_LIB} ${NAS_UE_LIB} ITTI ${ATLAS_LIBRARIES}
......@@ -2509,7 +2468,7 @@ target_link_libraries(nr-softmodem PRIVATE
UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU GTPV1U SECU_CN SECU_OSA
ITTI ${RAL_LIB} ${NAS_UE_LIB} lte_rrc nr_rrc
ngap s1ap L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
x2ap f1ap m2ap M3AP_LIB M3AP_ENB
x2ap f1ap m2ap m3ap
-Wl,--end-group z dl)
target_link_libraries(nr-softmodem PRIVATE ${LIBXML2_LIBRARIES})
......@@ -2806,7 +2765,7 @@ if (${T_TRACER})
syncsim nr_ulsim nr_dlsim nr_dlschsim nr_pbchsim nr_pucchsim
nr_ulschsim ldpctest polartest smallblocktest cu_test du_test
#all "add_library" definitions
ITTI lte_rrc nr_rrc s1ap x2ap m2ap M3AP_LIB M3AP_ENB f1ap
ITTI lte_rrc nr_rrc s1ap x2ap m2ap m3ap f1ap
params_libconfig oai_usrpdevif oai_bladerfdevif oai_lmssdrdevif oai_iqplayer
oai_eth_transpro oai_mobipass coding HASHTABLE UTIL OMG_SUMO
SECU_OSA SECU_CN SCHED_LIB SCHED_NR_LIB SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB default_sched remote_sched RAL
......
add_subdirectory(M3AP)
add_subdirectory(S1AP)
add_subdirectory(NGAP)
add_subdirectory(MESSAGES)
This diff is collapsed.
This diff is collapsed.
set(M3AP_GRAMMAR ASN1/m3ap-14.0.0.asn)
set(m3ap_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
M3AP_Absolute-Time-ofMBMS-Data.c
M3AP_AllocationAndRetentionPriority.c
M3AP_BitRate.c
M3AP_Cause.c
M3AP_CauseMisc.c
M3AP_CauseNAS.c
M3AP_CauseProtocol.c
M3AP_CauseRadioNetwork.c
M3AP_CauseTransport.c
M3AP_Criticality.c
M3AP_CriticalityDiagnostics.c
M3AP_CriticalityDiagnostics-IE-List.c
M3AP_ECGI.c
M3AP_ErrorIndication.c
M3AP_EUTRANCellIdentifier.c
M3AP_ExtendedMCE-ID.c
M3AP_GBR-QosInformation.c
M3AP_Global-MCE-ID.c
M3AP_GTP-TEID.c
M3AP_InitiatingMessage.c
M3AP_IPAddress.c
M3AP_M3AP-PDU.c
M3AP_M3SetupFailure.c
M3AP_M3SetupRequest.c
M3AP_M3SetupResponse.c
M3AP_MBMS-Cell-List.c
M3AP_MBMS-E-RAB-QoS-Parameters.c
M3AP_MBMSServiceArea1.c
M3AP_MBMS-Service-Area.c
M3AP_MBMSServiceAreaListItem.c
M3AP_MBMS-Service-associatedLogicalM3-ConnectionItem.c
M3AP_MBMS-Service-associatedLogicalM3-ConnectionListResAck.c
M3AP_MBMS-Service-associatedLogicalM3-ConnectionListRes.c
M3AP_MBMS-Session-Duration.c
M3AP_MBMS-Session-ID.c
M3AP_MBMSSessionStartFailure.c
M3AP_MBMSSessionStartRequest.c
M3AP_MBMSSessionStartResponse.c
M3AP_MBMSSessionStopRequest.c
M3AP_MBMSSessionStopResponse.c
M3AP_MBMSSessionUpdateFailure.c
M3AP_MBMSSessionUpdateRequest.c
M3AP_MBMSSessionUpdateResponse.c
M3AP_MCEConfigurationUpdateAcknowledge.c
M3AP_MCEConfigurationUpdate.c
M3AP_MCEConfigurationUpdateFailure.c
M3AP_MCE-ID.c
M3AP_MCE-MBMS-M3AP-ID.c
M3AP_MCEname.c
M3AP_MinimumTimeToMBMSDataTransfer.c
M3AP_MME-MBMS-M3AP-ID.c
M3AP_PLMN-Identity.c
M3AP_Pre-emptionCapability.c
M3AP_Pre-emptionVulnerability.c
M3AP_Presence.c
M3AP_PriorityLevel.c
M3AP_PrivateIE-Container.c
M3AP_PrivateIE-Field.c
M3AP_PrivateIE-ID.c
M3AP_PrivateMessage.c
M3AP_ProcedureCode.c
M3AP_ProtocolExtensionContainer.c
M3AP_ProtocolExtensionField.c
M3AP_ProtocolIE-Container.c
M3AP_ProtocolIE-ContainerList.c
M3AP_ProtocolIE-ContainerPair.c
M3AP_ProtocolIE-ContainerPairList.c
M3AP_ProtocolIE-Field.c
M3AP_ProtocolIE-FieldPair.c
M3AP_ProtocolIE-ID.c
M3AP_ProtocolIE-Single-Container.c
M3AP_QCI.c
M3AP_Reestablishment.c
M3AP_ResetAcknowledge.c
M3AP_ResetAll.c
M3AP_Reset.c
M3AP_ResetType.c
M3AP_SuccessfulOutcome.c
M3AP_TimeToWait.c
M3AP_TMGI.c
M3AP_TNL-Information.c
M3AP_TriggeringMessage.c
M3AP_TypeOfError.c
M3AP_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(m3ap_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
M3AP_Absolute-Time-ofMBMS-Data.h
M3AP_AllocationAndRetentionPriority.h
M3AP_asn_constant.h
M3AP_BitRate.h
M3AP_Cause.h
M3AP_CauseMisc.h
M3AP_CauseNAS.h
M3AP_CauseProtocol.h
M3AP_CauseRadioNetwork.h
M3AP_CauseTransport.h
M3AP_CriticalityDiagnostics.h
M3AP_CriticalityDiagnostics-IE-List.h
M3AP_Criticality.h
M3AP_ECGI.h
M3AP_ErrorIndication.h
M3AP_EUTRANCellIdentifier.h
M3AP_ExtendedMCE-ID.h
M3AP_GBR-QosInformation.h
M3AP_Global-MCE-ID.h
M3AP_GTP-TEID.h
M3AP_InitiatingMessage.h
M3AP_IPAddress.h
M3AP_M3AP-PDU.h
M3AP_M3SetupFailure.h
M3AP_M3SetupRequest.h
M3AP_M3SetupResponse.h
M3AP_MBMS-Cell-List.h
M3AP_MBMS-E-RAB-QoS-Parameters.h
M3AP_MBMSServiceArea1.h
M3AP_MBMS-Service-Area.h
M3AP_MBMSServiceAreaListItem.h
M3AP_MBMS-Service-associatedLogicalM3-ConnectionItem.h
M3AP_MBMS-Service-associatedLogicalM3-ConnectionListResAck.h
M3AP_MBMS-Service-associatedLogicalM3-ConnectionListRes.h
M3AP_MBMS-Session-Duration.h
M3AP_MBMS-Session-ID.h
M3AP_MBMSSessionStartFailure.h
M3AP_MBMSSessionStartRequest.h
M3AP_MBMSSessionStartResponse.h
M3AP_MBMSSessionStopRequest.h
M3AP_MBMSSessionStopResponse.h
M3AP_MBMSSessionUpdateFailure.h
M3AP_MBMSSessionUpdateRequest.h
M3AP_MBMSSessionUpdateResponse.h
M3AP_MCEConfigurationUpdateAcknowledge.h
M3AP_MCEConfigurationUpdateFailure.h
M3AP_MCEConfigurationUpdate.h
M3AP_MCE-ID.h
M3AP_MCE-MBMS-M3AP-ID.h
M3AP_MCEname.h
M3AP_MinimumTimeToMBMSDataTransfer.h
M3AP_MME-MBMS-M3AP-ID.h
M3AP_PLMN-Identity.h
M3AP_Pre-emptionCapability.h
M3AP_Pre-emptionVulnerability.h
M3AP_Presence.h
M3AP_PriorityLevel.h
M3AP_PrivateIE-Container.h
M3AP_PrivateIE-Field.h
M3AP_PrivateIE-ID.h
M3AP_PrivateMessage.h
M3AP_ProcedureCode.h
M3AP_ProtocolExtensionContainer.h
M3AP_ProtocolExtensionField.h
M3AP_ProtocolIE-Container.h
M3AP_ProtocolIE-ContainerList.h
M3AP_ProtocolIE-ContainerPair.h
M3AP_ProtocolIE-ContainerPairList.h
M3AP_ProtocolIE-Field.h
M3AP_ProtocolIE-FieldPair.h
M3AP_ProtocolIE-ID.h
M3AP_ProtocolIE-Single-Container.h
M3AP_QCI.h
M3AP_Reestablishment.h
M3AP_ResetAcknowledge.h
M3AP_ResetAll.h
M3AP_Reset.h
M3AP_ResetType.h
M3AP_SuccessfulOutcome.h
M3AP_TimeToWait.h
M3AP_TMGI.h
M3AP_TNL-Information.h
M3AP_TriggeringMessage.h
M3AP_TypeOfError.h
M3AP_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
)
set(M3AP_VERSION 14 0 0)
make_version(M3AP_cc ${M3AP_VERSION})
string(REPLACE ";" "." M3AP_RELEASE "${M3AP_VERSION}")
if(M3AP_RELEASE VERSION_EQUAL "8.9.0")
include(ASN1/m3ap-8.9.0.cmake)
elseif(M3AP_RELEASE VERSION_EQUAL "11.9.0")
include(ASN1/m3ap-11.9.0.cmake)
elseif(M3AP_RELEASE VERSION_EQUAL "12.9.0")
include(ASN1/m3ap-12.9.0.cmake)
elseif(M3AP_RELEASE VERSION_EQUAL "14.0.0")
include(ASN1/m3ap-14.0.0.cmake)
elseif(M3AP_RELEASE VERSION_EQUAL "15.1.0")
include(ASN1/m3ap-15.1.0.cmake)
else()
message(FATAL_ERROR "unknown M3AP_RELEASE ${M3AP_RELEASE}")
endif()
add_custom_command(OUTPUT ${m3ap_source} ${m3ap_headers}
COMMAND ASN1C_PREFIX=M3AP_ asn1c -gen-PER -no-gen-OER -fcompound-names -no-gen-example -fno-include-deps -D ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${M3AP_GRAMMAR}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${M3AP_GRAMMAR}
COMMENT "Generating M3AP source files from ${CMAKE_CURRENT_SOURCE_DIR}/${M3AP_GRAMMAR}"
)
add_library(asn1_m3ap ${m3ap_source})
target_include_directories(asn1_m3ap PUBLIC "${CMAKE_CURRENT_BINARY_DIR}")
target_compile_options(asn1_m3ap PRIVATE -DASN_DISABLE_OER_SUPPORT -w)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment