diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 2e6bd7df6831d667ee5cf6a50e0466f84ba696ac..c0b864182e63bf447d0ad7b7f21b9befd4e6c739 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -487,19 +487,19 @@ include_directories ("${X2AP_DIR}") # Same limitation as described in RRC/S1AP: unknown generated file list # so we generate it at cmake time ############## -add_list1_option(F1AP_VERSION R15 "F1AP Asn.1 grammar version" R14 R15) +add_list1_option(F1AP_VERSION R15 "F1AP Asn.1 grammar version" R15) set(F1AP_DIR ${OPENAIR2_DIR}/F1AP) -#if (${F1AP_VERSION} STREQUAL "R14") +#if (${F1AP_VERSION} STREQUAL "R15") set (ASN1RELDIR R15) -#endif(${F1AP_VERSION} STREQUAL "R14") +#endif(${F1AP_VERSION} STREQUAL "R15") set(F1AP_ASN_DIR ${F1AP_DIR}/MESSAGES/ASN1/${ASN1RELDIR}) set(F1AP_ASN_FILES - ${F1AP_ASN_DIR}/38.473.Common-Definitions.asn - ${F1AP_ASN_DIR}/38.473.Constant-Definitions.asn - ${F1AP_ASN_DIR}/38.473.Information-Element-Definitions.asn - ${F1AP_ASN_DIR}/38.473.PDU-Definitions.asn - ${F1AP_ASN_DIR}/38.473.Elementary-Procedures.asn - ${F1AP_ASN_DIR}/38.473.Container-Definitions.asn + ${F1AP_ASN_DIR}/F1AP-CommonDataTypes.asn + ${F1AP_ASN_DIR}/F1AP-Constants.asn + ${F1AP_ASN_DIR}/F1AP-PDU-Descriptions.asn + ${F1AP_ASN_DIR}/F1AP-PDU-Contents.asn + ${F1AP_ASN_DIR}/F1AP-IEs.asn + ${F1AP_ASN_DIR}/F1AP-Containers.asn ) set(F1AP_C_DIR ${asn1_generated_dir}/${ASN1RELDIR}) @@ -508,7 +508,7 @@ execute_process(COMMAND ${asn1c_call} ${F1AP_C_DIR} ${F1AP_ASN_FILES} if (NOT ${ret} STREQUAL 0) message(FATAL_ERROR "${asn1c_call}: error") endif (NOT ${ret} STREQUAL 0) -execute_process(COMMAND python ${F1AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f ${F1AP_ASN_DIR}/38.473.PDU-Definitions.asn -o ${F1AP_C_DIR} +execute_process(COMMAND python ${F1AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f ${F1AP_ASN_DIR}/F1AP-PDU-Contents.asn -o ${F1AP_C_DIR} RESULT_VARIABLE ret) if (NOT ${ret} STREQUAL 0) message(FATAL_ERROR "asn1tostruct.py: error") @@ -533,7 +533,7 @@ set(f1ap_h ${f1ap_h} ) #add_custom_command ( # OUTPUT ${F1AP_OAI_generated} # COMMAND ${asn1c_call} ${F1AP_C_DIR} ${F1AP_ASN_FILES} -# COMMAND python ${F1AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f ${F1AP_ASN_DIR}/38.473.PDU-Definitions.asn -o ${F1AP_C_DIR} +# COMMAND python ${F1AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f ${F1AP_ASN_DIR}/F1AP-PDU-Contents.asn -o ${F1AP_C_DIR} # COMMAND ${fix_asn1c_call} ${F1AP_C_DIR} F1AP ${F1AP_VERSION} # DEPENDS ${F1AP_ASN_FILES} # ) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index da4b34f26d1c74e794cb708420954ed0029d14ad..9b5c9320778eeef75cb0ebe231e59929490767d1 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -661,7 +661,7 @@ install_asn1c_from_source(){ $SUDO rm -rf /tmp/asn1c GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/asn1c.git /tmp/asn1c cd /tmp/asn1c - git checkout master + git checkout master.aper git pull test -f configure || autoreconf -iv ./configure diff --git a/cmake_targets/tools/fix_asn1 b/cmake_targets/tools/fix_asn1 index 9d5d6a393e2a1a4e8073c27b177cbf85ca7273f4..5fbb3bdbe94de3412574625f0d6c226e157a0c2d 100755 --- a/cmake_targets/tools/fix_asn1 +++ b/cmake_targets/tools/fix_asn1 @@ -23,7 +23,7 @@ reset_color="$(tput sgr0)" function error() { echo -e "$red_color"ERROR: "$@""$reset_color" - #exit 1 +# exit 1 } function check_sha1() @@ -56,11 +56,11 @@ function patch_file() echo -e "$green_color""patch file $file with $OPENAIR_DIR/cmake_targets/tools/$patch""$reset_color" - patch "$file" "$OPENAIR_DIR/cmake_targets/tools/$patch" - if [ $? -ne 0 ] - then - error "patching of $file with $OPENAIR_DIR/cmake_targets/tools/$patch failed" - fi +# patch "$file" "$OPENAIR_DIR/cmake_targets/tools/$patch" +# if [ $? -ne 0 ] +# then +# error "patching of $file with $OPENAIR_DIR/cmake_targets/tools/$patch failed" +# fi } function apply_patches() diff --git a/cmake_targets/tools/generate_asn1 b/cmake_targets/tools/generate_asn1 index 79becbf28881395dd495bad7921ee11dce02100b..1a9cb975acd433b283d896b99acc50ea6128b9b0 100755 --- a/cmake_targets/tools/generate_asn1 +++ b/cmake_targets/tools/generate_asn1 @@ -99,7 +99,7 @@ echo done with asnfix echo running asn1c -asn1c -gen-PER -fcompound-names fixed_grammar.asn 2>&1 | grep -v -- '->' | grep -v '^Compiled' |grep -v sample +asn1c -gen-PER -fcompound-names -no-gen-example fixed_grammar.asn 2>&1 | grep -v -- '->' | grep -v '^Compiled' |grep -v sample rm -f fixed_grammar.asn @@ -107,7 +107,7 @@ echo asn1c done else -asn1c -gen-PER -fcompound-names $* 2>&1 | grep -v -- '->' | grep -v '^Compiled' |grep -v sample +asn1c -gen-PER -fcompound-names -no-gen-example $* 2>&1 | grep -v -- '->' | grep -v '^Compiled' |grep -v sample fi diff --git a/openair2/F1AP/MESSAGES/ASN1/R15/38.473.Common-Definitions.asn b/openair2/F1AP/MESSAGES/ASN1/R15/F1AP-CommonDataTypes.asn similarity index 100% rename from openair2/F1AP/MESSAGES/ASN1/R15/38.473.Common-Definitions.asn rename to openair2/F1AP/MESSAGES/ASN1/R15/F1AP-CommonDataTypes.asn diff --git a/openair2/F1AP/MESSAGES/ASN1/R15/38.473.Constant-Definitions.asn b/openair2/F1AP/MESSAGES/ASN1/R15/F1AP-Constants.asn similarity index 100% rename from openair2/F1AP/MESSAGES/ASN1/R15/38.473.Constant-Definitions.asn rename to openair2/F1AP/MESSAGES/ASN1/R15/F1AP-Constants.asn diff --git a/openair2/F1AP/MESSAGES/ASN1/R15/38.473.Container-Definitions.asn b/openair2/F1AP/MESSAGES/ASN1/R15/F1AP-Containers.asn similarity index 100% rename from openair2/F1AP/MESSAGES/ASN1/R15/38.473.Container-Definitions.asn rename to openair2/F1AP/MESSAGES/ASN1/R15/F1AP-Containers.asn diff --git a/openair2/F1AP/MESSAGES/ASN1/R15/38.473.Information-Element-Definitions.asn b/openair2/F1AP/MESSAGES/ASN1/R15/F1AP-IEs.asn similarity index 100% rename from openair2/F1AP/MESSAGES/ASN1/R15/38.473.Information-Element-Definitions.asn rename to openair2/F1AP/MESSAGES/ASN1/R15/F1AP-IEs.asn diff --git a/openair2/F1AP/MESSAGES/ASN1/R15/38.473.PDU-Definitions.asn b/openair2/F1AP/MESSAGES/ASN1/R15/F1AP-PDU-Contents.asn similarity index 100% rename from openair2/F1AP/MESSAGES/ASN1/R15/38.473.PDU-Definitions.asn rename to openair2/F1AP/MESSAGES/ASN1/R15/F1AP-PDU-Contents.asn diff --git a/openair2/F1AP/MESSAGES/ASN1/R15/38.473.Elementary-Procedures.asn b/openair2/F1AP/MESSAGES/ASN1/R15/F1AP-PDU-Descriptions.asn similarity index 100% rename from openair2/F1AP/MESSAGES/ASN1/R15/38.473.Elementary-Procedures.asn rename to openair2/F1AP/MESSAGES/ASN1/R15/F1AP-PDU-Descriptions.asn diff --git a/openair2/RRC/LITE/L2_interface.c b/openair2/RRC/LITE/L2_interface.c index 91834d9c9d64f4742cec1cd2b9d538a8ca9b8065..8a5136792cab52e08550b50fcc558d253a7411cd 100644 --- a/openair2/RRC/LITE/L2_interface.c +++ b/openair2/RRC/LITE/L2_interface.c @@ -190,7 +190,7 @@ mac_rrc_data_req( if( (Srb_id & RAB_OFFSET ) == MIBCH) { mib->message.systemFrameNumber.buf = &sfn; - enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_BCH_Message, + enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_BCH_Message, NULL, (void*)mib, carrier->MIB, 24); diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c index 77ba0c4cade0378c36db0cb8807d4f1a23b30ace..45b331a33007002c1fccb40a4fbc6b6edee43ee6 100644 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c @@ -238,7 +238,7 @@ uint8_t do_MIB(rrc_eNB_carrier_data_t *carrier, uint32_t N_RB_DL, uint32_t phich mib->message.schedulingInfoSIB1_BR_r13 = 0; // turn off eMTC #endif - enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_BCH_Message, + enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_BCH_Message, NULL, (void*)mib, carrier->MIB, 24); @@ -445,7 +445,7 @@ uint8_t do_SIB1(rrc_eNB_carrier_data_t *carrier, #ifdef XER_PRINT xer_fprint(stdout, &asn_DEF_BCCH_DL_SCH_Message, (void*)bcch_message); #endif - enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_DL_SCH_Message, + enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_DL_SCH_Message, NULL, (void*)bcch_message, buffer, 100); @@ -971,7 +971,7 @@ uint8_t do_SIB23(uint8_t Mod_id, #ifdef XER_PRINT xer_fprint(stdout, &asn_DEF_BCCH_DL_SCH_Message, (void*)bcch_message); #endif - enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_DL_SCH_Message, + enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_DL_SCH_Message, NULL, (void*)bcch_message, buffer, 900); @@ -1059,7 +1059,7 @@ uint8_t do_RRCConnectionRequest(uint8_t Mod_id, uint8_t *buffer,uint8_t *rv) rrcConnectionRequest->criticalExtensions.choice.rrcConnectionRequest_r8.spare.bits_unused = 7; - enc_rval = uper_encode_to_buffer(&asn_DEF_UL_CCCH_Message, + enc_rval = uper_encode_to_buffer(&asn_DEF_UL_CCCH_Message, NULL, (void*)&ul_ccch_msg, buffer, 100); @@ -1140,7 +1140,7 @@ uint8_t do_RRCConnectionSetupComplete(uint8_t Mod_id, uint8_t *buffer, const uin rrcConnectionSetupComplete->criticalExtensions.choice.c1.choice.rrcConnectionSetupComplete_r8.registeredMME->mmec.bits_unused=0; */ - enc_rval = uper_encode_to_buffer(&asn_DEF_UL_DCCH_Message, + enc_rval = uper_encode_to_buffer(&asn_DEF_UL_DCCH_Message, NULL, (void*)&ul_dcch_msg, buffer, 100); @@ -1200,7 +1200,7 @@ do_RRCConnectionReconfigurationComplete( RRCConnectionReconfigurationComplete__criticalExtensions_PR_rrcConnectionReconfigurationComplete_r8; rrcConnectionReconfigurationComplete->criticalExtensions.choice.rrcConnectionReconfigurationComplete_r8.nonCriticalExtension=NULL; - enc_rval = uper_encode_to_buffer(&asn_DEF_UL_DCCH_Message, + enc_rval = uper_encode_to_buffer(&asn_DEF_UL_DCCH_Message, NULL, (void*)&ul_dcch_msg, buffer, 100); @@ -1587,7 +1587,7 @@ do_RRCConnectionSetup( #ifdef XER_PRINT xer_fprint(stdout, &asn_DEF_DL_CCCH_Message, (void*)&dl_ccch_msg); #endif - enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message, + enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message, NULL, (void*)&dl_ccch_msg, buffer, 100); @@ -1658,7 +1658,7 @@ do_SecurityModeCommand( #ifdef XER_PRINT xer_fprint(stdout, &asn_DEF_DL_DCCH_Message, (void*)&dl_dcch_msg); #endif - enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message, + enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message, NULL, (void*)&dl_dcch_msg, buffer, 100); @@ -1734,7 +1734,7 @@ do_UECapabilityEnquiry( #ifdef XER_PRINT xer_fprint(stdout, &asn_DEF_DL_DCCH_Message, (void*)&dl_dcch_msg); #endif - enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message, + enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message, NULL, (void*)&dl_dcch_msg, buffer, 100); @@ -1894,7 +1894,7 @@ do_RRCConnectionReconfiguration( rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.dedicatedInfoNASList = dedicatedInfoNASList; rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.securityConfigHO = NULL; - enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message, + enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message, NULL, (void*)&dl_dcch_msg, buffer, RRC_BUF_SIZE); @@ -2108,6 +2108,7 @@ do_RRCConnectionReestablishment( xer_fprint(stdout, &asn_DEF_DL_CCCH_Message, (void*)&dl_ccch_msg); #endif enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message, + NULL, (void*)&dl_ccch_msg, buffer, 100); @@ -2165,7 +2166,7 @@ do_RRCConnectionReestablishmentReject( #ifdef XER_PRINT xer_fprint(stdout, &asn_DEF_DL_CCCH_Message, (void*)&dl_ccch_msg); #endif - enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message, + enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message, NULL, (void*)&dl_ccch_msg, buffer, 100); @@ -2224,7 +2225,7 @@ do_RRCConnectionReject( #ifdef XER_PRINT xer_fprint(stdout, &asn_DEF_DL_CCCH_Message, (void*)&dl_ccch_msg); #endif - enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message, + enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message, NULL, (void*)&dl_ccch_msg, buffer, 100); @@ -2286,7 +2287,7 @@ uint8_t do_RRCConnectionRelease( rrcConnectionRelease->criticalExtensions.choice.c1.choice.rrcConnectionRelease_r8.nonCriticalExtension=CALLOC(1, sizeof(*rrcConnectionRelease->criticalExtensions.choice.c1.choice.rrcConnectionRelease_r8.nonCriticalExtension)); - enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message, + enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message, NULL, (void*)&dl_dcch_msg, buffer, RRC_BUF_SIZE); @@ -2413,7 +2414,7 @@ uint8_t do_MBSFNAreaConfig(uint8_t Mod_id, #ifdef XER_PRINT xer_fprint(stdout,&asn_DEF_MCCH_Message,(void*)mcch_message); #endif - enc_rval = uper_encode_to_buffer(&asn_DEF_MCCH_Message, + enc_rval = uper_encode_to_buffer(&asn_DEF_MCCH_Message, NULL, (void*)mcch_message, buffer, 100); @@ -2542,7 +2543,7 @@ uint8_t do_MeasurementReport(uint8_t Mod_id, uint8_t *buffer,int measid,int phy_ measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells->choice.measResultListEUTRA=*(measResultListEUTRA2); - enc_rval = uper_encode_to_buffer(&asn_DEF_UL_DCCH_Message, + enc_rval = uper_encode_to_buffer(&asn_DEF_UL_DCCH_Message, NULL, (void*)&ul_dcch_msg, buffer, 100); @@ -2676,7 +2677,7 @@ uint8_t do_Paging(uint8_t Mod_id, uint8_t *buffer, ue_paging_identity_t ue_pagin LOG_D(RRC, "[eNB %d] do_Paging paging_record: cn_Domain %ld, ue_paging_identity.presenceMask %d, PagingRecordList.count %d\n", Mod_id, paging_record_p->cn_Domain, ue_paging_identity.presenceMask, pcch_msg.message.choice.c1.choice.paging.pagingRecordList->list.count); - enc_rval = uper_encode_to_buffer(&asn_DEF_PCCH_Message, (void*)&pcch_msg, buffer, RRC_BUF_SIZE); + enc_rval = uper_encode_to_buffer(&asn_DEF_PCCH_Message, NULL, (void*)&pcch_msg, buffer, RRC_BUF_SIZE); AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n", enc_rval.failed_type->name, enc_rval.encoded); @@ -2848,7 +2849,7 @@ OAI_UECapability_t *fill_ue_capability(char *UE_EUTRA_Capability_xer_fname) #ifdef XER_PRINT xer_fprint(stdout,&asn_DEF_UE_EUTRA_Capability,(void *)UE_EUTRA_Capability); #endif - enc_rval = uper_encode_to_buffer(&asn_DEF_UE_EUTRA_Capability, + enc_rval = uper_encode_to_buffer(&asn_DEF_UE_EUTRA_Capability, NULL, (void*)UE_EUTRA_Capability, &UECapability.sdu[0], MAX_UE_CAPABILITY_SIZE); diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg_NB_IoT.c b/openair2/RRC/LITE/MESSAGES/asn1_msg_NB_IoT.c index 43721bbfd55f0ee6d03f2c90e618dcf92571e63d..7583be251f3ad8568fc5f92edcf6238a17dad055 100644 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg_NB_IoT.c +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg_NB_IoT.c @@ -131,6 +131,7 @@ uint8_t do_MIB_NB_IoT( (uint32_t)hsfn_LSB); enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_BCH_Message_NB, + NULL, (void*)mib_NB_IoT, carrier->MIB_NB_IoT, 100); @@ -387,6 +388,7 @@ uint8_t do_SIB1_NB_IoT(uint8_t Mod_id, int CC_id, enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_DL_SCH_Message_NB, + NULL, (void*)bcch_message, carrier->SIB1_NB_IoT, 100); @@ -669,6 +671,7 @@ uint8_t do_SIB23_NB_IoT(uint8_t Mod_id, xer_fprint(stdout, &asn_DEF_BCCH_DL_SCH_Message_NB, (void*)bcch_message); #endif enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_DL_SCH_Message_NB, + NULL, (void*)bcch_message, carrier->SIB23_NB_IoT, 900); @@ -888,6 +891,7 @@ uint8_t do_RRCConnectionSetup_NB_IoT( xer_fprint(stdout, &asn_DEF_DL_CCCH_Message, (void*)&dl_ccch_msg); #endif enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message_NB, + NULL, (void*)&dl_ccch_msg_NB_IoT, buffer, 100); @@ -939,6 +943,7 @@ uint8_t do_SecurityModeCommand_NB_IoT( xer_fprint(stdout, &asn_DEF_DL_DCCH_Message_NB, (void*)&dl_dcch_msg_NB_IoT); #endif enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message_NB, + NULL, (void*)&dl_dcch_msg_NB_IoT, buffer, 100); @@ -1000,6 +1005,7 @@ uint8_t do_UECapabilityEnquiry_NB_IoT( xer_fprint(stdout, &asn_DEF_DL_DCCH_Message_NB, (void*)&dl_dcch_msg_NB_IoT); #endif enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message_NB, + NULL, (void*)&dl_dcch_msg_NB_IoT, buffer, 100); @@ -1094,6 +1100,7 @@ uint16_t do_RRCConnectionReconfiguration_NB_IoT( rrcConnectionReconfiguration_NB->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r13.fullConfig_r13 = NULL; enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message_NB, + NULL, (void*)&dl_dcch_msg_NB_IoT, buffer, RRC_BUF_SIZE); @@ -1140,6 +1147,7 @@ uint8_t do_RRCConnectionReestablishmentReject_NB_IoT( xer_fprint(stdout, &asn_DEF_DL_CCCH_Message_NB, (void*)&dl_ccch_msg_NB_IoT); #endif enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message_NB, + NULL, (void*)&dl_ccch_msg_NB_IoT, buffer, 100); @@ -1210,6 +1218,7 @@ uint8_t do_RRCConnectionReject_NB_IoT( xer_fprint(stdout, &asn_DEF_DL_CCCH_Message_NB, (void*)&dl_ccch_msg); #endif enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message_NB, + NULL, (void*)&dl_ccch_msg_NB_IoT, buffer, 100); @@ -1336,6 +1345,7 @@ uint8_t do_RRCConnectionReestablishment_NB_IoT( rrcConnectionReestablishment_NB_IoT->criticalExtensions.choice.c1.choice.rrcConnectionReestablishment_r13.nextHopChainingCount_r13=0; enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message_NB, + NULL, (void*)&dl_ccch_msg_NB_IoT, buffer, RRC_BUF_SIZE); @@ -1405,6 +1415,7 @@ uint8_t do_RRCConnectionRelease_NB_IoT( sizeof(*rrcConnectionRelease_NB_IoT->criticalExtensions.choice.c1.choice.rrcConnectionRelease_r13.nonCriticalExtension)); enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message_NB, + NULL, (void*)&dl_dcch_msg_NB_IoT, buffer, RRC_BUF_SIZE);//check diff --git a/openair2/RRC/LITE/rrc_UE.c b/openair2/RRC/LITE/rrc_UE.c index 3edf230ac2817ca736956c7affd80342980629f4..1ebfde38909cecd98010103d3e90929eba19f04a 100644 --- a/openair2/RRC/LITE/rrc_UE.c +++ b/openair2/RRC/LITE/rrc_UE.c @@ -1739,7 +1739,7 @@ rrc_ue_process_securityModeCommand( LOG_I(RRC,"[UE %d] Frame %d: Receiving from SRB1 (DL-DCCH), encoding securityModeComplete (eNB %d)\n", ctxt_pP->module_id,ctxt_pP->frame,eNB_index); - enc_rval = uper_encode_to_buffer(&asn_DEF_UL_DCCH_Message, + enc_rval = uper_encode_to_buffer(&asn_DEF_UL_DCCH_Message, NULL, (void*)&ul_dcch_msg, buffer, 100); @@ -1853,7 +1853,7 @@ rrc_ue_process_ueCapabilityEnquiry( &ul_dcch_msg.message.choice.c1.choice.ueCapabilityInformation.criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList.list, &ue_CapabilityRAT_Container); - enc_rval = uper_encode_to_buffer(&asn_DEF_UL_DCCH_Message, (void*) &ul_dcch_msg, buffer, 100); + enc_rval = uper_encode_to_buffer(&asn_DEF_UL_DCCH_Message, NULL, (void*) &ul_dcch_msg, buffer, 100); AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %jd)!\n", enc_rval.failed_type->name, enc_rval.encoded); diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index 9faa686ef6532afafa413a9c5f4ae633940dcff7..8bb244a34d24d77f1891bf4b187b8141061ce0b5 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -6886,8 +6886,8 @@ if (ue_context_p->ue_context.nb_of_modify_e_rabs > 0) { LOG_I(RRC, "got UE capabilities for UE %x\n", ctxt_pP->rnti); if (ue_context_p->ue_context.UE_Capability) { LOG_I(RRC, "freeing old UE capabilities for UE %x\n", ctxt_pP->rnti); - asn_DEF_UE_EUTRA_Capability.free_struct(&asn_DEF_UE_EUTRA_Capability, - ue_context_p->ue_context.UE_Capability, 0); + ASN_STRUCT_FREE(asn_DEF_UE_EUTRA_Capability, + ue_context_p->ue_context.UE_Capability); ue_context_p->ue_context.UE_Capability = 0; } dec_rval = uper_decode(NULL, @@ -6907,8 +6907,8 @@ if (ue_context_p->ue_context.nb_of_modify_e_rabs > 0) { LOG_E(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Failed to decode UE capabilities (%zu bytes)\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), dec_rval.consumed); - asn_DEF_UE_EUTRA_Capability.free_struct(&asn_DEF_UE_EUTRA_Capability, - ue_context_p->ue_context.UE_Capability, 0); + ASN_STRUCT_FREE(asn_DEF_UE_EUTRA_Capability, + ue_context_p->ue_context.UE_Capability); ue_context_p->ue_context.UE_Capability = 0; } diff --git a/openair2/RRC/LITE/rrc_eNB_S1AP.c b/openair2/RRC/LITE/rrc_eNB_S1AP.c index 80ae1c9ba57e9e276f5f4581c6dea7c9c7e49bec..9c58a05b59dd2344cf4e15c6f08b5cf47cba0264 100644 --- a/openair2/RRC/LITE/rrc_eNB_S1AP.c +++ b/openair2/RRC/LITE/rrc_eNB_S1AP.c @@ -680,7 +680,7 @@ void rrc_eNB_send_S1AP_UE_CAPABILITIES_IND( return; } - asn_enc_rval_t ret = uper_encode_to_buffer(&asn_DEF_UECapabilityInformation, ueCapabilityInformation, buf, 4096); + asn_enc_rval_t ret = uper_encode_to_buffer(&asn_DEF_UECapabilityInformation, NULL, ueCapabilityInformation, buf, 4096); if (ret.encoded == -1) abort(); memset(&rac, 0, sizeof(UERadioAccessCapabilityInformation_t)); @@ -694,7 +694,7 @@ void rrc_eNB_send_S1AP_UE_CAPABILITIES_IND( /* 8192 is arbitrary, should be big enough */ buf2 = malloc16(8192); if (buf2 == NULL) abort(); - ret = uper_encode_to_buffer(&asn_DEF_UERadioAccessCapabilityInformation, &rac, buf2, 8192); + ret = uper_encode_to_buffer(&asn_DEF_UERadioAccessCapabilityInformation, NULL, &rac, buf2, 8192); if (ret.encoded == -1) abort(); MessageDef *msg_p; diff --git a/openair3/S1AP/MESSAGES/ASN1/asn1tostruct.py b/openair3/S1AP/MESSAGES/ASN1/asn1tostruct.py index 4603e869a658e1f9e83ecfdd768aea47c81c4d41..b5a141349ba0fe694aa97d3bbcc74595c2b1ce29 100644 --- a/openair3/S1AP/MESSAGES/ASN1/asn1tostruct.py +++ b/openair3/S1AP/MESSAGES/ASN1/asn1tostruct.py @@ -253,15 +253,6 @@ for key in iesDefs: f.write(" %s_t *%s,\n" % (re.sub('-', '_', key), lowerFirstCamelWord(re.sub('-', '_', key)))) f.write(" ANY_t *any_p);\n\n") - f.write("/* %s in iesDefs not in ieofielist.values() */\n" % (key)) - f.write("/** \\brief Compare function for %s ies.\n" % (key)) - f.write(" * \\param %s Pointer to the ASN1 structure.\n" % (firstlower)) - f.write(" * \\param %s Pointer to the ASN1 structure.\n" % (firstlower)) - f.write(" **/\n") - f.write("asn_comp_rval_t * %s_compare_%s(\n" % (fileprefix, keylowerunderscore)) - f.write(" %s_t *%s1,\n" % (re.sub('-', '_', key), lowerFirstCamelWord(re.sub('-', '_', key)))) - f.write(" %s_t *%s2);\n\n" % (re.sub('-', '_', key), lowerFirstCamelWord(re.sub('-', '_', key)))) - if len(iesDefs[key]["ies"]) == 0: continue @@ -298,13 +289,6 @@ for key in iesDefs: f.write("int %s_decode_%s(\n" % (fileprefix, firstlower.lower())) f.write(" %sIEs_t *%sIEs,\n" % (asn1cStruct, firstlower)) f.write(" %s_t *%s);\n\n" % (asn1cStruct, lowerFirstCamelWord(asn1cStruct))) - f.write("/** \\brief Compare function for %s ies.\n" % (key)) - f.write(" * \\param %s Pointer to the IES structure.\n" % (firstlower)) - f.write(" * \\param %s Pointer to the IES structure.\n" % (firstlower)) - f.write(" **/\n") - f.write("asn_comp_rval_t * %s_compare_%s(\n" % (fileprefix, firstlower.lower())) - f.write(" %sIEs_t *%s1,\n" % (asn1cStruct, firstlower)) - f.write(" %sIEs_t *%s2);\n\n" % (asn1cStruct, firstlower)) @@ -634,19 +618,19 @@ xer_encode_local(asn_TYPE_descriptor_t *td, void *sptr, mname = td->xml_tag; mlen = strlen(mname); - _i_ASN_TEXT_INDENT(0, indent); - _ASN_CALLBACK3("<", 1, mname, mlen, ">", 1); + ASN__TEXT_INDENT(0, indent); + ASN__CALLBACK3("<", 1, mname, mlen, ">", 1); - tmper = td->xer_encoder(td, sptr, indent + 1, XER_F_BASIC, cb, app_key); + tmper = td->op->xer_encoder(td, sptr, indent + 1, XER_F_BASIC, cb, app_key); if(tmper.encoded == -1) return tmper; - _ASN_CALLBACK3("</", 2, mname, mlen, ">\\n", xcan); + ASN__CALLBACK3("</", 2, mname, mlen, ">\\n", xcan); er.encoded = 4 + xcan + (2 * mlen) + tmper.encoded; - _ASN_ENCODED_OK(er); + ASN__ENCODED_OK(er); cb_failed: - _ASN_ENCODE_FAILED; + ASN__ENCODE_FAILED; } """) @@ -714,7 +698,7 @@ for (key, value) in iesDefs.items(): f.write(" cb(\" </%s>\\n\", %d, app_key);\n" % (key, len(" </%s>\n" % (key)))) f.write(" cb(\"</%s-PDU>\\n\", %d, app_key);\n" % (key, len("</%s-PDU>\n" % (key)))) - f.write(" _ASN_ENCODED_OK(er);\n") + f.write(" ASN__ENCODED_OK(er);\n") #if key not in ieofielist.values(): #f.write("cb_failed:\n") #f.write(" return er;\n") @@ -731,119 +715,6 @@ f.write("#include \"%s_common.h\"\n#include \"%s_ies_defs.h\"\n" % (fileprefix, f.write("#include \"%s-ProtocolIE-ID.h\"\n\n" % (fileprefix_first_upper)) -for key in iesDefs: - if key in ieofielist.values(): - continue - structName = re.sub('ies', '', key) - asn1cStruct = re.sub('-', '_', re.sub('IEs', '', key)) - asn1cStruct = re.sub('Item', 'List', asn1cStruct) - if asn1cStruct.rfind('_') == len(asn1cStruct) - 1: - asn1cStruct = asn1cStruct[:-1] - asn1cStructfirstlower = asn1cStruct[:1].lower() + asn1cStruct[1:] - firstwordlower = re.sub('Item', 'List', re.sub('enb', 'eNB', lowerFirstCamelWord(asn1cStruct))) - - iesaccess = "" - if key not in ieofielist.values(): - iesaccess = "%s_ies." % (firstwordlower) - - keyName = re.sub('-', '_', key) - keyupperunderscore = keyName.upper() - # No IE to encode... - if len(iesDefs[key]["ies"]) == 0: - continue - - f.write("asn_comp_rval_t * %s_compare_%s(\n" % (fileprefix, re.sub('-', '_', structName.lower()))) - f.write(" %s_t *%s1,\n" % (re.sub('-', '_', key), lowerFirstCamelWord(re.sub('-', '_', key)))) - f.write(" %s_t *%s2) {\n\n" % (re.sub('-', '_', key), lowerFirstCamelWord(re.sub('-', '_', key)))) - - f.write(" asn_comp_rval_t *rv = NULL;\n\n") - f.write(" asn_comp_rval_t *rv2 = NULL;\n\n") - - f.write(" assert(%s1 != NULL);\n" % (lowerFirstCamelWord(re.sub('-', '_', key)))); - f.write(" assert(%s2 != NULL);\n" % (lowerFirstCamelWord(re.sub('-', '_', key)))); - - loop = 0 - for ie in iesDefs[key]["ies"]: - iename = re.sub('-', '_', re.sub('id-', '', ie[0])) - ienameunderscore = re.sub('-', '_', iename) - ienamefirstwordlower = lowerFirstCamelWord(iename) - ieupperunderscore = re.sub('-', '_', re.sub('id-', '', ie[0])).upper() - ietypeunderscore = re.sub('-', '_', ie[2]) - - if ie[3] != "mandatory": - - loop = loop + 1 - if loop == 1: - #f.write(" %s_IE_t *ie1 = NULL;\n" % (fileprefix_first_upper)) - #f.write(" %s_IE_t *ie2 = NULL;\n" % (fileprefix_first_upper)) - f.write(" if (%s1->presenceMask != %s2->presenceMask) {rv=calloc(1,sizeof(asn_comp_rval_t));rv->name = asn_DEF_%s.name;rv->structure1 = %s1;rv->structure2 = %s2;rv->err_code = COMPARE_ERR_CODE_VALUE_NULL; return rv;}\n" % (lowerFirstCamelWord(re.sub('-', '_', key)), lowerFirstCamelWord(re.sub('-', '_', key)), ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', key)), lowerFirstCamelWord(re.sub('-', '_', key)))) - - if ie[3] == "optional": - f.write(" /* Optional field */\n") - elif ie[3] == "conditional": - f.write(" /* Conditional field */\n") - f.write(" if (%s1->presenceMask & %s_%s_PRESENT) {\n" % (lowerFirstCamelWord(re.sub('-', '_', key)), keyupperunderscore, ieupperunderscore)) - - - if ie[2] in ieofielist.keys(): - f.write(" /* collection field */\n") - f.write(" rv2 = %s_compare_%s(&%s1->%s, &%s2->%s);\n" % (fileprefix, ietypeunderscore.lower(), lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower, lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower )) - f.write(" if(rv2) {") - f.write(" if (NULL == rv) {") - f.write(" rv = rv2;") - f.write(" } else {") - f.write(" rv2->next = rv;") - f.write(" rv = rv2;") - f.write(" }") - f.write(" rv2 = NULL;") - f.write(" }") - else: - f.write(" /* simple field */\n") - f.write(" rv2 = asn_DEF_%s.compare(&asn_DEF_%s, &%s1->%s, &asn_DEF_%s, &%s2->%s); \n" % (ietypeunderscore, ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower, ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower )) - f.write(" if (rv2) {") - f.write(" if (NULL == rv) {") - f.write(" rv = rv2;") - f.write(" } else {") - f.write(" rv2->next = rv;") - f.write(" rv = rv2;") - f.write(" }") - f.write(" rv2 = NULL;") - f.write(" if (!rv->name) rv->name = asn_DEF_%s.name;" % (ietypeunderscore)) - f.write(" }") - - f.write(" assert(0);\n"); - f.write(" }\n\n") - - else: - if ie[2] in ieofielist.keys(): - f.write(" /* Mandatory collection field */\n") - f.write(" rv2 = %s_compare_%s(&%s1->%s, &%s2->%s);\n" % (fileprefix, ietypeunderscore.lower(), lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower, lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower )) - f.write(" if (rv2) {\n") - f.write(" if (NULL == rv) {\n") - f.write(" rv = rv2;\n") - f.write(" } else {\n") - f.write(" rv2->next = rv;\n") - f.write(" rv = rv2;\n") - f.write(" }\n") - f.write(" rv2 = NULL;\n") - f.write(" }\n") - - else: - f.write(" /* Mandatory simple field */\n") - f.write(" rv2 = asn_DEF_%s.compare(&asn_DEF_%s, &%s1->%s, &asn_DEF_%s, &%s2->%s);\n" % (ietypeunderscore, ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower, ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower )) - f.write(" if(rv2) {\n") - f.write(" if (NULL == rv) {\n") - f.write(" rv = rv2;\n") - f.write(" } else {\n") - f.write(" rv2->next = rv;\n") - f.write(" rv = rv2;\n") - f.write(" }\n") - f.write(" rv2 = NULL;\n") - f.write(" if (!rv->name) rv->name = asn_DEF_%s.name;\n" % (ietypeunderscore)) - f.write(" }\n") - f.write(" return rv;\n") - f.write("}\n\n") - for (key, value) in iesDefs.items(): if key not in ieofielist.values(): continue @@ -859,30 +730,3 @@ for (key, value) in iesDefs.items(): break f.write("extern asn_TYPE_descriptor_t asn_DEF_%s;\n" % (ietypeunderscore)) - - f.write("asn_comp_rval_t * %s_compare_%s(\n" % (fileprefix, re.sub('-', '_', i).lower())) - f.write(" %sIEs_t *%sIEs1,\n" % (re.sub('-', '_', i), lowerFirstCamelWord(re.sub('-', '_', i)))) - f.write(" %sIEs_t *%sIEs2) {\n\n" % (re.sub('-', '_', i), lowerFirstCamelWord(re.sub('-', '_', i)))) - f.write(" int i;\n") - f.write(" asn_comp_rval_t *rv = NULL;\n\n") - f.write(" asn_comp_rval_t *rv2 = NULL;\n\n") - - - f.write(" assert(%sIEs1 != NULL);\n" % (lowerFirstCamelWord(re.sub('-', '_', i)))); - f.write(" assert(%sIEs2 != NULL);\n\n" % (lowerFirstCamelWord(re.sub('-', '_', i)))); - - f.write(" for (i = 0; i < %sIEs1->%s.count; i++) {\n" % (lowerFirstCamelWord(re.sub('-', '_', i)), re.sub('IEs', '', lowerFirstCamelWord(re.sub('-', '_', key))))) - f.write(" rv2 = asn_DEF_%s.compare(&asn_DEF_%s, %sIEs1->%s.array[i], &asn_DEF_%s, %sIEs2->%s.array[i]);\n" % (ietypeunderscore, ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', i)), re.sub('IEs', '', lowerFirstCamelWord(re.sub('-', '_', key))), ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', i)), re.sub('IEs', '', lowerFirstCamelWord(re.sub('-', '_', key))))) - f.write(" if(rv2) {") - f.write(" if (NULL == rv) {") - f.write(" rv = rv2;") - f.write(" } else {") - f.write(" rv2->next = rv;") - f.write(" rv = rv2;") - f.write(" }") - f.write(" rv2 = NULL;") - f.write(" }") - f.write(" }\n") - f.write(" return rv;\n") - f.write("}\n\n") -