From b797dafdc67689808191015d0b2b344d0b2a75a0 Mon Sep 17 00:00:00 2001 From: Bing-Kai Hong Date: Tue, 28 Aug 2018 14:52:46 +0200 Subject: [PATCH] 1.Update the F1 messages with F1AP spec R15.2.1 and build scripts for proper generation of F1 messages 2.Add SCTP procedure (without ITTI) with F1AP 3.Add F1AP test code --- cmake_targets/CMakeLists.txt | 85 +- cmake_targets/tools/generate_asn1 | 62 +- common/utils/LOG/log.h | 1 + common/utils/T/T_IDs.h | 546 ++++++ openair2/COMMON/f1ap_messages_def.h | 77 + openair2/COMMON/f1ap_messages_types.h | 646 +++++++ openair2/F1AP/CU_F1AP.c | 1494 ++++++++++++++++ openair2/F1AP/DU_F1AP.c | 1506 ++++++++++++++++ .../ASN1/R15.2.1/F1AP-CommonDataTypes.asn | 32 + .../MESSAGES/ASN1/R15.2.1/F1AP-Constants.asn | 256 +++ .../MESSAGES/ASN1/R15.2.1/F1AP-Containers.asn | 184 ++ .../F1AP/MESSAGES/ASN1/R15.2.1/F1AP-IEs.asn | 1441 +++++++++++++++ .../ASN1/R15.2.1/F1AP-PDU-Contents.asn | 1578 +++++++++++++++++ .../ASN1/R15.2.1/F1AP-PDU-Descriptions.asn | 353 ++++ openair2/F1AP/f1ap_common.c | 199 +++ openair2/F1AP/f1ap_common.h | 483 +++++ openair2/F1AP/f1ap_decoder.c | 235 +++ openair2/F1AP/f1ap_decoder.h | 42 + openair2/F1AP/f1ap_default_values.h | 46 + openair2/F1AP/f1ap_encoder.c | 382 ++++ openair2/F1AP/f1ap_encoder.h | 39 + openair2/F1AP/f1ap_handlers.c | 1381 +++++++++++++++ openair2/F1AP/f1ap_handlers.h | 41 + openair2/F1AP/f1ap_messaging.c | 88 + openair2/F1AP/f1ap_messaging.h | 50 + openair2/F1AP/sctp_cu.c | 123 ++ openair2/F1AP/sctp_du.c | 139 ++ openair2/F1AP/test_f1ap_cu.c | 11 + openair2/F1AP/test_f1ap_du.c | 5 + openair3/UTILS/conversions.h | 31 + 30 files changed, 11494 insertions(+), 62 deletions(-) create mode 100644 common/utils/T/T_IDs.h create mode 100644 openair2/COMMON/f1ap_messages_def.h create mode 100644 openair2/COMMON/f1ap_messages_types.h create mode 100644 openair2/F1AP/CU_F1AP.c create mode 100644 openair2/F1AP/DU_F1AP.c create mode 100644 openair2/F1AP/MESSAGES/ASN1/R15.2.1/F1AP-CommonDataTypes.asn create mode 100644 openair2/F1AP/MESSAGES/ASN1/R15.2.1/F1AP-Constants.asn create mode 100644 openair2/F1AP/MESSAGES/ASN1/R15.2.1/F1AP-Containers.asn create mode 100644 openair2/F1AP/MESSAGES/ASN1/R15.2.1/F1AP-IEs.asn create mode 100644 openair2/F1AP/MESSAGES/ASN1/R15.2.1/F1AP-PDU-Contents.asn create mode 100644 openair2/F1AP/MESSAGES/ASN1/R15.2.1/F1AP-PDU-Descriptions.asn create mode 100644 openair2/F1AP/f1ap_common.c create mode 100644 openair2/F1AP/f1ap_common.h create mode 100644 openair2/F1AP/f1ap_decoder.c create mode 100644 openair2/F1AP/f1ap_decoder.h create mode 100644 openair2/F1AP/f1ap_default_values.h create mode 100644 openair2/F1AP/f1ap_encoder.c create mode 100644 openair2/F1AP/f1ap_encoder.h create mode 100644 openair2/F1AP/f1ap_handlers.c create mode 100644 openair2/F1AP/f1ap_handlers.h create mode 100644 openair2/F1AP/f1ap_messaging.c create mode 100644 openair2/F1AP/f1ap_messaging.h create mode 100644 openair2/F1AP/sctp_cu.c create mode 100644 openair2/F1AP/sctp_du.c create mode 100644 openair2/F1AP/test_f1ap_cu.c create mode 100644 openair2/F1AP/test_f1ap_du.c diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 8c2aaa8cb3..3b22302133 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -170,7 +170,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_FLAGS_PROCESSOR} -std=gnu99 -Wall -Wstrict-prototypes -fno-strict-aliasing -rdynamic -funroll-loops -Wno-packed-bitfield-compat -fPIC ") # add autotools definitions that were maybe used! set(CMAKE_C_FLAGS - "${CMAKE_C_FLAGS} -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP -DASN_DISABLE_OER_SUPPORT -D'MAKE_VERSION(a,b,c)=((a)*256+(b)*16+c)'" + "${CMAKE_C_FLAGS} -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP -D'MAKE_VERSION(a,b,c)=((a)*256+(b)*16+c)'" ) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} -std=c++11 " @@ -478,15 +478,13 @@ include_directories ("${X2AP_DIR}") -#F1AP -# Same limitation as described in RRC/S1AP: unknown generated file list -# so we generate it at cmake time +# F1AP ############## add_list1_option(F1AP_RELEASE R15 "F1AP ASN.1 grammar version" R15) set(F1AP_DIR ${OPENAIR2_DIR}/F1AP) if (${F1AP_RELEASE} STREQUAL "R15") - make_version(F1AP_VERSION 15 1 1) - set (ASN1RELDIR R15.1.1) + make_version(F1AP_VERSION 15 2 1) + set (ASN1RELDIR R15.2.1) endif(${F1AP_RELEASE} STREQUAL "R15") add_definitions(-DF1AP_VERSION=${F1AP_VERSION}) set(F1AP_ASN_DIR ${F1AP_DIR}/MESSAGES/ASN1/${ASN1RELDIR}) @@ -507,47 +505,53 @@ unset(ENV{ASN1C_PREFIX}) 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}/F1AP-PDU-Contents.asn -o ${F1AP_C_DIR} -# RESULT_VARIABLE ret) -#if (NOT ${ret} STREQUAL 0) -# message(FATAL_ERROR "asn1tostruct.py: error") -#endif (NOT ${ret} STREQUAL 0) -#execute_process(COMMAND ${fix_asn1c_call} ${F1AP_C_DIR} F1AP ${F1AP_VERSION} -# RESULT_VARIABLE ret) -#if (NOT ${ret} STREQUAL 0) -# message(FATAL_ERROR "${fix_asn1c_call}: error") -#endif (NOT ${ret} STREQUAL 0) file(GLOB F1AP_source ${F1AP_C_DIR}/*.c) #set(F1AP_OAI_generated -# ${X2AP_C_DIR}/x2ap_decoder.c -# ${X2AP_C_DIR}/x2ap_encoder.c -# ${X2AP_C_DIR}/x2ap_xer_print.c -# ${X2AP_C_DIR}/x2ap_ies_defs.h +# ${F1AP_C_DIR}/per_decoder.c +# ${F1AP_C_DIR}/per_encoder.c + #${F1AP_C_DIR}/f1ap_xer_print.c +# ${F1AP_C_DIR}/F1AP_ProtocolIE-Field.h # ) + file(GLOB f1ap_h ${F1AP_C_DIR}/*.h) set(f1ap_h ${f1ap_h} ) -##message("calling ${X2AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f ${X2AP_ASN_DIR}/X2AP-PDU-Contents.asn -o ${X2AP_C_DIR}") -#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}/F1AP-PDU-Contents.asn -o ${F1AP_C_DIR} -# COMMAND ${fix_asn1c_call} ${F1AP_C_DIR} F1AP ${F1AP_VERSION} -# DEPENDS ${F1AP_ASN_FILES} -# ) - add_library(F1AP_LIB - ${F1AP_OAI_generated} + #${F1AP_OAI_generated} + #${f1ap_h} ${F1AP_source} -# ${F1AP_DIR}/f1ap_common.c ) include_directories ("${F1AP_C_DIR}") include_directories ("${F1AP_DIR}") +add_library(F1AP + #${F1AP_DIR}/test.c + ${F1AP_DIR}/DU_F1AP.c + ${F1AP_DIR}/CU_F1AP.c + ) +add_executable(test_f1ap_du + ${F1AP_DIR}/test_f1ap_du.c + ${F1AP_DIR}/DU_F1AP.c + ${F1AP_DIR}/sctp_du.c + ) + +target_link_libraries(test_f1ap_du + -Wl,--start-group F1AP_LIB sctp pthread -Wl,--end-group + ) + +add_executable(test_f1ap_cu + ${F1AP_DIR}/test_f1ap_cu.c + ${F1AP_DIR}/CU_F1AP.c + ${F1AP_DIR}/sctp_cu.c + ) + +target_link_libraries(test_f1ap_cu + -Wl,--start-group F1AP_LIB sctp pthread -Wl,--end-group + ) # Hardware dependant options ################################### @@ -832,6 +836,7 @@ include_directories("${OPENAIR3_DIR}/SECU") include_directories("${OPENAIR3_DIR}/SCTP") include_directories("${OPENAIR3_DIR}/S1AP") include_directories("${OPENAIR2_DIR}/X2AP") +include_directories("${OPENAIR2_DIR}/F1AP") include_directories("${OPENAIR3_DIR}/UDP") include_directories("${OPENAIR3_DIR}/GTPV1-U") include_directories("${OPENAIR_DIR}/targets/COMMON") @@ -2049,6 +2054,8 @@ add_definitions(-DASN1_MINIMUM_VERSION=924) add_executable(lte-softmodem ${rrc_h} ${s1ap_h} + ${f1ap_h} + #${OPENAIR_BIN_DIR}/messages_xml.h ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c ${OPENAIR_TARGETS}/RT/USER/lte-enb.c ${OPENAIR_TARGETS}/RT/USER/lte-ru.c @@ -2073,7 +2080,7 @@ add_executable(lte-softmodem target_link_libraries (lte-softmodem -Wl,--start-group - RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2 + RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB} LFDS7 NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB -Wl,--end-group z dl) @@ -2088,6 +2095,8 @@ target_link_libraries (lte-softmodem ${T_LIB}) add_executable(lte-softmodem-nos1 ${rrc_h} ${s1ap_h} + ${f1ap_h} + #${OPENAIR_BIN_DIR}/messages_xml.h ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c ${OPENAIR_TARGETS}/RT/USER/lte-enb.c ${OPENAIR_TARGETS}/RT/USER/lte-ru.c @@ -2126,6 +2135,8 @@ target_link_libraries (lte-softmodem-nos1 ${T_LIB}) add_executable(lte-uesoftmodem ${rrc_h} ${s1ap_h} + ${f1ap_h} + #${OPENAIR_BIN_DIR}/messages_xml.h ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c ${OPENAIR_TARGETS}/RT/USER/lte-ue.c ${OPENAIR_TARGETS}/RT/USER/lte-uesoftmodem.c @@ -2149,7 +2160,7 @@ add_executable(lte-uesoftmodem target_link_libraries (lte-uesoftmodem -Wl,--start-group - RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE SIMU + RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE SIMU ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB -Wl,--end-group z dl) @@ -2164,6 +2175,8 @@ target_link_libraries (lte-uesoftmodem ${T_LIB}) add_executable(lte-uesoftmodem-nos1 ${rrc_h} ${s1ap_h} + ${f1ap_h} +# ${OPENAIR_BIN_DIR}/messages_xml.h ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c ${OPENAIR_TARGETS}/RT/USER/lte-ue.c ${OPENAIR_TARGETS}/RT/USER/lte-uesoftmodem.c @@ -2266,7 +2279,7 @@ add_executable(test_epc_generate_scenario ${OPENAIR3_DIR}/S1AP/s1ap_eNB_defs.h ) target_link_libraries (test_epc_generate_scenario - -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES} + -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES} ) add_executable(test_epc_play_scenario @@ -2286,7 +2299,7 @@ add_executable(test_epc_play_scenario ) target_include_directories(test_epc_play_scenario PUBLIC /usr/local/share/asn1c) target_link_libraries (test_epc_play_scenario - -Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY_COMMON PHY PHY_UE LFDS ${ITTI_LIB} ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES} + -Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY_COMMON PHY PHY_UE LFDS ${ITTI_LIB} ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES} ) @@ -2322,7 +2335,7 @@ if (${T_TRACER}) dlsim_tm4 dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim prachsim syncsim ulsim #all "add_library" definitions - ITTI RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB + ITTI RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB F1AP_LIB F1AP oai_exmimodevif oai_usrpdevif oai_bladerfdevif oai_lmssdrdevif oai_eth_transpro FLPT_MSG ASYNC_IF FLEXRAN_AGENT HASHTABLE MSC UTIL OMG_SUMO SECU_OSA diff --git a/cmake_targets/tools/generate_asn1 b/cmake_targets/tools/generate_asn1 index 1a9cb975ac..b382730c6a 100755 --- a/cmake_targets/tools/generate_asn1 +++ b/cmake_targets/tools/generate_asn1 @@ -2,23 +2,29 @@ function main() { -mkdir -p $1 -cd $1 +PROTOCOL_DIR=$1 +mkdir -p ${PROTOCOL_DIR} +cd ${PROTOCOL_DIR} + +# Because use $* also include directory, so we need shift shift -#if this script is called with only 2 arguments (so 1 here after the shift), it's for RRC -#(there may be a better way...) -if [ $# -eq 1 ]; then +# There are three types parameter for asn1c +# One is for RRC +# and one is for F1AP +# another is for other protocols -#asn1c does not work well with extension groups, we need the following fix: -# replace [[ by ' SEQUENCE {' -# and ]] by '} OPTIONAL' -# is ext with N starting from 1 and incremented at each new [[ ]] just -#following another [[ ]] -# -#this is what the following C program does +if echo ${PROTOCOL_DIR} | grep -q "RRC"; then -echo generate asnfix.c + #asn1c does not work well with extension groups, we need the following fix: + # replace [[ by ' SEQUENCE {' + # and ]] by '} OPTIONAL' + # is ext with N starting from 1 and incremented at each new [[ ]] just + #following another [[ ]] + # + #this is what the following C program does + + echo generate asnfix.c cat << EOF > asnfix.c /* transforms: @@ -85,30 +91,34 @@ int main(void) } EOF -echo compile asnfix.c + echo compile asnfix.c -gcc -Wall -o asnfix asnfix.c + gcc -Wall -o asnfix asnfix.c -echo run asnfix on $1 + echo run asnfix on $1 -./asnfix < $1 > fixed_grammar.asn + ./asnfix < $1 > fixed_grammar.asn -rm -f asnfix asnfix.c + rm -f asnfix asnfix.c -echo done with asnfix + echo done with asnfix -echo running asn1c + echo running asn1c -asn1c -gen-PER -fcompound-names -no-gen-example 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 + rm -f fixed_grammar.asn -echo asn1c done + echo asn1c done +elif echo ${PROTOCOL_DIR} | grep -q "F1AP"; then + + asn1c -gen-PER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps $* 2>&1 | grep -v -- '->' | grep -v '^Compiled' |grep -v sample + else - -asn1c -gen-PER -fcompound-names -no-gen-example $* 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 awk ' diff --git a/common/utils/LOG/log.h b/common/utils/LOG/log.h index de4a926c7a..7354c32c7d 100644 --- a/common/utils/LOG/log.h +++ b/common/utils/LOG/log.h @@ -173,6 +173,7 @@ typedef enum { GTPU, SPGW, S1AP, + F1AP, SCTP, HW, OSA, diff --git a/common/utils/T/T_IDs.h b/common/utils/T/T_IDs.h new file mode 100644 index 0000000000..58b4307518 --- /dev/null +++ b/common/utils/T/T_IDs.h @@ -0,0 +1,546 @@ +/* generated file, do not edit by hand */ + +#define T_ENB_MASTER_TICK T_ID(0) +#define T_ENB_PHY_UL_TICK T_ID(1) +#define T_ENB_PHY_DL_TICK T_ID(2) +#define T_ENB_PHY_DLSCH_UE_DCI T_ID(3) +#define T_ENB_PHY_DLSCH_UE_ACK T_ID(4) +#define T_ENB_PHY_DLSCH_UE_NACK T_ID(5) +#define T_ENB_PHY_ULSCH_UE_DCI T_ID(6) +#define T_ENB_PHY_ULSCH_UE_NO_DCI_RETRANSMISSION T_ID(7) +#define T_ENB_PHY_ULSCH_UE_ACK T_ID(8) +#define T_ENB_PHY_ULSCH_UE_NACK T_ID(9) +#define T_ENB_PHY_INPUT_SIGNAL T_ID(10) +#define T_ENB_PHY_OUTPUT_SIGNAL T_ID(11) +#define T_ENB_PHY_UL_CHANNEL_ESTIMATE T_ID(12) +#define T_ENB_PHY_PUSCH_IQ T_ID(13) +#define T_ENB_PHY_PUCCH_1AB_IQ T_ID(14) +#define T_ENB_PHY_PUCCH_1_ENERGY T_ID(15) +#define T_ENB_PHY_PHICH T_ID(16) +#define T_ENB_PHY_MSG3_ALLOCATION T_ID(17) +#define T_ENB_PHY_INITIATE_RA_PROCEDURE T_ID(18) +#define T_ENB_MAC_UE_DL_SDU T_ID(19) +#define T_ENB_MAC_UE_UL_SCHEDULE T_ID(20) +#define T_ENB_MAC_UE_UL_SCHEDULE_RETRANSMISSION T_ID(21) +#define T_ENB_MAC_UE_UL_PDU T_ID(22) +#define T_ENB_MAC_UE_UL_PDU_WITH_DATA T_ID(23) +#define T_ENB_MAC_UE_UL_SDU T_ID(24) +#define T_ENB_MAC_UE_UL_SDU_WITH_DATA T_ID(25) +#define T_ENB_MAC_UE_UL_CE T_ID(26) +#define T_ENB_MAC_UE_DL_PDU_WITH_DATA T_ID(27) +#define T_ENB_MAC_SCHEDULING_REQUEST T_ID(28) +#define T_ENB_RLC_DL T_ID(29) +#define T_ENB_RLC_UL T_ID(30) +#define T_ENB_RLC_MAC_DL T_ID(31) +#define T_ENB_RLC_MAC_UL T_ID(32) +#define T_ENB_PDCP_UL T_ID(33) +#define T_ENB_PDCP_DL T_ID(34) +#define T_ENB_RRC_CONNECTION_SETUP_COMPLETE T_ID(35) +#define T_ENB_RRC_SECURITY_MODE_COMMAND T_ID(36) +#define T_ENB_RRC_SECURITY_MODE_COMPLETE T_ID(37) +#define T_ENB_RRC_SECURITY_MODE_FAILURE T_ID(38) +#define T_ENB_RRC_UE_CAPABILITY_ENQUIRY T_ID(39) +#define T_ENB_RRC_UE_CAPABILITY_INFORMATION T_ID(40) +#define T_ENB_RRC_CONNECTION_REQUEST T_ID(41) +#define T_ENB_RRC_CONNECTION_REJECT T_ID(42) +#define T_ENB_RRC_CONNECTION_REESTABLISHMENT_REQUEST T_ID(43) +#define T_ENB_RRC_CONNECTION_REESTABLISHMENT T_ID(44) +#define T_ENB_RRC_CONNECTION_REESTABLISHMENT_COMPLETE T_ID(45) +#define T_ENB_RRC_CONNECTION_REESTABLISHMENT_REJECT T_ID(46) +#define T_ENB_RRC_CONNECTION_RELEASE T_ID(47) +#define T_ENB_RRC_CONNECTION_RECONFIGURATION T_ID(48) +#define T_ENB_RRC_MEASUREMENT_REPORT T_ID(49) +#define T_ENB_RRC_HANDOVER_PREPARATION_INFORMATION T_ID(50) +#define T_ENB_RRC_CONNECTION_RECONFIGURATION_COMPLETE T_ID(51) +#define T_ENB_RRC_CONNECTION_SETUP T_ID(52) +#define T_ENB_RRC_UL_CCCH_DATA_IN T_ID(53) +#define T_ENB_RRC_UL_DCCH_DATA_IN T_ID(54) +#define T_ENB_RRC_UL_HANDOVER_PREPARATION_TRANSFER T_ID(55) +#define T_ENB_RRC_UL_INFORMATION_TRANSFER T_ID(56) +#define T_ENB_RRC_COUNTER_CHECK_RESPONSE T_ID(57) +#define T_ENB_RRC_UE_INFORMATION_RESPONSE_R9 T_ID(58) +#define T_ENB_RRC_PROXIMITY_INDICATION_R9 T_ID(59) +#define T_ENB_RRC_RECONFIGURATION_COMPLETE_R10 T_ID(60) +#define T_ENB_RRC_MBMS_COUNTING_RESPONSE_R10 T_ID(61) +#define T_ENB_RRC_INTER_FREQ_RSTD_MEASUREMENT_INDICATION T_ID(62) +#define T_ENB_RRC_UNKNOW_MESSAGE T_ID(63) +#define T_LEGACY_MAC_INFO T_ID(64) +#define T_LEGACY_MAC_ERROR T_ID(65) +#define T_LEGACY_MAC_WARNING T_ID(66) +#define T_LEGACY_MAC_DEBUG T_ID(67) +#define T_LEGACY_MAC_TRACE T_ID(68) +#define T_LEGACY_PHY_INFO T_ID(69) +#define T_LEGACY_PHY_ERROR T_ID(70) +#define T_LEGACY_PHY_WARNING T_ID(71) +#define T_LEGACY_PHY_DEBUG T_ID(72) +#define T_LEGACY_PHY_TRACE T_ID(73) +#define T_LEGACY_S1AP_INFO T_ID(74) +#define T_LEGACY_S1AP_ERROR T_ID(75) +#define T_LEGACY_S1AP_WARNING T_ID(76) +#define T_LEGACY_S1AP_DEBUG T_ID(77) +#define T_LEGACY_S1AP_TRACE T_ID(78) +#define T_LEGACY_X2AP_INFO T_ID(79) +#define T_LEGACY_X2AP_ERROR T_ID(80) +#define T_LEGACY_X2AP_WARNING T_ID(81) +#define T_LEGACY_X2AP_DEBUG T_ID(82) +#define T_LEGACY_X2AP_TRACE T_ID(83) +#define T_LEGACY_RRC_INFO T_ID(84) +#define T_LEGACY_RRC_ERROR T_ID(85) +#define T_LEGACY_RRC_WARNING T_ID(86) +#define T_LEGACY_RRC_DEBUG T_ID(87) +#define T_LEGACY_RRC_TRACE T_ID(88) +#define T_LEGACY_RLC_INFO T_ID(89) +#define T_LEGACY_RLC_ERROR T_ID(90) +#define T_LEGACY_RLC_WARNING T_ID(91) +#define T_LEGACY_RLC_DEBUG T_ID(92) +#define T_LEGACY_RLC_TRACE T_ID(93) +#define T_LEGACY_PDCP_INFO T_ID(94) +#define T_LEGACY_PDCP_ERROR T_ID(95) +#define T_LEGACY_PDCP_WARNING T_ID(96) +#define T_LEGACY_PDCP_DEBUG T_ID(97) +#define T_LEGACY_PDCP_TRACE T_ID(98) +#define T_LEGACY_ENB_APP_INFO T_ID(99) +#define T_LEGACY_ENB_APP_ERROR T_ID(100) +#define T_LEGACY_ENB_APP_WARNING T_ID(101) +#define T_LEGACY_ENB_APP_DEBUG T_ID(102) +#define T_LEGACY_ENB_APP_TRACE T_ID(103) +#define T_LEGACY_FLEXRAN_AGENT_INFO T_ID(104) +#define T_LEGACY_FLEXRAN_AGENT_ERROR T_ID(105) +#define T_LEGACY_FLEXRAN_AGENT_WARNING T_ID(106) +#define T_LEGACY_FLEXRAN_AGENT_DEBUG T_ID(107) +#define T_LEGACY_FLEXRAN_AGENT_TRACE T_ID(108) +#define T_LEGACY_SCTP_INFO T_ID(109) +#define T_LEGACY_SCTP_ERROR T_ID(110) +#define T_LEGACY_SCTP_WARNING T_ID(111) +#define T_LEGACY_SCTP_DEBUG T_ID(112) +#define T_LEGACY_SCTP_TRACE T_ID(113) +#define T_LEGACY_UDP__INFO T_ID(114) +#define T_LEGACY_UDP__ERROR T_ID(115) +#define T_LEGACY_UDP__WARNING T_ID(116) +#define T_LEGACY_UDP__DEBUG T_ID(117) +#define T_LEGACY_UDP__TRACE T_ID(118) +#define T_LEGACY_NAS_INFO T_ID(119) +#define T_LEGACY_NAS_ERROR T_ID(120) +#define T_LEGACY_NAS_WARNING T_ID(121) +#define T_LEGACY_NAS_DEBUG T_ID(122) +#define T_LEGACY_NAS_TRACE T_ID(123) +#define T_LEGACY_HW_INFO T_ID(124) +#define T_LEGACY_HW_ERROR T_ID(125) +#define T_LEGACY_HW_WARNING T_ID(126) +#define T_LEGACY_HW_DEBUG T_ID(127) +#define T_LEGACY_HW_TRACE T_ID(128) +#define T_LEGACY_EMU_INFO T_ID(129) +#define T_LEGACY_EMU_ERROR T_ID(130) +#define T_LEGACY_EMU_WARNING T_ID(131) +#define T_LEGACY_EMU_DEBUG T_ID(132) +#define T_LEGACY_EMU_TRACE T_ID(133) +#define T_LEGACY_OTG_INFO T_ID(134) +#define T_LEGACY_OTG_ERROR T_ID(135) +#define T_LEGACY_OTG_WARNING T_ID(136) +#define T_LEGACY_OTG_DEBUG T_ID(137) +#define T_LEGACY_OTG_TRACE T_ID(138) +#define T_LEGACY_OCG_INFO T_ID(139) +#define T_LEGACY_OCG_ERROR T_ID(140) +#define T_LEGACY_OCG_WARNING T_ID(141) +#define T_LEGACY_OCG_DEBUG T_ID(142) +#define T_LEGACY_OCG_TRACE T_ID(143) +#define T_LEGACY_OCM_INFO T_ID(144) +#define T_LEGACY_OCM_ERROR T_ID(145) +#define T_LEGACY_OCM_WARNING T_ID(146) +#define T_LEGACY_OCM_DEBUG T_ID(147) +#define T_LEGACY_OCM_TRACE T_ID(148) +#define T_LEGACY_OIP_INFO T_ID(149) +#define T_LEGACY_OIP_ERROR T_ID(150) +#define T_LEGACY_OIP_WARNING T_ID(151) +#define T_LEGACY_OIP_DEBUG T_ID(152) +#define T_LEGACY_OIP_TRACE T_ID(153) +#define T_LEGACY_OMG_INFO T_ID(154) +#define T_LEGACY_OMG_ERROR T_ID(155) +#define T_LEGACY_OMG_WARNING T_ID(156) +#define T_LEGACY_OMG_DEBUG T_ID(157) +#define T_LEGACY_OMG_TRACE T_ID(158) +#define T_LEGACY_OPT_INFO T_ID(159) +#define T_LEGACY_OPT_ERROR T_ID(160) +#define T_LEGACY_OPT_WARNING T_ID(161) +#define T_LEGACY_OPT_DEBUG T_ID(162) +#define T_LEGACY_OPT_TRACE T_ID(163) +#define T_LEGACY_GTPU_INFO T_ID(164) +#define T_LEGACY_GTPU_ERROR T_ID(165) +#define T_LEGACY_GTPU_WARNING T_ID(166) +#define T_LEGACY_GTPU_DEBUG T_ID(167) +#define T_LEGACY_GTPU_TRACE T_ID(168) +#define T_LEGACY_TMR_INFO T_ID(169) +#define T_LEGACY_TMR_ERROR T_ID(170) +#define T_LEGACY_TMR_WARNING T_ID(171) +#define T_LEGACY_TMR_DEBUG T_ID(172) +#define T_LEGACY_TMR_TRACE T_ID(173) +#define T_LEGACY_OSA_INFO T_ID(174) +#define T_LEGACY_OSA_ERROR T_ID(175) +#define T_LEGACY_OSA_WARNING T_ID(176) +#define T_LEGACY_OSA_DEBUG T_ID(177) +#define T_LEGACY_OSA_TRACE T_ID(178) +#define T_LEGACY_SIM_INFO T_ID(179) +#define T_LEGACY_SIM_ERROR T_ID(180) +#define T_LEGACY_SIM_WARNING T_ID(181) +#define T_LEGACY_SIM_DEBUG T_ID(182) +#define T_LEGACY_SIM_TRACE T_ID(183) +#define T_LEGACY_component_INFO T_ID(184) +#define T_LEGACY_component_ERROR T_ID(185) +#define T_LEGACY_component_WARNING T_ID(186) +#define T_LEGACY_component_DEBUG T_ID(187) +#define T_LEGACY_component_TRACE T_ID(188) +#define T_LEGACY_componentP_INFO T_ID(189) +#define T_LEGACY_componentP_ERROR T_ID(190) +#define T_LEGACY_componentP_WARNING T_ID(191) +#define T_LEGACY_componentP_DEBUG T_ID(192) +#define T_LEGACY_componentP_TRACE T_ID(193) +#define T_LEGACY_CLI_INFO T_ID(194) +#define T_LEGACY_CLI_ERROR T_ID(195) +#define T_LEGACY_CLI_WARNING T_ID(196) +#define T_LEGACY_CLI_DEBUG T_ID(197) +#define T_LEGACY_CLI_TRACE T_ID(198) +#define T_UE_MASTER_TICK T_ID(199) +#define T_UE_PHY_UL_TICK T_ID(200) +#define T_UE_PHY_DL_TICK T_ID(201) +#define T_UE_PHY_DLSCH_UE_DCI T_ID(202) +#define T_UE_PHY_DLSCH_UE_ACK T_ID(203) +#define T_UE_PHY_DLSCH_UE_NACK T_ID(204) +#define T_UE_PHY_ULSCH_UE_DCI T_ID(205) +#define T_UE_PHY_ULSCH_UE_ACK T_ID(206) +#define T_UE_PHY_ULSCH_UE_NACK T_ID(207) +#define T_UE_PHY_INPUT_SIGNAL T_ID(208) +#define T_UE_PHY_DL_CHANNEL_ESTIMATE T_ID(209) +#define T_UE_PHY_PDCCH_IQ T_ID(210) +#define T_UE_PHY_PDCCH_ENERGY T_ID(211) +#define T_UE_PHY_PDSCH_IQ T_ID(212) +#define T_UE_PHY_PDSCH_ENERGY T_ID(213) +#define T_UE_PHY_PUSCH_TX_POWER T_ID(214) +#define T_UE_PHY_PUCCH_TX_POWER T_ID(215) +#define T_UE_PHY_MEAS T_ID(216) +#define T_first T_ID(217) +#define T_buf_test T_ID(218) +#define T_VCD_VARIABLE_FRAME_NUMBER_TX0_ENB T_ID(219) +#define T_VCD_VARIABLE_FRAME_NUMBER_TX1_ENB T_ID(220) +#define T_VCD_VARIABLE_FRAME_NUMBER_RX0_ENB T_ID(221) +#define T_VCD_VARIABLE_FRAME_NUMBER_RX1_ENB T_ID(222) +#define T_VCD_VARIABLE_SUBFRAME_NUMBER_TX0_ENB T_ID(223) +#define T_VCD_VARIABLE_SUBFRAME_NUMBER_TX1_ENB T_ID(224) +#define T_VCD_VARIABLE_SUBFRAME_NUMBER_RX0_ENB T_ID(225) +#define T_VCD_VARIABLE_SUBFRAME_NUMBER_RX1_ENB T_ID(226) +#define T_VCD_VARIABLE_FRAME_NUMBER_TX0_RU T_ID(227) +#define T_VCD_VARIABLE_FRAME_NUMBER_TX1_RU T_ID(228) +#define T_VCD_VARIABLE_FRAME_NUMBER_RX0_RU T_ID(229) +#define T_VCD_VARIABLE_FRAME_NUMBER_RX1_RU T_ID(230) +#define T_VCD_VARIABLE_SUBFRAME_NUMBER_TX0_RU T_ID(231) +#define T_VCD_VARIABLE_SUBFRAME_NUMBER_TX1_RU T_ID(232) +#define T_VCD_VARIABLE_SUBFRAME_NUMBER_RX0_RU T_ID(233) +#define T_VCD_VARIABLE_SUBFRAME_NUMBER_RX1_RU T_ID(234) +#define T_VCD_VARIABLE_RUNTIME_TX_ENB T_ID(235) +#define T_VCD_VARIABLE_RUNTIME_RX_ENB T_ID(236) +#define T_VCD_VARIABLE_FRAME_NUMBER_TX0_UE T_ID(237) +#define T_VCD_VARIABLE_FRAME_NUMBER_TX1_UE T_ID(238) +#define T_VCD_VARIABLE_FRAME_NUMBER_RX0_UE T_ID(239) +#define T_VCD_VARIABLE_FRAME_NUMBER_RX1_UE T_ID(240) +#define T_VCD_VARIABLE_SUBFRAME_NUMBER_TX0_UE T_ID(241) +#define T_VCD_VARIABLE_SUBFRAME_NUMBER_TX1_UE T_ID(242) +#define T_VCD_VARIABLE_SUBFRAME_NUMBER_RX0_UE T_ID(243) +#define T_VCD_VARIABLE_SUBFRAME_NUMBER_RX1_UE T_ID(244) +#define T_VCD_VARIABLE_UE_RX_OFFSET T_ID(245) +#define T_VCD_VARIABLE_DIFF T_ID(246) +#define T_VCD_VARIABLE_HW_SUBFRAME T_ID(247) +#define T_VCD_VARIABLE_HW_FRAME T_ID(248) +#define T_VCD_VARIABLE_HW_SUBFRAME_RX T_ID(249) +#define T_VCD_VARIABLE_HW_FRAME_RX T_ID(250) +#define T_VCD_VARIABLE_TXCNT T_ID(251) +#define T_VCD_VARIABLE_RXCNT T_ID(252) +#define T_VCD_VARIABLE_TRX_TS T_ID(253) +#define T_VCD_VARIABLE_TRX_TST T_ID(254) +#define T_VCD_VARIABLE_TRX_TS_UE T_ID(255) +#define T_VCD_VARIABLE_TRX_TST_UE T_ID(256) +#define T_VCD_VARIABLE_TRX_WRITE_FLAGS T_ID(257) +#define T_VCD_VARIABLE_TX_TS T_ID(258) +#define T_VCD_VARIABLE_RX_TS T_ID(259) +#define T_VCD_VARIABLE_RX_HWCNT T_ID(260) +#define T_VCD_VARIABLE_RX_LHWCNT T_ID(261) +#define T_VCD_VARIABLE_TX_HWCNT T_ID(262) +#define T_VCD_VARIABLE_TX_LHWCNT T_ID(263) +#define T_VCD_VARIABLE_RX_PCK T_ID(264) +#define T_VCD_VARIABLE_TX_PCK T_ID(265) +#define T_VCD_VARIABLE_RX_SEQ_NUM T_ID(266) +#define T_VCD_VARIABLE_RX_SEQ_NUM_PRV T_ID(267) +#define T_VCD_VARIABLE_TX_SEQ_NUM T_ID(268) +#define T_VCD_VARIABLE_CNT T_ID(269) +#define T_VCD_VARIABLE_DUMMY_DUMP T_ID(270) +#define T_VCD_VARIABLE_ITTI_SEND_MSG T_ID(271) +#define T_VCD_VARIABLE_ITTI_POLL_MSG T_ID(272) +#define T_VCD_VARIABLE_ITTI_RECV_MSG T_ID(273) +#define T_VCD_VARIABLE_ITTI_ALLOC_MSG T_ID(274) +#define T_VCD_VARIABLE_MP_ALLOC T_ID(275) +#define T_VCD_VARIABLE_MP_FREE T_ID(276) +#define T_VCD_VARIABLE_UE_INST_CNT_RX T_ID(277) +#define T_VCD_VARIABLE_UE_INST_CNT_TX T_ID(278) +#define T_VCD_VARIABLE_DCI_INFO T_ID(279) +#define T_VCD_VARIABLE_UE0_BSR T_ID(280) +#define T_VCD_VARIABLE_UE0_BO T_ID(281) +#define T_VCD_VARIABLE_UE0_SCHEDULED T_ID(282) +#define T_VCD_VARIABLE_UE0_TIMING_ADVANCE T_ID(283) +#define T_VCD_VARIABLE_UE0_SR_ENERGY T_ID(284) +#define T_VCD_VARIABLE_UE0_SR_THRES T_ID(285) +#define T_VCD_VARIABLE_UE0_RSSI0 T_ID(286) +#define T_VCD_VARIABLE_UE0_RSSI1 T_ID(287) +#define T_VCD_VARIABLE_UE0_RSSI2 T_ID(288) +#define T_VCD_VARIABLE_UE0_RSSI3 T_ID(289) +#define T_VCD_VARIABLE_UE0_RSSI4 T_ID(290) +#define T_VCD_VARIABLE_UE0_RSSI5 T_ID(291) +#define T_VCD_VARIABLE_UE0_RSSI6 T_ID(292) +#define T_VCD_VARIABLE_UE0_RSSI7 T_ID(293) +#define T_VCD_VARIABLE_UE0_RES0 T_ID(294) +#define T_VCD_VARIABLE_UE0_RES1 T_ID(295) +#define T_VCD_VARIABLE_UE0_RES2 T_ID(296) +#define T_VCD_VARIABLE_UE0_RES3 T_ID(297) +#define T_VCD_VARIABLE_UE0_RES4 T_ID(298) +#define T_VCD_VARIABLE_UE0_RES5 T_ID(299) +#define T_VCD_VARIABLE_UE0_RES6 T_ID(300) +#define T_VCD_VARIABLE_UE0_RES7 T_ID(301) +#define T_VCD_VARIABLE_UE0_MCS0 T_ID(302) +#define T_VCD_VARIABLE_UE0_MCS1 T_ID(303) +#define T_VCD_VARIABLE_UE0_MCS2 T_ID(304) +#define T_VCD_VARIABLE_UE0_MCS3 T_ID(305) +#define T_VCD_VARIABLE_UE0_MCS4 T_ID(306) +#define T_VCD_VARIABLE_UE0_MCS5 T_ID(307) +#define T_VCD_VARIABLE_UE0_MCS6 T_ID(308) +#define T_VCD_VARIABLE_UE0_MCS7 T_ID(309) +#define T_VCD_VARIABLE_UE0_RB0 T_ID(310) +#define T_VCD_VARIABLE_UE0_RB1 T_ID(311) +#define T_VCD_VARIABLE_UE0_RB2 T_ID(312) +#define T_VCD_VARIABLE_UE0_RB3 T_ID(313) +#define T_VCD_VARIABLE_UE0_RB4 T_ID(314) +#define T_VCD_VARIABLE_UE0_RB5 T_ID(315) +#define T_VCD_VARIABLE_UE0_RB6 T_ID(316) +#define T_VCD_VARIABLE_UE0_RB7 T_ID(317) +#define T_VCD_VARIABLE_UE0_ROUND0 T_ID(318) +#define T_VCD_VARIABLE_UE0_ROUND1 T_ID(319) +#define T_VCD_VARIABLE_UE0_ROUND2 T_ID(320) +#define T_VCD_VARIABLE_UE0_ROUND3 T_ID(321) +#define T_VCD_VARIABLE_UE0_ROUND4 T_ID(322) +#define T_VCD_VARIABLE_UE0_ROUND5 T_ID(323) +#define T_VCD_VARIABLE_UE0_ROUND6 T_ID(324) +#define T_VCD_VARIABLE_UE0_ROUND7 T_ID(325) +#define T_VCD_VARIABLE_UE0_SFN0 T_ID(326) +#define T_VCD_VARIABLE_UE0_SFN1 T_ID(327) +#define T_VCD_VARIABLE_UE0_SFN2 T_ID(328) +#define T_VCD_VARIABLE_UE0_SFN3 T_ID(329) +#define T_VCD_VARIABLE_UE0_SFN4 T_ID(330) +#define T_VCD_VARIABLE_UE0_SFN5 T_ID(331) +#define T_VCD_VARIABLE_UE0_SFN6 T_ID(332) +#define T_VCD_VARIABLE_UE0_SFN7 T_ID(333) +#define T_VCD_VARIABLE_SEND_IF4_SYMBOL T_ID(334) +#define T_VCD_VARIABLE_RECV_IF4_SYMBOL T_ID(335) +#define T_VCD_VARIABLE_SEND_IF5_PKT_ID T_ID(336) +#define T_VCD_VARIABLE_RECV_IF5_PKT_ID T_ID(337) +#define T_VCD_VARIABLE_UE_PDCP_FLUSH_SIZE T_ID(338) +#define T_VCD_VARIABLE_UE_PDCP_FLUSH_ERR T_ID(339) +#define T_VCD_VARIABLE_UE0_TRX_READ_NS T_ID(340) +#define T_VCD_VARIABLE_UE0_TRX_WRITE_NS T_ID(341) +#define T_VCD_VARIABLE_UE0_TRX_READ_NS_MISSING T_ID(342) +#define T_VCD_VARIABLE_UE0_TRX_WRITE_NS_MISSING T_ID(343) +#define T_VCD_VARIABLE_CPUID_ENB_THREAD_RXTX T_ID(344) +#define T_VCD_VARIABLE_CPUID_RU_THREAD T_ID(345) +#define T_VCD_VARIABLE_CPUID_RU_THREAD_TX T_ID(346) +#define T_VCD_FUNCTION_RT_SLEEP T_ID(347) +#define T_VCD_FUNCTION_TRX_READ T_ID(348) +#define T_VCD_FUNCTION_TRX_WRITE T_ID(349) +#define T_VCD_FUNCTION_TRX_READ_UE T_ID(350) +#define T_VCD_FUNCTION_TRX_WRITE_UE T_ID(351) +#define T_VCD_FUNCTION_TRX_READ_IF T_ID(352) +#define T_VCD_FUNCTION_TRX_WRITE_IF T_ID(353) +#define T_VCD_FUNCTION_eNB_PROC_RXTX0 T_ID(354) +#define T_VCD_FUNCTION_eNB_PROC_RXTX1 T_ID(355) +#define T_VCD_FUNCTION_UE_THREAD_SYNCH T_ID(356) +#define T_VCD_FUNCTION_UE_THREAD_RXTX0 T_ID(357) +#define T_VCD_FUNCTION_UE_THREAD_RXTX1 T_ID(358) +#define T_VCD_FUNCTION_TRX_READ_SF9 T_ID(359) +#define T_VCD_FUNCTION_TRX_WRITE_SF9 T_ID(360) +#define T_VCD_FUNCTION_UE_SIGNAL_COND_RXTX0 T_ID(361) +#define T_VCD_FUNCTION_UE_SIGNAL_COND_RXTX1 T_ID(362) +#define T_VCD_FUNCTION_UE_WAIT_COND_RXTX0 T_ID(363) +#define T_VCD_FUNCTION_UE_WAIT_COND_RXTX1 T_ID(364) +#define T_VCD_FUNCTION_UE_LOCK_MUTEX_RXTX_FOR_COND_WAIT0 T_ID(365) +#define T_VCD_FUNCTION_UE_LOCK_MUTEX_RXTX_FOR_COND_WAIT1 T_ID(366) +#define T_VCD_FUNCTION_UE_LOCK_MUTEX_RXTX_FOR_CNT_DECREMENT0 T_ID(367) +#define T_VCD_FUNCTION_UE_LOCK_MUTEX_RXTX_FOR_CNT_DECREMENT1 T_ID(368) +#define T_VCD_FUNCTION_UE_LOCK_MUTEX_RXTX_FOR_CNT_INCREMENT0 T_ID(369) +#define T_VCD_FUNCTION_UE_LOCK_MUTEX_RXTX_FOR_CNT_INCREMENT1 T_ID(370) +#define T_VCD_FUNCTION_SIM_DO_DL_SIGNAL T_ID(371) +#define T_VCD_FUNCTION_SIM_DO_UL_SIGNAL T_ID(372) +#define T_VCD_FUNCTION_SIM_UE_TRX_READ T_ID(373) +#define T_VCD_FUNCTION_eNB_TX T_ID(374) +#define T_VCD_FUNCTION_eNB_RX T_ID(375) +#define T_VCD_FUNCTION_eNB_TRX T_ID(376) +#define T_VCD_FUNCTION_eNB_TM T_ID(377) +#define T_VCD_FUNCTION_eNB_RX_SLEEP T_ID(378) +#define T_VCD_FUNCTION_eNB_TX_SLEEP T_ID(379) +#define T_VCD_FUNCTION_eNB_PROC_SLEEP T_ID(380) +#define T_VCD_FUNCTION_TRX_READ_RF T_ID(381) +#define T_VCD_FUNCTION_TRX_WRITE_RF T_ID(382) +#define T_VCD_FUNCTION_UE_SYNCH T_ID(383) +#define T_VCD_FUNCTION_UE_SLOT_FEP T_ID(384) +#define T_VCD_FUNCTION_UE_RRC_MEASUREMENTS T_ID(385) +#define T_VCD_FUNCTION_UE_GAIN_CONTROL T_ID(386) +#define T_VCD_FUNCTION_UE_ADJUST_SYNCH T_ID(387) +#define T_VCD_FUNCTION_UE_MEASUREMENT_PROCEDURES T_ID(388) +#define T_VCD_FUNCTION_UE_PDCCH_PROCEDURES T_ID(389) +#define T_VCD_FUNCTION_UE_PBCH_PROCEDURES T_ID(390) +#define T_VCD_FUNCTION_PHY_PROCEDURES_ENB_TX T_ID(391) +#define T_VCD_FUNCTION_PHY_PROCEDURES_ENB_TX1 T_ID(392) +#define T_VCD_FUNCTION_PHY_PROCEDURES_RU_FEPRX T_ID(393) +#define T_VCD_FUNCTION_PHY_PROCEDURES_RU_FEPRX1 T_ID(394) +#define T_VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM T_ID(395) +#define T_VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM1 T_ID(396) +#define T_VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_PREC T_ID(397) +#define T_VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_PREC1 T_ID(398) +#define T_VCD_FUNCTION_PHY_PROCEDURES_ENB_RX_UESPEC T_ID(399) +#define T_VCD_FUNCTION_PHY_PROCEDURES_ENB_RX_UESPEC1 T_ID(400) +#define T_VCD_FUNCTION_PHY_PROCEDURES_UE_TX T_ID(401) +#define T_VCD_FUNCTION_PHY_PROCEDURES_UE_RX T_ID(402) +#define T_VCD_FUNCTION_PHY_PROCEDURES_UE_TX_ULSCH_UESPEC T_ID(403) +#define T_VCD_FUNCTION_PHY_PROCEDURES_UE_TX_PUCCH T_ID(404) +#define T_VCD_FUNCTION_PHY_PROCEDURES_UE_TX_ULSCH_COMMON T_ID(405) +#define T_VCD_FUNCTION_PHY_PROCEDURES_UE_TX_PRACH T_ID(406) +#define T_VCD_FUNCTION_PHY_PROCEDURES_UE_TX_ULSCH_RAR T_ID(407) +#define T_VCD_FUNCTION_PHY_PROCEDURES_ENB_LTE T_ID(408) +#define T_VCD_FUNCTION_PHY_PROCEDURES_UE_LTE T_ID(409) +#define T_VCD_FUNCTION_PDSCH_THREAD T_ID(410) +#define T_VCD_FUNCTION_DLSCH_THREAD0 T_ID(411) +#define T_VCD_FUNCTION_DLSCH_THREAD1 T_ID(412) +#define T_VCD_FUNCTION_DLSCH_THREAD2 T_ID(413) +#define T_VCD_FUNCTION_DLSCH_THREAD3 T_ID(414) +#define T_VCD_FUNCTION_DLSCH_THREAD4 T_ID(415) +#define T_VCD_FUNCTION_DLSCH_THREAD5 T_ID(416) +#define T_VCD_FUNCTION_DLSCH_THREAD6 T_ID(417) +#define T_VCD_FUNCTION_DLSCH_THREAD7 T_ID(418) +#define T_VCD_FUNCTION_DLSCH_DECODING0 T_ID(419) +#define T_VCD_FUNCTION_DLSCH_DECODING1 T_ID(420) +#define T_VCD_FUNCTION_DLSCH_DECODING2 T_ID(421) +#define T_VCD_FUNCTION_DLSCH_DECODING3 T_ID(422) +#define T_VCD_FUNCTION_DLSCH_DECODING4 T_ID(423) +#define T_VCD_FUNCTION_DLSCH_DECODING5 T_ID(424) +#define T_VCD_FUNCTION_DLSCH_DECODING6 T_ID(425) +#define T_VCD_FUNCTION_DLSCH_DECODING7 T_ID(426) +#define T_VCD_FUNCTION_RX_PDCCH T_ID(427) +#define T_VCD_FUNCTION_DCI_DECODING T_ID(428) +#define T_VCD_FUNCTION_RX_PHICH T_ID(429) +#define T_VCD_FUNCTION_PDSCH_PROC T_ID(430) +#define T_VCD_FUNCTION_PDSCH_PROC_SI T_ID(431) +#define T_VCD_FUNCTION_PDSCH_PROC_P T_ID(432) +#define T_VCD_FUNCTION_PDSCH_PROC_RA T_ID(433) +#define T_VCD_FUNCTION_PHY_UE_CONFIG_SIB2 T_ID(434) +#define T_VCD_FUNCTION_PHY_CONFIG_SIB1_ENB T_ID(435) +#define T_VCD_FUNCTION_PHY_CONFIG_SIB2_ENB T_ID(436) +#define T_VCD_FUNCTION_PHY_CONFIG_DEDICATED_ENB T_ID(437) +#define T_VCD_FUNCTION_PHY_UE_COMPUTE_PRACH T_ID(438) +#define T_VCD_FUNCTION_PHY_ENB_ULSCH_MSG3 T_ID(439) +#define T_VCD_FUNCTION_PHY_ENB_ULSCH_DECODING0 T_ID(440) +#define T_VCD_FUNCTION_PHY_ENB_ULSCH_DECODING1 T_ID(441) +#define T_VCD_FUNCTION_PHY_ENB_ULSCH_DECODING2 T_ID(442) +#define T_VCD_FUNCTION_PHY_ENB_ULSCH_DECODING3 T_ID(443) +#define T_VCD_FUNCTION_PHY_ENB_ULSCH_DECODING4 T_ID(444) +#define T_VCD_FUNCTION_PHY_ENB_ULSCH_DECODING5 T_ID(445) +#define T_VCD_FUNCTION_PHY_ENB_ULSCH_DECODING6 T_ID(446) +#define T_VCD_FUNCTION_PHY_ENB_ULSCH_DECODING7 T_ID(447) +#define T_VCD_FUNCTION_PHY_ENB_SFGEN T_ID(448) +#define T_VCD_FUNCTION_PHY_ENB_PRACH_RX T_ID(449) +#define T_VCD_FUNCTION_PHY_RU_PRACH_RX T_ID(450) +#define T_VCD_FUNCTION_PHY_ENB_PDCCH_TX T_ID(451) +#define T_VCD_FUNCTION_PHY_ENB_RS_TX T_ID(452) +#define T_VCD_FUNCTION_UE_GENERATE_PRACH T_ID(453) +#define T_VCD_FUNCTION_UE_ULSCH_MODULATION T_ID(454) +#define T_VCD_FUNCTION_UE_ULSCH_ENCODING T_ID(455) +#define T_VCD_FUNCTION_UE_ULSCH_ENCODING_FILL_CQI T_ID(456) +#define T_VCD_FUNCTION_UE_ULSCH_SCRAMBLING T_ID(457) +#define T_VCD_FUNCTION_ENB_DLSCH_MODULATION T_ID(458) +#define T_VCD_FUNCTION_ENB_DLSCH_ENCODING T_ID(459) +#define T_VCD_FUNCTION_ENB_DLSCH_ENCODING_W T_ID(460) +#define T_VCD_FUNCTION_ENB_DLSCH_SCRAMBLING T_ID(461) +#define T_VCD_FUNCTION_ENB_BEAM_PRECODING T_ID(462) +#define T_VCD_FUNCTION_ENB_OFDM_MODULATION T_ID(463) +#define T_VCD_FUNCTION_MACPHY_INIT T_ID(464) +#define T_VCD_FUNCTION_MACPHY_EXIT T_ID(465) +#define T_VCD_FUNCTION_ENB_DLSCH_ULSCH_SCHEDULER T_ID(466) +#define T_VCD_FUNCTION_FILL_RAR T_ID(467) +#define T_VCD_FUNCTION_TERMINATE_RA_PROC T_ID(468) +#define T_VCD_FUNCTION_INITIATE_RA_PROC T_ID(469) +#define T_VCD_FUNCTION_CANCEL_RA_PROC T_ID(470) +#define T_VCD_FUNCTION_GET_DCI_SDU T_ID(471) +#define T_VCD_FUNCTION_GET_DLSCH_SDU T_ID(472) +#define T_VCD_FUNCTION_RX_SDU T_ID(473) +#define T_VCD_FUNCTION_MRBCH_PHY_SYNC_FAILURE T_ID(474) +#define T_VCD_FUNCTION_SR_INDICATION T_ID(475) +#define T_VCD_FUNCTION_DLSCH_PREPROCESSOR T_ID(476) +#define T_VCD_FUNCTION_SCHEDULE_DLSCH T_ID(477) +#define T_VCD_FUNCTION_FILL_DLSCH_DCI T_ID(478) +#define T_VCD_FUNCTION_OUT_OF_SYNC_IND T_ID(479) +#define T_VCD_FUNCTION_UE_DECODE_SI T_ID(480) +#define T_VCD_FUNCTION_UE_DECODE_PCCH T_ID(481) +#define T_VCD_FUNCTION_UE_DECODE_CCCH T_ID(482) +#define T_VCD_FUNCTION_UE_DECODE_BCCH T_ID(483) +#define T_VCD_FUNCTION_UE_SEND_SDU T_ID(484) +#define T_VCD_FUNCTION_UE_GET_SDU T_ID(485) +#define T_VCD_FUNCTION_UE_GET_RACH T_ID(486) +#define T_VCD_FUNCTION_UE_PROCESS_RAR T_ID(487) +#define T_VCD_FUNCTION_UE_SCHEDULER T_ID(488) +#define T_VCD_FUNCTION_UE_GET_SR T_ID(489) +#define T_VCD_FUNCTION_UE_SEND_MCH_SDU T_ID(490) +#define T_VCD_FUNCTION_RLC_DATA_REQ T_ID(491) +#define T_VCD_FUNCTION_MAC_RLC_STATUS_IND T_ID(492) +#define T_VCD_FUNCTION_MAC_RLC_DATA_REQ T_ID(493) +#define T_VCD_FUNCTION_MAC_RLC_DATA_IND T_ID(494) +#define T_VCD_FUNCTION_RLC_UM_TRY_REASSEMBLY T_ID(495) +#define T_VCD_FUNCTION_RLC_UM_CHECK_TIMER_DAR_TIME_OUT T_ID(496) +#define T_VCD_FUNCTION_RLC_UM_RECEIVE_PROCESS_DAR T_ID(497) +#define T_VCD_FUNCTION_PDCP_RUN T_ID(498) +#define T_VCD_FUNCTION_PDCP_DATA_REQ T_ID(499) +#define T_VCD_FUNCTION_PDCP_DATA_IND T_ID(500) +#define T_VCD_FUNCTION_PDCP_APPLY_SECURITY T_ID(501) +#define T_VCD_FUNCTION_PDCP_VALIDATE_SECURITY T_ID(502) +#define T_VCD_FUNCTION_PDCP_FIFO_READ T_ID(503) +#define T_VCD_FUNCTION_PDCP_FIFO_READ_BUFFER T_ID(504) +#define T_VCD_FUNCTION_PDCP_FIFO_FLUSH T_ID(505) +#define T_VCD_FUNCTION_PDCP_FIFO_FLUSH_BUFFER T_ID(506) +#define T_VCD_FUNCTION_RRC_RX_TX T_ID(507) +#define T_VCD_FUNCTION_RRC_MAC_CONFIG T_ID(508) +#define T_VCD_FUNCTION_RRC_UE_DECODE_SIB1 T_ID(509) +#define T_VCD_FUNCTION_RRC_UE_DECODE_SI T_ID(510) +#define T_VCD_FUNCTION_GTPV1U_ENB_TASK T_ID(511) +#define T_VCD_FUNCTION_GTPV1U_PROCESS_UDP_REQ T_ID(512) +#define T_VCD_FUNCTION_GTPV1U_PROCESS_TUNNEL_DATA_REQ T_ID(513) +#define T_VCD_FUNCTION_UDP_ENB_TASK T_ID(514) +#define T_VCD_FUNCTION_EMU_TRANSPORT T_ID(515) +#define T_VCD_FUNCTION_LOG_RECORD T_ID(516) +#define T_VCD_FUNCTION_ITTI_ENQUEUE_MESSAGE T_ID(517) +#define T_VCD_FUNCTION_ITTI_DUMP_ENQUEUE_MESSAGE T_ID(518) +#define T_VCD_FUNCTION_ITTI_DUMP_ENQUEUE_MESSAGE_MALLOC T_ID(519) +#define T_VCD_FUNCTION_ITTI_RELAY_THREAD T_ID(520) +#define T_VCD_FUNCTION_TEST T_ID(521) +#define T_VCD_FUNCTION_SEND_IF4 T_ID(522) +#define T_VCD_FUNCTION_RECV_IF4 T_ID(523) +#define T_VCD_FUNCTION_SEND_IF5 T_ID(524) +#define T_VCD_FUNCTION_RECV_IF5 T_ID(525) +#define T_VCD_FUNCTION_TRX_COMPR_IF T_ID(526) +#define T_VCD_FUNCTION_TRX_DECOMPR_IF T_ID(527) +#define T_VCD_FUNCTION_NFAPI T_ID(528) +#define T_VCD_FUNCTION_GENERATE_PCFICH T_ID(529) +#define T_VCD_FUNCTION_GENERATE_DCI0 T_ID(530) +#define T_VCD_FUNCTION_GENERATE_DLSCH T_ID(531) +#define T_VCD_FUNCTION_GENERATE_PHICH T_ID(532) +#define T_VCD_FUNCTION_PDCCH_SCRAMBLING T_ID(533) +#define T_VCD_FUNCTION_PDCCH_MODULATION T_ID(534) +#define T_VCD_FUNCTION_PDCCH_INTERLEAVING T_ID(535) +#define T_VCD_FUNCTION_PDCCH_TX T_ID(536) +#define T_NUMBER_OF_IDS 537 + +#define T_LEGACY_PROTO_AGENT_DEBUG T_ID(538) +#define T_LEGACY_PROTO_AGENT_INFO T_ID(539) +#define T_LEGACY_PROTO_AGENT_ERROR T_ID(540) +#define T_LEGACY_F1U_ERROR T_ID(541) +#define T_LEGACY_F1U_DEBUG T_ID(542) diff --git a/openair2/COMMON/f1ap_messages_def.h b/openair2/COMMON/f1ap_messages_def.h new file mode 100644 index 0000000000..d81bd87ed5 --- /dev/null +++ b/openair2/COMMON/f1ap_messages_def.h @@ -0,0 +1,77 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/* Messages for S1AP logging */ +MESSAGE_DEF(S1AP_UPLINK_NAS_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_uplink_nas_log) +MESSAGE_DEF(S1AP_UE_CAPABILITY_IND_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_ue_capability_ind_log) +MESSAGE_DEF(S1AP_INITIAL_CONTEXT_SETUP_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_initial_context_setup_log) +MESSAGE_DEF(S1AP_NAS_NON_DELIVERY_IND_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_nas_non_delivery_ind_log) +MESSAGE_DEF(S1AP_DOWNLINK_NAS_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_downlink_nas_log) +MESSAGE_DEF(S1AP_S1_SETUP_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_s1_setup_log) +MESSAGE_DEF(S1AP_INITIAL_UE_MESSAGE_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_initial_ue_message_log) +MESSAGE_DEF(S1AP_UE_CONTEXT_RELEASE_REQ_LOG, MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_ue_context_release_req_log) +MESSAGE_DEF(S1AP_UE_CONTEXT_RELEASE_COMMAND_LOG, MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_ue_context_release_command_log) +MESSAGE_DEF(S1AP_UE_CONTEXT_RELEASE_COMPLETE_LOG, MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_ue_context_release_complete_log) +MESSAGE_DEF(S1AP_UE_CONTEXT_RELEASE_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_ue_context_release_log) +MESSAGE_DEF(S1AP_E_RAB_SETUP_REQUEST_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_e_rab_setup_request_log) +MESSAGE_DEF(S1AP_E_RAB_SETUP_RESPONSE_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_e_rab_setup_response_log) +MESSAGE_DEF(S1AP_E_RAB_MODIFY_REQUEST_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_e_rab_modify_request_log) +MESSAGE_DEF(S1AP_E_RAB_MODIFY_RESPONSE_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_e_rab_modify_response_log) +MESSAGE_DEF(S1AP_PAGING_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_paging_log) +MESSAGE_DEF(S1AP_E_RAB_RELEASE_REQUEST_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_e_rab_release_request_log) +MESSAGE_DEF(S1AP_E_RAB_RELEASE_RESPONSE_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_e_rab_release_response_log) +MESSAGE_DEF(S1AP_E_RAB_ERROR_INDICATION_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_error_indication_log) + +/* eNB application layer -> S1AP messages */ +MESSAGE_DEF(S1AP_REGISTER_ENB_REQ , MESSAGE_PRIORITY_MED, s1ap_register_enb_req_t , s1ap_register_enb_req) + +/* S1AP -> eNB application layer messages */ +MESSAGE_DEF(S1AP_REGISTER_ENB_CNF , MESSAGE_PRIORITY_MED, s1ap_register_enb_cnf_t , s1ap_register_enb_cnf) +MESSAGE_DEF(S1AP_DEREGISTERED_ENB_IND , MESSAGE_PRIORITY_MED, s1ap_deregistered_enb_ind_t , s1ap_deregistered_enb_ind) + +/* RRC -> S1AP messages */ +MESSAGE_DEF(S1AP_NAS_FIRST_REQ , MESSAGE_PRIORITY_MED, s1ap_nas_first_req_t , s1ap_nas_first_req) +MESSAGE_DEF(S1AP_UPLINK_NAS , MESSAGE_PRIORITY_MED, s1ap_uplink_nas_t , s1ap_uplink_nas) +MESSAGE_DEF(S1AP_UE_CAPABILITIES_IND , MESSAGE_PRIORITY_MED, s1ap_ue_cap_info_ind_t , s1ap_ue_cap_info_ind) +MESSAGE_DEF(S1AP_INITIAL_CONTEXT_SETUP_RESP, MESSAGE_PRIORITY_MED, s1ap_initial_context_setup_resp_t, s1ap_initial_context_setup_resp) +MESSAGE_DEF(S1AP_INITIAL_CONTEXT_SETUP_FAIL, MESSAGE_PRIORITY_MED, s1ap_initial_context_setup_fail_t, s1ap_initial_context_setup_fail) +MESSAGE_DEF(S1AP_NAS_NON_DELIVERY_IND , MESSAGE_PRIORITY_MED, s1ap_nas_non_delivery_ind_t , s1ap_nas_non_delivery_ind) +MESSAGE_DEF(S1AP_UE_CONTEXT_RELEASE_RESP , MESSAGE_PRIORITY_MED, s1ap_ue_release_resp_t , s1ap_ue_release_resp) +MESSAGE_DEF(S1AP_UE_CONTEXT_RELEASE_COMPLETE, MESSAGE_PRIORITY_MED, s1ap_ue_release_complete_t , s1ap_ue_release_complete) +MESSAGE_DEF(S1AP_UE_CTXT_MODIFICATION_RESP , MESSAGE_PRIORITY_MED, s1ap_ue_ctxt_modification_resp_t , s1ap_ue_ctxt_modification_resp) +MESSAGE_DEF(S1AP_UE_CTXT_MODIFICATION_FAIL , MESSAGE_PRIORITY_MED, s1ap_ue_ctxt_modification_fail_t , s1ap_ue_ctxt_modification_fail) +MESSAGE_DEF(S1AP_E_RAB_SETUP_RESP , MESSAGE_PRIORITY_MED, s1ap_e_rab_setup_resp_t , s1ap_e_rab_setup_resp) +MESSAGE_DEF(S1AP_E_RAB_SETUP_REQUEST_FAIL , MESSAGE_PRIORITY_MED, s1ap_e_rab_setup_req_fail_t , s1ap_e_rab_setup_request_fail) +MESSAGE_DEF(S1AP_E_RAB_MODIFY_RESP , MESSAGE_PRIORITY_MED, s1ap_e_rab_modify_resp_t , s1ap_e_rab_modify_resp) +MESSAGE_DEF(S1AP_E_RAB_RELEASE_RESPONSE , MESSAGE_PRIORITY_MED, s1ap_e_rab_release_resp_t , s1ap_e_rab_release_resp) + +/* S1AP -> RRC messages */ +MESSAGE_DEF(S1AP_DOWNLINK_NAS , MESSAGE_PRIORITY_MED, s1ap_downlink_nas_t , s1ap_downlink_nas ) +MESSAGE_DEF(S1AP_INITIAL_CONTEXT_SETUP_REQ , MESSAGE_PRIORITY_MED, s1ap_initial_context_setup_req_t , s1ap_initial_context_setup_req ) +MESSAGE_DEF(S1AP_UE_CTXT_MODIFICATION_REQ , MESSAGE_PRIORITY_MED, s1ap_ue_ctxt_modification_req_t , s1ap_ue_ctxt_modification_req) +MESSAGE_DEF(S1AP_PAGING_IND , MESSAGE_PRIORITY_MED, s1ap_paging_ind_t , s1ap_paging_ind ) +MESSAGE_DEF(S1AP_E_RAB_SETUP_REQ , MESSAGE_PRIORITY_MED, s1ap_e_rab_setup_req_t , s1ap_e_rab_setup_req ) +MESSAGE_DEF(S1AP_E_RAB_MODIFY_REQ , MESSAGE_PRIORITY_MED, s1ap_e_rab_modify_req_t , s1ap_e_rab_modify_req ) +MESSAGE_DEF(S1AP_E_RAB_RELEASE_COMMAND , MESSAGE_PRIORITY_MED, s1ap_e_rab_release_command_t , s1ap_e_rab_release_command) +MESSAGE_DEF(S1AP_UE_CONTEXT_RELEASE_COMMAND, MESSAGE_PRIORITY_MED, s1ap_ue_release_command_t , s1ap_ue_release_command) + +/* S1AP <-> RRC messages (can be initiated either by MME or eNB) */ +MESSAGE_DEF(S1AP_UE_CONTEXT_RELEASE_REQ , MESSAGE_PRIORITY_MED, s1ap_ue_release_req_t , s1ap_ue_release_req) diff --git a/openair2/COMMON/f1ap_messages_types.h b/openair2/COMMON/f1ap_messages_types.h new file mode 100644 index 0000000000..4a5f492b0b --- /dev/null +++ b/openair2/COMMON/f1ap_messages_types.h @@ -0,0 +1,646 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +#ifndef S1AP_MESSAGES_TYPES_H_ +#define S1AP_MESSAGES_TYPES_H_ + +//-------------------------------------------------------------------------------------------// +// Defines to access message fields. + +#define S1AP_REGISTER_ENB_REQ(mSGpTR) (mSGpTR)->ittiMsg.s1ap_register_enb_req + +#define S1AP_REGISTER_ENB_CNF(mSGpTR) (mSGpTR)->ittiMsg.s1ap_register_enb_cnf +#define S1AP_DEREGISTERED_ENB_IND(mSGpTR) (mSGpTR)->ittiMsg.s1ap_deregistered_enb_ind + +#define S1AP_NAS_FIRST_REQ(mSGpTR) (mSGpTR)->ittiMsg.s1ap_nas_first_req +#define S1AP_UPLINK_NAS(mSGpTR) (mSGpTR)->ittiMsg.s1ap_uplink_nas +#define S1AP_UE_CAPABILITIES_IND(mSGpTR) (mSGpTR)->ittiMsg.s1ap_ue_cap_info_ind +#define S1AP_INITIAL_CONTEXT_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.s1ap_initial_context_setup_resp +#define S1AP_INITIAL_CONTEXT_SETUP_FAIL(mSGpTR) (mSGpTR)->ittiMsg.s1ap_initial_context_setup_fail +#define S1AP_UE_CONTEXT_RELEASE_RESP(mSGpTR) (mSGpTR)->ittiMsg.s1ap_ue_release_resp +#define S1AP_NAS_NON_DELIVERY_IND(mSGpTR) (mSGpTR)->ittiMsg.s1ap_nas_non_delivery_ind +#define S1AP_UE_CTXT_MODIFICATION_RESP(mSGpTR) (mSGpTR)->ittiMsg.s1ap_ue_ctxt_modification_resp +#define S1AP_UE_CTXT_MODIFICATION_FAIL(mSGpTR) (mSGpTR)->ittiMsg.s1ap_ue_ctxt_modification_fail +#define S1AP_E_RAB_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.s1ap_e_rab_setup_resp +#define S1AP_E_RAB_SETUP_FAIL(mSGpTR) (mSGpTR)->ittiMsg.s1ap_e_rab_setup_req_fail +#define S1AP_E_RAB_MODIFY_RESP(mSGpTR) (mSGpTR)->ittiMsg.s1ap_e_rab_modify_resp + +#define S1AP_DOWNLINK_NAS(mSGpTR) (mSGpTR)->ittiMsg.s1ap_downlink_nas +#define S1AP_INITIAL_CONTEXT_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.s1ap_initial_context_setup_req +#define S1AP_UE_CTXT_MODIFICATION_REQ(mSGpTR) (mSGpTR)->ittiMsg.s1ap_ue_ctxt_modification_req +#define S1AP_UE_CONTEXT_RELEASE_COMMAND(mSGpTR) (mSGpTR)->ittiMsg.s1ap_ue_release_command +#define S1AP_UE_CONTEXT_RELEASE_COMPLETE(mSGpTR) (mSGpTR)->ittiMsg.s1ap_ue_release_complete +#define S1AP_E_RAB_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.s1ap_e_rab_setup_req +#define S1AP_E_RAB_MODIFY_REQ(mSGpTR) (mSGpTR)->ittiMsg.s1ap_e_rab_modify_req +#define S1AP_PAGING_IND(mSGpTR) (mSGpTR)->ittiMsg.s1ap_paging_ind + +#define S1AP_UE_CONTEXT_RELEASE_REQ(mSGpTR) (mSGpTR)->ittiMsg.s1ap_ue_release_req +#define S1AP_E_RAB_RELEASE_COMMAND(mSGpTR) (mSGpTR)->ittiMsg.s1ap_e_rab_release_command +#define S1AP_E_RAB_RELEASE_RESPONSE(mSGpTR) (mSGpTR)->ittiMsg.s1ap_e_rab_release_resp + +//-------------------------------------------------------------------------------------------// +/* Maximum number of e-rabs to be setup/deleted in a single message. + * Even if only one bearer will be modified by message. + */ +#define S1AP_MAX_E_RAB 11 + +/* Length of the transport layer address string + * 160 bits / 8 bits by char. + */ +#define S1AP_TRANSPORT_LAYER_ADDRESS_SIZE (160 / 8) + +#define S1AP_MAX_NB_MME_IP_ADDRESS 10 +#define S1AP_IMSI_LENGTH 16 + +/* Security key length used within eNB + * Even if only 16 bytes will be effectively used, + * the key length is 32 bytes (256 bits) + */ +#define SECURITY_KEY_LENGTH 32 +#ifndef OCP_FRAMEWORK +typedef enum cell_type_e { + CELL_MACRO_ENB, + CELL_HOME_ENB +} cell_type_t; + +typedef enum paging_drx_e { + PAGING_DRX_32 = 0x0, + PAGING_DRX_64 = 0x1, + PAGING_DRX_128 = 0x2, + PAGING_DRX_256 = 0x3 +} paging_drx_t; + +/* Lower value codepoint + * indicates higher priority. + */ +typedef enum paging_priority_s { + PAGING_PRIO_LEVEL1 = 0, + PAGING_PRIO_LEVEL2 = 1, + PAGING_PRIO_LEVEL3 = 2, + PAGING_PRIO_LEVEL4 = 3, + PAGING_PRIO_LEVEL5 = 4, + PAGING_PRIO_LEVEL6 = 5, + PAGING_PRIO_LEVEL7 = 6, + PAGING_PRIO_LEVEL8 = 7 +} paging_priority_t; + +typedef enum cn_domain_s { + CN_DOMAIN_PS = 1, + CN_DOMAIN_CS = 2 +} cn_domain_t; +#endif + +typedef struct net_ip_address_s { + unsigned ipv4:1; + unsigned ipv6:1; + char ipv4_address[16]; + char ipv6_address[46]; +} net_ip_address_t; + +typedef uint64_t bitrate_t; + +typedef struct ambr_s { + bitrate_t br_ul; + bitrate_t br_dl; +} ambr_t; + +#ifndef OCP_FRAMEWORK +typedef enum priority_level_s { + PRIORITY_LEVEL_SPARE = 0, + PRIORITY_LEVEL_HIGHEST = 1, + PRIORITY_LEVEL_LOWEST = 14, + PRIORITY_LEVEL_NO_PRIORITY = 15 +} priority_level_t; + +typedef enum pre_emp_capability_e { + PRE_EMPTION_CAPABILITY_ENABLED = 0, + PRE_EMPTION_CAPABILITY_DISABLED = 1, + PRE_EMPTION_CAPABILITY_MAX, +} pre_emp_capability_t; + +typedef enum pre_emp_vulnerability_e { + PRE_EMPTION_VULNERABILITY_ENABLED = 0, + PRE_EMPTION_VULNERABILITY_DISABLED = 1, + PRE_EMPTION_VULNERABILITY_MAX, +} pre_emp_vulnerability_t; +#endif + +typedef struct allocation_retention_priority_s { + priority_level_t priority_level; + pre_emp_capability_t pre_emp_capability; + pre_emp_vulnerability_t pre_emp_vulnerability; +} allocation_retention_priority_t; + +typedef struct security_capabilities_s { + uint16_t encryption_algorithms; + uint16_t integrity_algorithms; +} security_capabilities_t; + +/* Provides the establishment cause for the RRC connection request as provided + * by the upper layers. W.r.t. the cause value names: highPriorityAccess + * concerns AC11..AC15, ‘mt’ stands for ‘Mobile Terminating’ and ‘mo’ for + * 'Mobile Originating'. Defined in TS 36.331. + */ +typedef enum rrc_establishment_cause_e { + RRC_CAUSE_EMERGENCY = 0x0, + RRC_CAUSE_HIGH_PRIO_ACCESS = 0x1, + RRC_CAUSE_MT_ACCESS = 0x2, + RRC_CAUSE_MO_SIGNALLING = 0x3, + RRC_CAUSE_MO_DATA = 0x4, +#if defined(UPDATE_RELEASE_10) + RRC_CAUSE_DELAY_TOLERANT_ACCESS = 0x5, +#endif + RRC_CAUSE_LAST +} rrc_establishment_cause_t; + +typedef struct s1ap_gummei_s { + uint16_t mcc; + uint16_t mnc; + uint8_t mnc_len; + uint8_t mme_code; + uint16_t mme_group_id; +} s1ap_gummei_t; + +typedef struct s1ap_imsi_s { + uint8_t buffer[S1AP_IMSI_LENGTH]; + uint8_t length; +} s1ap_imsi_t; + +typedef struct s_tmsi_s { + uint8_t mme_code; + uint32_t m_tmsi; +} s_tmsi_t; + +typedef enum ue_paging_identity_presenceMask_e { + UE_PAGING_IDENTITY_NONE = 0, + UE_PAGING_IDENTITY_imsi = (1 << 1), + UE_PAGING_IDENTITY_s_tmsi = (1 << 2), +} ue_paging_identity_presenceMask_t; + +typedef struct ue_paging_identity_s { + ue_paging_identity_presenceMask_t presenceMask; + union { + s1ap_imsi_t imsi; + s_tmsi_t s_tmsi; + } choice; +} ue_paging_identity_t; + +typedef enum ue_identities_presenceMask_e { + UE_IDENTITIES_NONE = 0, + UE_IDENTITIES_s_tmsi = 1 << 1, + UE_IDENTITIES_gummei = 1 << 2, +} ue_identities_presenceMask_t; + +typedef struct ue_identity_s { + ue_identities_presenceMask_t presenceMask; + s_tmsi_t s_tmsi; + s1ap_gummei_t gummei; +} ue_identity_t; + +typedef struct nas_pdu_s { + /* Octet string data */ + uint8_t *buffer; + /* Length of the octet string */ + uint32_t length; +} nas_pdu_t, ue_radio_cap_t; + +typedef struct transport_layer_addr_s { + /* Length of the transport layer address buffer in bits. S1AP layer received a + * bit string<1..160> containing one of the following addresses: ipv4, + * ipv6, or ipv4 and ipv6. The layer doesn't interpret the buffer but + * silently forward it to S1-U. + */ + uint8_t length; + uint8_t buffer[20]; // in network byte order +} transport_layer_addr_t; + +#define TRANSPORT_LAYER_ADDR_COPY(dEST,sOURCE) \ + do { \ + AssertFatal(sOURCE.len <= 20); \ + memcpy(dEST.buffer, sOURCE.buffer, sOURCE.len); \ + dEST.length = sOURCE.length; \ + } while (0) + +typedef struct e_rab_level_qos_parameter_s { + uint8_t qci; + + allocation_retention_priority_t allocation_retention_priority; +} e_rab_level_qos_parameter_t; + +typedef struct e_rab_s { + /* Unique e_rab_id for the UE. */ + uint8_t e_rab_id; + /* Quality of service for this e_rab */ + e_rab_level_qos_parameter_t qos; + /* The NAS PDU should be forwarded by the RRC layer to the NAS layer */ + nas_pdu_t nas_pdu; + /* The transport layer address for the IP packets */ + transport_layer_addr_t sgw_addr; + /* S-GW Tunnel endpoint identifier */ + uint32_t gtp_teid; +} e_rab_t; + +typedef struct e_rab_setup_s { + /* Unique e_rab_id for the UE. */ + uint8_t e_rab_id; + + /* The transport layer address for the IP packets */ + transport_layer_addr_t eNB_addr; + + /* S-GW Tunnel endpoint identifier */ + uint32_t gtp_teid; +} e_rab_setup_t; + +typedef struct e_rab_modify_s { + /* Unique e_rab_id for the UE. */ + uint8_t e_rab_id; +} e_rab_modify_t; + +typedef enum S1ap_Cause_e { + S1AP_CAUSE_NOTHING, /* No components present */ + S1AP_CAUSE_RADIO_NETWORK, + S1AP_CAUSE_TRANSPORT, + S1AP_CAUSE_NAS, + S1AP_CAUSE_PROTOCOL, + S1AP_CAUSE_MISC, + /* Extensions may appear below */ + +} s1ap_Cause_t; + +typedef struct e_rab_failed_s { + /* Unique e_rab_id for the UE. */ + uint8_t e_rab_id; + /* Cause of the failure */ + // cause_t cause; + s1ap_Cause_t cause; + uint8_t cause_value; +} e_rab_failed_t; + +typedef enum s1ap_ue_ctxt_modification_present_s { + S1AP_UE_CONTEXT_MODIFICATION_SECURITY_KEY = (1 << 0), + S1AP_UE_CONTEXT_MODIFICATION_UE_AMBR = (1 << 1), + S1AP_UE_CONTEXT_MODIFICATION_UE_SECU_CAP = (1 << 2), +} s1ap_ue_ctxt_modification_present_t; + +typedef enum s1ap_paging_ind_present_s { + S1AP_PAGING_IND_PAGING_DRX = (1 << 0), + S1AP_PAGING_IND_PAGING_PRIORITY = (1 << 1), +} s1ap_paging_ind_present_t; + +//-------------------------------------------------------------------------------------------// +// eNB application layer -> S1AP messages +typedef struct s1ap_register_enb_req_s { + /* Unique eNB_id to identify the eNB within EPC. + * For macro eNB ids this field should be 20 bits long. + * For home eNB ids this field should be 28 bits long. + */ + uint32_t eNB_id; + /* The type of the cell */ + enum cell_type_e cell_type; + + /* Optional name for the cell + * NOTE: the name can be NULL (i.e no name) and will be cropped to 150 + * characters. + */ + char *eNB_name; + + /* Tracking area code */ + uint16_t tac; + + /* Mobile Country Code + * Mobile Network Code + */ + uint16_t mcc; + uint16_t mnc; + uint8_t mnc_digit_length; + + /* Default Paging DRX of the eNB as defined in TS 36.304 */ + paging_drx_t default_drx; + + /* The eNB IP address to bind */ + net_ip_address_t enb_ip_address; + + /* Nb of MME to connect to */ + uint8_t nb_mme; + /* List of MME to connect to */ + net_ip_address_t mme_ip_address[S1AP_MAX_NB_MME_IP_ADDRESS]; + + /* Number of SCTP streams used for a mme association */ + uint16_t sctp_in_streams; + uint16_t sctp_out_streams; +} s1ap_register_enb_req_t; + +//-------------------------------------------------------------------------------------------// +// S1AP -> eNB application layer messages +typedef struct s1ap_register_enb_cnf_s { + /* Nb of MME connected */ + uint8_t nb_mme; +} s1ap_register_enb_cnf_t; + +typedef struct s1ap_deregistered_enb_ind_s { + /* Nb of MME connected */ + uint8_t nb_mme; +} s1ap_deregistered_enb_ind_t; + +//-------------------------------------------------------------------------------------------// +// RRC -> S1AP messages + +/* The NAS First Req is the first message exchanged between RRC and S1AP + * for an UE. + * The rnti uniquely identifies an UE within a cell. Later the enb_ue_s1ap_id + * will be the unique identifier used between RRC and S1AP. + */ +typedef struct s1ap_nas_first_req_s { + /* UE id for initial connection to S1AP */ + uint16_t ue_initial_id; + + /* Establishment cause as sent by UE */ + rrc_establishment_cause_t establishment_cause; + + /* NAS PDU */ + nas_pdu_t nas_pdu; + + /* If this flag is set S1AP layer is expecting the GUMMEI. If = 0, + * the temporary s-tmsi is used. + */ + ue_identity_t ue_identity; +} s1ap_nas_first_req_t; + +typedef struct s1ap_uplink_nas_s { + /* Unique UE identifier within an eNB */ + unsigned eNB_ue_s1ap_id:24; + + /* NAS pdu */ + nas_pdu_t nas_pdu; +} s1ap_uplink_nas_t; + +typedef struct s1ap_ue_cap_info_ind_s { + unsigned eNB_ue_s1ap_id:24; + ue_radio_cap_t ue_radio_cap; +} s1ap_ue_cap_info_ind_t; + +typedef struct s1ap_initial_context_setup_resp_s { + unsigned eNB_ue_s1ap_id:24; + + /* Number of e_rab setup-ed in the list */ + uint8_t nb_of_e_rabs; + /* list of e_rab setup-ed by RRC layers */ + e_rab_setup_t e_rabs[S1AP_MAX_E_RAB]; + + /* Number of e_rab failed to be setup in list */ + uint8_t nb_of_e_rabs_failed; + /* list of e_rabs that failed to be setup */ + e_rab_failed_t e_rabs_failed[S1AP_MAX_E_RAB]; +} s1ap_initial_context_setup_resp_t; + +typedef struct s1ap_initial_context_setup_fail_s { + unsigned eNB_ue_s1ap_id:24; + + /* TODO add cause */ +} s1ap_initial_context_setup_fail_t, s1ap_ue_ctxt_modification_fail_t, s1ap_e_rab_setup_req_fail_t; + +typedef struct s1ap_nas_non_delivery_ind_s { + unsigned eNB_ue_s1ap_id:24; + nas_pdu_t nas_pdu; + /* TODO: add cause */ +} s1ap_nas_non_delivery_ind_t; + +typedef struct s1ap_ue_ctxt_modification_req_s { + unsigned eNB_ue_s1ap_id:24; + + /* Bit-mask of possible present parameters */ + s1ap_ue_ctxt_modification_present_t present; + + /* Following fields are optionnaly present */ + + /* Security key */ + uint8_t security_key[SECURITY_KEY_LENGTH]; + + /* UE aggregate maximum bitrate */ + ambr_t ue_ambr; + + /* Security capabilities */ + security_capabilities_t security_capabilities; +} s1ap_ue_ctxt_modification_req_t; + +typedef struct s1ap_ue_ctxt_modification_resp_s { + unsigned eNB_ue_s1ap_id:24; +} s1ap_ue_ctxt_modification_resp_t; + +typedef struct s1ap_ue_release_complete_s { + + unsigned eNB_ue_s1ap_id:24; + +} s1ap_ue_release_complete_t; + +//-------------------------------------------------------------------------------------------// +// S1AP -> RRC messages +typedef struct s1ap_downlink_nas_s { + /* UE id for initial connection to S1AP */ + uint16_t ue_initial_id; + + /* Unique UE identifier within an eNB */ + unsigned eNB_ue_s1ap_id:24; + + /* NAS pdu */ + nas_pdu_t nas_pdu; +} s1ap_downlink_nas_t; + + +typedef struct s1ap_initial_context_setup_req_s { + /* UE id for initial connection to S1AP */ + uint16_t ue_initial_id; + + /* eNB ue s1ap id as initialized by S1AP layer */ + unsigned eNB_ue_s1ap_id:24; + + /* UE aggregate maximum bitrate */ + ambr_t ue_ambr; + + /* Security algorithms */ + security_capabilities_t security_capabilities; + + /* Security key */ + uint8_t security_key[SECURITY_KEY_LENGTH]; + + /* Number of e_rab to be setup in the list */ + uint8_t nb_of_e_rabs; + /* list of e_rab to be setup by RRC layers */ + e_rab_t e_rab_param[S1AP_MAX_E_RAB]; +} s1ap_initial_context_setup_req_t; + +typedef struct tai_plmn_identity_s { + uint16_t mcc; + uint16_t mnc; + uint8_t mnc_digit_length; +} plmn_identity_t; + +typedef struct s1ap_paging_ind_s { + /* UE identity index value. + * Specified in 3GPP TS 36.304 + */ + unsigned ue_index_value:10; + + /* UE paging identity */ + ue_paging_identity_t ue_paging_identity; + + /* Indicates origin of paging */ + cn_domain_t cn_domain; + + /* PLMN_identity in TAI of Paging*/ + plmn_identity_t plmn_identity[256]; + + /* TAC in TAIList of Paging*/ + int16_t tac[256]; + + /* size of TAIList*/ + int16_t tai_size; + + /* Optional fields */ + paging_drx_t paging_drx; + + paging_priority_t paging_priority; +} s1ap_paging_ind_t; + +typedef struct s1ap_e_rab_setup_req_s { + /* UE id for initial connection to S1AP */ + uint16_t ue_initial_id; + + /* MME UE id */ + uint16_t mme_ue_s1ap_id; + + /* eNB ue s1ap id as initialized by S1AP layer */ + unsigned eNB_ue_s1ap_id:24; + + /* Number of e_rab to be setup in the list */ + uint8_t nb_e_rabs_tosetup; + + /* E RAB setup request */ + e_rab_t e_rab_setup_params[S1AP_MAX_E_RAB]; + +} s1ap_e_rab_setup_req_t; + +typedef struct s1ap_e_rab_setup_resp_s { + unsigned eNB_ue_s1ap_id:24; + + /* Number of e_rab setup-ed in the list */ + uint8_t nb_of_e_rabs; + /* list of e_rab setup-ed by RRC layers */ + e_rab_setup_t e_rabs[S1AP_MAX_E_RAB]; + + /* Number of e_rab failed to be setup in list */ + uint8_t nb_of_e_rabs_failed; + /* list of e_rabs that failed to be setup */ + e_rab_failed_t e_rabs_failed[S1AP_MAX_E_RAB]; +} s1ap_e_rab_setup_resp_t; + + +// S1AP --> RRC messages +typedef struct s1ap_ue_release_command_s { + + unsigned eNB_ue_s1ap_id:24; + +} s1ap_ue_release_command_t; + + +//-------------------------------------------------------------------------------------------// +// S1AP <-- RRC messages +typedef struct s1ap_ue_release_req_s { + unsigned eNB_ue_s1ap_id:24; + s1ap_Cause_t cause; + long cause_value; +} s1ap_ue_release_req_t, s1ap_ue_release_resp_t; + +typedef struct s1ap_e_rab_modify_req_s { + /* UE id for initial connection to S1AP */ + uint16_t ue_initial_id; + + /* MME UE id */ + uint16_t mme_ue_s1ap_id; + + /* eNB ue s1ap id as initialized by S1AP layer */ + unsigned eNB_ue_s1ap_id:24; + + /* Number of e_rab to be modify in the list */ + uint8_t nb_e_rabs_tomodify; + + /* E RAB modify request */ + e_rab_t e_rab_modify_params[S1AP_MAX_E_RAB]; +} s1ap_e_rab_modify_req_t; + +typedef struct s1ap_e_rab_modify_resp_s { + unsigned eNB_ue_s1ap_id:24; + + /* Number of e_rab modify-ed in the list */ + uint8_t nb_of_e_rabs; + /* list of e_rab modify-ed by RRC layers */ + e_rab_modify_t e_rabs[S1AP_MAX_E_RAB]; + + /* Number of e_rab failed to be modify in list */ + uint8_t nb_of_e_rabs_failed; + /* list of e_rabs that failed to be modify */ + e_rab_failed_t e_rabs_failed[S1AP_MAX_E_RAB]; +} s1ap_e_rab_modify_resp_t; + +typedef struct e_rab_release_s { + /* Unique e_rab_id for the UE. */ + uint8_t e_rab_id; +} e_rab_release_t; + +typedef struct s1ap_e_rab_release_command_s { + /* MME UE id */ + uint16_t mme_ue_s1ap_id; + + /* eNB ue s1ap id as initialized by S1AP layer */ + unsigned eNB_ue_s1ap_id:24; + + /* The NAS PDU should be forwarded by the RRC layer to the NAS layer */ + nas_pdu_t nas_pdu; + + /* Number of e_rab to be released in the list */ + uint8_t nb_e_rabs_torelease; + + /* E RAB release command */ + e_rab_release_t e_rab_release_params[S1AP_MAX_E_RAB]; + +} s1ap_e_rab_release_command_t; + +typedef struct s1ap_e_rab_release_resp_s { + /* MME UE id */ + uint16_t mme_ue_s1ap_id; + + /* eNB ue s1ap id as initialized by S1AP layer */ + unsigned eNB_ue_s1ap_id:24; + + /* Number of e_rab released in the list */ + uint8_t nb_of_e_rabs_released; + + /* list of e_rabs released */ + e_rab_release_t e_rab_release[S1AP_MAX_E_RAB]; + + /* Number of e_rab failed to be released in list */ + uint8_t nb_of_e_rabs_failed; + /* list of e_rabs that failed to be released */ + e_rab_failed_t e_rabs_failed[S1AP_MAX_E_RAB]; + +} s1ap_e_rab_release_resp_t; + +#endif /* S1AP_MESSAGES_TYPES_H_ */ diff --git a/openair2/F1AP/CU_F1AP.c b/openair2/F1AP/CU_F1AP.c new file mode 100644 index 0000000000..e164dc99db --- /dev/null +++ b/openair2/F1AP/CU_F1AP.c @@ -0,0 +1,1494 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file openair2/F1AP/CU_F1AP.c +* \brief data structures for F1 interface modules +* \author EURECOM/NTUST +* \date 2018 +* \version 0.1 +* \company Eurecom +* \email: navid.nikaein@eurecom.fr, raymond.knopp@eurecom.fr, bing-kai.hong@eurecom.fr +* \note +* \warning +*/ + +#include "conversions.h" +#include "f1ap_common.h" +#include "f1ap_messages_types.h" +#include "platform_types.h" +#include "log.h" + +#define MAX_F1AP_BUFFER_SIZE 4096 + +/* This structure describes association of a DU to a CU */ +typedef struct f1ap_info { + + module_id_t enb_mod_idP; + module_id_t cu_mod_idP; + + /* Unique eNB_id to identify the eNB within EPC. + * In our case the eNB is a macro eNB so the id will be 20 bits long. + * For Home eNB id, this field should be 28 bits long. + */ + uint32_t GNB_DU_ID; + + /* This is the optional name provided by the MME */ + char *GNB_CU_Name; + net_ip_address_t mme_net_ip_address; // useful for joining assoc_id and ip address of packets + + + /* Number of input/ouput streams */ + uint16_t in_streams; + uint16_t out_streams; + + /* Connexion id used between SCTP/S1AP */ + uint16_t cnx_id; + + /* SCTP association id */ + int32_t assoc_id; + + uint16_t mcc; + uint16_t mnc; + uint8_t mnc_digit_length; + +} f1ap_info_t; + +// helper functions +#define F1AP_TRANSACTION_IDENTIFIER_NUMBER 3 +#define NUMBER_OF_eNB_MAX 3 + +uint8_t F1AP_get_next_transaction_identifier(module_id_t enb_mod_idP, module_id_t cu_mod_idP) { + static uint8_t transaction_identifier[NUMBER_OF_eNB_MAX]; + transaction_identifier[enb_mod_idP+cu_mod_idP] = (transaction_identifier[enb_mod_idP+cu_mod_idP] + 1) % F1AP_TRANSACTION_IDENTIFIER_NUMBER; + //LOG_T(F1AP,"generated xid is %d\n",transaction_identifier[enb_mod_idP+cu_mod_idP]); + return transaction_identifier[enb_mod_idP+cu_mod_idP]; +} + +// ============================================================================== + +void F1AP_CU_task() { + printf("Start F1AP CU task!\n"); + + sctp_cu_init(); + + // while (1) { + + // switch () { + + // case F1AP_ProcedureCode_id_F1Setup: + //CU_send_F1_SETUP_RESPONSE(); + //CU_send_DL_RRC_MESSAGE_TRANSFER(); // L436 + //CU_send_UE_CONTEXT_SETUP_REQUEST(); // god + //CU_send_UE_CONTEXT_MODIFICATION_REQUEST(); // oh my + // break; + + // default: + + // } // switch + + // } // while + + return NULL; +} + + +// ============================================================================== +//void CU_handle_F1_SETUP_REQUEST(struct F1AP_F1AP_PDU_t *message_p) { +void CU_handle_F1_SETUP_REQUEST() { + F1AP_F1AP_PDU_t pdu; + + uint8_t *buffer; + uint32_t len; + int ret = 0; + /* Receiver */ + //f1ap_receiver(&buffer); + + if (f1ap_decode_pdu(&pdu, buffer, len) > 0) { + printf("Failed to decode F1 setup request\n"); + } + /* decode */ + //CU_F1AP_decode(args_p); + + /* handle */ + + // send successful callback + //CU_send_F1_SETUP_RESPONSE(); + // or failure callback + //CU_send_F1_SETUP_FAILURE(); + +} + +void CU_send_F1_SETUP_RESPONSE() { +//void CU_send_F1_SETUP_RESPONSE(F1AP_F1SetupResponse_t *F1SetupResponse) { + //AssertFatal(1==0,"Not implemented yet\n"); + + module_id_t enb_mod_idP; + module_id_t cu_mod_idP; + + enb_mod_idP = (module_id_t)12; + cu_mod_idP = (module_id_t)34; + + F1AP_F1AP_PDU_t pdu; + F1AP_F1SetupResponse_t *out; + F1AP_F1SetupResponseIEs_t *ie; + + uint8_t *buffer; + uint32_t len; + int ret = 0; + int i = 0; + + f1ap_info_t f1ap_info; + f1ap_info.GNB_CU_Name = "ABC"; + f1ap_info.mcc = 208; + f1ap_info.mnc = 93; + f1ap_info.mnc_digit_length = 8; + + /* Create */ + /* 0. Message Type */ + memset(&pdu, 0, sizeof(pdu)); + pdu.present = F1AP_F1AP_PDU_PR_successfulOutcome; + pdu.choice.successfulOutcome = (F1AP_SuccessfulOutcome_t *)calloc(1, sizeof(F1AP_SuccessfulOutcome_t)); + pdu.choice.successfulOutcome->procedureCode = F1AP_ProcedureCode_id_F1Setup; + pdu.choice.successfulOutcome->criticality = F1AP_Criticality_reject; + pdu.choice.successfulOutcome->value.present = F1AP_SuccessfulOutcome__value_PR_F1SetupResponse; + out = &pdu.choice.successfulOutcome->value.choice.F1SetupResponse; + + /* response_present_val */ + //F1AP_F1SetupResponseIEs__value_PR_TransactionID + //F1AP_F1SetupResponseIEs__value_PR_GNB_CU_Name + //F1AP_F1SetupResponseIEs__value_PR_Cells_to_be_Activated_List + + /* mandatory */ + /* c1. Transaction ID (integer value)*/ + ie = (F1AP_F1SetupResponseIEs_t *)calloc(1, sizeof(F1AP_F1SetupResponseIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_TransactionID; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_F1SetupResponseIEs__value_PR_TransactionID; + ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(enb_mod_idP, cu_mod_idP); + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* optional */ + /* c2. GNB_CU_Name */ + if (f1ap_info.GNB_CU_Name != NULL) { + ie = (F1AP_F1SetupResponseIEs_t *)calloc(1, sizeof(F1AP_F1SetupResponseIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_Name; + ie->criticality = F1AP_Criticality_ignore; + ie->value.present = F1AP_F1SetupResponseIEs__value_PR_GNB_CU_Name; + OCTET_STRING_fromBuf(&ie->value.choice.GNB_CU_Name, f1ap_info.GNB_CU_Name, + strlen(f1ap_info.GNB_CU_Name)); + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + } + + /* mandatory */ + /* c3. cells to be Activated list */ + ie = (F1AP_F1SetupResponseIEs_t *)calloc(1, sizeof(F1AP_F1SetupResponseIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_F1SetupResponseIEs__value_PR_Cells_to_be_Activated_List; + + + for (i=0; + i<1; + i++) { + + F1AP_Cells_to_be_Activated_List_ItemIEs_t *cells_to_be_activated_list_item_ies; + cells_to_be_activated_list_item_ies = (F1AP_Cells_to_be_Activated_List_ItemIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemIEs_t)); + cells_to_be_activated_list_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item; + cells_to_be_activated_list_item_ies->criticality = F1AP_Criticality_reject; + cells_to_be_activated_list_item_ies->value.present = F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item; + + /* 3.1 cells to be Activated list item */ + F1AP_Cells_to_be_Activated_List_Item_t cells_to_be_activated_list_item; + memset((void *)&cells_to_be_activated_list_item, 0, sizeof(F1AP_Cells_to_be_Activated_List_Item_t)); + + /* - nRCGI */ + F1AP_NRCGI_t nRCGI; + MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length, + &nRCGI.pLMN_Identity); + NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); + cells_to_be_activated_list_item.nRCGI = nRCGI; + + /* optional */ + /* - nRPCI */ + if (0) { + cells_to_be_activated_list_item.nRPCI = (F1AP_NRPCI_t *)calloc(1, sizeof(F1AP_NRPCI_t)); + *cells_to_be_activated_list_item.nRPCI = 321L; // int 0..1007 + } + + /* optional */ + /* - gNB-CU System Information */ + //if (1) { + + //} + /* ADD */ + cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item = cells_to_be_activated_list_item; + ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Activated_List.list, + cells_to_be_activated_list_item_ies); + } + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + /* encode */ + if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { + printf("Failed to encode F1 setup request\n"); + } + + // printf("\n"); + + /* decode */ + if (f1ap_decode_pdu(&pdu, buffer, len) > 0) { + printf("Failed to decode F1 setup request\n"); + } + //printf("F1 setup response present = %d\n", out->value.present); + //f1ap_send_sctp_data_req(instance_p->instance, f1ap_mme_data_p->assoc_id, buffer, len, 0); + +} + +int f1ap_encode_pdu(F1AP_F1AP_PDU_t *pdu, uint8_t **buffer, uint32_t *length) { + DevAssert(pdu != NULL); + DevAssert(buffer != NULL); + DevAssert(length != NULL); + + + xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, pdu); + + + ssize_t encoded; + + // asn_DEF_F1AP_F1SetupRequest + // asn_DEF_F1AP_F1AP_PDU + + /* We can safely free list of IE from sptr */ + //ASN_STRUCT_FREE_CONTENTS_ONLY(&asn_DEF_F1AP_F1SetupRequest, pdu); + + + if ((encoded = aper_encode_to_new_buffer(&asn_DEF_F1AP_F1AP_PDU, 0, + pdu, + + (void **)buffer)) < 0) { + printf("\nencoded len = %ld\n", encoded); + return -1; + } + + printf("encoded len = %ld\n", encoded); + printf("buffer = \n"); + + int i_ret; + for (i_ret = 0; i_ret < encoded; i_ret++) { + printf("%x ", *((*buffer)+i_ret)); + } + printf("\n"); + *length = encoded; + // ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_F1AP_F1AP_PDU, pdu); + return encoded; +} + + +int f1ap_decode_pdu(F1AP_F1AP_PDU_t *message, uint8_t *buffer, uint32_t length) { + + //LOG_I(F1AP,"Entering main loop of DU F1AP pdu receiver\n"); + F1AP_F1AP_PDU_t pdu; + F1AP_F1AP_PDU_t *pdu_p = &pdu; + asn_dec_rval_t dec_ret; + + DevAssert(buffer != NULL); + + printf("buffer = \n"); + int i_ret; + for (i_ret = 0; i_ret < length; i_ret++) { + printf("%x ", *(buffer+i_ret)); + } + printf("\n"); + + memset((void *)pdu_p, 0, sizeof(F1AP_F1AP_PDU_t)); + + + dec_ret = aper_decode(NULL, + &asn_DEF_F1AP_F1AP_PDU, + (void **)&pdu_p, + buffer, + length, + 0, + 0); + + xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, pdu_p); + + printf("\n"); + + printf("dec_ret.code = %d \n", dec_ret.code); + + AssertFatal(dec_ret.code == RC_OK,"Failed to decode pdu\n"); + + // switch(pdu_p->present) { + // case F1AP_F1AP_PDU_PR_initiatingpdu: + // return F1AP_DU_decode_initiating_pdu(&pdu_p->choice.initiatingpdu); + + // case F1AP_F1AP_PDU_PR_successfulOutcome: + // return F1AP_DU_decode_successful_outcome(&pdu_p->choice.successfulOutcome); + + // case F1AP_F1AP_PDU_PR_unsuccessfulOutcome: + // return F1AP_DU_decode_unsuccessful_outcome(&pdu_p->choice.unsuccessfulOutcome); + + // default: + // /*AssertFatal(1==0,"Unknown presence (%d) or not implemented\n", (int)pdu_p->present);*/ + // break; + // } + + //AssertFatal(1==0,"Shouldn't get here\n"); + return -1; +} + +void CU_send_F1_SETUP_FAILURE(F1AP_F1SetupFailure_t *F1SetupFailure) { + AssertFatal(1==0,"Not implemented yet\n"); + //AssertFatal(1==0,"Not implemented yet\n"); + //f1ap_send_sctp_data_req(instance_p->instance, f1ap_mme_data_p->assoc_id, buffer, len, 0); +} + + +void CU_handle_ERROR_INDICATION(F1AP_ErrorIndication_t *ErrorIndication) { + AssertFatal(1==0,"Not implemented yet\n"); +} + +void CU_send_ERROR_INDICATION(F1AP_ErrorIndication_t *ErrorIndication) { + AssertFatal(1==0,"Not implemented yet\n"); +} + + +void CU_send_RESET(F1AP_Reset_t *Reset) { + AssertFatal(1==0,"Not implemented yet\n"); +} + +void CU_handle_RESET_ACKKNOWLEDGE(F1AP_ResetAcknowledge_t *ResetAcknowledge) { + AssertFatal(1==0,"Not implemented yet\n"); +} + +void CU_handle_RESET(F1AP_Reset_t *Reset) { + AssertFatal(1==0,"Not implemented yet\n"); +} + +void CU_send_RESET_ACKKNOWLEDGE(F1AP_ResetAcknowledge_t *ResetAcknowledge) { + AssertFatal(1==0,"Not implemented yet\n"); +} + + +void CU_handle_UL_RRC_MESSAGE_TRANSFER(F1AP_ULRRCMessageTransfer_t *ULRRCMessageTransfer) { + AssertFatal(1==0,"Not implemented yet\n"); +} + +//void CU_send_DL_RRC_MESSAGE_TRANSFER(F1AP_DLRRCMessageTransfer_t *DLRRCMessageTransfer) { +void CU_send_DL_RRC_MESSAGE_TRANSFER() { + F1AP_F1AP_PDU_t pdu; + F1AP_DLRRCMessageTransfer_t *out; + F1AP_DLRRCMessageTransferIEs_t *ie; + + uint8_t *buffer; + uint32_t len; + int ret = 0; + int i = 0; + + /* Create */ + /* 0. Message Type */ + memset(&pdu, 0, sizeof(pdu)); + pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage; + pdu.choice.initiatingMessage = (F1AP_InitiatingMessage_t *)calloc(1, sizeof(F1AP_InitiatingMessage_t)); + pdu.choice.initiatingMessage->procedureCode = F1AP_ProcedureCode_id_DLRRCMessageTransfer; + pdu.choice.initiatingMessage->criticality = F1AP_Criticality_ignore; + pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_DLRRCMessageTransfer; + out = &pdu.choice.initiatingMessage->value.choice.DLRRCMessageTransfer; + + /* mandatory */ + /* c1. GNB_CU_UE_F1AP_ID */ + ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_GNB_CU_UE_F1AP_ID; + ie->value.choice.GNB_CU_UE_F1AP_ID = 126L; + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* mandatory */ + /* c2. GNB_DU_UE_F1AP_ID */ + ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_GNB_DU_UE_F1AP_ID; + ie->value.choice.GNB_DU_UE_F1AP_ID = 651L; + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* optional */ + /* c3. oldgNB_DU_UE_F1AP_ID */ + if (0) { + ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_oldgNB_DU_UE_F1AP_ID; + ie->criticality = F1AP_Criticality_reject; + //ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_NOTHING; + //ie->value.choice. = 1; + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + } + + /* mandatory */ + /* c4. SRBID */ + ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_SRBID; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_SRBID; + ie->value.choice.SRBID = 1L; + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* optional */ + /* c5. ExecuteDuplication */ + if (0) { + ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_ExecuteDuplication; + ie->criticality = F1AP_Criticality_ignore; + ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_ExecuteDuplication; + ie->value.choice.ExecuteDuplication = F1AP_ExecuteDuplication_true; + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + } + + // issue in here + /* mandatory */ + /* c6. RRCContainer */ + ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_RRCContainer; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_RRCContainer; + OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer, "asdsa1", strlen("asdsa1")); + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* optional */ + /* c7. RAT_FrequencyPriorityInformation */ + if (0) { + ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_RAT_FrequencyPriorityInformation; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_RAT_FrequencyPriorityInformation; + + ie->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_subscriberProfileIDforRFP; + ie->value.choice.RAT_FrequencyPriorityInformation.choice.subscriberProfileIDforRFP = 123L; + + //ie->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_rAT_FrequencySelectionPriority; + //ie->value.choice.RAT_FrequencyPriorityInformation.choice.rAT_FrequencySelectionPriority = 123L; + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + } + + /* encode */ + if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { + printf("Failed to encode F1 setup request\n"); + return -1; + } + + printf("\n"); + + /* decode */ + if (f1ap_decode_pdu(&pdu, buffer, len) > 0) { + printf("Failed to decode F1 setup request\n"); + } + //AssertFatal(1==0,"Not implemented yet\n"); +} + + +void CU_handle_gNB_DU_CONFIGURATION_UPDATE(F1AP_GNBDUConfigurationUpdate_t *GNBDUConfigurationUpdate) { + AssertFatal(1==0,"Not implemented yet\n"); +} + +void CU_send_gNB_DU_CONFIGURATION_FAILURE(F1AP_GNBDUConfigurationUpdateFailure_t *GNBDUConfigurationUpdateFailure) { + AssertFatal(1==0,"Not implemented yet\n"); +} + +void CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(F1AP_GNBDUConfigurationUpdateAcknowledge_t *GNBDUConfigurationUpdateAcknowledge) { + AssertFatal(1==0,"Not implemented yet\n"); +} + + +void CU_send_gNB_CU_CONFIGURATION_UPDATE(F1AP_GNBCUConfigurationUpdate_t *GNBCUConfigurationUpdate) { + AssertFatal(1==0,"Not implemented yet\n"); +} + +void CU_handle_gNB_CU_CONFIGURATION_UPDATE_FALIURE(F1AP_GNBCUConfigurationUpdateFailure_t *GNBCUConfigurationUpdateFailure) { + AssertFatal(1==0,"Not implemented yet\n"); +} + +void CU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(F1AP_GNBCUConfigurationUpdateAcknowledge_t *GNBCUConfigurationUpdateAcknowledge) { + AssertFatal(1==0,"Not implemented yet\n"); +} + + +//void CU_send_UE_CONTEXT_SETUP_REQUEST(F1AP_UEContextSetupRequest_t *UEContextSetupRequest) { +void CU_send_UE_CONTEXT_SETUP_REQUEST() { + F1AP_F1AP_PDU_t pdu; + F1AP_UEContextSetupRequest_t *out; + F1AP_UEContextSetupRequestIEs_t *ie; + + uint8_t *buffer; + uint32_t len; + int ret = 0; + int i = 0; + + f1ap_info_t f1ap_info; + f1ap_info.GNB_CU_Name = "ABC"; + f1ap_info.mcc = 208; + f1ap_info.mnc = 93; + f1ap_info.mnc_digit_length = 8; + + /* Create */ + /* 0. Message Type */ + memset(&pdu, 0, sizeof(pdu)); + pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage; + pdu.choice.initiatingMessage = (F1AP_InitiatingMessage_t *)calloc(1, sizeof(F1AP_InitiatingMessage_t)); + pdu.choice.initiatingMessage->procedureCode = F1AP_ProcedureCode_id_UEContextSetup; + pdu.choice.initiatingMessage->criticality = F1AP_Criticality_reject; + pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_UEContextSetupRequest; + out = &pdu.choice.initiatingMessage->value.choice.UEContextSetupRequest; + + /* mandatory */ + /* c1. GNB_CU_UE_F1AP_ID */ + ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_GNB_CU_UE_F1AP_ID; + ie->value.choice.GNB_CU_UE_F1AP_ID = 126L; + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* optional */ + /* c2. GNB_DU_UE_F1AP_ID */ + if (0) { + ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID; + ie->criticality = F1AP_Criticality_ignore; + ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_GNB_DU_UE_F1AP_ID; + ie->value.choice.GNB_DU_UE_F1AP_ID = 651L; + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + } + + /* mandatory */ + /* c3. SpCell_ID */ + ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_SpCell_ID; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_NRCGI; + /* - nRCGI */ + F1AP_NRCGI_t nRCGI; + MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length, + &nRCGI.pLMN_Identity); + NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); + + ie->value.choice.NRCGI = nRCGI; + + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* mandatory */ + /* c4. ServCellIndex */ + ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_ServCellndex; + ie->criticality = F1AP_Criticality_ignore; + ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_ServCellIndex; + ie->value.choice.ServCellIndex = 2; + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* optional */ + /* c5. CellULConfigured */ + if (0) { + ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_SpCellULConfigured; + ie->criticality = F1AP_Criticality_ignore; + ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_CellULConfigured; + ie->value.choice.CellULConfigured = F1AP_CellULConfigured_ul; + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + } + + /* mandatory */ + /* c6. CUtoDURRCInformation */ + ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_CUtoDURRCInformation; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_CUtoDURRCInformation; + ie->value.choice.CUtoDURRCInformation.cG_ConfigInfo = (F1AP_CG_ConfigInfo_t *)calloc(1, sizeof(F1AP_CG_ConfigInfo_t)); + /* optional */ + OCTET_STRING_fromBuf(ie->value.choice.CUtoDURRCInformation.cG_ConfigInfo, "asdsa1d32sa1d31asd31as", + strlen("asdsa1d32sa1d31asd31as")); + ie->value.choice.CUtoDURRCInformation.uE_CapabilityRAT_ContainerList = (F1AP_UE_CapabilityRAT_ContainerList_t *)calloc(1, sizeof(F1AP_UE_CapabilityRAT_ContainerList_t)); + /* optional */ + OCTET_STRING_fromBuf(ie->value.choice.CUtoDURRCInformation.uE_CapabilityRAT_ContainerList, "asdsa1d32sa1d31asd31as", + strlen("asdsa1d32sa1d31asd31as")); + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* mandatory */ + /* c7. Candidate_SpCell_List */ + ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_Candidate_SpCell_List; //90 + ie->criticality = F1AP_Criticality_ignore; + ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_Candidate_SpCell_List; + + for (i=0; + i<1; + i++) { + + F1AP_Candidate_SpCell_ItemIEs_t *candidate_spCell_item_ies; + candidate_spCell_item_ies = (F1AP_Candidate_SpCell_ItemIEs_t *)calloc(1, sizeof(F1AP_Candidate_SpCell_ItemIEs_t)); + candidate_spCell_item_ies->id = F1AP_ProtocolIE_ID_id_Candidate_SpCell_Item; // 91 + candidate_spCell_item_ies->criticality = F1AP_Criticality_reject; + candidate_spCell_item_ies->value.present = F1AP_Candidate_SpCell_ItemIEs__value_PR_Candidate_SpCell_Item; + + /* 5.1 Candidate_SpCell_Item */ + F1AP_Candidate_SpCell_Item_t candidate_spCell_item; + memset((void *)&candidate_spCell_item, 0, sizeof(F1AP_Candidate_SpCell_Item_t)); + + /* - candidate_SpCell_ID */ + F1AP_NRCGI_t nRCGI; + MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length, + &nRCGI.pLMN_Identity); + NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); + + candidate_spCell_item.candidate_SpCell_ID = nRCGI; + + /* ADD */ + candidate_spCell_item_ies->value.choice.Candidate_SpCell_Item = candidate_spCell_item; + ASN_SEQUENCE_ADD(&ie->value.choice.Candidate_SpCell_List.list, + candidate_spCell_item_ies); + } + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* optional */ + /* c8. DRXCycle */ + if (0) { + ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_DRXCycle; + ie->criticality = F1AP_Criticality_ignore; + ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_DRXCycle; + ie->value.choice.DRXCycle.longDRXCycleLength = F1AP_LongDRXCycleLength_ms10; // enum + if (0) { + ie->value.choice.DRXCycle.shortDRXCycleLength = (F1AP_ShortDRXCycleLength_t *)calloc(1, sizeof(F1AP_ShortDRXCycleLength_t)); + *ie->value.choice.DRXCycle.shortDRXCycleLength = F1AP_ShortDRXCycleLength_ms2; // enum + } + if (0) { + ie->value.choice.DRXCycle.shortDRXCycleTimer = (F1AP_ShortDRXCycleTimer_t *)calloc(1, sizeof(F1AP_ShortDRXCycleTimer_t)); + *ie->value.choice.DRXCycle.shortDRXCycleTimer = 123L; + } + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + } + + /* optional */ + /* c9. ResourceCoordinationTransferContainer */ + if (0) { + ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_ResourceCoordinationTransferContainer; + ie->criticality = F1AP_Criticality_ignore; + ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_ResourceCoordinationTransferContainer; + + ie->value.choice.ResourceCoordinationTransferContainer.buf = malloc(4); + ie->value.choice.ResourceCoordinationTransferContainer.size = 4; + *ie->value.choice.ResourceCoordinationTransferContainer.buf = "123"; + + + OCTET_STRING_fromBuf(&ie->value.choice.ResourceCoordinationTransferContainer, "asdsa1d32sa1d31asd31as", + strlen("asdsa1d32sa1d31asd31as")); + + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + } + + /* mandatory */ + /* c10. SCell_ToBeSetup_List */ + ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_SCell_ToBeSetup_List; + ie->criticality = F1AP_Criticality_ignore; + ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_SCell_ToBeSetup_List; + + for (i=0; + i<1; + i++) { + // + F1AP_SCell_ToBeSetup_ItemIEs_t *scell_toBeSetup_item_ies; + scell_toBeSetup_item_ies = (F1AP_SCell_ToBeSetup_ItemIEs_t *)calloc(1, sizeof(F1AP_SCell_ToBeSetup_ItemIEs_t)); + scell_toBeSetup_item_ies->id = F1AP_ProtocolIE_ID_id_SCell_ToBeSetup_Item; //53 + scell_toBeSetup_item_ies->criticality = F1AP_Criticality_ignore; + scell_toBeSetup_item_ies->value.present = F1AP_SCell_ToBeSetup_ItemIEs__value_PR_SCell_ToBeSetup_Item; + + /* 8.1 SCell_ToBeSetup_Item */ + F1AP_SCell_ToBeSetup_Item_t scell_toBeSetup_item; + memset((void *)&scell_toBeSetup_item, 0, sizeof(F1AP_SCell_ToBeSetup_Item_t)); + + // /* - sCell_ID */ + F1AP_NRCGI_t nRCGI; + MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length, + &nRCGI.pLMN_Identity); + NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); + + scell_toBeSetup_item.sCell_ID = nRCGI; + + /* sCellIndex */ + scell_toBeSetup_item.sCellIndex = 3; // issue here + // /* ADD */ + scell_toBeSetup_item_ies->value.choice.SCell_ToBeSetup_Item = scell_toBeSetup_item; + + ASN_SEQUENCE_ADD(&ie->value.choice.SCell_ToBeSetup_List.list, + scell_toBeSetup_item_ies); + } + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + // /* mandatory */ + /* c11. SRBs_ToBeSetup_List */ + ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_SRBs_ToBeSetup_List; + ie->criticality = F1AP_Criticality_reject; // ? + ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_SRBs_ToBeSetup_List; + + for (i=0; + i<1; + i++) { + // + F1AP_SRBs_ToBeSetup_ItemIEs_t *srbs_toBeSetup_item_ies; + srbs_toBeSetup_item_ies = (F1AP_SRBs_ToBeSetup_ItemIEs_t *)calloc(1, sizeof(F1AP_SRBs_ToBeSetup_ItemIEs_t)); + srbs_toBeSetup_item_ies->id = F1AP_ProtocolIE_ID_id_SRBs_ToBeSetup_Item; // 73 + srbs_toBeSetup_item_ies->criticality = F1AP_Criticality_ignore; + srbs_toBeSetup_item_ies->value.present = F1AP_SRBs_ToBeSetup_ItemIEs__value_PR_SRBs_ToBeSetup_Item; + + /* 9.1 SRBs_ToBeSetup_Item */ + F1AP_SRBs_ToBeSetup_Item_t srbs_toBeSetup_item; + memset((void *)&srbs_toBeSetup_item, 0, sizeof(F1AP_SRBs_ToBeSetup_Item_t)); + + /* - sRBID */ + srbs_toBeSetup_item.sRBID = 50L; + + /* ADD */ + srbs_toBeSetup_item_ies->value.choice.SRBs_ToBeSetup_Item = srbs_toBeSetup_item; + ASN_SEQUENCE_ADD(&ie->value.choice.SRBs_ToBeSetup_List.list, + srbs_toBeSetup_item_ies); + } + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* mandatory */ + /* c12. DRBs_ToBeSetup_List */ + ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_DRBs_ToBeSetup_List; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_DRBs_ToBeSetup_List; + + for (i=0; + i<1; + i++) { + // + F1AP_DRBs_ToBeSetup_ItemIEs_t *drbs_toBeSetup_item_ies; + drbs_toBeSetup_item_ies = (F1AP_DRBs_ToBeSetup_ItemIEs_t *)calloc(1, sizeof(F1AP_DRBs_ToBeSetup_ItemIEs_t)); + drbs_toBeSetup_item_ies->id = F1AP_ProtocolIE_ID_id_DRBs_ToBeSetup_Item; + drbs_toBeSetup_item_ies->criticality = F1AP_Criticality_reject; + drbs_toBeSetup_item_ies->value.present = F1AP_DRBs_ToBeSetup_ItemIEs__value_PR_DRBs_ToBeSetup_Item; + + /* 10.1 SRBs_ToBeSetup_Item */ + F1AP_DRBs_ToBeSetup_Item_t drbs_toBeSetup_item; + memset((void *)&drbs_toBeSetup_item, 0, sizeof(F1AP_DRBs_ToBeSetup_Item_t)); + + /* dRBID */ + drbs_toBeSetup_item.dRBID = 30L; + + /* qoSInformation */ + drbs_toBeSetup_item.qoSInformation.present = F1AP_QoSInformation_PR_eUTRANQoS; + drbs_toBeSetup_item.qoSInformation.choice.eUTRANQoS = (F1AP_EUTRANQoS_t *)calloc(1, sizeof(F1AP_EUTRANQoS_t)); + drbs_toBeSetup_item.qoSInformation.choice.eUTRANQoS->qCI = 789L; + + /* ULTunnels_ToBeSetup_List */ + int maxnoofULTunnels = 1; // 2; + for (i=0; + iuLUPTNLInformation.present = F1AP_UPTransportLayerInformation_PR_gTPTunnel; + F1AP_GTPTunnel_t *gTPTunnel = (F1AP_GTPTunnel_t *)calloc(1, sizeof(F1AP_GTPTunnel_t)); + + TRANSPORT_LAYER_ADDRESS_TO_BIT_STRING(1234, &gTPTunnel->transportLayerAddress); + + OCTET_STRING_fromBuf(&gTPTunnel->gTP_TEID, "1234", + strlen("1234")); + + uLUPTNLInformation_ToBeSetup_Item->uLUPTNLInformation.choice.gTPTunnel = gTPTunnel; + + ASN_SEQUENCE_ADD(&drbs_toBeSetup_item.uLUPTNLInformation_ToBeSetup_List.list, &uLUPTNLInformation_ToBeSetup_Item); + } + + /* rLCMode */ + drbs_toBeSetup_item.rLCMode = F1AP_RLCMode_rlc_um; // enum + + /* OPTIONAL */ + /* ULConfiguration */ + if (0) { + drbs_toBeSetup_item.uLConfiguration = (F1AP_ULConfiguration_t *)calloc(1, sizeof(F1AP_ULConfiguration_t)); + } + + /* ADD */ + drbs_toBeSetup_item_ies->value.choice.DRBs_ToBeSetup_Item = drbs_toBeSetup_item; + ASN_SEQUENCE_ADD(&ie->value.choice.DRBs_ToBeSetup_List.list, + drbs_toBeSetup_item_ies); + + } + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* OPTIONAL */ + if (0) { + F1AP_InactivityMonitoringRequest_t InactivityMonitoringRequest; + F1AP_RAT_FrequencyPriorityInformation_t RAT_FrequencyPriorityInformation; + F1AP_RRCContainer_t RRCContainer; + F1AP_MaskedIMEISV_t MaskedIMEISV; + } + + /* encode */ + if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { + printf("Failed to encode F1 setup request\n"); + return -1; + } + + printf("\n"); + + /* decode */ + if (f1ap_decode_pdu(&pdu, buffer, len) > 0) { + printf("Failed to decode F1 setup request\n"); + } + //AssertFatal(1==0,"Not implemented yet\n"); +} + +void CU_handle_UE_CONTEXT_SETUP_RESPONSE(F1AP_UEContextSetupResponse_t *UEContextSetupResponse) { + AssertFatal(1==0,"Not implemented yet\n"); +} + +void CU_handle_UE_CONTEXT_SETUP_FAILURE(F1AP_UEContextSetupFailure_t UEContextSetupFailure) { + AssertFatal(1==0,"Not implemented yet\n"); +} + + +void CU_handle_UE_CONTEXT_RELEASE_REQUEST(F1AP_UEContextReleaseRequest_t *UEContextReleaseRequest) { + AssertFatal(1==0,"Not implemented yet\n"); +} + + +void CU_send_UE_CONTEXT_RELEASE_COMMAND(F1AP_UEContextReleaseCommand_t *UEContextReleaseCommand) { + AssertFatal(1==0,"Not implemented yet\n"); +} + + +void CU_handle_UE_CONTEXT_RELEASE_COMPLETE(F1AP_UEContextReleaseComplete_t *UEContextReleaseComplete) { + AssertFatal(1==0,"Not implemented yet\n"); +} + +//void CU_send_UE_CONTEXT_MODIFICATION_REQUEST(F1AP_UEContextModificationRequest_t *UEContextModificationRequest) { +void CU_send_UE_CONTEXT_MODIFICATION_REQUEST() { + F1AP_F1AP_PDU_t pdu; + F1AP_UEContextModificationRequest_t *out; + F1AP_UEContextModificationRequestIEs_t *ie; + + uint8_t *buffer; + uint32_t len; + int ret = 0; + int i = 0; + + f1ap_info_t f1ap_info; + f1ap_info.GNB_CU_Name = "ABC"; + f1ap_info.mcc = 208; + f1ap_info.mnc = 93; + f1ap_info.mnc_digit_length = 8; + + /* Create */ + /* 0. Message Type */ + memset(&pdu, 0, sizeof(pdu)); + pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage; + pdu.choice.initiatingMessage = (F1AP_InitiatingMessage_t *)calloc(1, sizeof(F1AP_InitiatingMessage_t)); + pdu.choice.initiatingMessage->procedureCode = F1AP_ProcedureCode_id_UEContextModification; + pdu.choice.initiatingMessage->criticality = F1AP_Criticality_reject; + pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_UEContextModificationRequest; + out = &pdu.choice.initiatingMessage->value.choice.UEContextModificationRequest; + + /* mandatory */ + /* c1. GNB_CU_UE_F1AP_ID */ + ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_GNB_CU_UE_F1AP_ID; + ie->value.choice.GNB_CU_UE_F1AP_ID = 126L; + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* mandatory */ + /* c2. GNB_DU_UE_F1AP_ID */ + ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_GNB_DU_UE_F1AP_ID; + ie->value.choice.GNB_DU_UE_F1AP_ID = 651L; + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* optional */ + /* c3. NRCGI */ + if (1) { + ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_SpCell_ID; + ie->criticality = F1AP_Criticality_ignore; + ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_NRCGI; + /* - nRCGI */ + F1AP_NRCGI_t nRCGI; + MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length, + &nRCGI.pLMN_Identity); + NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); + ie->value.choice.NRCGI = nRCGI; + + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + } + + /* mandatory */ + /* c4. ServCellIndex */ + ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_ServCellndex; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_ServCellIndex; + ie->value.choice.ServCellIndex = 5L; + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* optional */ + /* c5. DRXCycle */ + if (0) { + ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_DRXCycle; + ie->criticality = F1AP_Criticality_ignore; + ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_DRXCycle; + ie->value.choice.DRXCycle.longDRXCycleLength = F1AP_LongDRXCycleLength_ms10; // enum + if (0) { + ie->value.choice.DRXCycle.shortDRXCycleLength = (F1AP_ShortDRXCycleLength_t *)calloc(1, sizeof(F1AP_ShortDRXCycleLength_t)); + *ie->value.choice.DRXCycle.shortDRXCycleLength = F1AP_ShortDRXCycleLength_ms2; // enum + } + if (0) { + ie->value.choice.DRXCycle.shortDRXCycleTimer = (F1AP_ShortDRXCycleTimer_t *)calloc(1, sizeof(F1AP_ShortDRXCycleTimer_t)); + *ie->value.choice.DRXCycle.shortDRXCycleTimer = 123L; + } + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + } + + /* optional */ + /* c5. CUtoDURRCInformation */ + if (1) { + ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_CUtoDURRCInformation; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_CUtoDURRCInformation; + ie->value.choice.CUtoDURRCInformation.cG_ConfigInfo = (F1AP_CG_ConfigInfo_t *)calloc(1, sizeof(F1AP_CG_ConfigInfo_t)); + /* optional */ + OCTET_STRING_fromBuf(ie->value.choice.CUtoDURRCInformation.cG_ConfigInfo, "asdsa1d32sa1d31asd31as", + strlen("asdsa1d32sa1d31asd31as")); + ie->value.choice.CUtoDURRCInformation.uE_CapabilityRAT_ContainerList = (F1AP_UE_CapabilityRAT_ContainerList_t *)calloc(1, sizeof(F1AP_UE_CapabilityRAT_ContainerList_t)); + /* optional */ + OCTET_STRING_fromBuf(ie->value.choice.CUtoDURRCInformation.uE_CapabilityRAT_ContainerList, "asdsa1d32sa1d31asd31as", + strlen("asdsa1d32sa1d31asd31as")); + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + } + + /* optional */ + /* c6. TransmissionStopIndicator */ + if (1) { + ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_TransmissionStopIndicator; + ie->criticality = F1AP_Criticality_ignore; + ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_TransmissionStopIndicator; + ie->value.choice.TransmissionStopIndicator = F1AP_TransmissionStopIndicator_true; + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + } + + /* optional */ + /* c7. ResourceCoordinationTransferContainer */ + if (0) { + ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_ResourceCoordinationTransferContainer; + ie->criticality = F1AP_Criticality_ignore; + ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_ResourceCoordinationTransferContainer; + OCTET_STRING_fromBuf(&ie->value.choice.ResourceCoordinationTransferContainer, "asdsa1d32sa1d31asd31as", + strlen("asdsa1d32sa1d31asd31as")); + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + } + + /* optional */ + /* c7. RRCRconfigurationCompleteIndicator */ + if (1) { + ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_RRCRconfigurationCompleteIndicator; + ie->criticality = F1AP_Criticality_ignore; + ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_RRCRconfigurationCompleteIndicator; + ie->value.choice.RRCRconfigurationCompleteIndicator = F1AP_RRCRconfigurationCompleteIndicator_true; + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + } + + /* optional */ + /* c8. RRCContainer */ + if (1) { + ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_RRCContainer; + ie->criticality = F1AP_Criticality_ignore; + ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_RRCContainer; + OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer, "asdsa1d32sa1d31asd31as", + strlen("asdsa1d32sa1d31asd31as")); + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + } + + /* mandatory */ + /* c9. SCell_ToBeSetupMod_List */ + ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_SCell_ToBeSetupMod_List; + ie->criticality = F1AP_Criticality_ignore; + ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_SCell_ToBeSetupMod_List; + + for (i=0; + i<1; + i++) { + // + F1AP_SCell_ToBeSetupMod_ItemIEs_t *scell_toBeSetupMod_item_ies; + scell_toBeSetupMod_item_ies = (F1AP_SCell_ToBeSetupMod_ItemIEs_t *)calloc(1, sizeof(F1AP_SCell_ToBeSetupMod_ItemIEs_t)); + //memset((void *)&scell_toBeSetupMod_item_ies, 0, sizeof(F1AP_SCell_ToBeSetupMod_ItemIEs_t)); + scell_toBeSetupMod_item_ies->id = F1AP_ProtocolIE_ID_id_SCell_ToBeSetupMod_Item; + scell_toBeSetupMod_item_ies->criticality = F1AP_Criticality_ignore; + scell_toBeSetupMod_item_ies->value.present = F1AP_SCell_ToBeSetupMod_ItemIEs__value_PR_SCell_ToBeSetupMod_Item; + + /* 8.1 SCell_ToBeSetup_Item */ + F1AP_SCell_ToBeSetupMod_Item_t scell_toBeSetupMod_item; + memset((void *)&scell_toBeSetupMod_item, 0, sizeof(F1AP_SCell_ToBeSetupMod_Item_t)); + + // /* - sCell_ID */ + F1AP_NRCGI_t nRCGI; + MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length, + &nRCGI.pLMN_Identity); + NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); + scell_toBeSetupMod_item.sCell_ID = nRCGI; + + /* sCellIndex */ + scell_toBeSetupMod_item.sCellIndex = 6; // issue here + + // /* ADD */ + scell_toBeSetupMod_item_ies->value.choice.SCell_ToBeSetupMod_Item = scell_toBeSetupMod_item; + ASN_SEQUENCE_ADD(&ie->value.choice.SCell_ToBeSetupMod_List.list, + scell_toBeSetupMod_item_ies); + } + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* mandatory */ + /* c10. SCell_ToBeRemoved_List */ + ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_SCell_ToBeRemoved_List; + ie->criticality = F1AP_Criticality_ignore; + ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_SCell_ToBeRemoved_List; + + for (i=0; + i<1; + i++) { + // + F1AP_SCell_ToBeRemoved_ItemIEs_t *scell_toBeRemoved_item_ies; + scell_toBeRemoved_item_ies = (F1AP_SCell_ToBeRemoved_ItemIEs_t *)calloc(1, sizeof(F1AP_SCell_ToBeRemoved_ItemIEs_t)); + //memset((void *)&scell_toBeRemoved_item_ies, 0, sizeof(F1AP_SCell_ToBeRemoved_ItemIEs_t)); + scell_toBeRemoved_item_ies->id = F1AP_ProtocolIE_ID_id_SCell_ToBeRemoved_Item; + scell_toBeRemoved_item_ies->criticality = F1AP_Criticality_ignore; + scell_toBeRemoved_item_ies->value.present = F1AP_SCell_ToBeRemoved_ItemIEs__value_PR_SCell_ToBeRemoved_Item; + + /* 10.1 SCell_ToBeRemoved_Item */ + F1AP_SCell_ToBeRemoved_Item_t scell_toBeRemoved_item; + memset((void *)&scell_toBeRemoved_item, 0, sizeof(F1AP_SCell_ToBeRemoved_Item_t)); + + /* - sCell_ID */ + F1AP_NRCGI_t nRCGI; + MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length, + &nRCGI.pLMN_Identity); + NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); + scell_toBeRemoved_item.sCell_ID = nRCGI; + + /* ADD */ + scell_toBeRemoved_item_ies->value.choice.SCell_ToBeRemoved_Item = scell_toBeRemoved_item; + ASN_SEQUENCE_ADD(&ie->value.choice.SCell_ToBeRemoved_List.list, + scell_toBeRemoved_item_ies); + } + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* mandatory */ + /* c11. SRBs_ToBeSetupMod_List */ + ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_SRBs_ToBeSetupMod_List; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_SRBs_ToBeSetupMod_List; + + for (i=0; + i<1; + i++) { + // + F1AP_SRBs_ToBeSetupMod_ItemIEs_t *srbs_toBeSetupMod_item_ies; + srbs_toBeSetupMod_item_ies = (F1AP_SRBs_ToBeSetupMod_ItemIEs_t *)calloc(1, sizeof(F1AP_SRBs_ToBeSetupMod_ItemIEs_t)); + //memset((void *)&srbs_toBeSetupMod_item_ies, 0, sizeof(F1AP_SRBs_ToBeSetupMod_ItemIEs_t)); + srbs_toBeSetupMod_item_ies->id = F1AP_ProtocolIE_ID_id_SRBs_ToBeSetupMod_Item; + srbs_toBeSetupMod_item_ies->criticality = F1AP_Criticality_ignore; + srbs_toBeSetupMod_item_ies->value.present = F1AP_SRBs_ToBeSetupMod_ItemIEs__value_PR_SRBs_ToBeSetupMod_Item; + + /* 9.1 SRBs_ToBeSetupMod_Item */ + F1AP_SRBs_ToBeSetupMod_Item_t srbs_toBeSetupMod_item; + memset((void *)&srbs_toBeSetupMod_item, 0, sizeof(F1AP_SRBs_ToBeSetupMod_Item_t)); + + /* - sRBID */ + srbs_toBeSetupMod_item.sRBID = 50L; + + /* ADD */ + srbs_toBeSetupMod_item_ies->value.choice.SRBs_ToBeSetupMod_Item = srbs_toBeSetupMod_item; + + ASN_SEQUENCE_ADD(&ie->value.choice.SRBs_ToBeSetupMod_List.list, + srbs_toBeSetupMod_item_ies); + } + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + + /* mandatory */ + /* c12. DRBs_ToBeSetupMod_List */ + ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_DRBs_ToBeSetupMod_List; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_DRBs_ToBeSetupMod_List; + + for (i=0; + i<1; + i++) { + // + F1AP_DRBs_ToBeSetupMod_ItemIEs_t *drbs_toBeSetupMod_item_ies; + drbs_toBeSetupMod_item_ies = (F1AP_DRBs_ToBeSetupMod_ItemIEs_t *)calloc(1, sizeof(F1AP_DRBs_ToBeSetupMod_ItemIEs_t)); + drbs_toBeSetupMod_item_ies->id = F1AP_ProtocolIE_ID_id_DRBs_ToBeSetupMod_Item; + drbs_toBeSetupMod_item_ies->criticality = F1AP_Criticality_reject; + drbs_toBeSetupMod_item_ies->value.present = F1AP_DRBs_ToBeSetupMod_ItemIEs__value_PR_DRBs_ToBeSetupMod_Item; + + /* 12.1 DRBs_ToBeSetupMod_Item */ + F1AP_DRBs_ToBeSetupMod_Item_t drbs_toBeSetupMod_item; + memset((void *)&drbs_toBeSetupMod_item, 0, sizeof(F1AP_DRBs_ToBeSetupMod_Item_t)); + + /* dRBID */ + drbs_toBeSetupMod_item.dRBID = 30L; + + /* qoSInformation */ + drbs_toBeSetupMod_item.qoSInformation.present = F1AP_QoSInformation_PR_eUTRANQoS; + drbs_toBeSetupMod_item.qoSInformation.choice.eUTRANQoS = (F1AP_EUTRANQoS_t *)calloc(1, sizeof(F1AP_EUTRANQoS_t)); + drbs_toBeSetupMod_item.qoSInformation.choice.eUTRANQoS->qCI = 789L; + + /* ULTunnels_ToBeSetupMod_List */ + int j = 0; + int maxnoofULTunnels = 1; // 2; + for (j=0; + juLUPTNLInformation.present = F1AP_UPTransportLayerInformation_PR_gTPTunnel; + F1AP_GTPTunnel_t *gTPTunnel = (F1AP_GTPTunnel_t *)calloc(1, sizeof(F1AP_GTPTunnel_t)); + + TRANSPORT_LAYER_ADDRESS_TO_BIT_STRING(1234, &gTPTunnel->transportLayerAddress); + + OCTET_STRING_fromBuf(&gTPTunnel->gTP_TEID, "4567", + strlen("4567")); + + uLUPTNLInformation_ToBeSetup_Item->uLUPTNLInformation.choice.gTPTunnel = gTPTunnel; + + ASN_SEQUENCE_ADD(&drbs_toBeSetupMod_item.uLUPTNLInformation_ToBeSetup_List.list, uLUPTNLInformation_ToBeSetup_Item); + } + + /* rLCMode */ + drbs_toBeSetupMod_item.rLCMode = F1AP_RLCMode_rlc_um; // enum + + /* OPTIONAL */ + /* ULConfiguration */ + if (0) { + drbs_toBeSetupMod_item.uLConfiguration = (F1AP_ULConfiguration_t *)calloc(1, sizeof(F1AP_ULConfiguration_t)); + } + + /* ADD */ + drbs_toBeSetupMod_item_ies->value.choice.DRBs_ToBeSetupMod_Item = drbs_toBeSetupMod_item; + ASN_SEQUENCE_ADD(&ie->value.choice.DRBs_ToBeSetupMod_List.list, + drbs_toBeSetupMod_item_ies); + + } + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* mandatory */ + /* c13. DRBs_ToBeModified_List */ + ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_DRBs_ToBeModified_List; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_DRBs_ToBeModified_List; + + for (i=0; + i<1; + i++) { + // + F1AP_DRBs_ToBeModified_ItemIEs_t *drbs_toBeModified_item_ies; + drbs_toBeModified_item_ies = (F1AP_DRBs_ToBeModified_ItemIEs_t *)calloc(1, sizeof(F1AP_DRBs_ToBeModified_ItemIEs_t)); + drbs_toBeModified_item_ies->id = F1AP_ProtocolIE_ID_id_DRBs_ToBeModified_Item; + drbs_toBeModified_item_ies->criticality = F1AP_Criticality_reject; + drbs_toBeModified_item_ies->value.present = F1AP_DRBs_ToBeModified_ItemIEs__value_PR_DRBs_ToBeModified_Item; + + /* 13.1 SRBs_ToBeModified_Item */ + F1AP_DRBs_ToBeModified_Item_t drbs_toBeModified_item; + memset((void *)&drbs_toBeModified_item, 0, sizeof(F1AP_DRBs_ToBeModified_Item_t)); + + /* dRBID */ + drbs_toBeModified_item.dRBID = 30L; + + /* qoSInformation */ + drbs_toBeModified_item.qoSInformation.present = F1AP_QoSInformation_PR_eUTRANQoS; + drbs_toBeModified_item.qoSInformation.choice.eUTRANQoS = (F1AP_EUTRANQoS_t *)calloc(1, sizeof(F1AP_EUTRANQoS_t)); + drbs_toBeModified_item.qoSInformation.choice.eUTRANQoS->qCI = 789L; + + /* ULTunnels_ToBeModified_List */ + int j = 0; + int maxnoofULTunnels = 1; // 2; + for (j=0; + juLUPTNLInformation.present = F1AP_UPTransportLayerInformation_PR_gTPTunnel; + F1AP_GTPTunnel_t *gTPTunnel = (F1AP_GTPTunnel_t *)calloc(1, sizeof(F1AP_GTPTunnel_t)); + + TRANSPORT_LAYER_ADDRESS_TO_BIT_STRING(1234, &gTPTunnel->transportLayerAddress); + + OCTET_STRING_fromBuf(&gTPTunnel->gTP_TEID, "1204", + strlen("1204")); + + uLUPTNLInformation_ToBeSetup_Item->uLUPTNLInformation.choice.gTPTunnel = gTPTunnel; + + ASN_SEQUENCE_ADD(&drbs_toBeModified_item.uLUPTNLInformation_ToBeSetup_List.list, uLUPTNLInformation_ToBeSetup_Item); + } + + /* OPTIONAL */ + /* ULConfiguration */ + if (0) { + drbs_toBeModified_item.uLConfiguration = (F1AP_ULConfiguration_t *)calloc(1, sizeof(F1AP_ULConfiguration_t)); + } + + /* ADD */ + drbs_toBeModified_item_ies->value.choice.DRBs_ToBeModified_Item = drbs_toBeModified_item; + ASN_SEQUENCE_ADD(&ie->value.choice.DRBs_ToBeModified_List.list, + drbs_toBeModified_item_ies); + + } + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* mandatory */ + /* c14. SRBs_ToBeReleased_List */ + ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_SRBs_ToBeReleased_List; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_SRBs_ToBeReleased_List; + + for (i=0; + i<1; + i++) { + // + F1AP_SRBs_ToBeReleased_ItemIEs_t *srbs_toBeReleased_item_ies; + srbs_toBeReleased_item_ies = (F1AP_SRBs_ToBeReleased_ItemIEs_t *)calloc(1, sizeof(F1AP_SRBs_ToBeReleased_ItemIEs_t)); + //memset((void *)&srbs_toBeReleased_item_ies, 0, sizeof(F1AP_SRBs_ToBeReleased_ItemIEs_t)); + srbs_toBeReleased_item_ies->id = F1AP_ProtocolIE_ID_id_SRBs_ToBeReleased_Item; + srbs_toBeReleased_item_ies->criticality = F1AP_Criticality_ignore; + srbs_toBeReleased_item_ies->value.present = F1AP_SRBs_ToBeReleased_ItemIEs__value_PR_SRBs_ToBeReleased_Item; + + /* 9.1 SRBs_ToBeReleased_Item */ + F1AP_SRBs_ToBeReleased_Item_t srbs_toBeReleased_item; + memset((void *)&srbs_toBeReleased_item, 0, sizeof(F1AP_SRBs_ToBeReleased_Item_t)); + + /* - sRBID */ + srbs_toBeReleased_item.sRBID = 50L; + + /* ADD */ + srbs_toBeReleased_item_ies->value.choice.SRBs_ToBeReleased_Item = srbs_toBeReleased_item; + ASN_SEQUENCE_ADD(&ie->value.choice.SRBs_ToBeReleased_List.list, + srbs_toBeReleased_item_ies); + } + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* mandatory */ + /* c15. DRBs_ToBeReleased_List */ + ie = (F1AP_UEContextModificationRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_DRBs_ToBeReleased_List; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_UEContextModificationRequestIEs__value_PR_DRBs_ToBeReleased_List; + + for (i=0; + i<1; + i++) { + // + F1AP_DRBs_ToBeReleased_ItemIEs_t *drbs_toBeReleased_item_ies; + drbs_toBeReleased_item_ies = (F1AP_DRBs_ToBeReleased_ItemIEs_t *)calloc(1, sizeof(F1AP_DRBs_ToBeReleased_ItemIEs_t)); + drbs_toBeReleased_item_ies->id = F1AP_ProtocolIE_ID_id_DRBs_ToBeReleased_Item; + drbs_toBeReleased_item_ies->criticality = F1AP_Criticality_reject; + drbs_toBeReleased_item_ies->value.present = F1AP_DRBs_ToBeReleased_ItemIEs__value_PR_DRBs_ToBeReleased_Item; + + /* 14.1 SRBs_ToBeReleased_Item */ + F1AP_DRBs_ToBeReleased_Item_t drbs_toBeReleased_item; + memset((void *)&drbs_toBeReleased_item, 0, sizeof(F1AP_DRBs_ToBeReleased_Item_t)); + + /* dRBID */ + drbs_toBeReleased_item.dRBID = 30L; + + /* ADD */ + drbs_toBeReleased_item_ies->value.choice.DRBs_ToBeReleased_Item = drbs_toBeReleased_item; + ASN_SEQUENCE_ADD(&ie->value.choice.DRBs_ToBeReleased_List.list, + drbs_toBeReleased_item_ies); + + } + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* encode */ + if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { + printf("Failed to encode F1 setup request\n"); + return -1; + } + + printf("\n"); + + /* decode */ + if (f1ap_decode_pdu(&pdu, buffer, len) > 0) { + printf("Failed to decode F1 setup request\n"); + } + +} + +void CU_handle_UE_CONTEXT_MODIFICATION_RESPONSE(F1AP_UEContextModificationResponse_t *UEContextModificationResponse) { + AssertFatal(1==0,"Not implemented yet\n"); +} + +void CU_handle_UE_CONTEXT_MODIFICATION_FAILURE(F1AP_UEContextModificationFailure_t EContextModificationFailure) { + AssertFatal(1==0,"Not implemented yet\n"); +} + +void CU_handle_UE_CONTEXT_MODIFICATION_REQUIRED(F1AP_UEContextModificationRequired_t *UEContextModificationRequired) { + AssertFatal(1==0,"Not implemented yet\n"); +} + +void CU_send_UE_CONTEXT_MODIFICATION_CONFIRM(F1AP_UEContextModificationConfirm_t UEContextModificationConfirm_t) { + AssertFatal(1==0,"Not implemented yet\n"); +} + + +static int F1AP_CU_decode_initiating_message(F1AP_InitiatingMessage_t *initiating_p) { + + switch (initiating_p->value.present) { + + case F1AP_InitiatingMessage__value_PR_NOTHING: /* No components present */ + AssertFatal(1==0,"Should not receive NOTHING on CU\n"); + break; + + case F1AP_InitiatingMessage__value_PR_Reset: + CU_send_RESET(&initiating_p->value.choice.Reset); + break; + case F1AP_InitiatingMessage__value_PR_F1SetupRequest: + CU_handle_F1_SETUP_REQUEST(&initiating_p->value.choice.F1SetupRequest); + break; + case F1AP_InitiatingMessage__value_PR_GNBDUConfigurationUpdate: + AssertFatal(1==0,"Should not receive GNBDUConfigurationUpdate on CU\n"); + break; + case F1AP_InitiatingMessage__value_PR_GNBCUConfigurationUpdate: + CU_handle_gNB_CU_CONFIGURATION_UPDATE(&initiating_p->value.choice.GNBCUConfigurationUpdate); + break; + case F1AP_InitiatingMessage__value_PR_UEContextSetupRequest: + CU_handle_UE_CONTEXT_SETUP_REQUEST(&initiating_p->value.choice.UEContextSetupRequest); + break; + case F1AP_InitiatingMessage__value_PR_UEContextReleaseCommand: + CU_handle_UE_CONTEXT_SETUP_RELEASE_COMMAND(&initiating_p->value.choice.UEContextReleaseCommand); + break; + case F1AP_InitiatingMessage__value_PR_UEContextModificationRequest: + CU_handle_UE_CONTEXT_MODIFICATION_REQUEST(&initiating_p->value.choice.UEContextModificationRequest); + break; + case F1AP_InitiatingMessage__value_PR_UEContextModificationRequired: + AssertFatal(1==0,"Should not receive UECONTEXTMODIFICATIONREQUIRED on CU\n"); + break; + case F1AP_InitiatingMessage__value_PR_ErrorIndication: + AssertFatal(1==0,"Should not receive ErrorIndication on CU\n"); + break; + case F1AP_InitiatingMessage__value_PR_UEContextReleaseRequest: + AssertFatal(1==0,"Should not receive UECONTEXTRELEASEREQUEST on CU\n"); + break; + case F1AP_InitiatingMessage__value_PR_DLRRCMessageTransfer: + CU_handle_DL_RRC_MESSAGE_TRANSFER(&initiating_p->value.choice.DLRRCMessageTransfer); + break; + case F1AP_InitiatingMessage__value_PR_ULRRCMessageTransfer: + AssertFatal(1==0,"Should not receive ULRRCMESSAGETRANSFER on CU\n"); + break; + case F1AP_InitiatingMessage__value_PR_PrivateMessage: + AssertFatal(1==0,"Should not receive PRIVATEMESSAGE on CU\n"); + break; + default: + AssertFatal(1==0,"Shouldn't get here\n"); + } + +} + +static int F1AP_CU_decode_successful_outcome(F1AP_SuccessfulOutcome_t *successfulOutcome_p) +{ + + switch (successfulOutcome_p->value.present) { + + case F1AP_SuccessfulOutcome__value_PR_NOTHING: /* No components present */ + AssertFatal(1==0,"Should not received NOTHING!\n"); + break; + case F1AP_SuccessfulOutcome__value_PR_ResetAcknowledge: + AssertFatal(1==0,"CU Should not receive ResetAcknowled!\n"); + break; + case F1AP_SuccessfulOutcome__value_PR_F1SetupResponse: + AssertFatal(1==0,"CU Should not receive F1SetupResponse!\n"); + break; + case F1AP_SuccessfulOutcome__value_PR_GNBDUConfigurationUpdateAcknowledge: + CU_handle_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(successfulOutcome_p->value.choice.GNBDUConfigurationUpdateAcknowledge); + break; + case F1AP_SuccessfulOutcome__value_PR_GNBCUConfigurationUpdateAcknowledge: + AssertFatal(1==0,"CU Should not receive GNBCUConfigurationUpdateAcknowledge!\n"); + break; + case F1AP_SuccessfulOutcome__value_PR_UEContextSetupResponse: + AssertFatal(1==0,"CU Should not receive UEContextSetupResponse!\n"); + break; + case F1AP_SuccessfulOutcome__value_PR_UEContextReleaseComplete: + AssertFatal(1==0,"CU Should not receive UEContextReleaseComplete!\n"); + break; + case F1AP_SuccessfulOutcome__value_PR_UEContextModificationResponse: + AssertFatal(1==0,"CU Should not receive UEContextModificationResponse!\n"); + break; + case F1AP_SuccessfulOutcome__value_PR_UEContextModificationConfirm: + CU_send_UE_CONTEXT_MODIFICATION_CONFIRM(successfulOutcome_p->value.choice.UEContextModificationConfirm); + break; + } +} + +static int F1AP_CU_decode_unsuccessful_outcome(F1AP_UnsuccessfulOutcome_t *unSuccessfulOutcome_p) +{ + + switch (unSuccessfulOutcome_p->value.present) { + + case F1AP_UnsuccessfulOutcome__value_PR_NOTHING: + AssertFatal(1==0,"Should not receive NOTHING!\n"); + break; /* No components present */ + case F1AP_UnsuccessfulOutcome__value_PR_F1SetupFailure: + AssertFatal(1==0,"Should not receive F1SetupFailure\n"); + break; + case F1AP_UnsuccessfulOutcome__value_PR_GNBDUConfigurationUpdateFailure: + CU_handle_gNB_CU_CONFIGURATION_FAILURE(unSuccessfulOutcome_p->value.choice.GNBDUConfigurationUpdateFailure); + break; + case F1AP_UnsuccessfulOutcome__value_PR_GNBCUConfigurationUpdateFailure: + AssertFatal(1==0,"Should not receive GNBCUConfigurationUpdateFailure\n"); + break; + case F1AP_UnsuccessfulOutcome__value_PR_UEContextSetupFailure: + CU_handle_UE_CONTEXT_SETUP_FAILURE(unSuccessfulOutcome_p->value.choice.UEContextSetupFailure); + break; + case F1AP_UnsuccessfulOutcome__value_PR_UEContextModificationFailure: + CU_handle_UE_CONTEXT_MODIFICATION_FAILURE(unSuccessfulOutcome_p->value.choice.UEContextModificationFailure); + break; + } + +} diff --git a/openair2/F1AP/DU_F1AP.c b/openair2/F1AP/DU_F1AP.c new file mode 100644 index 0000000000..4d9f0cc5f8 --- /dev/null +++ b/openair2/F1AP/DU_F1AP.c @@ -0,0 +1,1506 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file openair2/F1AP/DU_F1AP.c +* \brief data structures for F1 interface modules +* \author EURECOM/NTUST +* \date 2018 +* \version 0.1 +* \company Eurecom +* \email: navid.nikaein@eurecom.fr, raymond.knopp@eurecom.fr, bing-kai.hong@eurecom.fr +* \note +* \warning +*/ + +#include "conversions.h" +#include "f1ap_common.h" +#include "f1ap_messages_types.h" +#include "platform_types.h" +#include "log.h" + +/* This structure describes association of a DU to a CU */ +typedef struct f1ap_info { + + module_id_t enb_mod_idP; + module_id_t du_mod_idP; + + /* Unique eNB_id to identify the eNB within EPC. + * In our case the eNB is a macro eNB so the id will be 20 bits long. + * For Home eNB id, this field should be 28 bits long. + */ + uint32_t GNB_DU_ID; + + /* This is the optional name provided by the MME */ + char *GNB_DU_Name; + net_ip_address_t mme_net_ip_address; // useful for joining assoc_id and ip address of packets + + + /* Number of input/ouput streams */ + uint16_t in_streams; + uint16_t out_streams; + + /* Connexion id used between SCTP/S1AP */ + uint16_t cnx_id; + + /* SCTP association id */ + int32_t assoc_id; + + uint16_t mcc; + uint16_t mnc; + uint8_t mnc_digit_length; + +} f1ap_info_t; + +// helper functions +#define F1AP_TRANSACTION_IDENTIFIER_NUMBER 3 +#define NUMBER_OF_eNB_MAX 3 + +uint8_t F1AP_get_next_transaction_identifier(module_id_t enb_mod_idP, module_id_t du_mod_idP) { + static uint8_t transaction_identifier[NUMBER_OF_eNB_MAX]; + transaction_identifier[enb_mod_idP+du_mod_idP] = (transaction_identifier[enb_mod_idP+du_mod_idP] + 1) % F1AP_TRANSACTION_IDENTIFIER_NUMBER; + //LOG_T(F1AP,"generated xid is %d\n",transaction_identifier[enb_mod_idP+du_mod_idP]); + return transaction_identifier[enb_mod_idP+du_mod_idP]; +} + +// ============================================================================== + +void F1AP_DU_task() { + printf("Start F1AP DU task!\n"); + + sctp_du_init(); + + // while (1) { + + // switch () { + + // case F1AP_ProcedureCode_id_F1Setup: + //DU_send_F1_SETUP_REQUEST((module_id_t)1, (module_id_t)2); + // break; + //DU_send_UL_RRC_MESSAGE_TRANSFER(); // OK + //DU_send_UE_CONTEXT_SETUP_RESPONSE(); // OK + DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(); // OK + // default: + + // } // switch + + // } // while + + return NULL; +} + + +// ============================================================================== + + +// SETUP REQUEST +void DU_send_F1_SETUP_REQUEST(module_id_t enb_mod_idP, module_id_t du_mod_idP) { +//void DU_send_F1_SETUP_REQUEST(F1SetupRequest_t *F1SetupRequest) { + F1AP_F1AP_PDU_t pdu; + F1AP_F1SetupRequest_t *out; + F1AP_F1SetupRequestIEs_t *ie; + + uint8_t *buffer; + uint32_t len; + int ret = 0; + int i = 0; + + // for test + f1ap_info_t f1ap_info; + f1ap_info.GNB_DU_ID = 789; + f1ap_info.GNB_DU_Name = "ABC"; + f1ap_info.mcc = 208; + f1ap_info.mnc = 93; + f1ap_info.mnc_digit_length = 3; + + /* Create */ + /* 0. pdu Type */ + memset(&pdu, 0, sizeof(pdu)); + pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage; + pdu.choice.initiatingMessage = (F1AP_InitiatingMessage_t *)calloc(1, sizeof(F1AP_InitiatingMessage_t)); + pdu.choice.initiatingMessage->procedureCode = F1AP_ProcedureCode_id_F1Setup; + pdu.choice.initiatingMessage->criticality = F1AP_Criticality_reject; + pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_F1SetupRequest; + out = &pdu.choice.initiatingMessage->value.choice.F1SetupRequest; + + /* mandatory */ + /* c1. Transaction ID (integer value) */ + ie = (F1AP_F1SetupRequestIEs_t *)calloc(1, sizeof(F1AP_F1SetupRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_TransactionID; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_F1SetupRequestIEs__value_PR_TransactionID; + ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(enb_mod_idP, du_mod_idP); + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* mandatory */ + /* c2. GNB_DU_ID (integrer value) */ + ie = (F1AP_F1SetupRequestIEs_t *)calloc(1, sizeof(F1AP_F1SetupRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_ID; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_F1SetupRequestIEs__value_PR_GNB_DU_ID; + asn_int642INTEGER(&ie->value.choice.GNB_DU_ID, f1ap_info.GNB_DU_ID); + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* optional */ + /* c3. GNB_DU_Name */ + if (f1ap_info.GNB_DU_Name != NULL) { + ie = (F1AP_F1SetupRequestIEs_t *)calloc(1, sizeof(F1AP_F1SetupRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_Name; + ie->criticality = F1AP_Criticality_ignore; + ie->value.present = F1AP_F1SetupRequestIEs__value_PR_GNB_DU_Name; + OCTET_STRING_fromBuf(&ie->value.choice.GNB_DU_Name, f1ap_info.GNB_DU_Name, + strlen(f1ap_info.GNB_DU_Name)); + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + } + + /* mandatory */ + /* c4. serverd cells list */ + ie = (F1AP_F1SetupRequestIEs_t *)calloc(1, sizeof(F1AP_F1SetupRequestIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_Served_Cells_List; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_F1SetupRequestIEs__value_PR_GNB_DU_Served_Cells_List; + + for (i=0; + i<1; + i++) { + /* mandatory */ + /* 4.1 serverd cells item */ + + F1AP_GNB_DU_Served_Cells_ItemIEs_t *gnb_du_served_cell_list_item_ies; + gnb_du_served_cell_list_item_ies = (F1AP_GNB_DU_Served_Cells_ItemIEs_t *)calloc(1, sizeof(F1AP_GNB_DU_Served_Cells_ItemIEs_t)); + gnb_du_served_cell_list_item_ies->id = F1AP_ProtocolIE_ID_id_GNB_DU_Served_Cells_Item; + gnb_du_served_cell_list_item_ies->criticality = F1AP_Criticality_reject; + gnb_du_served_cell_list_item_ies->value.present = F1AP_GNB_DU_Served_Cells_ItemIEs__value_PR_GNB_DU_Served_Cells_Item; + + + F1AP_GNB_DU_Served_Cells_Item_t gnb_du_served_cells_item; + memset((void *)&gnb_du_served_cells_item, 0, sizeof(F1AP_GNB_DU_Served_Cells_Item_t)); + + /* 4.1.1 serverd cell Information */ + F1AP_Served_Cell_Information_t served_cell_information; + + memset((void *)&served_cell_information, 0, sizeof(F1AP_Served_Cell_Information_t)); + /* - nRCGI */ + F1AP_NRCGI_t nRCGI; + MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length, &nRCGI.pLMN_Identity); + + + //INT32_TO_BIT_STRING(123, &nRCGI.nRCellIdentity); + nRCGI.nRCellIdentity.buf = malloc((36+7)/8); + + nRCGI.nRCellIdentity.size = (36+7)/8; + nRCGI.nRCellIdentity.bits_unused = 4; + + nRCGI.nRCellIdentity.buf[0] = 123; + + //nRCGI.nRCellIdentity = 15; + served_cell_information.nRCGI = nRCGI; + + /* - nRPCI */ + served_cell_information.nRPCI = 321; // int 0..1007 + + /* - fiveGS_TAC */ + OCTET_STRING_fromBuf(&served_cell_information.fiveGS_TAC, + "10", + 3); + + /* - Configured_EPS_TAC */ + if(1){ + served_cell_information.configured_EPS_TAC = (F1AP_Configured_EPS_TAC_t *)calloc(1, sizeof(F1AP_Configured_EPS_TAC_t)); + OCTET_STRING_fromBuf(served_cell_information.configured_EPS_TAC, + "2", + 2); + } + + /* - broadcast PLMNs */ + int maxnoofBPLMNS = 1; + for (i=0; + i PLMN BroadcastPLMNs Item */ + F1AP_BroadcastPLMNs_Item_t *broadcastPLMNs_Item = (F1AP_BroadcastPLMNs_Item_t *)calloc(1, sizeof(F1AP_BroadcastPLMNs_Item_t)); + //memset((void *)&broadcastPLMNs_Item, 0, sizeof(F1AP_BroadcastPLMNs_Item_t)); + MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length, &broadcastPLMNs_Item->pLMN_Identity); + ASN_SEQUENCE_ADD(&served_cell_information.servedPLMNs.list, broadcastPLMNs_Item); + } + + // // /* - CHOICE NR-MODE-Info */ + F1AP_NR_Mode_Info_t nR_Mode_Info; + + if ("FDD") { + nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_fDD; + /* > FDD >> FDD Info */ + F1AP_FDD_Info_t *fDD_Info = (F1AP_FDD_Info_t *)calloc(1, sizeof(F1AP_FDD_Info_t)); + /* >>> UL NRFreqInfo */ + fDD_Info->uL_NRFreqInfo.nRARFCN = 999L; + + F1AP_FreqBandNrItem_t ul_freqBandNrItem; + memset((void *)&ul_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t)); + ul_freqBandNrItem.freqBandIndicatorNr = 888L; + + F1AP_SupportedSULFreqBandItem_t ul_supportedSULFreqBandItem; + memset((void *)&ul_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t)); + ul_supportedSULFreqBandItem.freqBandIndicatorNr = 777L; + ASN_SEQUENCE_ADD(&ul_freqBandNrItem.supportedSULBandList.list, &ul_supportedSULFreqBandItem); + + ASN_SEQUENCE_ADD(&fDD_Info->uL_NRFreqInfo.freqBandListNr.list, &ul_freqBandNrItem); + + /* >>> DL NRFreqInfo */ + fDD_Info->dL_NRFreqInfo.nRARFCN = 666L; + + F1AP_FreqBandNrItem_t dl_freqBandNrItem; + memset((void *)&dl_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t)); + dl_freqBandNrItem.freqBandIndicatorNr = 555L; + + F1AP_SupportedSULFreqBandItem_t dl_supportedSULFreqBandItem; + memset((void *)&dl_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t)); + dl_supportedSULFreqBandItem.freqBandIndicatorNr = 444L; + ASN_SEQUENCE_ADD(&dl_freqBandNrItem.supportedSULBandList.list, &dl_supportedSULFreqBandItem); + + ASN_SEQUENCE_ADD(&fDD_Info->dL_NRFreqInfo.freqBandListNr.list, &dl_freqBandNrItem); + + /* >>> UL Transmission Bandwidth */ + fDD_Info->uL_Transmission_Bandwidth.nRSCS = F1AP_NRSCS_scs15; + fDD_Info->uL_Transmission_Bandwidth.nRNRB = F1AP_NRNRB_nrb11; + /* >>> DL Transmission Bandwidth */ + fDD_Info->dL_Transmission_Bandwidth.nRSCS = F1AP_NRSCS_scs15; + fDD_Info->dL_Transmission_Bandwidth.nRNRB = F1AP_NRNRB_nrb11; + + nR_Mode_Info.choice.fDD = fDD_Info; + } else { // TDD + nR_Mode_Info.present = F1AP_NR_Mode_Info_PR_tDD; + + /* > TDD >> TDD Info */ + F1AP_TDD_Info_t *tDD_Info = (F1AP_TDD_Info_t *)calloc(1, sizeof(F1AP_TDD_Info_t)); + /* >>> ARFCN */ + tDD_Info->nRFreqInfo.nRARFCN = 999L; // Integer + F1AP_FreqBandNrItem_t nr_freqBandNrItem; + memset((void *)&nr_freqBandNrItem, 0, sizeof(F1AP_FreqBandNrItem_t)); + nr_freqBandNrItem.freqBandIndicatorNr = 555L; + + F1AP_SupportedSULFreqBandItem_t nr_supportedSULFreqBandItem; + memset((void *)&nr_supportedSULFreqBandItem, 0, sizeof(F1AP_SupportedSULFreqBandItem_t)); + nr_supportedSULFreqBandItem.freqBandIndicatorNr = 444L; + ASN_SEQUENCE_ADD(&nr_freqBandNrItem.supportedSULBandList.list, &nr_supportedSULFreqBandItem); + + ASN_SEQUENCE_ADD(&tDD_Info->nRFreqInfo.freqBandListNr.list, &nr_freqBandNrItem); + + tDD_Info->transmission_Bandwidth.nRSCS= F1AP_NRSCS_scs15; + tDD_Info->transmission_Bandwidth.nRNRB= F1AP_NRNRB_nrb11; + + nR_Mode_Info.choice.tDD = tDD_Info; + } + + served_cell_information.nR_Mode_Info = nR_Mode_Info; + + /* - measurementTimingConfiguration */ + char *measurementTimingConfiguration = "0"; // sept. 2018 + + OCTET_STRING_fromBuf(&served_cell_information.measurementTimingConfiguration, + measurementTimingConfiguration, + strlen(measurementTimingConfiguration)); + gnb_du_served_cells_item.served_Cell_Information = served_cell_information; // + + /* 4.1.2 gNB-DU System Information */ + F1AP_GNB_DU_System_Information_t *gNB_DU_System_Information = (F1AP_GNB_DU_System_Information_t *)calloc(1, sizeof(F1AP_GNB_DU_System_Information_t)); + + OCTET_STRING_fromBuf(&gNB_DU_System_Information->mIB_message, // sept. 2018 + "1", + sizeof("1")); + + OCTET_STRING_fromBuf(&gNB_DU_System_Information->sIB1_message, // sept. 2018 + "1", + sizeof("1")); + gnb_du_served_cells_item.gNB_DU_System_Information = gNB_DU_System_Information; // + + /* ADD */ + gnb_du_served_cell_list_item_ies->value.choice.GNB_DU_Served_Cells_Item = gnb_du_served_cells_item; + + ASN_SEQUENCE_ADD(&ie->value.choice.GNB_DU_Served_Cells_List.list, + gnb_du_served_cell_list_item_ies); + + } + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + //printf("F1 setup request present = %d\n", ie.value.present); + + /* encode */ + if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { + printf("Failed to encode F1 setup request\n"); + } + + f1ap_du_send_message(buffer, len); + // printf("\n"); + + /* decode */ + // if (f1ap_decode_pdu(&pdu, buffer, len) > 0) { + // printf("Failed to decode F1 setup request\n"); + // } + // int req; + // req = s1ap_eNB_encode_s1_setup_request(&ie, &buffer, &len); + + //printf("encode F1 setup request, req = %d \n", req); + + //f1ap_eNB_itti_send_sctp_data_req(instance_p->instance, f1ap_mme_data_p->assoc_id, buffer, len, 0); + /* send Not Use ITTI */ + //f1ap_send_sctp_data_req(instance_p->instance, f1ap_mme_data_p->assoc_id, buffer, len, 0); + +} + +// ============================================================================== + +int f1ap_encode_pdu(F1AP_F1AP_PDU_t *pdu, uint8_t **buffer, uint32_t *length) { + DevAssert(pdu != NULL); + DevAssert(buffer != NULL); + DevAssert(length != NULL); + + + xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, pdu); + + + ssize_t encoded; + + // asn_DEF_F1AP_F1SetupRequest + // asn_DEF_F1AP_F1AP_PDU + + /* We can safely free list of IE from sptr */ + //ASN_STRUCT_FREE_CONTENTS_ONLY(&asn_DEF_F1AP_F1SetupRequest, pdu); + + + if ((encoded = aper_encode_to_new_buffer(&asn_DEF_F1AP_F1AP_PDU, 0, + pdu, + (void **)buffer)) < 0) { + printf("encoded len = %ld\n", encoded); + return -1; + } + + printf("encoded len = %ld\n", encoded); + printf("buffer = \n"); + + int i_ret; + for (i_ret = 0; i_ret < encoded; i_ret++) { + printf("%x ", *((*buffer)+i_ret)); + } + printf("\n"); + *length = encoded; + //ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_F1AP_F1AP_PDU, pdu); + return encoded; +} + + +int f1ap_decode_pdu(F1AP_F1AP_PDU_t *message, uint8_t *buffer, uint32_t length) { + + //LOG_I(F1AP,"Entering main loop of DU F1AP pdu receiver\n"); + F1AP_F1AP_PDU_t pdu; + F1AP_F1AP_PDU_t *pdu_p = &pdu; + asn_dec_rval_t dec_ret; + + DevAssert(buffer != NULL); + + printf("buffer = \n"); + int i_ret; + for (i_ret = 0; i_ret < length; i_ret++) { + printf("%x ", *(buffer+i_ret)); + } + printf("\n"); + + memset((void *)pdu_p, 0, sizeof(F1AP_F1AP_PDU_t)); + + + dec_ret = aper_decode(NULL, + &asn_DEF_F1AP_F1AP_PDU, + (void **)&pdu_p, + buffer, + length, + 0, + 0); + + xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, pdu_p); + + printf("\n"); + + printf("dec_ret.code = %d \n", dec_ret.code); + + AssertFatal(dec_ret.code == RC_OK,"Failed to decode pdu\n"); + + // switch(pdu_p->present) { + // case F1AP_F1AP_PDU_PR_initiatingpdu: + // return F1AP_DU_decode_initiating_pdu(&pdu_p->choice.initiatingpdu); + + // case F1AP_F1AP_PDU_PR_successfulOutcome: + // return F1AP_DU_decode_successful_outcome(&pdu_p->choice.successfulOutcome); + + // case F1AP_F1AP_PDU_PR_unsuccessfulOutcome: + // return F1AP_DU_decode_unsuccessful_outcome(&pdu_p->choice.unsuccessfulOutcome); + + // default: + // /*AssertFatal(1==0,"Unknown presence (%d) or not implemented\n", (int)pdu_p->present);*/ + // break; + // } + + //AssertFatal(1==0,"Shouldn't get here\n"); + return -1; +} + + +// ssize_t s1ap_generate_initiating_pdu( +// uint8_t **buffer, +// uint32_t *length, +// F1AP_ProcedureCode_t procedureCode, +// F1AP_Criticality_t criticality, +// asn_TYPE_descriptor_t *td, +// void *sptr) +// { +// F1AP_F1AP_PDU_t pdu; +// ssize_t encoded; + +// memset(&pdu, 0, sizeof(F1AP_F1AP_PDU_t)); + +// pdu.present = F1AP_F1AP_PDU_PR_initiatingpdu; +// pdu.choice.initiatingpdu = (F1AP_Initiatingpdu_t *)calloc(1, sizeof(F1AP_Initiatingpdu_t)); +// pdu.choice.initiatingpdu->procedureCode = procedureCode; +// pdu.choice.initiatingpdu->criticality = criticality; +// //ANY_fromType_aper(&pdu.choice.initiatingpdu->value, td, sptr); + +// //if (asn1_xer_print) { +// xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, (void *)&pdu); +// //} + +// /* We can safely free list of IE from sptr */ +// ASN_STRUCT_FREE_CONTENTS_ONLY(*td, sptr); + +// if ((encoded = aper_encode_to_new_buffer(&asn_DEF_F1AP_F1AP_PDU, 0, &pdu, +// (void **)buffer)) < 0) { +// return -1; +// } + +// *length = encoded; +// return encoded; +// } + +// int s1ap_eNB_encode_s1_setup_request( +// F1AP_F1SetupRequestIEs_t *s1SetupRequestIEs, +// uint8_t **buffer, +// uint32_t *length) +// { +// F1AP_F1SetupRequestIEs_t s1SetupRequest; +// F1AP_F1SetupRequestIEs_t *s1SetupRequest_p = &s1SetupRequest; + +// memset((void *)s1SetupRequest_p, 0, sizeof(s1SetupRequest)); + +// if (s1ap_encode_s1ap_s1setuprequesties(s1SetupRequest_p, s1SetupRequestIEs) < 0) { +// return -1; +// } + +// return s1ap_generate_initiating_pdu(buffer, +// length, +// F1AP_ProcedureCode_id_F1Setup, +// F1AP_Criticality_reject, +// &asn_DEF_F1AP_F1SetupRequest, +// s1SetupRequest_p); +// } + + + + +// SETUP SUCCESSFUL +void DU_handle_F1_SETUP_RESPONSE(struct F1AP_F1AP_PDU_t *pdu_p) { + + /* decode */ + //DU_F1AP_decode(args_p); + + /* handle */ + + /* save state */ +} + +// ============================================================================== + +// SETUP FAILURE +void DU_handle_F1_SETUP_FAILURE(struct F1AP_F1AP_PDU_t *pdu_p) { + //AssertFatal(1==0,"Not implemented yet\n"); + + //F1AP_F1SetupFailureIEs_t *f1_setup_failure_p; + //f1_setup_failure_p = &pdu_p.choice.unsuccessfulOutcome.value.choice.F1SetupFailureIEs.protocolIEs; + +} + + + +void DU_send_ERROR_INDICATION(struct F1AP_F1AP_PDU_t *pdu_p) { + //AssertFatal(1==0,"Not implemented yet\n"); + + //F1AP_F1ErrorIndicationIEs_t *f1_error_indication_p; + //f1_error_indication_p = &pdu_p.choice.successfulOutcome.value.choice.F1ErrorIndicationIEs.protocolIEs; +} + + +void DU_handle_ERROR_INDICATION(F1AP_ErrorIndication_t *ErrorIndication) { + AssertFatal(1==0,"Not implemented yet\n"); +} + + +void DU_handle_RESET(F1AP_Reset_t *Reset) { + AssertFatal(1==0,"Not implemented yet\n"); +} + +void DU_send_RESET_ACKKNOWLEDGE(F1AP_ResetAcknowledge_t *ResetAcknowledge) { + AssertFatal(1==0,"Not implemented yet\n"); +} + +void DU_send_RESET(F1AP_Reset_t *Reset) { + AssertFatal(1==0,"Not implemented yet\n"); +} + +void DU_handle_RESET_ACKKNOWLEDGE(F1AP_ResetAcknowledge_t *ResetAcknowledge) { + AssertFatal(1==0,"Not implemented yet\n"); +} + + +//void DU_send_UL_RRC_MESSAGE_TRANSFER(F1AP_ULRRCMessageTransfer_t *ULRRCMessageTransfer) { +void DU_send_UL_RRC_MESSAGE_TRANSFER() { + F1AP_F1AP_PDU_t pdu; + F1AP_ULRRCMessageTransfer_t *out; + F1AP_ULRRCMessageTransferIEs_t *ie; + + uint8_t *buffer; + uint32_t len; + int ret = 0; + int i = 0; + + /* Create */ + /* 0. Message Type */ + memset(&pdu, 0, sizeof(pdu)); + pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage; + pdu.choice.initiatingMessage = (F1AP_InitiatingMessage_t *)calloc(1, sizeof(F1AP_InitiatingMessage_t)); + pdu.choice.initiatingMessage->procedureCode = F1AP_ProcedureCode_id_ULRRCMessageTransfer; + pdu.choice.initiatingMessage->criticality = F1AP_Criticality_ignore; + pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_ULRRCMessageTransfer; + out = &pdu.choice.initiatingMessage->value.choice.ULRRCMessageTransfer; + + /* mandatory */ + /* c1. GNB_CU_UE_F1AP_ID */ + ie = (F1AP_ULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_ULRRCMessageTransferIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_GNB_CU_UE_F1AP_ID; + ie->value.choice.GNB_CU_UE_F1AP_ID = 126L; + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* mandatory */ + /* c2. GNB_DU_UE_F1AP_ID */ + ie = (F1AP_ULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_ULRRCMessageTransferIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_GNB_DU_UE_F1AP_ID; + ie->value.choice.GNB_DU_UE_F1AP_ID = 651L; + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* mandatory */ + /* c3. SRBID */ + ie = (F1AP_ULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_ULRRCMessageTransferIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_SRBID; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_SRBID; + ie->value.choice.SRBID = 1; + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + // issue in here + /* mandatory */ + /* c4. RRCContainer */ + ie = (F1AP_ULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_ULRRCMessageTransferIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_RRCContainer; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_RRCContainer; + OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer, "asdsa1d32sa1d31asd31as", + strlen("asdsa1d32sa1d31asd31as")); + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* encode */ + if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { + printf("Failed to encode F1 setup request\n"); + } + + printf("\n"); + + f1ap_du_send_message(buffer, len); + /* decode */ + // if (f1ap_decode_pdu(&pdu, buffer, len) > 0) { + // printf("Failed to decode F1 setup request\n"); + // } + //AssertFatal(1==0,"Not implemented yet\n"); +} + +void DU_handle_DL_RRC_MESSAGE_TRANSFER(F1AP_DLRRCMessageTransfer_t *DLRRCMessageTransfer) { + AssertFatal(1==0,"Not implemented yet\n"); +} + + +void DU_send_gNB_DU_CONFIGURATION_UPDATE(F1AP_GNBDUConfigurationUpdate_t *GNBDUConfigurationUpdate) { + AssertFatal(1==0,"Not implemented yet\n"); +} + +void DU_handle_gNB_DU_CONFIGURATION_FAILURE(F1AP_GNBDUConfigurationUpdateFailure_t GNBDUConfigurationUpdateFailure) { + AssertFatal(1==0,"Not implemented yet\n"); +} + +void DU_handle_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(F1AP_GNBDUConfigurationUpdateAcknowledge_t GNBDUConfigurationUpdateAcknowledge) { + AssertFatal(1==0,"Not implemented yet\n"); +} + + +void DU_handle_gNB_CU_CONFIGURATION_UPDATE(F1AP_GNBCUConfigurationUpdate_t *GNBCUConfigurationUpdate) { + AssertFatal(1==0,"Not implemented yet\n"); +} + +void DU_send_gNB_CU_CONFIGURATION_UPDATE_FALIURE(F1AP_GNBCUConfigurationUpdateFailure_t *GNBCUConfigurationUpdateFailure) { + AssertFatal(1==0,"Not implemented yet\n"); +} + +void DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(F1AP_GNBCUConfigurationUpdateAcknowledge_t *GNBCUConfigurationUpdateAcknowledge) { + AssertFatal(1==0,"Not implemented yet\n"); +} + + +void DU_handle_UE_CONTEXT_SETUP_REQUEST(F1AP_UEContextSetupRequest_t *UEContextSetupRequest) { + AssertFatal(1==0,"Not implemented yet\n"); +} + +//void DU_send_UE_CONTEXT_SETUP_RESPONSE(F1AP_UEContextSetupResponse_t *UEContextSetupResponse) { +void DU_send_UE_CONTEXT_SETUP_RESPONSE() { + F1AP_F1AP_PDU_t pdu; + F1AP_UEContextSetupResponse_t *out; + F1AP_UEContextSetupResponseIEs_t *ie; + + uint8_t *buffer; + uint32_t len; + int ret = 0; + int i = 0; + + f1ap_info_t f1ap_info; + f1ap_info.GNB_DU_Name = "ABC"; + f1ap_info.mcc = 208; + f1ap_info.mnc = 93; + f1ap_info.mnc_digit_length = 8; + + /* Create */ + /* 0. Message Type */ + memset(&pdu, 0, sizeof(pdu)); + pdu.present = F1AP_F1AP_PDU_PR_successfulOutcome; + pdu.choice.successfulOutcome = (F1AP_SuccessfulOutcome_t *)calloc(1, sizeof(F1AP_SuccessfulOutcome_t)); + pdu.choice.successfulOutcome->procedureCode = F1AP_ProcedureCode_id_UEContextSetup; + pdu.choice.successfulOutcome->criticality = F1AP_Criticality_reject; + pdu.choice.successfulOutcome->value.present = F1AP_SuccessfulOutcome__value_PR_UEContextSetupResponse; + out = &pdu.choice.successfulOutcome->value.choice.UEContextSetupResponse; + + /* mandatory */ + /* c1. GNB_CU_UE_F1AP_ID */ + ie = (F1AP_UEContextSetupResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupResponseIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_UEContextSetupResponseIEs__value_PR_GNB_CU_UE_F1AP_ID; + ie->value.choice.GNB_CU_UE_F1AP_ID = 126L; + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* mandatory */ + /* c2. GNB_DU_UE_F1AP_ID */ + ie = (F1AP_UEContextSetupResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupResponseIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_UEContextSetupResponseIEs__value_PR_GNB_DU_UE_F1AP_ID; + ie->value.choice.GNB_DU_UE_F1AP_ID = 651L; + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* mandatory */ + /* c3. DUtoCURRCInformation */ + ie = (F1AP_UEContextSetupResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupResponseIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_DUtoCURRCInformation; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_UEContextSetupResponseIEs__value_PR_DUtoCURRCInformation; + + OCTET_STRING_fromBuf(&ie->value.choice.DUtoCURRCInformation.cellGroupConfig, "asdsa", + strlen("asdsa")); + /* OPTIONAL */ + if (0) { + ie->value.choice.DUtoCURRCInformation.measGapConfig = (F1AP_MeasGapConfig_t *)calloc(1, sizeof(F1AP_MeasGapConfig_t)); + OCTET_STRING_fromBuf( ie->value.choice.DUtoCURRCInformation.measGapConfig, "asdsa", + strlen("asdsa")); + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + } + + /* optional */ + /* c4. ResourceCoordinationTransferContainer */ + if (0) { + ie = (F1AP_UEContextSetupResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupResponseIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_ResourceCoordinationTransferContainer; + ie->criticality = F1AP_Criticality_ignore; + ie->value.present = F1AP_UEContextSetupResponseIEs__value_PR_ResourceCoordinationTransferContainer; + OCTET_STRING_fromBuf(&ie->value.choice.ResourceCoordinationTransferContainer, "asdsa", + strlen("asdsa")); + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + } + + // /* */ + /* c5. DRBs_Setup_List */ + ie = (F1AP_UEContextSetupResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupResponseIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_DRBs_Setup_List; + ie->criticality = F1AP_Criticality_ignore; + ie->value.present = F1AP_UEContextSetupResponseIEs__value_PR_DRBs_Setup_List; + + for (i=0; + i<1; + i++) { + // + F1AP_DRBs_Setup_ItemIEs_t *drbs_setup_item_ies; + drbs_setup_item_ies = (F1AP_DRBs_Setup_ItemIEs_t *)calloc(1, sizeof(F1AP_DRBs_Setup_ItemIEs_t)); + drbs_setup_item_ies->id = F1AP_ProtocolIE_ID_id_DRBs_Setup_Item; + drbs_setup_item_ies->criticality = F1AP_Criticality_ignore; + drbs_setup_item_ies->value.present = F1AP_SRBs_FailedToBeSetup_ItemIEs__value_PR_SRBs_FailedToBeSetup_Item; + + /* 5.1 DRBs_Setup_Item */ + F1AP_DRBs_Setup_Item_t drbs_setup_item; + memset((void *)&drbs_setup_item, 0, sizeof(F1AP_DRBs_Setup_Item_t)); + + drbs_setup_item.dRBID = 12; + + int j; + for (j=0; + j<1; + j++) { + + F1AP_DLUPTNLInformation_ToBeSetup_Item_t *dLUPTNLInformation_ToBeSetup_Item; + dLUPTNLInformation_ToBeSetup_Item = (F1AP_DLUPTNLInformation_ToBeSetup_Item_t *)calloc(1, sizeof(F1AP_DLUPTNLInformation_ToBeSetup_Item_t)); + dLUPTNLInformation_ToBeSetup_Item->dLUPTNLInformation.present = F1AP_UPTransportLayerInformation_PR_gTPTunnel; + + F1AP_GTPTunnel_t *gTPTunnel = (F1AP_GTPTunnel_t *)calloc(1, sizeof(F1AP_GTPTunnel_t)); + + // F1AP_TransportLayerAddress_t transportLayerAddress; + // transportLayerAddress.buf = malloc((36+7)/8); + // transportLayerAddress.size = (36+7)/8; + // transportLayerAddress.bits_unused = 4; + // *transportLayerAddress.buf = 123; + // dLUPTNLInformation_ToBeSetup_Item.dL_GTP_Tunnel_EndPoint.transportLayerAddress = transportLayerAddress; + + TRANSPORT_LAYER_ADDRESS_TO_BIT_STRING(1234, &gTPTunnel->transportLayerAddress); + + OCTET_STRING_fromBuf(&gTPTunnel->gTP_TEID, "1204", + strlen("1204")); + + dLUPTNLInformation_ToBeSetup_Item->dLUPTNLInformation.choice.gTPTunnel = gTPTunnel; + + ASN_SEQUENCE_ADD(&drbs_setup_item.dLUPTNLInformation_ToBeSetup_List.list, + dLUPTNLInformation_ToBeSetup_Item); + } + + // /* ADD */ + drbs_setup_item_ies->value.choice.DRBs_Setup_Item = drbs_setup_item; + ASN_SEQUENCE_ADD(&ie->value.choice.DRBs_Setup_List.list, + drbs_setup_item_ies); + } + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + // /* */ + /* c6. SRBs_FailedToBeSetup_List */ + ie = (F1AP_UEContextSetupResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupResponseIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_SRBs_FailedToBeSetup_List; + ie->criticality = F1AP_Criticality_ignore; + ie->value.present = F1AP_UEContextSetupResponseIEs__value_PR_SRBs_FailedToBeSetup_List; + + for (i=0; + i<1; + i++) { + // + F1AP_SRBs_FailedToBeSetup_ItemIEs_t *srbs_failedToBeSetup_item_ies; + srbs_failedToBeSetup_item_ies = (F1AP_SRBs_FailedToBeSetup_ItemIEs_t *)calloc(1, sizeof(F1AP_SRBs_FailedToBeSetup_ItemIEs_t)); + srbs_failedToBeSetup_item_ies->id = F1AP_ProtocolIE_ID_id_SRBs_FailedToBeSetup_Item; + srbs_failedToBeSetup_item_ies->criticality = F1AP_Criticality_ignore; + srbs_failedToBeSetup_item_ies->value.present = F1AP_SRBs_FailedToBeSetup_ItemIEs__value_PR_SRBs_FailedToBeSetup_Item; + + /* 6.1 SRBs_Setup_Item */ + F1AP_SRBs_FailedToBeSetup_Item_t srbs_failedToBeSetup_item; + memset((void *)&srbs_failedToBeSetup_item, 0, sizeof(F1AP_SRBs_FailedToBeSetup_Item_t)); + + srbs_failedToBeSetup_item.sRBID = 13; + srbs_failedToBeSetup_item.cause = (F1AP_Cause_t *)calloc(1, sizeof(F1AP_Cause_t)); + srbs_failedToBeSetup_item.cause->present = F1AP_Cause_PR_radioNetwork; + srbs_failedToBeSetup_item.cause->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnb_cu_ue_f1ap_id; + + // /* ADD */ + srbs_failedToBeSetup_item_ies->value.choice.SRBs_FailedToBeSetup_Item = srbs_failedToBeSetup_item; + ASN_SEQUENCE_ADD(&ie->value.choice.SRBs_FailedToBeSetup_List.list, + srbs_failedToBeSetup_item_ies); + } + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + // /* */ + /* c7. DRBs_FailedToBeSetup_List */ + ie = (F1AP_UEContextSetupResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupResponseIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_DRBs_FailedToBeSetup_List; + ie->criticality = F1AP_Criticality_ignore; + ie->value.present = F1AP_UEContextSetupResponseIEs__value_PR_DRBs_FailedToBeSetup_List; + + for (i=0; + i<1; + i++) { + // + F1AP_DRBs_FailedToBeSetup_ItemIEs_t *drbs_failedToBeSetup_item_ies; + drbs_failedToBeSetup_item_ies = (F1AP_DRBs_FailedToBeSetup_ItemIEs_t *)calloc(1, sizeof(F1AP_DRBs_FailedToBeSetup_ItemIEs_t)); + drbs_failedToBeSetup_item_ies->id = F1AP_ProtocolIE_ID_id_DRBs_FailedToBeSetup_Item; + drbs_failedToBeSetup_item_ies->criticality = F1AP_Criticality_ignore; + drbs_failedToBeSetup_item_ies->value.present = F1AP_DRBs_FailedToBeSetup_ItemIEs__value_PR_DRBs_FailedToBeSetup_Item; + + /* 7.1 DRBs_Setup_Item */ + F1AP_DRBs_FailedToBeSetup_Item_t drbs_failedToBeSetup_item; + memset((void *)&drbs_failedToBeSetup_item, 0, sizeof(F1AP_DRBs_FailedToBeSetup_Item_t)); + + drbs_failedToBeSetup_item.dRBID = 14; + drbs_failedToBeSetup_item.cause = (F1AP_Cause_t *)calloc(1, sizeof(F1AP_Cause_t)); + drbs_failedToBeSetup_item.cause->present = F1AP_Cause_PR_radioNetwork; + drbs_failedToBeSetup_item.cause->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnb_cu_ue_f1ap_id; + + // /* ADD */ + drbs_failedToBeSetup_item_ies->value.choice.DRBs_FailedToBeSetup_Item = drbs_failedToBeSetup_item; + ASN_SEQUENCE_ADD(&ie->value.choice.DRBs_FailedToBeSetup_List.list, + drbs_failedToBeSetup_item_ies); + } + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + // /* */ + /* c8. SCell_FailedtoSetup_List */ + ie = (F1AP_UEContextSetupResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupResponseIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_SCell_FailedtoSetup_List; + ie->criticality = F1AP_Criticality_ignore; + ie->value.present = F1AP_UEContextSetupResponseIEs__value_PR_SCell_FailedtoSetup_List; + + for (i=0; + i<1; + i++) { + // + F1AP_SCell_FailedtoSetup_ItemIEs_t *sCell_FailedtoSetup_item_ies; + sCell_FailedtoSetup_item_ies = (F1AP_SCell_FailedtoSetup_ItemIEs_t *)calloc(1, sizeof(F1AP_SCell_FailedtoSetup_ItemIEs_t)); + sCell_FailedtoSetup_item_ies->id = F1AP_ProtocolIE_ID_id_SCell_FailedtoSetup_Item; + sCell_FailedtoSetup_item_ies->criticality = F1AP_Criticality_ignore; + sCell_FailedtoSetup_item_ies->value.present = F1AP_SCell_FailedtoSetup_ItemIEs__value_PR_SCell_FailedtoSetup_Item; + + /* 8.1 DRBs_Setup_Item */ + F1AP_SCell_FailedtoSetup_Item_t sCell_FailedtoSetup_item; + memset((void *)&sCell_FailedtoSetup_item, 0, sizeof(F1AP_SCell_FailedtoSetup_Item_t)); + + /* - nRCGI */ + F1AP_NRCGI_t nRCGI; // issue here + MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length, &nRCGI.pLMN_Identity); +// + // INT32_TO_BIT_STRING(123, &nRCGI.nRCellIdentity); + // nRCGI.nRCellIdentity.buf = malloc((36+7)/8); + + // nRCGI.nRCellIdentity.size = (36+7)/8; + // nRCGI.nRCellIdentity.bits_unused = 4; + + // nRCGI.nRCellIdentity.buf[0] = 123; + + //nRCGI.nRCellIdentity = 15; + + NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); + + sCell_FailedtoSetup_item.sCell_ID = nRCGI; + + sCell_FailedtoSetup_item.cause = (F1AP_Cause_t *)calloc(1, sizeof(F1AP_Cause_t)); + sCell_FailedtoSetup_item.cause->present = F1AP_Cause_PR_radioNetwork; + sCell_FailedtoSetup_item.cause->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnb_cu_ue_f1ap_id; + + // /* ADD */ + sCell_FailedtoSetup_item_ies->value.choice.SCell_FailedtoSetup_Item = sCell_FailedtoSetup_item; + ASN_SEQUENCE_ADD(&ie->value.choice.SCell_FailedtoSetup_List.list, + sCell_FailedtoSetup_item_ies); + } + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + // /* */ + /* c9. CriticalityDiagnostics */ + if (0) { + ie = (F1AP_UEContextSetupResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupResponseIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_CriticalityDiagnostics; + ie->criticality = F1AP_Criticality_ignore; + ie->value.present = F1AP_UEContextSetupResponseIEs__value_PR_CriticalityDiagnostics; + ie->value.choice.CriticalityDiagnostics.procedureCode = (F1AP_ProcedureCode_t *)calloc(1, sizeof(F1AP_ProcedureCode_t)); + *ie->value.choice.CriticalityDiagnostics.procedureCode = F1AP_ProcedureCode_id_UEContextSetup; + ie->value.choice.CriticalityDiagnostics.triggeringMessage = (F1AP_TriggeringMessage_t *)calloc(1, sizeof(F1AP_TriggeringMessage_t)); + *ie->value.choice.CriticalityDiagnostics.triggeringMessage = F1AP_TriggeringMessage_initiating_message; + ie->value.choice.CriticalityDiagnostics.procedureCriticality = (F1AP_Criticality_t *)calloc(1, sizeof(F1AP_Criticality_t)); + *ie->value.choice.CriticalityDiagnostics.procedureCriticality = F1AP_Criticality_reject; + ie->value.choice.CriticalityDiagnostics.transactionID = (F1AP_TransactionID_t *)calloc(1, sizeof(F1AP_TransactionID_t)); + *ie->value.choice.CriticalityDiagnostics.transactionID = 0; + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + } + + + /* encode */ + if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { + printf("Failed to encode F1 setup request\n"); + return -1; + } + + printf("\n"); + + /* decode */ + // if (f1ap_decode_pdu(&pdu, buffer, len) > 0) { + // printf("Failed to decode F1 setup request\n"); + // } + f1ap_du_send_message(buffer, len); +} + +void DU_send_UE_CONTEXT_SETUP_FAILURE(F1AP_UEContextSetupFailure_t UEContextSetupFailure) { + AssertFatal(1==0,"Not implemented yet\n"); +} + + +void DU_send_UE_CONTEXT_RELEASE_REQUEST(F1AP_UEContextReleaseRequest_t *UEContextReleaseRequest) { + AssertFatal(1==0,"Not implemented yet\n"); +} + + +void DU_handle_UE_CONTEXT_RELEASE_COMMAND(F1AP_UEContextReleaseCommand_t *UEContextReleaseCommand) { + AssertFatal(1==0,"Not implemented yet\n"); +} + + +void DU_send_UE_CONTEXT_RELEASE_COMPLETE(F1AP_UEContextReleaseComplete_t *UEContextReleaseComplete) { + AssertFatal(1==0,"Not implemented yet\n"); +} + +void DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(F1AP_UEContextModificationRequest_t *UEContextModificationRequest) { + AssertFatal(1==0,"Not implemented yet\n"); +} + +//void DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(F1AP_UEContextModificationResponse_t *UEContextModificationResponse) { +void DU_send_UE_CONTEXT_MODIFICATION_RESPONSE() { + F1AP_F1AP_PDU_t pdu; + F1AP_UEContextModificationResponse_t *out; + F1AP_UEContextModificationResponseIEs_t *ie; + + uint8_t *buffer; + uint32_t len; + int ret = 0; + int i = 0; + + f1ap_info_t f1ap_info; + f1ap_info.GNB_DU_Name = "ABC"; + f1ap_info.mcc = 208; + f1ap_info.mnc = 93; + f1ap_info.mnc_digit_length = 8; + + /* Create */ + /* 0. Message Type */ + memset(&pdu, 0, sizeof(pdu)); + pdu.present = F1AP_F1AP_PDU_PR_successfulOutcome; + pdu.choice.successfulOutcome = (F1AP_SuccessfulOutcome_t *)calloc(1, sizeof(F1AP_SuccessfulOutcome_t)); + pdu.choice.successfulOutcome->procedureCode = F1AP_ProcedureCode_id_UEContextModification; + pdu.choice.successfulOutcome->criticality = F1AP_Criticality_reject; + pdu.choice.successfulOutcome->value.present = F1AP_SuccessfulOutcome__value_PR_UEContextModificationResponse; + out = &pdu.choice.successfulOutcome->value.choice.UEContextModificationResponse; + + /* mandatory */ + /* c1. GNB_CU_UE_F1AP_ID */ + ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_GNB_CU_UE_F1AP_ID; + ie->value.choice.GNB_CU_UE_F1AP_ID = 126L; + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* mandatory */ + /* c2. GNB_DU_UE_F1AP_ID */ + ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_GNB_DU_UE_F1AP_ID; + ie->value.choice.GNB_DU_UE_F1AP_ID = 651L; + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* optional */ + /* c3. ResourceCoordinationTransferContainer */ + if (0) { + ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_ResourceCoordinationTransferContainer; + ie->criticality = F1AP_Criticality_ignore; + ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_ResourceCoordinationTransferContainer; + OCTET_STRING_fromBuf(&ie->value.choice.ResourceCoordinationTransferContainer, "asdsa1d32sa1d31asd31as", + strlen("asdsa1d32sa1d31asd31as")); + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + } + + /* optional */ + /* c4. DUtoCURRCInformation */ + if (0) { + ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_DUtoCURRCInformation; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_DUtoCURRCInformation; + + OCTET_STRING_fromBuf(&ie->value.choice.DUtoCURRCInformation.cellGroupConfig, "asdsa1d32sa1d31asd31as", + strlen("asdsa1d32sa1d31asd31as")); + /* OPTIONAL */ + if (1) { + ie->value.choice.DUtoCURRCInformation.measGapConfig = (F1AP_MeasGapConfig_t *)calloc(1, sizeof(F1AP_MeasGapConfig_t)); + OCTET_STRING_fromBuf( ie->value.choice.DUtoCURRCInformation.measGapConfig, "asdsa1d32sa1d31asd31as", + strlen("asdsa1d32sa1d31asd31as")); + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + } + } + + + /* mandatory */ + /* c5. DRBs_SetupMod_List */ + ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_DRBs_SetupMod_List; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_DRBs_SetupMod_List; + + for (i=0; + i<1; + i++) { + // + F1AP_DRBs_SetupMod_ItemIEs_t *drbs_setupMod_item_ies; + drbs_setupMod_item_ies = (F1AP_DRBs_SetupMod_ItemIEs_t *)calloc(1, sizeof(F1AP_DRBs_SetupMod_ItemIEs_t)); + drbs_setupMod_item_ies->id = F1AP_ProtocolIE_ID_id_DRBs_SetupMod_Item; + drbs_setupMod_item_ies->criticality = F1AP_Criticality_reject; + drbs_setupMod_item_ies->value.present = F1AP_DRBs_SetupMod_ItemIEs__value_PR_DRBs_SetupMod_Item; + + /* 10.1 DRBs_SetupMod_Item */ + F1AP_DRBs_SetupMod_Item_t drbs_setupMod_item; + memset((void *)&drbs_setupMod_item, 0, sizeof(F1AP_DRBs_SetupMod_Item_t)); + + /* dRBID */ + drbs_setupMod_item.dRBID = 30L; + + /* DLTunnels_SetupMod_List */ + int j = 0; + int maxnoofDLUPTNLInformation = 1; // 2; + for (j=0; + jdLUPTNLInformation.present = F1AP_UPTransportLayerInformation_PR_gTPTunnel; + F1AP_GTPTunnel_t *gTPTunnel = (F1AP_GTPTunnel_t *)calloc(1, sizeof(F1AP_GTPTunnel_t)); + + TRANSPORT_LAYER_ADDRESS_TO_BIT_STRING(1234, &gTPTunnel->transportLayerAddress); + + OCTET_STRING_fromBuf(&gTPTunnel->gTP_TEID, "1204", + strlen("1204")); + + dLUPTNLInformation_ToBeSetup_Item->dLUPTNLInformation.choice.gTPTunnel = gTPTunnel; + + ASN_SEQUENCE_ADD(&drbs_setupMod_item.dLUPTNLInformation_ToBeSetup_List.list, dLUPTNLInformation_ToBeSetup_Item); + } + + /* ADD */ + drbs_setupMod_item_ies->value.choice.DRBs_SetupMod_Item = drbs_setupMod_item; + ASN_SEQUENCE_ADD(&ie->value.choice.DRBs_SetupMod_List.list, + drbs_setupMod_item_ies); + } + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + + /* mandatory */ + /* c6. DRBs_Modified_List */ + ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_DRBs_Modified_List; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_DRBs_Modified_List; + + for (i=0; + i<1; + i++) { + // + F1AP_DRBs_Modified_ItemIEs_t *drbs_modified_item_ies; + drbs_modified_item_ies = (F1AP_DRBs_Modified_ItemIEs_t *)calloc(1, sizeof(F1AP_DRBs_Modified_ItemIEs_t)); + drbs_modified_item_ies->id = F1AP_ProtocolIE_ID_id_DRBs_Modified_Item; + drbs_modified_item_ies->criticality = F1AP_Criticality_reject; + drbs_modified_item_ies->value.present = F1AP_DRBs_Modified_ItemIEs__value_PR_DRBs_Modified_Item; + + /* 13.1 SRBs_modified_Item */ + F1AP_DRBs_Modified_Item_t drbs_modified_item; + memset((void *)&drbs_modified_item, 0, sizeof(F1AP_DRBs_Modified_Item_t)); + + /* dRBID */ + drbs_modified_item.dRBID = 25L; + + /* ULTunnels_Modified_List */ + int maxnoofULTunnels = 1; // 2; + int j = 0; + for (j=0; + jdLUPTNLInformation.present = F1AP_UPTransportLayerInformation_PR_gTPTunnel; + F1AP_GTPTunnel_t *gTPTunnel = (F1AP_GTPTunnel_t *)calloc(1, sizeof(F1AP_GTPTunnel_t)); + + TRANSPORT_LAYER_ADDRESS_TO_BIT_STRING(1234, &gTPTunnel->transportLayerAddress); + + OCTET_STRING_fromBuf(&gTPTunnel->gTP_TEID, "1204", + strlen("1204")); + + dLUPTNLInformation_ToBeSetup_Item->dLUPTNLInformation.choice.gTPTunnel = gTPTunnel; + + ASN_SEQUENCE_ADD(&drbs_modified_item.dLUPTNLInformation_ToBeSetup_List.list, dLUPTNLInformation_ToBeSetup_Item); + } + + /* ADD */ + drbs_modified_item_ies->value.choice.DRBs_Modified_Item = drbs_modified_item; + ASN_SEQUENCE_ADD(&ie->value.choice.DRBs_Modified_List.list, + drbs_modified_item_ies); + } + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* mandatory */ + /* c7. SRBs_FailedToBeSetupMod_List */ + ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_SRBs_FailedToBeSetupMod_List; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_SRBs_FailedToBeSetupMod_List; + + for (i=0; + i<1; + i++) { + // + F1AP_SRBs_FailedToBeSetupMod_ItemIEs_t *srbs_failedToBeSetupMod_item_ies; + srbs_failedToBeSetupMod_item_ies = (F1AP_SRBs_FailedToBeSetupMod_ItemIEs_t *)calloc(1, sizeof(F1AP_SRBs_FailedToBeSetupMod_ItemIEs_t)); + srbs_failedToBeSetupMod_item_ies->id = F1AP_ProtocolIE_ID_id_SRBs_FailedToBeSetupMod_Item; + srbs_failedToBeSetupMod_item_ies->criticality = F1AP_Criticality_ignore; + srbs_failedToBeSetupMod_item_ies->value.present = F1AP_SRBs_FailedToBeSetupMod_ItemIEs__value_PR_SRBs_FailedToBeSetupMod_Item; + + /* 9.1 SRBs_FailedToBeSetupMod_Item */ + F1AP_SRBs_FailedToBeSetupMod_Item_t srbs_failedToBeSetupMod_item; + memset((void *)&srbs_failedToBeSetupMod_item, 0, sizeof(F1AP_SRBs_FailedToBeSetupMod_Item_t)); + + /* - sRBID */ + srbs_failedToBeSetupMod_item.sRBID = 50L; + + srbs_failedToBeSetupMod_item.cause = (F1AP_Cause_t *)calloc(1, sizeof(F1AP_Cause_t)); + srbs_failedToBeSetupMod_item.cause->present = F1AP_Cause_PR_radioNetwork; + srbs_failedToBeSetupMod_item.cause->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnd_du_ue_f1ap_id; + + /* ADD */ + srbs_failedToBeSetupMod_item_ies->value.choice.SRBs_FailedToBeSetupMod_Item = srbs_failedToBeSetupMod_item; + ASN_SEQUENCE_ADD(&ie->value.choice.SRBs_FailedToBeSetupMod_List.list, + srbs_failedToBeSetupMod_item_ies); + } + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* mandatory */ + /* c8. DRBs_FailedToBeSetupMod_List */ + ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_DRBs_FailedToBeSetupMod_List; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_DRBs_FailedToBeSetupMod_List; + + for (i=0; + i<1; + i++) { + // + F1AP_DRBs_FailedToBeSetupMod_ItemIEs_t *drbs_failedToBeSetupMod_item_ies; + drbs_failedToBeSetupMod_item_ies = (F1AP_DRBs_FailedToBeSetupMod_ItemIEs_t *)calloc(1, sizeof(F1AP_DRBs_FailedToBeSetupMod_ItemIEs_t)); + drbs_failedToBeSetupMod_item_ies->id = F1AP_ProtocolIE_ID_id_DRBs_FailedToBeSetupMod_Item; + drbs_failedToBeSetupMod_item_ies->criticality = F1AP_Criticality_reject; + drbs_failedToBeSetupMod_item_ies->value.present = F1AP_DRBs_FailedToBeSetupMod_ItemIEs__value_PR_DRBs_FailedToBeSetupMod_Item; + + /* 10.1 DRBs_ToBeSetupMod_Item */ + F1AP_DRBs_FailedToBeSetupMod_Item_t drbs_failedToBeSetupMod_item; + memset((void *)&drbs_failedToBeSetupMod_item, 0, sizeof(F1AP_DRBs_FailedToBeSetupMod_Item_t)); + + /* dRBID */ + drbs_failedToBeSetupMod_item.dRBID = 30L; + + drbs_failedToBeSetupMod_item.cause = (F1AP_Cause_t *)calloc(1, sizeof(F1AP_Cause_t)); + drbs_failedToBeSetupMod_item.cause->present = F1AP_Cause_PR_radioNetwork; + drbs_failedToBeSetupMod_item.cause->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnd_du_ue_f1ap_id; + + /* ADD */ + drbs_failedToBeSetupMod_item_ies->value.choice.DRBs_FailedToBeSetupMod_Item = drbs_failedToBeSetupMod_item; + ASN_SEQUENCE_ADD(&ie->value.choice.DRBs_FailedToBeSetupMod_List.list, + drbs_failedToBeSetupMod_item_ies); + + } + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + + /* mandatory */ + /* c9. SCell_FailedtoSetupMod_List */ + ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_SCell_FailedtoSetupMod_List; + ie->criticality = F1AP_Criticality_ignore; + ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_SCell_FailedtoSetupMod_List; + + for (i=0; + i<1; + i++) { + // + F1AP_SCell_FailedtoSetupMod_ItemIEs_t *scell_failedtoSetupMod_item_ies; + scell_failedtoSetupMod_item_ies = (F1AP_SCell_FailedtoSetupMod_ItemIEs_t *)calloc(1, sizeof(F1AP_SCell_FailedtoSetupMod_ItemIEs_t)); + scell_failedtoSetupMod_item_ies->id = F1AP_ProtocolIE_ID_id_SCell_FailedtoSetupMod_Item; + scell_failedtoSetupMod_item_ies->criticality = F1AP_Criticality_ignore; + scell_failedtoSetupMod_item_ies->value.present = F1AP_SCell_FailedtoSetupMod_ItemIEs__value_PR_SCell_FailedtoSetupMod_Item; + + /* 8.1 SCell_ToBeSetup_Item */ + F1AP_SCell_FailedtoSetupMod_Item_t scell_failedtoSetupMod_item; + memset((void *)&scell_failedtoSetupMod_item, 0, sizeof(F1AP_SCell_FailedtoSetupMod_Item_t)); + + /* - sCell_ID */ + F1AP_NRCGI_t nRCGI; + MCC_MNC_TO_PLMNID(f1ap_info.mcc, f1ap_info.mnc, f1ap_info.mnc_digit_length, + &nRCGI.pLMN_Identity); + + NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity); + + scell_failedtoSetupMod_item.sCell_ID = nRCGI; + + scell_failedtoSetupMod_item.cause = (F1AP_Cause_t *)calloc(1, sizeof(F1AP_Cause_t)); + scell_failedtoSetupMod_item.cause->present = F1AP_Cause_PR_radioNetwork; + scell_failedtoSetupMod_item.cause->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnd_du_ue_f1ap_id; + + /* ADD */ + scell_failedtoSetupMod_item_ies->value.choice.SCell_FailedtoSetupMod_Item = scell_failedtoSetupMod_item; + ASN_SEQUENCE_ADD(&ie->value.choice.SCell_FailedtoSetupMod_List.list, + scell_failedtoSetupMod_item_ies); + } + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + /* mandatory */ + /* c10. DRBs_FailedToBeModified_List */ + ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_DRBs_FailedToBeModified_List; + ie->criticality = F1AP_Criticality_reject; + ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_DRBs_FailedToBeModified_List; + + for (i=0; + i<1; + i++) { + // + F1AP_DRBs_FailedToBeModified_ItemIEs_t *drbs_failedToBeModified_item_ies; + drbs_failedToBeModified_item_ies = (F1AP_DRBs_FailedToBeModified_ItemIEs_t *)calloc(1, sizeof(F1AP_DRBs_FailedToBeModified_ItemIEs_t)); + drbs_failedToBeModified_item_ies->id = F1AP_ProtocolIE_ID_id_DRBs_FailedToBeModified_Item; + drbs_failedToBeModified_item_ies->criticality = F1AP_Criticality_reject; + drbs_failedToBeModified_item_ies->value.present = F1AP_DRBs_FailedToBeModified_ItemIEs__value_PR_DRBs_FailedToBeModified_Item; + + /* 13.1 DRBs_FailedToBeModified_Item */ + F1AP_DRBs_FailedToBeModified_Item_t drbs_failedToBeModified_item; + memset((void *)&drbs_failedToBeModified_item, 0, sizeof(F1AP_DRBs_FailedToBeModified_Item_t)); + + /* dRBID */ + drbs_failedToBeModified_item.dRBID = 30L; + + drbs_failedToBeModified_item.cause = (F1AP_Cause_t *)calloc(1, sizeof(F1AP_Cause_t)); + drbs_failedToBeModified_item.cause->present = F1AP_Cause_PR_radioNetwork; + drbs_failedToBeModified_item.cause->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnd_du_ue_f1ap_id; + + /* ADD */ + drbs_failedToBeModified_item_ies->value.choice.DRBs_FailedToBeModified_Item = drbs_failedToBeModified_item; + ASN_SEQUENCE_ADD(&ie->value.choice.DRBs_FailedToBeModified_List.list, + drbs_failedToBeModified_item_ies); + + } + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + + // /* */ + /* c11. CriticalityDiagnostics */ + if (0) { + ie = (F1AP_UEContextModificationResponseIEs_t *)calloc(1, sizeof(F1AP_UEContextModificationResponseIEs_t)); + ie->id = F1AP_ProtocolIE_ID_id_CriticalityDiagnostics; + ie->criticality = F1AP_Criticality_ignore; + ie->value.present = F1AP_UEContextModificationResponseIEs__value_PR_CriticalityDiagnostics; + ie->value.choice.CriticalityDiagnostics.procedureCode = (F1AP_ProcedureCode_t *)calloc(1, sizeof(F1AP_ProcedureCode_t)); + *ie->value.choice.CriticalityDiagnostics.procedureCode = F1AP_ProcedureCode_id_UEContextModification; + ie->value.choice.CriticalityDiagnostics.triggeringMessage = (F1AP_TriggeringMessage_t *)calloc(1, sizeof(F1AP_TriggeringMessage_t)); + *ie->value.choice.CriticalityDiagnostics.triggeringMessage = F1AP_TriggeringMessage_initiating_message; + ie->value.choice.CriticalityDiagnostics.procedureCriticality = (F1AP_Criticality_t *)calloc(1, sizeof(F1AP_Criticality_t)); + *ie->value.choice.CriticalityDiagnostics.procedureCriticality = F1AP_Criticality_reject; + ie->value.choice.CriticalityDiagnostics.transactionID = (F1AP_TransactionID_t *)calloc(1, sizeof(F1AP_TransactionID_t)); + *ie->value.choice.CriticalityDiagnostics.transactionID = 0; + ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); + } + + /* encode */ + if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) { + printf("Failed to encode F1 setup request\n"); + return -1; + } + + printf("\n"); + + /* decode */ + // if (f1ap_decode_pdu(&pdu, buffer, len) > 0) { + // printf("Failed to decode F1 setup request\n"); + // } + f1ap_du_send_message(buffer, len); + +} + +void DU_send_UE_CONTEXT_MODIFICATION_FAILURE(F1AP_UEContextModificationFailure_t UEContextModificationFailure) { + AssertFatal(1==0,"Not implemented yet\n"); +} + +void DU_send_UE_CONTEXT_MODIFICATION_REQUIRED(F1AP_UEContextModificationRequired_t *UEContextModificationRequired) { + AssertFatal(1==0,"Not implemented yet\n"); +} + +void DU_handle_UE_CONTEXT_MODIFICATION_CONFIRM(F1AP_UEContextModificationConfirm_t UEContextModificationConfirm_t) { + AssertFatal(1==0,"Not implemented yet\n"); +} + + +static int F1AP_DU_decode_initiating_message(F1AP_InitiatingMessage_t *initiating_p) { + + switch (initiating_p->value.present) { + + case F1AP_InitiatingMessage__value_PR_NOTHING: /* No components present */ + AssertFatal(1==0,"Should not receive NOTHING on DU\n"); + break; + + case F1AP_InitiatingMessage__value_PR_Reset: + DU_handle_RESET(&initiating_p->value.choice.Reset); + break; + /*case F1AP_Initiatingpdu__value_PR_F1SetupRequest: + DU_send_F1_SETUP_REQUEST(&initiating_p->value.choice.F1SetupRequest); + break;*/ + case F1AP_InitiatingMessage__value_PR_GNBDUConfigurationUpdate: + AssertFatal(1==0,"Should not receive GNBDUConfigurationUpdate on DU\n"); + break; + case F1AP_InitiatingMessage__value_PR_GNBCUConfigurationUpdate: + DU_handle_gNB_CU_CONFIGURATION_UPDATE(&initiating_p->value.choice.GNBCUConfigurationUpdate); + break; + case F1AP_InitiatingMessage__value_PR_UEContextSetupRequest: + DU_handle_UE_CONTEXT_SETUP_REQUEST(&initiating_p->value.choice.UEContextSetupRequest); + break; + case F1AP_InitiatingMessage__value_PR_UEContextReleaseCommand: + DU_handle_UE_CONTEXT_RELEASE_COMMAND(&initiating_p->value.choice.UEContextReleaseCommand); + break; + case F1AP_InitiatingMessage__value_PR_UEContextModificationRequest: + DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(&initiating_p->value.choice.UEContextModificationRequest); + break; + case F1AP_InitiatingMessage__value_PR_UEContextModificationRequired: + AssertFatal(1==0,"Should not receive UECONTEXTMODIFICATIONREQUIRED on DU\n"); + break; + case F1AP_InitiatingMessage__value_PR_ErrorIndication: + AssertFatal(1==0,"Should not receive ErrorIndication on DU\n"); + break; + case F1AP_InitiatingMessage__value_PR_UEContextReleaseRequest: + AssertFatal(1==0,"Should not receive UECONTEXTRELEASEREQUEST on DU\n"); + break; + case F1AP_InitiatingMessage__value_PR_DLRRCMessageTransfer: + DU_handle_DL_RRC_Message_TRANSFER(&initiating_p->value.choice.DLRRCMessageTransfer); + break; + case F1AP_InitiatingMessage__value_PR_ULRRCMessageTransfer: + AssertFatal(1==0,"Should not receive ULRRCmessageTRANSFER on DU\n"); + break; + case F1AP_InitiatingMessage__value_PR_PrivateMessage: + AssertFatal(1==0,"Should not receive PRIVATEmessage on DU\n"); + break; + default: + AssertFatal(1==0,"Shouldn't get here\n"); + } + +} + +static int F1AP_DU_decode_successful_outcome(F1AP_SuccessfulOutcome_t *successfulOutcome_p) { + + switch (successfulOutcome_p->value.present) { + + case F1AP_SuccessfulOutcome__value_PR_NOTHING: /* No components present */ + AssertFatal(1==0,"Should not received NOTHING!\n"); + break; + case F1AP_SuccessfulOutcome__value_PR_ResetAcknowledge: + AssertFatal(1==0,"DU Should not receive ResetAcknowled!\n"); + break; + case F1AP_SuccessfulOutcome__value_PR_F1SetupResponse: + AssertFatal(1==0,"DU Should not receive F1SetupResponse!\n"); + break; + case F1AP_SuccessfulOutcome__value_PR_GNBDUConfigurationUpdateAcknowledge: + DU_handle_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(successfulOutcome_p->value.choice.GNBDUConfigurationUpdateAcknowledge); + break; + case F1AP_SuccessfulOutcome__value_PR_GNBCUConfigurationUpdateAcknowledge: + AssertFatal(1==0,"DU Should not receive GNBCUConfigurationUpdateAcknowledge!\n"); + break; + case F1AP_SuccessfulOutcome__value_PR_UEContextSetupResponse: + AssertFatal(1==0,"DU Should not receive UEContextSetupResponse!\n"); + break; + case F1AP_SuccessfulOutcome__value_PR_UEContextReleaseComplete: + AssertFatal(1==0,"DU Should not receive UEContextReleaseComplete!\n"); + break; + case F1AP_SuccessfulOutcome__value_PR_UEContextModificationResponse: + AssertFatal(1==0,"DU Should not receive UEContextModificationResponse!\n"); + break; + case F1AP_SuccessfulOutcome__value_PR_UEContextModificationConfirm: + DU_handle_UE_CONTEXT_MODIFICATION_CONFIRM(successfulOutcome_p->value.choice.UEContextModificationConfirm); + break; + } +} + +static int F1AP_DU_decode_unsuccessful_outcome(F1AP_UnsuccessfulOutcome_t *unSuccessfulOutcome_p) { + + switch (unSuccessfulOutcome_p->value.present) { + + case F1AP_UnsuccessfulOutcome__value_PR_NOTHING: + AssertFatal(1==0,"Should not receive NOTHING!\n"); + break; /* No components present */ + case F1AP_UnsuccessfulOutcome__value_PR_F1SetupFailure: + AssertFatal(1==0,"Should not receive F1SetupFailure\n"); + break; + case F1AP_UnsuccessfulOutcome__value_PR_GNBDUConfigurationUpdateFailure: + DU_handle_gNB_DU_CONFIGURATION_FAILURE(unSuccessfulOutcome_p->value.choice.GNBDUConfigurationUpdateFailure); + break; + case F1AP_UnsuccessfulOutcome__value_PR_GNBCUConfigurationUpdateFailure: + AssertFatal(1==0,"Should not receive GNBCUConfigurationUpdateFailure\n"); + break; + case F1AP_UnsuccessfulOutcome__value_PR_UEContextSetupFailure: + DU_send_UE_CONTEXT_SETUP_FAILURE(unSuccessfulOutcome_p->value.choice.UEContextSetupFailure); + break; + case F1AP_UnsuccessfulOutcome__value_PR_UEContextModificationFailure: + DU_send_UE_CONTEXT_MODIFICATION_FAILURE(unSuccessfulOutcome_p->value.choice.UEContextModificationFailure); + break; + } + +} + +static int F1AP_DU_encode_initiating_message(F1AP_InitiatingMessage_t *initiating_p) { + return -1; +} + +static int F1AP_DU_encode_successful_outcome(F1AP_SuccessfulOutcome_t *successfulOutcome_p) +{ + return -1; +} + +static int F1AP_DU_encode_unsuccessful_outcome(F1AP_UnsuccessfulOutcome_t *unSuccessfulOutcome_p) +{ + return -1; +} + +#define MAX_F1AP_BUFFER_SIZE 4096 + + +// or init function + +void DU_F1AP_init(void* args_p ) { + +} diff --git a/openair2/F1AP/MESSAGES/ASN1/R15.2.1/F1AP-CommonDataTypes.asn b/openair2/F1AP/MESSAGES/ASN1/R15.2.1/F1AP-CommonDataTypes.asn new file mode 100644 index 0000000000..12dfbd12ff --- /dev/null +++ b/openair2/F1AP/MESSAGES/ASN1/R15.2.1/F1AP-CommonDataTypes.asn @@ -0,0 +1,32 @@ +-- ************************************************************** +-- +-- Common definitions +-- +-- ************************************************************** + +F1AP-CommonDataTypes { +itu-t (0) identified-organization (4) etsi (0) mobileDomain (0) +ngran-access (22) modules (3) f1ap (3) version1 (1) f1ap-CommonDataTypes (3) } + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +Criticality ::= ENUMERATED { reject, ignore, notify } + +Presence ::= ENUMERATED { optional, conditional, mandatory } + +PrivateIE-ID ::= CHOICE { + local INTEGER (0..65535), + global OBJECT IDENTIFIER +} + +ProcedureCode ::= INTEGER (0..255) + +ProtocolExtensionID ::= INTEGER (0..65535) + +ProtocolIE-ID ::= INTEGER (0..65535) + +TriggeringMessage ::= ENUMERATED { initiating-message, successful-outcome, unsuccessfull-outcome } + +END diff --git a/openair2/F1AP/MESSAGES/ASN1/R15.2.1/F1AP-Constants.asn b/openair2/F1AP/MESSAGES/ASN1/R15.2.1/F1AP-Constants.asn new file mode 100644 index 0000000000..de34aa8f43 --- /dev/null +++ b/openair2/F1AP/MESSAGES/ASN1/R15.2.1/F1AP-Constants.asn @@ -0,0 +1,256 @@ +-- ************************************************************** +-- +-- Constant definitions +-- +-- ************************************************************** + +F1AP-Constants { +itu-t (0) identified-organization (4) etsi (0) mobileDomain (0) +ngran-access (22) modules (3) f1ap (3) version1 (1) f1ap-Constants (4) } + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +-- ************************************************************** +-- +-- IE parameter types from other modules. +-- +-- ************************************************************** + +IMPORTS + ProcedureCode, + ProtocolIE-ID + +FROM F1AP-CommonDataTypes; + + +-- ************************************************************** +-- +-- Elementary Procedures +-- +-- ************************************************************** + +id-Reset ProcedureCode ::= 0 +id-F1Setup ProcedureCode ::= 1 +id-ErrorIndication ProcedureCode ::= 2 +id-gNBDUConfigurationUpdate ProcedureCode ::= 3 +id-gNBCUConfigurationUpdate ProcedureCode ::= 4 +id-UEContextSetup ProcedureCode ::= 5 +id-UEContextRelease ProcedureCode ::= 6 +id-UEContextModification ProcedureCode ::= 7 +id-UEContextModificationRequired ProcedureCode ::= 8 +id-UEMobilityCommand ProcedureCode ::= 9 +id-UEContextReleaseRequest ProcedureCode ::= 10 +id-InitialULRRCMessageTransfer ProcedureCode ::= 11 +id-DLRRCMessageTransfer ProcedureCode ::= 12 +id-ULRRCMessageTransfer ProcedureCode ::= 13 +id-privateMessage ProcedureCode ::= 14 +id-UEInactivityNotification ProcedureCode ::= 15 +id-GNBDUResourceCoordination ProcedureCode ::= 16 +id-SystemInformationDeliveryCommand ProcedureCode ::= 17 +id-Paging ProcedureCode ::= 18 +id-Notify ProcedureCode ::= 19 +id-WriteReplaceWarning ProcedureCode ::= 20 +id-PWSCancel ProcedureCode ::= 21 +id-PWSRestartIndication ProcedureCode ::= 22 +id-PWSFailureIndication ProcedureCode ::= 23 + +-- ************************************************************** +-- +-- Extension constants +-- +-- ************************************************************** + +maxPrivateIEs INTEGER ::= 65535 +maxProtocolExtensions INTEGER ::= 65535 +maxProtocolIEs INTEGER ::= 65535 +-- ************************************************************** +-- +-- Lists +-- +-- ************************************************************** + +maxNRARFCN INTEGER ::= 3279165 +maxnoofErrors INTEGER ::= 256 +maxnoofIndividualF1ConnectionsToReset INTEGER ::= 65536 +maxCellingNBDU INTEGER ::= 512 +maxnoofSCells INTEGER ::= 32 +maxnoofSRBs INTEGER ::= 8 +maxnoofDRBs INTEGER ::= 64 +maxnoofULUPTNLInformation INTEGER ::= 2 +maxnoofDLUPTNLInformation INTEGER ::= 2 +maxnoofBPLMNs INTEGER ::= 6 +maxnoofCandidateSpCells INTEGER ::= 64 +maxnoofPotentialSpCells INTEGER ::= 64 +maxnoofNrCellBands INTEGER ::= 32 +maxnoofSIBTypes INTEGER ::= 16 +maxnoofPagingCells INTEGER ::= 512 +maxnoofTNLAssociations INTEGER ::= 32 +maxnoofQoSFlows INTEGER ::= 64 +maxnoofSliceItems INTEGER ::= 1024 +maxCellineNB INTEGER ::= 256 + + +-- ************************************************************** +-- +-- IEs +-- +-- ************************************************************** + +id-Cause ProtocolIE-ID ::= 0 +id-Cells-Failed-to-be-Activated-List ProtocolIE-ID ::= 1 +id-Cells-Failed-to-be-Activated-List-Item ProtocolIE-ID ::= 2 +id-Cells-to-be-Activated-List ProtocolIE-ID ::= 3 +id-Cells-to-be-Activated-List-Item ProtocolIE-ID ::= 4 +id-Cells-to-be-Deactivated-List ProtocolIE-ID ::= 5 +id-Cells-to-be-Deactivated-List-Item ProtocolIE-ID ::= 6 +id-CriticalityDiagnostics ProtocolIE-ID ::= 7 +id-CUtoDURRCInformation ProtocolIE-ID ::= 9 +id-DRBs-FailedToBeModified-Item ProtocolIE-ID ::= 12 +id-DRBs-FailedToBeModified-List ProtocolIE-ID ::= 13 +id-DRBs-FailedToBeSetup-Item ProtocolIE-ID ::= 14 +id-DRBs-FailedToBeSetup-List ProtocolIE-ID ::= 15 +id-DRBs-FailedToBeSetupMod-Item ProtocolIE-ID ::= 16 +id-DRBs-FailedToBeSetupMod-List ProtocolIE-ID ::= 17 +id-DRBs-ModifiedConf-Item ProtocolIE-ID ::= 18 +id-DRBs-ModifiedConf-List ProtocolIE-ID ::= 19 +id-DRBs-Modified-Item ProtocolIE-ID ::= 20 +id-DRBs-Modified-List ProtocolIE-ID ::= 21 +id-DRBs-Required-ToBeModified-Item ProtocolIE-ID ::= 22 +id-DRBs-Required-ToBeModified-List ProtocolIE-ID ::= 23 +id-DRBs-Required-ToBeReleased-Item ProtocolIE-ID ::= 24 +id-DRBs-Required-ToBeReleased-List ProtocolIE-ID ::= 25 +id-DRBs-Setup-Item ProtocolIE-ID ::= 26 +id-DRBs-Setup-List ProtocolIE-ID ::= 27 +id-DRBs-SetupMod-Item ProtocolIE-ID ::= 28 +id-DRBs-SetupMod-List ProtocolIE-ID ::= 29 +id-DRBs-ToBeModified-Item ProtocolIE-ID ::= 30 +id-DRBs-ToBeModified-List ProtocolIE-ID ::= 31 +id-DRBs-ToBeReleased-Item ProtocolIE-ID ::= 32 +id-DRBs-ToBeReleased-List ProtocolIE-ID ::= 33 +id-DRBs-ToBeSetup-Item ProtocolIE-ID ::= 34 +id-DRBs-ToBeSetup-List ProtocolIE-ID ::= 35 +id-DRBs-ToBeSetupMod-Item ProtocolIE-ID ::= 36 +id-DRBs-ToBeSetupMod-List ProtocolIE-ID ::= 37 +id-DRXCycle ProtocolIE-ID ::= 38 +id-DUtoCURRCInformation ProtocolIE-ID ::= 39 +id-gNB-CU-UE-F1AP-ID ProtocolIE-ID ::= 40 +id-gNB-DU-UE-F1AP-ID ProtocolIE-ID ::= 41 +id-gNB-DU-ID ProtocolIE-ID ::= 42 +id-GNB-DU-Served-Cells-Item ProtocolIE-ID ::= 43 +id-gNB-DU-Served-Cells-List ProtocolIE-ID ::= 44 +id-gNB-DU-Name ProtocolIE-ID ::= 45 +id-NRCellID ProtocolIE-ID ::= 46 +id-oldgNB-DU-UE-F1AP-ID ProtocolIE-ID ::= 47 +id-ResetType ProtocolIE-ID ::= 48 +id-ResourceCoordinationTransferContainer ProtocolIE-ID ::= 49 +id-RRCContainer ProtocolIE-ID ::= 50 +id-SCell-ToBeRemoved-Item ProtocolIE-ID ::= 51 +id-SCell-ToBeRemoved-List ProtocolIE-ID ::= 52 +id-SCell-ToBeSetup-Item ProtocolIE-ID ::= 53 +id-SCell-ToBeSetup-List ProtocolIE-ID ::= 54 +id-SCell-ToBeSetupMod-Item ProtocolIE-ID ::= 55 +id-SCell-ToBeSetupMod-List ProtocolIE-ID ::= 56 +id-Served-Cells-To-Add-Item ProtocolIE-ID ::= 57 +id-Served-Cells-To-Add-List ProtocolIE-ID ::= 58 +id-Served-Cells-To-Delete-Item ProtocolIE-ID ::= 59 +id-Served-Cells-To-Delete-List ProtocolIE-ID ::= 60 +id-Served-Cells-To-Modify-Item ProtocolIE-ID ::= 61 +id-Served-Cells-To-Modify-List ProtocolIE-ID ::= 62 +id-SpCell-ID ProtocolIE-ID ::= 63 +id-SRBID ProtocolIE-ID ::= 64 +id-SRBs-FailedToBeSetup-Item ProtocolIE-ID ::= 65 +id-SRBs-FailedToBeSetup-List ProtocolIE-ID ::= 66 +id-SRBs-FailedToBeSetupMod-Item ProtocolIE-ID ::= 67 +id-SRBs-FailedToBeSetupMod-List ProtocolIE-ID ::= 68 +id-SRBs-Required-ToBeReleased-Item ProtocolIE-ID ::= 69 +id-SRBs-Required-ToBeReleased-List ProtocolIE-ID ::= 70 +id-SRBs-ToBeReleased-Item ProtocolIE-ID ::= 71 +id-SRBs-ToBeReleased-List ProtocolIE-ID ::= 72 +id-SRBs-ToBeSetup-Item ProtocolIE-ID ::= 73 +id-SRBs-ToBeSetup-List ProtocolIE-ID ::= 74 +id-SRBs-ToBeSetupMod-Item ProtocolIE-ID ::= 75 +id-SRBs-ToBeSetupMod-List ProtocolIE-ID ::= 76 +id-TimeToWait ProtocolIE-ID ::= 77 +id-TransactionID ProtocolIE-ID ::= 78 +id-TransmissionStopIndicator ProtocolIE-ID ::= 79 +id-UE-associatedLogicalF1-ConnectionItem ProtocolIE-ID ::= 80 +id-UE-associatedLogicalF1-ConnectionListResAck ProtocolIE-ID ::= 81 +id-gNB-CU-Name ProtocolIE-ID ::= 82 +id-SCell-FailedtoSetup-List ProtocolIE-ID ::= 83 +id-SCell-FailedtoSetup-Item ProtocolIE-ID ::= 84 +id-SCell-FailedtoSetupMod-List ProtocolIE-ID ::= 85 +id-SCell-FailedtoSetupMod-Item ProtocolIE-ID ::= 86 +id-RRCRconfigurationCompleteIndicator ProtocolIE-ID ::= 87 +id-Active-Cells-Item ProtocolIE-ID ::= 88 +id-Active-Cells-List ProtocolIE-ID ::= 89 +id-Candidate-SpCell-List ProtocolIE-ID ::= 90 +id-Candidate-SpCell-Item ProtocolIE-ID ::= 91 +id-Potential-SpCell-List ProtocolIE-ID ::= 92 +id-Potential-SpCell-Item ProtocolIE-ID ::= 93 +id-FullConfiguration ProtocolIE-ID ::= 94 +id-C-RNTI ProtocolIE-ID ::= 95 +id-SpCellULConfigured ProtocolIE-ID ::= 96 +id-InactivityMonitoringRequest ProtocolIE-ID ::= 97 +id-InactivityMonitoringResponse ProtocolIE-ID ::= 98 +id-DRB-Activity-Item ProtocolIE-ID ::= 99 +id-DRB-Activity-List ProtocolIE-ID ::= 100 +id-EUTRA-NR-CellResourceCoordinationReq-Container ProtocolIE-ID ::= 101 +id-EUTRA-NR-CellResourceCoordinationReqAck-Container ProtocolIE-ID ::= 102 +id-SpectrumSharingGroupID ProtocolIE-ID ::= 103 +id-ListofEUTRACellsinGNBDUCoordination ProtocolIE-ID ::= 104 +id-Protected-EUTRA-Resources-List ProtocolIE-ID ::= 105 +id-RequestType ProtocolIE-ID ::= 106 +id-ServCellndex ProtocolIE-ID ::= 107 +id-RAT-FrequencyPriorityInformation ProtocolIE-ID ::= 108 +id-ExecuteDuplication ProtocolIE-ID ::= 109 +id-NRCGI ProtocolIE-ID ::= 111 +id-PagingCell-Item ProtocolIE-ID ::= 112 +id-PagingCell-List ProtocolIE-ID ::= 113 +id-PagingDRX ProtocolIE-ID ::= 114 +id-PagingPriority ProtocolIE-ID ::= 115 +id-SIBtype-List ProtocolIE-ID ::= 116 +id-UEIdentityIndexValue ProtocolIE-ID ::= 117 +id-gNB-CUSystemInformation ProtocolIE-ID ::= 118 +id-HandoverPreparationInformation ProtocolIE-ID ::= 119 +id-GNB-CU-TNL-Association-To-Add-Item ProtocolIE-ID ::= 120 +id-GNB-CU-TNL-Association-To-Add-List ProtocolIE-ID ::= 121 +id-GNB-CU-TNL-Association-To-Remove-Item ProtocolIE-ID ::= 122 +id-GNB-CU-TNL-Association-To-Remove-List ProtocolIE-ID ::= 123 +id-GNB-CU-TNL-Association-To-Update-Item ProtocolIE-ID ::= 124 +id-GNB-CU-TNL-Association-To-Update-List ProtocolIE-ID ::= 125 +id-MaskedIMEISV ProtocolIE-ID ::= 126 +id-PagingIdentity ProtocolIE-ID ::= 127 +id-DUtoCURRCContainer ProtocolIE-ID ::= 128 +id-Cells-to-be-Barred-List ProtocolIE-ID ::= 129 +id-Cells-to-be-Barred-Item ProtocolIE-ID ::= 130 +id-TAISliceSupportList ProtocolIE-ID ::= 131 +id-GNB-CU-TNL-Association-Setup-List ProtocolIE-ID ::= 132 +id-GNB-CU-TNL-Association-Setup-Item ProtocolIE-ID ::= 133 +id-GNB-CU-TNL-Association-Failed-To-Setup-List ProtocolIE-ID ::= 134 +id-GNB-CU-TNL-Association-Failed-To-Setup-Item ProtocolIE-ID ::= 135 +id-DRB-Notify-Item ProtocolIE-ID ::= 136 +id-DRB-Notify-List ProtocolIE-ID ::= 137 +id-NotficationControl ProtocolIE-ID ::= 138 +id-RANAC ProtocolIE-ID ::= 139 +id-PWSSystemInformation ProtocolIE-ID ::= 140 +id-RepetitionPeriod ProtocolIE-ID ::= 141 +id-NumberofBroadcastRequest ProtocolIE-ID ::= 142 +id-ConcurrentWarningMessageIndicator ProtocolIE-ID ::= 143 +id-Cells-To-Be-Broadcast-List ProtocolIE-ID ::= 144 +id-Cells-To-Be-Broadcast-Item ProtocolIE-ID ::= 145 +id-Cells-Broadcast-Completed-List ProtocolIE-ID ::= 146 +id-Cells-Broadcast-Completed-Item ProtocolIE-ID ::= 147 +id-Broadcast-To-Be-Cancelled-List ProtocolIE-ID ::= 148 +id-Broadcast-To-Be-Cancelled-Item ProtocolIE-ID ::= 149 +id-Cells-Broadcast-Cancelled-List ProtocolIE-ID ::= 150 +id-Cells-Broadcast-Cancelled-Item ProtocolIE-ID ::= 151 +id-NR-CGI-List-For-Restart-List ProtocolIE-ID ::= 152 +id-NR-CGI-List-For-Restart-Item ProtocolIE-ID ::= 153 +id-PWS-Failed-NR-CGI-List ProtocolIE-ID ::= 154 +id-PWS-Failed-NR-CGI-Item ProtocolIE-ID ::= 155 +id-ConfirmedUEID ProtocolIE-ID ::= 156 +id-Cancel-all-Warning-Messages-Indicator ProtocolIE-ID ::= 157 + +END diff --git a/openair2/F1AP/MESSAGES/ASN1/R15.2.1/F1AP-Containers.asn b/openair2/F1AP/MESSAGES/ASN1/R15.2.1/F1AP-Containers.asn new file mode 100644 index 0000000000..ed5dfba961 --- /dev/null +++ b/openair2/F1AP/MESSAGES/ASN1/R15.2.1/F1AP-Containers.asn @@ -0,0 +1,184 @@ +-- ************************************************************** +-- +-- Container definitions +-- +-- ************************************************************** + +F1AP-Containers { +itu-t (0) identified-organization (4) etsi (0) mobileDomain (0) +ngran-access (22) modules (3) f1ap (3) version1 (1) f1ap-Containers (5) } + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +-- ************************************************************** +-- +-- IE parameter types from other modules. +-- +-- ************************************************************** + +IMPORTS + Criticality, + Presence, + PrivateIE-ID, + ProtocolExtensionID, + ProtocolIE-ID + +FROM F1AP-CommonDataTypes + maxPrivateIEs, + maxProtocolExtensions, + maxProtocolIEs + +FROM F1AP-Constants; + +-- ************************************************************** +-- +-- Class Definition for Protocol IEs +-- +-- ************************************************************** + +F1AP-PROTOCOL-IES ::= CLASS { + &id ProtocolIE-ID UNIQUE, + &criticality Criticality, + &Value, + &presence Presence +} +WITH SYNTAX { + ID &id + CRITICALITY &criticality + TYPE &Value + PRESENCE &presence +} + +-- ************************************************************** +-- +-- Class Definition for Protocol IEs +-- +-- ************************************************************** + +F1AP-PROTOCOL-IES-PAIR ::= CLASS { + &id ProtocolIE-ID UNIQUE, + &firstCriticality Criticality, + &FirstValue, + &secondCriticality Criticality, + &SecondValue, + &presence Presence +} +WITH SYNTAX { + ID &id + FIRST CRITICALITY &firstCriticality + FIRST TYPE &FirstValue + SECOND CRITICALITY &secondCriticality + SECOND TYPE &SecondValue + PRESENCE &presence +} + +-- ************************************************************** +-- +-- Class Definition for Protocol Extensions +-- +-- ************************************************************** + +F1AP-PROTOCOL-EXTENSION ::= CLASS { + &id ProtocolExtensionID UNIQUE, + &criticality Criticality, + &Extension, + &presence Presence +} +WITH SYNTAX { + ID &id + CRITICALITY &criticality + EXTENSION &Extension + PRESENCE &presence +} + +-- ************************************************************** +-- +-- Class Definition for Private IEs +-- +-- ************************************************************** + +F1AP-PRIVATE-IES ::= CLASS { + &id PrivateIE-ID, + &criticality Criticality, + &Value, + &presence Presence +} +WITH SYNTAX { + ID &id + CRITICALITY &criticality + TYPE &Value + PRESENCE &presence +} + +-- ************************************************************** +-- +-- Container for Protocol IEs +-- +-- ************************************************************** + +ProtocolIE-Container {F1AP-PROTOCOL-IES : IEsSetParam} ::= + SEQUENCE (SIZE (0..maxProtocolIEs)) OF + ProtocolIE-Field {{IEsSetParam}} + +ProtocolIE-SingleContainer {F1AP-PROTOCOL-IES : IEsSetParam} ::= + ProtocolIE-Field {{IEsSetParam}} + +ProtocolIE-Field {F1AP-PROTOCOL-IES : IEsSetParam} ::= SEQUENCE { + id F1AP-PROTOCOL-IES.&id ({IEsSetParam}), + criticality F1AP-PROTOCOL-IES.&criticality ({IEsSetParam}{@id}), + value F1AP-PROTOCOL-IES.&Value ({IEsSetParam}{@id}) +} + +-- ************************************************************** +-- +-- Container for Protocol IE Pairs +-- +-- ************************************************************** + +ProtocolIE-ContainerPair {F1AP-PROTOCOL-IES-PAIR : IEsSetParam} ::= + SEQUENCE (SIZE (0..maxProtocolIEs)) OF + ProtocolIE-FieldPair {{IEsSetParam}} + +ProtocolIE-FieldPair {F1AP-PROTOCOL-IES-PAIR : IEsSetParam} ::= SEQUENCE { + id F1AP-PROTOCOL-IES-PAIR.&id ({IEsSetParam}), + firstCriticality F1AP-PROTOCOL-IES-PAIR.&firstCriticality ({IEsSetParam}{@id}), + firstValue F1AP-PROTOCOL-IES-PAIR.&FirstValue ({IEsSetParam}{@id}), + secondCriticality F1AP-PROTOCOL-IES-PAIR.&secondCriticality ({IEsSetParam}{@id}), + secondValue F1AP-PROTOCOL-IES-PAIR.&SecondValue ({IEsSetParam}{@id}) +} + +-- ************************************************************** +-- +-- Container for Protocol Extensions +-- +-- ************************************************************** + +ProtocolExtensionContainer {F1AP-PROTOCOL-EXTENSION : ExtensionSetParam} ::= + SEQUENCE (SIZE (1..maxProtocolExtensions)) OF + ProtocolExtensionField {{ExtensionSetParam}} + +ProtocolExtensionField {F1AP-PROTOCOL-EXTENSION : ExtensionSetParam} ::= SEQUENCE { + id F1AP-PROTOCOL-EXTENSION.&id ({ExtensionSetParam}), + criticality F1AP-PROTOCOL-EXTENSION.&criticality ({ExtensionSetParam}{@id}), + extensionValue F1AP-PROTOCOL-EXTENSION.&Extension ({ExtensionSetParam}{@id}) +} + +-- ************************************************************** +-- +-- Container for Private IEs +-- +-- ************************************************************** + +PrivateIE-Container {F1AP-PRIVATE-IES : IEsSetParam } ::= + SEQUENCE (SIZE (1.. maxPrivateIEs)) OF + PrivateIE-Field {{IEsSetParam}} + +PrivateIE-Field {F1AP-PRIVATE-IES : IEsSetParam} ::= SEQUENCE { + id F1AP-PRIVATE-IES.&id ({IEsSetParam}), + criticality F1AP-PRIVATE-IES.&criticality ({IEsSetParam}{@id}), + value F1AP-PRIVATE-IES.&Value ({IEsSetParam}{@id}) +} + +END diff --git a/openair2/F1AP/MESSAGES/ASN1/R15.2.1/F1AP-IEs.asn b/openair2/F1AP/MESSAGES/ASN1/R15.2.1/F1AP-IEs.asn new file mode 100644 index 0000000000..aa92b8d3f8 --- /dev/null +++ b/openair2/F1AP/MESSAGES/ASN1/R15.2.1/F1AP-IEs.asn @@ -0,0 +1,1441 @@ +-- ************************************************************** +-- +-- Information Element Definitions +-- +-- ************************************************************** + +F1AP-IEs { +itu-t (0) identified-organization (4) etsi (0) mobileDomain (0) +ngran-access (22) modules (3) f1ap (3) version1 (1) f1ap-IEs (2) } + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +IMPORTS + id-gNB-CUSystemInformation, + id-HandoverPreparationInformation, + id-TAISliceSupportList, + id-RANAC, + maxNRARFCN, + maxnoofErrors, + maxnoofBPLMNs, + maxnoofDLUPTNLInformation, + maxnoofNrCellBands, + maxnoofULUPTNLInformation, + maxnoofQoSFlows, + maxnoofSliceItems, + maxnoofSIBTypes, + maxCellineNB + +FROM F1AP-Constants + + Criticality, + ProcedureCode, + ProtocolIE-ID, + TriggeringMessage + +FROM F1AP-CommonDataTypes + + ProtocolExtensionContainer{}, + F1AP-PROTOCOL-EXTENSION, + ProtocolIE-SingleContainer{}, + F1AP-PROTOCOL-IES + +FROM F1AP-Containers; + +-- A + +Active-Cells-Item ::= SEQUENCE { + nRCGI NRCGI , + iE-Extensions ProtocolExtensionContainer { { Active-Cells-ItemExtIEs } } OPTIONAL, + ... +} + +Active-Cells-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + + +AllocationAndRetentionPriority ::= SEQUENCE { + priorityLevel PriorityLevel, + pre-emptionCapability Pre-emptionCapability, + pre-emptionVulnerability Pre-emptionVulnerability, + iE-Extensions ProtocolExtensionContainer { {AllocationAndRetentionPriority-ExtIEs} } OPTIONAL, + ... +} + +AllocationAndRetentionPriority-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} +AveragingWindow ::= INTEGER (0..63) -- this IE may need to be refined + +-- B + +BitRate ::= INTEGER (0..4000000000000,...) + +BroadcastPLMNs-List ::= SEQUENCE (SIZE(1..maxnoofBPLMNs)) OF BroadcastPLMNs-Item + +BroadcastPLMNs-Item ::= SEQUENCE { + pLMN-Identity PLMN-Identity, + iE-Extensions ProtocolExtensionContainer { { BroadcastPLMNs-ItemExtIEs} } OPTIONAL, + ... +} + +BroadcastPLMNs-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { +{ ID id-TAISliceSupportList CRITICALITY ignore EXTENSION SliceSupportList PRESENCE optional }, + ... +} + + +-- C + +Cancel-all-Warning-Messages-Indicator ::= ENUMERATED {true, ...} + +Candidate-SpCell-Item ::= SEQUENCE { + candidate-SpCell-ID NRCGI , + iE-Extensions ProtocolExtensionContainer { { Candidate-SpCell-ItemExtIEs } } OPTIONAL, + ... +} + +Candidate-SpCell-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +Cause ::= CHOICE { + radioNetwork CauseRadioNetwork, + transport CauseTransport, + protocol CauseProtocol, + misc CauseMisc, + ... +} + +CauseMisc ::= ENUMERATED { + control-processing-overload, + not-enough-user-plane-processing-resources, + hardware-failure, + om-intervention, + unspecified, +... +} + +CauseProtocol ::= ENUMERATED { + transfer-syntax-error, + abstract-syntax-error-reject, + abstract-syntax-error-ignore-and-notify, + message-not-compatible-with-receiver-state, + semantic-error, + abstract-syntax-error-falsely-constructed-message, + unspecified, + ... +} + +CauseRadioNetwork ::= ENUMERATED { + unspecified, + rl-failure, + unknown-or-already-allocated-gnb-cu-ue-f1ap-id, + unknown-or-already-allocated-gnd-du-ue-f1ap-id, + unknown-or-inconsistent-pair-of-ue-f1ap-id, + interaction-with-other-procedure, + not-supported-qci-Value, + action-desirable-for-radio-reasons, + no-radio-resources-available, + procedure-cancelled, + normal-release, + ... +} + +CauseTransport ::= ENUMERATED { + unspecified, + transport-resource-unavailable, + ... +} + + + +CellGroupConfig ::= OCTET STRING + +Cells-Failed-to-be-Activated-List-Item ::= SEQUENCE { + nRCGI NRCGI, + cause Cause, + iE-Extensions ProtocolExtensionContainer { { Cells-Failed-to-be-Activated-List-ItemExtIEs } } OPTIONAL, + ... +} + +Cells-Failed-to-be-Activated-List-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +Cells-To-Be-Broadcast-Item ::= SEQUENCE { + nRCGI NRCGI, + iE-Extensions ProtocolExtensionContainer { { Cells-To-Be-Broadcast-ItemExtIEs } } OPTIONAL, + ... +} + +Cells-To-Be-Broadcast-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +Cells-Broadcast-Completed-Item ::= SEQUENCE { + nRCGI NRCGI, + iE-Extensions ProtocolExtensionContainer { { Cells-Broadcast-Completed-ItemExtIEs } } OPTIONAL, + ... +} + +Cells-Broadcast-Completed-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +Broadcast-To-Be-Cancelled-Item ::= SEQUENCE { + nRCGI NRCGI, + iE-Extensions ProtocolExtensionContainer { { Broadcast-To-Be-Cancelled-ItemExtIEs } } OPTIONAL, + ... +} + +Broadcast-To-Be-Cancelled-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + + +Cells-Broadcast-Cancelled-Item ::= SEQUENCE { + nRCGI NRCGI, + numberOfBroadcasts NumberOfBroadcasts, + iE-Extensions ProtocolExtensionContainer { { Cells-Broadcast-Cancelled-ItemExtIEs } } OPTIONAL, + ... +} + +Cells-Broadcast-Cancelled-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +Cells-to-be-Activated-List-Item ::= SEQUENCE { + nRCGI NRCGI, + nRPCI NRPCI OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { Cells-to-be-Activated-List-ItemExtIEs} } OPTIONAL, + ... +} + +Cells-to-be-Activated-List-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { +{ ID id-gNB-CUSystemInformation CRITICALITY reject EXTENSION GNB-CUSystemInformation PRESENCE optional }, + ... +} + +Cells-to-be-Deactivated-List-Item ::= SEQUENCE { + nRCGI NRCGI , + iE-Extensions ProtocolExtensionContainer { { Cells-to-be-Deactivated-List-ItemExtIEs } } OPTIONAL, + ... +} + +Cells-to-be-Deactivated-List-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +Cells-to-be-Barred-Item::= SEQUENCE { + nRCGI NRCGI , + cellBarred CellBarred, + iE-Extensions ProtocolExtensionContainer { { Cells-to-be-Barred-Item-ExtIEs } } OPTIONAL +} + +Cells-to-be-Barred-Item-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +CellBarred ::= ENUMERATED {barred, not-barred, ...} + +CellULConfigured ::= ENUMERATED {none, ul, sul, ul-and-sul, ...} + +CNUEPagingIdentity ::= CHOICE { + fiveG-S-TMSI BIT STRING (SIZE(48)), + choice-extension ProtocolExtensionContainer { { CNUEPagingIdentity-ExtIEs } }, + ... +} + +CNUEPagingIdentity-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + + +ConcurrentWarningMessageIndicator ::= ENUMERATED {true, ...} + +CP-TransportLayerAddress ::= CHOICE { + endpoint-IP-address TransportLayerAddress, + endpoint-IP-address-and-port Endpoint-IP-address-and-port, + choice-extension ProtocolExtensionContainer { { CP-TransportLayerAddress-ExtIEs } }, + ... +} + +CP-TransportLayerAddress-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +CriticalityDiagnostics ::= SEQUENCE { + procedureCode ProcedureCode OPTIONAL, + triggeringMessage TriggeringMessage OPTIONAL, + procedureCriticality Criticality OPTIONAL, + transactionID TransactionID OPTIONAL, + iEsCriticalityDiagnostics CriticalityDiagnostics-IE-List OPTIONAL, + iE-Extensions ProtocolExtensionContainer {{CriticalityDiagnostics-ExtIEs}} OPTIONAL, + ... +} + +CriticalityDiagnostics-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +CriticalityDiagnostics-IE-List ::= SEQUENCE (SIZE (1.. maxnoofErrors)) OF CriticalityDiagnostics-IE-Item + +CriticalityDiagnostics-IE-Item ::= SEQUENCE { + iECriticality Criticality, + iE-ID ProtocolIE-ID, + typeOfError TypeOfError, + iE-Extensions ProtocolExtensionContainer {{CriticalityDiagnostics-IE-Item-ExtIEs}} OPTIONAL, + ... +} + +CriticalityDiagnostics-IE-Item-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +C-RNTI ::= BIT STRING (SIZE (16)) + +CUtoDURRCInformation ::= SEQUENCE { + cG-ConfigInfo CG-ConfigInfo OPTIONAL, + uE-CapabilityRAT-ContainerList UE-CapabilityRAT-ContainerList OPTIONAL, + measConfig MeasConfig OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { CUtoDURRCInformation-ExtIEs} } OPTIONAL, + ... +} + +CUtoDURRCInformation-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { +{ ID id-HandoverPreparationInformation CRITICALITY ignore EXTENSION HandoverPreparationInformation PRESENCE optional }, + ... +} + +-- D + +DLUPTNLInformation-ToBeSetup-List ::= SEQUENCE (SIZE(1..maxnoofDLUPTNLInformation)) OF DLUPTNLInformation-ToBeSetup-Item + +DLUPTNLInformation-ToBeSetup-Item ::= SEQUENCE { + dLUPTNLInformation UPTransportLayerInformation , + iE-Extensions ProtocolExtensionContainer { { DLUPTNLInformation-ToBeSetup-ItemExtIEs } } OPTIONAL, + ... +} + +DLUPTNLInformation-ToBeSetup-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +DRB-Activity-Item ::= SEQUENCE { + dRBID DRBID, + dRB-Activity DRB-Activity OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { DRB-Activity-ItemExtIEs } } OPTIONAL, + ... +} + +DRB-Activity-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +DRB-Activity ::= ENUMERATED {active, not-active} + +DRBID ::= INTEGER (1..32, ...) + +DRBs-FailedToBeModified-Item ::= SEQUENCE { + dRBID DRBID , + cause Cause OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { DRBs-FailedToBeModified-ItemExtIEs } } OPTIONAL, + ... +} + +DRBs-FailedToBeModified-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +DRBs-FailedToBeSetup-Item ::= SEQUENCE { + dRBID DRBID, + cause Cause OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { DRBs-FailedToBeSetup-ItemExtIEs } } OPTIONAL, + ... +} + +DRBs-FailedToBeSetup-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + + +DRBs-FailedToBeSetupMod-Item ::= SEQUENCE { + dRBID DRBID , + cause Cause OPTIONAL , + iE-Extensions ProtocolExtensionContainer { { DRBs-FailedToBeSetupMod-ItemExtIEs } } OPTIONAL, + ... +} + +DRBs-FailedToBeSetupMod-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +DRB-Information ::= SEQUENCE { + dRB-QoS QoSFlowLevelQoSParameters, + sNSSAI SNSSAI, + notificationControl NotificationControl OPTIONAL, + flows-Mapped-To-DRB-List Flows-Mapped-To-DRB-List, + iE-Extensions ProtocolExtensionContainer { { DRB-Information-ItemExtIEs } } OPTIONAL +} + +DRB-Information-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +DRBs-Modified-Item ::= SEQUENCE { + dRBID DRBID, + lCID LCID OPTIONAL, + dLUPTNLInformation-ToBeSetup-List DLUPTNLInformation-ToBeSetup-List, + iE-Extensions ProtocolExtensionContainer { { DRBs-Modified-ItemExtIEs } } OPTIONAL, + ... +} + +DRBs-Modified-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +DRBs-ModifiedConf-Item ::= SEQUENCE { + dRBID DRBID, + uLUPTNLInformation-ToBeSetup-List ULUPTNLInformation-ToBeSetup-List , + iE-Extensions ProtocolExtensionContainer { { DRBs-ModifiedConf-ItemExtIEs } } OPTIONAL, + ... +} + +DRBs-ModifiedConf-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +DRB-Notify-Item ::= SEQUENCE { + dRBID DRBID, + notification-Cause Notification-Cause, + iE-Extensions ProtocolExtensionContainer { { DRB-Notify-ItemExtIEs } } OPTIONAL, + ... +} + +DRB-Notify-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +DRBs-Required-ToBeModified-Item ::= SEQUENCE { + dRBID DRBID, + dLUPTNLInformation-ToBeSetup-List DLUPTNLInformation-ToBeSetup-List , + iE-Extensions ProtocolExtensionContainer { { DRBs-Required-ToBeModified-ItemExtIEs } } OPTIONAL, + ... +} + +DRBs-Required-ToBeModified-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +DRBs-Required-ToBeReleased-Item ::= SEQUENCE { + dRBID DRBID, + iE-Extensions ProtocolExtensionContainer { { DRBs-Required-ToBeReleased-ItemExtIEs } } OPTIONAL, + ... +} + +DRBs-Required-ToBeReleased-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +DRBs-Setup-Item ::= SEQUENCE { + dRBID DRBID, + lCID LCID OPTIONAL, + dLUPTNLInformation-ToBeSetup-List DLUPTNLInformation-ToBeSetup-List , + iE-Extensions ProtocolExtensionContainer { { DRBs-Setup-ItemExtIEs } } OPTIONAL, + ... +} + +DRBs-Setup-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +DRBs-SetupMod-Item ::= SEQUENCE { + dRBID DRBID, + lCID LCID OPTIONAL, + dLUPTNLInformation-ToBeSetup-List DLUPTNLInformation-ToBeSetup-List , + iE-Extensions ProtocolExtensionContainer { { DRBs-SetupMod-ItemExtIEs } } OPTIONAL, + ... +} + +DRBs-SetupMod-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + + +DRBs-ToBeModified-Item ::= SEQUENCE { + dRBID DRBID, + qoSInformation QoSInformation, + uLUPTNLInformation-ToBeSetup-List ULUPTNLInformation-ToBeSetup-List , + uLConfiguration ULConfiguration OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { DRBs-ToBeModified-ItemExtIEs } } OPTIONAL, + ... +} + +DRBs-ToBeModified-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +DRBs-ToBeReleased-Item ::= SEQUENCE { + dRBID DRBID, + iE-Extensions ProtocolExtensionContainer { { DRBs-ToBeReleased-ItemExtIEs } } OPTIONAL, + ... +} + +DRBs-ToBeReleased-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +DRBs-ToBeSetup-Item ::= SEQUENCE { + dRBID DRBID, + qoSInformation QoSInformation, + uLUPTNLInformation-ToBeSetup-List ULUPTNLInformation-ToBeSetup-List , + rLCMode RLCMode, + uLConfiguration ULConfiguration OPTIONAL, + duplicationActivation DuplicationActivation OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { DRBs-ToBeSetup-ItemExtIEs } } OPTIONAL, + ... +} + +DRBs-ToBeSetup-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + + +DRBs-ToBeSetupMod-Item ::= SEQUENCE { + dRBID DRBID, + qoSInformation QoSInformation, + uLUPTNLInformation-ToBeSetup-List ULUPTNLInformation-ToBeSetup-List, + rLCMode RLCMode, + uLConfiguration ULConfiguration OPTIONAL, + duplicationActivation DuplicationActivation OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { DRBs-ToBeSetupMod-ItemExtIEs } } OPTIONAL, + ... +} + +DRBs-ToBeSetupMod-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +DRXCycle ::= SEQUENCE { + longDRXCycleLength LongDRXCycleLength, + shortDRXCycleLength ShortDRXCycleLength OPTIONAL, + shortDRXCycleTimer ShortDRXCycleTimer OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { DRXCycle-ExtIEs} } OPTIONAL, + ... +} + +DRXCycle-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +DUtoCURRCContainer ::= OCTET STRING + +DUtoCURRCInformation ::= SEQUENCE { + cellGroupConfig CellGroupConfig, + measGapConfig MeasGapConfig OPTIONAL, + requestedP-MaxFR1 OCTET STRING OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { DUtoCURRCInformation-ExtIEs} } OPTIONAL, + ... +} + +DUtoCURRCInformation-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +DuplicationActivation ::= ENUMERATED{active,inactive,... } + +DuplicationIndication ::= ENUMERATED {true, ...} + +Dynamic5QIDescriptor ::= SEQUENCE { + qoSPriorityLevel INTEGER (1..127), + packetDelayBudget PacketDelayBudget, + packetErrorRate PacketErrorRate, + delayCritical ENUMERATED {delay-critical, non-delay-critical} OPTIONAL, + averagingWindow AveragingWindow OPTIONAL, + maxDataBurstVolume MaxDataBurstVolume OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { Dynamic5QIDescriptor-ExtIEs } } OPTIONAL +} + +Dynamic5QIDescriptor-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +-- E + +Endpoint-IP-address-and-port ::=SEQUENCE { + endpointIPAddress TransportLayerAddress, + iE-Extensions ProtocolExtensionContainer { { Endpoint-IP-address-and-port-ExtIEs} } OPTIONAL +} + +Endpoint-IP-address-and-port-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +EUTRANQoS ::= SEQUENCE { + qCI QCI, + allocationAndRetentionPriority AllocationAndRetentionPriority, + gbrQosInformation GBR-QosInformation OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { EUTRANQoS-ExtIEs} } OPTIONAL, + ... +} + +EUTRANQoS-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +ExecuteDuplication ::= ENUMERATED{true,...} + +EUTRA-Mode-Info ::= CHOICE { + eUTRAFDD EUTRA-FDD-Info, + eUTRATDD EUTRA-TDD-Info, + ... +} + +EUTRA-NR-CellResourceCoordinationReq-Container ::= OCTET STRING + +EUTRA-NR-CellResourceCoordinationReqAck-Container ::= OCTET STRING + +EUTRA-FDD-Info ::= SEQUENCE { + uL-offsetToPointA OffsetToPointA, + dL-offsetToPointA OffsetToPointA, + iE-Extensions ProtocolExtensionContainer { {EUTRA-FDD-Info-ExtIEs} } OPTIONAL, + ... +} + +EUTRA-FDD-Info-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +EUTRA-TDD-Info ::= SEQUENCE { + offsetToPointA OffsetToPointA, + iE-Extensions ProtocolExtensionContainer { {EUTRA-TDD-Info-ExtIEs} } OPTIONAL, + ... +} + +EUTRA-TDD-Info-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +-- F + +FDD-Info ::= SEQUENCE { + uL-NRFreqInfo NRFreqInfo, + dL-NRFreqInfo NRFreqInfo, + uL-Transmission-Bandwidth Transmission-Bandwidth, + dL-Transmission-Bandwidth Transmission-Bandwidth, + iE-Extensions ProtocolExtensionContainer { {FDD-Info-ExtIEs} } OPTIONAL, + ... +} + +FDD-Info-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + + +Flows-Mapped-To-DRB-List ::= SEQUENCE (SIZE(1.. maxnoofQoSFlows)) OF Flows-Mapped-To-DRB-Item + +Flows-Mapped-To-DRB-Item ::= SEQUENCE { + qoSFlowIndicator QoSFlowIndicator, + qoSFlowLevelQoSParameters QoSFlowLevelQoSParameters, + iE-Extensions ProtocolExtensionContainer { { Flows-Mapped-To-DRB-ItemExtIEs} } OPTIONAL +} + +Flows-Mapped-To-DRB-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +FreqBandNrItem ::= SEQUENCE { + freqBandIndicatorNr INTEGER (1..1024,...), + supportedSULBandList SEQUENCE (SIZE(0..maxnoofNrCellBands)) OF SupportedSULFreqBandItem, + iE-Extensions ProtocolExtensionContainer { {FreqBandNrItem-ExtIEs} } OPTIONAL, + ... +} + +FreqBandNrItem-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +FullConfiguration ::= ENUMERATED {full, ...} + +-- G + + +GBR-QosInformation ::= SEQUENCE { + e-RAB-MaximumBitrateDL BitRate, + e-RAB-MaximumBitrateUL BitRate, + e-RAB-GuaranteedBitrateDL BitRate, + e-RAB-GuaranteedBitrateUL BitRate, + iE-Extensions ProtocolExtensionContainer { { GBR-QosInformation-ExtIEs} } OPTIONAL, + ... +} + +GBR-QosInformation-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +GBR-QoSFlowInformation::= SEQUENCE { + maxFlowBitRateDownlink BitRate, + maxFlowBitRateUplink BitRate, + guaranteedFlowBitRateDownlink BitRate, + guaranteedFlowBitRateUplink BitRate, + maxPacketLossRateDownlink MaxPacketLossRate OPTIONAL, + maxPacketLossRateUplink MaxPacketLossRate OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { GBR-QosFlowInformation-ExtIEs} } OPTIONAL, + ... +} + +GBR-QosFlowInformation-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + + +GNB-CUSystemInformation::= SEQUENCE { + sImessage OCTET STRING, + iE-Extensions ProtocolExtensionContainer { { GNB-CUSystemInformation-ExtIEs} } OPTIONAL, + ... +} + +GNB-CUSystemInformation-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +GNB-CU-TNL-Association-Setup-Item::= SEQUENCE { + tNLAssociationTransportLayerAddress CP-TransportLayerAddress , + iE-Extensions ProtocolExtensionContainer { { GNB-CU-TNL-Association-Setup-Item-ExtIEs} } OPTIONAL +} + +GNB-CU-TNL-Association-Setup-Item-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +GNB-CU-TNL-Association-Failed-To-Setup-Item ::= SEQUENCE { + tNLAssociationTransportLayerAddress CP-TransportLayerAddress , + cause Cause, + iE-Extensions ProtocolExtensionContainer { { GNB-CU-TNL-Association-Failed-To-Setup-Item-ExtIEs} } OPTIONAL +} + +GNB-CU-TNL-Association-Failed-To-Setup-Item-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + + +GNB-CU-TNL-Association-To-Add-Item ::= SEQUENCE { + tNLAssociationTransportLayerAddress CP-TransportLayerAddress , + tNLAssociationUsage TNLAssociationUsage, + iE-Extensions ProtocolExtensionContainer { { GNB-CU-TNL-Association-To-Add-Item-ExtIEs} } OPTIONAL +} + +GNB-CU-TNL-Association-To-Add-Item-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +GNB-CU-TNL-Association-To-Remove-Item::= SEQUENCE { + tNLAssociationTransportLayerAddress CP-TransportLayerAddress , + iE-Extensions ProtocolExtensionContainer { { GNB-CU-TNL-Association-To-Remove-Item-ExtIEs} } OPTIONAL +} + +GNB-CU-TNL-Association-To-Remove-Item-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + + +GNB-CU-TNL-Association-To-Update-Item::= SEQUENCE { + tNLAssociationTransportLayerAddress CP-TransportLayerAddress , + tNLAssociationUsage TNLAssociationUsage OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { GNB-CU-TNL-Association-To-Update-Item-ExtIEs} } OPTIONAL +} + +GNB-CU-TNL-Association-To-Update-Item-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +GNB-CU-UE-F1AP-ID ::= INTEGER (0..4294967295) + +GNB-DU-UE-F1AP-ID ::= INTEGER (0..4294967295) + +GNB-DU-ID ::= INTEGER (0..68719476735) + +GNB-CU-Name ::= PrintableString(SIZE(1..150,...)) + +GNB-DU-Name ::= PrintableString(SIZE(1..150,...)) + +GNB-DU-Served-Cells-Item ::= SEQUENCE { + served-Cell-Information Served-Cell-Information, + gNB-DU-System-Information GNB-DU-System-Information OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { GNB-DU-Served-Cells-ItemExtIEs} } OPTIONAL, + ... +} + +GNB-DU-Served-Cells-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +GNB-DU-System-Information ::= SEQUENCE { + mIB-message MIB-message, + sIB1-message SIB1-message, + iE-Extensions ProtocolExtensionContainer { { GNB-DU-System-Information-ExtIEs } } OPTIONAL, + ... +} + +GNB-DU-System-Information-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +GTP-TEID ::= OCTET STRING (SIZE (4)) + +GTPTunnel ::= SEQUENCE { + transportLayerAddress TransportLayerAddress, + gTP-TEID GTP-TEID, + iE-Extensions ProtocolExtensionContainer { { GTPTunnel-ExtIEs } } OPTIONAL, + ... +} + +GTPTunnel-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +-- H + +HandoverPreparationInformation ::= OCTET STRING + +-- I +InactivityMonitoringRequest ::= ENUMERATED { true,...} +InactivityMonitoringResponse ::= ENUMERATED { not-supported,...} + +-- J + +-- K + +-- L + +LCID ::= INTEGER (1..32, ...) + +ListofEUTRACellsinGNBDUCoordination ::= SEQUENCE (SIZE (0.. maxCellineNB)) OF Served-EUTRA-Cells-Information + +LongDRXCycleLength ::= ENUMERATED +{ms10, ms20, ms32, ms40, ms60, ms64, ms70, ms80, ms128, ms160, ms256, ms320, ms512, ms640, ms1024, ms1280, ms2048, ms2560, ms5120, ms10240, ...} + +-- M + +MaskedIMEISV ::= BIT STRING (SIZE (64)) + +MaxDataBurstVolume ::= INTEGER (0..63) -- this IE may need to be refined +MaxPacketLossRate ::= INTEGER (0..1000) + +MIB-message ::= OCTET STRING + +MeasConfig ::= OCTET STRING + +MeasGapConfig ::= OCTET STRING + +-- N + +NGRANAllocationAndRetentionPriority ::= SEQUENCE { + priorityLevel PriorityLevel, + pre-emptionCapability Pre-emptionCapability, + pre-emptionVulnerability Pre-emptionVulnerability, + iE-Extensions ProtocolExtensionContainer { {NGRANAllocationAndRetentionPriority-ExtIEs} } OPTIONAL +} + +NGRANAllocationAndRetentionPriority-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +NR-CGI-List-For-Restart-Item ::= SEQUENCE { + nRCGI NRCGI, + iE-Extensions ProtocolExtensionContainer { { NR-CGI-List-For-Restart-ItemExtIEs } } OPTIONAL, + ... +} + +NR-CGI-List-For-Restart-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +NonDynamic5QIDescriptor ::= SEQUENCE { + fiveQI INTEGER (0..255), + qoSPriorityLevel INTEGER (1..127) OPTIONAL, + averagingWindow AveragingWindow OPTIONAL, + maxDataBurstVolume MaxDataBurstVolume OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { NonDynamic5QIDescriptor-ExtIEs } } OPTIONAL +} + +NonDynamic5QIDescriptor-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +Notification-Cause ::= ENUMERATED {fulfilled, not-fulfilled, ...} + +NotificationControl ::= ENUMERATED {active, not-active, ...} + +NRFreqInfo ::= SEQUENCE { + nRARFCN INTEGER (0..maxNRARFCN), + sul-Information SUL-Information OPTIONAL, + freqBandListNr SEQUENCE (SIZE(1..maxnoofNrCellBands)) OF FreqBandNrItem, + iE-Extensions ProtocolExtensionContainer { { NRFreqInfoExtIEs} } OPTIONAL, + ... +} + +NRFreqInfoExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +NRCGI ::= SEQUENCE { + pLMN-Identity PLMN-Identity, + nRCellIdentity NRCellIdentity, + iE-Extensions ProtocolExtensionContainer { {NRCGI-ExtIEs} } OPTIONAL, + ... +} + +NRCGI-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +NR-Mode-Info ::= CHOICE { + fDD FDD-Info, + tDD TDD-Info, + choice-extension ProtocolExtensionContainer { { NR-Mode-Info-ExtIEs} }, + ... +} + +NR-Mode-Info-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { ... +} + + +NRCellIdentity ::= BIT STRING (SIZE(36)) + +NRNRB ::= ENUMERATED { nrb11, nrb18, nrb24, nrb25, nrb31, nrb32, nrb38, nrb51, nrb52, nrb65, nrb66, nrb78, nrb79, nrb93, nrb106, nrb107, nrb121, nrb132, nrb133, nrb135, nrb160, nrb162, nrb189, nrb216, nrb217, nrb245, nrb264, nrb270, nrb273, ...} + +NRPCI ::= INTEGER(0..1007) + +NRSCS ::= ENUMERATED { scs15, scs30, scs60, scs120, ...} + +NumberOfBroadcasts ::= INTEGER (0..65535) + +NumberofBroadcastRequest ::= INTEGER (0..65535) + +-- O + +OffsetToPointA ::= INTEGER (0..2199,...) + +-- P + +PacketDelayBudget ::= INTEGER (0..63) -- this IE may need to be refined + +PacketErrorRate ::= INTEGER (0..63) -- this IE may need to be refined + +PagingCell-Item ::= SEQUENCE { + nRCGI NRCGI , + iE-Extensions ProtocolExtensionContainer { { PagingCell-ItemExtIEs } } OPTIONAL +} + +PagingCell-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +PagingDRX ::= INTEGER (0..63) -- this IE may need to be refined + +PagingIdentity ::= CHOICE { + rANUEPagingIdentity RANUEPagingIdentity, + cNUEPagingIdentity CNUEPagingIdentity, + choice-extension ProtocolExtensionContainer { { PagingIdentity-ExtIEs } }, + ... +} + +PagingIdentity-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +PagingPriority ::= ENUMERATED { priolevel1, priolevel2, priolevel3, priolevel4, priolevel5, priolevel6, priolevel7, priolevel8,...} + +PLMN-Identity ::= OCTET STRING (SIZE(3)) + +Pre-emptionCapability ::= ENUMERATED { + shall-not-trigger-pre-emption, + may-trigger-pre-emption +} + +Pre-emptionVulnerability ::= ENUMERATED { + not-pre-emptable, + pre-emptable +} + +PriorityLevel ::= INTEGER { spare (0), highest (1), lowest (14), no-priority (15) } (0..15) + +ProtectedEUTRAResourceIndication ::= OCTET STRING + +Potential-SpCell-Item ::= SEQUENCE { + potential-SpCell-ID NRCGI , + iE-Extensions ProtocolExtensionContainer { { Potential-SpCell-ItemExtIEs } } OPTIONAL, + ... +} + +Potential-SpCell-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +PWS-Failed-NR-CGI-Item ::= SEQUENCE { + nRCGI NRCGI, + numberOfBroadcasts NumberOfBroadcasts, + iE-Extensions ProtocolExtensionContainer { { PWS-Failed-NR-CGI-ItemExtIEs } } OPTIONAL, + ... +} + +PWS-Failed-NR-CGI-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +PWSSystemInformation ::= OCTET STRING + +-- Q + +QCI ::= INTEGER (0..255) + +QoS-Characteristics ::= CHOICE { + non-Dynamic-5QI NonDynamic5QIDescriptor, + dynamic-5QI Dynamic5QIDescriptor, + choice-extension ProtocolExtensionContainer { { QoS-Characteristics-ExtIEs } }, + ... +} + +QoS-Characteristics-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +QoSFlowIndicator ::= INTEGER (0..63) + +QoSFlowLevelQoSParameters ::= SEQUENCE { + qoS-Characteristics QoS-Characteristics, + nGRANallocationRetentionPriority NGRANAllocationAndRetentionPriority, + gBR-QoS-Flow-Information GBR-QoSFlowInformation OPTIONAL, + reflective-QoS-Attribute ENUMERATED {subject-to, ...} OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { QoSFlowLevelQoSParameters-ExtIEs } } OPTIONAL +} + +QoSFlowLevelQoSParameters-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +QoSInformation ::= CHOICE { + eUTRANQoS EUTRANQoS, + dRB-Information DRB-Information, + choice-extension ProtocolExtensionContainer { { QoSInformation-ExtIEs} }, + ... +} + +QoSInformation-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +-- R + +RANAC ::= INTEGER (0..64) + +RANUEPagingIdentity ::= SEQUENCE { + iRNTI BIT STRING (SIZE(40)), + iE-Extensions ProtocolExtensionContainer { { RANUEPagingIdentity-ExtIEs } } OPTIONAL} + +RANUEPagingIdentity-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +RAT-FrequencyPriorityInformation::= CHOICE { + subscriberProfileIDforRFP SubscriberProfileIDforRFP, + rAT-FrequencySelectionPriority RAT-FrequencySelectionPriority, + choice-extension ProtocolExtensionContainer { { RAT-FrequencyPriorityInformation-ExtIEs} }, + ... +} + +RAT-FrequencyPriorityInformation-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +RAT-FrequencySelectionPriority::= INTEGER (1.. 256, ...) + +RequestType ::= ENUMERATED {offer, execution, ...} + +ResourceCoordinationTransferContainer ::= OCTET STRING + +RepetitionPeriod ::= INTEGER (0..131071, ...) +RLCMode ::= ENUMERATED { + rlc-am, + rlc-um +} + +RRCContainer ::= OCTET STRING + +RRCRconfigurationCompleteIndicator ::= ENUMERATED {true, ...} + +-- S + +SCell-FailedtoSetup-Item ::= SEQUENCE { + sCell-ID NRCGI , + cause Cause OPTIONAL , + iE-Extensions ProtocolExtensionContainer { { SCell-FailedtoSetup-ItemExtIEs } } OPTIONAL, + ... +} + +SCell-FailedtoSetup-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +SCell-FailedtoSetupMod-Item ::= SEQUENCE { + sCell-ID NRCGI , + cause Cause OPTIONAL , + iE-Extensions ProtocolExtensionContainer { { SCell-FailedtoSetupMod-ItemExtIEs } } OPTIONAL, + ... +} + +SCell-FailedtoSetupMod-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +SCell-ToBeRemoved-Item ::= SEQUENCE { + sCell-ID NRCGI , + iE-Extensions ProtocolExtensionContainer { { SCell-ToBeRemoved-ItemExtIEs } } OPTIONAL, + ... +} + +SCell-ToBeRemoved-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +SCell-ToBeSetup-Item ::= SEQUENCE { + sCell-ID NRCGI , + sCellIndex SCellIndex, + sCellULConfigured CellULConfigured OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { SCell-ToBeSetup-ItemExtIEs } } OPTIONAL, + ... +} + +SCell-ToBeSetup-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +SCell-ToBeSetupMod-Item ::= SEQUENCE { + sCell-ID NRCGI , + sCellIndex SCellIndex, + sCellULConfigured CellULConfigured OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { SCell-ToBeSetupMod-ItemExtIEs } } OPTIONAL, + ... +} + +SCell-ToBeSetupMod-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +SCellIndex ::=INTEGER (1..31, ...) + +CG-ConfigInfo ::= OCTET STRING + +ServCellIndex ::= INTEGER (0..31, ...) + +Served-Cell-Information ::= SEQUENCE { + nRCGI NRCGI, + nRPCI NRPCI, + fiveGS-TAC FiveGS-TAC, + configured-EPS-TAC Configured-EPS-TAC OPTIONAL, + servedPLMNs BroadcastPLMNs-List, + nR-Mode-Info NR-Mode-Info, + measurementTimingConfiguration OCTET STRING, + iE-Extensions ProtocolExtensionContainer { {Served-Cell-Information-ExtIEs} } OPTIONAL, + ... +} + +Served-Cell-Information-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { +{ ID id-RANAC CRITICALITY ignore EXTENSION RANAC PRESENCE optional}, + ... +} + +Served-Cells-To-Add-Item ::= SEQUENCE { + served-Cell-Information Served-Cell-Information, + gNB-DU-System-Information GNB-DU-System-Information OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { Served-Cells-To-Add-ItemExtIEs} } OPTIONAL, + ... +} + +Served-Cells-To-Add-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +Served-Cells-To-Delete-Item ::= SEQUENCE { + oldNRCGI NRCGI , + iE-Extensions ProtocolExtensionContainer { { Served-Cells-To-Delete-ItemExtIEs } } OPTIONAL, + ... +} + +Served-Cells-To-Delete-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +Served-Cells-To-Modify-Item ::= SEQUENCE { + oldNRCGI NRCGI , + served-Cell-Information Served-Cell-Information , + gNB-DU-System-Information GNB-DU-System-Information OPTIONAL , + iE-Extensions ProtocolExtensionContainer { { Served-Cells-To-Modify-ItemExtIEs } } OPTIONAL, + ... +} + +Served-Cells-To-Modify-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +Served-EUTRA-Cells-Information::= SEQUENCE { + eUTRA-Mode-Info EUTRA-Mode-Info, + protectedEUTRAResourceIndication ProtectedEUTRAResourceIndication, + iE-Extensions ProtocolExtensionContainer { {Served-EUTRA-Cell-Information-ExtIEs} } OPTIONAL, + ... +} + +Served-EUTRA-Cell-Information-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +ShortDRXCycleLength ::= ENUMERATED {ms2, ms3, ms4, ms5, ms6, ms7, ms8, ms10, ms14, ms16, ms20, ms30, ms32, ms35, ms40, ms64, ms80, ms128, ms160, ms256, ms320, ms512, ms640, ...} + +ShortDRXCycleTimer ::= INTEGER (1..16) + +SIB1-message ::= OCTET STRING + +SIBtype ::= ENUMERATED { + sibtype2,sibtype3, sibtype4, sibtype5, sibtype6, sibtype7, sibtype8, sibtype9, + ... +} + +SIBtype-List ::= SEQUENCE (SIZE(1.. maxnoofSIBTypes)) OF SIBtype-Item + +SIBtype-Item ::= SEQUENCE { + sIBtype SIBtype , + iE-Extensions ProtocolExtensionContainer { { SIBtype-ItemExtIEs } } OPTIONAL +} + +SIBtype-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +SliceSupportList ::= SEQUENCE (SIZE(1.. maxnoofSliceItems)) OF SliceSupportItem + +SliceSupportItem ::= SEQUENCE { + sNSSAI SNSSAI, + iE-Extensions ProtocolExtensionContainer { { SliceSupportItem-ExtIEs } } OPTIONAL +} + +SliceSupportItem-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +SNSSAI ::= SEQUENCE { + sST OCTET STRING (SIZE(1)), + sD OCTET STRING (SIZE(3)) OPTIONAL , + iE-Extensions ProtocolExtensionContainer { { SNSSAI-ExtIEs } } OPTIONAL +} + +SNSSAI-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +SpectrumSharingGroupID ::= INTEGER (1..maxCellineNB) + +SRBID ::= INTEGER (0..3, ...) + +SRBs-FailedToBeSetup-Item ::= SEQUENCE { + sRBID SRBID , + cause Cause OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { SRBs-FailedToBeSetup-ItemExtIEs } } OPTIONAL, + ... +} + +SRBs-FailedToBeSetup-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +SRBs-FailedToBeSetupMod-Item ::= SEQUENCE { + sRBID SRBID , + cause Cause OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { SRBs-FailedToBeSetupMod-ItemExtIEs } } OPTIONAL, + ... +} + +SRBs-FailedToBeSetupMod-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + + +SRBs-Required-ToBeReleased-Item ::= SEQUENCE { + sRBID SRBID, + iE-Extensions ProtocolExtensionContainer { { SRBs-Required-ToBeReleased-ItemExtIEs } } OPTIONAL, + ... +} + +SRBs-Required-ToBeReleased-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +SRBs-ToBeReleased-Item ::= SEQUENCE { + sRBID SRBID, + iE-Extensions ProtocolExtensionContainer { { SRBs-ToBeReleased-ItemExtIEs } } OPTIONAL, + ... +} + +SRBs-ToBeReleased-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +SRBs-ToBeSetup-Item ::= SEQUENCE { + sRBID SRBID , + duplicationIndication DuplicationIndication OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { SRBs-ToBeSetup-ItemExtIEs } } OPTIONAL, + ... +} + +SRBs-ToBeSetup-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +SRBs-ToBeSetupMod-Item ::= SEQUENCE { + sRBID SRBID, + duplicationIndication DuplicationIndication OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { SRBs-ToBeSetupMod-ItemExtIEs } } OPTIONAL, + ... +} + +SRBs-ToBeSetupMod-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +SUL-Information ::= SEQUENCE { + sUL-NRARFCN INTEGER (0..maxNRARFCN), + sUL-transmission-Bandwidth Transmission-Bandwidth, + iE-Extensions ProtocolExtensionContainer { { SUL-InformationExtIEs} } OPTIONAL, + ... +} + +SUL-InformationExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +SubscriberProfileIDforRFP ::= INTEGER (1..256, ...) + +SupportedSULFreqBandItem ::= SEQUENCE { + freqBandIndicatorNr INTEGER (1..1024,...), + iE-Extensions ProtocolExtensionContainer { { SupportedSULFreqBandItem-ExtIEs} } OPTIONAL, + ... +} + +SupportedSULFreqBandItem-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +-- T + +FiveGS-TAC ::= OCTET STRING (SIZE(3)) + +Configured-EPS-TAC ::= OCTET STRING (SIZE(2)) + +TDD-Info ::= SEQUENCE { + nRFreqInfo NRFreqInfo, + transmission-Bandwidth Transmission-Bandwidth, + iE-Extensions ProtocolExtensionContainer { {TDD-Info-ExtIEs} } OPTIONAL, + ... +} + +TDD-Info-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +TimeToWait ::= ENUMERATED {v1s, v2s, v5s, v10s, v20s, v60s, ...} + +TNLAssociationUsage ::= ENUMERATED { + ue, + non-ue, + both, +... +} + +TransportLayerAddress ::= BIT STRING (SIZE(1..160, ...)) + +TransactionID ::= INTEGER (0..255, ...) + +Transmission-Bandwidth ::= SEQUENCE { + nRSCS NRSCS, + nRNRB NRNRB, + iE-Extensions ProtocolExtensionContainer { { Transmission-Bandwidth-ExtIEs} } OPTIONAL, + ... +} + +Transmission-Bandwidth-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +TransmissionStopIndicator ::= ENUMERATED {true, ...} + +TypeOfError ::= ENUMERATED { + not-understood, + missing, + ... +} + +-- U + +UE-associatedLogicalF1-ConnectionItem ::= SEQUENCE { + gNB-CU-UE-F1AP-ID GNB-CU-UE-F1AP-ID OPTIONAL, + gNB-DU-UE-F1AP-ID GNB-DU-UE-F1AP-ID OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { UE-associatedLogicalF1-ConnectionItemExtIEs} } OPTIONAL, + ... +} + +UE-associatedLogicalF1-ConnectionItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +UE-CapabilityRAT-ContainerList::= OCTET STRING + +UEIdentityIndexValue ::= INTEGER (0..63) -- This IE may need to be refined. + +ULConfiguration ::= SEQUENCE { + uLUEConfiguration ULUEConfiguration, + iE-Extensions ProtocolExtensionContainer { { ULConfigurationExtIEs } } OPTIONAL, + ... +} +ULConfigurationExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +ULUEConfiguration ::= ENUMERATED {no-data, shared, only, ...} + + +ULUPTNLInformation-ToBeSetup-List ::= SEQUENCE (SIZE(1..maxnoofULUPTNLInformation)) OF ULUPTNLInformation-ToBeSetup-Item + +ULUPTNLInformation-ToBeSetup-Item ::=SEQUENCE { + uLUPTNLInformation UPTransportLayerInformation, + iE-Extensions ProtocolExtensionContainer { { ULUPTNLInformation-ToBeSetup-ItemExtIEs } } OPTIONAL, + ... +} + +ULUPTNLInformation-ToBeSetup-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... +} + +UPTransportLayerInformation ::= CHOICE { + gTPTunnel GTPTunnel, + choice-extension ProtocolExtensionContainer { { UPTransportLayerInformation-ExtIEs} }, + ... +} + +UPTransportLayerInformation-ExtIEs F1AP-PROTOCOL-EXTENSION ::= { + ... + } +-- V + +-- W + +-- X + +-- Y + +-- Z + +END diff --git a/openair2/F1AP/MESSAGES/ASN1/R15.2.1/F1AP-PDU-Contents.asn b/openair2/F1AP/MESSAGES/ASN1/R15.2.1/F1AP-PDU-Contents.asn new file mode 100644 index 0000000000..ec6e3733b1 --- /dev/null +++ b/openair2/F1AP/MESSAGES/ASN1/R15.2.1/F1AP-PDU-Contents.asn @@ -0,0 +1,1578 @@ +-- ************************************************************** +-- +-- PDU definitions for F1AP. +-- +-- ************************************************************** + +F1AP-PDU-Contents { +itu-t (0) identified-organization (4) etsi (0) mobileDomain (0) +ngran-access (22) modules (3) f1ap (3) version1 (1) f1ap-PDU-Contents (1) } + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +-- ************************************************************** +-- +-- IE parameter types from other modules. +-- +-- ************************************************************** + +IMPORTS + Active-Cells-Item, + Candidate-SpCell-Item, + Cause, + Cells-Failed-to-be-Activated-List-Item, + Cells-to-be-Activated-List-Item, + Cells-to-be-Deactivated-List-Item, + CellULConfigured, + CriticalityDiagnostics, + C-RNTI, + CUtoDURRCInformation, + DRB-Activity-Item, + DRBID, + DRBs-FailedToBeModified-Item, + DRBs-FailedToBeSetup-Item, + DRBs-FailedToBeSetupMod-Item, + DRB-Notify-Item, + DRBs-ModifiedConf-Item, + DRBs-Modified-Item, + DRBs-Required-ToBeModified-Item, + DRBs-Required-ToBeReleased-Item, + DRBs-Setup-Item, + DRBs-SetupMod-Item, + DRBs-ToBeModified-Item, + DRBs-ToBeReleased-Item, + DRBs-ToBeSetup-Item, + DRBs-ToBeSetupMod-Item, + DRXCycle, + DUtoCURRCInformation, + EUTRANQoS, + ExecuteDuplication, + FullConfiguration, + GNB-CU-UE-F1AP-ID, + GNB-DU-UE-F1AP-ID, + GNB-DU-ID, + GNB-DU-Served-Cells-Item, + GNB-DU-System-Information, + GNB-CU-Name, + GNB-DU-Name, + InactivityMonitoringRequest, + InactivityMonitoringResponse, + NotificationControl, + NRCGI, + NRPCI, + Potential-SpCell-Item, + RAT-FrequencyPriorityInformation, + ResourceCoordinationTransferContainer, + RRCContainer, + RRCRconfigurationCompleteIndicator, + SCellIndex, + SCell-ToBeRemoved-Item, + SCell-ToBeSetup-Item, + SCell-ToBeSetupMod-Item, + SCell-FailedtoSetup-Item, + SCell-FailedtoSetupMod-Item, + ServCellIndex, + Served-Cell-Information, + Served-Cells-To-Add-Item, + Served-Cells-To-Delete-Item, + Served-Cells-To-Modify-Item, + SRBID, + SRBs-FailedToBeSetup-Item, + SRBs-FailedToBeSetupMod-Item, + SRBs-Required-ToBeReleased-Item, + SRBs-ToBeReleased-Item, + SRBs-ToBeSetup-Item, + SRBs-ToBeSetupMod-Item, + TimeToWait, + TransactionID, + TransmissionStopIndicator, + UE-associatedLogicalF1-ConnectionItem, + DUtoCURRCContainer, + PagingCell-Item, + SIBtype-List, + UEIdentityIndexValue, + GNB-CU-TNL-Association-Setup-Item, + GNB-CU-TNL-Association-Failed-To-Setup-Item, + GNB-CU-TNL-Association-To-Add-Item, + GNB-CU-TNL-Association-To-Remove-Item, + GNB-CU-TNL-Association-To-Update-Item, + MaskedIMEISV, + PagingDRX, + PagingPriority, + PagingIdentity, + Cells-to-be-Barred-Item, + PWSSystemInformation, + Broadcast-To-Be-Cancelled-Item, + Cells-Broadcast-Cancelled-Item, + ConcurrentWarningMessageIndicator, + NR-CGI-List-For-Restart-Item, + PWS-Failed-NR-CGI-Item, + RepetitionPeriod, + NumberofBroadcastRequest, + Cells-To-Be-Broadcast-Item, + Cells-Broadcast-Completed-Item, + Cancel-all-Warning-Messages-Indicator, + EUTRA-NR-CellResourceCoordinationReq-Container, + EUTRA-NR-CellResourceCoordinationReqAck-Container, + ListofEUTRACellsinGNBDUCoordination, + SpectrumSharingGroupID, + RequestType + +FROM F1AP-IEs + + PrivateIE-Container{}, + ProtocolExtensionContainer{}, + ProtocolIE-Container{}, + ProtocolIE-ContainerPair{}, + ProtocolIE-SingleContainer{}, + F1AP-PRIVATE-IES, + F1AP-PROTOCOL-EXTENSION, + F1AP-PROTOCOL-IES, + F1AP-PROTOCOL-IES-PAIR + +FROM F1AP-Containers + + id-Active-Cells-Item, + id-Active-Cells-List, + id-Candidate-SpCell-Item, + id-Candidate-SpCell-List, + id-Cause, + id-Cancel-all-Warning-Messages-Indicator, + id-Cells-Failed-to-be-Activated-List, + id-Cells-Failed-to-be-Activated-List-Item, + id-Cells-to-be-Activated-List, + id-Cells-to-be-Activated-List-Item, + id-Cells-to-be-Deactivated-List, + id-Cells-to-be-Deactivated-List-Item, + id-ConfirmedUEID, + id-CriticalityDiagnostics, + id-C-RNTI, + id-CUtoDURRCInformation, + id-DRB-Activity-Item, + id-DRB-Activity-List, + id-DRBs-FailedToBeModified-Item, + id-DRBs-FailedToBeModified-List, + id-DRBs-FailedToBeSetup-Item, + id-DRBs-FailedToBeSetup-List, + id-DRBs-FailedToBeSetupMod-Item, + id-DRBs-FailedToBeSetupMod-List, + id-DRBs-ModifiedConf-Item, + id-DRBs-ModifiedConf-List, + id-DRBs-Modified-Item, + id-DRBs-Modified-List, + id-DRB-Notify-Item, + id-DRB-Notify-List, + id-DRBs-Required-ToBeModified-Item, + id-DRBs-Required-ToBeModified-List, + id-DRBs-Required-ToBeReleased-Item, + id-DRBs-Required-ToBeReleased-List, + id-DRBs-Setup-Item, + id-DRBs-Setup-List, + id-DRBs-SetupMod-Item, + id-DRBs-SetupMod-List, + id-DRBs-ToBeModified-Item, + id-DRBs-ToBeModified-List, + id-DRBs-ToBeReleased-Item, + id-DRBs-ToBeReleased-List, + id-DRBs-ToBeSetup-Item, + id-DRBs-ToBeSetup-List, + id-DRBs-ToBeSetupMod-Item, + id-DRBs-ToBeSetupMod-List, + id-DRXCycle, + id-DUtoCURRCInformation, + id-ExecuteDuplication, + id-FullConfiguration, + id-gNB-CU-UE-F1AP-ID, + id-gNB-DU-UE-F1AP-ID, + id-gNB-DU-ID, + id-GNB-DU-Served-Cells-Item, + id-gNB-DU-Served-Cells-List, + id-gNB-CU-Name, + id-gNB-DU-Name, + id-InactivityMonitoringRequest, + id-InactivityMonitoringResponse, + id-oldgNB-DU-UE-F1AP-ID, + id-Potential-SpCell-Item, + id-Potential-SpCell-List, + id-RAT-FrequencyPriorityInformation, + id-ResetType, + id-ResourceCoordinationTransferContainer, + id-RRCContainer, + id-RRCRconfigurationCompleteIndicator, + id-SCell-FailedtoSetup-List, + id-SCell-FailedtoSetup-Item, + id-SCell-FailedtoSetupMod-List, + id-SCell-FailedtoSetupMod-Item, + id-SCell-ToBeRemoved-Item, + id-SCell-ToBeRemoved-List, + id-SCell-ToBeSetup-Item, + id-SCell-ToBeSetup-List, + id-SCell-ToBeSetupMod-Item, + id-SCell-ToBeSetupMod-List, + id-Served-Cells-To-Add-Item, + id-Served-Cells-To-Add-List, + id-Served-Cells-To-Delete-Item, + id-Served-Cells-To-Delete-List, + id-Served-Cells-To-Modify-Item, + id-Served-Cells-To-Modify-List, + id-ServCellndex, + id-SpCell-ID, + id-SpCellULConfigured, + id-SRBID, + id-SRBs-FailedToBeSetup-Item, + id-SRBs-FailedToBeSetup-List, + id-SRBs-FailedToBeSetupMod-Item, + id-SRBs-FailedToBeSetupMod-List, + id-SRBs-Required-ToBeReleased-Item, + id-SRBs-Required-ToBeReleased-List, + id-SRBs-ToBeReleased-Item, + id-SRBs-ToBeReleased-List, + id-SRBs-ToBeSetup-Item, + id-SRBs-ToBeSetup-List, + id-SRBs-ToBeSetupMod-Item, + id-SRBs-ToBeSetupMod-List, + id-TimeToWait, + id-TransactionID, + id-TransmissionStopIndicator, + id-UE-associatedLogicalF1-ConnectionItem, + id-UE-associatedLogicalF1-ConnectionListResAck, + id-DUtoCURRCContainer, + id-NRCGI, + id-PagingCell-Item, + id-PagingCell-List, + id-PagingDRX, + id-PagingPriority, + id-SIBtype-List, + id-UEIdentityIndexValue, + id-GNB-CU-TNL-Association-Setup-List, + id-GNB-CU-TNL-Association-Setup-Item, + id-GNB-CU-TNL-Association-Failed-To-Setup-List, + id-GNB-CU-TNL-Association-Failed-To-Setup-Item, + id-GNB-CU-TNL-Association-To-Add-Item, + id-GNB-CU-TNL-Association-To-Add-List, + id-GNB-CU-TNL-Association-To-Remove-Item, + id-GNB-CU-TNL-Association-To-Remove-List, + id-GNB-CU-TNL-Association-To-Update-Item, + id-GNB-CU-TNL-Association-To-Update-List, + id-MaskedIMEISV, + id-PagingIdentity, + id-Cells-to-be-Barred-List, + id-Cells-to-be-Barred-Item, + id-PWSSystemInformation, + id-RepetitionPeriod, + id-NumberofBroadcastRequest, + id-ConcurrentWarningMessageIndicator, + id-Cells-To-Be-Broadcast-List, + id-Cells-To-Be-Broadcast-Item, + id-Cells-Broadcast-Completed-List, + id-Cells-Broadcast-Completed-Item, + id-Broadcast-To-Be-Cancelled-List, + id-Broadcast-To-Be-Cancelled-Item, + id-Cells-Broadcast-Cancelled-List, + id-Cells-Broadcast-Cancelled-Item, + id-NR-CGI-List-For-Restart-List, + id-NR-CGI-List-For-Restart-Item, + id-PWS-Failed-NR-CGI-List, + id-PWS-Failed-NR-CGI-Item, + id-EUTRA-NR-CellResourceCoordinationReq-Container, + id-EUTRA-NR-CellResourceCoordinationReqAck-Container, + id-SpectrumSharingGroupID, + id-ListofEUTRACellsinGNBDUCoordination, + id-Protected-EUTRA-Resources-List, + id-RequestType, + maxCellingNBDU, + maxnoofCandidateSpCells, + maxnoofDRBs, + maxnoofErrors, + maxnoofIndividualF1ConnectionsToReset, + maxnoofPotentialSpCells, + maxnoofSCells, + maxnoofSRBs, + maxnoofPagingCells, + maxnoofTNLAssociations, + maxCellineNB + +FROM F1AP-Constants; + + +-- ************************************************************** +-- +-- RESET ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- Reset +-- +-- ************************************************************** + +Reset ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {ResetIEs} }, + ... +} + +ResetIEs F1AP-PROTOCOL-IES ::= { + { ID id-TransactionID CRITICALITY reject TYPE TransactionID PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-ResetType CRITICALITY reject TYPE ResetType PRESENCE mandatory }, + ... +} + +ResetType ::= CHOICE { + f1-Interface ResetAll, + partOfF1-Interface UE-associatedLogicalF1-ConnectionListRes, + ... +} + + +ResetAll ::= ENUMERATED { + reset-all, + ... +} + +UE-associatedLogicalF1-ConnectionListRes ::= SEQUENCE (SIZE(1.. maxnoofIndividualF1ConnectionsToReset)) OF ProtocolIE-SingleContainer { { UE-associatedLogicalF1-ConnectionItemRes } } + +UE-associatedLogicalF1-ConnectionItemRes F1AP-PROTOCOL-IES ::= { + { ID id-UE-associatedLogicalF1-ConnectionItem CRITICALITY reject TYPE UE-associatedLogicalF1-ConnectionItem PRESENCE mandatory}, + ... +} + + +-- ************************************************************** +-- +-- Reset Acknowledge +-- +-- ************************************************************** + +ResetAcknowledge ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {ResetAcknowledgeIEs} }, + ... +} + +ResetAcknowledgeIEs F1AP-PROTOCOL-IES ::= { + { ID id-TransactionID CRITICALITY reject TYPE TransactionID PRESENCE mandatory }| + { ID id-UE-associatedLogicalF1-ConnectionListResAck CRITICALITY ignore TYPE UE-associatedLogicalF1-ConnectionListResAck PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +UE-associatedLogicalF1-ConnectionListResAck ::= SEQUENCE (SIZE(1.. maxnoofIndividualF1ConnectionsToReset)) OF ProtocolIE-SingleContainer { { UE-associatedLogicalF1-ConnectionItemResAck } } + +UE-associatedLogicalF1-ConnectionItemResAck F1AP-PROTOCOL-IES ::= { + { ID id-UE-associatedLogicalF1-ConnectionItem CRITICALITY ignore TYPE UE-associatedLogicalF1-ConnectionItem PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- ERROR INDICATION ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- Error Indication +-- +-- ************************************************************** + +ErrorIndication ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{ErrorIndicationIEs}}, + ... +} + +ErrorIndicationIEs F1AP-PROTOCOL-IES ::= { + { ID id-TransactionID CRITICALITY reject TYPE TransactionID PRESENCE mandatory}| + { ID id-gNB-CU-UE-F1AP-ID CRITICALITY ignore TYPE GNB-CU-UE-F1AP-ID PRESENCE optional }| + { ID id-gNB-DU-UE-F1AP-ID CRITICALITY ignore TYPE GNB-DU-UE-F1AP-ID PRESENCE optional }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- F1 SETUP ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- F1 Setup Request +-- +-- ************************************************************** + +F1SetupRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {F1SetupRequestIEs} }, + ... +} + +F1SetupRequestIEs F1AP-PROTOCOL-IES ::= { + { ID id-TransactionID CRITICALITY reject TYPE TransactionID PRESENCE mandatory }| + { ID id-gNB-DU-ID CRITICALITY reject TYPE GNB-DU-ID PRESENCE mandatory }| + { ID id-gNB-DU-Name CRITICALITY ignore TYPE GNB-DU-Name PRESENCE optional }| + { ID id-gNB-DU-Served-Cells-List CRITICALITY reject TYPE GNB-DU-Served-Cells-List PRESENCE mandatory }, + ... +} + + +GNB-DU-Served-Cells-List ::= SEQUENCE (SIZE(1.. maxCellingNBDU)) OF ProtocolIE-SingleContainer { { GNB-DU-Served-Cells-ItemIEs } } + +GNB-DU-Served-Cells-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-GNB-DU-Served-Cells-Item CRITICALITY reject TYPE GNB-DU-Served-Cells-Item PRESENCE mandatory }, + ... +} + + +-- ************************************************************** +-- +-- F1 Setup Response +-- +-- ************************************************************** + +F1SetupResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {F1SetupResponseIEs} }, + ... +} + + +F1SetupResponseIEs F1AP-PROTOCOL-IES ::= { + { ID id-TransactionID CRITICALITY reject TYPE TransactionID PRESENCE mandatory }| + { ID id-gNB-CU-Name CRITICALITY ignore TYPE GNB-CU-Name PRESENCE optional }| + { ID id-Cells-to-be-Activated-List CRITICALITY reject TYPE Cells-to-be-Activated-List PRESENCE optional }, + ... +} + + +Cells-to-be-Activated-List ::= SEQUENCE (SIZE(1.. maxCellingNBDU)) OF ProtocolIE-SingleContainer { { Cells-to-be-Activated-List-ItemIEs } } + +Cells-to-be-Activated-List-ItemIEs F1AP-PROTOCOL-IES::= { + { ID id-Cells-to-be-Activated-List-Item CRITICALITY reject TYPE Cells-to-be-Activated-List-Item PRESENCE mandatory}, + ... +} + + + +-- ************************************************************** +-- +-- F1 Setup Failure +-- +-- ************************************************************** + +F1SetupFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {F1SetupFailureIEs} }, + ... +} + +F1SetupFailureIEs F1AP-PROTOCOL-IES ::= { + { ID id-TransactionID CRITICALITY reject TYPE TransactionID PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-TimeToWait CRITICALITY ignore TYPE TimeToWait PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + + +-- ************************************************************** +-- +-- GNB-DU CONFIGURATION UPDATE ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- GNB-DU CONFIGURATION UPDATE +-- +-- ************************************************************** + +GNBDUConfigurationUpdate::= SEQUENCE { + protocolIEs ProtocolIE-Container { {GNBDUConfigurationUpdateIEs} }, + ... +} + +GNBDUConfigurationUpdateIEs F1AP-PROTOCOL-IES ::= { + { ID id-TransactionID CRITICALITY reject TYPE TransactionID PRESENCE mandatory }| + { ID id-Served-Cells-To-Add-List CRITICALITY reject TYPE Served-Cells-To-Add-List PRESENCE optional }| + { ID id-Served-Cells-To-Modify-List CRITICALITY reject TYPE Served-Cells-To-Modify-List PRESENCE optional }| + { ID id-Served-Cells-To-Delete-List CRITICALITY reject TYPE Served-Cells-To-Delete-List PRESENCE optional }| + { ID id-Active-Cells-List CRITICALITY reject TYPE Active-Cells-List PRESENCE optional }, + ... +} +Served-Cells-To-Add-List ::= SEQUENCE (SIZE(1.. maxCellingNBDU)) OF ProtocolIE-SingleContainer { { Served-Cells-To-Add-ItemIEs } } +Served-Cells-To-Modify-List ::= SEQUENCE (SIZE(1.. maxCellingNBDU)) OF ProtocolIE-SingleContainer { { Served-Cells-To-Modify-ItemIEs } } +Served-Cells-To-Delete-List ::= SEQUENCE (SIZE(1.. maxCellingNBDU)) OF ProtocolIE-SingleContainer { { Served-Cells-To-Delete-ItemIEs } } +Active-Cells-List ::= SEQUENCE (SIZE(0.. maxCellingNBDU)) OF ProtocolIE-SingleContainer { { Active-Cells-ItemIEs } } + +Served-Cells-To-Add-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-Served-Cells-To-Add-Item CRITICALITY reject TYPE Served-Cells-To-Add-Item PRESENCE mandatory }, + ... +} + +Served-Cells-To-Modify-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-Served-Cells-To-Modify-Item CRITICALITY reject TYPE Served-Cells-To-Modify-Item PRESENCE mandatory }, + ... +} + +Served-Cells-To-Delete-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-Served-Cells-To-Delete-Item CRITICALITY reject TYPE Served-Cells-To-Delete-Item PRESENCE mandatory }, +... +} + +Active-Cells-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-Active-Cells-Item CRITICALITY reject TYPE Active-Cells-Item PRESENCE mandatory }, + ... +} + + +-- ************************************************************** +-- +-- GNB-DU CONFIGURATION UPDATE ACKNOWLEDGE +-- +-- ************************************************************** + +GNBDUConfigurationUpdateAcknowledge ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {GNBDUConfigurationUpdateAcknowledgeIEs} }, + ... +} + + +GNBDUConfigurationUpdateAcknowledgeIEs F1AP-PROTOCOL-IES ::= { + { ID id-TransactionID CRITICALITY reject TYPE TransactionID PRESENCE mandatory }| + { ID id-Cells-to-be-Activated-List CRITICALITY reject TYPE Cells-to-be-Activated-List PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- GNB-DU CONFIGURATION UPDATE FAILURE +-- +-- ************************************************************** + +GNBDUConfigurationUpdateFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {GNBDUConfigurationUpdateFailureIEs} }, + ... +} + +GNBDUConfigurationUpdateFailureIEs F1AP-PROTOCOL-IES ::= { + { ID id-TransactionID CRITICALITY reject TYPE TransactionID PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-TimeToWait CRITICALITY ignore TYPE TimeToWait PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- GNB-CU CONFIGURATION UPDATE ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- GNB-CU CONFIGURATION UPDATE +-- +-- ************************************************************** + +GNBCUConfigurationUpdate ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { GNBCUConfigurationUpdateIEs} }, + ... +} + +GNBCUConfigurationUpdateIEs F1AP-PROTOCOL-IES ::= { + { ID id-TransactionID CRITICALITY reject TYPE TransactionID PRESENCE mandatory }| + { ID id-Cells-to-be-Activated-List CRITICALITY reject TYPE Cells-to-be-Activated-List PRESENCE optional }| + { ID id-Cells-to-be-Deactivated-List CRITICALITY reject TYPE Cells-to-be-Deactivated-List PRESENCE optional }| + { ID id-GNB-CU-TNL-Association-To-Add-List CRITICALITY ignore TYPE GNB-CU-TNL-Association-To-Add-List PRESENCE optional }| + { ID id-GNB-CU-TNL-Association-To-Remove-List CRITICALITY ignore TYPE GNB-CU-TNL-Association-To-Remove-List PRESENCE optional }| + { ID id-GNB-CU-TNL-Association-To-Update-List CRITICALITY ignore TYPE GNB-CU-TNL-Association-To-Update-List PRESENCE optional }| + { ID id-Cells-to-be-Barred-List CRITICALITY ignore TYPE Cells-to-be-Barred-List PRESENCE optional }| + { ID id-Protected-EUTRA-Resources-List CRITICALITY reject TYPE Protected-EUTRA-Resources-List PRESENCE optional }, + ... +} + +Cells-to-be-Deactivated-List ::= SEQUENCE (SIZE(1.. maxCellingNBDU)) OF ProtocolIE-SingleContainer { { Cells-to-be-Deactivated-List-ItemIEs } } +GNB-CU-TNL-Association-To-Add-List ::= SEQUENCE (SIZE(1.. maxnoofTNLAssociations)) OF ProtocolIE-SingleContainer { { GNB-CU-TNL-Association-To-Add-ItemIEs } } +GNB-CU-TNL-Association-To-Remove-List ::= SEQUENCE (SIZE(1.. maxnoofTNLAssociations)) OF ProtocolIE-SingleContainer { { GNB-CU-TNL-Association-To-Remove-ItemIEs } } +GNB-CU-TNL-Association-To-Update-List ::= SEQUENCE (SIZE(1.. maxnoofTNLAssociations)) OF ProtocolIE-SingleContainer { { GNB-CU-TNL-Association-To-Update-ItemIEs } } +Cells-to-be-Barred-List ::= SEQUENCE(SIZE(1.. maxCellingNBDU)) OF ProtocolIE-SingleContainer { { Cells-to-be-Barred-ItemIEs } } + + +Cells-to-be-Deactivated-List-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-Cells-to-be-Deactivated-List-Item CRITICALITY reject TYPE Cells-to-be-Deactivated-List-Item PRESENCE mandatory }, +...} + + +GNB-CU-TNL-Association-To-Add-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-GNB-CU-TNL-Association-To-Add-Item CRITICALITY reject TYPE GNB-CU-TNL-Association-To-Add-Item PRESENCE mandatory }, +...} + +GNB-CU-TNL-Association-To-Remove-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-GNB-CU-TNL-Association-To-Remove-Item CRITICALITY reject TYPE GNB-CU-TNL-Association-To-Remove-Item PRESENCE mandatory }, +...} + +GNB-CU-TNL-Association-To-Update-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-GNB-CU-TNL-Association-To-Update-Item CRITICALITY reject TYPE GNB-CU-TNL-Association-To-Update-Item PRESENCE mandatory }, +...} + +Cells-to-be-Barred-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-Cells-to-be-Barred-Item CRITICALITY ignore TYPE Cells-to-be-Barred-Item PRESENCE mandatory }, + ... +} + +Protected-EUTRA-Resources-List ::= SEQUENCE (SIZE(1.. maxCellineNB)) OF ProtocolIE-SingleContainer { { Protected-EUTRA-Resources-ItemIEs } } +Protected-EUTRA-Resources-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-SpectrumSharingGroupID CRITICALITY reject TYPE SpectrumSharingGroupID PRESENCE mandatory}| + { ID id-ListofEUTRACellsinGNBDUCoordination CRITICALITY reject TYPE ListofEUTRACellsinGNBDUCoordination PRESENCE mandatory }, +...} + +-- ************************************************************** +-- +-- GNB-CU CONFIGURATION UPDATE ACKNOWLEDGE +-- +-- ************************************************************** + +GNBCUConfigurationUpdateAcknowledge ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { GNBCUConfigurationUpdateAcknowledgeIEs} }, + ... +} + + +GNBCUConfigurationUpdateAcknowledgeIEs F1AP-PROTOCOL-IES ::= { + { ID id-TransactionID CRITICALITY reject TYPE TransactionID PRESENCE mandatory }| + { ID id-Cells-Failed-to-be-Activated-List CRITICALITY reject TYPE Cells-Failed-to-be-Activated-List PRESENCE optional}| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }| + { ID id-GNB-CU-TNL-Association-Setup-List CRITICALITY ignore TYPE GNB-CU-TNL-Association-Setup-List PRESENCE optional }| + { ID id-GNB-CU-TNL-Association-Failed-To-Setup-List CRITICALITY ignore TYPE GNB-CU-TNL-Association-Failed-To-Setup-List PRESENCE optional }, + ... +} + +Cells-Failed-to-be-Activated-List ::= SEQUENCE (SIZE(1.. maxCellingNBDU)) OF ProtocolIE-SingleContainer { { Cells-Failed-to-be-Activated-List-ItemIEs } } +GNB-CU-TNL-Association-Setup-List ::= SEQUENCE (SIZE(1.. maxnoofTNLAssociations)) OF ProtocolIE-SingleContainer { { GNB-CU-TNL-Association-Setup-ItemIEs } } +GNB-CU-TNL-Association-Failed-To-Setup-List ::= SEQUENCE (SIZE(1.. maxnoofTNLAssociations)) OF ProtocolIE-SingleContainer { { GNB-CU-TNL-Association-Failed-To-Setup-ItemIEs } } + +Cells-Failed-to-be-Activated-List-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-Cells-Failed-to-be-Activated-List-Item CRITICALITY reject TYPE Cells-Failed-to-be-Activated-List-Item PRESENCE mandatory }, + ... +} + +GNB-CU-TNL-Association-Setup-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-GNB-CU-TNL-Association-Setup-Item CRITICALITY reject TYPE GNB-CU-TNL-Association-Setup-Item PRESENCE mandatory }, +...} + + +GNB-CU-TNL-Association-Failed-To-Setup-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-GNB-CU-TNL-Association-Failed-To-Setup-Item CRITICALITY reject TYPE GNB-CU-TNL-Association-Failed-To-Setup-Item PRESENCE mandatory }, +...} + + +-- ************************************************************** +-- +-- GNB-CU CONFIGURATION UPDATE FAILURE +-- +-- ************************************************************** + +GNBCUConfigurationUpdateFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { GNBCUConfigurationUpdateFailureIEs} }, + ... +} + +GNBCUConfigurationUpdateFailureIEs F1AP-PROTOCOL-IES ::= { + { ID id-TransactionID CRITICALITY reject TYPE TransactionID PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-TimeToWait CRITICALITY ignore TYPE TimeToWait PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + + +-- ************************************************************** +-- +-- GNB-DU RESOURCE COORDINATION REQUEST +-- +-- ************************************************************** + +GNBDUResourceCoordinationRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{GNBDUResourceCoordinationRequest-IEs}}, + ... +} + +GNBDUResourceCoordinationRequest-IEs F1AP-PROTOCOL-IES ::= { + { ID id-TransactionID CRITICALITY reject TYPE TransactionID PRESENCE mandatory }| + { ID id-RequestType CRITICALITY reject TYPE RequestType PRESENCE mandatory }| + { ID id-EUTRA-NR-CellResourceCoordinationReq-Container CRITICALITY reject TYPE EUTRA-NR-CellResourceCoordinationReq-Container PRESENCE mandatory}, + ... +} + + +-- ************************************************************** +-- +-- GNB-DU RESOURCE COORDINATION RESPONSE +-- +-- ************************************************************** + +GNBDUResourceCoordinationResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{GNBDUResourceCoordinationResponse-IEs}}, + ... +} + +GNBDUResourceCoordinationResponse-IEs F1AP-PROTOCOL-IES ::= { + { ID id-TransactionID CRITICALITY reject TYPE TransactionID PRESENCE mandatory }| + { ID id-EUTRA-NR-CellResourceCoordinationReqAck-Container CRITICALITY reject TYPE EUTRA-NR-CellResourceCoordinationReqAck-Container PRESENCE mandatory}, + ... +} + +-- ************************************************************** +-- +-- UE Context Setup ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- UE CONTEXT SETUP REQUEST +-- +-- ************************************************************** + +UEContextSetupRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { UEContextSetupRequestIEs} }, + ... +} + +UEContextSetupRequestIEs F1AP-PROTOCOL-IES ::= { + { ID id-gNB-CU-UE-F1AP-ID CRITICALITY reject TYPE GNB-CU-UE-F1AP-ID PRESENCE mandatory }| + { ID id-gNB-DU-UE-F1AP-ID CRITICALITY ignore TYPE GNB-DU-UE-F1AP-ID PRESENCE optional }| + { ID id-SpCell-ID CRITICALITY reject TYPE NRCGI PRESENCE mandatory }| + { ID id-ServCellndex CRITICALITY reject TYPE ServCellIndex PRESENCE mandatory }| + { ID id-SpCellULConfigured CRITICALITY ignore TYPE CellULConfigured PRESENCE optional }| + { ID id-CUtoDURRCInformation CRITICALITY reject TYPE CUtoDURRCInformation PRESENCE mandatory}| + { ID id-Candidate-SpCell-List CRITICALITY ignore TYPE Candidate-SpCell-List PRESENCE optional }| + { ID id-DRXCycle CRITICALITY ignore TYPE DRXCycle PRESENCE optional }| + { ID id-ResourceCoordinationTransferContainer CRITICALITY ignore TYPE ResourceCoordinationTransferContainer PRESENCE optional }| + { ID id-SCell-ToBeSetup-List CRITICALITY ignore TYPE SCell-ToBeSetup-List PRESENCE optional }| + { ID id-SRBs-ToBeSetup-List CRITICALITY reject TYPE SRBs-ToBeSetup-List PRESENCE optional }| + { ID id-DRBs-ToBeSetup-List CRITICALITY reject TYPE DRBs-ToBeSetup-List PRESENCE optional }| + { ID id-InactivityMonitoringRequest CRITICALITY reject TYPE InactivityMonitoringRequest PRESENCE optional }| + { ID id-RAT-FrequencyPriorityInformation CRITICALITY reject TYPE RAT-FrequencyPriorityInformation PRESENCE optional }| + { ID id-RRCContainer CRITICALITY ignore TYPE RRCContainer PRESENCE optional }| + { ID id-MaskedIMEISV CRITICALITY ignore TYPE MaskedIMEISV PRESENCE optional }, + ... +} + +Candidate-SpCell-List::= SEQUENCE (SIZE(1..maxnoofCandidateSpCells)) OF ProtocolIE-SingleContainer { { Candidate-SpCell-ItemIEs} } +SCell-ToBeSetup-List::= SEQUENCE (SIZE(1..maxnoofSCells)) OF ProtocolIE-SingleContainer { { SCell-ToBeSetup-ItemIEs} } +SRBs-ToBeSetup-List ::= SEQUENCE (SIZE(1..maxnoofSRBs)) OF ProtocolIE-SingleContainer { { SRBs-ToBeSetup-ItemIEs} } +DRBs-ToBeSetup-List ::= SEQUENCE (SIZE(1..maxnoofDRBs)) OF ProtocolIE-SingleContainer { { DRBs-ToBeSetup-ItemIEs} } + + +Candidate-SpCell-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-Candidate-SpCell-Item CRITICALITY ignore TYPE Candidate-SpCell-Item PRESENCE mandatory }, + ... +} + + +SCell-ToBeSetup-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-SCell-ToBeSetup-Item CRITICALITY ignore TYPE SCell-ToBeSetup-Item PRESENCE mandatory }, + ... +} + +SRBs-ToBeSetup-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-SRBs-ToBeSetup-Item CRITICALITY reject TYPE SRBs-ToBeSetup-Item PRESENCE mandatory}, + ... +} + +DRBs-ToBeSetup-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-DRBs-ToBeSetup-Item CRITICALITY reject TYPE DRBs-ToBeSetup-Item PRESENCE mandatory}, + ... +} + + + +-- ************************************************************** +-- +-- UE CONTEXT SETUP RESPONSE +-- +-- ************************************************************** + +UEContextSetupResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { UEContextSetupResponseIEs} }, + ... +} + + +UEContextSetupResponseIEs F1AP-PROTOCOL-IES ::= { + { ID id-gNB-CU-UE-F1AP-ID CRITICALITY reject TYPE GNB-CU-UE-F1AP-ID PRESENCE mandatory }| + { ID id-gNB-DU-UE-F1AP-ID CRITICALITY reject TYPE GNB-DU-UE-F1AP-ID PRESENCE mandatory }| + { ID id-DUtoCURRCInformation CRITICALITY reject TYPE DUtoCURRCInformation PRESENCE mandatory }| + { ID id-C-RNTI CRITICALITY ignore TYPE C-RNTI PRESENCE optional }| + { ID id-ResourceCoordinationTransferContainer CRITICALITY ignore TYPE ResourceCoordinationTransferContainer PRESENCE optional }| + { ID id-FullConfiguration CRITICALITY reject TYPE FullConfiguration PRESENCE optional }| + { ID id-DRBs-Setup-List CRITICALITY ignore TYPE DRBs-Setup-List PRESENCE optional }| + { ID id-SRBs-FailedToBeSetup-List CRITICALITY ignore TYPE SRBs-FailedToBeSetup-List PRESENCE optional }| + { ID id-DRBs-FailedToBeSetup-List CRITICALITY ignore TYPE DRBs-FailedToBeSetup-List PRESENCE optional }| + { ID id-SCell-FailedtoSetup-List CRITICALITY ignore TYPE SCell-FailedtoSetup-List PRESENCE optional }| + { ID id-InactivityMonitoringResponse CRITICALITY reject TYPE InactivityMonitoringResponse PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +DRBs-Setup-List ::= SEQUENCE (SIZE(1..maxnoofDRBs)) OF ProtocolIE-SingleContainer { { DRBs-Setup-ItemIEs} } +SRBs-FailedToBeSetup-List ::= SEQUENCE (SIZE(1..maxnoofSRBs)) OF ProtocolIE-SingleContainer { { SRBs-FailedToBeSetup-ItemIEs} } +DRBs-FailedToBeSetup-List ::= SEQUENCE (SIZE(1..maxnoofDRBs)) OF ProtocolIE-SingleContainer { { DRBs-FailedToBeSetup-ItemIEs} } +SCell-FailedtoSetup-List ::= SEQUENCE (SIZE(1..maxnoofSCells)) OF ProtocolIE-SingleContainer { { SCell-FailedtoSetup-ItemIEs} } + +DRBs-Setup-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-DRBs-Setup-Item CRITICALITY ignore TYPE DRBs-Setup-Item PRESENCE mandatory}, + ... +} + +SRBs-FailedToBeSetup-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-SRBs-FailedToBeSetup-Item CRITICALITY ignore TYPE SRBs-FailedToBeSetup-Item PRESENCE mandatory}, + ... +} + + +DRBs-FailedToBeSetup-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-DRBs-FailedToBeSetup-Item CRITICALITY ignore TYPE DRBs-FailedToBeSetup-Item PRESENCE mandatory}, + ... +} + +SCell-FailedtoSetup-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-SCell-FailedtoSetup-Item CRITICALITY ignore TYPE SCell-FailedtoSetup-Item PRESENCE mandatory}, + ... +} + +-- ************************************************************** +-- +-- UE CONTEXT SETUP FAILURE +-- +-- ************************************************************** + +UEContextSetupFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { UEContextSetupFailureIEs} }, + ... +} + +UEContextSetupFailureIEs F1AP-PROTOCOL-IES ::= { + { ID id-gNB-CU-UE-F1AP-ID CRITICALITY reject TYPE GNB-CU-UE-F1AP-ID PRESENCE mandatory }| + { ID id-gNB-DU-UE-F1AP-ID CRITICALITY ignore TYPE GNB-DU-UE-F1AP-ID PRESENCE optional }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }| + { ID id-Potential-SpCell-List CRITICALITY ignore TYPE Potential-SpCell-List PRESENCE optional }, + ... +} + +Potential-SpCell-List::= SEQUENCE (SIZE(0..maxnoofPotentialSpCells)) OF ProtocolIE-SingleContainer { { Potential-SpCell-ItemIEs} } + +Potential-SpCell-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-Potential-SpCell-Item CRITICALITY ignore TYPE Potential-SpCell-Item PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- UE Context Release Request ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- UE Context Release Request +-- +-- ************************************************************** + +UEContextReleaseRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{ UEContextReleaseRequestIEs}}, + ... +} + +UEContextReleaseRequestIEs F1AP-PROTOCOL-IES ::= { + { ID id-gNB-CU-UE-F1AP-ID CRITICALITY reject TYPE GNB-CU-UE-F1AP-ID PRESENCE mandatory }| + { ID id-gNB-DU-UE-F1AP-ID CRITICALITY reject TYPE GNB-DU-UE-F1AP-ID PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }, + ... +} + + +-- ************************************************************** +-- +-- UE Context Release (gNB-CU initiated) ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- UE CONTEXT RELEASE COMMAND +-- +-- ************************************************************** + +UEContextReleaseCommand ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { UEContextReleaseCommandIEs} }, + ... +} + +UEContextReleaseCommandIEs F1AP-PROTOCOL-IES ::= { + { ID id-gNB-CU-UE-F1AP-ID CRITICALITY reject TYPE GNB-CU-UE-F1AP-ID PRESENCE mandatory }| + { ID id-gNB-DU-UE-F1AP-ID CRITICALITY reject TYPE GNB-DU-UE-F1AP-ID PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-RRCContainer CRITICALITY ignore TYPE RRCContainer PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- UE CONTEXT RELEASE COMPLETE +-- +-- ************************************************************** + +UEContextReleaseComplete ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { UEContextReleaseCompleteIEs} }, + ... +} + + +UEContextReleaseCompleteIEs F1AP-PROTOCOL-IES ::= { + { ID id-gNB-CU-UE-F1AP-ID CRITICALITY reject TYPE GNB-CU-UE-F1AP-ID PRESENCE mandatory }| + { ID id-gNB-DU-UE-F1AP-ID CRITICALITY reject TYPE GNB-DU-UE-F1AP-ID PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, ... +} + +-- ************************************************************** +-- +-- UE Context Modification ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- UE CONTEXT MODIFICATION REQUEST +-- +-- ************************************************************** + +UEContextModificationRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { UEContextModificationRequestIEs} }, + ... +} + +UEContextModificationRequestIEs F1AP-PROTOCOL-IES ::= { + { ID id-gNB-CU-UE-F1AP-ID CRITICALITY reject TYPE GNB-CU-UE-F1AP-ID PRESENCE mandatory }| + { ID id-gNB-DU-UE-F1AP-ID CRITICALITY reject TYPE GNB-DU-UE-F1AP-ID PRESENCE mandatory }| + { ID id-SpCell-ID CRITICALITY ignore TYPE NRCGI PRESENCE optional }| + { ID id-ServCellndex CRITICALITY reject TYPE ServCellIndex PRESENCE mandatory }| + { ID id-SpCellULConfigured CRITICALITY ignore TYPE CellULConfigured PRESENCE optional }| + { ID id-DRXCycle CRITICALITY ignore TYPE DRXCycle PRESENCE optional }| + { ID id-CUtoDURRCInformation CRITICALITY reject TYPE CUtoDURRCInformation PRESENCE optional }| + { ID id-TransmissionStopIndicator CRITICALITY ignore TYPE TransmissionStopIndicator PRESENCE optional }| + { ID id-ResourceCoordinationTransferContainer CRITICALITY ignore TYPE ResourceCoordinationTransferContainer PRESENCE optional }| + { ID id-RRCRconfigurationCompleteIndicator CRITICALITY ignore TYPE RRCRconfigurationCompleteIndicator PRESENCE optional }| + { ID id-RRCContainer CRITICALITY reject TYPE RRCContainer PRESENCE optional }| + { ID id-SCell-ToBeSetupMod-List CRITICALITY ignore TYPE SCell-ToBeSetupMod-List PRESENCE optional }| + { ID id-SCell-ToBeRemoved-List CRITICALITY ignore TYPE SCell-ToBeRemoved-List PRESENCE optional }| + { ID id-SRBs-ToBeSetupMod-List CRITICALITY reject TYPE SRBs-ToBeSetupMod-List PRESENCE optional }| + { ID id-DRBs-ToBeSetupMod-List CRITICALITY reject TYPE DRBs-ToBeSetupMod-List PRESENCE optional }| + { ID id-DRBs-ToBeModified-List CRITICALITY reject TYPE DRBs-ToBeModified-List PRESENCE optional }| + { ID id-SRBs-ToBeReleased-List CRITICALITY reject TYPE SRBs-ToBeReleased-List PRESENCE optional }| + { ID id-DRBs-ToBeReleased-List CRITICALITY reject TYPE DRBs-ToBeReleased-List PRESENCE optional }| + { ID id-InactivityMonitoringRequest CRITICALITY reject TYPE InactivityMonitoringRequest PRESENCE optional }| + { ID id-RAT-FrequencyPriorityInformation CRITICALITY reject TYPE RAT-FrequencyPriorityInformation PRESENCE optional }, + ... +} + +SCell-ToBeSetupMod-List::= SEQUENCE (SIZE(1..maxnoofSCells)) OF ProtocolIE-SingleContainer { { SCell-ToBeSetupMod-ItemIEs} } +SCell-ToBeRemoved-List::= SEQUENCE (SIZE(1..maxnoofSCells)) OF ProtocolIE-SingleContainer { { SCell-ToBeRemoved-ItemIEs} } +SRBs-ToBeSetupMod-List ::= SEQUENCE (SIZE(1..maxnoofSRBs)) OF ProtocolIE-SingleContainer { { SRBs-ToBeSetupMod-ItemIEs} } +DRBs-ToBeSetupMod-List ::= SEQUENCE (SIZE(1..maxnoofDRBs)) OF ProtocolIE-SingleContainer { { DRBs-ToBeSetupMod-ItemIEs} } + +DRBs-ToBeModified-List ::= SEQUENCE (SIZE(1..maxnoofDRBs)) OF ProtocolIE-SingleContainer { { DRBs-ToBeModified-ItemIEs} } +SRBs-ToBeReleased-List ::= SEQUENCE (SIZE(1..maxnoofSRBs)) OF ProtocolIE-SingleContainer { { SRBs-ToBeReleased-ItemIEs} } +DRBs-ToBeReleased-List ::= SEQUENCE (SIZE(1..maxnoofDRBs)) OF ProtocolIE-SingleContainer { { DRBs-ToBeReleased-ItemIEs} } + +SCell-ToBeSetupMod-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-SCell-ToBeSetupMod-Item CRITICALITY ignore TYPE SCell-ToBeSetupMod-Item PRESENCE mandatory }, + ... +} + +SCell-ToBeRemoved-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-SCell-ToBeRemoved-Item CRITICALITY ignore TYPE SCell-ToBeRemoved-Item PRESENCE mandatory }, + ... +} + + +SRBs-ToBeSetupMod-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-SRBs-ToBeSetupMod-Item CRITICALITY reject TYPE SRBs-ToBeSetupMod-Item PRESENCE mandatory}, + ... +} + + +DRBs-ToBeSetupMod-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-DRBs-ToBeSetupMod-Item CRITICALITY reject TYPE DRBs-ToBeSetupMod-Item PRESENCE mandatory}, + ... +} + +DRBs-ToBeModified-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-DRBs-ToBeModified-Item CRITICALITY reject TYPE DRBs-ToBeModified-Item PRESENCE mandatory}, + ... +} + + +SRBs-ToBeReleased-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-SRBs-ToBeReleased-Item CRITICALITY reject TYPE SRBs-ToBeReleased-Item PRESENCE mandatory}, + ... +} + +DRBs-ToBeReleased-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-DRBs-ToBeReleased-Item CRITICALITY reject TYPE DRBs-ToBeReleased-Item PRESENCE mandatory}, + ... +} + +-- ************************************************************** +-- +-- UE CONTEXT MODIFICATION RESPONSE +-- +-- ************************************************************** + +UEContextModificationResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { UEContextModificationResponseIEs} }, + ... +} + + +UEContextModificationResponseIEs F1AP-PROTOCOL-IES ::= { + { ID id-gNB-CU-UE-F1AP-ID CRITICALITY reject TYPE GNB-CU-UE-F1AP-ID PRESENCE mandatory }| + { ID id-gNB-DU-UE-F1AP-ID CRITICALITY reject TYPE GNB-DU-UE-F1AP-ID PRESENCE mandatory }| + { ID id-ResourceCoordinationTransferContainer CRITICALITY ignore TYPE ResourceCoordinationTransferContainer PRESENCE optional }| + { ID id-DUtoCURRCInformation CRITICALITY reject TYPE DUtoCURRCInformation PRESENCE optional}| + { ID id-DRBs-SetupMod-List CRITICALITY ignore TYPE DRBs-SetupMod-List PRESENCE optional}| + { ID id-DRBs-Modified-List CRITICALITY ignore TYPE DRBs-Modified-List PRESENCE optional}| + { ID id-SRBs-FailedToBeSetupMod-List CRITICALITY ignore TYPE SRBs-FailedToBeSetupMod-List PRESENCE optional }| + { ID id-DRBs-FailedToBeSetupMod-List CRITICALITY ignore TYPE DRBs-FailedToBeSetupMod-List PRESENCE optional }| + { ID id-SCell-FailedtoSetupMod-List CRITICALITY ignore TYPE SCell-FailedtoSetupMod-List PRESENCE optional }| + { ID id-DRBs-FailedToBeModified-List CRITICALITY ignore TYPE DRBs-FailedToBeModified-List PRESENCE optional }| + { ID id-InactivityMonitoringResponse CRITICALITY reject TYPE InactivityMonitoringResponse PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + + +DRBs-SetupMod-List ::= SEQUENCE (SIZE(1..maxnoofDRBs)) OF ProtocolIE-SingleContainer { { DRBs-SetupMod-ItemIEs} } +DRBs-Modified-List::= SEQUENCE (SIZE(1..maxnoofDRBs)) OF ProtocolIE-SingleContainer { { DRBs-Modified-ItemIEs } } +DRBs-FailedToBeModified-List ::= SEQUENCE (SIZE(1..maxnoofDRBs)) OF ProtocolIE-SingleContainer { { DRBs-FailedToBeModified-ItemIEs} } +SRBs-FailedToBeSetupMod-List ::= SEQUENCE (SIZE(1..maxnoofSRBs)) OF ProtocolIE-SingleContainer { { SRBs-FailedToBeSetupMod-ItemIEs} } +DRBs-FailedToBeSetupMod-List ::= SEQUENCE (SIZE(1..maxnoofDRBs)) OF ProtocolIE-SingleContainer { { DRBs-FailedToBeSetupMod-ItemIEs} } +SCell-FailedtoSetupMod-List ::= SEQUENCE (SIZE(1..maxnoofSCells)) OF ProtocolIE-SingleContainer { { SCell-FailedtoSetupMod-ItemIEs} } + +DRBs-SetupMod-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-DRBs-SetupMod-Item CRITICALITY ignore TYPE DRBs-SetupMod-Item PRESENCE mandatory}, + ... +} + + +DRBs-Modified-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-DRBs-Modified-Item CRITICALITY ignore TYPE DRBs-Modified-Item PRESENCE mandatory}, + ... +} + +SRBs-FailedToBeSetupMod-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-SRBs-FailedToBeSetupMod-Item CRITICALITY ignore TYPE SRBs-FailedToBeSetupMod-Item PRESENCE mandatory}, + ... +} + + + +DRBs-FailedToBeSetupMod-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-DRBs-FailedToBeSetupMod-Item CRITICALITY ignore TYPE DRBs-FailedToBeSetupMod-Item PRESENCE mandatory}, + ... +} + + +DRBs-FailedToBeModified-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-DRBs-FailedToBeModified-Item CRITICALITY ignore TYPE DRBs-FailedToBeModified-Item PRESENCE mandatory}, + ... +} + +SCell-FailedtoSetupMod-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-SCell-FailedtoSetupMod-Item CRITICALITY ignore TYPE SCell-FailedtoSetupMod-Item PRESENCE mandatory}, + ... +} + +-- ************************************************************** +-- +-- UE CONTEXT MODIFICATION FAILURE +-- +-- ************************************************************** + +UEContextModificationFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { UEContextModificationFailureIEs} }, + ... +} + +UEContextModificationFailureIEs F1AP-PROTOCOL-IES ::= { + { ID id-gNB-CU-UE-F1AP-ID CRITICALITY reject TYPE GNB-CU-UE-F1AP-ID PRESENCE mandatory }| + { ID id-gNB-DU-UE-F1AP-ID CRITICALITY reject TYPE GNB-DU-UE-F1AP-ID PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + + +-- ************************************************************** +-- +-- UE Context Modification Required (gNB-DU initiated) ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- UE CONTEXT MODIFICATION REQUIRED +-- +-- ************************************************************** + +UEContextModificationRequired ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { UEContextModificationRequiredIEs} }, + ... +} + +UEContextModificationRequiredIEs F1AP-PROTOCOL-IES ::= { + { ID id-gNB-CU-UE-F1AP-ID CRITICALITY reject TYPE GNB-CU-UE-F1AP-ID PRESENCE mandatory }| + { ID id-gNB-DU-UE-F1AP-ID CRITICALITY reject TYPE GNB-DU-UE-F1AP-ID PRESENCE mandatory }| + { ID id-ResourceCoordinationTransferContainer CRITICALITY ignore TYPE ResourceCoordinationTransferContainer PRESENCE optional }| + { ID id-DUtoCURRCInformation CRITICALITY reject TYPE DUtoCURRCInformation PRESENCE optional}| + { ID id-DRBs-Required-ToBeModified-List CRITICALITY reject TYPE DRBs-Required-ToBeModified-List PRESENCE optional}| + { ID id-SRBs-Required-ToBeReleased-List CRITICALITY reject TYPE SRBs-Required-ToBeReleased-List PRESENCE optional}| + { ID id-DRBs-Required-ToBeReleased-List CRITICALITY reject TYPE DRBs-Required-ToBeReleased-List PRESENCE optional}| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }, + ... +} + +DRBs-Required-ToBeModified-List::= SEQUENCE (SIZE(1..maxnoofDRBs)) OF ProtocolIE-SingleContainer { { DRBs-Required-ToBeModified-ItemIEs } } +DRBs-Required-ToBeReleased-List::= SEQUENCE (SIZE(1..maxnoofDRBs)) OF ProtocolIE-SingleContainer { { DRBs-Required-ToBeReleased-ItemIEs } } + +SRBs-Required-ToBeReleased-List::= SEQUENCE (SIZE(1..maxnoofSRBs)) OF ProtocolIE-SingleContainer { { SRBs-Required-ToBeReleased-ItemIEs } } + +DRBs-Required-ToBeModified-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-DRBs-Required-ToBeModified-Item CRITICALITY reject TYPE DRBs-Required-ToBeModified-Item PRESENCE mandatory}, + ... +} + +DRBs-Required-ToBeReleased-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-DRBs-Required-ToBeReleased-Item CRITICALITY reject TYPE DRBs-Required-ToBeReleased-Item PRESENCE mandatory}, + ... +} + +SRBs-Required-ToBeReleased-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-SRBs-Required-ToBeReleased-Item CRITICALITY reject TYPE SRBs-Required-ToBeReleased-Item PRESENCE mandatory}, + ... +} + +-- ************************************************************** +-- +-- UE CONTEXT MODIFICATION CONFIRM +-- +-- ************************************************************** + +UEContextModificationConfirm::= SEQUENCE { + protocolIEs ProtocolIE-Container { { UEContextModificationConfirmIEs} }, + ... +} + + +UEContextModificationConfirmIEs F1AP-PROTOCOL-IES ::= { + { ID id-gNB-CU-UE-F1AP-ID CRITICALITY reject TYPE GNB-CU-UE-F1AP-ID PRESENCE mandatory }| + { ID id-gNB-DU-UE-F1AP-ID CRITICALITY reject TYPE GNB-DU-UE-F1AP-ID PRESENCE mandatory }| + { ID id-ResourceCoordinationTransferContainer CRITICALITY ignore TYPE ResourceCoordinationTransferContainer PRESENCE optional }| + { ID id-DRBs-ModifiedConf-List CRITICALITY ignore TYPE DRBs-ModifiedConf-List PRESENCE optional}| + { ID id-RRCContainer CRITICALITY ignore TYPE RRCContainer PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +DRBs-ModifiedConf-List::= SEQUENCE (SIZE(1..maxnoofDRBs)) OF ProtocolIE-SingleContainer { { DRBs-ModifiedConf-ItemIEs } } + +DRBs-ModifiedConf-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-DRBs-ModifiedConf-Item CRITICALITY ignore TYPE DRBs-ModifiedConf-Item PRESENCE mandatory}, + ... +} + + + +-- ************************************************************** +-- +-- WRITE-REPLACE WARNING ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- Write-Replace Warning Request +-- +-- ************************************************************** + +WriteReplaceWarningRequest ::= SEQUENCE { +protocolIEs ProtocolIE-Container { {WriteReplaceWarningRequestIEs} }, +... +} +WriteReplaceWarningRequestIEs F1AP-PROTOCOL-IES ::= { +{ ID id-TransactionID CRITICALITY reject TYPE TransactionID PRESENCE mandatory }| +{ ID id-PWSSystemInformation CRITICALITY reject TYPE PWSSystemInformation PRESENCE mandatory }| +{ ID id-RepetitionPeriod CRITICALITY reject TYPE RepetitionPeriod PRESENCE mandatory }| +{ ID id-NumberofBroadcastRequest CRITICALITY reject TYPE NumberofBroadcastRequest PRESENCE mandatory }| +{ ID id-ConcurrentWarningMessageIndicator CRITICALITY reject TYPE ConcurrentWarningMessageIndicator PRESENCE optional }| +{ ID id-Cells-To-Be-Broadcast-List CRITICALITY reject TYPE Cells-To-Be-Broadcast-List PRESENCE optional }, +... +} +Cells-To-Be-Broadcast-List ::= SEQUENCE (SIZE(1.. maxCellingNBDU)) OF ProtocolIE-SingleContainer { { Cells-To-Be-Broadcast-List-ItemIEs } } + +Cells-To-Be-Broadcast-List-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-Cells-To-Be-Broadcast-Item CRITICALITY reject TYPE Cells-To-Be-Broadcast-Item PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- Write-Replace Warning Response +-- +-- ************************************************************** + +WriteReplaceWarningResponse ::= SEQUENCE { +protocolIEs ProtocolIE-Container { {WriteReplaceWarningResponseIEs} }, +... +} +WriteReplaceWarningResponseIEs F1AP-PROTOCOL-IES ::= { +{ ID id-TransactionID CRITICALITY reject TYPE TransactionID PRESENCE mandatory }| +{ ID id-Cells-Broadcast-Completed-List CRITICALITY reject TYPE Cells-Broadcast-Completed-List PRESENCE optional }| +{ ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, +... +} +Cells-Broadcast-Completed-List ::= SEQUENCE (SIZE(1.. maxCellingNBDU)) OF ProtocolIE-SingleContainer { { Cells-Broadcast-Completed-List-ItemIEs } } + +Cells-Broadcast-Completed-List-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-Cells-Broadcast-Completed-Item CRITICALITY reject TYPE Cells-Broadcast-Completed-Item PRESENCE mandatory }, + ... +} + + +-- ************************************************************** +-- +-- PWS CANCEL ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- PWS Cancel Request +-- +-- ************************************************************** + +PWSCancelRequest ::= SEQUENCE { +protocolIEs ProtocolIE-Container { {PWSCancelRequestIEs} }, +... +} +PWSCancelRequestIEs F1AP-PROTOCOL-IES ::= { +{ ID id-TransactionID CRITICALITY reject TYPE TransactionID PRESENCE mandatory }| +{ ID id-NumberofBroadcastRequest CRITICALITY reject TYPE NumberofBroadcastRequest PRESENCE mandatory }| +{ ID id-Broadcast-To-Be-Cancelled-List CRITICALITY reject TYPE Broadcast-To-Be-Cancelled-List PRESENCE optional }| +{ ID id-Cancel-all-Warning-Messages-Indicator CRITICALITY reject TYPE Cancel-all-Warning-Messages-Indicator PRESENCE optional } +, +... +} +Broadcast-To-Be-Cancelled-List ::= SEQUENCE (SIZE(1.. maxCellingNBDU)) OF ProtocolIE-SingleContainer { { Broadcast-To-Be-Cancelled-List-ItemIEs } } + +Broadcast-To-Be-Cancelled-List-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-Broadcast-To-Be-Cancelled-Item CRITICALITY reject TYPE Broadcast-To-Be-Cancelled-Item PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- PWS Cancel Response +-- +-- ************************************************************** + +PWSCancelResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {PWSCancelResponseIEs} }, +... +} + +PWSCancelResponseIEs F1AP-PROTOCOL-IES ::= { +{ ID id-TransactionID CRITICALITY reject TYPE TransactionID PRESENCE mandatory }| +{ ID id-Cells-Broadcast-Cancelled-List CRITICALITY reject TYPE Cells-Broadcast-Cancelled-List PRESENCE optional }| +{ ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, +... +} +Cells-Broadcast-Cancelled-List ::= SEQUENCE (SIZE(1.. maxCellingNBDU)) OF ProtocolIE-SingleContainer { { Cells-Broadcast-Cancelled-List-ItemIEs } } + +Cells-Broadcast-Cancelled-List-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-Cells-Broadcast-Cancelled-Item CRITICALITY reject TYPE Cells-Broadcast-Cancelled-Item PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- UE Inactivity Notification ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- UE Inactivity Notification +-- +-- ************************************************************** + +UEInactivityNotification ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{ UEInactivityNotificationIEs}}, + ... +} + +UEInactivityNotificationIEs F1AP-PROTOCOL-IES ::= { + { ID id-gNB-CU-UE-F1AP-ID CRITICALITY reject TYPE GNB-CU-UE-F1AP-ID PRESENCE mandatory }| + { ID id-gNB-DU-UE-F1AP-ID CRITICALITY reject TYPE GNB-DU-UE-F1AP-ID PRESENCE mandatory }| + { ID id-DRB-Activity-List CRITICALITY reject TYPE DRB-Activity-List PRESENCE mandatory } , + ... +} + +DRB-Activity-List::= SEQUENCE (SIZE(1..maxnoofDRBs)) OF ProtocolIE-SingleContainer { { DRB-Activity-ItemIEs } } + +DRB-Activity-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-DRB-Activity-Item CRITICALITY reject TYPE DRB-Activity-Item PRESENCE mandatory}, + ... +} + +-- ************************************************************** +-- +-- Initial UL RRC Message Transfer ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- INITIAL UL RRC Message Transfer +-- +-- ************************************************************** + +InitialULRRCMessageTransfer ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{ InitialULRRCMessageTransferIEs}}, + ... +} + +InitialULRRCMessageTransferIEs F1AP-PROTOCOL-IES ::= { + { ID id-gNB-DU-UE-F1AP-ID CRITICALITY reject TYPE GNB-DU-UE-F1AP-ID PRESENCE mandatory }| + { ID id-NRCGI CRITICALITY reject TYPE NRCGI PRESENCE mandatory }| + { ID id-C-RNTI CRITICALITY reject TYPE C-RNTI PRESENCE mandatory }| + { ID id-RRCContainer CRITICALITY reject TYPE RRCContainer PRESENCE mandatory }| + { ID id-DUtoCURRCContainer CRITICALITY reject TYPE DUtoCURRCContainer PRESENCE optional }, + ... +} + + +-- ************************************************************** +-- +-- DL RRC Message Transfer ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- DL RRC Message Transfer +-- +-- ************************************************************** + +DLRRCMessageTransfer ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{ DLRRCMessageTransferIEs}}, + ... +} + +DLRRCMessageTransferIEs F1AP-PROTOCOL-IES ::= { + { ID id-gNB-CU-UE-F1AP-ID CRITICALITY reject TYPE GNB-CU-UE-F1AP-ID PRESENCE mandatory }| + { ID id-gNB-DU-UE-F1AP-ID CRITICALITY reject TYPE GNB-DU-UE-F1AP-ID PRESENCE mandatory }| + { ID id-oldgNB-DU-UE-F1AP-ID CRITICALITY reject TYPE GNB-DU-UE-F1AP-ID PRESENCE optional }| + { ID id-SRBID CRITICALITY reject TYPE SRBID PRESENCE mandatory }| + { ID id-ExecuteDuplication CRITICALITY ignore TYPE ExecuteDuplication PRESENCE optional}| + { ID id-RRCContainer CRITICALITY reject TYPE RRCContainer PRESENCE mandatory }| + { ID id-RAT-FrequencyPriorityInformation CRITICALITY reject TYPE RAT-FrequencyPriorityInformation PRESENCE optional }, + ... +} +-- ************************************************************** +-- +-- UL RRC Message Transfer ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- UL RRC Message Transfer +-- +-- ************************************************************** + +ULRRCMessageTransfer ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{ ULRRCMessageTransferIEs}}, + ... +} + +ULRRCMessageTransferIEs F1AP-PROTOCOL-IES ::= { + { ID id-gNB-CU-UE-F1AP-ID CRITICALITY reject TYPE GNB-CU-UE-F1AP-ID PRESENCE mandatory }| + { ID id-gNB-DU-UE-F1AP-ID CRITICALITY reject TYPE GNB-DU-UE-F1AP-ID PRESENCE mandatory }| + { ID id-SRBID CRITICALITY reject TYPE SRBID PRESENCE mandatory }| + { ID id-RRCContainer CRITICALITY reject TYPE RRCContainer PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- PRIVATE MESSAGE +-- +-- ************************************************************** + +PrivateMessage ::= SEQUENCE { + privateIEs PrivateIE-Container {{PrivateMessage-IEs}}, + ... +} + +PrivateMessage-IEs F1AP-PRIVATE-IES ::= { + ... +} + + +-- ************************************************************** +-- +-- System Information ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- System information Delivery Command +-- +-- ************************************************************** + +SystemInformationDeliveryCommand ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{ SystemInformationDeliveryCommandIEs}}, + ... +} + +SystemInformationDeliveryCommandIEs F1AP-PROTOCOL-IES ::= { + { ID id-NRCGI CRITICALITY reject TYPE NRCGI PRESENCE mandatory }| + { ID id-SIBtype-List CRITICALITY reject TYPE SIBtype-List PRESENCE mandatory }| + { ID id-ConfirmedUEID CRITICALITY reject TYPE GNB-DU-UE-F1AP-ID PRESENCE mandatory }, + ... +} + + +-- ************************************************************** +-- +-- Paging PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- Paging +-- +-- ************************************************************** + +Paging ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{ PagingIEs}}, + ... +} + +PagingIEs F1AP-PROTOCOL-IES ::= { + { ID id-UEIdentityIndexValue CRITICALITY reject TYPE UEIdentityIndexValue PRESENCE mandatory }| + { ID id-PagingIdentity CRITICALITY reject TYPE PagingIdentity PRESENCE optional }| + { ID id-PagingDRX CRITICALITY ignore TYPE PagingDRX PRESENCE optional }| + { ID id-PagingPriority CRITICALITY ignore TYPE PagingPriority PRESENCE optional }| + { ID id-PagingCell-List CRITICALITY ignore TYPE PagingCell-list PRESENCE optional }, + ... +} + +PagingCell-list::= SEQUENCE (SIZE(1.. maxnoofPagingCells)) OF ProtocolIE-SingleContainer { { PagingCell-ItemIEs } } + +PagingCell-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-PagingCell-Item CRITICALITY ignore TYPE PagingCell-Item PRESENCE mandatory} , + ... +} + + + +-- ************************************************************** +-- +-- Notify +-- +-- ************************************************************** + +Notify ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{ NotifyIEs}}, + ... +} + +NotifyIEs F1AP-PROTOCOL-IES ::= { + { ID id-gNB-CU-UE-F1AP-ID CRITICALITY reject TYPE GNB-CU-UE-F1AP-ID PRESENCE mandatory }| + { ID id-gNB-DU-UE-F1AP-ID CRITICALITY reject TYPE GNB-DU-UE-F1AP-ID PRESENCE mandatory }| + { ID id-DRB-Notify-List CRITICALITY reject TYPE DRB-Notify-List PRESENCE mandatory }, + ... +} + +DRB-Notify-List::= SEQUENCE (SIZE(1)) OF ProtocolIE-SingleContainer { { DRB-Notify-ItemIEs } } + +DRB-Notify-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-DRB-Notify-Item CRITICALITY reject TYPE DRB-Notify-Item PRESENCE mandatory}, + ... +} + + + +-- ************************************************************** +-- +-- PWS RESTART INDICATION ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- PWS Restart Indication +-- +-- ************************************************************** + +PWSRestartIndication ::= SEQUENCE { +protocolIEs ProtocolIE-Container { { PWSRestartIndicationIEs} }, +... +} +PWSRestartIndicationIEs F1AP-PROTOCOL-IES ::= { +{ ID id-NR-CGI-List-For-Restart-List CRITICALITY reject TYPE NR-CGI-List-For-Restart-List PRESENCE optional }, +... +} +NR-CGI-List-For-Restart-List ::= SEQUENCE (SIZE(1.. maxCellingNBDU)) OF ProtocolIE-SingleContainer { { NR-CGI-List-For-Restart-List-ItemIEs } } + +NR-CGI-List-For-Restart-List-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-NR-CGI-List-For-Restart-Item CRITICALITY reject TYPE NR-CGI-List-For-Restart-Item PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- PWS FAILURE INDICATION ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- PWS Failure Indication +-- +-- ************************************************************** + +PWSFailureIndication ::= SEQUENCE { +protocolIEs ProtocolIE-Container { { PWSFailureIndicationIEs} }, +... +} +PWSFailureIndicationIEs F1AP-PROTOCOL-IES ::= { +{ ID id-PWS-Failed-NR-CGI-List CRITICALITY reject TYPE PWS-Failed-NR-CGI-List PRESENCE optional }, +... +} +PWS-Failed-NR-CGI-List ::= SEQUENCE (SIZE(1.. maxCellingNBDU)) OF ProtocolIE-SingleContainer { { PWS-Failed-NR-CGI-List-ItemIEs } } + +PWS-Failed-NR-CGI-List-ItemIEs F1AP-PROTOCOL-IES ::= { + { ID id-PWS-Failed-NR-CGI-Item CRITICALITY reject TYPE PWS-Failed-NR-CGI-Item PRESENCE mandatory }, + ... +} + +END diff --git a/openair2/F1AP/MESSAGES/ASN1/R15.2.1/F1AP-PDU-Descriptions.asn b/openair2/F1AP/MESSAGES/ASN1/R15.2.1/F1AP-PDU-Descriptions.asn new file mode 100644 index 0000000000..6ca80a706c --- /dev/null +++ b/openair2/F1AP/MESSAGES/ASN1/R15.2.1/F1AP-PDU-Descriptions.asn @@ -0,0 +1,353 @@ +-- ************************************************************** +-- +-- Elementary Procedure definitions +-- +-- ************************************************************** + +F1AP-PDU-Descriptions { +itu-t (0) identified-organization (4) etsi (0) mobileDomain (0) +ngran-access (22) modules (3) f1ap (3) version1 (1) f1ap-PDU-Descriptions (0)} + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +-- ************************************************************** +-- +-- IE parameter types from other modules. +-- +-- ************************************************************** + +IMPORTS + Criticality, + ProcedureCode + +FROM F1AP-CommonDataTypes + Reset, + ResetAcknowledge, + F1SetupRequest, + F1SetupResponse, + F1SetupFailure, + GNBDUConfigurationUpdate, + GNBDUConfigurationUpdateAcknowledge, + GNBDUConfigurationUpdateFailure, + GNBCUConfigurationUpdate, + GNBCUConfigurationUpdateAcknowledge, + GNBCUConfigurationUpdateFailure, + UEContextSetupRequest, + UEContextSetupResponse, + UEContextSetupFailure, + UEContextReleaseCommand, + UEContextReleaseComplete, + UEContextModificationRequest, + UEContextModificationResponse, + UEContextModificationFailure, + UEContextModificationRequired, + UEContextModificationConfirm, + ErrorIndication, + UEContextReleaseRequest, + DLRRCMessageTransfer, + ULRRCMessageTransfer, + GNBDUResourceCoordinationRequest, + GNBDUResourceCoordinationResponse, + PrivateMessage, + UEInactivityNotification, + InitialULRRCMessageTransfer, + SystemInformationDeliveryCommand, + Paging, + Notify, + WriteReplaceWarningRequest, + WriteReplaceWarningResponse, + PWSCancelRequest, + PWSCancelResponse, + PWSRestartIndication, + PWSFailureIndication + +FROM F1AP-PDU-Contents + id-Reset, + id-F1Setup, + id-gNBDUConfigurationUpdate, + id-gNBCUConfigurationUpdate, + id-UEContextSetup, + id-UEContextRelease, + id-UEContextModification, + id-UEContextModificationRequired, + id-ErrorIndication, + id-UEContextReleaseRequest, + id-DLRRCMessageTransfer, + id-ULRRCMessageTransfer, + id-GNBDUResourceCoordination, + id-privateMessage, + id-UEInactivityNotification, + id-InitialULRRCMessageTransfer, + id-SystemInformationDeliveryCommand, + id-Paging, + id-Notify, + id-WriteReplaceWarning, + id-PWSCancel, + id-PWSRestartIndication, + id-PWSFailureIndication + + +FROM F1AP-Constants; + + +-- ************************************************************** +-- +-- Interface Elementary Procedure Class +-- +-- ************************************************************** + +F1AP-ELEMENTARY-PROCEDURE ::= CLASS { + &InitiatingMessage , + &SuccessfulOutcome OPTIONAL, + &UnsuccessfulOutcome OPTIONAL, + &procedureCode ProcedureCode UNIQUE, + &criticality Criticality DEFAULT ignore +} +WITH SYNTAX { + INITIATING MESSAGE &InitiatingMessage + [SUCCESSFUL OUTCOME &SuccessfulOutcome] + [UNSUCCESSFUL OUTCOME &UnsuccessfulOutcome] + PROCEDURE CODE &procedureCode + [CRITICALITY &criticality] +} + +-- ************************************************************** +-- +-- Interface PDU Definition +-- +-- ************************************************************** + +F1AP-PDU ::= CHOICE { + initiatingMessage InitiatingMessage, + successfulOutcome SuccessfulOutcome, + unsuccessfulOutcome UnsuccessfulOutcome, + ... +} + +InitiatingMessage ::= SEQUENCE { + procedureCode F1AP-ELEMENTARY-PROCEDURE.&procedureCode ({F1AP-ELEMENTARY-PROCEDURES}), + criticality F1AP-ELEMENTARY-PROCEDURE.&criticality ({F1AP-ELEMENTARY-PROCEDURES}{@procedureCode}), + value F1AP-ELEMENTARY-PROCEDURE.&InitiatingMessage ({F1AP-ELEMENTARY-PROCEDURES}{@procedureCode}) +} + +SuccessfulOutcome ::= SEQUENCE { + procedureCode F1AP-ELEMENTARY-PROCEDURE.&procedureCode ({F1AP-ELEMENTARY-PROCEDURES}), + criticality F1AP-ELEMENTARY-PROCEDURE.&criticality ({F1AP-ELEMENTARY-PROCEDURES}{@procedureCode}), + value F1AP-ELEMENTARY-PROCEDURE.&SuccessfulOutcome ({F1AP-ELEMENTARY-PROCEDURES}{@procedureCode}) +} + +UnsuccessfulOutcome ::= SEQUENCE { + procedureCode F1AP-ELEMENTARY-PROCEDURE.&procedureCode ({F1AP-ELEMENTARY-PROCEDURES}), + criticality F1AP-ELEMENTARY-PROCEDURE.&criticality ({F1AP-ELEMENTARY-PROCEDURES}{@procedureCode}), + value F1AP-ELEMENTARY-PROCEDURE.&UnsuccessfulOutcome ({F1AP-ELEMENTARY-PROCEDURES}{@procedureCode}) +} + +-- ************************************************************** +-- +-- Interface Elementary Procedure List +-- +-- ************************************************************** + +F1AP-ELEMENTARY-PROCEDURES F1AP-ELEMENTARY-PROCEDURE ::= { + F1AP-ELEMENTARY-PROCEDURES-CLASS-1 | + F1AP-ELEMENTARY-PROCEDURES-CLASS-2, + ... +} + + +F1AP-ELEMENTARY-PROCEDURES-CLASS-1 F1AP-ELEMENTARY-PROCEDURE ::= { + reset | + f1Setup | + gNBDUConfigurationUpdate | + gNBCUConfigurationUpdate | + uEContextSetup | + uEContextRelease | + uEContextModification | + uEContextModificationRequired | + writeReplaceWarning | + pWSCancel | + gNBDUResourceCoordination , + ...} + + F1AP-ELEMENTARY-PROCEDURES-CLASS-2 F1AP-ELEMENTARY-PROCEDURE ::= { + errorIndication | + uEContextReleaseRequest | + dLRRCMessageTransfer | + uLRRCMessageTransfer | + uEInactivityNotification | + privateMessage | + initialULRRCMessageTransfer | + systemInformationDelivery | + paging | + notify | + pWSRestartIndication | + pWSFailureIndication , + ... +} +-- ************************************************************** +-- +-- Interface Elementary Procedures +-- +-- ************************************************************** + +reset F1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE Reset + SUCCESSFUL OUTCOME ResetAcknowledge + PROCEDURE CODE id-Reset + CRITICALITY reject +} + +f1Setup F1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE F1SetupRequest + SUCCESSFUL OUTCOME F1SetupResponse + UNSUCCESSFUL OUTCOME F1SetupFailure + PROCEDURE CODE id-F1Setup + CRITICALITY reject +} + +gNBDUConfigurationUpdate F1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE GNBDUConfigurationUpdate + SUCCESSFUL OUTCOME GNBDUConfigurationUpdateAcknowledge + UNSUCCESSFUL OUTCOME GNBDUConfigurationUpdateFailure + PROCEDURE CODE id-gNBDUConfigurationUpdate + CRITICALITY reject +} + +gNBCUConfigurationUpdate F1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE GNBCUConfigurationUpdate + SUCCESSFUL OUTCOME GNBCUConfigurationUpdateAcknowledge + UNSUCCESSFUL OUTCOME GNBCUConfigurationUpdateFailure + PROCEDURE CODE id-gNBCUConfigurationUpdate + CRITICALITY reject +} + +uEContextSetup F1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UEContextSetupRequest + SUCCESSFUL OUTCOME UEContextSetupResponse + UNSUCCESSFUL OUTCOME UEContextSetupFailure + PROCEDURE CODE id-UEContextSetup + CRITICALITY reject +} + +uEContextRelease F1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UEContextReleaseCommand + SUCCESSFUL OUTCOME UEContextReleaseComplete + PROCEDURE CODE id-UEContextRelease + CRITICALITY reject +} + +uEContextModification F1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UEContextModificationRequest + SUCCESSFUL OUTCOME UEContextModificationResponse + UNSUCCESSFUL OUTCOME UEContextModificationFailure + PROCEDURE CODE id-UEContextModification + CRITICALITY reject +} + +uEContextModificationRequired F1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UEContextModificationRequired + SUCCESSFUL OUTCOME UEContextModificationConfirm + PROCEDURE CODE id-UEContextModificationRequired + CRITICALITY reject +} + +writeReplaceWarning F1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE WriteReplaceWarningRequest + SUCCESSFUL OUTCOME WriteReplaceWarningResponse + PROCEDURE CODE id-WriteReplaceWarning + CRITICALITY reject +} + +pWSCancel F1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE PWSCancelRequest + SUCCESSFUL OUTCOME PWSCancelResponse + PROCEDURE CODE id-PWSCancel + CRITICALITY reject +} + +errorIndication F1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE ErrorIndication + PROCEDURE CODE id-ErrorIndication + CRITICALITY ignore +} + +uEContextReleaseRequest F1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UEContextReleaseRequest + PROCEDURE CODE id-UEContextReleaseRequest + CRITICALITY ignore +} + + +initialULRRCMessageTransfer F1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE InitialULRRCMessageTransfer + PROCEDURE CODE id-InitialULRRCMessageTransfer + CRITICALITY ignore +} + +dLRRCMessageTransfer F1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE DLRRCMessageTransfer + PROCEDURE CODE id-DLRRCMessageTransfer + CRITICALITY ignore +} + +uLRRCMessageTransfer F1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE ULRRCMessageTransfer + PROCEDURE CODE id-ULRRCMessageTransfer + CRITICALITY ignore +} + + +uEInactivityNotification F1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UEInactivityNotification + PROCEDURE CODE id-UEInactivityNotification + CRITICALITY ignore +} + +gNBDUResourceCoordination F1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE GNBDUResourceCoordinationRequest + SUCCESSFUL OUTCOME GNBDUResourceCoordinationResponse + PROCEDURE CODE id-GNBDUResourceCoordination + CRITICALITY reject +} + +privateMessage F1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE PrivateMessage + PROCEDURE CODE id-privateMessage + CRITICALITY ignore +} + +systemInformationDelivery F1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE SystemInformationDeliveryCommand + PROCEDURE CODE id-SystemInformationDeliveryCommand + CRITICALITY ignore +} + + +paging F1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE Paging + PROCEDURE CODE id-Paging + CRITICALITY ignore +} + +notify F1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE Notify + PROCEDURE CODE id-Notify + CRITICALITY ignore +} + +pWSRestartIndication F1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE PWSRestartIndication + PROCEDURE CODE id-PWSRestartIndication + CRITICALITY ignore +} + +pWSFailureIndication F1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE PWSFailureIndication + PROCEDURE CODE id-PWSFailureIndication + CRITICALITY ignore +} + + +END diff --git a/openair2/F1AP/f1ap_common.c b/openair2/F1AP/f1ap_common.c new file mode 100644 index 0000000000..80c5b7b70d --- /dev/null +++ b/openair2/F1AP/f1ap_common.c @@ -0,0 +1,199 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file f1ap_common.c + * \brief f1ap procedures for both CU and DU + * \author EURECOM/NTUST + * \date 2018 + * \version 0.1 + * \company Eurecom + * \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr + * \note + * \warning + */ + +#include + +#include "f1ap_common.h" +//#include "S1AP-PDU.h" + +int asn_debug = 0; +int asn1_xer_print = 0; + +#if defined(EMIT_ASN_DEBUG_EXTERN) +inline void ASN_DEBUG(const char *fmt, ...) +{ + if (asn_debug) { + int adi = asn_debug_indent; + va_list ap; + va_start(ap, fmt); + fprintf(stderr, "[ASN1]"); + + while(adi--) fprintf(stderr, " "); + + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\n"); + va_end(ap); + } +} +#endif + +ssize_t f1ap_generate_initiating_message( + uint8_t **buffer, + uint32_t *length, + e_F1ap_ProcedureCode procedureCode, + F1ap_Criticality_t criticality, + asn_TYPE_descriptor_t *td, + void *sptr) +{ + S1AP_PDU_t pdu; + ssize_t encoded; + + memset(&pdu, 0, sizeof(S1AP_PDU_t)); + + pdu.present = S1AP_PDU_PR_initiatingMessage; + pdu.choice.initiatingMessage.procedureCode = procedureCode; + pdu.choice.initiatingMessage.criticality = criticality; + ANY_fromType_aper(&pdu.choice.initiatingMessage.value, td, sptr); + + if (asn1_xer_print) { + xer_fprint(stdout, &asn_DEF_S1AP_PDU, (void *)&pdu); + } + + /* We can safely free list of IE from sptr */ + ASN_STRUCT_FREE_CONTENTS_ONLY(*td, sptr); + + if ((encoded = aper_encode_to_new_buffer(&asn_DEF_S1AP_PDU, 0, &pdu, + (void **)buffer)) < 0) { + return -1; + } + + *length = encoded; + return encoded; +} + +ssize_t f1ap_generate_successfull_outcome( + uint8_t **buffer, + uint32_t *length, + e_F1ap_ProcedureCode procedureCode, + F1ap_Criticality_t criticality, + asn_TYPE_descriptor_t *td, + void *sptr) +{ + S1AP_PDU_t pdu; + ssize_t encoded; + + memset(&pdu, 0, sizeof(S1AP_PDU_t)); + + pdu.present = S1AP_PDU_PR_successfulOutcome; + pdu.choice.successfulOutcome.procedureCode = procedureCode; + pdu.choice.successfulOutcome.criticality = criticality; + ANY_fromType_aper(&pdu.choice.successfulOutcome.value, td, sptr); + + if (asn1_xer_print) { + xer_fprint(stdout, &asn_DEF_S1AP_PDU, (void *)&pdu); + } + + /* We can safely free list of IE from sptr */ + ASN_STRUCT_FREE_CONTENTS_ONLY(*td, sptr); + + if ((encoded = aper_encode_to_new_buffer(&asn_DEF_S1AP_PDU, 0, &pdu, + (void **)buffer)) < 0) { + return -1; + } + + *length = encoded; + + return encoded; +} + +ssize_t f1ap_generate_unsuccessfull_outcome( + uint8_t **buffer, + uint32_t *length, + e_F1ap_ProcedureCode procedureCode, + F1ap_Criticality_t criticality, + asn_TYPE_descriptor_t *td, + void *sptr) +{ + S1AP_PDU_t pdu; + ssize_t encoded; + + memset(&pdu, 0, sizeof(S1AP_PDU_t)); + + pdu.present = S1AP_PDU_PR_unsuccessfulOutcome; + pdu.choice.successfulOutcome.procedureCode = procedureCode; + pdu.choice.successfulOutcome.criticality = criticality; + ANY_fromType_aper(&pdu.choice.successfulOutcome.value, td, sptr); + + if (asn1_xer_print) { + xer_fprint(stdout, &asn_DEF_S1AP_PDU, (void *)&pdu); + } + + /* We can safely free list of IE from sptr */ + ASN_STRUCT_FREE_CONTENTS_ONLY(*td, sptr); + + if ((encoded = aper_encode_to_new_buffer(&asn_DEF_S1AP_PDU, 0, &pdu, + (void **)buffer)) < 0) { + return -1; + } + + *length = encoded; + + return encoded; +} + +F1ap_IE_t *f1ap_new_ie( + F1ap_ProtocolIE_ID_t id, + F1ap_Criticality_t criticality, + asn_TYPE_descriptor_t *type, + void *sptr) +{ + F1ap_IE_t *buff; + + if ((buff = malloc(sizeof(F1ap_IE_t))) == NULL) { + // Possible error on malloc + return NULL; + } + + memset((void *)buff, 0, sizeof(F1ap_IE_t)); + + buff->id = id; + buff->criticality = criticality; + + if (ANY_fromType_aper(&buff->value, type, sptr) < 0) { + fprintf(stderr, "Encoding of %s failed\n", type->name); + free(buff); + return NULL; + } + + if (asn1_xer_print) + if (xer_fprint(stdout, &asn_DEF_F1ap_IE, buff) < 0) { + free(buff); + return NULL; + } + + return buff; +} + +void f1ap_handle_criticality(F1ap_Criticality_t criticality) +{ + +} diff --git a/openair2/F1AP/f1ap_common.h b/openair2/F1AP/f1ap_common.h new file mode 100644 index 0000000000..884e3dcfe7 --- /dev/null +++ b/openair2/F1AP/f1ap_common.h @@ -0,0 +1,483 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file f1ap_common.h + * \brief f1ap procedures for both CU and DU + * \author EURECOM/NTUST + * \date 2018 + * \version 0.1 + * \company Eurecom + * \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr + * \note + * \warning + */ + +#if HAVE_CONFIG_H_ +# include "config.h" +#endif + +#ifndef F1AP_COMMON_H_ +#define F1AP_COMMON_H_ + +/* Defined in asn_internal.h */ +// extern int asn_debug_indent; +extern int asn_debug; + +#if defined(EMIT_ASN_DEBUG_EXTERN) +inline void ASN_DEBUG(const char *fmt, ...); +#endif + +#include "F1AP_Active-Cells-List.h" +#include "F1AP_RAT-FrequencyPriorityInformation.h" +#include "F1AP_DLUPTNLInformation-ToBeSetup-Item.h" +#include "F1AP_PrivateMessage.h" +#include "F1AP_Cause.h" +#include "F1AP_Pre-emptionVulnerability.h" +#include "F1AP_NRPCI.h" +#include "F1AP_Transmission-Bandwidth.h" +#include "F1AP_SIB1-message.h" +#include "F1AP_GNBCUConfigurationUpdateAcknowledge.h" +#include "F1AP_DRBs-Setup-Item.h" +#include "F1AP_EUTRA-NR-CellResourceCoordinationReqAck-Container.h" +#include "F1AP_NR-CGI-List-For-Restart-Item.h" +#include "F1AP_GNB-CU-Name.h" +#include "F1AP_PagingDRX.h" +#include "F1AP_RepetitionPeriod.h" +#include "F1AP_DRBs-ToBeModified-List.h" +#include "F1AP_ExecuteDuplication.h" +#include "F1AP_SCell-FailedtoSetupMod-List.h" +#include "F1AP_NRNRB.h" +#include "F1AP_SCell-ToBeSetup-List.h" +#include "F1AP_F1AP-PDU.h" +#include "F1AP_MaskedIMEISV.h" +#include "F1AP_ProtocolIE-Container.h" +#include "F1AP_GNB-CU-TNL-Association-To-Update-Item.h" +#include "F1AP_Cells-to-be-Activated-List-Item.h" +#include "F1AP_DRBs-Required-ToBeModified-Item.h" +#include "F1AP_BitRate.h" +#include "F1AP_SRBs-ToBeSetup-List.h" +#include "F1AP_ConcurrentWarningMessageIndicator.h" +#include "F1AP_CriticalityDiagnostics-IE-Item.h" +#include "F1AP_GNB-CU-TNL-Association-To-Update-List.h" +#include "F1AP_DRB-Notify-List.h" +#include "F1AP_UEContextReleaseCommand.h" +#include "F1AP_ProtocolIE-SingleContainer.h" +#include "F1AP_DRBs-ToBeReleased-List.h" +#include "F1AP_PWS-Failed-NR-CGI-List.h" +#include "F1AP_InitialULRRCMessageTransfer.h" +#include "F1AP_Served-Cell-Information.h" +#include "F1AP_Served-EUTRA-Cells-Information.h" +#include "F1AP_Cells-Broadcast-Cancelled-Item.h" +#include "F1AP_F1SetupRequest.h" +#include "F1AP_Served-Cells-To-Add-Item.h" +#include "F1AP_F1SetupFailure.h" +#include "F1AP_ULUPTNLInformation-ToBeSetup-Item.h" +#include "F1AP_GNB-CU-TNL-Association-To-Add-Item.h" +#include "F1AP_DUtoCURRCContainer.h" +#include "F1AP_GNBDUResourceCoordinationRequest.h" +#include "F1AP_DRBs-FailedToBeSetup-List.h" +#include "F1AP_UPTransportLayerInformation.h" +#include "F1AP_RRCContainer.h" +#include "F1AP_Notification-Cause.h" +#include "F1AP_UEIdentityIndexValue.h" +#include "F1AP_SRBs-ToBeSetupMod-List.h" +#include "F1AP_GNB-DU-Served-Cells-Item.h" +#include "F1AP_RLCMode.h" +#include "F1AP_NRSCS.h" +#include "F1AP_SliceSupportList.h" +#include "F1AP_GTP-TEID.h" +#include "F1AP_UEContextModificationRequest.h" +#include "F1AP_MeasConfig.h" +#include "F1AP_Flows-Mapped-To-DRB-List.h" +#include "F1AP_Cells-to-be-Deactivated-List-Item.h" +#include "F1AP_QoSFlowLevelQoSParameters.h" +#include "F1AP_GNB-CU-UE-F1AP-ID.h" +#include "F1AP_CauseTransport.h" +#include "F1AP_DRBs-ToBeReleased-Item.h" +#include "F1AP_SCell-ToBeSetupMod-Item.h" +#include "F1AP_CellGroupConfig.h" +#include "F1AP_PWSSystemInformation.h" +#include "F1AP_DRBs-Modified-List.h" +#include "F1AP_HandoverPreparationInformation.h" +#include "F1AP_InactivityMonitoringResponse.h" +#include "F1AP_Served-Cells-To-Delete-List.h" +#include "F1AP_ProtocolExtensionField.h" +#include "F1AP_GNB-CU-TNL-Association-To-Remove-List.h" +#include "F1AP_SRBID.h" +#include "F1AP_DRB-Activity-List.h" +#include "F1AP_DRBs-FailedToBeModified-Item.h" +#include "F1AP_TransactionID.h" +#include "F1AP_AllocationAndRetentionPriority.h" +#include "F1AP_ShortDRXCycleLength.h" +#include "F1AP_BroadcastPLMNs-Item.h" +#include "F1AP_DRB-Information.h" +#include "F1AP_TimeToWait.h" +#include "F1AP_NonDynamic5QIDescriptor.h" +#include "F1AP_C-RNTI.h" +#include "F1AP_MIB-message.h" +#include "F1AP_SIBtype-Item.h" +#include "F1AP_Served-Cells-To-Modify-List.h" +#include "F1AP_NRCGI.h" +#include "F1AP_DuplicationActivation.h" +#include "F1AP_CauseProtocol.h" +#include "F1AP_SCell-FailedtoSetup-Item.h" +#include "F1AP_PagingIdentity.h" +#include "F1AP_NGRANAllocationAndRetentionPriority.h" +#include "F1AP_TypeOfError.h" +#include "F1AP_GNB-CU-TNL-Association-To-Add-List.h" +#include "F1AP_DRBs-Required-ToBeReleased-Item.h" +#include "F1AP_EUTRA-Mode-Info.h" +#include "F1AP_FiveGS-TAC.h" +#include "F1AP_Cells-to-be-Activated-List.h" +#include "F1AP_PagingCell-list.h" +#include "F1AP_NotificationControl.h" +#include "F1AP_ProtectedEUTRAResourceIndication.h" +#include "F1AP_CUtoDURRCInformation.h" +#include "F1AP_SystemInformationDeliveryCommand.h" +#include "F1AP_AveragingWindow.h" +#include "F1AP_SRBs-ToBeSetupMod-Item.h" +#include "F1AP_NumberOfBroadcasts.h" +#include "F1AP_Cells-Broadcast-Completed-List.h" +#include "F1AP_GNB-CU-TNL-Association-Setup-Item.h" +#include "F1AP_PWSCancelResponse.h" +#include "F1AP_SpectrumSharingGroupID.h" +#include "F1AP_RANUEPagingIdentity.h" +#include "F1AP_CG-ConfigInfo.h" +#include "F1AP_PagingCell-Item.h" +#include "F1AP_GNB-CU-TNL-Association-To-Remove-Item.h" +#include "F1AP_UE-CapabilityRAT-ContainerList.h" +#include "F1AP_PWSCancelRequest.h" +#include "F1AP_PriorityLevel.h" +#include "F1AP_ProtocolIE-ContainerPair.h" +#include "F1AP_FullConfiguration.h" +#include "F1AP_NRCellIdentity.h" +#include "F1AP_ProtocolExtensionContainer.h" +#include "F1AP_PWSRestartIndication.h" +#include "F1AP_DRBs-ModifiedConf-List.h" +#include "F1AP_GNB-CU-TNL-Association-Failed-To-Setup-List.h" +#include "F1AP_UEContextSetupRequest.h" +#include "F1AP_PWSFailureIndication.h" +#include "F1AP_UE-associatedLogicalF1-ConnectionListResAck.h" +#include "F1AP_DRBs-ToBeSetupMod-Item.h" +#include "F1AP_SRBs-FailedToBeSetup-List.h" +#include "F1AP_Criticality.h" +#include "F1AP_UEContextModificationConfirm.h" +#include "F1AP_Broadcast-To-Be-Cancelled-List.h" +#include "F1AP_UEContextReleaseComplete.h" +#include "F1AP_PrivateIE-Container.h" +#include "F1AP_CellULConfigured.h" +#include "F1AP_DRB-Activity.h" +#include "F1AP_GNB-CU-TNL-Association-Failed-To-Setup-Item.h" +#include "F1AP_PrivateIE-ID.h" +#include "F1AP_WriteReplaceWarningResponse.h" +#include "F1AP_CauseMisc.h" +#include "F1AP_SRBs-Required-ToBeReleased-Item.h" +#include "F1AP_Cells-Broadcast-Cancelled-List.h" +#include "F1AP_ULUEConfiguration.h" +#include "F1AP_RAT-FrequencySelectionPriority.h" +#include "F1AP_UEInactivityNotification.h" +#include "F1AP_DLRRCMessageTransfer.h" +#include "F1AP_TriggeringMessage.h" +#include "F1AP_DRBs-ToBeSetup-List.h" +#include "F1AP_Cells-to-be-Barred-Item.h" +#include "F1AP_UE-associatedLogicalF1-ConnectionItem.h" +#include "F1AP_Cancel-all-Warning-Messages-Indicator.h" +#include "F1AP_SCell-FailedtoSetupMod-Item.h" +#include "F1AP_DRBs-FailedToBeSetupMod-List.h" +#include "F1AP_ProtocolIE-ID.h" +#include "F1AP_TransportLayerAddress.h" +#include "F1AP_GNB-DU-System-Information.h" +#include "F1AP_PWS-Failed-NR-CGI-Item.h" +#include "F1AP_Notify.h" +#include "F1AP_UEContextModificationResponse.h" +#include "F1AP_DRBID.h" +#include "F1AP_GNBDUResourceCoordinationResponse.h" +#include "F1AP_UEContextModificationRequired.h" +#include "F1AP_InitiatingMessage.h" +#include "F1AP_SliceSupportItem.h" +#include "F1AP_ProtocolIE-FieldPair.h" +#include "F1AP_EUTRA-TDD-Info.h" +#include "F1AP_GNBDUConfigurationUpdateFailure.h" +#include "F1AP_ULUPTNLInformation-ToBeSetup-List.h" +#include "F1AP_WriteReplaceWarningRequest.h" +#include "F1AP_ServCellIndex.h" +#include "F1AP_ResetAcknowledge.h" +#include "F1AP_SRBs-FailedToBeSetupMod-Item.h" +#include "F1AP_OffsetToPointA.h" +#include "F1AP_ProcedureCode.h" +#include "F1AP_GTPTunnel.h" +#include "F1AP_TDD-Info.h" +#include "F1AP_Pre-emptionCapability.h" +#include "F1AP_MaxDataBurstVolume.h" +#include "F1AP_SUL-Information.h" +#include "F1AP_CriticalityDiagnostics-IE-List.h" +#include "F1AP_EUTRA-FDD-Info.h" +#include "F1AP_BroadcastPLMNs-List.h" +#include "F1AP_Served-Cells-To-Delete-Item.h" +#include "F1AP_ListofEUTRACellsinGNBDUCoordination.h" +#include "F1AP_Candidate-SpCell-Item.h" +#include "F1AP_Cells-To-Be-Broadcast-List.h" +#include "F1AP_ULRRCMessageTransfer.h" +#include "F1AP_Cells-to-be-Deactivated-List.h" +#include "F1AP_DRBs-Required-ToBeReleased-List.h" +#include "F1AP_Served-Cells-To-Add-List.h" +#include "F1AP_Potential-SpCell-List.h" +#include "F1AP_EUTRANQoS.h" +#include "F1AP_Dynamic5QIDescriptor.h" +#include "F1AP_GNBCUConfigurationUpdateFailure.h" +#include "F1AP_DuplicationIndication.h" +#include "F1AP_GNB-DU-Served-Cells-List.h" +#include "F1AP_QoS-Characteristics.h" +#include "F1AP_UE-associatedLogicalF1-ConnectionListRes.h" +#include "F1AP_ResourceCoordinationTransferContainer.h" +#include "F1AP_DRXCycle.h" +#include "F1AP_DRBs-FailedToBeSetup-Item.h" +#include "F1AP_PrivateIE-Field.h" +#include "F1AP_SRBs-ToBeReleased-List.h" +#include "F1AP_MeasGapConfig.h" +#include "F1AP_NR-Mode-Info.h" +#include "F1AP_Active-Cells-Item.h" +#include "F1AP_Protected-EUTRA-Resources-List.h" +#include "F1AP_SRBs-FailedToBeSetup-Item.h" +#include "F1AP_ResetAll.h" +#include "F1AP_SCell-FailedtoSetup-List.h" +#include "F1AP_UEContextModificationFailure.h" +#include "F1AP_CNUEPagingIdentity.h" +#include "F1AP_DRBs-ToBeSetupMod-List.h" +#include "F1AP_GNBDUConfigurationUpdate.h" +#include "F1AP_DRBs-ToBeSetup-Item.h" +#include "F1AP_UnsuccessfulOutcome.h" +#include "F1AP_SRBs-FailedToBeSetupMod-List.h" +#include "F1AP_SCell-ToBeRemoved-Item.h" +#include "F1AP_InactivityMonitoringRequest.h" +#include "F1AP_Cells-Failed-to-be-Activated-List-Item.h" +#include "F1AP_DRBs-Modified-Item.h" +#include "F1AP_SRBs-Required-ToBeReleased-List.h" +#include "F1AP_GBR-QosInformation.h" +#include "F1AP_SCell-ToBeRemoved-List.h" +#include "F1AP_RANAC.h" +#include "F1AP_GNB-DU-UE-F1AP-ID.h" +#include "F1AP_CauseRadioNetwork.h" +#include "F1AP_DRB-Notify-Item.h" +#include "F1AP_GNBDUConfigurationUpdateAcknowledge.h" +#include "F1AP_GNB-CUSystemInformation.h" +#include "F1AP_ProtocolIE-Field.h" +#include "F1AP_Served-Cells-To-Modify-Item.h" +#include "F1AP_Flows-Mapped-To-DRB-Item.h" +#include "F1AP_SupportedSULFreqBandItem.h" +#include "F1AP_UEContextReleaseRequest.h" +#include "F1AP_GNB-DU-Name.h" +#include "F1AP_DRBs-ToBeModified-Item.h" +#include "F1AP_SIBtype-List.h" +#include "F1AP_EUTRA-NR-CellResourceCoordinationReq-Container.h" +#include "F1AP_DRBs-SetupMod-List.h" +#include "F1AP_DRBs-Required-ToBeModified-List.h" +#include "F1AP_DUtoCURRCInformation.h" +#include "F1AP_MaxPacketLossRate.h" +#include "F1AP_PacketDelayBudget.h" +#include "F1AP_GNBCUConfigurationUpdate.h" +#include "F1AP_Cells-Broadcast-Completed-Item.h" +#include "F1AP_RRCRconfigurationCompleteIndicator.h" +#include "F1AP_PagingPriority.h" +#include "F1AP_Cells-Failed-to-be-Activated-List.h" +#include "F1AP_Endpoint-IP-address-and-port.h" +#include "F1AP_PacketErrorRate.h" +#include "F1AP_PLMN-Identity.h" +#include "F1AP_asn_constant.h" +#include "F1AP_ResetType.h" +#include "F1AP_FDD-Info.h" +#include "F1AP_DLUPTNLInformation-ToBeSetup-List.h" +#include "F1AP_QoSFlowIndicator.h" +#include "F1AP_NR-CGI-List-For-Restart-List.h" +#include "F1AP_F1SetupResponse.h" +#include "F1AP_UEContextSetupResponse.h" +#include "F1AP_CP-TransportLayerAddress.h" +#include "F1AP_Broadcast-To-Be-Cancelled-Item.h" +#include "F1AP_ErrorIndication.h" +#include "F1AP_SubscriberProfileIDforRFP.h" +#include "F1AP_SNSSAI.h" +#include "F1AP_DRBs-ModifiedConf-Item.h" +#include "F1AP_GNB-CU-TNL-Association-Setup-List.h" +#include "F1AP_DRB-Activity-Item.h" +#include "F1AP_LCID.h" +#include "F1AP_ULConfiguration.h" +#include "F1AP_ShortDRXCycleTimer.h" +#include "F1AP_FreqBandNrItem.h" +#include "F1AP_Cells-to-be-Barred-List.h" +#include "F1AP_Presence.h" +#include "F1AP_CellBarred.h" +#include "F1AP_SIBtype.h" +#include "F1AP_RequestType.h" +#include "F1AP_NRFreqInfo.h" +#include "F1AP_Potential-SpCell-Item.h" +#include "F1AP_NumberofBroadcastRequest.h" +#include "F1AP_TNLAssociationUsage.h" +#include "F1AP_SCell-ToBeSetupMod-List.h" +#include "F1AP_DRBs-Setup-List.h" +#include "F1AP_Reset.h" +#include "F1AP_CriticalityDiagnostics.h" +#include "F1AP_Paging.h" +#include "F1AP_LongDRXCycleLength.h" +#include "F1AP_GNB-DU-ID.h" +#include "F1AP_SuccessfulOutcome.h" +#include "F1AP_Configured-EPS-TAC.h" +#include "F1AP_Candidate-SpCell-List.h" +#include "F1AP_SRBs-ToBeReleased-Item.h" +#include "F1AP_QoSInformation.h" +#include "F1AP_SCell-ToBeSetup-Item.h" +#include "F1AP_SRBs-ToBeSetup-Item.h" +#include "F1AP_GBR-QoSFlowInformation.h" +#include "F1AP_SCellIndex.h" +#include "F1AP_DRBs-SetupMod-Item.h" +#include "F1AP_TransmissionStopIndicator.h" +#include "F1AP_UEContextSetupFailure.h" +#include "F1AP_DRBs-FailedToBeModified-List.h" +#include "F1AP_DRBs-FailedToBeSetupMod-Item.h" +#include "F1AP_ProtocolExtensionID.h" +#include "F1AP_Cells-To-Be-Broadcast-Item.h" +#include "F1AP_QCI.h" + +/* Checking version of ASN1C compiler */ +#if (ASN1C_ENVIRONMENT_VERSION < ASN1C_MINIMUM_VERSION) +# error "You are compiling f1ap with the wrong version of ASN1C" +#endif + +#ifndef FALSE +# define FALSE (0) +#endif +#ifndef TRUE +# define TRUE (!FALSE) +#endif + +#define F1AP_UE_ID_FMT "0x%06"PRIX32 + +extern int asn_debug; +extern int asn1_xer_print; + +#include "assertions.h" + +#if defined(ENB_MODE) +# include "log.h" +# include "f1ap_default_values.h" +# define F1AP_ERROR(x, args...) LOG_E(F1AP, x, ##args) +# define F1AP_WARN(x, args...) LOG_W(F1AP, x, ##args) +# define F1AP_TRAF(x, args...) LOG_I(F1AP, x, ##args) +# define F1AP_INFO(x, args...) LOG_I(F1AP, x, ##args) +# define F1AP_DEBUG(x, args...) LOG_I(F1AP, x, ##args) +#else +//# include "mme_default_values.h" +# define F1AP_ERROR(x, args...) do { fprintf(stdout, "[F1AP][E]"x, ##args); } while(0) +# define F1AP_WARN(x, args...) do { fprintf(stdout, "[F1AP][W]"x, ##args); } while(0) +# define F1AP_TRAF(x, args...) do { fprintf(stdout, "[F1AP][T]"x, ##args); } while(0) +# define F1AP_INFO(x, args...) do { fprintf(stdout, "[F1AP][I]"x, ##args); } while(0) +# define F1AP_DEBUG(x, args...) do { fprintf(stdout, "[F1AP][D]"x, ##args); } while(0) +#endif + +//Forward declaration +//struct f1ap_message_s; + +typedef struct f1ap_message_s { + F1AP_ProtocolIE_ID_t id; + F1AP_Criticality_t criticality; + uint8_t direction; + union { + F1AP_F1SetupRequestIEs_t f1ap_F1SetupRequestIEs; + } msg; +} f1ap_message; + +/** \brief Function callback prototype. + **/ +/*typedef int (*f1ap_message_decoded_callback)( + uint32_t assoc_id, + uint32_t stream, + struct f1ap_message_s *message_p +);*/ + +/** \brief Encode a successfull outcome message + \param buffer pointer to buffer in which data will be encoded + \param length pointer to the length of buffer + \param procedureCode Procedure code for the message + \param criticality Criticality of the message + \param td ASN1C type descriptor of the sptr + \param sptr Deferenced pointer to the structure to encode + @returns size in bytes encded on success or 0 on failure + **/ +/*ssize_t f1ap_generate_successfull_outcome( + uint8_t **buffer, + uint32_t *length, + e_F1ap_ProcedureCode procedureCode, + F1ap_Criticality_t criticality, + asn_TYPE_descriptor_t *td, + void *sptr); +*/ +/** \brief Encode an initiating message + \param buffer pointer to buffer in which data will be encoded + \param length pointer to the length of buffer + \param procedureCode Procedure code for the message + \param criticality Criticality of the message + \param td ASN1C type descriptor of the sptr + \param sptr Deferenced pointer to the structure to encode + @returns size in bytes encded on success or 0 on failure + **/ +/*ssize_t f1ap_generate_initiating_message( + uint8_t **buffer, + uint32_t *length, + e_F1ap_ProcedureCode procedureCode, + F1ap_Criticality_t criticality, + asn_TYPE_descriptor_t *td, + void *sptr); +*/ +/** \brief Encode an unsuccessfull outcome message + \param buffer pointer to buffer in which data will be encoded + \param length pointer to the length of buffer + \param procedureCode Procedure code for the message + \param criticality Criticality of the message + \param td ASN1C type descriptor of the sptr + \param sptr Deferenced pointer to the structure to encode + @returns size in bytes encded on success or 0 on failure + **/ +/*ssize_t f1ap_generate_unsuccessfull_outcome( + uint8_t **buffer, + uint32_t *length, + e_F1ap_ProcedureCode procedureCode, + F1ap_Criticality_t criticality, + asn_TYPE_descriptor_t *td, + void *sptr); +*/ +/** \brief Generate a new IE + \param id Protocol ie id of the IE + \param criticality Criticality of the IE + \param type ASN1 type descriptor of the IE value + \param sptr Structure to be encoded in the value field + @returns a pointer to the newly created IE structure or NULL in case of failure + **/ +/*F1ap_IE_t *f1ap_new_ie(F1ap_ProtocolIE_ID_t id, + F1ap_Criticality_t criticality, + asn_TYPE_descriptor_t *type, + void *sptr); +*/ +/** \brief Handle criticality + \param criticality Criticality of the IE + @returns void + **/ +//void f1ap_handle_criticality(F1ap_Criticality_t criticality); + +#endif /* F1AP_COMMON_H_ */ diff --git a/openair2/F1AP/f1ap_decoder.c b/openair2/F1AP/f1ap_decoder.c new file mode 100644 index 0000000000..9d89cf5172 --- /dev/null +++ b/openair2/F1AP/f1ap_decoder.c @@ -0,0 +1,235 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file f1ap_decoder.c + * \brief f1ap pdu decode procedures + * \author EURECOM/NTUST + * \date 2018 + * \version 0.1 + * \company Eurecom + * \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr + * \note + * \warning + */ + +#include + +#include "assertions.h" + +#include "intertask_interface.h" + +#include "f1ap_common.h" +#include "f1ap_ies_defs.h" +#include "f1ap_decoder.h" + +static int f1ap_decode_initiating_message(f1ap_message *message, + F1ap_InitiatingMessage_t *initiating_p) +{ + int ret = -1; + MessageDef *message_p; + char *message_string = NULL; + size_t message_string_size; + MessagesIds message_id; + + DevAssert(initiating_p != NULL); + + message_string = calloc(10000, sizeof(char)); + + f1ap_string_total_size = 0; + + message->procedureCode = initiating_p->procedureCode; + message->criticality = initiating_p->criticality; + + switch(initiating_p->procedureCode) { + + case F1ap_ProcedureCode_id_InitialContextSetup: + ret = f1ap_decode_f1ap_initialcontextsetuprequesties( + &message->msg.f1ap_InitialContextSetupRequestIEs, &initiating_p->value); + f1ap_xer_print_f1ap_initialcontextsetuprequest(f1ap_xer__print2sp, message_string, message); + message_id = F1AP_INITIAL_CONTEXT_SETUP_LOG; + message_string_size = strlen(message_string); + message_p = itti_alloc_new_message_sized(TASK_F1AP, + message_id, + message_string_size + sizeof (IttiMsgText)); + message_p->ittiMsg.f1ap_initial_context_setup_log.size = message_string_size; + memcpy(&message_p->ittiMsg.f1ap_initial_context_setup_log.text, message_string, message_string_size); + itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p); + free(message_string); + break; + + case F1ap_ProcedureCode_id_UEContextRelease: + ret = f1ap_decode_f1ap_uecontextreleasecommandies( + &message->msg.f1ap_UEContextReleaseCommandIEs, &initiating_p->value); + f1ap_xer_print_f1ap_uecontextreleasecommand(f1ap_xer__print2sp, message_string, message); + message_id = F1AP_UE_CONTEXT_RELEASE_COMMAND_LOG; + message_string_size = strlen(message_string); + message_p = itti_alloc_new_message_sized(TASK_F1AP, + message_id, + message_string_size + sizeof (IttiMsgText)); + message_p->ittiMsg.f1ap_ue_context_release_command_log.size = message_string_size; + memcpy(&message_p->ittiMsg.f1ap_ue_context_release_command_log.text, message_string, message_string_size); + itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p); + free(message_string); + break; + + case F1ap_ProcedureCode_id_ErrorIndication: + ret = f1ap_decode_f1ap_errorindicationies( + &message->msg.f1ap_ErrorIndicationIEs, &initiating_p->value); + f1ap_xer_print_f1ap_errorindication(f1ap_xer__print2sp, message_string, message); + message_id = F1AP_E_RAB_ERROR_INDICATION_LOG; + message_string_size = strlen(message_string); + message_p = itti_alloc_new_message_sized(TASK_F1AP, + message_id, + message_string_size + sizeof (IttiMsgText)); + message_p->ittiMsg.f1ap_e_rab_release_request_log.size = message_string_size; + memcpy(&message_p->ittiMsg.f1ap_error_indication_log.text, message_string, message_string_size); + itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p); + free(message_string); + F1AP_INFO("ErrorIndication initiating message\n"); + break; + + default: + F1AP_ERROR("Unknown procedure ID (%d) for initiating message\n", + (int)initiating_p->procedureCode); + AssertFatal( 0 , "Unknown procedure ID (%d) for initiating message\n", + (int)initiating_p->procedureCode); + return -1; + } + + + return ret; +} + +static int f1ap_decode_successful_outcome(f1ap_message *message, + F1ap_SuccessfulOutcome_t *successfullOutcome_p) +{ + int ret = -1; + MessageDef *message_p; + char *message_string = NULL; + size_t message_string_size; + MessagesIds message_id; + + DevAssert(successfullOutcome_p != NULL); + + message_string = malloc(sizeof(char) * 10000); + memset((void*)message_string,0,sizeof(char) * 10000); + + f1ap_string_total_size = 0; + + message->procedureCode = successfullOutcome_p->procedureCode; + message->criticality = successfullOutcome_p->criticality; + + switch(successfullOutcome_p->procedureCode) { + case F1ap_ProcedureCode_id_F1Setup: + ret = f1ap_decode_f1ap_f1setupresponseies( + &message->msg.f1ap_F1SetupResponseIEs, &successfullOutcome_p->value); + f1ap_xer_print_f1ap_f1setupresponse(f1ap_xer__print2sp, message_string, message); + message_id = F1AP_F1_SETUP_LOG; + break; + + default: + F1AP_ERROR("Unknown procedure ID (%d) for successfull outcome message\n", + (int)successfullOutcome_p->procedureCode); + return -1; + } + + message_string_size = strlen(message_string); + + message_p = itti_alloc_new_message_sized(TASK_F1AP, message_id, message_string_size + sizeof (IttiMsgText)); + message_p->ittiMsg.f1ap_f1_setup_log.size = message_string_size; + memcpy(&message_p->ittiMsg.f1ap_f1_setup_log.text, message_string, message_string_size); + + itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p); + + free(message_string); + + return ret; +} + +static int f1ap_decode_unsuccessful_outcome(f1ap_message *message, + F1ap_UnsuccessfulOutcome_t *unSuccessfullOutcome_p) +{ + int ret = -1; + DevAssert(unSuccessfullOutcome_p != NULL); + + message->procedureCode = unSuccessfullOutcome_p->procedureCode; + message->criticality = unSuccessfullOutcome_p->criticality; + + switch(unSuccessfullOutcome_p->procedureCode) { + case F1ap_ProcedureCode_id_F1Setup: + return f1ap_decode_f1ap_f1setupfailureies( + &message->msg.f1ap_F1SetupFailureIEs, &unSuccessfullOutcome_p->value); + + default: + F1AP_ERROR("Unknown procedure ID (%d) for unsuccessfull outcome message\n", + (int)unSuccessfullOutcome_p->procedureCode); + break; + } + + return ret; +} + +int f1ap_decode_pdu(f1ap_message *message, const uint8_t * const buffer, + const uint32_t length) +{ + F1AP_PDU_t pdu; + F1AP_PDU_t *pdu_p = &pdu; + asn_dec_rval_t dec_ret; + + DevAssert(buffer != NULL); + + memset((void *)pdu_p, 0, sizeof(F1AP_PDU_t)); + + dec_ret = aper_decode(NULL, + &asn_DEF_F1AP_PDU, + (void **)&pdu_p, + buffer, + length, + 0, + 0); + + if (dec_ret.code != RC_OK) { + F1AP_ERROR("Failed to decode pdu\n"); + return -1; + } + + message->direction = pdu_p->present; + + switch(pdu_p->present) { + case F1AP_F1AP_PDU_PR_initiatingMessage: + return f1ap_decode_initiating_message(message, + &pdu_p->choice.initiatingMessage); + + case F1AP_F1AP_PDU_PR_successfulOutcome: + return f1ap_decode_successful_outcome(message, + &pdu_p->choice.successfulOutcome); + + case F1AP_F1AP_PDU_PR_unsuccessfulOutcome: + return f1ap_decode_unsuccessful_outcome(message, + &pdu_p->choice.unsuccessfulOutcome); + + default: + F1AP_DEBUG("Unknown presence (%d) or not implemented\n", (int)pdu_p->present); + break; + } + + return -1; +} diff --git a/openair2/F1AP/f1ap_decoder.h b/openair2/F1AP/f1ap_decoder.h new file mode 100644 index 0000000000..81a8e3512b --- /dev/null +++ b/openair2/F1AP/f1ap_decoder.h @@ -0,0 +1,42 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file f1ap_decoder.h + * \brief f1ap pdu decode procedures + * \author EURECOM/NTUST + * \date 2018 + * \version 0.1 + * \company Eurecom + * \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr + * \note + * \warning + */ + +#include +#include "f1ap_ies_defs.h" + +#ifndef F1AP_DECODER_H_ +#define F1AP_DECODER_H_ + +int f1ap_decode_pdu(f1ap_message *message, const uint8_t * const buffer, + const uint32_t length) __attribute__ ((warn_unused_result)); + +#endif /* F1AP_DECODER_H_ */ diff --git a/openair2/F1AP/f1ap_default_values.h b/openair2/F1AP/f1ap_default_values.h new file mode 100644 index 0000000000..ddb2ef5b07 --- /dev/null +++ b/openair2/F1AP/f1ap_default_values.h @@ -0,0 +1,46 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file f1ap_default_values.h + * \brief default values for f1ap procedures + * \author EURECOM/NTUST + * \date 2018 + * \version 0.1 + * \company Eurecom + * \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr + * \note + * \warning + */ + +#ifndef F1AP_DEFAULT_VALUES_H_ +#define F1AP_DEFAULT_VALUES_H_ + +#define ENB_TAC (1) +#define ENB_MCC (208) +#define ENB_MNC (92) + +#define ENB_NAME "Eurecom ENB" +#define ENB_NAME_FORMAT (ENB_NAME" %u") + +#define F1AP_PORT_NUMBER (3642) +#define F1AP_SCTP_PPID (62) + +#endif /* F1AP_DEFAULT_VALUES_H_ */ diff --git a/openair2/F1AP/f1ap_encoder.c b/openair2/F1AP/f1ap_encoder.c new file mode 100644 index 0000000000..58be896eae --- /dev/null +++ b/openair2/F1AP/f1ap_encoder.c @@ -0,0 +1,382 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file f1ap_encoder.c + * \brief f1ap pdu encode procedures + * \author EURECOM/NTUST + * \date 2018 + * \version 0.1 + * \company Eurecom + * \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr + * \note + * \warning + */ + +#include +#include +#include + +#include "assertions.h" + +#include "conversions.h" + +#include "intertask_interface.h" + +#include "f1ap_common.h" +#include "f1ap_ies_defs.h" +#include "f1ap_encoder.h" + +static inline int f1ap_encode_initiating(f1ap_message *message, + uint8_t **buffer, + uint32_t *len); + +static inline int f1ap_encode_successfull_outcome(f1ap_message *message, + uint8_t **buffer, uint32_t *len); + +static inline int f1ap_encode_unsuccessfull_outcome(f1ap_message *message, + uint8_t **buffer, uint32_t *len); + +static inline int f1ap_encode_f1_setup_request( + F1ap_F1SetupRequestIEs_t *f1SetupRequestIEs, uint8_t **buffer, uint32_t *length); + +static inline int f1ap_encode_trace_failure(F1ap_TraceFailureIndicationIEs_t + *trace_failure_ies_p, uint8_t **buffer, + uint32_t *length); + +static inline int f1ap_encode_initial_context_setup_response( + F1ap_InitialContextSetupResponseIEs_t *initialContextSetupResponseIEs, + uint8_t **buffer, + uint32_t *length); + +static inline +int f1ap_encode_ue_context_release_complete( + F1ap_UEContextReleaseCompleteIEs_t *f1ap_UEContextReleaseCompleteIEs, + uint8_t **buffer, + uint32_t *length); + +static inline +int f1ap_encode_ue_context_release_request( + F1ap_UEContextReleaseRequestIEs_t *f1ap_UEContextReleaseRequestIEs, + uint8_t **buffer, + uint32_t *length); + +int f1ap_encode_pdu(f1ap_message *message, uint8_t **buffer, uint32_t *len) +{ + DevAssert(message != NULL); + DevAssert(buffer != NULL); + DevAssert(len != NULL); + + switch(message->direction) { // Need Check (present)? + case F1AP_F1AP_PDU_PR_initiatingMessage: + return f1ap_encode_initiating(message, buffer, len); + + case F1AP_F1AP_PDU_PR_successfulOutcome: + return f1ap_encode_successfull_outcome(message, buffer, len); + + case F1AP_F1AP_PDU_PR_unsuccessfulOutcome: + return f1ap_encode_unsuccessfull_outcome(message, buffer, len); + + default: + F1AP_DEBUG("Unknown message outcome (%d) or not implemented", + (int)message->direction); + break; + } + + return -1; +} + +static inline +int f1ap_encode_initiating(f1ap_message *f1ap_message_p, + uint8_t **buffer, uint32_t *len) +{ + int ret = -1; + MessageDef *message_p; + char *message_string = NULL; + size_t message_string_size; + MessagesIds message_id; + + DevAssert(f1ap_message_p != NULL); + + message_string = calloc(10000, sizeof(char)); + + f1ap_string_total_size = 0; + + switch(f1ap_message_p->procedureCode) { + case F1ap_ProcedureCode_id_F1Setup: + ret = f1ap_encode_f1_setup_request( + &f1ap_message_p->msg.f1ap_F1SetupRequestIEs, buffer, len); + //f1ap_xer_print_f1ap_f1setuprequest(f1ap_xer__print2sp, message_string, f1ap_message_p); + message_id = F1AP_F1_SETUP_LOG; + break; + + case F1ap_ProcedureCode_id_UEContextReleaseRequest: + ret = f1ap_encode_ue_context_release_request( + &f1ap_message_p->msg.f1ap_UEContextReleaseRequestIEs, buffer, len); + //f1ap_xer_print_f1ap_uecontextreleaserequest(f1ap_xer__print2sp, + // message_string, f1ap_message_p); + message_id = F1AP_UE_CONTEXT_RELEASE_REQ_LOG; + break; + + + default: + F1AP_DEBUG("Unknown procedure ID (%d) for initiating message\n", + (int)f1ap_message_p->procedureCode); + return ret; + break; + } + + message_string_size = strlen(message_string); + + message_p = itti_alloc_new_message_sized(TASK_F1AP, message_id, message_string_size + sizeof (IttiMsgText)); + message_p->ittiMsg.f1ap_f1_setup_log.size = message_string_size; + memcpy(&message_p->ittiMsg.f1ap_f1_setup_log.text, message_string, message_string_size); + + itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p); + + free(message_string); + + return ret; +} + +static inline +int f1ap_encode_successfull_outcome(f1ap_message *f1ap_message_p, + uint8_t **buffer, uint32_t *len) +{ + int ret = -1; + MessageDef *message_p; + char *message_string = NULL; + size_t message_string_size; + MessagesIds message_id; + + DevAssert(f1ap_message_p != NULL); + + message_string = calloc(10000, sizeof(char)); + + f1ap_string_total_size = 0; + message_string_size = strlen(message_string); + + + switch(f1ap_message_p->procedureCode) { + case F1ap_ProcedureCode_id_InitialContextSetup: + ret = f1ap_encode_initial_context_setup_response( + &f1ap_message_p->msg.f1ap_InitialContextSetupResponseIEs, buffer, len); + + f1ap_xer_print_f1ap_initialcontextsetupresponse(f1ap_xer__print2sp, message_string, f1ap_message_p); + message_id = F1AP_INITIAL_CONTEXT_SETUP_LOG; + message_p = itti_alloc_new_message_sized(TASK_F1AP, message_id, message_string_size + sizeof (IttiMsgText)); + message_p->ittiMsg.f1ap_initial_context_setup_log.size = message_string_size; + memcpy(&message_p->ittiMsg.f1ap_initial_context_setup_log.text, message_string, message_string_size); + itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p); + free(message_string); + break; + + case F1ap_ProcedureCode_id_UEContextRelease: + ret = f1ap_encode_ue_context_release_complete( + &f1ap_message_p->msg.f1ap_UEContextReleaseCompleteIEs, buffer, len); + f1ap_xer_print_f1ap_uecontextreleasecomplete(f1ap_xer__print2sp, message_string, f1ap_message_p); + message_id = F1AP_UE_CONTEXT_RELEASE_COMPLETE_LOG; + message_p = itti_alloc_new_message_sized(TASK_F1AP, message_id, message_string_size + sizeof (IttiMsgText)); + message_p->ittiMsg.f1ap_ue_context_release_complete_log.size = message_string_size; + memcpy(&message_p->ittiMsg.f1ap_ue_context_release_complete_log.text, message_string, message_string_size); + itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p); + free(message_string); + break; + + default: + F1AP_WARN("Unknown procedure ID (%d) for successfull outcome message\n", + (int)f1ap_message_p->procedureCode); + return ret; + break; + } + + + return ret; +} + +static inline +int f1ap_encode_unsuccessfull_outcome(f1ap_message *f1ap_message_p, + uint8_t **buffer, uint32_t *len) +{ + int ret = -1; + MessageDef *message_p; + char *message_string = NULL; + size_t message_string_size; + MessagesIds message_id; + + DevAssert(f1ap_message_p != NULL); + + message_string = calloc(10000, sizeof(char)); + + f1ap_string_total_size = 0; + + switch(f1ap_message_p->procedureCode) { + case F1ap_ProcedureCode_id_InitialContextSetup: + // ret = f1ap_encode_f1ap_initialcontextsetupfailureies( + // &f1ap_message_p->ittiMsg.f1ap_InitialContextSetupFailureIEs, buffer, len); + f1ap_xer_print_f1ap_initialcontextsetupfailure(f1ap_xer__print2sp, message_string, f1ap_message_p); + message_id = F1AP_INITIAL_CONTEXT_SETUP_LOG; + break; + + default: + F1AP_DEBUG("Unknown procedure ID (%d) for unsuccessfull outcome message\n", + (int)f1ap_message_p->procedureCode); + return ret; + break; + } + + message_string_size = strlen(message_string); + + message_p = itti_alloc_new_message_sized(TASK_F1AP, message_id, message_string_size + sizeof (IttiMsgText)); + message_p->ittiMsg.f1ap_initial_context_setup_log.size = message_string_size; + memcpy(&message_p->ittiMsg.f1ap_initial_context_setup_log.text, message_string, message_string_size); + + itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p); + + free(message_string); + + return ret; +} + +static inline +int f1ap_encode_f1_setup_request( + F1ap_F1SetupRequestIEs_t *f1SetupRequestIEs, + uint8_t **buffer, + uint32_t *length) +{ + F1ap_F1SetupRequest_t f1SetupRequest; + F1ap_F1SetupRequest_t *f1SetupRequest_p = &f1SetupRequest; + + memset((void *)f1SetupRequest_p, 0, sizeof(f1SetupRequest)); + + if (f1ap_encode_f1ap_f1setuprequesties(f1SetupRequest_p, f1SetupRequestIEs) < 0) { + return -1; + } + + return f1ap_generate_initiating_message(buffer, + length, + F1ap_ProcedureCode_id_F1Setup, + F1ap_Criticality_reject, + &asn_DEF_F1ap_F1SetupRequest, + f1SetupRequest_p); +} + +static inline +int f1ap_encode_trace_failure( + F1ap_TraceFailureIndicationIEs_t *trace_failure_ies_p, + uint8_t **buffer, + uint32_t *length) +{ + F1ap_TraceFailureIndication_t trace_failure; + F1ap_TraceFailureIndication_t *trace_failure_p = &trace_failure; + + memset((void *)trace_failure_p, 0, sizeof(trace_failure)); + + if (f1ap_encode_f1ap_tracefailureindicationies( + trace_failure_p, trace_failure_ies_p) < 0) { + return -1; + } + + return f1ap_generate_initiating_message(buffer, + length, + F1ap_ProcedureCode_id_TraceFailureIndication, + F1ap_Criticality_reject, + &asn_DEF_F1ap_TraceFailureIndication, + trace_failure_p); +} + +static inline +int f1ap_encode_initial_context_setup_response( + F1ap_InitialContextSetupResponseIEs_t *initialContextSetupResponseIEs, + uint8_t **buffer, + uint32_t *length) +{ + F1ap_InitialContextSetupResponse_t initial_context_setup_response; + F1ap_InitialContextSetupResponse_t *initial_context_setup_response_p = + &initial_context_setup_response; + + memset((void *)initial_context_setup_response_p, 0, + sizeof(initial_context_setup_response)); + + if (f1ap_encode_f1ap_initialcontextsetupresponseies( + initial_context_setup_response_p, initialContextSetupResponseIEs) < 0) { + return -1; + } + + return f1ap_generate_successfull_outcome(buffer, + length, + F1ap_ProcedureCode_id_InitialContextSetup, + F1ap_Criticality_reject, + &asn_DEF_F1ap_InitialContextSetupResponse, + initial_context_setup_response_p); +} + +static inline +int f1ap_encode_ue_context_release_complete( + F1ap_UEContextReleaseCompleteIEs_t *f1ap_UEContextReleaseCompleteIEs, + uint8_t **buffer, + uint32_t *length) +{ + F1ap_UEContextReleaseComplete_t ue_context_release_complete; + F1ap_UEContextReleaseComplete_t *ue_context_release_complete_p = + &ue_context_release_complete; + + memset((void *)ue_context_release_complete_p, 0, + sizeof(ue_context_release_complete)); + + if (f1ap_encode_f1ap_uecontextreleasecompleteies( + ue_context_release_complete_p, f1ap_UEContextReleaseCompleteIEs) < 0) { + return -1; + } + + return f1ap_generate_successfull_outcome(buffer, + length, + F1ap_ProcedureCode_id_UEContextRelease, + F1ap_Criticality_reject, + &asn_DEF_F1ap_UEContextReleaseComplete, + ue_context_release_complete_p); +} + +static inline +int f1ap_encode_ue_context_release_request( + F1ap_UEContextReleaseRequestIEs_t *f1ap_UEContextReleaseRequestIEs, + uint8_t **buffer, + uint32_t *length) +{ + F1ap_UEContextReleaseRequest_t ue_context_release_request; + F1ap_UEContextReleaseRequest_t *ue_context_release_request_p = + &ue_context_release_request; + + memset((void *)ue_context_release_request_p, 0, + sizeof(ue_context_release_request)); + + if (f1ap_encode_f1ap_uecontextreleaserequesties( + ue_context_release_request_p, f1ap_UEContextReleaseRequestIEs) < 0) { + return -1; + } + + return f1ap_generate_initiating_message(buffer, + length, + F1ap_ProcedureCode_id_UEContextReleaseRequest, + F1ap_Criticality_reject, + &asn_DEF_F1ap_UEContextReleaseRequest, + ue_context_release_request_p); +} + diff --git a/openair2/F1AP/f1ap_encoder.h b/openair2/F1AP/f1ap_encoder.h new file mode 100644 index 0000000000..d926497aa5 --- /dev/null +++ b/openair2/F1AP/f1ap_encoder.h @@ -0,0 +1,39 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file f1ap_encoder.h + * \brief f1ap pdu encode procedures + * \author EURECOM/NTUST + * \date 2018 + * \version 0.1 + * \company Eurecom + * \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr + * \note + * \warning + */ + +#ifndef F1AP_ENCODER_H_ +#define F1AP_ENCODER_H_ + +int f1ap_encode_pdu(f1ap_message *message, uint8_t **buffer, uint32_t *len) +__attribute__ ((warn_unused_result)); + +#endif /* F1AP_ENCODER_H_ */ diff --git a/openair2/F1AP/f1ap_handlers.c b/openair2/F1AP/f1ap_handlers.c new file mode 100644 index 0000000000..e779364803 --- /dev/null +++ b/openair2/F1AP/f1ap_handlers.c @@ -0,0 +1,1381 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file f1ap_handlers.c + * \brief f1ap messages handlers + * \author EURECOM/NTUST + * \date 2018 + * \version 0.1 + * \company Eurecom + * \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr + * \note + * \warning + */ + +#include + +#include "intertask_interface.h" + +#include "asn1_conversions.h" + +#include "f1ap_common.h" +#include "f1ap_ies_defs.h" +// #include "f1ap_eNB.h" +#include "f1ap_defs.h" +#include "f1ap_handlers.h" +#include "f1ap_decoder.h" + +#include "f1ap_ue_context.h" +#include "f1ap_trace.h" +#include "f1ap_nas_procedures.h" +#include "f1ap_management_procedures.h" + +#include "f1ap_default_values.h" + +#include "assertions.h" +#include "conversions.h" +#include "msc.h" + +static +int f1ap_handle_f1_setup_response(uint32_t assoc_id, + uint32_t stream, + struct f1ap_message_s *message_p); +static +int f1ap_handle_f1_setup_failure(uint32_t assoc_id, + uint32_t stream, + struct f1ap_message_s *message_p); + +static +int f1ap_handle_error_indication(uint32_t assoc_id, + uint32_t stream, + struct f1ap_message_s *message_p); + +static +int f1ap_handle_initial_context_request(uint32_t assoc_id, + uint32_t stream, + struct f1ap_message_s *message_p); + +static +int f1ap_handle_ue_context_release_command(uint32_t assoc_id, + uint32_t stream, + struct f1ap_message_s *f1ap_message_p); + + +static +int f1ap_handle_e_rab_setup_request(uint32_t assoc_id, + uint32_t stream, + struct f1ap_message_s *f1ap_message_p); + +static +int f1ap_handle_paging(uint32_t assoc_id, + uint32_t stream, + struct f1ap_message_s *message_p); + +static +int f1ap_handle_e_rab_modify_request(uint32_t assoc_id, + uint32_t stream, + struct f1ap_message_s *f1ap_message_p); + +static +int f1ap_handle_e_rab_release_command(uint32_t assoc_id, + uint32_t stream, + struct f1ap_message_s *f1ap_message_p); + +/* Handlers matrix. Only eNB related procedure present here */ +f1ap_message_decoded_callback messages_callback[][3] = { + { 0, 0, 0 }, /* HandoverPreparation */ + { 0, 0, 0 }, /* HandoverResourceAllocation */ + { 0, 0, 0 }, /* HandoverNotification */ + { 0, 0, 0 }, /* PathSwitchRequest */ + { 0, 0, 0 }, /* HandoverCancel */ + { f1ap_handle_e_rab_setup_request, 0, 0 }, /* E_RABSetup */ + { f1ap_handle_e_rab_modify_request, 0, 0 }, /* E_RABModify */ + { f1ap_handle_e_rab_release_command, 0, 0 }, /* E_RABRelease */ + { 0, 0, 0 }, /* E_RABReleaseIndication */ + { f1ap_handle_initial_context_request, 0, 0 }, /* InitialContextSetup */ + { f1ap_handle_paging, 0, 0 }, /* Paging */ + { f1ap_handle_nas_downlink, 0, 0 }, /* downlinkNASTransport */ + { 0, 0, 0 }, /* initialUEMessage */ + { 0, 0, 0 }, /* uplinkNASTransport */ + { 0, 0, 0 }, /* Reset */ + { f1ap_handle_error_indication, 0, 0 }, /* ErrorIndication */ + { 0, 0, 0 }, /* NASNonDeliveryIndication */ + { 0, f1ap_handle_f1_setup_response, f1ap_handle_f1_setup_failure }, /* F1Setup */ + { 0, 0, 0 }, /* UEContextReleaseRequest */ + { 0, 0, 0 }, /* DownlinkF1cdma2000tunneling */ + { 0, 0, 0 }, /* UplinkF1cdma2000tunneling */ + { 0, 0, 0 }, /* UEContextModification */ + { 0, 0, 0 }, /* UECapabilityInfoIndication */ + { f1ap_handle_ue_context_release_command, 0, 0 }, /* UEContextRelease */ + { 0, 0, 0 }, /* eNBStatusTransfer */ + { 0, 0, 0 }, /* MMEStatusTransfer */ + { f1ap_handle_deactivate_trace, 0, 0 }, /* DeactivateTrace */ + { f1ap_handle_trace_start, 0, 0 }, /* TraceStart */ + { 0, 0, 0 }, /* TraceFailureIndication */ + { 0, 0, 0 }, /* ENBConfigurationUpdate */ + { 0, 0, 0 }, /* MMEConfigurationUpdate */ + { 0, 0, 0 }, /* LocationReportingControl */ + { 0, 0, 0 }, /* LocationReportingFailureIndication */ + { 0, 0, 0 }, /* LocationReport */ + { 0, 0, 0 }, /* OverloadStart */ + { 0, 0, 0 }, /* OverloadStop */ + { 0, 0, 0 }, /* WriteReplaceWarning */ + { 0, 0, 0 }, /* eNBDirectInformationTransfer */ + { 0, 0, 0 }, /* MMEDirectInformationTransfer */ + { 0, 0, 0 }, /* PrivateMessage */ + { 0, 0, 0 }, /* eNBConfigurationTransfer */ + { 0, 0, 0 }, /* MMEConfigurationTransfer */ + { 0, 0, 0 }, /* CellTrafficTrace */ +#if (F1AP_VERSION >= MAKE_VERSION(9, 0, 0)) + { 0, 0, 0 }, /* Kill */ + { 0, 0, 0 }, /* DownlinkUEAssociatedLPPaTransport */ + { 0, 0, 0 }, /* UplinkUEAssociatedLPPaTransport */ + { 0, 0, 0 }, /* DownlinkNonUEAssociatedLPPaTransport */ + { 0, 0, 0 }, /* UplinkNonUEAssociatedLPPaTransport */ +#endif +}; + +static const char *f1ap_direction2String[] = { + "", /* Nothing */ + "Originating message", /* originating message */ + "Successfull outcome", /* successfull outcome */ + "UnSuccessfull outcome", /* successfull outcome */ +}; + +void f1ap_handle_f1_setup_message(f1ap_mme_data_t *mme_desc_p, int sctp_shutdown) +{ + if (sctp_shutdown) { + /* A previously connected MME has been shutdown */ + + /* TODO check if it was used by some eNB and send a message to inform these eNB if there is no more associated MME */ + if (mme_desc_p->state == F1AP_ENB_STATE_CONNECTED) { + mme_desc_p->state = F1AP_ENB_STATE_DISCONNECTED; + + if (mme_desc_p->f1ap_instance->f1ap_mme_associated_nb > 0) { + /* Decrease associated MME number */ + mme_desc_p->f1ap_instance->f1ap_mme_associated_nb --; + } + + /* If there are no more associated MME, inform eNB app */ + if (mme_desc_p->f1ap_instance->f1ap_mme_associated_nb == 0) { + MessageDef *message_p; + + message_p = itti_alloc_new_message(TASK_F1AP, F1AP_DEREGISTERED_ENB_IND); + F1AP_DEREGISTERED_ENB_IND(message_p).nb_mme = 0; + itti_send_msg_to_task(TASK_ENB_APP, mme_desc_p->f1ap_instance->instance, message_p); + } + } + } else { + /* Check that at least one setup message is pending */ + DevCheck(mme_desc_p->f1ap_instance->f1ap_mme_pending_nb > 0, mme_desc_p->f1ap_instance->instance, + mme_desc_p->f1ap_instance->f1ap_mme_pending_nb, 0); + + if (mme_desc_p->f1ap_instance->f1ap_mme_pending_nb > 0) { + /* Decrease pending messages number */ + mme_desc_p->f1ap_instance->f1ap_mme_pending_nb --; + } + + /* If there are no more pending messages, inform eNB app */ + if (mme_desc_p->f1ap_instance->f1ap_mme_pending_nb == 0) { + MessageDef *message_p; + + message_p = itti_alloc_new_message(TASK_F1AP, F1AP_REGISTER_ENB_CNF); + F1AP_REGISTER_ENB_CNF(message_p).nb_mme = mme_desc_p->f1ap_instance->f1ap_mme_associated_nb; + itti_send_msg_to_task(TASK_ENB_APP, mme_desc_p->f1ap_instance->instance, message_p); + } + } +} + +int f1ap_handle_message(uint32_t assoc_id, int32_t stream, + const uint8_t * const data, const uint32_t data_length) +{ + struct f1ap_message_s message; + + DevAssert(data != NULL); + + memset(&message, 0, sizeof(struct f1ap_message_s)); + + if (f1ap_decode_pdu(&message, data, data_length) < 0) { + F1AP_ERROR("Failed to decode PDU\n"); + return -1; + } + + /* Checking procedure Code and direction of message */ + if (message.procedureCode > sizeof(messages_callback) / (3 * sizeof( + f1ap_message_decoded_callback)) + || (message.direction > F1AP_PDU_PR_unsuccessfulOutcome)) { + F1AP_ERROR("[SCTP %d] Either procedureCode %ld or direction %d exceed expected\n", + assoc_id, message.procedureCode, message.direction); + return -1; + } + + /* No handler present. + * This can mean not implemented or no procedure for eNB (wrong direction). + */ + if (messages_callback[message.procedureCode][message.direction-1] == NULL) { + F1AP_ERROR("[SCTP %d] No handler for procedureCode %ld in %s\n", + assoc_id, message.procedureCode, + f1ap_direction2String[message.direction]); + return -1; + } + + /* Calling the right handler */ + return (*messages_callback[message.procedureCode][message.direction-1]) + (assoc_id, stream, &message); +} + +static +int f1ap_handle_f1_setup_failure(uint32_t assoc_id, + uint32_t stream, + struct f1ap_message_s *message_p) +{ + F1ap_F1SetupFailureIEs_t *f1_setup_failure_p; + f1ap_mme_data_t *mme_desc_p; + + DevAssert(message_p != NULL); + + f1_setup_failure_p = &message_p->msg.f1ap_F1SetupFailureIEs; + + /* F1 Setup Failure == Non UE-related procedure -> stream 0 */ + if (stream != 0) { + F1AP_WARN("[SCTP %d] Received f1 setup failure on stream != 0 (%d)\n", + assoc_id, stream); + } + + if ((mme_desc_p = f1ap_get_MME(NULL, assoc_id, 0)) == NULL) { + F1AP_ERROR("[SCTP %d] Received F1 setup response for non existing " + "MME context\n", assoc_id); + return -1; + } + + if ((f1_setup_failure_p->cause.present == F1ap_Cause_PR_misc) && + (f1_setup_failure_p->cause.choice.misc == F1ap_CauseMisc_unspecified)) { + F1AP_WARN("Received f1 setup failure for MME... MME is not ready\n"); + } else { + F1AP_ERROR("Received f1 setup failure for MME... please check your parameters\n"); + } + + mme_desc_p->state = F1AP_ENB_STATE_WAITING; + f1ap_handle_f1_setup_message(mme_desc_p, 0); + + return 0; +} + +static +int f1ap_handle_f1_setup_response(uint32_t assoc_id, + uint32_t stream, + struct f1ap_message_s *message_p) +{ + F1ap_F1SetupResponseIEs_t *f1SetupResponse_p; + f1ap_mme_data_t *mme_desc_p; + int i; + + DevAssert(message_p != NULL); + + f1SetupResponse_p = &message_p->msg.f1ap_F1SetupResponseIEs; + + /* F1 Setup Response == Non UE-related procedure -> stream 0 */ + if (stream != 0) { + F1AP_ERROR("[SCTP %d] Received f1 setup response on stream != 0 (%d)\n", + assoc_id, stream); + return -1; + } + + if ((mme_desc_p = f1ap_get_MME(NULL, assoc_id, 0)) == NULL) { + F1AP_ERROR("[SCTP %d] Received F1 setup response for non existing " + "MME context\n", assoc_id); + return -1; + } + + /* The list of served gummei can contain at most 8 elements. + * LTE related gummei is the first element in the list, i.e with an id of 0. + */ + F1AP_DEBUG("servedGUMMEIs.list.count %d\n",f1SetupResponse_p->servedGUMMEIs.list.count); + DevAssert(f1SetupResponse_p->servedGUMMEIs.list.count > 0); + DevAssert(f1SetupResponse_p->servedGUMMEIs.list.count <= 8); + + + for (i = 0; i < f1SetupResponse_p->servedGUMMEIs.list.count; i++) { + struct F1ap_ServedGUMMEIsItem *gummei_item_p; + struct served_gummei_s *new_gummei_p; + int j; + + gummei_item_p = (struct F1ap_ServedGUMMEIsItem *) + f1SetupResponse_p->servedGUMMEIs.list.array[i]; + new_gummei_p = calloc(1, sizeof(struct served_gummei_s)); + + STAILQ_INIT(&new_gummei_p->served_plmns); + STAILQ_INIT(&new_gummei_p->served_group_ids); + STAILQ_INIT(&new_gummei_p->mme_codes); + + F1AP_DEBUG("servedPLMNs.list.count %d\n",gummei_item_p->servedPLMNs.list.count); + for (j = 0; j < gummei_item_p->servedPLMNs.list.count; j++) { + F1ap_PLMNidentity_t *plmn_identity_p; + struct plmn_identity_s *new_plmn_identity_p; + + plmn_identity_p = gummei_item_p->servedPLMNs.list.array[j]; + new_plmn_identity_p = calloc(1, sizeof(struct plmn_identity_s)); + TBCD_TO_MCC_MNC(plmn_identity_p, new_plmn_identity_p->mcc, + new_plmn_identity_p->mnc, new_plmn_identity_p->mnc_digit_length); + STAILQ_INSERT_TAIL(&new_gummei_p->served_plmns, new_plmn_identity_p, next); + new_gummei_p->nb_served_plmns++; + } + + for (j = 0; j < gummei_item_p->servedGroupIDs.list.count; j++) { + F1ap_MME_Group_ID_t *mme_group_id_p; + struct served_group_id_s *new_group_id_p; + + mme_group_id_p = gummei_item_p->servedGroupIDs.list.array[j]; + new_group_id_p = calloc(1, sizeof(struct served_group_id_s)); + OCTET_STRING_TO_INT16(mme_group_id_p, new_group_id_p->mme_group_id); + STAILQ_INSERT_TAIL(&new_gummei_p->served_group_ids, new_group_id_p, next); + new_gummei_p->nb_group_id++; + } + + for (j = 0; j < gummei_item_p->servedMMECs.list.count; j++) { + F1ap_MME_Code_t *mme_code_p; + struct mme_code_s *new_mme_code_p; + + mme_code_p = gummei_item_p->servedMMECs.list.array[j]; + new_mme_code_p = calloc(1, sizeof(struct mme_code_s)); + + OCTET_STRING_TO_INT8(mme_code_p, new_mme_code_p->mme_code); + STAILQ_INSERT_TAIL(&new_gummei_p->mme_codes, new_mme_code_p, next); + new_gummei_p->nb_mme_code++; + } + + STAILQ_INSERT_TAIL(&mme_desc_p->served_gummei, new_gummei_p, next); + } + + /* Free contents of the list */ + ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_F1ap_ServedGUMMEIs, + (void *)&f1SetupResponse_p->servedGUMMEIs); + /* Set the capacity of this MME */ + mme_desc_p->relative_mme_capacity = f1SetupResponse_p->relativeMMECapacity; + + /* Optionaly set the mme name */ + if (f1SetupResponse_p->presenceMask & F1AP_F1SETUPRESPONSEIES_MMENAME_PRESENT) { + mme_desc_p->mme_name = calloc(f1SetupResponse_p->mmEname.size + 1, sizeof(char)); + memcpy(mme_desc_p->mme_name, f1SetupResponse_p->mmEname.buf, + f1SetupResponse_p->mmEname.size); + /* Convert the mme name to a printable string */ + mme_desc_p->mme_name[f1SetupResponse_p->mmEname.size] = '\0'; + } + + /* The association is now ready as eNB and MME know parameters of each other. + * Mark the association as UP to enable UE contexts creation. + */ + mme_desc_p->state = F1AP_ENB_STATE_CONNECTED; + mme_desc_p->f1ap_instance->f1ap_mme_associated_nb ++; + f1ap_handle_f1_setup_message(mme_desc_p, 0); + +#if 0 + /* We call back our self + * -> generate a dummy initial UE message + */ + { + f1ap_nas_first_req_t f1ap_nas_first_req; + + memset(&f1ap_nas_first_req, 0, sizeof(f1ap_nas_first_req_t)); + + f1ap_nas_first_req.rnti = 0xC03A; + f1ap_nas_first_req.establishment_cause = RRC_CAUSE_MO_DATA; + f1ap_nas_first_req.ue_identity.presenceMask = UE_IDENTITIES_gummei; + + f1ap_nas_first_req.ue_identity.gummei.mcc = 208; + f1ap_nas_first_req.ue_identity.gummei.mnc = 34; + f1ap_nas_first_req.ue_identity.gummei.mme_code = 0; + f1ap_nas_first_req.ue_identity.gummei.mme_group_id = 0; + + /* NAS Attach request with IMSI */ + static uint8_t nas_attach_req_imsi[] = { + 0x07, 0x41, + /* EPS Mobile identity = IMSI */ + 0x71, 0x08, 0x29, 0x80, 0x43, 0x21, 0x43, 0x65, 0x87, + 0xF9, + /* End of EPS Mobile Identity */ + 0x02, 0xE0, 0xE0, 0x00, 0x20, 0x02, 0x03, + 0xD0, 0x11, 0x27, 0x1A, 0x80, 0x80, 0x21, 0x10, 0x01, 0x00, 0x00, + 0x10, 0x81, 0x06, 0x00, 0x00, 0x00, 0x00, 0x83, 0x06, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x0A, 0x00, 0x52, 0x12, 0xF2, + 0x01, 0x27, 0x11, + }; + + /* NAS Attach request with GUTI */ + static uint8_t nas_attach_req_guti[] = { + 0x07, 0x41, + /* EPS Mobile identity = IMSI */ + 0x71, 0x0B, 0xF6, 0x12, 0xF2, 0x01, 0x80, 0x00, 0x01, 0xE0, 0x00, + 0xDA, 0x1F, + /* End of EPS Mobile Identity */ + 0x02, 0xE0, 0xE0, 0x00, 0x20, 0x02, 0x03, + 0xD0, 0x11, 0x27, 0x1A, 0x80, 0x80, 0x21, 0x10, 0x01, 0x00, 0x00, + 0x10, 0x81, 0x06, 0x00, 0x00, 0x00, 0x00, 0x83, 0x06, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x0A, 0x00, 0x52, 0x12, 0xF2, + 0x01, 0x27, 0x11, + }; + + f1ap_nas_first_req.nas_pdu.buffer = nas_attach_req_guti; + f1ap_nas_first_req.nas_pdu.length = sizeof(nas_attach_req_guti); + + f1ap_handle_nas_first_req(mme_desc_p->f1ap_instance->instance, + &f1ap_nas_first_req); + } +#endif + + return 0; +} + + +static +int f1ap_handle_error_indication(uint32_t assoc_id, + uint32_t stream, + struct f1ap_message_s *message_p) +{ + F1ap_ErrorIndicationIEs_t *f1_error_indication_p; + f1ap_mme_data_t *mme_desc_p; + + DevAssert(message_p != NULL); + + f1_error_indication_p = &message_p->msg.f1ap_ErrorIndicationIEs; + + /* F1 Setup Failure == Non UE-related procedure -> stream 0 */ + if (stream != 0) { + F1AP_WARN("[SCTP %d] Received f1 Error indication on stream != 0 (%d)\n", + assoc_id, stream); + } + + if ((mme_desc_p = f1ap_get_MME(NULL, assoc_id, 0)) == NULL) { + F1AP_ERROR("[SCTP %d] Received F1 Error indication for non existing " + "MME context\n", assoc_id); + return -1; + } + if ( f1_error_indication_p->presenceMask & F1AP_ERRORINDICATIONIES_MME_UE_F1AP_ID_PRESENT) { + F1AP_WARN("Received F1 Error indication MME UE F1AP ID 0x%lx\n", f1_error_indication_p->mme_ue_f1ap_id); + } + if ( f1_error_indication_p->presenceMask & F1AP_ERRORINDICATIONIES_ENB_UE_F1AP_ID_PRESENT) { + F1AP_WARN("Received F1 Error indication eNB UE F1AP ID 0x%lx\n", f1_error_indication_p->eNB_UE_F1AP_ID); + } + + if ( f1_error_indication_p->presenceMask & F1AP_ERRORINDICATIONIES_CAUSE_PRESENT) { + switch(f1_error_indication_p->cause.present) { + case F1ap_Cause_PR_NOTHING: + F1AP_WARN("Received F1 Error indication cause NOTHING\n"); + break; + case F1ap_Cause_PR_radioNetwork: + switch (f1_error_indication_p->cause.choice.radioNetwork) { + case F1ap_CauseRadioNetwork_unspecified: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_unspecified\n"); + break; + case F1ap_CauseRadioNetwork_tx2relocoverall_expiry: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_tx2relocoverall_expiry\n"); + break; + case F1ap_CauseRadioNetwork_successful_handover: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_successful_handover\n"); + break; + case F1ap_CauseRadioNetwork_release_due_to_eutran_generated_reason: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_release_due_to_eutran_generated_reason\n"); + break; + case F1ap_CauseRadioNetwork_handover_cancelled: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_handover_cancelled\n"); + break; + case F1ap_CauseRadioNetwork_partial_handover: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_partial_handover\n"); + break; + case F1ap_CauseRadioNetwork_ho_failure_in_target_EPC_eNB_or_target_system: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_ho_failure_in_target_EPC_eNB_or_target_system\n"); + break; + case F1ap_CauseRadioNetwork_ho_target_not_allowed: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_ho_target_not_allowed\n"); + break; + case F1ap_CauseRadioNetwork_tF1relocoverall_expiry: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_tF1relocoverall_expiry\n"); + break; + case F1ap_CauseRadioNetwork_tF1relocprep_expiry: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_tF1relocprep_expiry\n"); + break; + case F1ap_CauseRadioNetwork_cell_not_available: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_cell_not_available\n"); + break; + case F1ap_CauseRadioNetwork_unknown_targetID: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_unknown_targetID\n"); + break; + case F1ap_CauseRadioNetwork_no_radio_resources_available_in_target_cell: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_no_radio_resources_available_in_target_cell\n"); + break; + case F1ap_CauseRadioNetwork_unknown_mme_ue_f1ap_id: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_unknown_mme_ue_f1ap_id\n"); + break; + case F1ap_CauseRadioNetwork_unknown_enb_ue_f1ap_id: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_unknown_enb_ue_f1ap_id\n"); + break; + case F1ap_CauseRadioNetwork_unknown_pair_ue_f1ap_id: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_unknown_pair_ue_f1ap_id\n"); + break; + case F1ap_CauseRadioNetwork_handover_desirable_for_radio_reason: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_handover_desirable_for_radio_reason\n"); + break; + case F1ap_CauseRadioNetwork_time_critical_handover: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_time_critical_handover\n"); + break; + case F1ap_CauseRadioNetwork_resource_optimisation_handover: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_resource_optimisation_handover\n"); + break; + case F1ap_CauseRadioNetwork_reduce_load_in_serving_cell: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_reduce_load_in_serving_cell\n"); + break; + case F1ap_CauseRadioNetwork_user_inactivity: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_user_inactivity\n"); + break; + case F1ap_CauseRadioNetwork_radio_connection_with_ue_lost: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_radio_connection_with_ue_lost\n"); + break; + case F1ap_CauseRadioNetwork_load_balancing_tau_required: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_load_balancing_tau_required\n"); + break; + case F1ap_CauseRadioNetwork_cs_fallback_triggered: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_cs_fallback_triggered\n"); + break; + case F1ap_CauseRadioNetwork_ue_not_available_for_ps_service: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_ue_not_available_for_ps_service\n"); + break; + case F1ap_CauseRadioNetwork_radio_resources_not_available: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_radio_resources_not_available\n"); + break; + case F1ap_CauseRadioNetwork_failure_in_radio_interface_procedure: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_failure_in_radio_interface_procedure\n"); + break; + case F1ap_CauseRadioNetwork_invalf1ap_id_qos_combination: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_invalf1ap_id_qos_combination\n"); + break; + case F1ap_CauseRadioNetwork_interrat_redirection: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_interrat_redirection\n"); + break; + case F1ap_CauseRadioNetwork_interaction_with_other_procedure: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_interaction_with_other_procedure\n"); + break; + case F1ap_CauseRadioNetwork_unknown_E_RAB_ID: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_unknown_E_RAB_ID\n"); + break; + case F1ap_CauseRadioNetwork_multiple_E_RAB_ID_instances: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_multiple_E_RAB_ID_instances\n"); + break; + case F1ap_CauseRadioNetwork_encryption_and_or_integrity_protection_algorithms_not_supported: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_encryption_and_or_integrity_protection_algorithms_not_supported\n"); + break; + case F1ap_CauseRadioNetwork_f1_intra_system_handover_triggered: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_f1_intra_system_handover_triggered\n"); + break; + case F1ap_CauseRadioNetwork_f1_inter_system_handover_triggered: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_f1_inter_system_handover_triggered\n"); + break; + case F1ap_CauseRadioNetwork_x2_handover_triggered: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_x2_handover_triggered\n"); + break; + case F1ap_CauseRadioNetwork_redirection_towards_1xRTT: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_redirection_towards_1xRTT\n"); + break; + case F1ap_CauseRadioNetwork_not_supported_QCI_value: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_not_supported_QCI_value\n"); + break; + case F1ap_CauseRadioNetwork_invalf1ap_id_CSG_Id: + F1AP_WARN("Received F1 Error indication F1ap_CauseRadioNetwork_invalf1ap_id_CSG_Id\n"); + break; + default: + F1AP_WARN("Received F1 Error indication cause radio network case not handled\n"); + } + break; + + case F1ap_Cause_PR_transport: + switch (f1_error_indication_p->cause.choice.transport) { + case F1ap_CauseTransport_transport_resource_unavailable: + F1AP_WARN("Received F1 Error indication F1ap_CauseTransport_transport_resource_unavailable\n"); + break; + case F1ap_CauseTransport_unspecified: + F1AP_WARN("Received F1 Error indication F1ap_CauseTransport_unspecified\n"); + break; + default: + F1AP_WARN("Received F1 Error indication cause transport case not handled\n"); + } + break; + + case F1ap_Cause_PR_nas: + switch (f1_error_indication_p->cause.choice.nas) { + case F1ap_CauseNas_normal_release: + F1AP_WARN("Received F1 Error indication F1ap_CauseNas_normal_release\n"); + break; + case F1ap_CauseNas_authentication_failure: + F1AP_WARN("Received F1 Error indication F1ap_CauseNas_authentication_failure\n"); + break; + case F1ap_CauseNas_detach: + F1AP_WARN("Received F1 Error indication F1ap_CauseNas_detach\n"); + break; + case F1ap_CauseNas_unspecified: + F1AP_WARN("Received F1 Error indication F1ap_CauseNas_unspecified\n"); + break; + case F1ap_CauseNas_csg_subscription_expiry: + F1AP_WARN("Received F1 Error indication F1ap_CauseNas_csg_subscription_expiry\n"); + break; + default: + F1AP_WARN("Received F1 Error indication cause nas case not handled\n"); + } + break; + + case F1ap_Cause_PR_protocol: + switch (f1_error_indication_p->cause.choice.protocol) { + case F1ap_CauseProtocol_transfer_syntax_error: + F1AP_WARN("Received F1 Error indication F1ap_CauseProtocol_transfer_syntax_error\n"); + break; + case F1ap_CauseProtocol_abstract_syntax_error_reject: + F1AP_WARN("Received F1 Error indication F1ap_CauseProtocol_abstract_syntax_error_reject\n"); + break; + case F1ap_CauseProtocol_abstract_syntax_error_ignore_and_notify: + F1AP_WARN("Received F1 Error indication F1ap_CauseProtocol_abstract_syntax_error_ignore_and_notify\n"); + break; + case F1ap_CauseProtocol_message_not_compatible_with_receiver_state: + F1AP_WARN("Received F1 Error indication F1ap_CauseProtocol_message_not_compatible_with_receiver_state\n"); + break; + case F1ap_CauseProtocol_semantic_error: + F1AP_WARN("Received F1 Error indication F1ap_CauseProtocol_semantic_error\n"); + break; + case F1ap_CauseProtocol_abstract_syntax_error_falsely_constructed_message: + F1AP_WARN("Received F1 Error indication F1ap_CauseProtocol_abstract_syntax_error_falsely_constructed_message\n"); + break; + case F1ap_CauseProtocol_unspecified: + F1AP_WARN("Received F1 Error indication F1ap_CauseProtocol_unspecified\n"); + break; + default: + F1AP_WARN("Received F1 Error indication cause protocol case not handled\n"); + } + break; + + case F1ap_Cause_PR_misc: + switch (f1_error_indication_p->cause.choice.protocol) { + case F1ap_CauseMisc_control_processing_overload: + F1AP_WARN("Received F1 Error indication F1ap_CauseMisc_control_processing_overload\n"); + break; + case F1ap_CauseMisc_not_enough_user_plane_processing_resources: + F1AP_WARN("Received F1 Error indication F1ap_CauseMisc_not_enough_user_plane_processing_resources\n"); + break; + case F1ap_CauseMisc_hardware_failure: + F1AP_WARN("Received F1 Error indication F1ap_CauseMisc_hardware_failure\n"); + break; + case F1ap_CauseMisc_om_intervention: + F1AP_WARN("Received F1 Error indication F1ap_CauseMisc_om_intervention\n"); + break; + case F1ap_CauseMisc_unspecified: + F1AP_WARN("Received F1 Error indication F1ap_CauseMisc_unspecified\n"); + break; + case F1ap_CauseMisc_unknown_PLMN: + F1AP_WARN("Received F1 Error indication F1ap_CauseMisc_unknown_PLMN\n"); + break; + default: + F1AP_WARN("Received F1 Error indication cause misc case not handled\n"); + } + break; + } + } + if ( f1_error_indication_p->presenceMask & F1AP_ERRORINDICATIONIES_CRITICALITYDIAGNOSTICS_PRESENT) { + // TODO continue + } + // TODO continue + + return 0; +} + + +static +int f1ap_handle_initial_context_request(uint32_t assoc_id, + uint32_t stream, + struct f1ap_message_s *f1ap_message_p) +{ + int i; + + f1ap_mme_data_t *mme_desc_p = NULL; + f1ap_ue_context_t *ue_desc_p = NULL; + MessageDef *message_p = NULL; + + F1ap_InitialContextSetupRequestIEs_t *initialContextSetupRequest_p; + DevAssert(f1ap_message_p != NULL); + + initialContextSetupRequest_p = &f1ap_message_p->msg.f1ap_InitialContextSetupRequestIEs; + + if ((mme_desc_p = f1ap_get_MME(NULL, assoc_id, 0)) == NULL) { + F1AP_ERROR("[SCTP %d] Received initial context setup request for non " + "existing MME context\n", assoc_id); + return -1; + } + + if ((ue_desc_p = f1ap_get_ue_context(mme_desc_p->f1ap_instance, + initialContextSetupRequest_p->eNB_UE_F1AP_ID)) == NULL) { + F1AP_ERROR("[SCTP %d] Received initial context setup request for non " + "existing UE context 0x%06lx\n", assoc_id, + initialContextSetupRequest_p->eNB_UE_F1AP_ID); + return -1; + } + + /* Initial context request = UE-related procedure -> stream != 0 */ + if (stream == 0) { + F1AP_ERROR("[SCTP %d] Received UE-related procedure on stream (%d)\n", + assoc_id, stream); + return -1; + } + + ue_desc_p->rx_stream = stream; + + ue_desc_p->mme_ue_f1ap_id = initialContextSetupRequest_p->mme_ue_f1ap_id; + + message_p = itti_alloc_new_message(TASK_F1AP, F1AP_INITIAL_CONTEXT_SETUP_REQ); + + F1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).ue_initial_id = ue_desc_p->ue_initial_id; + ue_desc_p->ue_initial_id = 0; + + F1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).eNB_ue_f1ap_id = ue_desc_p->eNB_ue_f1ap_id; + F1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).nb_of_e_rabs = + initialContextSetupRequest_p->e_RABToBeSetupListCtxtSUReq.f1ap_E_RABToBeSetupItemCtxtSUReq.count; + + F1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).ue_ambr.br_ul = 64;// TO DO(bitrate_t)(initialContextSetupRequest_p->uEaggregateMaximumBitrate.uEaggregateMaximumBitRateUL); + F1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).ue_ambr.br_dl = 1024;//(bitrate_t)(initialContextSetupRequest_p->uEaggregateMaximumBitrate.uEaggregateMaximumBitRateDL); + + F1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).security_capabilities.encryption_algorithms = + BIT_STRING_to_uint16(&initialContextSetupRequest_p->ueSecurityCapabilities.encryptionAlgorithms); + F1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).security_capabilities.integrity_algorithms = + BIT_STRING_to_uint16(&initialContextSetupRequest_p->ueSecurityCapabilities.integrityProtectionAlgorithms); + + /* Copy the security key */ + memcpy(&F1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).security_key, + initialContextSetupRequest_p->securityKey.buf, initialContextSetupRequest_p->securityKey.size); + + for (i = 0; i < initialContextSetupRequest_p->e_RABToBeSetupListCtxtSUReq.f1ap_E_RABToBeSetupItemCtxtSUReq.count; i++) { + F1ap_E_RABToBeSetupItemCtxtSUReq_t *item_p; + + item_p = (F1ap_E_RABToBeSetupItemCtxtSUReq_t *)initialContextSetupRequest_p->e_RABToBeSetupListCtxtSUReq.f1ap_E_RABToBeSetupItemCtxtSUReq.array[i]; + + F1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).e_rab_param[i].e_rab_id = item_p->e_RAB_ID; + + if (item_p->nAS_PDU != NULL) { + /* Only copy NAS pdu if present */ + F1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).e_rab_param[i].nas_pdu.length = item_p->nAS_PDU->size; + + F1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).e_rab_param[i].nas_pdu.buffer = + malloc(sizeof(uint8_t) * item_p->nAS_PDU->size); + + memcpy(F1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).e_rab_param[i].nas_pdu.buffer, + item_p->nAS_PDU->buf, item_p->nAS_PDU->size); + F1AP_DEBUG("Received NAS message with the E_RAB setup procedure\n"); + } else { + F1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).e_rab_param[i].nas_pdu.length = 0; + F1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).e_rab_param[i].nas_pdu.buffer = NULL; + } + + /* Set the transport layer address */ + memcpy(F1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).e_rab_param[i].sgw_addr.buffer, + item_p->transportLayerAddress.buf, item_p->transportLayerAddress.size); + F1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).e_rab_param[i].sgw_addr.length = + item_p->transportLayerAddress.size * 8 - item_p->transportLayerAddress.bits_unused; + + /* GTP tunnel endpoint ID */ + OCTET_STRING_TO_INT32(&item_p->gTP_TEID, F1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).e_rab_param[i].gtp_teid); + + /* Set the QOS informations */ + F1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).e_rab_param[i].qos.qci = item_p->e_RABlevelQoSParameters.qCI; + + F1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).e_rab_param[i].qos.allocation_retention_priority.priority_level = + item_p->e_RABlevelQoSParameters.allocationRetentionPriority.priorityLevel; + F1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).e_rab_param[i].qos.allocation_retention_priority.pre_emp_capability = + item_p->e_RABlevelQoSParameters.allocationRetentionPriority.pre_emptionCapability; + F1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).e_rab_param[i].qos.allocation_retention_priority.pre_emp_vulnerability = + item_p->e_RABlevelQoSParameters.allocationRetentionPriority.pre_emptionVulnerability; + } + + itti_send_msg_to_task(TASK_RRC_ENB, ue_desc_p->eNB_instance->instance, message_p); + + return 0; +} + + +static +int f1ap_handle_ue_context_release_command(uint32_t assoc_id, + uint32_t stream, + struct f1ap_message_s *f1ap_message_p) +{ + f1ap_mme_data_t *mme_desc_p = NULL; + f1ap_ue_context_t *ue_desc_p = NULL; + MessageDef *message_p = NULL; + + F1ap_UEContextReleaseCommandIEs_t *ueContextReleaseCommand_p; + DevAssert(f1ap_message_p != NULL); + + ueContextReleaseCommand_p = &f1ap_message_p->msg.f1ap_UEContextReleaseCommandIEs; + + if ((mme_desc_p = f1ap_get_MME(NULL, assoc_id, 0)) == NULL) { + F1AP_ERROR("[SCTP %d] Received UE context release command for non " + "existing MME context\n", assoc_id); + return -1; + } + + F1ap_MME_UE_F1AP_ID_t mme_ue_f1ap_id; + F1ap_ENB_UE_F1AP_ID_t enb_ue_f1ap_id; + + switch (ueContextReleaseCommand_p->uE_F1AP_IDs.present) { + case F1ap_UE_F1AP_IDs_PR_uE_F1AP_ID_pair: + enb_ue_f1ap_id = ueContextReleaseCommand_p->uE_F1AP_IDs.choice.uE_F1AP_ID_pair.eNB_UE_F1AP_ID; + mme_ue_f1ap_id = ueContextReleaseCommand_p->uE_F1AP_IDs.choice.uE_F1AP_ID_pair.mME_UE_F1AP_ID; + + MSC_LOG_RX_MESSAGE( + MSC_F1AP_ENB, + MSC_F1AP_MME, + NULL,0, + "0 UEContextRelease/%s eNB_ue_f1ap_id "F1AP_UE_ID_FMT" mme_ue_f1ap_id "F1AP_UE_ID_FMT" len %u", + f1ap_direction2String[f1ap_message_p->direction], + enb_ue_f1ap_id, + mme_ue_f1ap_id); + + if ((ue_desc_p = f1ap_get_ue_context(mme_desc_p->f1ap_instance, + enb_ue_f1ap_id)) == NULL) { + F1AP_ERROR("[SCTP %d] Received UE context release command for non " + "existing UE context 0x%06lx\n", + assoc_id, + enb_ue_f1ap_id); + /*MessageDef *msg_complete_p; + msg_complete_p = itti_alloc_new_message(TASK_RRC_ENB, F1AP_UE_CONTEXT_RELEASE_COMPLETE); + F1AP_UE_CONTEXT_RELEASE_COMPLETE(msg_complete_p).eNB_ue_f1ap_id = enb_ue_f1ap_id; + itti_send_msg_to_task(TASK_F1AP, ue_desc_p->eNB_instance->instance <=> 0, msg_complete_p); + */ + return -1; + } else { + MSC_LOG_TX_MESSAGE( + MSC_F1AP_ENB, + MSC_RRC_ENB, + NULL,0, + "0 F1AP_UE_CONTEXT_RELEASE_COMMAND/%d eNB_ue_f1ap_id "F1AP_UE_ID_FMT" ", + enb_ue_f1ap_id); + + message_p = itti_alloc_new_message(TASK_F1AP, F1AP_UE_CONTEXT_RELEASE_COMMAND); + F1AP_UE_CONTEXT_RELEASE_COMMAND(message_p).eNB_ue_f1ap_id = enb_ue_f1ap_id; + itti_send_msg_to_task(TASK_RRC_ENB, ue_desc_p->eNB_instance->instance, message_p); + return 0; + } + + break; + +//#warning "TODO mapping mme_ue_f1ap_id enb_ue_f1ap_id?" + + case F1ap_UE_F1AP_IDs_PR_mME_UE_F1AP_ID: + mme_ue_f1ap_id = ueContextReleaseCommand_p->uE_F1AP_IDs.choice.mME_UE_F1AP_ID; + F1AP_ERROR("TO DO mapping mme_ue_f1ap_id enb_ue_f1ap_id"); + (void)mme_ue_f1ap_id; /* TODO: remove - it's to remove gcc warning about unused var */ + + case F1ap_UE_F1AP_IDs_PR_NOTHING: + default: + F1AP_ERROR("F1AP_UE_CONTEXT_RELEASE_COMMAND not processed, missing info elements"); + return -1; + } +} + +static +int f1ap_handle_e_rab_setup_request(uint32_t assoc_id, + uint32_t stream, + struct f1ap_message_s *f1ap_message_p) { + + int i; + + f1ap_mme_data_t *mme_desc_p = NULL; + f1ap_ue_context_t *ue_desc_p = NULL; + MessageDef *message_p = NULL; + + F1ap_E_RABSetupRequestIEs_t *f1ap_E_RABSetupRequest; + DevAssert(f1ap_message_p != NULL); + + f1ap_E_RABSetupRequest = &f1ap_message_p->msg.f1ap_E_RABSetupRequestIEs; + + if ((mme_desc_p = f1ap_get_MME(NULL, assoc_id, 0)) == NULL) { + F1AP_ERROR("[SCTP %d] Received initial context setup request for non " + "existing MME context\n", assoc_id); + return -1; + } + + + if ((ue_desc_p = f1ap_get_ue_context(mme_desc_p->f1ap_instance, + f1ap_E_RABSetupRequest->eNB_UE_F1AP_ID)) == NULL) { + F1AP_ERROR("[SCTP %d] Received initial context setup request for non " + "existing UE context 0x%06lx\n", assoc_id, + f1ap_E_RABSetupRequest->eNB_UE_F1AP_ID); + return -1; + } + + /* Initial context request = UE-related procedure -> stream != 0 */ + if (stream == 0) { + F1AP_ERROR("[SCTP %d] Received UE-related procedure on stream (%d)\n", + assoc_id, stream); + return -1; + } + + ue_desc_p->rx_stream = stream; + + if ( ue_desc_p->mme_ue_f1ap_id != f1ap_E_RABSetupRequest->mme_ue_f1ap_id){ + F1AP_WARN("UE context mme_ue_f1ap_id is different form that of the message (%d != %ld)", + ue_desc_p->mme_ue_f1ap_id, f1ap_E_RABSetupRequest->mme_ue_f1ap_id); + + } + message_p = itti_alloc_new_message(TASK_F1AP, F1AP_E_RAB_SETUP_REQ); + + F1AP_E_RAB_SETUP_REQ(message_p).ue_initial_id = ue_desc_p->ue_initial_id; + + F1AP_E_RAB_SETUP_REQ(message_p).mme_ue_f1ap_id = f1ap_E_RABSetupRequest->mme_ue_f1ap_id; + F1AP_E_RAB_SETUP_REQ(message_p).eNB_ue_f1ap_id = f1ap_E_RABSetupRequest->eNB_UE_F1AP_ID; + + F1AP_E_RAB_SETUP_REQ(message_p).nb_e_rabs_tosetup = + f1ap_E_RABSetupRequest->e_RABToBeSetupListBearerSUReq.f1ap_E_RABToBeSetupItemBearerSUReq.count; + + for (i = 0; i < f1ap_E_RABSetupRequest->e_RABToBeSetupListBearerSUReq.f1ap_E_RABToBeSetupItemBearerSUReq.count; i++) { + F1ap_E_RABToBeSetupItemBearerSUReq_t *item_p; + + item_p = (F1ap_E_RABToBeSetupItemBearerSUReq_t *)f1ap_E_RABSetupRequest->e_RABToBeSetupListBearerSUReq.f1ap_E_RABToBeSetupItemBearerSUReq.array[i]; + + F1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].e_rab_id = item_p->e_RAB_ID; + + // check for the NAS PDU + if (item_p->nAS_PDU.size > 0 ) { + F1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].nas_pdu.length = item_p->nAS_PDU.size; + + F1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].nas_pdu.buffer = malloc(sizeof(uint8_t) * item_p->nAS_PDU.size); + + memcpy(F1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].nas_pdu.buffer, + item_p->nAS_PDU.buf, item_p->nAS_PDU.size); + // F1AP_INFO("received a NAS PDU with size %d (%02x.%02x)\n",F1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].nas_pdu.length, item_p->nAS_PDU.buf[0], item_p->nAS_PDU.buf[1]); + } else { + F1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].nas_pdu.length = 0; + F1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].nas_pdu.buffer = NULL; + + F1AP_WARN("NAS PDU is not provided, generate a E_RAB_SETUP Failure (TBD) back to MME \n"); + // return -1; + } + + /* Set the transport layer address */ + memcpy(F1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].sgw_addr.buffer, + item_p->transportLayerAddress.buf, item_p->transportLayerAddress.size); + F1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].sgw_addr.length = + item_p->transportLayerAddress.size * 8 - item_p->transportLayerAddress.bits_unused; + + /* F1AP_INFO("sgw addr %s len: %d (size %d, index %d)\n", + F1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].sgw_addr.buffer, + F1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].sgw_addr.length, + item_p->transportLayerAddress.size, i); + */ + /* GTP tunnel endpoint ID */ + OCTET_STRING_TO_INT32(&item_p->gTP_TEID, F1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].gtp_teid); + + /* Set the QOS informations */ + F1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].qos.qci = item_p->e_RABlevelQoSParameters.qCI; + + F1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].qos.allocation_retention_priority.priority_level = + item_p->e_RABlevelQoSParameters.allocationRetentionPriority.priorityLevel; + F1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].qos.allocation_retention_priority.pre_emp_capability = + item_p->e_RABlevelQoSParameters.allocationRetentionPriority.pre_emptionCapability; + F1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].qos.allocation_retention_priority.pre_emp_vulnerability = + item_p->e_RABlevelQoSParameters.allocationRetentionPriority.pre_emptionVulnerability; + } + + itti_send_msg_to_task(TASK_RRC_ENB, ue_desc_p->eNB_instance->instance, message_p); + + return 0; +} + +static +int f1ap_handle_paging(uint32_t assoc_id, + uint32_t stream, + struct f1ap_message_s *f1ap_message_p) +{ + F1ap_PagingIEs_t *paging_p; + f1ap_mme_data_t *mme_desc_p = NULL; + f1ap_instance_t *f1ap_instance = NULL; + MessageDef *message_p = NULL; + + DevAssert(f1ap_message_p != NULL); + // received Paging Message from MME + F1AP_DEBUG("[SCTP %d] Received Paging Message From MME\n",assoc_id); + + paging_p = &f1ap_message_p->msg.f1ap_PagingIEs; + + /* Paging procedure -> stream != 0 */ + if (stream == 0) { + F1AP_ERROR("[SCTP %d] Received Paging procedure on stream (%d)\n", + assoc_id, stream); + return -1; + } + + if ((mme_desc_p = f1ap_get_MME(NULL, assoc_id, 0)) == NULL) { + F1AP_ERROR("[SCTP %d] Received Paging for non " + "existing MME context\n", assoc_id); + return -1; + } + + f1ap_instance = mme_desc_p->f1ap_instance; + if (f1ap_instance == NULL) { + F1AP_ERROR("[SCTP %d] Received Paging for non existing MME context : f1ap_instance is NULL\n", + assoc_id); + return -1; + } + + message_p = itti_alloc_new_message(TASK_F1AP, F1AP_PAGING_IND); + + /* convert F1ap_PagingIEs_t to f1ap_paging_ind_t */ + /* convert UE Identity Index value */ + F1AP_PAGING_IND(message_p).ue_index_value = BIT_STRING_to_uint32(&paging_p->ueIdentityIndexValue); + F1AP_DEBUG("[SCTP %d] Received Paging ue_index_value (%d)\n", + assoc_id,(uint32_t)F1AP_PAGING_IND(message_p).ue_index_value); + + F1AP_PAGING_IND(message_p).ue_paging_identity.choice.s_tmsi.mme_code = 0; + F1AP_PAGING_IND(message_p).ue_paging_identity.choice.s_tmsi.m_tmsi = 0; + + /* convert UE Paging Identity */ + if (paging_p->uePagingID.present == F1ap_UEPagingID_PR_s_TMSI) { + F1AP_PAGING_IND(message_p).ue_paging_identity.presenceMask = UE_PAGING_IDENTITY_s_tmsi; + OCTET_STRING_TO_INT8(&paging_p->uePagingID.choice.s_TMSI.mMEC, F1AP_PAGING_IND(message_p).ue_paging_identity.choice.s_tmsi.mme_code); + OCTET_STRING_TO_INT32(&paging_p->uePagingID.choice.s_TMSI.m_TMSI, F1AP_PAGING_IND(message_p).ue_paging_identity.choice.s_tmsi.m_tmsi); + } else if (paging_p->uePagingID.present == F1ap_UEPagingID_PR_iMSI) { + F1AP_PAGING_IND(message_p).ue_paging_identity.presenceMask = UE_PAGING_IDENTITY_imsi; + F1AP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.length = 0; + for (int i = 0; i < paging_p->uePagingID.choice.iMSI.size; i++) { + F1AP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.buffer[2*i] = (uint8_t)(paging_p->uePagingID.choice.iMSI.buf[i] & 0x0F ); + F1AP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.length++; + F1AP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.buffer[2*i+1] = (uint8_t)((paging_p->uePagingID.choice.iMSI.buf[i]>>4) & 0x0F); + LOG_D(F1AP,"paging : i %d %d imsi %d %d \n",2*i,2*i+1,F1AP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.buffer[2*i], F1AP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.buffer[2*i+1]); + if (F1AP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.buffer[2*i+1] == 0x0F) { + if(i != paging_p->uePagingID.choice.iMSI.size - 1){ + /* invalid paging_p->uePagingID.choise.iMSI.buffer */ + F1AP_ERROR("[SCTP %d] Received Paging : uePagingID.choise.iMSI error(i %d 0x0F)\n", assoc_id,i); + return -1; + } + } else { + F1AP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.length++; + } + } + if (F1AP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.length >= F1AP_IMSI_LENGTH) { + /* invalid paging_p->uePagingID.choise.iMSI.size */ + F1AP_ERROR("[SCTP %d] Received Paging : uePagingID.choise.iMSI.size(%d) is over IMSI length(%d)\n", assoc_id, F1AP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.length, F1AP_IMSI_LENGTH); + return -1; + } +} else { + /* invalid paging_p->uePagingID.present */ + F1AP_ERROR("[SCTP %d] Received Paging : uePagingID.present(%d) is unknown\n", assoc_id, paging_p->uePagingID.present); + return -1; + } + +#if 0 + /* convert Paging DRX(optional) */ + if (paging_p->presenceMask & F1AP_PAGINGIES_PAGINGDRX_PRESENT) { + switch(paging_p->pagingDRX) { + case F1ap_PagingDRX_v32: + F1AP_PAGING_IND(message_p).paging_drx = PAGING_DRX_32; + break; + case F1ap_PagingDRX_v64: + F1AP_PAGING_IND(message_p).paging_drx = PAGING_DRX_64; + break; + case F1ap_PagingDRX_v128: + F1AP_PAGING_IND(message_p).paging_drx = PAGING_DRX_128; + break; + case F1ap_PagingDRX_v256: + F1AP_PAGING_IND(message_p).paging_drx = PAGING_DRX_256; + break; + default: + // when UE Paging DRX is no value + F1AP_PAGING_IND(message_p).paging_drx = PAGING_DRX_256; + break; + } + } +#endif + F1AP_PAGING_IND(message_p).paging_drx = PAGING_DRX_256; + + /* convert cnDomain */ + if (paging_p->cnDomain == F1ap_CNDomain_ps) { + F1AP_PAGING_IND(message_p).cn_domain = CN_DOMAIN_PS; + } else if (paging_p->cnDomain == F1ap_CNDomain_cs) { + F1AP_PAGING_IND(message_p).cn_domain = CN_DOMAIN_CS; + } else { + /* invalid paging_p->cnDomain */ + F1AP_ERROR("[SCTP %d] Received Paging : cnDomain(%ld) is unknown\n", assoc_id, paging_p->cnDomain); + return -1; + } + + memset (&F1AP_PAGING_IND(message_p).plmn_identity[0], 0, sizeof(plmn_identity_t)*256); + memset (&F1AP_PAGING_IND(message_p).tac[0], 0, sizeof(int16_t)*256); + F1AP_PAGING_IND(message_p).tai_size = 0; + + for (int i = 0; i < paging_p->taiList.f1ap_TAIItem.count; i++) { + F1AP_INFO("[SCTP %d] Received Paging taiList: i %d, count %d\n", assoc_id, i, paging_p->taiList.f1ap_TAIItem.count); + F1ap_TAIItem_t f1ap_TAIItem; + memset (&f1ap_TAIItem, 0, sizeof(F1ap_TAIItem_t)); + + memcpy(&f1ap_TAIItem, paging_p->taiList.f1ap_TAIItem.array[i], sizeof(F1ap_TAIItem_t)); + + TBCD_TO_MCC_MNC(&f1ap_TAIItem.tAI.pLMNidentity, F1AP_PAGING_IND(message_p).plmn_identity[i].mcc, + F1AP_PAGING_IND(message_p).plmn_identity[i].mnc, + F1AP_PAGING_IND(message_p).plmn_identity[i].mnc_digit_length); + OCTET_STRING_TO_INT16(&f1ap_TAIItem.tAI.tAC, F1AP_PAGING_IND(message_p).tac[i]); + F1AP_PAGING_IND(message_p).tai_size++; + F1AP_DEBUG("[SCTP %d] Received Paging: MCC %d, MNC %d, TAC %d\n", assoc_id, F1AP_PAGING_IND(message_p).plmn_identity[i].mcc, F1AP_PAGING_IND(message_p).plmn_identity[i].mnc, F1AP_PAGING_IND(message_p).tac[i]); + } + +#if 0 + // CSG Id(optional) List is not used + if (paging_p->presenceMask & F1AP_PAGINGIES_CSG_IDLIST_PRESENT) { + // TODO + } + + /* convert pagingPriority (optional) if has value */ + if (paging_p->presenceMask & F1AP_PAGINGIES_PAGINGPRIORITY_PRESENT) { + switch(paging_p->pagingPriority) { + case F1ap_PagingPriority_priolevel1: + F1AP_PAGING_IND(message_p).paging_priority = PAGING_PRIO_LEVEL1; + break; + case F1ap_PagingPriority_priolevel2: + F1AP_PAGING_IND(message_p).paging_priority = PAGING_PRIO_LEVEL2; + break; + case F1ap_PagingPriority_priolevel3: + F1AP_PAGING_IND(message_p).paging_priority = PAGING_PRIO_LEVEL3; + break; + case F1ap_PagingPriority_priolevel4: + F1AP_PAGING_IND(message_p).paging_priority = PAGING_PRIO_LEVEL4; + break; + case F1ap_PagingPriority_priolevel5: + F1AP_PAGING_IND(message_p).paging_priority = PAGING_PRIO_LEVEL5; + break; + case F1ap_PagingPriority_priolevel6: + F1AP_PAGING_IND(message_p).paging_priority = PAGING_PRIO_LEVEL6; + break; + case F1ap_PagingPriority_priolevel7: + F1AP_PAGING_IND(message_p).paging_priority = PAGING_PRIO_LEVEL7; + break; + case F1ap_PagingPriority_priolevel8: + F1AP_PAGING_IND(message_p).paging_priority = PAGING_PRIO_LEVEL8; + break; + default: + /* invalid paging_p->pagingPriority */ + F1AP_ERROR("[SCTP %d] Received paging : pagingPriority(%ld) is invalid\n", assoc_id, paging_p->pagingPriority); + return -1; + } + } +#endif + //paging parameter values + F1AP_DEBUG("[SCTP %d] Received Paging parameters: ue_index_value %d cn_domain %d paging_drx %d paging_priority %d\n",assoc_id, + F1AP_PAGING_IND(message_p).ue_index_value, F1AP_PAGING_IND(message_p).cn_domain, + F1AP_PAGING_IND(message_p).paging_drx, F1AP_PAGING_IND(message_p).paging_priority); + F1AP_DEBUG("[SCTP %d] Received Paging parameters(ue): presenceMask %d s_tmsi.m_tmsi %d s_tmsi.mme_code %d IMSI length %d (0-5) %d%d%d%d%d%d\n",assoc_id, + F1AP_PAGING_IND(message_p).ue_paging_identity.presenceMask, F1AP_PAGING_IND(message_p).ue_paging_identity.choice.s_tmsi.m_tmsi, + F1AP_PAGING_IND(message_p).ue_paging_identity.choice.s_tmsi.mme_code, F1AP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.length, + F1AP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.buffer[0], F1AP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.buffer[1], + F1AP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.buffer[2], F1AP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.buffer[3], + F1AP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.buffer[4], F1AP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.buffer[5]); + + /* send message to RRC */ + itti_send_msg_to_task(TASK_RRC_ENB, f1ap_instance->instance, message_p); + + return 0; +} + +static +int f1ap_handle_e_rab_modify_request(uint32_t assoc_id, + uint32_t stream, + struct f1ap_message_s *f1ap_message_p) { + + int i; + + f1ap_mme_data_t *mme_desc_p = NULL; + f1ap_ue_context_t *ue_desc_p = NULL; + MessageDef *message_p = NULL; + int nb_of_e_rabs_failed = 0; + + F1ap_E_RABModifyRequestIEs_t *f1ap_E_RABModifyRequest; + DevAssert(f1ap_message_p != NULL); + + f1ap_E_RABModifyRequest = &f1ap_message_p->msg.f1ap_E_RABModifyRequestIEs; + + if ((mme_desc_p = f1ap_get_MME(NULL, assoc_id, 0)) == NULL) { + F1AP_ERROR("[SCTP %d] Received E-RAB modify request for non " + "existing MME context\n", assoc_id); + return -1; + } + + + if ((ue_desc_p = f1ap_get_ue_context(mme_desc_p->f1ap_instance, + f1ap_E_RABModifyRequest->eNB_UE_F1AP_ID)) == NULL) { + F1AP_ERROR("[SCTP %d] Received E-RAB modify request for non " + "existing UE context 0x%06lx\n", assoc_id, + f1ap_E_RABModifyRequest->eNB_UE_F1AP_ID); + return -1; + } + + /* E-RAB modify request = UE-related procedure -> stream != 0 */ + if (stream == 0) { + F1AP_ERROR("[SCTP %d] Received UE-related procedure on stream (%d)\n", + assoc_id, stream); + return -1; + } + + ue_desc_p->rx_stream = stream; + + if ( ue_desc_p->mme_ue_f1ap_id != f1ap_E_RABModifyRequest->mme_ue_f1ap_id){ + F1AP_WARN("UE context mme_ue_f1ap_id is different form that of the message (%d != %ld)", + ue_desc_p->mme_ue_f1ap_id, f1ap_E_RABModifyRequest->mme_ue_f1ap_id); + message_p = itti_alloc_new_message (TASK_RRC_ENB, F1AP_E_RAB_MODIFY_RESP); + + F1AP_E_RAB_MODIFY_RESP (message_p).eNB_ue_f1ap_id = f1ap_E_RABModifyRequest->eNB_UE_F1AP_ID; +// F1AP_E_RAB_MODIFY_RESP (msg_fail_p).e_rabs[F1AP_MAX_E_RAB]; + F1AP_E_RAB_MODIFY_RESP (message_p).nb_of_e_rabs = 0; + + for(nb_of_e_rabs_failed = 0; nb_of_e_rabs_failed < f1ap_E_RABModifyRequest->e_RABToBeModifiedListBearerModReq.f1ap_E_RABToBeModifiedItemBearerModReq.count; nb_of_e_rabs_failed++) { + F1AP_E_RAB_MODIFY_RESP (message_p).e_rabs_failed[nb_of_e_rabs_failed].e_rab_id = + ((F1ap_E_RABToBeModifiedItemBearerModReq_t *)f1ap_E_RABModifyRequest->e_RABToBeModifiedListBearerModReq.f1ap_E_RABToBeModifiedItemBearerModReq.array[nb_of_e_rabs_failed])->e_RAB_ID; + F1AP_E_RAB_MODIFY_RESP (message_p).e_rabs_failed[nb_of_e_rabs_failed].cause = F1AP_CAUSE_RADIO_NETWORK; + F1AP_E_RAB_MODIFY_RESP (message_p).e_rabs_failed[nb_of_e_rabs_failed].cause_value = 13;//F1ap_CauseRadioNetwork_unknown_mme_ue_f1ap_id; + } + F1AP_E_RAB_MODIFY_RESP (message_p).nb_of_e_rabs_failed = nb_of_e_rabs_failed; + + f1ap_e_rab_modify_resp(mme_desc_p->f1ap_instance->instance, + &F1AP_E_RAB_MODIFY_RESP(message_p)); + + message_p = NULL; + return -1; + } + + message_p = itti_alloc_new_message(TASK_F1AP, F1AP_E_RAB_MODIFY_REQ); + + F1AP_E_RAB_MODIFY_REQ(message_p).ue_initial_id = ue_desc_p->ue_initial_id; + + F1AP_E_RAB_MODIFY_REQ(message_p).mme_ue_f1ap_id = f1ap_E_RABModifyRequest->mme_ue_f1ap_id; + F1AP_E_RAB_MODIFY_REQ(message_p).eNB_ue_f1ap_id = f1ap_E_RABModifyRequest->eNB_UE_F1AP_ID; + + F1AP_E_RAB_MODIFY_REQ(message_p).nb_e_rabs_tomodify = + f1ap_E_RABModifyRequest->e_RABToBeModifiedListBearerModReq.f1ap_E_RABToBeModifiedItemBearerModReq.count; + + for (i = 0; i < f1ap_E_RABModifyRequest->e_RABToBeModifiedListBearerModReq.f1ap_E_RABToBeModifiedItemBearerModReq.count; i++) { + F1ap_E_RABToBeModifiedItemBearerModReq_t *item_p; + + item_p = (F1ap_E_RABToBeModifiedItemBearerModReq_t *)f1ap_E_RABModifyRequest->e_RABToBeModifiedListBearerModReq.f1ap_E_RABToBeModifiedItemBearerModReq.array[i]; + + F1AP_E_RAB_MODIFY_REQ(message_p).e_rab_modify_params[i].e_rab_id = item_p->e_RAB_ID; + + // check for the NAS PDU + if (item_p->nAS_PDU.size > 0 ) { + F1AP_E_RAB_MODIFY_REQ(message_p).e_rab_modify_params[i].nas_pdu.length = item_p->nAS_PDU.size; + + F1AP_E_RAB_MODIFY_REQ(message_p).e_rab_modify_params[i].nas_pdu.buffer = malloc(sizeof(uint8_t) * item_p->nAS_PDU.size); + + memcpy(F1AP_E_RAB_MODIFY_REQ(message_p).e_rab_modify_params[i].nas_pdu.buffer, + item_p->nAS_PDU.buf, item_p->nAS_PDU.size); + } else { + F1AP_E_RAB_MODIFY_REQ(message_p).e_rab_modify_params[i].nas_pdu.length = 0; + F1AP_E_RAB_MODIFY_REQ(message_p).e_rab_modify_params[i].nas_pdu.buffer = NULL; + continue; + } + + /* Set the QOS informations */ + F1AP_E_RAB_MODIFY_REQ(message_p).e_rab_modify_params[i].qos.qci = item_p->e_RABLevelQoSParameters.qCI; + + F1AP_E_RAB_MODIFY_REQ(message_p).e_rab_modify_params[i].qos.allocation_retention_priority.priority_level = + item_p->e_RABLevelQoSParameters.allocationRetentionPriority.priorityLevel; + F1AP_E_RAB_MODIFY_REQ(message_p).e_rab_modify_params[i].qos.allocation_retention_priority.pre_emp_capability = + item_p->e_RABLevelQoSParameters.allocationRetentionPriority.pre_emptionCapability; + F1AP_E_RAB_MODIFY_REQ(message_p).e_rab_modify_params[i].qos.allocation_retention_priority.pre_emp_vulnerability = + item_p->e_RABLevelQoSParameters.allocationRetentionPriority.pre_emptionVulnerability; + + } + + itti_send_msg_to_task(TASK_RRC_ENB, ue_desc_p->eNB_instance->instance, message_p); + + return 0; +} +// handle e-rab release command and send it to rrc_end +static +int f1ap_handle_e_rab_release_command(uint32_t assoc_id, + uint32_t stream, + struct f1ap_message_s *f1ap_message_p) { + + int i; + + f1ap_mme_data_t *mme_desc_p = NULL; + f1ap_ue_context_t *ue_desc_p = NULL; + MessageDef *message_p = NULL; + + F1ap_E_RABReleaseCommandIEs_t *f1ap_E_RABReleaseCommand; + DevAssert(f1ap_message_p != NULL); + f1ap_E_RABReleaseCommand = &f1ap_message_p->msg.f1ap_E_RABReleaseCommandIEs; + + if ((mme_desc_p = f1ap_get_MME(NULL, assoc_id, 0)) == NULL) { + F1AP_ERROR("[SCTP %d] Received E-RAB release command for non existing MME context\n", assoc_id); + return -1; + } + if ((ue_desc_p = f1ap_get_ue_context(mme_desc_p->f1ap_instance, + f1ap_E_RABReleaseCommand->eNB_UE_F1AP_ID)) == NULL) { + F1AP_ERROR("[SCTP %d] Received E-RAB release command for non existing UE context 0x%06lx\n", assoc_id, + f1ap_E_RABReleaseCommand->eNB_UE_F1AP_ID); + return -1; + } + + /* Initial context request = UE-related procedure -> stream != 0 */ + if (stream == 0) { + F1AP_ERROR("[SCTP %d] Received UE-related procedure on stream (%d)\n", + assoc_id, stream); + return -1; + } + + ue_desc_p->rx_stream = stream; + + if ( ue_desc_p->mme_ue_f1ap_id != f1ap_E_RABReleaseCommand->mme_ue_f1ap_id){ + F1AP_WARN("UE context mme_ue_f1ap_id is different form that of the message (%d != %ld)", + ue_desc_p->mme_ue_f1ap_id, f1ap_E_RABReleaseCommand->mme_ue_f1ap_id); + } + + F1AP_DEBUG("[SCTP %d] Received E-RAB release command for eNB_UE_F1AP_ID %ld mme_ue_f1ap_id %ld\n", + assoc_id, f1ap_E_RABReleaseCommand->eNB_UE_F1AP_ID, f1ap_E_RABReleaseCommand->mme_ue_f1ap_id); + + message_p = itti_alloc_new_message(TASK_F1AP, F1AP_E_RAB_RELEASE_COMMAND); + + F1AP_E_RAB_RELEASE_COMMAND(message_p).eNB_ue_f1ap_id = f1ap_E_RABReleaseCommand->eNB_UE_F1AP_ID; + F1AP_E_RAB_RELEASE_COMMAND(message_p).mme_ue_f1ap_id = f1ap_E_RABReleaseCommand->mme_ue_f1ap_id; + if(f1ap_E_RABReleaseCommand->nas_pdu.size > 0 ){ + F1AP_E_RAB_RELEASE_COMMAND(message_p).nas_pdu.length = f1ap_E_RABReleaseCommand->nas_pdu.size; + + F1AP_E_RAB_RELEASE_COMMAND(message_p).nas_pdu.buffer = + malloc(sizeof(uint8_t) * f1ap_E_RABReleaseCommand->nas_pdu.size); + + memcpy(F1AP_E_RAB_RELEASE_COMMAND(message_p).nas_pdu.buffer, + f1ap_E_RABReleaseCommand->nas_pdu.buf, + f1ap_E_RABReleaseCommand->nas_pdu.size); + } else { + F1AP_E_RAB_RELEASE_COMMAND(message_p).nas_pdu.length = 0; + F1AP_E_RAB_RELEASE_COMMAND(message_p).nas_pdu.buffer = NULL; + } + + F1AP_E_RAB_RELEASE_COMMAND(message_p).nb_e_rabs_torelease = f1ap_E_RABReleaseCommand->e_RABToBeReleasedList.f1ap_E_RABItem.count; + for(i=0; i < f1ap_E_RABReleaseCommand->e_RABToBeReleasedList.f1ap_E_RABItem.count; i++){ + F1ap_E_RABItem_t *item_p; + item_p = (F1ap_E_RABItem_t*)f1ap_E_RABReleaseCommand->e_RABToBeReleasedList.f1ap_E_RABItem.array[i]; + F1AP_E_RAB_RELEASE_COMMAND(message_p).e_rab_release_params[i].e_rab_id = item_p->e_RAB_ID; + F1AP_DEBUG("[SCTP] Received E-RAB release command for e-rab id %ld\n", item_p->e_RAB_ID); + } + + itti_send_msg_to_task(TASK_RRC_ENB, ue_desc_p->eNB_instance->instance, message_p); + + return 0; +} diff --git a/openair2/F1AP/f1ap_handlers.h b/openair2/F1AP/f1ap_handlers.h new file mode 100644 index 0000000000..eaa2b15c31 --- /dev/null +++ b/openair2/F1AP/f1ap_handlers.h @@ -0,0 +1,41 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file f1ap_handlers.h + * \brief f1ap messages handlers + * \author EURECOM/NTUST + * \date 2018 + * \version 0.1 + * \company Eurecom + * \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr + * \note + * \warning + */ + +#ifndef F1AP_HANDLERS_H_ +#define F1AP_HANDLERS_H_ + +void f1ap_handle_f1_setup_message(f1ap_eNB_mme_data_t *mme_desc_p, int sctp_shutdown); + +int f1ap_handle_message(uint32_t assoc_id, int32_t stream, + const uint8_t * const data, const uint32_t data_length); + +#endif /* F1AP_HANDLERS_H_ */ diff --git a/openair2/F1AP/f1ap_messaging.c b/openair2/F1AP/f1ap_messaging.c new file mode 100644 index 0000000000..1be0ee9829 --- /dev/null +++ b/openair2/F1AP/f1ap_messaging.c @@ -0,0 +1,88 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file f1ap_messaging.c + * \brief f1ap procedures + * \author EURECOM/NTUST + * \date 2018 + * \version 0.1 + * \company Eurecom + * \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr + * \note + * \warning + */ + + +#include "intertask_interface.h" + +#include "f1ap_messaging.h" + +void f1ap_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer, + uint32_t buffer_length, uint16_t stream) +{ + MessageDef *message_p; + sctp_data_req_t *sctp_data_req; + + message_p = itti_alloc_new_message(TASK_F1AP, SCTP_DATA_REQ); + + sctp_data_req = &message_p->ittiMsg.sctp_data_req; + + sctp_data_req->assoc_id = assoc_id; + sctp_data_req->buffer = buffer; + sctp_data_req->buffer_length = buffer_length; + sctp_data_req->stream = stream; + + itti_send_msg_to_task(TASK_SCTP, instance, message_p); +} + +void f1ap_send_nas_downlink_ind(instance_t instance, + uint16_t ue_initial_id, + uint32_t eNB_ue_s1ap_id, + uint8_t *nas_pdu, + uint32_t nas_pdu_length) +{ + MessageDef *message_p; + f1ap_downlink_nas_t *f1ap_downlink_nas; + + message_p = itti_alloc_new_message(TASK_F1AP, F1AP_DOWNLINK_NAS); + + f1ap_downlink_nas = &message_p->ittiMsg.f1ap_downlink_nas; + + f1ap_downlink_nas->ue_initial_id = ue_initial_id; + f1ap_downlink_nas->eNB_ue_s1ap_id = eNB_ue_f1ap_id; + f1ap_downlink_nas->nas_pdu.buffer = nas_pdu; + f1ap_downlink_nas->nas_pdu.length = nas_pdu_length; + + itti_send_msg_to_task(TASK_RRC_ENB, instance, message_p); +} + +void f1ap_send_sctp_close_association(instance_t instance, int32_t assoc_id) +{ + MessageDef *message_p = NULL; + sctp_close_association_t *sctp_close_association_p = NULL; + + message_p = itti_alloc_new_message(TASK_F1AP, SCTP_CLOSE_ASSOCIATION); + sctp_close_association_p = &message_p->ittiMsg.sctp_close_association; + sctp_close_association_p->assoc_id = assoc_id; + + itti_send_msg_to_task(TASK_SCTP, instance, message_p); +} + diff --git a/openair2/F1AP/f1ap_messaging.h b/openair2/F1AP/f1ap_messaging.h new file mode 100644 index 0000000000..8d224ab75b --- /dev/null +++ b/openair2/F1AP/f1ap_messaging.h @@ -0,0 +1,50 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file f1ap_messaging.h + * \brief f1ap procedures + * \author EURECOM/NTUST + * \date 2018 + * \version 0.1 + * \company Eurecom + * \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr + * \note + * \warning + */ + + +#ifndef F1AP_MESSAGING_H_ +#define F1AP_MESSAGING_H_ + +void f1ap_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer, + uint32_t buffer_length, uint16_t stream); + +void f1ap_send_nas_downlink_ind(instance_t instance, + uint16_t ue_initial_id, + uint32_t eNB_ue_f1ap_id, + uint8_t *nas_pdu, + uint32_t nas_pdu_length); + +void f1ap_send_sctp_close_association(instance_t instance, + int32_t assoc_id); + + +#endif /* F1AP_MESSAGING_H_ */ diff --git a/openair2/F1AP/sctp_cu.c b/openair2/F1AP/sctp_cu.c new file mode 100644 index 0000000000..546759e003 --- /dev/null +++ b/openair2/F1AP/sctp_cu.c @@ -0,0 +1,123 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file sctp_server.c + * \brief sctp server procedures for f1ap + * \author EURECOM/NTUST + * \date 2018 + * \version 0.1 + * \company Eurecom + * \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr + * \note + * \warning + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // for close +#include + +#define MAX_BUFFER 1024 + +/* server */ + +int sfd, cfd, len, flags; +struct sctp_sndrcvinfo sndrcvinfo; +struct sockaddr_in saddr, caddr; +struct sctp_initmsg initmsg; +uint8_t buff[INET_ADDRSTRLEN]; + +void send_func(int cfd) { + uint8_t buffer_send[MAX_BUFFER+1]; + /* Changing 9th character the character after # in the message buffer */ + buffer_send[0] = rand(); + sctp_sendmsg( cfd, (void *)buffer_send, (size_t)strlen(buffer_send), + NULL, 0, htons(62), 0, 1 /* stream */, 0, 0 ); + printf("S - Sent: %s\n", buffer_send); +} + +void *recv_func(void *cfd) { + int ret; + uint8_t buffer_recv[MAX_BUFFER+1]; + + //recv message + bzero( (void *)&buffer_recv, sizeof(buffer_recv) ); + while(ret = sctp_recvmsg( *(int*)cfd, (void *)buffer_recv, sizeof(buffer_recv), + (struct sockaddr *)NULL, 0, &sndrcvinfo, &flags )) { + //send_func(*(int*)cfd); + //printf("S - cfd = %d\n", *(int*)cfd); + printf("S - Received following data on ppid %d, data is: %x\n", + sndrcvinfo.sinfo_ppid, buffer_recv); + printf("S - Received following data on stream %d, data is: \n", sndrcvinfo.sinfo_stream); + + int i_ret; + for (i_ret = 0; i_ret < sizeof(buffer_recv); i_ret++) { + printf("%x ", *(buffer_recv+i_ret)); + } + + printf("\n"); + + f1ap_decode_pdu(NULL , buffer_recv, sizeof(buffer_recv)); + } + printf("ret = %d\n", ret); + close( *(int*)cfd ); +} + +int sctp_cu_init() { + pthread_t threads; + printf("S - Waiting for socket_accept\n"); + + sfd = socket( AF_INET, SOCK_STREAM, IPPROTO_SCTP ); + bzero( (void *)&saddr, sizeof(saddr) ); + saddr.sin_family = AF_INET; + saddr.sin_addr.s_addr = htonl( INADDR_ANY ); + saddr.sin_port = htons(29008); + + bind( sfd, (struct sockaddr *)&saddr, sizeof(saddr) ); + + /* Maximum of 3 streams will be available per socket */ + memset( &initmsg, 0, sizeof(initmsg) ); + initmsg.sinit_num_ostreams = 3; + initmsg.sinit_max_instreams = 3; + initmsg.sinit_max_attempts = 2; + setsockopt( sfd, IPPROTO_SCTP, SCTP_INITMSG, + &initmsg, sizeof(initmsg) ); + + listen( sfd, 5 ); + + while(cfd=accept(sfd, (struct sockaddr *)&caddr, (socklen_t*)&caddr)) { + printf("-------- S - Connected to %s\n", + inet_ntop(AF_INET, &caddr.sin_addr, buff, + sizeof(buff))); + int *thread_args = malloc(sizeof(int)); + *thread_args = cfd; + pthread_create(&threads, NULL, recv_func, thread_args); + } + + printf("S - close\n"); + return 0; +} \ No newline at end of file diff --git a/openair2/F1AP/sctp_du.c b/openair2/F1AP/sctp_du.c new file mode 100644 index 0000000000..3520f4691b --- /dev/null +++ b/openair2/F1AP/sctp_du.c @@ -0,0 +1,139 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file sctp_client.c + * \brief sctp client procedures for f1ap + * \author EURECOM/NTUST + * \date 2018 + * \version 0.1 + * \company Eurecom + * \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr + * \note + * \warning + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include // for close +#include + +#define MAX_BUFFER 1024 +#define NUM_THREADS 1 + +int cfd, i, flags, ret; +struct sockaddr_in saddr; +struct sctp_sndrcvinfo sndrcvinfo; +struct sctp_event_subscribe events; +struct sctp_initmsg initmsg; +uint8_t buffer_send[MAX_BUFFER+1]; +uint8_t buffer_recv[MAX_BUFFER+1]; + +void f1ap_du_send_message(uint8_t *buffer_send, uint32_t length) +{ + /* Changing 9th character the character after # in the message buffer */ + //while (1) { + //buffer_send[0] = rand(); + sctp_sendmsg( cfd, (void *)buffer_send, length, + NULL, 0, htonl(62), 0, 1 /* stream */, 0, 0 ); + printf("C - Sent: "); + + int i_ret; + for (i_ret = 0; i_ret < length; i_ret++) { + printf("%x ", *(buffer_send+i_ret)); + } + + printf("\n"); + //} +} + +/* for test*/ +void *send_func(void *argument) +{ + /* Changing 9th character the character after # in the message buffer */ + while (1) { + buffer_send[0] = rand(); + sctp_sendmsg( cfd, (void *)buffer_send, (size_t)strlen(buffer_send), + NULL, 0, 0, 0, 1 /* stream */, 0, 0 ); + printf("C - Sent: %s\n", buffer_send); + } +} + +void *recv_func(void *argument) +{ + bzero( (void *)&buffer_recv, sizeof(buffer_recv) ); + + while(ret = sctp_recvmsg( cfd, (void *)buffer_recv, sizeof(buffer_recv), + (struct sockaddr *)NULL, 0, &sndrcvinfo, &flags )) { + + printf("C - Received following data on stream %d, data is: %s\n", + sndrcvinfo.sinfo_stream, buffer_recv); + } + close(cfd); + printf("C - close\n"); +} + +int sctp_du_init() +{ + pthread_t threads[NUM_THREADS]; + + char *ipadd; + ipadd = "127.0.0.1"; + printf("Use default ipaddress %s \n", ipadd); + + cfd = socket( AF_INET, SOCK_STREAM, IPPROTO_SCTP ); + + /* Specify that a maximum of 3 streams will be available per socket */ + memset( &initmsg, 0, sizeof(initmsg) ); + initmsg.sinit_num_ostreams = 3; + initmsg.sinit_max_instreams = 3; + initmsg.sinit_max_attempts = 2; + setsockopt( cfd, IPPROTO_SCTP, SCTP_INITMSG, + &initmsg, sizeof(initmsg) ); + + bzero( (void *)&saddr, sizeof(saddr) ); + saddr.sin_family = AF_INET; + inet_pton(AF_INET, ipadd, &saddr.sin_addr); + saddr.sin_port = htons(29008); + + int ret; + ret = connect( cfd, (struct sockaddr *)&saddr, sizeof(saddr) ); + if (ret == -1) { + printf("C - Not founded Server, close\n"); + return 0; + } + memset( (void *)&events, 0, sizeof(events) ); + events.sctp_data_io_event = 1; + setsockopt( cfd, SOL_SCTP, SCTP_EVENTS, + (const void *)&events, sizeof(events) ); + + /* Sending three messages on different streams */ + // send message + //pthread_create(&threads[0], NULL, send_func, (void *)0); + + pthread_create(&threads[0], NULL, recv_func, (void *)0); + + return 0; +} \ No newline at end of file diff --git a/openair2/F1AP/test_f1ap_cu.c b/openair2/F1AP/test_f1ap_cu.c new file mode 100644 index 0000000000..544d787cf8 --- /dev/null +++ b/openair2/F1AP/test_f1ap_cu.c @@ -0,0 +1,11 @@ + +/* Test */ +void CU_handle_F1_SETUP_REQUEST(void); +/**/ + +int main(void) { + /* Test */ + F1AP_CU_task(); + //CU_handle_F1_SETUP_REQUEST(); + return 0; +} diff --git a/openair2/F1AP/test_f1ap_du.c b/openair2/F1AP/test_f1ap_du.c new file mode 100644 index 0000000000..78ae552a88 --- /dev/null +++ b/openair2/F1AP/test_f1ap_du.c @@ -0,0 +1,5 @@ + +int main(void) { + F1AP_DU_task(); + return 0; +} diff --git a/openair3/UTILS/conversions.h b/openair3/UTILS/conversions.h index 00287341b2..abfe20c418 100644 --- a/openair3/UTILS/conversions.h +++ b/openair3/UTILS/conversions.h @@ -251,6 +251,37 @@ do { \ + pLMN.MNCdigit2 * 10 + pLMN.MNCdigit1; \ } while(0) + +/* TS 38.473 v15.1.1 section 9.3.2.1: + * NR CELL ID + */ +#define TRANSPORT_LAYER_ADDRESS_TO_BIT_STRING(mACRO, bITsTRING) \ +do { \ + (bITsTRING)->buf = calloc(5, sizeof(uint8_t)); \ + (bITsTRING)->buf[0] = (mACRO) >> 28; \ + (bITsTRING)->buf[1] = (mACRO) >> 20; \ + (bITsTRING)->buf[2] = (mACRO) >> 12; \ + (bITsTRING)->buf[3] = (mACRO) >> 4; \ + (bITsTRING)->buf[4] = ((mACRO) & 0x0f) << 4; \ + (bITsTRING)->size = 5; \ + (bITsTRING)->bits_unused = 4; \ +} while(0) + +/* TS 38.473 v15.1.1 section 9.3.1.12: + * NR CELL ID + */ +#define NR_CELL_ID_TO_BIT_STRING(mACRO, bITsTRING) \ +do { \ + (bITsTRING)->buf = calloc(5, sizeof(uint8_t)); \ + (bITsTRING)->buf[0] = (mACRO) >> 28; \ + (bITsTRING)->buf[1] = (mACRO) >> 20; \ + (bITsTRING)->buf[2] = (mACRO) >> 12; \ + (bITsTRING)->buf[3] = (mACRO) >> 4; \ + (bITsTRING)->buf[4] = ((mACRO) & 0x0f) << 4; \ + (bITsTRING)->size = 5; \ + (bITsTRING)->bits_unused = 4; \ +} while(0) + /* TS 36.413 v10.9.0 section 9.2.1.37: * Macro eNB ID: * Equal to the 20 leftmost bits of the Cell