Compare commits

...

17 Commits

Author SHA1 Message Date
Raymond Knopp
d49db79ed9 update to if5 2022-08-03 17:16:11 +02:00
Raymond Knopp
6fe0c8481f update to if5 2022-08-03 17:14:08 +02:00
KARIM BOUTIBA
69d037263e add ngap ids, cqi and rsrp data to E2SM MET 2022-06-01 21:29:55 +02:00
Raymond Knopp
da5cd851db commented useless call to function which creates an assert with band n38 2022-05-31 14:41:15 +02:00
Raymond Knopp
750954cf59 corrections for 20 and 40 MHz n38. Some assertions were wrong. 2022-05-31 14:41:15 +02:00
KARIM BOUTIBA
7e0971c47c revert to previous if5_rework state with E2 agent 2022-05-31 14:25:33 +02:00
KARIM BOUTIBA
5c3fddde3b fix compilation 2022-05-31 13:44:09 +02:00
Raymond Knopp
14f01cda29 fix compilation 2022-05-30 23:12:06 +02:00
KARIM BOUTIBA
23bcd5c0cd first working version in full SA 2022-05-30 19:38:58 +02:00
KARIM BOUTIBA
02242cb18c first working version in full SA 2022-05-30 18:33:09 +02:00
KARIM BOUTIBA
3c2fbcb77d fix conflicts 2022-05-30 14:42:05 +02:00
KARIM BOUTIBA
035923347a update L2 MET E2SM 2022-05-30 14:32:24 +02:00
KARIM BOUTIBA
6b850d4d4f initial commit fr ONF e2 agent in SA mode 2022-05-30 14:32:24 +02:00
KARIM BOUTIBA
cc0157d30d initial commit fr ONF e2 agent in SA mode 2022-05-30 14:32:24 +02:00
KARIM BOUTIBA
43733d121f update L2 MET E2SM 2022-05-30 14:29:11 +02:00
KARIM BOUTIBA
91ca9008a5 initial commit fr ONF e2 agent in SA mode 2022-05-29 11:08:21 +02:00
KARIM BOUTIBA
315ea27cc1 initial commit fr ONF e2 agent in SA mode 2022-05-19 18:27:12 +02:00
468 changed files with 76651 additions and 8 deletions

View File

@@ -8,6 +8,13 @@ gNBs =
////////// Identification parameters:
gNB_CU_ID = 0xe00;
RIC : {
remote_ipv4_addr = "10.244.0.13";
local_ipv4_addr = "172.21.16.126";
remote_port = 36421;
enabled = "yes";
};
# cell_type = "CELL_MACRO_GNB";
gNB_name = "gNB-OAI";
@@ -41,7 +48,6 @@ gNBs =
#pucch_TargetSNRx10 = 200;
ul_prbblacklist = "51,52,53,54"
min_rxtxtime = 6;
do_SRS = 1;
pdcch_ConfigSIB1 = (
{
@@ -262,7 +268,7 @@ RUs = (
## beamforming 4x4 matrix:
#bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff];
sf_extension = 0
sdr_addrs = "mgmt_addr=172.21.19.14,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
}
);
@@ -295,11 +301,19 @@ security = {
log_config :
{
global_log_level ="info";
global_log_verbosity ="medium";
hw_log_level ="info";
hw_log_verbosity ="medium";
phy_log_level ="info";
phy_log_verbosity ="medium";
mac_log_level ="info";
mac_log_verbosity ="high";
rlc_log_level ="info";
rlc_log_verbosity ="medium";
pdcp_log_level ="info";
pdcp_log_verbosity ="medium";
rrc_log_level ="info";
rrc_log_verbosity ="medium";
f1ap_log_level ="debug";
f1ap_log_verbosity ="medium";
};

View File

@@ -1189,6 +1189,183 @@ set(FSPT_MSG_LIB FSPT_MSG)
message("fspt c dir is : ${FSPT_C_DIR}")
include_directories (${FSPT_C_DIR})
# O-RAN RIC Agent
#################
add_boolean_option(ENABLE_RIC_AGENT False "Enable O-RAN RIC agent")
if(ENABLE_RIC_AGENT)
set(E2AP_DIR ${OPENAIR2_DIR}/RIC_AGENT/E2AP)
# E2AP ASN
set(E2AP_ASN_VERS R2)
set(E2AP_ASN_DIR ${E2AP_DIR}/MESSAGES/ASN1/${E2AP_ASN_VERS})
set(E2AP_C_DIR ${asn1_generated_dir}/E2AP/)
set(E2AP_ASN_FILE ${E2AP_ASN_DIR}/e2ap_v2.asn1)
execute_process(
COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes_e2.sh "${E2AP_C_DIR}"
"${E2AP_ASN_FILE}" "E2AP_" -fno-include-deps -fincludes-quoted
RESULT_VARIABLE ret)
if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "${ret}: error")
endif (NOT ${ret} STREQUAL 0)
add_custom_target (
e2ap_flag ALL
COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes_e2.sh "${E2AP_C_DIR}"
"${E2AP_ASN_FILE}" "E2AP_" -fno-include-deps -fincludes-quoted
DEPENDS $${E2AP_ASN_FILE}
)
file(GLOB E2AP_asn_source ${E2AP_C_DIR}/*.c)
add_library(E2AP_ASN ${E2AP_asn_source})
set(E2AP_ASN_LIB E2AP_ASN)
include_directories ("${E2AP_C_DIR}")
# E2AP
file(GLOB E2AP_source ${E2AP_DIR}/*.c)
add_library(E2AP ${E2AP_source})
set(E2AP_LIB E2AP)
include_directories (${E2AP_DIR})
# E2SM_KPM
# set(KPM_ASN_VERS R01)
set(KPM_ASN_VERS R02)
if (${KPM_ASN_VERS} STREQUAL R01)
set(E2SM_KPM_ASN_FILE e2sm-kpm-v01.00.asn1)
elseif (${KPM_ASN_VERS} STREQUAL R02)
# set(E2SM_KPM_ASN_FILE e2sm-kpm-v02.00.asn1)
# set(E2SM_KPM_ASN_FILE e2sm_kpm_v2.0.2-rm.asn)
set(E2SM_KPM_ASN_FILE e2sm_kpm_v2.0.3-changed.asn)
endif (${KPM_ASN_VERS} STREQUAL R01)
set(E2SM_KPM_DIR ${OPENAIR2_DIR}/RIC_AGENT/E2SM-KPM)
set(E2SM_KPM_ASN_DIR ${E2SM_KPM_DIR}/MESSAGES/ASN1/${KPM_ASN_VERS})
set(E2SM_KPM_C_DIR ${asn1_generated_dir}/E2SM-KPM/)
execute_process(
COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes_e2.sh "${E2SM_KPM_C_DIR}"
"${E2SM_KPM_ASN_DIR}/${E2SM_KPM_ASN_FILE}" "E2SM_KPM_" -fno-include-deps -fincludes-quoted
RESULT_VARIABLE ret)
if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "${ret}: error")
endif (NOT ${ret} STREQUAL 0)
add_custom_target (
e2sm_kpm_flag ALL
COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes_e2.sh "${E2SM_KPM_C_DIR}"
"${E2SM_KPM_ASN_DIR}/${E2SM_KPM_ASN_FILE}" "E2SM_KPM_" -fno-include-deps -fincludes-quoted
DEPENDS ${E2SM_KPM_ASN_DIR}/${E2SM_KPM_ASN_FILE})
file(GLOB E2SM_KPM_asn_source ${E2SM_KPM_C_DIR}/*.c)
add_library(E2SM_KPM_ASN ${E2SM_KPM_asn_source})
set(E2SM_KPM_ASN_LIB E2SM_KPM_ASN)
include_directories ("${E2SM_KPM_C_DIR}")
file(GLOB E2SM_KPM_source ${E2SM_KPM_DIR}/*.c)
add_library(E2SM_KPM ${E2SM_KPM_source} ${E2SM_KPM_asn_source})
set(E2SM_KPM_LIB E2SM_KPM)
include_directories (${E2SM_KPM_DIR})
######## MET SM
# E2SM_MET
set(MET_ASN_VERS R01)
# set(MET_ASN_VERS R02)
if (${MET_ASN_VERS} STREQUAL R01)
set(E2SM_MET_ASN_FILE e2sm-met.asn1)
elseif (${MET_ASN_VERS} STREQUAL R02)
# set(E2SM_MET_ASN_FILE e2sm-met-v02.00.asn1)
# set(E2SM_MET_ASN_FILE e2sm_met_v2.0.2-rm.asn)
set(E2SM_MET_ASN_FILE e2sm_met_v2.0.3-changed.asn)
endif (${MET_ASN_VERS} STREQUAL R01)
set(E2SM_MET_DIR ${OPENAIR2_DIR}/RIC_AGENT/E2SM-MET)
set(E2SM_MET_ASN_DIR ${E2SM_MET_DIR}/MESSAGES/ASN1/${MET_ASN_VERS})
set(E2SM_MET_C_DIR ${asn1_generated_dir}/E2SM-MET/)
execute_process(
COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes_e2.sh "${E2SM_MET_C_DIR}"
"${E2SM_MET_ASN_DIR}/${E2SM_MET_ASN_FILE}" "E2SM_MET_" -fno-include-deps -fincludes-quoted
RESULT_VARIABLE ret)
if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "${ret}: error")
endif (NOT ${ret} STREQUAL 0)
add_custom_target (
e2sm_met_flag ALL
COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes_e2.sh "${E2SM_MET_C_DIR}"
"${E2SM_MET_ASN_DIR}/${E2SM_MET_ASN_FILE}" "E2SM_MET_" -fno-include-deps -fincludes-quoted
DEPENDS ${E2SM_MET_ASN_DIR}/${E2SM_MET_ASN_FILE})
file(GLOB E2SM_MET_asn_source ${E2SM_MET_C_DIR}/*.c)
add_library(E2SM_MET_ASN ${E2SM_MET_asn_source})
set(E2SM_MET_ASN_LIB E2SM_MET_ASN)
include_directories ("${E2SM_MET_C_DIR}")
file(GLOB E2SM_MET_source ${E2SM_MET_DIR}/*.c)
add_library(E2SM_MET ${E2SM_MET_source} ${E2SM_MET_asn_source})
set(E2SM_MET_LIB E2SM_MET)
include_directories (${E2SM_MET_DIR})
######### End MET SM
# RIC_AGENT_LIB
set(RIC_AGENT_DIR ${OPENAIR2_DIR}/RIC_AGENT)
file(GLOB RIC_AGENT_source ${RIC_AGENT_DIR}/*.c)
include_directories ("${RIC_AGENT_DIR}")
add_library(RIC_AGENT ${RIC_AGENT_source})
add_dependencies(RIC_AGENT rrc_flag)
set(RIC_AGENT_LIB RIC_AGENT)
else()
set(E2AP_ASN_LIB "")
set(E2AP_LIB "")
set(RIC_AGENT_LIB "")
endif()
# RAN SLICING
#################
add_boolean_option(ENABLE_RAN_SLICING False "Enable RAN Slicing")
if(ENABLE_RAN_SLICING)
# E2SM_RSM
set(RSM_ASN_VERS R01)
if (${RSM_ASN_VERS} STREQUAL R01)
set(E2SM_RSM_ASN_FILE e2sm-rsm-v1.asn)
set(E2SM_COMMON_ASN_FILE ORAN-WG3.E2SM-v02.00.asn)
endif (${RSM_ASN_VERS} STREQUAL R01)
set(E2SM_RSM_DIR ${OPENAIR2_DIR}/RIC_AGENT/E2SM-RSM)
set(E2SM_RSM_ASN_DIR ${E2SM_RSM_DIR}/MESSAGES/ASN1/${RSM_ASN_VERS})
set(E2SM_RSM_C_DIR ${asn1_generated_dir}/E2SM-RSM/)
#execute_process(
# COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${E2SM_RSM_C_DIR}"
# "${E2SM_RSM_ASN_DIR}/${E2SM_RSM_ASN_FILE} ${E2SM_RSM_ASN_DIR}/${E2SM_COMMON_ASN_FILE}" "E2SM_RSM_" -fno-include-deps -fincludes-quoted
# RESULT_VARIABLE ret)
#if (NOT ${ret} STREQUAL 0)
# message(FATAL_ERROR "${ret}: error")
#endif (NOT ${ret} STREQUAL 0)
add_custom_target (
e2sm_rsm_flag ALL
COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes_e2.sh "${E2SM_RSM_C_DIR}"
"${E2SM_RSM_ASN_DIR}/${E2SM_RSM_ASN_FILE} ${E2SM_RSM_ASN_DIR}/${E2SM_COMMON_ASN_FILE}" "E2SM_RSM_" -fno-include-deps -fincludes-quoted
DEPENDS ${E2SM_RSM_ASN_DIR}/${E2SM_RSM_ASN_FILE} ${E2SM_RSM_ASN_DIR}/${E2SM_COMMON_ASN_FILE})
file(GLOB E2SM_RSM_asn_source ${E2SM_RSM_C_DIR}/*.c)
add_library(E2SM_RSM_ASN ${E2SM_RSM_asn_source})
set(E2SM_RSM_ASN_LIB E2SM_RSM_ASN)
include_directories ("${E2SM_RSM_C_DIR}")
file(GLOB E2SM_RSM_source ${E2SM_RSM_DIR}/*.c)
add_library(E2SM_RSM ${E2SM_RSM_source} ${E2SM_RSM_asn_source})
set(E2SM_RSM_LIB E2SM_RSM)
include_directories (${E2SM_RSM_DIR})
endif()
set(PROTOBUF_LIB "protobuf-c")
#set(PROTOBUF_LIB "protobuf") #for Cpp
@@ -2758,7 +2935,7 @@ target_link_libraries (nr-softmodem
UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU GTPV1U SECU_CN SECU_OSA
ITTI ${FLPT_MSG_LIB} ${FLEXRAN_AGENT_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB
NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${FSPT_MSG_LIB}
X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${E2AP_ASN_LIB} ${E2AP_LIB} ${E2SM_KPM_ASN_LIB} ${E2SM_KPM_LIB} ${E2SM_KMET_ASN_LIB} ${E2SM_MET_LIB} ${E2SM_RSM_LIB} ${RIC_AGENT_LIB} ${FSPT_MSG_LIB}
-Wl,--end-group z dl)
target_link_libraries (nr-softmodem ${LIBXML2_LIBRARIES})
@@ -3041,7 +3218,8 @@ if (${T_TRACER})
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_VNF_LIB NFAPI_USER_LIB
PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU PHY_MEX
L2 L2_LTE L2_NR L2_LTE_NR L2_UE NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON MAC_NR MAC_UE_NR NGAP_GNB
CN_UTILS GTPV1U SCTP_CLIENT MME_APP LIB_NAS_UE NB_IoT SIMU_COMMON SIMU SIMU_ETH OPENAIR0_LIB
CN_UTILS GTPV1U SCTP_CLIENT MME_APP LIB_NAS_UE NB_IoT SIMU_COMMON SIMU SIMU_ETH OPENAIR0_LIB ${E2AP_ASN_LIB} ${E2AP_LIB} ${E2SM_KPM_ASN_LIB} ${E2SM_KPM_LIB} ${E2SM_KMET_ASN_LIB} ${E2SM_MET_LIB}
${E2SM_RSM_LIB} ${RIC_AGENT_LIB}
ldpc_orig ldpc_optim ldpc_optim8seg ldpc dfts)
if (TARGET ${i})
add_dependencies(${i} generate_T)

View File

@@ -443,6 +443,11 @@ function main() {
fi
fi
shift 2;;
--build-ric-agent)
BUILD_RIC_AGENT="True"
CMAKE_CMD="$CMAKE_CMD -DENABLE_RIC_AGENT=True"
echo_info "Enabling RIC agent"
shift 1;;
--noavx512)
NOAVX512="True"
echo_info "Disabling AVX512"
@@ -451,6 +456,11 @@ function main() {
SKIP_SHARED_LIB_FLAG="True"
echo_info "Skipping build of shared libraries, rfsimulator and transport protocol libraries"
shift;;
--build-ran-slicing)
BUILD_RAN_SLICING="True"
CMAKE_CMD="$CMAKE_CMD -DENABLE_RAN_SLICING=True"
echo_info "Enabling RAN Slicing"
shift;;
--ninja)
CMAKE_CMD="$CMAKE_CMD -GNinja"
MAKE_CMD=ninja
@@ -806,7 +816,9 @@ function main() {
echo "set ( DEADLINE_SCHEDULER \"${DEADLINE_SCHEDULER_FLAG_USER}\" )" >> $cmake_file
echo "set ( CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )" >> $cmake_file
echo "set ( HWLAT \"${HWLAT}\" )" >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
echo "set ( ENABLE_RIC_AGENT $BUILD_RIC_AGENT )" >> $cmake_file
echo "set ( ENABLE_RAN_SLICING $BUILD_RAN_SLICING )" >> $cmake_file
cd $DIR/$hwlat_build_dir/build
cmake ..
compilations \
@@ -835,6 +847,8 @@ function main() {
echo "set ( CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )" >> $cmake_file
echo "set ( HWLAT \"${HWLAT}\" )" >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
echo "set ( ENABLE_RIC_AGENT $BUILD_RIC_AGENT )" >> $cmake_file
echo "set ( ENABLE_RAN_SLICING $BUILD_RAN_SLICING )" >> $cmake_file
cd $DIR/$hwlat_test_build_dir/build
cmake ..
compilations \

3386
cmake_targets/tmp.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,31 @@
#!/bin/bash
GENERATED_FULL_DIR=$1
shift
ASN1_SOURCE_FILES="$1"
shift
export ASN1C_PREFIX=$1
shift
options=$*
done_flag="$GENERATED_FULL_DIR"/done
newer=0
for sf in $ASN1_SOURCE_FILES ; do
if [ "$done_flag" -ot $sf ] ; then
newer=1
break
fi
done
if [ $newer -eq 1 ]; then
rm -f "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}*.c "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}*.h
mkdir -p "$GENERATED_FULL_DIR"
asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example $options -D $GENERATED_FULL_DIR $ASN1_SOURCE_FILES |& egrep -v "^Copied|^Compiled" | sort -u
if [ "$ASN1C_PREFIX" = "X2AP_" ] ; then
sed -i 's/18446744073709551615))/18446744073709551615U))/g' "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}E-RABUsageReport-Item.c
sed -i 's/18446744073709551615 }/18446744073709551615U }/g' "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}E-RABUsageReport-Item.c
fi
if [ "$ASN1C_PREFIX" = "S1AP_" ] ; then
sed -i 's/18446744073709551615))/18446744073709551615U))/g' "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}E-RABUsageReportItem.c
sed -i 's/18446744073709551615 }/18446744073709551615U }/g' "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}E-RABUsageReportItem.c
fi
fi
touch $done_flag

View File

@@ -496,7 +496,9 @@ int logInit (void)
register_log_component("NGAP","",NGAP);
register_log_component("ITTI","log",ITTI);
register_log_component("UTIL","log",UTIL);
#ifdef ENABLE_RIC_AGENT
register_log_component("RIC_AGENT","log",RIC_AGENT);
#endif
for (int i=0 ; log_level_names[i].name != NULL ; i++)
g_log->level2string[i] = toupper(log_level_names[i].name[0]); // uppercased first letter of level name

View File

@@ -247,6 +247,9 @@ typedef enum {
NFAPI_PNF,
ITTI,
UTIL,
#ifdef ENABLE_RIC_AGENT
RIC_AGENT,
#endif
MAX_LOG_PREDEF_COMPONENTS,
}
comp_name_t;

View File

@@ -691,6 +691,47 @@ ID = LEGACY_FLEXRAN_AGENT_TRACE
DESC = FLEXRAN_AGENT legacy logs - trace level
GROUP = ALL:LEGACY_FLEXRAN_AGENT:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
ID = LEGACY_RIC_AGENT_INFO
DESC = RIC_AGENT legacy logs - info level
GROUP = ALL:LEGACY_RIC_AGENT:LEGACY_GROUP_INFO:LEGACY
FORMAT = string,log
ID = LEGACY_RIC_AGENT_ERROR
DESC = RIC_AGENT legacy logs - error level
GROUP = ALL:LEGACY_RIC_AGENT:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log
ID = LEGACY_RIC_AGENT_WARNING
DESC = RIC_AGENT legacy logs - warning level
GROUP = ALL:LEGACY_RIC_AGENT:LEGACY_GROUP_WARNING:LEGACY
FORMAT = string,log
ID = LEGACY_RIC_AGENT_DEBUG
DESC = RIC_AGENT legacy logs - debug level
GROUP = ALL:LEGACY_RIC_AGENT:LEGACY_GROUP_DEBUG:LEGACY
FORMAT = string,log
ID = LEGACY_RIC_AGENT_TRACE
DESC = RIC_AGENT legacy logs - trace level
GROUP = ALL:LEGACY_RIC_AGENT:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
ID = LEGACY_E2AP_INFO
DESC = E2AP legacy logs - info level
GROUP = ALL:LEGACY_E2AP:LEGACY_GROUP_INFO:LEGACY
FORMAT = string,log
ID = LEGACY_E2AP_ERROR
DESC = E2AP legacy logs - error level
GROUP = ALL:LEGACY_E2AP:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log
ID = LEGACY_E2AP_WARNING
DESC = E2AP legacy logs - warning level
GROUP = ALL:LEGACY_E2AP:LEGACY_GROUP_WARNING:LEGACY
FORMAT = string,log
ID = LEGACY_E2AP_DEBUG
DESC = E2AP legacy logs - debug level
GROUP = ALL:LEGACY_E2AP:LEGACY_GROUP_DEBUG:LEGACY
FORMAT = string,log
ID = LEGACY_E2AP_TRACE
DESC = E2AP legacy logs - trace level
GROUP = ALL:LEGACY_E2AP:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
ID = LEGACY_SCTP_INFO
DESC = SCTP legacy logs - info level

View File

@@ -346,6 +346,8 @@ void *rrc_enb_process_msg(void *);
TASK_DEF(TASK_RRC_NSA_UE, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_RRC_NSA_NRUE, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_NAS_NRUE, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_RIC_AGENT, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_RIC_AGENT_DU, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_MAX, TASK_PRIORITY_MED, 200, NULL, NULL)
#define TASK_DEF(TaskID, pRIO, qUEUEsIZE, FuNc, ThreadFunc) { pRIO, qUEUEsIZE, #TaskID, FuNc, ThreadFunc },

View File

@@ -0,0 +1,516 @@
/*
* 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
*
* Author and copyright: Laurent Thomas, open-cells.com
*
* 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
*/
#include <vector>
#include <map>
#include <sys/eventfd.h>
extern "C" {
#include <intertask_interface.h>
#include <common/utils/system.h>
typedef struct timer_elm_s {
timer_type_t type; ///< Timer type
long instance;
long duration;
uint64_t timeout;
void *timer_arg; ///< Optional argument that will be passed when timer expires
} timer_elm_t ;
typedef struct task_list_s {
task_info_t admin;
pthread_t thread;
pthread_mutex_t queue_cond_lock;
std::vector<MessageDef *> message_queue;
std::map<long,timer_elm_t> timer_map;
uint64_t next_timer=UINT64_MAX;
struct epoll_event *events =NULL;
int nb_fd_epoll=0;
int nb_events=0;
int epoll_fd=-1;
int sem_fd=-1;
} task_list_t;
int timer_expired(int fd);
static task_list_t **tasks=NULL;
static int nb_queues=0;
static pthread_mutex_t lock_nb_queues;
void *pool_buffer_init (void) {
return 0;
}
void *pool_buffer_clean (void *arg) {
//-----------------------------------------------------------------------------
return 0;
}
void free_mem_block (mem_block_t *leP, const char *caller) {
AssertFatal(leP!=NULL,"");
free(leP);
}
mem_block_t *get_free_mem_block (uint32_t sizeP, const char *caller) {
mem_block_t *ptr=(mem_block_t *)malloc(sizeP+sizeof(mem_block_t));
ptr->next = NULL;
ptr->previous = NULL;
ptr->data=((unsigned char *)ptr)+sizeof(mem_block_t);
ptr->size=sizeP;
return ptr;
}
void *itti_malloc(task_id_t origin_task_id, task_id_t destination_task_id, ssize_t size) {
void *ptr = NULL;
AssertFatal ((ptr=calloc (size, 1)) != NULL, "Memory allocation of %zu bytes failed (%d -> %d)!\n",
size, origin_task_id, destination_task_id);
return ptr;
}
int itti_free(task_id_t task_id, void *ptr) {
AssertFatal (ptr != NULL, "Trying to free a NULL pointer (%d)!\n", task_id);
free (ptr);
return (EXIT_SUCCESS);
}
// in the two following functions, the +32 in malloc is there to deal with gcc memory alignment
// because a struct size can be larger than sum(sizeof(struct components))
// We should remove the itti principle of a huge union for all types of messages in paramter "msg_t ittiMsg"
// to use a more C classical pointer casting "void * ittiMsg", later casted in the right struct
// but we would have to change all legacy macros, as per this example
// #define S1AP_REGISTER_ENB_REQ(mSGpTR) (mSGpTR)->ittiMsg.s1ap_register_enb_req
// would become
// #define S1AP_REGISTER_ENB_REQ(mSGpTR) (s1ap_register_enb_req) mSGpTR)->ittiMsg
MessageDef *itti_alloc_new_message_sized(task_id_t origin_task_id, instance_t originInstance, MessagesIds message_id, MessageHeaderSize size) {
MessageDef *temp = (MessageDef *)itti_malloc (origin_task_id, TASK_UNKNOWN, sizeof(MessageHeader) +32 + size);
temp->ittiMsgHeader.messageId = message_id;
temp->ittiMsgHeader.originTaskId = origin_task_id;
temp->ittiMsgHeader.ittiMsgSize = size;
return temp;
}
MessageDef *itti_alloc_new_message(task_id_t origin_task_id, instance_t originInstance, MessagesIds message_id) {
int size=sizeof(MessageHeader) + 32 + messages_info[message_id].size;
MessageDef *temp = (MessageDef *)itti_malloc (origin_task_id, TASK_UNKNOWN, size);
temp->ittiMsgHeader.messageId = message_id;
temp->ittiMsgHeader.originTaskId = origin_task_id;
temp->ittiMsgHeader.ittiMsgSize = size;
temp->ittiMsgHeader.destinationTaskId=TASK_UNKNOWN;
temp->ittiMsgHeader.originInstance=originInstance;
temp->ittiMsgHeader.destinationInstance=0;
temp->ittiMsgHeader.lte_time= {0};
return temp;
//return itti_alloc_new_message_sized(origin_task_id, message_id, messages_info[message_id].size);
}
static inline int itti_send_msg_to_task_locked(task_id_t destination_task_id, instance_t destinationInstance, MessageDef *message) {
task_list_t *t=tasks[destination_task_id];
message->ittiMsgHeader.destinationTaskId = destination_task_id;
message->ittiMsgHeader.destinationInstance = destinationInstance;
message->ittiMsgHeader.lte_time.frame = 0;
message->ittiMsgHeader.lte_time.slot = 0;
int message_id = message->ittiMsgHeader.messageId;
size_t s=t->message_queue.size();
if ( s > t->admin.queue_size )
LOG_E(TMR,"Queue for %s task contains %ld messages\n", itti_get_task_name(destination_task_id), s );
if ( s > 50 )
LOG_I(ITTI,"Queue for %s task size: %ld (last message %s)\n",itti_get_task_name(destination_task_id), s+1,ITTI_MSG_NAME(message));
t->message_queue.insert(t->message_queue.begin(), message);
eventfd_t sem_counter = 1;
AssertFatal ( sizeof(sem_counter) == write(t->sem_fd, &sem_counter, sizeof(sem_counter)), "");
LOG_D(ITTI,"sent messages id=%d to %s\n",message_id, t->admin.name);
return 0;
}
int itti_send_msg_to_task(task_id_t destination_task_id, instance_t destinationInstance, MessageDef *message) {
task_list_t *t=tasks[destination_task_id];
pthread_mutex_lock (&t->queue_cond_lock);
int ret=itti_send_msg_to_task_locked(destination_task_id, destinationInstance, message);
while ( t->message_queue.size()>0 && t->admin.func != NULL ) {
if (t->message_queue.size()>1)
LOG_W(ITTI,"queue in no thread mode is %ld\n", t->message_queue.size());
pthread_mutex_unlock (&t->queue_cond_lock);
t->admin.func(NULL);
pthread_mutex_lock (&t->queue_cond_lock);
}
pthread_mutex_unlock (&t->queue_cond_lock);
return ret;
}
void itti_subscribe_event_fd(task_id_t task_id, int fd) {
struct epoll_event event;
task_list_t *t=tasks[task_id];
t->nb_fd_epoll++;
t->events = (struct epoll_event *)realloc((void *)t->events,
t->nb_fd_epoll * sizeof(struct epoll_event));
event.events = EPOLLIN | EPOLLERR;
event.data.u64 = 0;
event.data.fd = fd;
AssertFatal(epoll_ctl(t->epoll_fd, EPOLL_CTL_ADD, fd, &event) == 0,
"epoll_ctl (EPOLL_CTL_ADD) failed for task %s, fd %d: %s!\n",
itti_get_task_name(task_id), fd, strerror(errno));
}
void itti_unsubscribe_event_fd(task_id_t task_id, int fd) {
task_list_t *t=tasks[task_id];
AssertFatal (epoll_ctl(t->epoll_fd, EPOLL_CTL_DEL, fd, NULL) == 0,
"epoll_ctl (EPOLL_CTL_DEL) failed for task %s, fd %d: %s!\n",
itti_get_task_name(task_id), fd, strerror(errno));
t->nb_fd_epoll--;
}
static inline int itti_get_events_locked(task_id_t task_id, struct epoll_event **events) {
task_list_t *t=tasks[task_id];
uint64_t current_time=0;
do {
if ( t->next_timer != UINT64_MAX ) {
struct timespec tp;
clock_gettime(CLOCK_MONOTONIC, &tp);
current_time=(uint64_t)tp.tv_sec*1000+tp.tv_nsec/(1000*1000);
if ( t->next_timer < current_time) {
t->next_timer=UINT64_MAX;
// Proceed expired timer
for ( auto it=t->timer_map.begin(), next_it = it; it != t->timer_map.end() ; it = next_it ) {
++next_it;
if ( it->second.timeout < current_time ) {
MessageDef *message = itti_alloc_new_message(TASK_TIMER, it->second.instance,TIMER_HAS_EXPIRED);
message->ittiMsg.timer_has_expired.timer_id=it->first;
message->ittiMsg.timer_has_expired.arg=it->second.timer_arg;
if (itti_send_msg_to_task_locked(task_id, it->second.instance, message) < 0) {
LOG_W(ITTI,"Failed to send msg TIMER_HAS_EXPIRED to task %u\n", task_id);
free(message);
t->timer_map.erase(it);
return -1;
}
if ( it->second.type==TIMER_PERIODIC ) {
it->second.timeout+=it->second.duration;
if (it->second.timeout < t->next_timer)
t->next_timer=it->second.timeout;
} else
t->timer_map.erase(it);
} else if (it->second.timeout < t->next_timer)
t->next_timer=it->second.timeout;
}
}
}
int epoll_timeout = -1;
if ( t->next_timer != UINT64_MAX )
epoll_timeout = t->next_timer-current_time;
pthread_mutex_unlock(&t->queue_cond_lock);
LOG_D(ITTI,"enter blocking wait for %s, timeout: %d ms\n", itti_get_task_name(task_id), epoll_timeout);
t->nb_events = epoll_wait(t->epoll_fd,t->events,t->nb_fd_epoll, epoll_timeout);
if ( t->nb_events < 0 && (errno == EINTR || errno == EAGAIN ) )
pthread_mutex_lock(&t->queue_cond_lock);
} while (t->nb_events < 0 && (errno == EINTR || errno == EAGAIN ) );
AssertFatal (t->nb_events >=0,
"epoll_wait failed for task %s, nb fds %d, timeout %lu: %s!\n",
itti_get_task_name(task_id), t->nb_fd_epoll, t->next_timer != UINT64_MAX ? t->next_timer-current_time : -1, strerror(errno));
LOG_D(ITTI,"receive on %d descriptors for %s\n", t->nb_events, itti_get_task_name(task_id));
if (t->nb_events == 0)
/* No data to read -> return */
return 0;
for (int i = 0; i < t->nb_events; i++) {
/* Check if there is an event for ITTI for the event fd */
if ((t->events[i].events & EPOLLIN) &&
(t->events[i].data.fd == t->sem_fd)) {
eventfd_t sem_counter;
/* Read will always return 1 */
AssertFatal( sizeof(sem_counter) == read (t->sem_fd, &sem_counter, sizeof(sem_counter)), "");
/* Mark that the event has been processed */
t->events[i].events &= ~EPOLLIN;
}
}
*events = t->events;
return t->nb_events;
}
int itti_get_events(task_id_t task_id, struct epoll_event **events) {
pthread_mutex_lock(&tasks[task_id]->queue_cond_lock);
return itti_get_events_locked(task_id, events);
}
void itti_receive_msg(task_id_t task_id, MessageDef **received_msg) {
// Reception of one message, blocking caller
task_list_t *t=tasks[task_id];
pthread_mutex_lock(&t->queue_cond_lock);
// Weird condition to deal with crap legacy itti interface
if ( t->nb_fd_epoll == 1 ) {
while (t->message_queue.empty()) {
itti_get_events_locked(task_id, &t->events);
pthread_mutex_lock(&t->queue_cond_lock);
}
} else {
if (t->message_queue.empty()) {
itti_get_events_locked(task_id, &t->events);
pthread_mutex_lock(&t->queue_cond_lock);
}
}
// Legacy design: we return even if we have no message
// in this case, *received_msg is NULL
if (t->message_queue.empty()) {
*received_msg=NULL;
LOG_D(ITTI,"task %s received even from other fd (total fds: %d), returning msg NULL\n",t->admin.name, t->nb_fd_epoll);
} else {
*received_msg=t->message_queue.back();
t->message_queue.pop_back();
LOG_D(ITTI,"task %s received a message\n",t->admin.name);
}
pthread_mutex_unlock (&t->queue_cond_lock);
}
void itti_poll_msg(task_id_t task_id, MessageDef **received_msg) {
//reception of one message, non-blocking
task_list_t *t=tasks[task_id];
pthread_mutex_lock(&t->queue_cond_lock);
if (!t->message_queue.empty()) {
LOG_D(ITTI,"task %s received a message in polling mode\n",t->admin.name);
*received_msg=t->message_queue.back();
t->message_queue.pop_back();
} else
*received_msg=NULL;
pthread_mutex_unlock (&t->queue_cond_lock);
}
int itti_create_task(task_id_t task_id,
void *(*start_routine)(void *),
void *args_p) {
task_list_t *t=tasks[task_id];
threadCreate (&t->thread, start_routine, args_p, (char *)itti_get_task_name(task_id),-1,OAI_PRIORITY_RT);
LOG_I(ITTI,"Created Posix thread %s\n", itti_get_task_name(task_id) );
return 0;
}
int itti_create_task_low(task_id_t task_id,
void *(*start_routine)(void *),
void *args_p) {
task_list_t *t=tasks[task_id];
threadCreate (&t->thread, start_routine, args_p, (char *)itti_get_task_name(task_id),1,OAI_PRIORITY_RT_LOW);
LOG_I(ITTI,"Created Posix thread %s\n", itti_get_task_name(task_id) );
return 0;
}
void itti_exit_task(void) {
pthread_exit (NULL);
}
void itti_terminate_tasks(task_id_t task_id) {
// Sends Terminate signals to all tasks.
itti_send_terminate_message (task_id);
usleep(100*1000); // Allow the tasks to receive the message before going returning to main thread
}
int itti_create_queue(const task_info_t *taskInfo) {
pthread_mutex_lock (&lock_nb_queues);
int newQueue=nb_queues++;
task_list_t **new_tasks = (task_list_t **)realloc(tasks, nb_queues * sizeof(*tasks));
AssertFatal(new_tasks != NULL, "could not realloc() tasks list");
tasks = new_tasks;
tasks[newQueue]= new task_list_t;
pthread_mutex_unlock (&lock_nb_queues);
LOG_I(ITTI,"Starting itti queue: %s as task %d\n", taskInfo->name, newQueue);
pthread_mutex_init(&tasks[newQueue]->queue_cond_lock, NULL);
memcpy(&tasks[newQueue]->admin, taskInfo, sizeof(task_info_t));
AssertFatal( ( tasks[newQueue]->epoll_fd = epoll_create1(0) ) >=0, "");
AssertFatal( ( tasks[newQueue]->sem_fd = eventfd(0, EFD_SEMAPHORE) ) >=0, "");
itti_subscribe_event_fd((task_id_t)newQueue, tasks[newQueue]->sem_fd);
if (tasks[newQueue]->admin.threadFunc != NULL)
itti_create_task((task_id_t)newQueue, tasks[newQueue]->admin.threadFunc, NULL);
return newQueue;
}
int itti_init(task_id_t task_max,
const task_info_t *tasks
) {
pthread_mutex_init(&lock_nb_queues, NULL);
nb_queues=0;
for(int i=0; i<task_max; ++i) {
itti_create_queue(&tasks[i]);
}
return 0;
}
int timer_setup(
uint32_t interval_sec,
uint32_t interval_us,
task_id_t task_id,
instance_t instance,
timer_type_t type,
void *timer_arg,
long *timer_id) {
task_list_t *t=tasks[task_id];
do {
// set the taskid in the timer id to keep compatible with the legacy API
// timer_remove() takes only the timer id as parameter
*timer_id=(random()%UINT16_MAX) << 16 | task_id ;
} while ( t->timer_map.find(*timer_id) != t->timer_map.end());
/* Allocate new timer list element */
timer_elm_t timer;
struct timespec tp;
clock_gettime(CLOCK_MONOTONIC, &tp);
if (interval_us%1000 != 0)
LOG_W(ITTI, "Can't set timer precision below 1ms, rounding it\n");
timer.duration = interval_sec*1000+interval_us/1000;
timer.timeout= ((uint64_t)tp.tv_sec*1000+tp.tv_nsec/(1000*1000)+timer.duration);
timer.instance = instance;
timer.type = type;
timer.timer_arg = timer_arg;
pthread_mutex_lock (&t->queue_cond_lock);
t->timer_map[*timer_id]= timer;
if (timer.timeout < t->next_timer)
t->next_timer=timer.timeout;
eventfd_t sem_counter = 1;
AssertFatal ( sizeof(sem_counter) == write(t->sem_fd, &sem_counter, sizeof(sem_counter)), "");
pthread_mutex_unlock (&t->queue_cond_lock);
return 0;
}
int timer_remove(long timer_id) {
task_id_t task_id=(task_id_t)(timer_id&0xffff);
int ret;
pthread_mutex_lock (&tasks[task_id]->queue_cond_lock);
ret=tasks[task_id]->timer_map.erase(timer_id);
pthread_mutex_unlock (&tasks[task_id]->queue_cond_lock);
if (ret==1)
return 0;
else {
LOG_W(ITTI, "tried to remove a non existing timer\n");
return 1;
}
}
const char *itti_get_message_name(MessagesIds message_id) {
return messages_info[message_id].name;
}
const char *itti_get_task_name(task_id_t task_id) {
return tasks[task_id]->admin.name;
}
// void for compatibility
void itti_send_terminate_message(task_id_t task_id) {
}
static volatile bool shutting_down;
static void catch_sigterm(int) {
static const char msg[] = "\n** Caught SIGTERM, shutting down\n";
__attribute__((unused))
int unused = write(STDOUT_FILENO, msg, sizeof(msg) - 1);
shutting_down = true;
}
void itti_wait_tasks_end(void) {
shutting_down = false;
signal(SIGTERM, catch_sigterm);
while (! shutting_down)
{
sleep(24 * 3600);
}
}
void itti_update_lte_time(uint32_t frame, uint8_t slot) {}
void itti_set_task_real_time(task_id_t task_id) {}
void itti_mark_task_ready(task_id_t task_id) {
// Function meaning is clear, but legacy implementation is wrong
// keep it void is fine: today implementation accepts messages in the queue before task is ready
}
void itti_wait_ready(int wait_tasks) {
// Stupid function, kept for compatibility (the parameter is meaningless!!!)
}
int signal_mask(void) {
return 0;
}
void log_scheduler(const char* label)
{
int policy = sched_getscheduler(0);
struct sched_param param;
if (sched_getparam(0, &param) == -1)
{
LOG_E(HW, "sched_getparam: %s\n", strerror(errno));
abort();
}
cpu_set_t cpu_set;
if (sched_getaffinity(0, sizeof(cpu_set), &cpu_set) == -1)
{
LOG_E(HW, "sched_getaffinity: %s\n", strerror(errno));
abort();
}
int num_cpus = sysconf(_SC_NPROCESSORS_ONLN);
if (num_cpus < 1)
{
LOG_E(HW, "sysconf(_SC_NPROCESSORS_ONLN): %s\n", strerror(errno));
abort();
}
char buffer[num_cpus];
for (int i = 0; i < num_cpus; i++)
{
buffer[i] = CPU_ISSET(i, &cpu_set) ? 'Y' : '-';
}
LOG_A(HW, "Scheduler policy=%d priority=%d affinity=[%d]%.*s label=%s\n",
policy,
param.sched_priority,
num_cpus,
num_cpus,
buffer,
label);
}
} // extern "C"

View File

@@ -80,7 +80,9 @@ unsigned short config_frames[4] = {2,9,11,13};
#include "gnb_paramdef.h"
#include <openair3/ocp-gtpu/gtp_itf.h>
#include "nfapi/oai_integration/vendor_ext.h"
#ifdef ENABLE_RIC_AGENT
#include "ric_agent.h"
#endif
pthread_cond_t nfapi_sync_cond;
pthread_mutex_t nfapi_sync_mutex;
int nfapi_sync_var=-1; //!< protected by mutex \ref nfapi_sync_mutex
@@ -367,7 +369,13 @@ int create_gNB_tasks(uint32_t gnb_nb) {
}
}
}
#ifdef ENABLE_RIC_AGENT
//if (NODE_IS_CU(type)) {
RCconfig_ric_agent();
int rc = itti_create_task(TASK_RIC_AGENT, ric_agent_task, NULL);
AssertFatal(rc >= 0, "Create task for RIC_AGENT failed\n");
//}
#endif
return 0;
}

View File

@@ -2375,6 +2375,7 @@ NR_UE_info_t *add_new_nr_ue(gNB_MAC_INST *nr_mac, rnti_t rntiP, NR_CellGroupConf
UE->rnti = rntiP;
UE->CellGroup = CellGroup;
UE_info->num_UEs++;
if (CellGroup)
UE->Msg4_ACKed = true;
@@ -2573,6 +2574,8 @@ void mac_remove_nr_ue(gNB_MAC_INST *nr_mac, rnti_t rnti)
pthread_mutex_unlock(&UE_info->mutex);
delete_nr_ue_data(UE, nr_mac->common_channels);
UE_info->num_UEs--;
}
void nr_mac_remove_ra_rnti(module_id_t mod_id, rnti_t rnti) {

View File

@@ -732,6 +732,8 @@ typedef struct {
pthread_mutex_t mutex;
NR_UE_info_t *list[MAX_MOBILES_PER_GNB+1];
bool sched_csirs;
int num_UEs;
} NR_UEs_t;
#define UE_iterator(BaSe, VaR) NR_UE_info_t ** VaR##pptr=BaSe, *VaR; while ((VaR=*(VaR##pptr++)))

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,32 @@
Obtaining O-RAN WG3 E2 Specifications
=====================================
Before you can build the OAI O-RAN RIC agent, you will need to accept
the O-RAN Alliance Adopter License: https://www.o-ran.org/specifications .
Once you have an account, download all specifications in `.docx` form
from WG3: E2AP, E2SM-NI, and E2SM-KPM. Place them in a temporary
directory on a machine that has the `openairinterface5g` repository.
For each .docx file, open and save as a plain .txt file with the same name.
Then run these commands:
openairinterface5g/cmake_targets/tools/extract_asn1_from_spec.pl \
< ORAN-WG3.E2AP-v01.00.txt > ORAN-WG3.E2AP-v01.00.asn
openairinterface5g/cmake_targets/tools/extract_asn1_from_spec.pl \
< ORAN-WG3.E2SM-NI-v01.00.txt > ORAN-WG3.E2SM-NI-v01.00.asn
openairinterface5g/cmake_targets/tools/extract_asn1_from_spec.pl \
< ORAN-WG3.E2SM-KPM-v01.00.txt > ORAN-WG3.E2SM-KPM-v01.00.asn
This is version 01, so copy the .asn files into your openairinterface5g
tree:
mkdir -p openairinterface5g/openair2/RIC_AGENT/MESSAGES/ASN1/R01
cp ORAN-WG3.E2AP-v01.00.asn \
ORAN-WG3.E2SM-NI-v01.00.asn \
ORAN-WG3.E2SM-KPM-v01.00.asn \
openairinterface5g/openair2/RIC_AGENT/MESSAGES/ASN1/R01
At this point, the build will work on these .asn files and generate the
necessary stubs via the `asn1c` compiler.

View File

@@ -0,0 +1,116 @@
/*
* SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* 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
*/
#include "assertions.h"
#include "ric_agent.h"
#include "e2ap_decoder.h"
#include "E2AP_E2AP-PDU.h"
#include "E2AP_ProcedureCode.h"
#include "per_decoder.h"
#define CASE_E2AP_I(id,name) \
case id: \
RIC_AGENT_INFO("decoded initiating " #name " (%ld)\n",id); \
break
#define CASE_E2AP_S(id,name) \
case id: \
RIC_AGENT_INFO("decoded successful outcome " #name " (%ld)\n",id); \
break
#define CASE_E2AP_U(id,name) \
case id: \
RIC_AGENT_INFO("decoded unsuccessful outcome " #name " (%ld)\n",id); \
break
int e2ap_decode_pdu(E2AP_E2AP_PDU_t *pdu,
const uint8_t * const buf,const uint32_t len)
{
asn_dec_rval_t dres;
DevAssert(pdu != NULL);
DevAssert(buf != NULL);
dres = aper_decode(NULL,&asn_DEF_E2AP_E2AP_PDU,(void **)&pdu,buf,len,0,0);
if (dres.code != RC_OK) {
RIC_AGENT_ERROR("failed to decode PDU (%d)\n",dres.code);
return -1;
}
xer_fprint(stdout, &asn_DEF_E2AP_E2AP_PDU, pdu);
switch (pdu->present) {
case E2AP_E2AP_PDU_PR_initiatingMessage:
switch (pdu->choice.initiatingMessage.procedureCode)
{
CASE_E2AP_I(E2AP_ProcedureCode_id_Reset,Reset);
CASE_E2AP_I(E2AP_ProcedureCode_id_RICsubscription,
RICsubscription);
CASE_E2AP_I(E2AP_ProcedureCode_id_RICsubscriptionDelete,
RICsubscriptionDelete);
CASE_E2AP_I(E2AP_ProcedureCode_id_RICcontrol,RICcontrol);
CASE_E2AP_I(E2AP_ProcedureCode_id_RICserviceQuery,RICserviceQuery);
CASE_E2AP_I(E2AP_ProcedureCode_id_ErrorIndication,ErrorIndication);
CASE_E2AP_I(E2AP_ProcedureCode_id_E2connectionUpdate,E2ConnectionUpdate);
default:
RIC_AGENT_ERROR("unknown procedure ID (%d) for initiating message\n",
(int)pdu->choice.initiatingMessage.procedureCode);
return -1;
}
break;
case E2AP_E2AP_PDU_PR_successfulOutcome:
switch (pdu->choice.successfulOutcome.procedureCode) {
CASE_E2AP_S(E2AP_ProcedureCode_id_E2setup,E2SetupResponse);
CASE_E2AP_S(E2AP_ProcedureCode_id_Reset,Reset);
CASE_E2AP_S(E2AP_ProcedureCode_id_RICserviceUpdate,RICserviceUpdate);
CASE_E2AP_S(E2AP_ProcedureCode_id_E2nodeConfigurationUpdate,E2nodeConfigurationUpdateAcknowledge);
default:
RIC_AGENT_ERROR("unknown procedure ID (%d) for successful outcome\n",
(int)pdu->choice.successfulOutcome.procedureCode);
return -1;
}
break;
case E2AP_E2AP_PDU_PR_unsuccessfulOutcome:
switch (pdu->choice.unsuccessfulOutcome.procedureCode) {
CASE_E2AP_U(E2AP_ProcedureCode_id_E2setup,E2setupFailure);
CASE_E2AP_U(E2AP_ProcedureCode_id_RICserviceUpdate,RICserviceUpdate);
default:
RIC_AGENT_ERROR("unknown procedure ID (%d) for unsuccessful outcome\n",
(int)pdu->choice.unsuccessfulOutcome.procedureCode);
return -1;
}
break;
default:
RIC_AGENT_ERROR("unknown presence (%d)\n",(int)pdu->present);
return -1;
}
return 0;
}

View File

@@ -0,0 +1,39 @@
/*
* SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* 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 _E2AP_DECODER_H
#define _E2AP_DECODER_H
#include "xer_support.h"
#include "E2AP_E2AP-PDU.h"
extern int e2ap_xer_print;
int e2ap_decode_pdu(E2AP_E2AP_PDU_t *pdu,
const uint8_t * const buf,const uint32_t len);
#endif /* _E2AP_DECODER_H */

View File

@@ -0,0 +1,77 @@
/*
* SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* 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
*/
#include "assertions.h"
#include "conversions.h"
#include "intertask_interface.h"
#include "e2ap_encoder.h"
#include "E2AP_E2AP-PDU.h"
#include "E2AP_ProcedureCode.h"
#include "per_encoder.h"
#include "asn_application.h"
#include "per_support.h"
ssize_t e2ap_encode(const struct asn_TYPE_descriptor_s *td,
const asn_per_constraints_t *constraints,
void *sptr,
uint8_t **buf)
{
ssize_t encoded;
DevAssert(td != NULL);
DevAssert(buf != NULL);
xer_fprint(stdout, td, sptr);
encoded = aper_encode_to_new_buffer(td, constraints, sptr, (void **)buf);
if (encoded < 0) {
return -1;
}
ASN_STRUCT_FREE_CONTENTS_ONLY((*td), sptr);
return encoded;
}
ssize_t e2ap_encode_pdu(E2AP_E2AP_PDU_t *pdu, uint8_t **buf, uint32_t *len)
{
ssize_t encoded;
DevAssert(pdu != NULL);
DevAssert(buf != NULL);
DevAssert(len != NULL);
encoded = e2ap_encode(&asn_DEF_E2AP_E2AP_PDU,0,pdu,buf);
if (encoded < 0) {
return -1;
}
*len = encoded;
return encoded;
}

View File

@@ -0,0 +1,40 @@
/*
* SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* 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 _E2AP_ENCODER_H
#define _E2AP_ENCODER_H
#include "E2AP_E2AP-PDU.h"
ssize_t e2ap_encode(const struct asn_TYPE_descriptor_s *td,
const asn_per_constraints_t *constraints,void *sptr,
uint8_t **buf)
__attribute__ ((warn_unused_result));
ssize_t e2ap_encode_pdu(E2AP_E2AP_PDU_t *pdu,uint8_t **buf,uint32_t *len)
__attribute__ ((warn_unused_result));
#endif /* _E2AP_ENCODER_H */

View File

@@ -0,0 +1,976 @@
/*
* SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* 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
*/
#include "assertions.h"
#include "conversions.h"
#include "common/ngran_types.h"
#include "ric_agent.h"
#include "e2ap_generate_messages.h"
#include "e2ap_encoder.h"
#include "e2ap_decoder.h"
#include "e2sm_kpm.h"
#include "E2AP_Cause.h"
#include "E2AP_ProtocolIE-Field.h"
#include "E2AP_InitiatingMessage.h"
#include "E2AP_SuccessfulOutcome.h"
#include "E2AP_UnsuccessfulOutcome.h"
#include "E2AP_E2setupRequest.h"
#include "E2AP_GlobalE2node-ID.h"
#include "E2AP_E2nodeComponentID.h"
extern int global_e2_node_id(ranid_t ranid, E2AP_GlobalE2node_ID_t* node_id);
extern unsigned int ran_functions_len;
extern ric_ran_function_t **ran_functions;
int e2ap_generate_e2_setup_request(ranid_t ranid,
uint8_t **buffer,uint32_t *len,
e2node_type_t e2node_type)
{
E2AP_E2AP_PDU_t pdu;
E2AP_E2setupRequest_t *req;
E2AP_E2setupRequestIEs_t *ie;
E2AP_RANfunction_ItemIEs_t *ran_function_item_ie;
E2AP_E2nodeComponentConfigAddition_ItemIEs_t *e2node_comp_cfg_update_ie;
ric_ran_function_t *func;
unsigned int i;
//DevAssert(ric != NULL);
DevAssert(buffer != NULL && len != NULL);
memset(&pdu,0,sizeof(pdu));
pdu.present = E2AP_E2AP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage.procedureCode = E2AP_ProcedureCode_id_E2setup;
pdu.choice.initiatingMessage.criticality = E2AP_Criticality_reject;
pdu.choice.initiatingMessage.value.present = E2AP_InitiatingMessage__value_PR_E2setupRequest;
req = &pdu.choice.initiatingMessage.value.choice.E2setupRequest;
/* TransactionID*/ //
ie = (E2AP_E2setupRequestIEs_t *)calloc(1,sizeof(*ie));
ie->id = E2AP_ProtocolIE_ID_id_TransactionID;
ie->criticality = E2AP_Criticality_reject;
ie->value.present = E2AP_E2setupRequestIEs__value_PR_TransactionID;
ie->value.choice.TransactionID = 1;
ASN_SEQUENCE_ADD(&req->protocolIEs.list,ie);
/* GlobalE2node_ID */
ie = (E2AP_E2setupRequestIEs_t *)calloc(1,sizeof(*ie));
ie->id = E2AP_ProtocolIE_ID_id_GlobalE2node_ID;
ie->criticality = E2AP_Criticality_reject;
ie->value.present = E2AP_E2setupRequestIEs__value_PR_GlobalE2node_ID;
global_e2_node_id(ranid, &ie->value.choice.GlobalE2node_ID);
ASN_SEQUENCE_ADD(&req->protocolIEs.list,ie);
/* "Optional" RANfunctions_List. */
ie = (E2AP_E2setupRequestIEs_t *)calloc(1,sizeof(*ie));
ie->id = E2AP_ProtocolIE_ID_id_RANfunctionsAdded;
ie->criticality = E2AP_Criticality_reject;
ie->value.present = E2AP_E2setupRequestIEs__value_PR_RANfunctions_List;
for (i = 0; i < ran_functions_len; ++i)
{
func = ran_functions[i];
DevAssert(func != NULL);
ran_function_item_ie = (E2AP_RANfunction_ItemIEs_t *) \
calloc(1,sizeof(*ran_function_item_ie));
ran_function_item_ie->id = E2AP_ProtocolIE_ID_id_RANfunction_Item;
ran_function_item_ie->criticality = E2AP_Criticality_reject;
ran_function_item_ie->value.present = E2AP_RANfunction_ItemIEs__value_PR_RANfunction_Item;
ran_function_item_ie->value.choice.RANfunction_Item.ranFunctionID = func->function_id;
//RIC_AGENT_INFO("RAN Function Def Len:%u\n",func->enc_definition_len);
ran_function_item_ie->value.choice.RANfunction_Item.ranFunctionDefinition.buf = (uint8_t *)malloc(func->enc_definition_len);
memcpy(ran_function_item_ie->value.choice.RANfunction_Item.ranFunctionDefinition.buf,
func->enc_definition,
func->enc_definition_len);
ran_function_item_ie->value.choice.RANfunction_Item.ranFunctionDefinition.size = func->enc_definition_len;
ran_function_item_ie->value.choice.RANfunction_Item.ranFunctionRevision = func->revision;
int oid_len = strlen(func->model->oid);
E2AP_RANfunctionOID_t* oid = (E2AP_RANfunctionOID_t*)calloc(1, sizeof(E2AP_RANfunctionOID_t));
oid->buf = (uint8_t *)calloc(oid_len, sizeof(uint8_t));
memcpy(oid->buf, func->model->oid, oid_len);
oid->size = oid_len;
ran_function_item_ie->value.choice.RANfunction_Item.ranFunctionOID = *oid;
ASN_SEQUENCE_ADD(&ie->value.choice.RANfunctions_List.list,
ran_function_item_ie);
}
ASN_SEQUENCE_ADD(&req->protocolIEs.list,ie);
/*to be re-done during E2AP 2.0.1 integration */
/* E2nodeComponentConfigUpdate_List */
E2AP_E2nodeComponentID_t *e2NodeCompId;
ie = (E2AP_E2setupRequestIEs_t *)calloc(1,sizeof(*ie));
ie->id = E2AP_ProtocolIE_ID_id_E2nodeComponentConfigAddition;
ie->criticality = E2AP_Criticality_reject;
//ie->value.present = E2AP_E2setupRequestIEs__value_PR_NOTHING;
ie->value.present = E2AP_E2setupRequestIEs__value_PR_E2nodeComponentConfigAddition_List;
#if 1
e2node_comp_cfg_update_ie = (E2AP_E2nodeComponentConfigAddition_ItemIEs_t *)calloc(1,sizeof(*e2node_comp_cfg_update_ie));
e2node_comp_cfg_update_ie->id = E2AP_ProtocolIE_ID_id_E2nodeComponentConfigAddition_Item;
e2node_comp_cfg_update_ie->criticality = E2AP_Criticality_reject;
e2node_comp_cfg_update_ie->value.present = E2AP_E2nodeComponentConfigAddition_ItemIEs__value_PR_E2nodeComponentConfigAddition_Item;
e2NodeCompId = &(e2node_comp_cfg_update_ie->value.choice.E2nodeComponentConfigAddition_Item.e2nodeComponentID);
if (1 || e2node_type == E2NODE_TYPE_ENB_CU)
{
e2node_comp_cfg_update_ie->value.choice.E2nodeComponentConfigAddition_Item.e2nodeComponentInterfaceType = E2AP_E2nodeComponentInterfaceType_e1; //E2AP_E2nodeComponentType_ng_eNB_CU
e2NodeCompId->present = E2AP_E2nodeComponentID_PR_e2nodeComponentInterfaceTypeE1;
if (asn_umax2INTEGER(&e2NodeCompId->choice.e2nodeComponentInterfaceTypeE1.gNB_CU_CP_ID, 100) != 0)
RIC_AGENT_ERROR("gNB_CU_UP_ID encoding failed\n");
//e2NodeCompId->choice.e2nodeComponentTypeGNB_CU_UP.gNB_CU_UP_ID.size = strlen("100");//sizeof(uint64_t);
//e2NodeCompId->choice.e2nodeComponentTypeGNB_CU_UP.gNB_CU_UP_ID.buf = (uint8_t *)strdup("100");
}
else if (e2node_type == E2NODE_TYPE_ENB_DU)
{
e2node_comp_cfg_update_ie->value.choice.E2nodeComponentConfigAddition_Item.e2nodeComponentInterfaceType = E2AP_E2nodeComponentInterfaceType_f1; //E2AP_E2nodeComponentType_ng_eNB_DU
e2NodeCompId->present = E2AP_E2nodeComponentID_PR_e2nodeComponentInterfaceTypeF1;
if (asn_umax2INTEGER(&e2NodeCompId->choice.e2nodeComponentInterfaceTypeF1.gNB_DU_ID, 200) != 0)
RIC_AGENT_ERROR("gNB_DU_ID encoding failed\n");
//e2NodeCompId->choice.e2nodeComponentTypeGNB_DU.gNB_DU_ID.size = strlen("200");
//e2NodeCompId->choice.e2nodeComponentTypeGNB_DU.gNB_DU_ID.buf = (uint8_t *)strdup("200");
}
e2node_comp_cfg_update_ie->value.choice.E2nodeComponentConfigAddition_Item.e2nodeComponentConfiguration.e2nodeComponentRequestPart.size = strlen("100");
e2node_comp_cfg_update_ie->value.choice.E2nodeComponentConfigAddition_Item.e2nodeComponentConfiguration.e2nodeComponentRequestPart.buf = (uint8_t *)strdup("100");
e2node_comp_cfg_update_ie->value.choice.E2nodeComponentConfigAddition_Item.e2nodeComponentConfiguration.e2nodeComponentResponsePart.size = strlen("200");
e2node_comp_cfg_update_ie->value.choice.E2nodeComponentConfigAddition_Item.e2nodeComponentConfiguration.e2nodeComponentResponsePart.buf = (uint8_t *)strdup("200");
ASN_SEQUENCE_ADD(&ie->value.choice.E2nodeComponentConfigAddition_List.list,
e2node_comp_cfg_update_ie);
#endif
ASN_SEQUENCE_ADD(&req->protocolIEs.list,ie);
if (e2ap_encode_pdu(&pdu,buffer,len) < 0) {
RIC_AGENT_ERROR("Failed to encode E2setupRequest\n");
return 1;
}
/*
E2AP_E2AP_PDU_t pdud;
memset(&pdud,0,sizeof(pdud));
if (e2ap_decode_pdu(&pdud,*buffer,*len) < 0) {
RIC_AGENT_WARN("Failed to encode E2setupRequest\n");
}
*/
return 0;
}
int e2ap_generate_e2_config_update(ranid_t ranid,
uint8_t **buffer,uint32_t *len,
e2node_type_t e2node_type)
{
E2AP_E2AP_PDU_t pdu;
E2AP_E2nodeConfigurationUpdate_t *req;
E2AP_E2nodeConfigurationUpdate_IEs_t *ie;
E2AP_E2nodeComponentConfigUpdate_ItemIEs_t *updateItemIe;
E2AP_E2nodeComponentConfigUpdate_Item_t *updateItem;
//E2AP_RANfunction_ItemIEs_t *ran_function_item_ie;
//E2AP_E2nodeComponentConfigUpdate_ItemIEs_t *e2node_comp_cfg_update_ie;
//ric_ran_function_t *func;
//unsigned int i;
//DevAssert(ric != NULL);
DevAssert(buffer != NULL && len != NULL);
memset(&pdu,0,sizeof(pdu));
pdu.present = E2AP_E2AP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage.procedureCode = E2AP_ProcedureCode_id_E2nodeConfigurationUpdate;
pdu.choice.initiatingMessage.criticality = E2AP_Criticality_reject;
pdu.choice.initiatingMessage.value.present = E2AP_InitiatingMessage__value_PR_E2nodeConfigurationUpdate;
req = &pdu.choice.initiatingMessage.value.choice.E2nodeConfigurationUpdate;
/* Transaction Id */
ie = (E2AP_E2nodeConfigurationUpdate_IEs_t *)calloc(1,sizeof(*ie));
ie->id = E2AP_ProtocolIE_ID_id_TransactionID;
ie->criticality = E2AP_Criticality_reject;
ie->value.present = E2AP_E2nodeConfigurationUpdate_IEs__value_PR_TransactionID;
ie->value.choice.TransactionID = 1;
ASN_SEQUENCE_ADD(&req->protocolIEs.list,ie);
/* GlobalE2node_ID */
ie = (E2AP_E2nodeConfigurationUpdate_IEs_t *)calloc(1,sizeof(*ie));
ie->id = E2AP_ProtocolIE_ID_id_GlobalE2node_ID;
ie->criticality = E2AP_Criticality_reject;
ie->value.present = E2AP_E2nodeConfigurationUpdate_IEs__value_PR_GlobalE2node_ID;
global_e2_node_id(ranid, &ie->value.choice.GlobalE2node_ID);
ASN_SEQUENCE_ADD(&req->protocolIEs.list,ie);
/* Component Configuration Update List */
ie = (E2AP_E2nodeConfigurationUpdate_IEs_t *)calloc(1,sizeof(*ie));
ie->id = E2AP_ProtocolIE_ID_id_E2nodeComponentConfigUpdate;
ie->criticality = E2AP_Criticality_reject;
ie->value.present = E2AP_E2nodeConfigurationUpdate_IEs__value_PR_E2nodeComponentConfigUpdate_List;
if (e2node_type == E2NODE_TYPE_GNB_CU || e2node_type == E2NODE_TYPE_ENB_CU)
{
/* S1 Interface Component Config */
updateItemIe = (E2AP_E2nodeComponentConfigUpdate_ItemIEs_t *)calloc(1,sizeof(*updateItemIe));
updateItemIe->id = E2AP_ProtocolIE_ID_id_E2nodeComponentConfigUpdate_Item;
updateItemIe->criticality = E2AP_Criticality_reject;
updateItemIe->value.present = E2AP_E2nodeComponentConfigUpdate_ItemIEs__value_PR_E2nodeComponentConfigUpdate_Item;
updateItem = (E2AP_E2nodeComponentConfigUpdate_Item_t *)&updateItemIe->value.choice.E2nodeComponentConfigUpdate_Item;
updateItem->e2nodeComponentInterfaceType = E2AP_E2nodeComponentInterfaceType_s1;
updateItem->e2nodeComponentID.present = E2AP_E2nodeComponentID_PR_e2nodeComponentInterfaceTypeS1;
updateItem->e2nodeComponentID.choice.e2nodeComponentInterfaceTypeS1.mme_name.buf = (uint8_t *)strdup("MME1");
updateItem->e2nodeComponentID.choice.e2nodeComponentInterfaceTypeS1.mme_name.size = strlen("MME1");
updateItem->e2nodeComponentConfiguration.e2nodeComponentRequestPart.size = strlen("100");
updateItem->e2nodeComponentConfiguration.e2nodeComponentRequestPart.buf = (uint8_t *)strdup("100");
updateItem->e2nodeComponentConfiguration.e2nodeComponentResponsePart.size = strlen("200");
updateItem->e2nodeComponentConfiguration.e2nodeComponentResponsePart.buf = (uint8_t *)strdup("200");
ASN_SEQUENCE_ADD(&ie->value.choice.E2nodeComponentConfigUpdate_List.list,updateItemIe);
}
/* E1/F1 Interface Component Config */
updateItemIe = (E2AP_E2nodeComponentConfigUpdate_ItemIEs_t *)calloc(1,sizeof(*updateItemIe));
updateItemIe->id = E2AP_ProtocolIE_ID_id_E2nodeComponentConfigUpdate_Item;
updateItemIe->criticality = E2AP_Criticality_reject;
updateItemIe->value.present = E2AP_E2nodeComponentConfigUpdate_ItemIEs__value_PR_E2nodeComponentConfigUpdate_Item;
updateItem = (E2AP_E2nodeComponentConfigUpdate_Item_t *)&updateItemIe->value.choice.E2nodeComponentConfigUpdate_Item;
if (e2node_type == E2NODE_TYPE_GNB_CU || e2node_type == E2NODE_TYPE_ENB_CU)
{
updateItem->e2nodeComponentInterfaceType = E2AP_E2nodeComponentInterfaceType_e1;
updateItem->e2nodeComponentID.present = E2AP_E2nodeComponentID_PR_e2nodeComponentInterfaceTypeE1;
if (asn_umax2INTEGER(&updateItem->e2nodeComponentID.choice.e2nodeComponentInterfaceTypeE1.gNB_CU_CP_ID, 100) != 0)
RIC_AGENT_ERROR("gNB_CU_UP_ID encoding failed\n");
}
else if (e2node_type == E2NODE_TYPE_ENB_DU)
{
updateItem->e2nodeComponentInterfaceType = E2AP_E2nodeComponentInterfaceType_f1;
updateItem->e2nodeComponentID.present = E2AP_E2nodeComponentID_PR_e2nodeComponentInterfaceTypeF1;
if (asn_umax2INTEGER(&updateItem->e2nodeComponentID.choice.e2nodeComponentInterfaceTypeF1.gNB_DU_ID, 200) != 0)
RIC_AGENT_ERROR("gNB_DU_ID encoding failed\n");
}
updateItem->e2nodeComponentConfiguration.e2nodeComponentRequestPart.size = strlen("100");
updateItem->e2nodeComponentConfiguration.e2nodeComponentRequestPart.buf = (uint8_t *)strdup("100");
updateItem->e2nodeComponentConfiguration.e2nodeComponentResponsePart.size = strlen("200");
updateItem->e2nodeComponentConfiguration.e2nodeComponentResponsePart.buf = (uint8_t *)strdup("200");
ASN_SEQUENCE_ADD(&ie->value.choice.E2nodeComponentConfigUpdate_List.list,updateItemIe);
ASN_SEQUENCE_ADD(&req->protocolIEs.list,ie);
if (e2ap_encode_pdu(&pdu,buffer,len) < 0) {
RIC_AGENT_ERROR("Failed to encode E2ConfigUpdate\n");
return 1;
}
return 0;
}
int e2ap_generate_ric_subscription_response(
ric_agent_info_t *ric,
ric_subscription_t *rs,
uint8_t **buffer,
uint32_t *len)
{
E2AP_E2AP_PDU_t pdu;
E2AP_RICsubscriptionResponse_t *out;
E2AP_RICsubscriptionResponse_IEs_t *ie;
E2AP_RICaction_NotAdmitted_Item_t *nai;
ric_action_t *action;
memset(&pdu, 0, sizeof(pdu));
pdu.present = E2AP_E2AP_PDU_PR_successfulOutcome;
pdu.choice.successfulOutcome.procedureCode = E2AP_ProcedureCode_id_RICsubscription;
pdu.choice.successfulOutcome.criticality = E2AP_Criticality_reject;
pdu.choice.successfulOutcome.value.present = E2AP_SuccessfulOutcome__value_PR_RICsubscriptionResponse;
out = &pdu.choice.successfulOutcome.value.choice.RICsubscriptionResponse;
ie = (E2AP_RICsubscriptionResponse_IEs_t *)calloc(1,sizeof(*ie));
ie->id = E2AP_ProtocolIE_ID_id_RICrequestID;
ie->criticality = E2AP_Criticality_reject;
ie->value.present = E2AP_RICsubscriptionResponse_IEs__value_PR_RICrequestID;
ie->value.choice.RICrequestID.ricRequestorID = rs->request_id;
ie->value.choice.RICrequestID.ricInstanceID = rs->instance_id;
ASN_SEQUENCE_ADD(&out->protocolIEs.list,ie);
ie = (E2AP_RICsubscriptionResponse_IEs_t *)calloc(1,sizeof(*ie));
ie->id = E2AP_ProtocolIE_ID_id_RANfunctionID;
ie->criticality = E2AP_Criticality_reject;
ie->value.present = E2AP_RICsubscriptionResponse_IEs__value_PR_RANfunctionID;
ie->value.choice.RANfunctionID = rs->function_id;
ASN_SEQUENCE_ADD(&out->protocolIEs.list,ie);
ie = (E2AP_RICsubscriptionResponse_IEs_t *)calloc(1,sizeof(*ie));
ie->id = E2AP_ProtocolIE_ID_id_RICactions_Admitted;
ie->criticality = E2AP_Criticality_reject;
ie->value.present = E2AP_RICsubscriptionResponse_IEs__value_PR_RICaction_Admitted_List;
LIST_FOREACH(action, &rs->action_list, actions) {
if (!action->enabled) {
continue;
}
E2AP_RICaction_Admitted_ItemIEs_t* ais = (E2AP_RICaction_Admitted_ItemIEs_t*)calloc(1, sizeof(E2AP_RICaction_Admitted_ItemIEs_t));
ais->id = E2AP_ProtocolIE_ID_id_RICaction_Admitted_Item;
ais->criticality = E2AP_Criticality_reject;
ais->value.present = E2AP_RICaction_Admitted_ItemIEs__value_PR_RICaction_Admitted_Item;
E2AP_RICaction_Admitted_Item_t *ai = &ais->value.choice.RICaction_Admitted_Item;
ai->ricActionID = action->id;
ASN_SEQUENCE_ADD(&ie->value.choice.RICaction_Admitted_List.list,ais);
}
xer_fprint(stdout, &asn_DEF_E2AP_RICsubscriptionResponse_IEs, ie);
ASN_SEQUENCE_ADD(&out->protocolIEs.list,ie);
ie = (E2AP_RICsubscriptionResponse_IEs_t *)calloc(1,sizeof(*ie));
ie->id = E2AP_ProtocolIE_ID_id_RICactions_NotAdmitted;
ie->criticality = E2AP_Criticality_reject;
ie->value.present = E2AP_RICsubscriptionResponse_IEs__value_PR_RICaction_NotAdmitted_List;
LIST_FOREACH(action,&rs->action_list,actions) {
if (action->enabled) {
continue;
}
nai = (E2AP_RICaction_NotAdmitted_Item_t *)calloc(1,sizeof(*nai));
nai->ricActionID = action->id;
nai->cause.present = action->error_cause;
switch (nai->cause.present) {
case E2AP_Cause_PR_NOTHING:
break;
case E2AP_Cause_PR_ricRequest:
nai->cause.choice.ricRequest = action->error_cause_detail;
break;
case E2AP_Cause_PR_ricService:
nai->cause.choice.ricService = action->error_cause_detail;
break;
case E2AP_Cause_PR_transport:
nai->cause.choice.transport = action->error_cause_detail;
break;
case E2AP_Cause_PR_protocol:
nai->cause.choice.protocol = action->error_cause_detail;
break;
case E2AP_Cause_PR_misc:
nai->cause.choice.misc = action->error_cause_detail;
break;
default:
break;
}
ASN_SEQUENCE_ADD(&ie->value.choice.RICaction_NotAdmitted_List.list,nai);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list,ie);
if (e2ap_encode_pdu(&pdu, buffer, len) < 0) {
RIC_AGENT_ERROR("Failed to encode RICsubscriptionResponse\n");
return -1;
}
return 0;
}
int du_e2ap_generate_ric_control_failure(du_ric_agent_info_t *ric,
ric_control_t *rc, uint8_t **buffer,uint32_t *len)
{
E2AP_E2AP_PDU_t pdu;
E2AP_RICcontrolFailure_t *out;
E2AP_RICcontrolFailure_IEs_t *ie;
memset(&pdu, 0, sizeof(pdu));
pdu.present = E2AP_E2AP_PDU_PR_unsuccessfulOutcome;
pdu.choice.unsuccessfulOutcome.procedureCode =
E2AP_ProcedureCode_id_RICcontrol;
pdu.choice.unsuccessfulOutcome.criticality = E2AP_Criticality_reject;
pdu.choice.unsuccessfulOutcome.value.present =
E2AP_UnsuccessfulOutcome__value_PR_RICcontrolFailure;
out = &pdu.choice.unsuccessfulOutcome.value.choice.RICcontrolFailure;
ie = (E2AP_RICcontrolFailure_IEs_t *)calloc(1,sizeof(*ie));
ie->id = E2AP_ProtocolIE_ID_id_RICrequestID;
ie->criticality = E2AP_Criticality_reject;
ie->value.present = E2AP_RICcontrolFailure_IEs__value_PR_RICrequestID;
ie->value.choice.RICrequestID.ricRequestorID = rc->request_id;
ie->value.choice.RICrequestID.ricInstanceID = rc->instance_id;
ASN_SEQUENCE_ADD(&out->protocolIEs.list,ie);
ie = (E2AP_RICcontrolFailure_IEs_t *)calloc(1,sizeof(*ie));
ie->id = E2AP_ProtocolIE_ID_id_RANfunctionID;
ie->criticality = E2AP_Criticality_reject;
ie->value.present = E2AP_RICcontrolFailure_IEs__value_PR_RANfunctionID;
ie->value.choice.RANfunctionID = rc->function_id;
ASN_SEQUENCE_ADD(&out->protocolIEs.list,ie);
ie = (E2AP_RICcontrolFailure_IEs_t *)calloc(1,sizeof(*ie));
ie->id = E2AP_ProtocolIE_ID_id_Cause;
ie->criticality = E2AP_Criticality_ignore;
ie->value.present = E2AP_RICcontrolFailure_IEs__value_PR_Cause;
ie->value.choice.Cause.present = E2AP_Cause_PR_ricRequest;
ie->value.choice.Cause.choice.ricRequest = rc->failure_cause;
ASN_SEQUENCE_ADD(&out->protocolIEs.list,ie);
if (e2ap_encode_pdu(&pdu,buffer,len) < 0) {
RIC_AGENT_ERROR("Failed to encode RICcontrolFailure\n");
return -1;
}
return 0;
}
int du_e2ap_generate_ric_control_acknowledge(du_ric_agent_info_t *ric,
ric_control_t *rc, uint8_t **buffer,uint32_t *len)
{
E2AP_E2AP_PDU_t pdu;
E2AP_RICcontrolAcknowledge_t *out;
E2AP_RICcontrolAcknowledge_IEs_t *ie;
memset(&pdu, 0, sizeof(pdu));
pdu.present = E2AP_E2AP_PDU_PR_successfulOutcome;
pdu.choice.successfulOutcome.procedureCode =
E2AP_ProcedureCode_id_RICcontrol;
pdu.choice.successfulOutcome.criticality = E2AP_Criticality_reject;
pdu.choice.successfulOutcome.value.present =
E2AP_SuccessfulOutcome__value_PR_RICcontrolAcknowledge;
out = &pdu.choice.successfulOutcome.value.choice.RICcontrolAcknowledge;
ie = (E2AP_RICcontrolAcknowledge_IEs_t *)calloc(1,sizeof(*ie));
ie->id = E2AP_ProtocolIE_ID_id_RICrequestID;
ie->criticality = E2AP_Criticality_reject;
ie->value.present = E2AP_RICcontrolAcknowledge_IEs__value_PR_RICrequestID;
ie->value.choice.RICrequestID.ricRequestorID = rc->request_id;
ie->value.choice.RICrequestID.ricInstanceID = rc->instance_id;
ASN_SEQUENCE_ADD(&out->protocolIEs.list,ie);
ie = (E2AP_RICcontrolAcknowledge_IEs_t *)calloc(1,sizeof(*ie));
ie->id = E2AP_ProtocolIE_ID_id_RANfunctionID;
ie->criticality = E2AP_Criticality_reject;
ie->value.present = E2AP_RICcontrolAcknowledge_IEs__value_PR_RANfunctionID;
ie->value.choice.RANfunctionID = rc->function_id;
ASN_SEQUENCE_ADD(&out->protocolIEs.list,ie);
#if 0
ie = (E2AP_RICcontrolAcknowledge_IEs_t *)calloc(1,sizeof(*ie));
ie->id = E2AP_ProtocolIE_ID_id_RICcontrolStatus;
ie->criticality = E2AP_Criticality_ignore;
ie->value.present = E2AP_RICcontrolAcknowledge_IEs__value_PR_RICcontrolOutcome;
ie->value.choice.RICcontrolOutcome = E2AP_RICcontrolStatus_success;
ASN_SEQUENCE_ADD(&out->protocolIEs.list,ie);
#endif
if (e2ap_encode_pdu(&pdu,buffer,len) < 0) {
RIC_AGENT_ERROR("Failed to encode RICcontrolAcknowledge\n");
return -1;
}
return 0;
}
int e2ap_generate_ric_subscription_failure(ric_agent_info_t *ric,
ric_subscription_t *rs, uint8_t **buffer,uint32_t *len)
{
E2AP_E2AP_PDU_t pdu;
E2AP_RICsubscriptionFailure_t *out;
E2AP_RICsubscriptionFailure_IEs_t *ie;
//ric_action_t *action;
memset(&pdu, 0, sizeof(pdu));
pdu.present = E2AP_E2AP_PDU_PR_unsuccessfulOutcome;
pdu.choice.unsuccessfulOutcome.procedureCode
= E2AP_ProcedureCode_id_RICsubscription;
pdu.choice.unsuccessfulOutcome.criticality = E2AP_Criticality_reject;
pdu.choice.unsuccessfulOutcome.value.present
= E2AP_UnsuccessfulOutcome__value_PR_RICsubscriptionFailure;
out = &pdu.choice.unsuccessfulOutcome.value.choice.RICsubscriptionFailure;
ie = (E2AP_RICsubscriptionFailure_IEs_t *)calloc(1,sizeof(*ie));
ie->id = E2AP_ProtocolIE_ID_id_RICrequestID;
ie->criticality = E2AP_Criticality_reject;
ie->value.present = E2AP_RICsubscriptionFailure_IEs__value_PR_RICrequestID;
ie->value.choice.RICrequestID.ricRequestorID = rs->request_id;
ie->value.choice.RICrequestID.ricInstanceID = rs->instance_id;
ASN_SEQUENCE_ADD(&out->protocolIEs.list,ie);
ie = (E2AP_RICsubscriptionFailure_IEs_t *)calloc(1,sizeof(*ie));
ie->id = E2AP_ProtocolIE_ID_id_RANfunctionID;
ie->criticality = E2AP_Criticality_reject;
ie->value.present = E2AP_RICsubscriptionFailure_IEs__value_PR_RANfunctionID;
ie->value.choice.RANfunctionID = rs->function_id;
ASN_SEQUENCE_ADD(&out->protocolIEs.list,ie);
ie = (E2AP_RICsubscriptionFailure_IEs_t *)calloc(1,sizeof(*ie));
ie->id = E2AP_ProtocolIE_ID_id_Cause;
ie->criticality = E2AP_Criticality_reject;
ie->value.present
= E2AP_RICsubscriptionFailure_IEs__value_PR_Cause;
ie->value.choice.Cause.present = E2AP_Cause_PR_misc;
ie->value.choice.Cause.choice.misc = E2AP_CauseMisc_control_processing_overload;
#if 0
LIST_FOREACH(action, &rs->action_list, actions) {
E2AP_RICaction_NotAdmitted_ItemIEs_t* ais
= (E2AP_RICaction_NotAdmitted_ItemIEs_t*)calloc(1,
sizeof(E2AP_RICaction_NotAdmitted_ItemIEs_t));
ais->id = E2AP_ProtocolIE_ID_id_RICaction_NotAdmitted_Item;
ais->criticality = E2AP_Criticality_reject;
ais->value.present
= E2AP_RICaction_NotAdmitted_ItemIEs__value_PR_RICaction_NotAdmitted_Item;
E2AP_RICaction_NotAdmitted_Item_t *ai
= &ais->value.choice.RICaction_NotAdmitted_Item;
ai->ricActionID = action->id;
// TODO
//ai->cause.present = action->error_cause;
ai->cause.present = E2AP_Cause_PR_ricRequest;
switch (ai->cause.present) {
case E2AP_Cause_PR_NOTHING:
break;
case E2AP_Cause_PR_ricRequest:
// TODO
//ai->cause.choice.ricRequest = action->error_cause_detail;
ai->cause.choice.ricRequest
= E2AP_CauseRIC_ran_function_id_Invalid;
break;
case E2AP_Cause_PR_ricService:
ai->cause.choice.ricService = action->error_cause_detail;
break;
case E2AP_Cause_PR_transport:
ai->cause.choice.transport = action->error_cause_detail;
break;
case E2AP_Cause_PR_protocol:
ai->cause.choice.protocol = action->error_cause_detail;
break;
case E2AP_Cause_PR_misc:
ai->cause.choice.misc = action->error_cause_detail;
break;
default:
break;
}
ASN_SEQUENCE_ADD(
&ie->value.choice.RICaction_NotAdmitted_List.list, ais);
}
#endif
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
if (e2ap_encode_pdu(&pdu,buffer,len) < 0) {
RIC_AGENT_ERROR("Failed to encode RICsubscriptionFailure\n");
return -1;
}
return 0;
}
int e2ap_generate_ric_subscription_delete_response(
ric_agent_info_t *ric,
long request_id,
long instance_id,
ric_ran_function_id_t function_id,
uint8_t **buffer,
uint32_t *len)
{
E2AP_E2AP_PDU_t pdu;
E2AP_RICsubscriptionDeleteResponse_t *out;
E2AP_RICsubscriptionDeleteResponse_IEs_t *ie;
memset(&pdu, 0, sizeof(pdu));
pdu.present = E2AP_E2AP_PDU_PR_successfulOutcome;
pdu.choice.successfulOutcome.procedureCode = E2AP_ProcedureCode_id_RICsubscriptionDelete;
pdu.choice.successfulOutcome.criticality = E2AP_Criticality_reject;
pdu.choice.successfulOutcome.value.present = E2AP_SuccessfulOutcome__value_PR_RICsubscriptionDeleteResponse;
out = &pdu.choice.successfulOutcome.value.choice.RICsubscriptionDeleteResponse;
ie = (E2AP_RICsubscriptionDeleteResponse_IEs_t *)calloc(1, sizeof(E2AP_RICsubscriptionDeleteResponse_IEs_t));
ie->id = E2AP_ProtocolIE_ID_id_RICrequestID;
ie->criticality = E2AP_Criticality_reject;
ie->value.present = E2AP_RICsubscriptionDeleteResponse_IEs__value_PR_RICrequestID;
ie->value.choice.RICrequestID.ricRequestorID = request_id;
ie->value.choice.RICrequestID.ricInstanceID = instance_id;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
ie = (E2AP_RICsubscriptionDeleteResponse_IEs_t *)calloc(1,sizeof(*ie));
ie->id = E2AP_ProtocolIE_ID_id_RANfunctionID;
ie->criticality = E2AP_Criticality_reject;
ie->value.present = E2AP_RICsubscriptionDeleteResponse_IEs__value_PR_RANfunctionID;
ie->value.choice.RANfunctionID = function_id;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
if (e2ap_encode_pdu(&pdu, buffer, len) < 0) {
RIC_AGENT_ERROR("Failed to encode RICsubscriptionDeleteResponse\n");
return -1;
}
return 0;
}
int e2ap_generate_ric_subscription_delete_failure(
ric_agent_info_t *ric,long request_id,long instance_id,
ric_ran_function_id_t function_id,long cause,long cause_detail,
uint8_t **buffer,uint32_t *len)
{
E2AP_E2AP_PDU_t pdu;
E2AP_RICsubscriptionDeleteFailure_t *out;
E2AP_RICsubscriptionDeleteFailure_IEs_t *ie;
memset(&pdu, 0, sizeof(pdu));
pdu.present = E2AP_E2AP_PDU_PR_unsuccessfulOutcome;
pdu.choice.unsuccessfulOutcome.procedureCode = E2AP_ProcedureCode_id_RICsubscription;
pdu.choice.unsuccessfulOutcome.criticality = E2AP_Criticality_reject;
pdu.choice.unsuccessfulOutcome.value.present = E2AP_UnsuccessfulOutcome__value_PR_RICsubscriptionDeleteFailure;
out = &pdu.choice.unsuccessfulOutcome.value.choice.RICsubscriptionDeleteFailure;
ie = (E2AP_RICsubscriptionDeleteFailure_IEs_t *)calloc(1,sizeof(*ie));
ie->id = E2AP_ProtocolIE_ID_id_RICrequestID;
ie->criticality = E2AP_Criticality_reject;
ie->value.present = E2AP_RICsubscriptionDeleteFailure_IEs__value_PR_RICrequestID;
ie->value.choice.RICrequestID.ricRequestorID = request_id;
ie->value.choice.RICrequestID.ricInstanceID = instance_id;
ASN_SEQUENCE_ADD(&out->protocolIEs.list,ie);
ie = (E2AP_RICsubscriptionDeleteFailure_IEs_t *)calloc(1,sizeof(*ie));
ie->id = E2AP_ProtocolIE_ID_id_RANfunctionID;
ie->criticality = E2AP_Criticality_reject;
ie->value.present = E2AP_RICsubscriptionDeleteFailure_IEs__value_PR_RANfunctionID;
ie->value.choice.RANfunctionID = function_id;
ASN_SEQUENCE_ADD(&out->protocolIEs.list,ie);
ie = (E2AP_RICsubscriptionDeleteFailure_IEs_t *)calloc(1,sizeof(*ie));
ie->id = E2AP_ProtocolIE_ID_id_RICactions_NotAdmitted;
ie->criticality = E2AP_Criticality_reject;
ie->value.present = E2AP_RICsubscriptionDeleteFailure_IEs__value_PR_Cause;
ie->value.choice.Cause.present = cause;
switch (cause) {
case E2AP_Cause_PR_NOTHING:
break;
case E2AP_Cause_PR_ricRequest:
ie->value.choice.Cause.choice.ricRequest = cause_detail;
break;
case E2AP_Cause_PR_ricService:
ie->value.choice.Cause.choice.ricService = cause_detail;
break;
case E2AP_Cause_PR_transport:
ie->value.choice.Cause.choice.transport = cause_detail;
break;
case E2AP_Cause_PR_protocol:
ie->value.choice.Cause.choice.protocol = cause_detail;
break;
case E2AP_Cause_PR_misc:
ie->value.choice.Cause.choice.misc = cause_detail;
break;
default:
break;
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list,ie);
if (e2ap_encode_pdu(&pdu,buffer,len) < 0) {
RIC_AGENT_ERROR("Failed to encode RICsubscriptionDeleteFailure\n");
return -1;
}
return 0;
}
int e2ap_generate_ric_service_update(ric_agent_info_t *ric,
uint8_t **buffer,uint32_t *len)
{
E2AP_E2AP_PDU_t pdu;
E2AP_RICserviceUpdate_t *out;
E2AP_RICserviceUpdate_IEs_t *ie;
/*
* NB: we never add, modify, or remove ran functions, so this is a noop.
*/
memset(&pdu, 0, sizeof(pdu));
pdu.present = E2AP_E2AP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage.procedureCode = E2AP_ProcedureCode_id_RICserviceUpdate;
pdu.choice.initiatingMessage.criticality = E2AP_Criticality_reject;
pdu.choice.initiatingMessage.value.present = E2AP_InitiatingMessage__value_PR_RICserviceUpdate;
out = &pdu.choice.initiatingMessage.value.choice.RICserviceUpdate;
ie = (E2AP_RICserviceUpdate_IEs_t *)calloc(1,sizeof(*ie));
ie->id = E2AP_ProtocolIE_ID_id_RANfunctionsAdded;
ie->criticality = E2AP_Criticality_reject;
ie->value.present = E2AP_RICserviceUpdate_IEs__value_PR_RANfunctions_List;
ASN_SEQUENCE_ADD(&out->protocolIEs.list,ie);
ie = (E2AP_RICserviceUpdate_IEs_t *)calloc(1,sizeof(*ie));
ie->id = E2AP_ProtocolIE_ID_id_RANfunctionsModified;
ie->criticality = E2AP_Criticality_reject;
ie->value.present = E2AP_RICserviceUpdate_IEs__value_PR_RANfunctions_List_1;
ASN_SEQUENCE_ADD(&out->protocolIEs.list,ie);
ie = (E2AP_RICserviceUpdate_IEs_t *)calloc(1,sizeof(*ie));
ie->id = E2AP_ProtocolIE_ID_id_RANfunctionsDeleted;
ie->criticality = E2AP_Criticality_reject;
ie->value.present = E2AP_RICserviceUpdate_IEs__value_PR_RANfunctionsID_List;
ASN_SEQUENCE_ADD(&out->protocolIEs.list,ie);
if (e2ap_encode_pdu(&pdu,buffer,len) < 0) {
RIC_AGENT_ERROR("Failed to encode RICserviceUpdate\n");
return -1;
}
return 0;
}
int e2ap_generate_reset_response(ric_agent_info_t *ric,
uint8_t **buffer,uint32_t *len)
{
E2AP_E2AP_PDU_t pdu;
memset(&pdu, 0, sizeof(pdu));
pdu.present = E2AP_E2AP_PDU_PR_successfulOutcome;
pdu.choice.successfulOutcome.procedureCode = E2AP_ProcedureCode_id_Reset;
pdu.choice.successfulOutcome.criticality = E2AP_Criticality_reject;
pdu.choice.successfulOutcome.value.present = E2AP_SuccessfulOutcome__value_PR_ResetResponse;
if (e2ap_encode_pdu(&pdu,buffer,len) < 0) {
RIC_AGENT_ERROR("Failed to encode ResetResponse\n");
return -1;
}
return 0;
}
int global_e2_node_id(ranid_t ranid, E2AP_GlobalE2node_ID_t* node_id) {
e2node_type_t node_type;
node_type = e2_conf[ranid]->e2node_type;
if ( 1 || (node_type == E2NODE_TYPE_ENB_CU) || (node_type == E2NODE_TYPE_ENB_DU) ) // TODO RIC: remove 1 ||
{
node_id->present = E2AP_GlobalE2node_ID_PR_eNB;
MCC_MNC_TO_PLMNID(
e2_conf[ranid]->mcc,
e2_conf[ranid]->mnc,
e2_conf[ranid]->mnc_digit_length,
&node_id->choice.eNB.global_eNB_ID.pLMN_Identity);
node_id->choice.eNB.global_eNB_ID.eNB_ID.present = E2AP_ENB_ID_PR_macro_eNB_ID;
MACRO_ENB_ID_TO_BIT_STRING(
e2_conf[ranid]->cell_identity,
&node_id->choice.eNB.global_eNB_ID.eNB_ID.choice.macro_eNB_ID);
RIC_AGENT_INFO("plmn %d\n",node_id->choice.eNB.global_eNB_ID.pLMN_Identity.buf[0]);
}
else if (node_type == E2NODE_TYPE_GNB_CU){
node_id->present = E2AP_GlobalE2node_ID_PR_gNB;
MCC_MNC_TO_PLMNID(
e2_conf[ranid]->mcc,
e2_conf[ranid]->mnc,
e2_conf[ranid]->mnc_digit_length,
&node_id->choice.gNB.global_gNB_ID.plmn_id);
node_id->choice.gNB.global_gNB_ID.gnb_id.present = E2AP_GNB_ID_Choice_PR_gnb_ID;
/* XXX: GNB version? */
MACRO_ENB_ID_TO_BIT_STRING(
e2_conf[ranid]->cell_identity,
&node_id->choice.gNB.global_gNB_ID.gnb_id.choice.gnb_ID);
}
#if 0
else if (node_type == E2NODE_TYPE_NG_ENB) {
node_id->present = E2AP_GlobalE2node_ID_PR_ng_eNB;
MCC_MNC_TO_PLMNID(
e2_conf[ranid]->mcc,
e2_conf[ranid]->mnc,
e2_conf[ranid]->mnc_digit_length,
&node_id->choice.ng_eNB.global_ng_eNB_ID.plmn_id);
node_id->choice.ng_eNB.global_ng_eNB_ID.enb_id.present
= E2AP_ENB_ID_Choice_PR_enb_ID_macro;
MACRO_ENB_ID_TO_BIT_STRING(
e2_conf[ranid]->cell_identity,
&node_id->choice.ng_eNB.global_ng_eNB_ID.enb_id.choice.enb_ID_macro);
} else if (node_type == E2NODE_TYPE_GNB) {
node_id->present = E2AP_GlobalE2node_ID_PR_gNB;
MCC_MNC_TO_PLMNID(
e2_conf[ranid]->mcc,
e2_conf[ranid]->mnc,
e2_conf[ranid]->mnc_digit_length,
&node_id->choice.gNB.global_gNB_ID.plmn_id);
node_id->choice.gNB.global_gNB_ID.gnb_id.present = E2AP_GNB_ID_Choice_PR_gnb_ID;
/* XXX: GNB version? */
MACRO_ENB_ID_TO_BIT_STRING(
e2_conf[ranid]->cell_identity,
&node_id->choice.gNB.global_gNB_ID.gnb_id.choice.gnb_ID);
} else {
RIC_AGENT_ERROR("unsupported eNB/gNB ngran_node_t %d; aborting!\n", node_type);
exit(1);
}
#endif
return 0;
}
void generate_e2apv1_indication_request_parameterized(E2AP_E2AP_PDU_t *e2ap_pdu,
long requestorId, long instanceId, long ranFunctionId, long actionId,
long seqNum, uint8_t *ind_header_buf, int header_length,
uint8_t *ind_message_buf, int message_length)
{
e2ap_pdu->present = E2AP_E2AP_PDU_PR_initiatingMessage;
E2AP_InitiatingMessage_t* initmsg = &e2ap_pdu->choice.initiatingMessage;
initmsg->procedureCode = E2AP_ProcedureCode_id_RICindication;
initmsg->criticality = E2AP_Criticality_ignore;
initmsg->value.present = E2AP_InitiatingMessage__value_PR_RICindication;
/*
* Encode RICrequestID IE
*/
E2AP_RICindication_IEs_t *ricrequestid_ie = (E2AP_RICindication_IEs_t*)calloc(1, sizeof(E2AP_RICindication_IEs_t));
ricrequestid_ie->id = E2AP_ProtocolIE_ID_id_RICrequestID;
ricrequestid_ie->criticality = 0;
ricrequestid_ie->value.present = E2AP_RICsubscriptionRequest_IEs__value_PR_RICrequestID;
ricrequestid_ie->value.choice.RICrequestID.ricRequestorID = requestorId;
ricrequestid_ie->value.choice.RICrequestID.ricInstanceID = instanceId;
ASN_SEQUENCE_ADD(&initmsg->value.choice.RICindication.protocolIEs.list, ricrequestid_ie);
/*
* Encode RANfunctionID IE
*/
E2AP_RICindication_IEs_t *ricind_ies2 = (E2AP_RICindication_IEs_t*)calloc(1, sizeof(E2AP_RICindication_IEs_t));
ricind_ies2->id = E2AP_ProtocolIE_ID_id_RANfunctionID;
ricind_ies2->criticality = 0;
ricind_ies2->value.present = E2AP_RICindication_IEs__value_PR_RANfunctionID;
ricind_ies2->value.choice.RANfunctionID = ranFunctionId;
ASN_SEQUENCE_ADD(&initmsg->value.choice.RICindication.protocolIEs.list, ricind_ies2);
/*
* Encode RICactionID IE
*/
E2AP_RICindication_IEs_t *ricind_ies3 = (E2AP_RICindication_IEs_t*)calloc(1, sizeof(E2AP_RICindication_IEs_t));
ricind_ies3->id = E2AP_ProtocolIE_ID_id_RICactionID;
ricind_ies3->criticality = 0;
ricind_ies3->value.present = E2AP_RICindication_IEs__value_PR_RICactionID;
ricind_ies3->value.choice.RICactionID = actionId;
ASN_SEQUENCE_ADD(&initmsg->value.choice.RICindication.protocolIEs.list, ricind_ies3);
/*
* Encode RICindicationSN IE
*/
E2AP_RICindication_IEs_t *ricind_ies4 = (E2AP_RICindication_IEs_t*)calloc(1, sizeof(E2AP_RICindication_IEs_t));
ricind_ies4->id = E2AP_ProtocolIE_ID_id_RICindicationSN;
ricind_ies4->criticality = 0;
ricind_ies4->value.present = E2AP_RICindication_IEs__value_PR_RICindicationSN;
ricind_ies4->value.choice.RICindicationSN = seqNum;
ASN_SEQUENCE_ADD(&initmsg->value.choice.RICindication.protocolIEs.list, ricind_ies4);
/*
* Encode RICindicationType IE
*/
E2AP_RICindication_IEs_t *ricind_ies5 = (E2AP_RICindication_IEs_t*)calloc(1, sizeof(E2AP_RICindication_IEs_t));
ricind_ies5->id = E2AP_ProtocolIE_ID_id_RICindicationType;
ricind_ies5->criticality = 0;
ricind_ies5->value.present = E2AP_RICindication_IEs__value_PR_RICindicationType;
ricind_ies5->value.choice.RICindicationType = E2AP_RICindicationType_report;
ASN_SEQUENCE_ADD(&initmsg->value.choice.RICindication.protocolIEs.list, ricind_ies5);
#if 0
//uint8_t *buf2 = (uint8_t *)"reportheader";
OCTET_STRING_t *hdr_str = (OCTET_STRING_t*)calloc(1,sizeof(OCTET_STRING_t));
hdr_str->buf = (uint8_t*)calloc(1,header_length);
hdr_str->size = header_length;
memcpy(hdr_str->buf, ind_header_buf, header_length);
#endif
/*
* Encode RICindicationHeader IE
*/
E2AP_RICindication_IEs_t *ricind_ies6 = (E2AP_RICindication_IEs_t*)calloc(1, sizeof(E2AP_RICindication_IEs_t));
ricind_ies6->id = E2AP_ProtocolIE_ID_id_RICindicationHeader;
ricind_ies6->criticality = 0;
ricind_ies6->value.present = E2AP_RICindication_IEs__value_PR_RICindicationHeader;
ricind_ies6->value.choice.RICindicationHeader.buf = (uint8_t*)calloc(1, header_length);
ricind_ies6->value.choice.RICindicationHeader.size = header_length;
memcpy(ricind_ies6->value.choice.RICindicationHeader.buf, ind_header_buf, header_length);
ASN_SEQUENCE_ADD(&initmsg->value.choice.RICindication.protocolIEs.list, ricind_ies6);
/*
* Encode RICindicationMessage IE
*/
E2AP_RICindication_IEs_t *ricind_ies7 = (E2AP_RICindication_IEs_t*)calloc(1, sizeof(E2AP_RICindication_IEs_t));
ricind_ies7->id = E2AP_ProtocolIE_ID_id_RICindicationMessage;
ricind_ies7->criticality = 0;
ricind_ies7->value.present = E2AP_RICindication_IEs__value_PR_RICindicationMessage;
ricind_ies7->value.choice.RICindicationMessage.buf = (uint8_t*)calloc(1, 8192);
memcpy(ricind_ies7->value.choice.RICindicationMessage.buf, ind_message_buf, message_length);
ricind_ies7->value.choice.RICindicationMessage.size = message_length;
ASN_SEQUENCE_ADD(&initmsg->value.choice.RICindication.protocolIEs.list, ricind_ies7);
char *error_buf = (char*)calloc(300, sizeof(char));
size_t errlen;
asn_check_constraints(&asn_DEF_E2AP_E2AP_PDU, e2ap_pdu, error_buf, &errlen);
//printf(" E2AP PDU error length %zu\n", errlen);
//printf("E2AP PDU error buf %s\n", error_buf);
free(error_buf);
//xer_fprint(stderr, &asn_DEF_E2AP_E2AP_PDU, e2ap_pdu);
}
int e2ap_asn1c_encode_pdu(E2AP_E2AP_PDU_t* pdu, unsigned char **buffer)
{
int len;
*buffer = NULL;
assert(pdu != NULL);
assert(buffer != NULL);
len = aper_encode_to_new_buffer(&asn_DEF_E2AP_E2AP_PDU, 0, pdu, (void **)buffer);
if (len < 0) {
RIC_AGENT_ERROR("Unable to aper encode");
exit(1);
}
else {
RIC_AGENT_INFO("Encoded succesfully, encoded size = %d\n", len);
}
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_E2AP_E2AP_PDU, pdu);
return len;
}

View File

@@ -0,0 +1,66 @@
/*
* SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* 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 _E2AP_GENERATE_MESSAGES_H
#define _E2AP_GENERATE_MESSAGES_H
#include "ric_agent.h"
#include "E2AP_E2AP-PDU.h"
extern int e2ap_generate_e2_setup_request(ranid_t ranid,
uint8_t **buffer,uint32_t *len, e2node_type_t e2node_type);
int e2ap_generate_ric_subscription_response(ric_agent_info_t *ric,
ric_subscription_t *rs,
uint8_t **buffer,uint32_t *len);
int e2ap_generate_ric_subscription_failure(ric_agent_info_t *ric,
ric_subscription_t *rs,
uint8_t **buffer,uint32_t *len);
int e2ap_generate_ric_subscription_delete_response(
ric_agent_info_t *ric,long request_id,long instance_id,
ric_ran_function_id_t function_id,uint8_t **buffer,uint32_t *len);
int e2ap_generate_ric_subscription_delete_failure(
ric_agent_info_t *ric,long request_id,long instance_id,
ric_ran_function_id_t function_id,long cause,long cause_detail,
uint8_t **buffer,uint32_t *len);
int e2ap_generate_ric_service_update(ric_agent_info_t *ric,
uint8_t **buffer,uint32_t *len);
int e2ap_generate_reset_response(ric_agent_info_t *ric,
uint8_t **buffer,uint32_t *len);
int du_e2ap_generate_ric_control_failure(du_ric_agent_info_t *ric,
ric_control_t *rc, uint8_t **buffer,uint32_t *len);
int du_e2ap_generate_ric_control_acknowledge(du_ric_agent_info_t *ric,
ric_control_t *rc, uint8_t **buffer,uint32_t *len);
void generate_e2apv1_indication_request_parameterized(E2AP_E2AP_PDU_t *e2ap_pdu, long requestorId, long instanceId, long ranFunctionId, long actionId, long seqNum, uint8_t *ind_header_buf, int header_length, uint8_t *ind_message_buf, int message_length);
int e2ap_asn1c_encode_pdu(E2AP_E2AP_PDU_t* pdu, unsigned char **buffer);
extern int e2ap_generate_e2_config_update(ranid_t ranid,
uint8_t **buffer,uint32_t *len,
e2node_type_t e2node_type);
#endif /* _E2AP_GENERATE_MESSAGES_H */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,72 @@
/*
* SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* 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 _E2AP_HANDLER_H
#define _E2AP_HANDLER_H
#include <stdint.h>
extern int e2ap_handle_message(
ric_agent_info_t *ric,
int32_t stream,
const uint8_t * const buf,
const uint32_t buflen,
uint8_t **outbuf,
uint32_t *outlen,
uint32_t *assoc_id);
extern int e2ap_handle_timer_expiry(
ric_agent_info_t *ric,
long timer_id,
void* arg,
uint8_t **outbuf,
uint32_t *outlen);
extern int e2ap_handle_gp_timer_expiry(
ric_agent_info_t *ric,
long timer_id,
void* arg,
uint8_t **outbuf,
uint32_t *outlen);
extern int du_e2ap_handle_message(
du_ric_agent_info_t *ric,
int32_t stream,
const uint8_t * const buf,
const uint32_t buflen,
uint8_t **outbuf,
uint32_t *outlen,
uint32_t *du_assoc_id);
extern void du_e2ap_prepare_ric_control_response(
du_ric_agent_info_t *ric,
//apiMsg *sliceResp,
uint8_t **outbuf,
uint32_t *outlen,
uint32_t *du_assoc_id);
#endif /* _E2AP_ENB_HANDLER_H */

View File

@@ -0,0 +1,424 @@
-- **************************************************************
-- E2SM-KPM
-- Information Element Definitions
--
-- **************************************************************
E2SM-KPM-IEs {
iso(1) identified-organization(3) dod(6) internet(1) private(4) enterprise(1) 53148 e2(1) version1 (1) e2sm(2) e2sm-KPMMON-IEs (2)}
DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
-- **************************************************************
-- IEs
-- **************************************************************
-- **************************************************************
GlobalKPMnode-ID ::= CHOICE{
gNB GlobalKPMnode-gNB-ID,
en-gNB GlobalKPMnode-en-gNB-ID,
ng-eNB GlobalKPMnode-ng-eNB-ID,
eNB GlobalKPMnode-eNB-ID,
...
}
-- **************************************************************
GlobalKPMnode-gNB-ID ::= SEQUENCE{
global-gNB-ID GlobalgNB-ID,
gNB-CU-UP-ID GNB-CU-UP-ID OPTIONAL,
gNB-DU-ID GNB-DU-ID OPTIONAL,
...
}
GlobalgNB-ID ::= SEQUENCE {
plmn-id PLMN-Identity,
gnb-id GNB-ID-Choice,
...
}
GNB-CU-UP-ID ::= INTEGER (0..68719476735)
GNB-DU-ID ::= INTEGER (0..68719476735)
GNB-ID-Choice ::= CHOICE {
gnb-ID BIT STRING (SIZE(22..32)),
...
}
-- **************************************************************
GlobalKPMnode-en-gNB-ID ::= SEQUENCE{
global-gNB-ID GlobalenGNB-ID,
...
}
GlobalenGNB-ID ::= SEQUENCE {
pLMN-Identity PLMN-Identity,
gNB-ID ENGNB-ID,
...
}
ENGNB-ID ::= CHOICE {
gNB-ID BIT STRING (SIZE (22..32)),
...
}
-- **************************************************************
GlobalKPMnode-ng-eNB-ID ::= SEQUENCE{
global-ng-eNB-ID GlobalngeNB-ID,
...
}
GlobalngeNB-ID ::= SEQUENCE {
plmn-id PLMN-Identity,
enb-id ENB-ID-Choice,
...
}
ENB-ID-Choice ::= CHOICE {
enb-ID-macro BIT STRING (SIZE(20)),
enb-ID-shortmacro BIT STRING (SIZE(18)),
enb-ID-longmacro BIT STRING (SIZE(21)),
...
}
-- **************************************************************
GlobalKPMnode-eNB-ID ::= SEQUENCE{
global-eNB-ID GlobalENB-ID,
...
}
GlobalENB-ID ::= SEQUENCE {
pLMN-Identity PLMN-Identity,
eNB-ID ENB-ID,
...
}
ENB-ID ::= CHOICE {
macro-eNB-ID BIT STRING (SIZE (20)),
home-eNB-ID BIT STRING (SIZE (28)),
... ,
short-Macro-eNB-ID BIT STRING (SIZE(18)),
long-Macro-eNB-ID BIT STRING (SIZE(21))
}
NRCGI ::= SEQUENCE {
pLMN-Identity PLMN-Identity,
nRCellIdentity NRCellIdentity
}
PLMN-Identity ::= OCTET STRING (SIZE(3))
NRCellIdentity ::= BIT STRING (SIZE(36))
SNSSAI ::= SEQUENCE {
sST OCTET STRING (SIZE(1)),
sD OCTET STRING (SIZE(3)) OPTIONAL
}
-- **************************************************************
--
-- Lists
--
-- **************************************************************
maxofMessageProtocolTests INTEGER ::= 15
maxofRICstyles INTEGER ::= 63
maxnoofQCI INTEGER ::= 256
maxnoofQoSFlows INTEGER ::= 64
maxnoofSliceItems INTEGER ::= 1024
maxnoofContainerListItems INTEGER ::= 3
maxCellingNBDU INTEGER ::= 512
maxofContainers INTEGER ::= 8
maxPLMN INTEGER ::= 12 -- Maximum number of PLMNs broadcast and reported by UE at establisghment
RIC-Style-Type ::= INTEGER
RIC-Style-Name ::= PrintableString(SIZE(1..150,...))
RIC-Format-Type ::= INTEGER
-- **************************************************************
-- E2SM-KPM Service model IEs
-- **************************************************************
-- **************************************************************
-- Event Trigger Definition OCTET STRING contents
-- **************************************************************
-- E2SM-KPM-EventTriggerDefinition IE
E2SM-KPM-EventTriggerDefinition ::= CHOICE{
eventDefinition-Format1 E2SM-KPM-EventTriggerDefinition-Format1,
...
}
-- E2SM-KPM-EventTriggerDefinition IE is used for Event Trigger Definition Format 1
E2SM-KPM-EventTriggerDefinition-Format1 ::= SEQUENCE{
policyTest-List SEQUENCE (SIZE(1..maxofMessageProtocolTests)) OF Trigger-ConditionIE-Item OPTIONAL,
...
}
-- **************************************************************
-- Action Definition OCTET STRING contents
-- **************************************************************
-- E2SM-KPM-ActionDefinition IE
E2SM-KPM-ActionDefinition ::= SEQUENCE{
ric-Style-Type RIC-Style-Type,
...
}
-- **************************************************************
-- Indication Header OCTET STRING contents
-- **************************************************************
-- E2SM-KPM-IndicationHeader IE
E2SM-KPM-IndicationHeader ::= CHOICE{
indicationHeader-Format1 E2SM-KPM-IndicationHeader-Format1,
...
}
-- E2SM-KPM-IndicationHeader Format 1
E2SM-KPM-IndicationHeader-Format1 ::= SEQUENCE{
id-GlobalKPMnode-ID GlobalKPMnode-ID OPTIONAL,
nRCGI NRCGI OPTIONAL,
pLMN-Identity PLMN-Identity OPTIONAL,
sliceID SNSSAI OPTIONAL,
fiveQI INTEGER (0..255) OPTIONAL,
qci INTEGER (0..255) OPTIONAL,
...
}
-- **************************************************************
-- Indication Message OCTET STRING contents
-- **************************************************************
-- E2SM-KPM-IndicationMessage IE
E2SM-KPM-IndicationMessage ::= CHOICE{
ric-Style-Type RIC-Style-Type,
indicationMessage-Format1 E2SM-KPM-IndicationMessage-Format1,
...
}
-- E2SM-KPM-IndicationMessage-Format 1 IE
E2SM-KPM-IndicationMessage-Format1 ::= SEQUENCE{
pm-Containers SEQUENCE (SIZE(1..maxCellingNBDU)) OF PM-Containers-List,
...
}
PM-Containers-List ::= SEQUENCE{
performanceContainer PF-Container OPTIONAL,
theRANContainer RAN-Container OPTIONAL,
...
}
-- ***************************************************************
-- RAN Function Description OCTET STRING contents
-- ***************************************************************
-- E2SM-KPM-RANfunction-Description
E2SM-KPM-RANfunction-Description ::= SEQUENCE{
ranFunction-Name RANfunction-Name,
e2SM-KPM-RANfunction-Item SEQUENCE{
ric-EventTriggerStyle-List SEQUENCE (SIZE(1..maxofRICstyles)) OF RIC-EventTriggerStyle-List OPTIONAL,
ric-ReportStyle-List SEQUENCE (SIZE(1..maxofRICstyles)) OF RIC-ReportStyle-List OPTIONAL,
...
},
...
}
-- ***************************************************************
-- commmon IEs
-- ***************************************************************
NI-Type ::= ENUMERATED{
x2-u,
xn-u,
f1-u,
...
}
RAN-Container ::= OCTET STRING
Trigger-ConditionIE-Item ::= SEQUENCE{
report-Period-IE RT-Period-IE,
...
}
RT-Period-IE ::= ENUMERATED{ ms10, ms20, ms32, ms40, ms60, ms64, ms70, ms80, ms128, ms160, ms256, ms320, ms512, ms640, ms1024, ms1280, ms2048, ms2560, ms5120, ms10240, ...}
RANcallProcess-ID-string ::= PrintableString(SIZE(1..150,...))
RANfunction-Name ::= SEQUENCE{
ranFunction-ShortName PrintableString(SIZE(1..150,...)),
ranFunction-E2SM-OID PrintableString(SIZE(1..1000,...)),
ranFunction-Description PrintableString(SIZE(1..150,...)),
ranFunction-Instance INTEGER OPTIONAL,
...
}
RIC-EventTriggerStyle-List ::= SEQUENCE{
ric-EventTriggerStyle-Type RIC-Style-Type,
ric-EventTriggerStyle-Name RIC-Style-Name,
ric-EventTriggerFormat-Type RIC-Format-Type,
...
}
RIC-ReportStyle-List ::= SEQUENCE{
ric-ReportStyle-Type RIC-Style-Type,
ric-ReportStyle-Name RIC-Style-Name,
ric-IndicationHeaderFormat-Type RIC-Format-Type,
ric-IndicationMessageFormat-Type RIC-Format-Type,
...
}
PF-Container ::= CHOICE {
oDU ODU-PF-Container,
oCU-CP OCUCP-PF-Container,
oCU-UP OCUUP-PF-Container
}
GNB-CU-CP-Name ::= PrintableString(SIZE(1..150,...))
GNB-DU-Name ::= PrintableString(SIZE(1..150,...))
GNB-CU-UP-Name ::= PrintableString(SIZE(1..150,...))
-- **************************************************************
-- O-DU Container IEs
-- **************************************************************
ODU-PF-Container ::= SEQUENCE{
cellResourceReportList SEQUENCE (SIZE(1..maxCellingNBDU)) OF CellResourceReportListItem,
...
}
CellResourceReportListItem ::= SEQUENCE{
nRCGI NRCGI,
dl-TotalofAvailablePRBs INTEGER (0..273) OPTIONAL,
ul-TotalofAvailablePRBs INTEGER (0..273) OPTIONAL,
servedPlmnPerCellList SEQUENCE (SIZE(1..maxPLMN)) OF ServedPlmnPerCellListItem,
...
}
ServedPlmnPerCellListItem ::= SEQUENCE{
pLMN-Identity PLMN-Identity,
du-PM-5GC FGC-DU-PM-Container OPTIONAL,
du-PM-EPC EPC-DU-PM-Container OPTIONAL,
...
}
FGC-DU-PM-Container ::= SEQUENCE{
slicePerPlmnPerCellList SEQUENCE (SIZE(1..maxnoofSliceItems)) OF SlicePerPlmnPerCellListItem,
...
}
SlicePerPlmnPerCellListItem ::= SEQUENCE{
sliceID SNSSAI,
fQIPERSlicesPerPlmnPerCellList SEQUENCE (SIZE(1..maxnoofQoSFlows)) OF FQIPERSlicesPerPlmnPerCellListItem,
...
}
FQIPERSlicesPerPlmnPerCellListItem ::= SEQUENCE{
fiveQI INTEGER (0..255),
dl-PRBUsage INTEGER (0..273) OPTIONAL,
ul-PRBUsage INTEGER (0..273) OPTIONAL,
...
}
EPC-DU-PM-Container ::= SEQUENCE{
perQCIReportList SEQUENCE (SIZE(1..maxnoofQCI)) OF PerQCIReportListItem,
...
}
PerQCIReportListItem ::= SEQUENCE{
qci INTEGER (0..255),
dl-PRBUsage INTEGER (0..100) OPTIONAL,
ul-PRBUsage INTEGER (0..100) OPTIONAL,
...
}
-- **************************************************************
-- O-CUCP Container IEs
-- **************************************************************
OCUCP-PF-Container ::= SEQUENCE{
gNB-CU-CP-Name GNB-CU-CP-Name OPTIONAL,
cu-CP-Resource-Status SEQUENCE {
numberOfActive-UEs INTEGER (1..65536, ...) OPTIONAL
}
}
-- **************************************************************
-- O-CU-UP Container IEs
-- **************************************************************
OCUUP-PF-Container ::= SEQUENCE{
gNB-CU-UP-Name GNB-CU-UP-Name OPTIONAL,
pf-ContainerList SEQUENCE (SIZE(1..maxnoofContainerListItems)) OF PF-ContainerListItem,
...
}
PF-ContainerListItem ::= SEQUENCE{
interface-type NI-Type,
o-CU-UP-PM-Container CUUPMeasurement-Container,
...
}
CUUPMeasurement-Container ::= SEQUENCE{
plmnList SEQUENCE (SIZE(1.. maxPLMN)) OF PlmnID-List,
...
}
PlmnID-List ::= SEQUENCE{
pLMN-Identity PLMN-Identity,
cu-UP-PM-5GC FGC-CUUP-PM-Format OPTIONAL,
cu-UP-PM-EPC EPC-CUUP-PM-Format OPTIONAL,
...
}
FGC-CUUP-PM-Format ::= SEQUENCE{
sliceToReportList SEQUENCE (SIZE(1..maxnoofSliceItems)) OF SliceToReportListItem,
...
}
SliceToReportListItem ::= SEQUENCE{
sliceID SNSSAI,
fQIPERSlicesPerPlmnList SEQUENCE (SIZE(1..maxnoofQoSFlows)) OF FQIPERSlicesPerPlmnListItem,
...
}
FQIPERSlicesPerPlmnListItem ::= SEQUENCE{
fiveQI INTEGER (0..255),
pDCPBytesDL INTEGER (0..10000000000,...) OPTIONAL,
pDCPBytesUL INTEGER (0..10000000000,...) OPTIONAL,
...
}
EPC-CUUP-PM-Format ::= SEQUENCE{
perQCIReportList SEQUENCE (SIZE(1..maxnoofQCI)) OF PerQCIReportListItemFormat,
...
}
PerQCIReportListItemFormat ::= SEQUENCE{
qci INTEGER (0..255),
pDCPBytesDL INTEGER (0..10000000000,...) OPTIONAL,
pDCPBytesUL INTEGER (0..10000000000,...) OPTIONAL,
...
}
END

View File

@@ -0,0 +1,371 @@
-- ASN1START
-- **************************************************************
-- E2SM-KPM 2.0.1 Information Element Definitions
-- **************************************************************
E2SM-KPM-IEs {
iso(1) identified-organization(3) dod(6) internet(1) private(4) enterprise(1) oran(53148) e2(1) version2(2) e2sm(2) e2sm-KPMMON-IEs (2)}
DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
-- **************************************************************
-- IEs
-- **************************************************************
PLMN-Identity ::= OCTET STRING (SIZE(3))
EUTRACellIdentity ::= BIT STRING (SIZE(28))
NRCellIdentity ::= BIT STRING (SIZE(36))
EUTRACGI ::= SEQUENCE {
pLMN-Identity PLMN-Identity,
eUTRACellIdentity EUTRACellIdentity,
...
}
NRCGI ::= SEQUENCE {
pLMN-Identity PLMN-Identity,
nRCellIdentity NRCellIdentity,
...
}
CellGlobalID ::= CHOICE {
nr-CGI NRCGI,
eUTRA-CGI EUTRACGI,
...
}
SNSSAI ::= SEQUENCE {
sST OCTET STRING (SIZE(1)),
sD OCTET STRING (SIZE(3)) OPTIONAL,
...
}
FiveQI ::= INTEGER (0.. 255, ...)
QCI ::= INTEGER (0.. 255, ...)
ARP ::= INTEGER (1.. 15, ...)
TimeStamp ::= OCTET STRING (SIZE(4))
-- **************************************************************
CellObjectID ::= PrintableString(SIZE (0.. 400), ...)
GranularityPeriod ::= INTEGER
MeasurementType ::= CHOICE {
measName MeasurementTypeName,
measID MeasurementTypeID,
...
}
MeasurementTypeName ::= PrintableString(SIZE(1.. 150, ...))
MeasurementTypeID ::= INTEGER (1.. 65536, ...)
MeasurementLabel ::= SEQUENCE {
plmnID PLMN-Identity OPTIONAL,
sliceID SNSSAI OPTIONAL,
fiveQI FiveQI OPTIONAL,
qCI QCI OPTIONAL,
qCImax QCI OPTIONAL,
qCImin QCI OPTIONAL,
aRPmax ARP OPTIONAL,
aRPmin ARP OPTIONAL,
bitrateRange INTEGER (1.. 65536, ...) OPTIONAL,
layerMU-MIMO INTEGER (1.. 65536, ...) OPTIONAL,
sUM ENUMERATED {true, ...} OPTIONAL,
distBinX INTEGER (1.. 65536, ...) OPTIONAL,
distBinY INTEGER (1.. 65536, ...) OPTIONAL,
distBinZ INTEGER (1.. 65536, ...) OPTIONAL,
preLabelOverride ENUMERATED {true, ...} OPTIONAL,
startEndInd ENUMERATED {start, end, ...} OPTIONAL,
...
}
SubscriptionID ::= INTEGER (1.. 4294967296, ...)
-- **************************************************************
GlobalKPMnode-ID ::= CHOICE{
gNB GlobalKPMnode-gNB-ID,
en-gNB GlobalKPMnode-en-gNB-ID,
ng-eNB GlobalKPMnode-ng-eNB-ID,
eNB GlobalKPMnode-eNB-ID,
...
}
GlobalKPMnode-gNB-ID ::= SEQUENCE{
global-gNB-ID GlobalgNB-ID,
gNB-CU-UP-ID GNB-CU-UP-ID OPTIONAL,
gNB-DU-ID GNB-DU-ID OPTIONAL,
...
}
GlobalgNB-ID ::= SEQUENCE {
plmn-id PLMN-Identity,
gnb-id GNB-ID-Choice,
...
}
GNB-CU-UP-ID ::= INTEGER (0..68719476735)
GNB-DU-ID ::= INTEGER (0..68719476735)
GNB-ID-Choice ::= CHOICE {
gnb-ID BIT STRING (SIZE(22..32)),
...
}
GlobalKPMnode-en-gNB-ID ::= SEQUENCE{
global-gNB-ID GlobalenGNB-ID,
gNB-CU-UP-ID GNB-CU-UP-ID OPTIONAL,
gNB-DU-ID GNB-DU-ID OPTIONAL,
...
}
GlobalenGNB-ID ::= SEQUENCE {
pLMN-Identity PLMN-Identity,
gNB-ID ENGNB-ID,
...
}
ENGNB-ID ::= CHOICE {
gNB-ID BIT STRING (SIZE (22..32)),
...
}
GlobalKPMnode-ng-eNB-ID ::= SEQUENCE{
global-ng-eNB-ID GlobalngeNB-ID,
gNB-DU-ID GNB-DU-ID OPTIONAL,
...
}
GlobalngeNB-ID ::= SEQUENCE {
plmn-id PLMN-Identity,
enb-id ENB-ID-Choice,
short-Macro-eNB-ID BIT STRING (SIZE(18)),
long-Macro-eNB-ID BIT STRING (SIZE(21)),
...
}
ENB-ID-Choice ::= CHOICE {
enb-ID-macro BIT STRING (SIZE(20)),
enb-ID-shortmacro BIT STRING (SIZE(18)),
enb-ID-longmacro BIT STRING (SIZE(21)),
...
}
GlobalKPMnode-eNB-ID ::= SEQUENCE{
global-eNB-ID GlobalENB-ID,
...
}
GlobalENB-ID ::= SEQUENCE {
pLMN-Identity PLMN-Identity,
eNB-ID ENB-ID,
...
}
ENB-ID ::= CHOICE {
macro-eNB-ID BIT STRING (SIZE (20)),
home-eNB-ID BIT STRING (SIZE (28)),
...
}
-- **************************************************************
RANfunction-Name ::= SEQUENCE{
ranFunction-ShortName PrintableString(SIZE(1..150,...)),
ranFunction-E2SM-OID PrintableString(SIZE(1..1000,...)),
ranFunction-Description PrintableString(SIZE(1..150,...)),
ranFunction-Instance INTEGER OPTIONAL,
...
}
RIC-Style-Type ::= INTEGER
RIC-Style-Name ::= PrintableString(SIZE(1.. 150, ...))
RIC-Format-Type ::= INTEGER
-- **************************************************************
-- Lists
-- **************************************************************
maxnoofKPMNodes INTEGER ::= 1024
maxnoofCells INTEGER ::= 16384
maxnoofRICStyles INTEGER ::= 63
maxnoofMeasurementInfo INTEGER ::= 65536
maxnoofLabelInfo INTEGER ::= 2147483647
maxnoofMeasurementRecord INTEGER ::= 65536
maxnoofMeasurementValue INTEGER ::= 2147483647
MeasurementInfoList ::= SEQUENCE (SIZE(1..maxnoofMeasurementInfo)) OF MeasurementInfoItem
MeasurementInfoItem ::= SEQUENCE {
measType MeasurementType,
labelInfoList LabelInfoList OPTIONAL,
...
}
LabelInfoList ::= SEQUENCE (SIZE(1..maxnoofLabelInfo)) OF LabelInfoItem
LabelInfoItem ::= SEQUENCE {
measLabel MeasurementLabel,
...
}
MeasurementData ::= SEQUENCE (SIZE(1..maxnoofMeasurementRecord)) OF MeasurementRecord
MeasurementRecord ::= SEQUENCE (SIZE(1..maxnoofMeasurementValue)) OF MeasurementRecordItem
MeasurementRecordItem ::= CHOICE {
integer INTEGER,
real REAL,
noValue NULL,
...
}
MeasurementInfo-Action-List ::= SEQUENCE (SIZE(1..maxnoofMeasurementInfo)) OF MeasurementInfo-Action-Item
MeasurementInfo-Action-Item ::= SEQUENCE {
measName MeasurementTypeName,
measID MeasurementTypeID OPTIONAL,
...
}
-- **************************************************************
-- E2SM-KPM Service Model IEs
-- **************************************************************
-- **************************************************************
-- Event Trigger Definition OCTET STRING contents
-- **************************************************************
E2SM-KPM-EventTriggerDefinition ::= SEQUENCE{
eventDefinition-formats CHOICE{
eventDefinition-Format1 E2SM-KPM-EventTriggerDefinition-Format1,
...
},
...
}
E2SM-KPM-EventTriggerDefinition-Format1 ::= SEQUENCE{
reportingPeriod INTEGER,
...
}
-- **************************************************************
-- Action Definition OCTET STRING contents
-- **************************************************************
E2SM-KPM-ActionDefinition ::= SEQUENCE{
ric-Style-Type RIC-Style-Type,
actionDefinition-formats CHOICE{
actionDefinition-Format1 E2SM-KPM-ActionDefinition-Format1,
...
},
...
}
E2SM-KPM-ActionDefinition-Format1 ::= SEQUENCE {
cellObjID CellObjectID,
measInfoList MeasurementInfoList,
granulPeriod GranularityPeriod,
subscriptID SubscriptionID,
...
}
-- **************************************************************
-- Indication Header OCTET STRING contents
-- **************************************************************
E2SM-KPM-IndicationHeader ::= SEQUENCE{
indicationHeader-formats CHOICE{
indicationHeader-Format1 E2SM-KPM-IndicationHeader-Format1,
...
},
...
}
E2SM-KPM-IndicationHeader-Format1 ::= SEQUENCE{
colletStartTime TimeStamp,
fileFormatversion PrintableString (SIZE (0..15), ...) OPTIONAL,
senderName PrintableString (SIZE (0..400), ...) OPTIONAL,
senderType PrintableString (SIZE (0..8), ...) OPTIONAL,
vendorName PrintableString (SIZE (0..32), ...) OPTIONAL,
kpmNodeID GlobalKPMnode-ID OPTIONAL,
...
}
-- **************************************************************
-- Indication Message OCTET STRING contents
-- **************************************************************
E2SM-KPM-IndicationMessage ::= SEQUENCE{
indicationMessage-formats CHOICE{
indicationMessage-Format1 E2SM-KPM-IndicationMessage-Format1,
...
},
...
}
E2SM-KPM-IndicationMessage-Format1 ::= SEQUENCE {
subscriptID SubscriptionID,
cellObjID CellObjectID OPTIONAL,
granulPeriod GranularityPeriod OPTIONAL,
measInfoList MeasurementInfoList OPTIONAL,
measData MeasurementData,
...
}
-- ***************************************************************
-- RAN Function Definition OCTET STRING contents
-- ***************************************************************
E2SM-KPM-RANfunction-Description ::= SEQUENCE{
ranFunction-Name RANfunction-Name,
ric-KPM-Node-List SEQUENCE (SIZE(1..maxnoofKPMNodes)) OF RIC-KPMNode-Item OPTIONAL,
ric-EventTriggerStyle-List SEQUENCE (SIZE(1..maxnoofRICStyles)) OF RIC-EventTriggerStyle-Item OPTIONAL,
ric-ReportStyle-List SEQUENCE (SIZE(1..maxnoofRICStyles)) OF RIC-ReportStyle-Item OPTIONAL,
...
}
RIC-KPMNode-Item ::= SEQUENCE {
ric-KPMNode-Type GlobalKPMnode-ID,
cell-Measurement-Object-List SEQUENCE (SIZE(1..maxnoofCells)) OF Cell-Measurement-Object-Item OPTIONAL,
...
}
Cell-Measurement-Object-Item ::= SEQUENCE {
cell-object-ID CellObjectID,
cell-global-ID CellGlobalID,
...
}
RIC-EventTriggerStyle-Item ::= SEQUENCE{
ric-EventTriggerStyle-Type RIC-Style-Type,
ric-EventTriggerStyle-Name RIC-Style-Name,
ric-EventTriggerFormat-Type RIC-Format-Type,
...
}
RIC-ReportStyle-Item ::= SEQUENCE{
ric-ReportStyle-Type RIC-Style-Type,
ric-ReportStyle-Name RIC-Style-Name,
ric-ActionFormat-Type RIC-Format-Type,
measInfo-Action-List MeasurementInfo-Action-List,
ric-IndicationHeaderFormat-Type RIC-Format-Type,
ric-IndicationMessageFormat-Type RIC-Format-Type,
...
}
END
-- ASN1STOP

View File

@@ -0,0 +1,479 @@
-- ASN1START
-- ***********************************************************************
-- E2SM-KPM 2.0.2-rm Information Element Definitions from March 10th 2021
-- ***********************************************************************
E2SM-KPM-IEs {
iso(1) identified-organization(3) dod(6) internet(1) private(4) enterprise(1) oran(53148) e2(1) version2(2) e2sm(2) e2sm-KPMMON-IEs (2)}
DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
-- **************************************************************
-- IEs
-- **************************************************************
PLMN-Identity ::= OCTET STRING (SIZE(3))
EUTRACellIdentity ::= BIT STRING (SIZE(28))
NRCellIdentity ::= BIT STRING (SIZE(36))
EUTRACGI ::= SEQUENCE {
pLMN-Identity PLMN-Identity,
eUTRACellIdentity EUTRACellIdentity,
...
}
NRCGI ::= SEQUENCE {
pLMN-Identity PLMN-Identity,
nRCellIdentity NRCellIdentity,
...
}
CellGlobalID ::= CHOICE {
nr-CGI NRCGI,
eUTRA-CGI EUTRACGI,
...
}
SNSSAI ::= SEQUENCE {
sST OCTET STRING (SIZE(1)),
sD OCTET STRING (SIZE(3)) OPTIONAL,
...
}
FiveQI ::= INTEGER (0.. 255, ...)
QCI ::= INTEGER (0.. 255, ...)
QFI ::= INTEGER (0.. 63, ...)
ARP ::= INTEGER (1.. 15, ...)
TimeStamp ::= OCTET STRING (SIZE(4))
UE-Identity ::= OCTET STRING
-- **************************************************************
CellObjectID ::= PrintableString(SIZE (0.. 400), ...)
GranularityPeriod ::= INTEGER
MeasurementType ::= CHOICE {
measName MeasurementTypeName,
measID MeasurementTypeID,
...
}
MeasurementTypeName ::= PrintableString(SIZE(1.. 150, ...))
MeasurementTypeID ::= INTEGER (1.. 65536, ...)
MeasurementLabel ::= SEQUENCE {
plmnID PLMN-Identity OPTIONAL,
sliceID SNSSAI OPTIONAL,
fiveQI FiveQI OPTIONAL,
qFI QFI OPTIONAL,
qCI QCI OPTIONAL,
qCImax QCI OPTIONAL,
qCImin QCI OPTIONAL,
aRPmax ARP OPTIONAL,
aRPmin ARP OPTIONAL,
bitrateRange INTEGER (1.. 65536, ...) OPTIONAL,
layerMU-MIMO INTEGER (1.. 65536, ...) OPTIONAL,
sUM ENUMERATED {true, ...} OPTIONAL,
distBinX INTEGER (1.. 65536, ...) OPTIONAL,
distBinY INTEGER (1.. 65536, ...) OPTIONAL,
distBinZ INTEGER (1.. 65536, ...) OPTIONAL,
preLabelOverride ENUMERATED {true, ...} OPTIONAL,
startEndInd ENUMERATED {start, end, ...} OPTIONAL,
...
}
SubscriptionID ::= INTEGER (1.. 4294967296, ...)
TestCondInfo ::= SEQUENCE{
testType TestCond-Type,
testExpr TestCond-Expression,
testValue TestCond-Value,
...
}
TestCond-Type ::= CHOICE{
gBR ENUMERATED {true, ...},
aMBR ENUMERATED {true, ...},
isStat ENUMERATED {true, ...},
isCatM ENUMERATED {true, ...},
rSRP ENUMERATED {true, ...},
rSRQ ENUMERATED {true, ...},
...
}
TestCond-Expression ::= ENUMERATED {
equal,
greaterthan,
lessthan,
contains,
present,
...
}
TestCond-Value ::= CHOICE{
valueInt INTEGER,
valueEnum INTEGER,
valueBool BOOLEAN,
valueBitS BIT STRING,
valueOctS OCTET STRING,
valuePrtS PrintableString,
...
}
-- **************************************************************
GlobalKPMnode-ID ::= CHOICE{
gNB GlobalKPMnode-gNB-ID,
en-gNB GlobalKPMnode-en-gNB-ID,
ng-eNB GlobalKPMnode-ng-eNB-ID,
eNB GlobalKPMnode-eNB-ID,
...
}
GlobalKPMnode-gNB-ID ::= SEQUENCE{
global-gNB-ID GlobalgNB-ID,
gNB-CU-UP-ID GNB-CU-UP-ID OPTIONAL,
gNB-DU-ID GNB-DU-ID OPTIONAL,
...
}
GlobalgNB-ID ::= SEQUENCE {
plmn-id PLMN-Identity,
gnb-id GNB-ID-Choice,
...
}
GNB-CU-UP-ID ::= INTEGER (0..68719476735)
GNB-DU-ID ::= INTEGER (0..68719476735)
GNB-ID-Choice ::= CHOICE {
gnb-ID BIT STRING (SIZE(22..32)),
...
}
GlobalKPMnode-en-gNB-ID ::= SEQUENCE{
global-gNB-ID GlobalenGNB-ID,
gNB-CU-UP-ID GNB-CU-UP-ID OPTIONAL,
gNB-DU-ID GNB-DU-ID OPTIONAL,
...
}
GlobalenGNB-ID ::= SEQUENCE {
pLMN-Identity PLMN-Identity,
gNB-ID ENGNB-ID,
...
}
ENGNB-ID ::= CHOICE {
gNB-ID BIT STRING (SIZE (22..32)),
...
}
GlobalKPMnode-ng-eNB-ID ::= SEQUENCE{
global-ng-eNB-ID GlobalngeNB-ID,
gNB-DU-ID GNB-DU-ID OPTIONAL,
...
}
GlobalngeNB-ID ::= SEQUENCE {
plmn-id PLMN-Identity,
enb-id ENB-ID-Choice,
short-Macro-eNB-ID BIT STRING (SIZE(18)),
long-Macro-eNB-ID BIT STRING (SIZE(21)),
...
}
ENB-ID-Choice ::= CHOICE {
enb-ID-macro BIT STRING (SIZE(20)),
enb-ID-shortmacro BIT STRING (SIZE(18)),
enb-ID-longmacro BIT STRING (SIZE(21)),
...
}
GlobalKPMnode-eNB-ID ::= SEQUENCE{
global-eNB-ID GlobalENB-ID,
...
}
GlobalENB-ID ::= SEQUENCE {
pLMN-Identity PLMN-Identity,
eNB-ID ENB-ID,
...
}
ENB-ID ::= CHOICE {
macro-eNB-ID BIT STRING (SIZE (20)),
home-eNB-ID BIT STRING (SIZE (28)),
...
}
-- **************************************************************
RANfunction-Name ::= SEQUENCE{
ranFunction-ShortName PrintableString(SIZE(1..150,...)),
ranFunction-E2SM-OID PrintableString(SIZE(1..1000,...)),
ranFunction-Description PrintableString(SIZE(1..150,...)),
ranFunction-Instance INTEGER OPTIONAL,
...
}
RIC-Style-Type ::= INTEGER
RIC-Style-Name ::= PrintableString(SIZE(1.. 150, ...))
RIC-Format-Type ::= INTEGER
-- **************************************************************
-- Lists
-- **************************************************************
maxnoofKPMNodes INTEGER ::= 1024
maxnoofCells INTEGER ::= 16384
maxnoofRICStyles INTEGER ::= 63
maxnoofMeasurementInfo INTEGER ::= 65535
maxnoofLabelInfo INTEGER ::= 2147483647
maxnoofMeasurementRecord INTEGER ::= 65535
maxnoofMeasurementValue INTEGER ::= 2147483647
maxnoofConditionInfo INTEGER ::= 32768
maxnoofUEID INTEGER ::= 65535
MeasurementInfoList ::= SEQUENCE (SIZE(1..maxnoofMeasurementInfo)) OF MeasurementInfoItem
MeasurementInfoItem ::= SEQUENCE {
measType MeasurementType,
labelInfoList LabelInfoList OPTIONAL,
...
}
LabelInfoList ::= SEQUENCE (SIZE(1..maxnoofLabelInfo)) OF LabelInfoItem
LabelInfoItem ::= SEQUENCE {
measLabel MeasurementLabel,
...
}
MeasurementData ::= SEQUENCE (SIZE(1..maxnoofMeasurementRecord)) OF MeasurementDataItem
MeasurementDataItem ::= SEQUENCE {
measRecord MeasurementRecord,
incompleteFlag ENUMERATED {true, ...} OPTIONAL,
...
}
MeasurementRecord ::= SEQUENCE (SIZE(1..maxnoofMeasurementValue)) OF MeasurementRecordItem
MeasurementRecordItem ::= CHOICE {
integer INTEGER,
real REAL,
noValue NULL,
...
}
MeasurementInfo-Action-List ::= SEQUENCE (SIZE(1..maxnoofMeasurementInfo)) OF MeasurementInfo-Action-Item
MeasurementInfo-Action-Item ::= SEQUENCE {
measName MeasurementTypeName,
measID MeasurementTypeID OPTIONAL,
...
}
MeasurementCondList ::= SEQUENCE (SIZE(1..maxnoofMeasurementInfo)) OF MeasurementCondItem
MeasurementCondItem ::= SEQUENCE {
measType MeasurementType,
matchingCond MatchingCondList,
...
}
MeasurementCondUEidList ::= SEQUENCE (SIZE(1..maxnoofMeasurementInfo)) OF MeasurementCondUEidItem
MeasurementCondUEidItem ::= SEQUENCE {
measType MeasurementType,
matchingCond MatchingCondList,
matchingUEidList MatchingUEidList OPTIONAL,
...
}
MatchingCondList ::= SEQUENCE (SIZE(1..maxnoofConditionInfo)) OF MatchingCondItem
MatchingCondItem ::= CHOICE{
measLabel MeasurementLabel,
testCondInfo TestCondInfo,
...
}
MatchingUEidList ::= SEQUENCE (SIZE(1..maxnoofUEID)) OF MatchingUEidItem
MatchingUEidItem ::= SEQUENCE{
ueID UE-Identity,
...
}
-- **************************************************************
-- E2SM-KPM Service Model IEs
-- **************************************************************
-- **************************************************************
-- Event Trigger Definition OCTET STRING contents
-- **************************************************************
E2SM-KPM-EventTriggerDefinition ::= SEQUENCE{
eventDefinition-formats CHOICE{
eventDefinition-Format1 E2SM-KPM-EventTriggerDefinition-Format1,
...
},
...
}
E2SM-KPM-EventTriggerDefinition-Format1 ::= SEQUENCE{
reportingPeriod INTEGER,
...
}
-- **************************************************************
-- Action Definition OCTET STRING contents
-- **************************************************************
E2SM-KPM-ActionDefinition ::= SEQUENCE{
ric-Style-Type RIC-Style-Type,
actionDefinition-formats CHOICE{
actionDefinition-Format1 E2SM-KPM-ActionDefinition-Format1,
actionDefinition-Format2 E2SM-KPM-ActionDefinition-Format2,
actionDefinition-Format3 E2SM-KPM-ActionDefinition-Format3,
...
},
...
}
E2SM-KPM-ActionDefinition-Format1 ::= SEQUENCE {
cellObjID CellObjectID,
measInfoList MeasurementInfoList,
granulPeriod GranularityPeriod,
subscriptID SubscriptionID,
...
}
E2SM-KPM-ActionDefinition-Format2 ::= SEQUENCE {
ueID UE-Identity,
subscriptInfo E2SM-KPM-ActionDefinition-Format1,
...
}
E2SM-KPM-ActionDefinition-Format3 ::= SEQUENCE {
cellObjID CellObjectID,
measCondList MeasurementCondList,
granulPeriod GranularityPeriod,
subscriptID SubscriptionID,
...
}
-- **************************************************************
-- Indication Header OCTET STRING contents
-- **************************************************************
E2SM-KPM-IndicationHeader ::= SEQUENCE{
indicationHeader-formats CHOICE{
indicationHeader-Format1 E2SM-KPM-IndicationHeader-Format1,
...
},
...
}
E2SM-KPM-IndicationHeader-Format1 ::= SEQUENCE{
colletStartTime TimeStamp,
fileFormatversion PrintableString (SIZE (0..15), ...) OPTIONAL,
senderName PrintableString (SIZE (0..400), ...) OPTIONAL,
senderType PrintableString (SIZE (0..8), ...) OPTIONAL,
vendorName PrintableString (SIZE (0..32), ...) OPTIONAL,
kpmNodeID GlobalKPMnode-ID OPTIONAL,
...
}
-- **************************************************************
-- Indication Message OCTET STRING contents
-- **************************************************************
E2SM-KPM-IndicationMessage ::= SEQUENCE{
indicationMessage-formats CHOICE{
indicationMessage-Format1 E2SM-KPM-IndicationMessage-Format1,
indicationMessage-Format2 E2SM-KPM-IndicationMessage-Format2,
...
},
...
}
E2SM-KPM-IndicationMessage-Format1 ::= SEQUENCE {
subscriptID SubscriptionID,
cellObjID CellObjectID OPTIONAL,
granulPeriod GranularityPeriod OPTIONAL,
measInfoList MeasurementInfoList OPTIONAL,
measData MeasurementData,
...
}
E2SM-KPM-IndicationMessage-Format2 ::= SEQUENCE {
subscriptID SubscriptionID,
cellObjID CellObjectID OPTIONAL,
granulPeriod GranularityPeriod OPTIONAL,
measCondUEidList MeasurementCondUEidList,
measData MeasurementData,
...
}
-- ***************************************************************
-- RAN Function Definition OCTET STRING contents
-- ***************************************************************
E2SM-KPM-RANfunction-Description ::= SEQUENCE{
ranFunction-Name RANfunction-Name,
ric-KPM-Node-List SEQUENCE (SIZE(1..maxnoofKPMNodes)) OF RIC-KPMNode-Item OPTIONAL,
ric-EventTriggerStyle-List SEQUENCE (SIZE(1..maxnoofRICStyles)) OF RIC-EventTriggerStyle-Item OPTIONAL,
ric-ReportStyle-List SEQUENCE (SIZE(1..maxnoofRICStyles)) OF RIC-ReportStyle-Item OPTIONAL,
...
}
RIC-KPMNode-Item ::= SEQUENCE {
ric-KPMNode-Type GlobalKPMnode-ID,
cell-Measurement-Object-List SEQUENCE (SIZE(1..maxnoofCells)) OF Cell-Measurement-Object-Item OPTIONAL,
...
}
Cell-Measurement-Object-Item ::= SEQUENCE {
cell-object-ID CellObjectID,
cell-global-ID CellGlobalID,
...
}
RIC-EventTriggerStyle-Item ::= SEQUENCE{
ric-EventTriggerStyle-Type RIC-Style-Type,
ric-EventTriggerStyle-Name RIC-Style-Name,
ric-EventTriggerFormat-Type RIC-Format-Type,
...
}
RIC-ReportStyle-Item ::= SEQUENCE{
ric-ReportStyle-Type RIC-Style-Type,
ric-ReportStyle-Name RIC-Style-Name,
ric-ActionFormat-Type RIC-Format-Type,
measInfo-Action-List MeasurementInfo-Action-List,
ric-IndicationHeaderFormat-Type RIC-Format-Type,
ric-IndicationMessageFormat-Type RIC-Format-Type,
...
}
END
-- ASN1STOP

View File

@@ -0,0 +1,479 @@
-- ASN1START
-- **************************************************************
-- E2SM-KPM Information Element Definitions (Radisys update)
-- **************************************************************
E2SM-KPM-IEs {
iso(1) identified-organization(3) dod(6) internet(1) private(4) enterprise(1) oran(53148) e2(1) version2(2) e2sm(2) e2sm-KPMMON-IEs (2)}
DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
-- **************************************************************
-- IEs
-- **************************************************************
PLMN-Identity-KPMv2 ::= OCTET STRING (SIZE(3))
EUTRACellIdentity-KPMv2 ::= BIT STRING (SIZE(28))
NRCellIdentity-KPMv2 ::= BIT STRING (SIZE(36))
EUTRACGI-KPMv2 ::= SEQUENCE {
pLMN-Identity PLMN-Identity-KPMv2,
eUTRACellIdentity EUTRACellIdentity-KPMv2,
...
}
NRCGI-KPMv2 ::= SEQUENCE {
pLMN-Identity PLMN-Identity-KPMv2,
nRCellIdentity NRCellIdentity-KPMv2,
...
}
CellGlobalID-KPMv2 ::= CHOICE {
nr-CGI NRCGI-KPMv2,
eUTRA-CGI EUTRACGI-KPMv2,
...
}
SNSSAI-KPMv2 ::= SEQUENCE {
sST OCTET STRING (SIZE(1)),
sD OCTET STRING (SIZE(3)) OPTIONAL,
...
}
FiveQI-KPMv2 ::= INTEGER (0.. 255, ...)
QCI-KPMv2 ::= INTEGER (0.. 255, ...)
QFI-KPMv2 ::= INTEGER (0.. 63, ...)
ARP-KPMv2 ::= INTEGER (1.. 15, ...)
TimeStamp-KPMv2 ::= OCTET STRING (SIZE(4))
UE-Identity-KPMv2 ::= OCTET STRING
-- **************************************************************
CellObjectID-KPMv2 ::= PrintableString(SIZE (0.. 400), ...)
GranularityPeriod-KPMv2 ::= INTEGER (1.. 4294967295)
MeasurementType-KPMv2 ::= CHOICE {
measName MeasurementTypeName-KPMv2,
measID MeasurementTypeID-KPMv2,
...
}
MeasurementTypeName-KPMv2 ::= PrintableString(SIZE(1.. 150, ...))
MeasurementTypeID-KPMv2 ::= INTEGER (1.. 65536, ...)
MeasurementLabel-KPMv2 ::= SEQUENCE {
plmnID PLMN-Identity-KPMv2 OPTIONAL,
sliceID SNSSAI-KPMv2 OPTIONAL,
fiveQI FiveQI-KPMv2 OPTIONAL,
qFI QFI-KPMv2 OPTIONAL,
qCI QCI-KPMv2 OPTIONAL,
qCImax QCI-KPMv2 OPTIONAL,
qCImin QCI-KPMv2 OPTIONAL,
aRPmax ARP-KPMv2 OPTIONAL,
aRPmin ARP-KPMv2 OPTIONAL,
bitrateRange INTEGER (1.. 65536, ...) OPTIONAL,
layerMU-MIMO INTEGER (1.. 65536, ...) OPTIONAL,
sUM ENUMERATED {true, ...} OPTIONAL,
distBinX INTEGER (1.. 65536, ...) OPTIONAL,
distBinY INTEGER (1.. 65536, ...) OPTIONAL,
distBinZ INTEGER (1.. 65536, ...) OPTIONAL,
preLabelOverride ENUMERATED {true, ...} OPTIONAL,
startEndInd ENUMERATED {start, end, ...} OPTIONAL,
...
}
SubscriptionID-KPMv2 ::= INTEGER (1.. 4294967295)
TestCondInfo-KPMv2 ::= SEQUENCE{
testType TestCond-Type-KPMv2,
testExpr TestCond-Expression-KPMv2,
testValue TestCond-Value-KPMv2,
...
}
TestCond-Type-KPMv2 ::= CHOICE{
gBR ENUMERATED {true, ...},
aMBR ENUMERATED {true, ...},
isStat ENUMERATED {true, ...},
isCatM ENUMERATED {true, ...},
rSRP ENUMERATED {true, ...},
rSRQ ENUMERATED {true, ...},
...
}
TestCond-Expression-KPMv2 ::= ENUMERATED {
equal,
greaterthan,
lessthan,
contains,
present,
...
}
TestCond-Value-KPMv2 ::= CHOICE{
valueInt INTEGER,
valueEnum INTEGER,
valueBool BOOLEAN,
valueBitS BIT STRING,
valueOctS OCTET STRING,
valuePrtS PrintableString,
...
}
-- **************************************************************
GlobalKPMnode-ID-KPMv2 ::= CHOICE{
gNB GlobalKPMnode-gNB-ID-KPMv2,
en-gNB GlobalKPMnode-en-gNB-ID-KPMv2,
ng-eNB GlobalKPMnode-ng-eNB-ID-KPMv2,
eNB GlobalKPMnode-eNB-ID-KPMv2,
...
}
GlobalKPMnode-gNB-ID-KPMv2 ::= SEQUENCE{
global-gNB-ID GlobalgNB-ID-KPMv2,
gNB-CU-UP-ID GNB-CU-UP-ID-KPMv2 OPTIONAL,
gNB-DU-ID GNB-DU-ID-KPMv2 OPTIONAL,
...
}
GlobalgNB-ID-KPMv2 ::= SEQUENCE {
plmn-id PLMN-Identity-KPMv2,
gnb-id GNB-ID-Choice-KPMv2,
...
}
GNB-CU-UP-ID-KPMv2 ::= INTEGER (0..68719476735)
GNB-DU-ID-KPMv2 ::= INTEGER (0..68719476735)
GNB-ID-Choice-KPMv2 ::= CHOICE {
gnb-ID BIT STRING (SIZE(22..32)),
...
}
GlobalKPMnode-en-gNB-ID-KPMv2 ::= SEQUENCE{
global-gNB-ID GlobalenGNB-ID-KPMv2,
gNB-CU-UP-ID GNB-CU-UP-ID-KPMv2 OPTIONAL,
gNB-DU-ID GNB-DU-ID-KPMv2 OPTIONAL,
...
}
GlobalenGNB-ID-KPMv2 ::= SEQUENCE {
pLMN-Identity PLMN-Identity-KPMv2,
gNB-ID ENGNB-ID-KPMv2,
...
}
ENGNB-ID-KPMv2 ::= CHOICE {
gNB-ID BIT STRING (SIZE (22..32)),
...
}
GlobalKPMnode-ng-eNB-ID-KPMv2 ::= SEQUENCE{
global-ng-eNB-ID GlobalngeNB-ID-KPMv2,
gNB-DU-ID GNB-DU-ID-KPMv2 OPTIONAL,
...
}
GlobalngeNB-ID-KPMv2 ::= SEQUENCE {
plmn-id PLMN-Identity-KPMv2,
enb-id ENB-ID-Choice-KPMv2,
short-Macro-eNB-ID BIT STRING (SIZE(18)),
long-Macro-eNB-ID BIT STRING (SIZE(21)),
...
}
ENB-ID-Choice-KPMv2 ::= CHOICE {
enb-ID-macro BIT STRING (SIZE(20)),
enb-ID-shortmacro BIT STRING (SIZE(18)),
enb-ID-longmacro BIT STRING (SIZE(21)),
...
}
GlobalKPMnode-eNB-ID-KPMv2 ::= SEQUENCE{
global-eNB-ID GlobalENB-ID-KPMv2,
...
}
GlobalENB-ID-KPMv2 ::= SEQUENCE {
pLMN-Identity PLMN-Identity-KPMv2,
eNB-ID ENB-ID-KPMv2,
...
}
ENB-ID-KPMv2 ::= CHOICE {
macro-eNB-ID BIT STRING (SIZE (20)),
home-eNB-ID BIT STRING (SIZE (28)),
...
}
-- **************************************************************
RANfunction-Name-KPMv2 ::= SEQUENCE{
ranFunction-ShortName PrintableString(SIZE(1..150,...)),
ranFunction-E2SM-OID PrintableString(SIZE(1..1000,...)),
ranFunction-Description PrintableString(SIZE(1..150,...)),
ranFunction-Instance INTEGER (0.. 255, ...) OPTIONAL,
...
}
RIC-Style-Type-KPMv2 ::= INTEGER (0.. 255, ...)
RIC-Style-Name-KPMv2 ::= PrintableString(SIZE(1.. 150, ...))
RIC-Format-Type-KPMv2 ::= INTEGER (0.. 255, ...)
-- **************************************************************
-- Lists
-- **************************************************************
maxnoofKPMNodes-KPMv2 INTEGER ::= 1024
maxnoofCells-KPMv2 INTEGER ::= 16384
maxnoofRICStyles-KPMv2 INTEGER ::= 63
maxnoofMeasurementInfo-KPMv2 INTEGER ::= 65535
maxnoofLabelInfo-KPMv2 INTEGER ::= 2147483647
maxnoofMeasurementRecord-KPMv2 INTEGER ::= 65535
maxnoofMeasurementValue-KPMv2 INTEGER ::= 2147483647
maxnoofConditionInfo-KPMv2 INTEGER ::= 32768
maxnoofUEID-KPMv2 INTEGER ::= 65535
MeasurementInfoList-KPMv2 ::= SEQUENCE (SIZE(1..maxnoofMeasurementInfo-KPMv2)) OF MeasurementInfoItem-KPMv2
MeasurementInfoItem-KPMv2 ::= SEQUENCE {
measType MeasurementType-KPMv2,
labelInfoList LabelInfoList-KPMv2 OPTIONAL,
...
}
LabelInfoList-KPMv2 ::= SEQUENCE (SIZE(1..maxnoofLabelInfo-KPMv2)) OF LabelInfoItem-KPMv2
LabelInfoItem-KPMv2 ::= SEQUENCE {
measLabel MeasurementLabel-KPMv2,
...
}
MeasurementData-KPMv2 ::= SEQUENCE (SIZE(1..maxnoofMeasurementRecord-KPMv2)) OF MeasurementDataItem-KPMv2
MeasurementDataItem-KPMv2 ::= SEQUENCE {
measRecord MeasurementRecord-KPMv2,
incompleteFlag ENUMERATED {true, ...} OPTIONAL,
...
}
MeasurementRecord-KPMv2 ::= SEQUENCE (SIZE(1..maxnoofMeasurementValue-KPMv2)) OF MeasurementRecordItem-KPMv2
MeasurementRecordItem-KPMv2 ::= CHOICE {
integer INTEGER (0..4294967295),
real REAL,
noValue NULL,
...
}
MeasurementInfo-Action-List-KPMv2 ::= SEQUENCE (SIZE(1..maxnoofMeasurementInfo-KPMv2)) OF MeasurementInfo-Action-Item-KPMv2
MeasurementInfo-Action-Item-KPMv2 ::= SEQUENCE {
measName MeasurementTypeName-KPMv2,
measID MeasurementTypeID-KPMv2 OPTIONAL,
...
}
MeasurementCondList-KPMv2 ::= SEQUENCE (SIZE(1..maxnoofMeasurementInfo-KPMv2)) OF MeasurementCondItem-KPMv2
MeasurementCondItem-KPMv2 ::= SEQUENCE {
measType MeasurementType-KPMv2,
matchingCond MatchingCondList-KPMv2,
...
}
MeasurementCondUEidList-KPMv2 ::= SEQUENCE (SIZE(1..maxnoofMeasurementInfo-KPMv2)) OF MeasurementCondUEidItem-KPMv2
MeasurementCondUEidItem-KPMv2 ::= SEQUENCE {
measType MeasurementType-KPMv2,
matchingCond MatchingCondList-KPMv2,
matchingUEidList MatchingUEidList-KPMv2 OPTIONAL,
...
}
MatchingCondList-KPMv2 ::= SEQUENCE (SIZE(1..maxnoofConditionInfo-KPMv2)) OF MatchingCondItem-KPMv2
MatchingCondItem-KPMv2 ::= CHOICE{
measLabel MeasurementLabel-KPMv2,
testCondInfo TestCondInfo-KPMv2,
...
}
MatchingUEidList-KPMv2 ::= SEQUENCE (SIZE(1..maxnoofUEID-KPMv2)) OF MatchingUEidItem-KPMv2
MatchingUEidItem-KPMv2 ::= SEQUENCE{
ueID UE-Identity-KPMv2,
...
}
-- **************************************************************
-- E2SM-KPMv2 Service Model IEs
-- **************************************************************
-- **************************************************************
-- Event Trigger Definition OCTET STRING contents
-- **************************************************************
E2SM-KPMv2-EventTriggerDefinition ::= SEQUENCE{
eventDefinition-formats CHOICE{
eventDefinition-Format1 E2SM-KPMv2-EventTriggerDefinition-Format1,
...
},
...
}
E2SM-KPMv2-EventTriggerDefinition-Format1 ::= SEQUENCE{
reportingPeriod INTEGER (1.. 4294967295),
...
}
-- **************************************************************
-- Action Definition OCTET STRING contents
-- **************************************************************
E2SM-KPMv2-ActionDefinition ::= SEQUENCE{
ric-Style-Type RIC-Style-Type-KPMv2,
actionDefinition-formats CHOICE{
actionDefinition-Format1 E2SM-KPMv2-ActionDefinition-Format1,
actionDefinition-Format2 E2SM-KPMv2-ActionDefinition-Format2,
actionDefinition-Format3 E2SM-KPMv2-ActionDefinition-Format3,
...
},
...
}
E2SM-KPMv2-ActionDefinition-Format1 ::= SEQUENCE {
cellObjID CellObjectID-KPMv2,
measInfoList MeasurementInfoList-KPMv2,
granulPeriod GranularityPeriod-KPMv2,
subscriptID SubscriptionID-KPMv2,
...
}
E2SM-KPMv2-ActionDefinition-Format2 ::= SEQUENCE {
ueID UE-Identity-KPMv2,
subscriptInfo E2SM-KPMv2-ActionDefinition-Format1,
...
}
E2SM-KPMv2-ActionDefinition-Format3 ::= SEQUENCE {
cellObjID CellObjectID-KPMv2,
measCondList MeasurementCondList-KPMv2,
granulPeriod GranularityPeriod-KPMv2,
subscriptID SubscriptionID-KPMv2,
...
}
-- **************************************************************
-- Indication Header OCTET STRING contents
-- **************************************************************
E2SM-KPMv2-IndicationHeader ::= SEQUENCE{
indicationHeader-formats CHOICE{
indicationHeader-Format1 E2SM-KPMv2-IndicationHeader-Format1,
...
},
...
}
E2SM-KPMv2-IndicationHeader-Format1 ::= SEQUENCE{
colletStartTime TimeStamp-KPMv2,
fileFormatversion PrintableString (SIZE (0..15), ...) OPTIONAL,
senderName PrintableString (SIZE (0..400), ...) OPTIONAL,
senderType PrintableString (SIZE (0..8), ...) OPTIONAL,
vendorName PrintableString (SIZE (0..32), ...) OPTIONAL,
kpmNodeID GlobalKPMnode-ID-KPMv2 OPTIONAL,
...
}
-- **************************************************************
-- Indication Message OCTET STRING contents
-- **************************************************************
E2SM-KPMv2-IndicationMessage ::= SEQUENCE{
indicationMessage-formats CHOICE{
indicationMessage-Format1 E2SM-KPMv2-IndicationMessage-Format1,
indicationMessage-Format2 E2SM-KPMv2-IndicationMessage-Format2,
...
},
...
}
E2SM-KPMv2-IndicationMessage-Format1 ::= SEQUENCE {
subscriptID SubscriptionID-KPMv2,
cellObjID CellObjectID-KPMv2 OPTIONAL,
granulPeriod GranularityPeriod-KPMv2 OPTIONAL,
measInfoList MeasurementInfoList-KPMv2 OPTIONAL,
measData MeasurementData-KPMv2,
...
}
E2SM-KPMv2-IndicationMessage-Format2 ::= SEQUENCE {
subscriptID SubscriptionID-KPMv2,
cellObjID CellObjectID-KPMv2 OPTIONAL,
granulPeriod GranularityPeriod-KPMv2 OPTIONAL,
measCondUEidList MeasurementCondUEidList-KPMv2,
measData MeasurementData-KPMv2,
...
}
-- ***************************************************************
-- RAN Function Definition OCTET STRING contents
-- ***************************************************************
E2SM-KPMv2-RANfunction-Description ::= SEQUENCE{
ranFunction-Name RANfunction-Name-KPMv2,
ric-KPM-Node-List SEQUENCE (SIZE(1..maxnoofKPMNodes-KPMv2)) OF RIC-KPMNode-Item-KPMv2 OPTIONAL,
ric-EventTriggerStyle-List SEQUENCE (SIZE(1..maxnoofRICStyles-KPMv2)) OF RIC-EventTriggerStyle-Item-KPMv2 OPTIONAL,
ric-ReportStyle-List SEQUENCE (SIZE(1..maxnoofRICStyles-KPMv2)) OF RIC-ReportStyle-Item-KPMv2 OPTIONAL,
...
}
RIC-KPMNode-Item-KPMv2 ::= SEQUENCE {
ric-KPMNode-Type GlobalKPMnode-ID-KPMv2,
cell-Measurement-Object-List SEQUENCE (SIZE(1..maxnoofCells-KPMv2)) OF Cell-Measurement-Object-Item-KPMv2 OPTIONAL,
...
}
Cell-Measurement-Object-Item-KPMv2 ::= SEQUENCE {
cell-object-ID CellObjectID-KPMv2,
cell-global-ID CellGlobalID-KPMv2,
...
}
RIC-EventTriggerStyle-Item-KPMv2 ::= SEQUENCE{
ric-EventTriggerStyle-Type RIC-Style-Type-KPMv2,
ric-EventTriggerStyle-Name RIC-Style-Name-KPMv2,
ric-EventTriggerFormat-Type RIC-Format-Type-KPMv2,
...
}
RIC-ReportStyle-Item-KPMv2 ::= SEQUENCE{
ric-ReportStyle-Type RIC-Style-Type-KPMv2,
ric-ReportStyle-Name RIC-Style-Name-KPMv2,
ric-ActionFormat-Type RIC-Format-Type-KPMv2,
measInfo-Action-List MeasurementInfo-Action-List-KPMv2,
ric-IndicationHeaderFormat-Type RIC-Format-Type-KPMv2,
ric-IndicationMessageFormat-Type RIC-Format-Type-KPMv2,
...
}
END
-- ASN1STOP

View File

@@ -0,0 +1,852 @@
/*
* SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* 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
*/
#include <sys/time.h>
#include <arpa/inet.h>
#include <stdbool.h>
#include <string.h>
#include "common/utils/assertions.h"
#include "f1ap_common.h"
#include "ric_agent.h"
#include "e2ap_encoder.h"
#include "e2sm_kpm.h"
#include "e2ap_generate_messages.h"
//#include "conversions.h"
#include "E2AP_Cause.h"
#include "E2SM_KPM_E2SM-KPMv2-RANfunction-Description.h"
#include "E2SM_KPM_RIC-KPMNode-Item-KPMv2.h"
#include "E2SM_KPM_Cell-Measurement-Object-Item-KPMv2.h"
#include "E2SM_KPM_RIC-EventTriggerStyle-Item-KPMv2.h"
#include "E2SM_KPM_RIC-ReportStyle-Item-KPMv2.h"
#include "E2SM_KPM_MeasurementInfo-Action-Item-KPMv2.h"
#include "E2SM_KPM_E2SM-KPMv2-ActionDefinition-Format1.h"
#include "E2SM_KPM_MeasurementInfoItem-KPMv2.h"
#include "E2SM_KPM_E2SM-KPMv2-ActionDefinition.h"
#include "E2SM_KPM_MeasurementRecord-KPMv2.h"
#include "E2SM_KPM_MeasurementRecordItem-KPMv2.h"
#include "E2SM_KPM_E2SM-KPMv2-IndicationMessage.h"
#include "E2SM_KPM_MeasurementDataItem-KPMv2.h"
#include "E2AP_ProtocolIE-Field.h"
#include "E2SM_KPM_E2SM-KPMv2-IndicationHeader.h"
#include "E2SM_KPM_SNSSAI-KPMv2.h"
#include "E2SM_KPM_GlobalKPMnode-ID-KPMv2.h"
#include "E2SM_KPM_GNB-ID-Choice-KPMv2.h"
#include "E2SM_KPM_NRCGI-KPMv2.h"
extern f1ap_cudu_inst_t f1ap_cu_inst[MAX_eNB];
extern int global_e2_node_id(ranid_t ranid, E2AP_GlobalE2node_ID_t* node_id);
extern RAN_CONTEXT_t RC;
//extern eNB_RRC_KPI_STATS rrc_kpi_stats;
/**
** The main thing with this abstraction is that we need per-SM modules
** to handle the details of the function, event trigger, action, etc
** definitions... and to actually do all the logic and implement the
** inner parts of the message encoding. generic e2ap handles the rest.
**/
static int e2sm_kpm_subscription_add(ric_agent_info_t *ric, ric_subscription_t *sub);
static int e2sm_kpm_subscription_del(ric_agent_info_t *ric, ric_subscription_t *sub, int force,long *cause,long *cause_detail);
static int e2sm_kpm_control(ric_agent_info_t *ric,ric_control_t *control);
static char *time_stamp(void);
static int e2sm_kpm_ricInd_timer_expiry(
ric_agent_info_t *ric,
long timer_id,
ric_ran_function_id_t function_id,
long request_id,
long instance_id,
long action_id,
uint8_t **outbuf,
uint32_t *outlen);
static int e2sm_kpm_gp_timer_expiry(
ric_agent_info_t *ric,
long timer_id,
ric_ran_function_id_t function_id,
long request_id,
long instance_id,
long action_id,
uint8_t **outbuf,
uint32_t *outlen);
static E2SM_KPM_E2SM_KPMv2_IndicationMessage_t* encode_kpm_Indication_Msg(ric_agent_info_t* ric, ric_subscription_t *rs);
//static void generate_e2apv1_indication_request_parameterized(E2AP_E2AP_PDU_t *e2ap_pdu, long requestorId, long instanceId, long ranFunctionId, long actionId, long seqNum, uint8_t *ind_header_buf, int header_length, uint8_t *ind_message_buf, int message_length);
static void encode_e2sm_kpm_indication_header(ranid_t ranid, E2SM_KPM_E2SM_KPMv2_IndicationHeader_t *ihead);
//static int e2ap_asn1c_encode_pdu(E2AP_E2AP_PDU_t* pdu, unsigned char **buffer);
#define MAX_KPM_MEAS 5
#define MAX_GRANULARITY_INDEX 50
uint8_t g_indMsgMeasInfoCnt = 0;
uint8_t g_granularityIndx = 0;
bool action_def_missing = false;
E2SM_KPM_MeasurementInfoItem_KPMv2_t *g_indMsgMeasInfoItemArr[MAX_KPM_MEAS];
E2SM_KPM_MeasurementRecordItem_KPMv2_t *g_indMsgMeasRecItemArr[MAX_GRANULARITY_INDEX][MAX_KPM_MEAS];
E2SM_KPM_GranularityPeriod_KPMv2_t *g_granulPeriod;
E2SM_KPM_SubscriptionID_KPMv2_t g_subscriptionID;
kmp_meas_info_t e2sm_kpm_meas_info[MAX_KPM_MEAS] = {
{1, "RRC.ConnEstabAtt.sum", 0, false},
{2, "RRC.ConnEstabSucc.sum", 0, false},
{3, "RRC.ConnReEstabAtt.sum", 0, false},
{4, "RRC.ConnMean", 0, false},
{5, "RRC.ConnMax", 0, false}
};
static ric_service_model_t e2sm_kpm_model = {
.name = "e2sm_kpm-v2beta1",
/* iso(1) identified-organization(3) dod(6) internet(1) private(4) enterprise(1) oran(53148) e2(1) version2(2) e2sm(2) e2sm-KPMMON-IEs (2) */
.oid = "1.3.6.1.4.1.53148.1.2.2.2",
.handle_subscription_add = e2sm_kpm_subscription_add,
.handle_subscription_del = e2sm_kpm_subscription_del,
.handle_control = e2sm_kpm_control,
.handle_ricInd_timer_expiry = e2sm_kpm_ricInd_timer_expiry,
.handle_gp_timer_expiry = e2sm_kpm_gp_timer_expiry
};
/**
* Initializes KPM state and registers KPM e2ap_ran_function_id_t number(s).
*/
int e2sm_kpm_init(void)
{
//uint16_t i;
ric_ran_function_t *func;
E2SM_KPM_E2SM_KPMv2_RANfunction_Description_t *func_def;
E2SM_KPM_RIC_ReportStyle_Item_KPMv2_t *ric_report_style_item;
E2SM_KPM_RIC_EventTriggerStyle_Item_KPMv2_t *ric_event_trigger_style_item;
E2SM_KPM_RIC_KPMNode_Item_KPMv2_t *ric_kpm_node_item;
E2SM_KPM_Cell_Measurement_Object_Item_KPMv2_t *cell_meas_object_item;
E2SM_KPM_MeasurementInfo_Action_Item_KPMv2_t *meas_action_item1;
E2SM_KPM_MeasurementInfo_Action_Item_KPMv2_t *meas_action_item2;
E2SM_KPM_MeasurementInfo_Action_Item_KPMv2_t *meas_action_item3;
E2SM_KPM_MeasurementInfo_Action_Item_KPMv2_t *meas_action_item4;
E2SM_KPM_MeasurementInfo_Action_Item_KPMv2_t *meas_action_item5;
func = (ric_ran_function_t *)calloc(1, sizeof(*func));
func->model = &e2sm_kpm_model;
func->revision = 1;
func->name = "ORAN-E2SM-KPM";
func->description = "KPM monitor";
func_def = (E2SM_KPM_E2SM_KPMv2_RANfunction_Description_t *)calloc(1, sizeof(*func_def));
/* RAN Function Name */
func_def->ranFunction_Name.ranFunction_ShortName.buf = (uint8_t *)strdup(func->name);
func_def->ranFunction_Name.ranFunction_ShortName.size = strlen(func->name);
func_def->ranFunction_Name.ranFunction_E2SM_OID.buf = (uint8_t *)strdup(func->model->oid);
func_def->ranFunction_Name.ranFunction_E2SM_OID.size = strlen(func->model->oid);
func_def->ranFunction_Name.ranFunction_Description.buf = (uint8_t *)strdup(func->description);
func_def->ranFunction_Name.ranFunction_Description.size = strlen(func->description);
/* Hack for E2t crash */
long *ranFuncInst;
ranFuncInst = (long *)calloc(1,sizeof(*func_def->ranFunction_Name.ranFunction_Instance));
*ranFuncInst = 0;
func_def->ranFunction_Name.ranFunction_Instance = ranFuncInst;
/* KPM Node List */
func_def->ric_KPM_Node_List = (struct E2SM_KPM_E2SM_KPMv2_RANfunction_Description__ric_KPM_Node_List *)calloc(1, sizeof(*func_def->ric_KPM_Node_List));
ric_kpm_node_item = (E2SM_KPM_RIC_KPMNode_Item_KPMv2_t *)calloc(1, sizeof(*ric_kpm_node_item));
ric_kpm_node_item->ric_KPMNode_Type.present = E2SM_KPM_GlobalKPMnode_ID_KPMv2_PR_eNB;
/* Fetching PLMN ID*/
//TODO RIC
/* for (i = 0; i < RC.nb_inst; ++i) { //is there a better way to fetch RANID,otherwise PLMNID of first intance will get populated ?
if ( (e2_conf[i]->enabled) &&
((e2_conf[i]->e2node_type == E2NODE_TYPE_ENB_CU) || (e2_conf[i]->e2node_type == E2NODE_TYPE_NG_ENB_CU))
){
break;
}
}*/
MCC_MNC_TO_PLMNID(
e2_conf[0]->mcc,
e2_conf[0]->mnc,
e2_conf[0]->mnc_digit_length,
&ric_kpm_node_item->ric_KPMNode_Type.choice.eNB.global_eNB_ID.pLMN_Identity);
/* eNB_ID */
ric_kpm_node_item->ric_KPMNode_Type.choice.eNB.global_eNB_ID.eNB_ID.present = E2AP_ENB_ID_PR_macro_eNB_ID;
MACRO_ENB_ID_TO_BIT_STRING(e2_conf[0]->cell_identity,
&ric_kpm_node_item->ric_KPMNode_Type.choice.eNB.global_eNB_ID.eNB_ID.choice.macro_eNB_ID);
ric_kpm_node_item->cell_Measurement_Object_List =
(struct E2SM_KPM_RIC_KPMNode_Item_KPMv2__cell_Measurement_Object_List *)calloc(1, sizeof(*ric_kpm_node_item->cell_Measurement_Object_List));
cell_meas_object_item = (E2SM_KPM_Cell_Measurement_Object_Item_KPMv2_t *)calloc(1, sizeof(*cell_meas_object_item));
cell_meas_object_item->cell_object_ID.buf = (uint8_t *)strdup("1"); //if cell is TDD then EUtranCellTDD
cell_meas_object_item->cell_object_ID.size = strlen("1");
cell_meas_object_item->cell_global_ID.present = E2SM_KPM_CellGlobalID_KPMv2_PR_eUTRA_CGI;
MCC_MNC_TO_PLMNID(e2_conf[0]->mcc,
e2_conf[0]->mnc,
e2_conf[0]->mnc_digit_length,
&cell_meas_object_item->cell_global_ID.choice.eUTRA_CGI.pLMN_Identity);
//MACRO_ENB_ID_TO_BIT_STRING(e2_conf[0]->cell_identity,
MACRO_ENB_ID_TO_CELL_IDENTITY(e2_conf[0]->cell_identity,0,
&cell_meas_object_item->cell_global_ID.choice.eUTRA_CGI.eUTRACellIdentity);
ASN_SEQUENCE_ADD(&ric_kpm_node_item->cell_Measurement_Object_List->list, cell_meas_object_item);
ASN_SEQUENCE_ADD(&func_def->ric_KPM_Node_List->list, ric_kpm_node_item);
/* Sequence of Event trigger styles */
func_def->ric_EventTriggerStyle_List = (struct E2SM_KPM_E2SM_KPMv2_RANfunction_Description__ric_EventTriggerStyle_List *)calloc(1, sizeof(*func_def->ric_EventTriggerStyle_List));
ric_event_trigger_style_item = (E2SM_KPM_RIC_EventTriggerStyle_Item_KPMv2_t *)calloc(1, sizeof(*ric_event_trigger_style_item));
ric_event_trigger_style_item->ric_EventTriggerStyle_Type = 1;
ric_event_trigger_style_item->ric_EventTriggerStyle_Name.buf = (uint8_t *)strdup("Trigger1");
ric_event_trigger_style_item->ric_EventTriggerStyle_Name.size = strlen("Trigger1");
ric_event_trigger_style_item->ric_EventTriggerFormat_Type = 1;
ASN_SEQUENCE_ADD(&func_def->ric_EventTriggerStyle_List->list, ric_event_trigger_style_item);
/* Sequence of Report styles */
func_def->ric_ReportStyle_List = (struct E2SM_KPM_E2SM_KPMv2_RANfunction_Description__ric_ReportStyle_List *)calloc(1, sizeof(*func_def->ric_ReportStyle_List));
ric_report_style_item = (E2SM_KPM_RIC_ReportStyle_Item_KPMv2_t *)calloc(1, sizeof(*ric_report_style_item));
ric_report_style_item->ric_ReportStyle_Type = 6;
ric_report_style_item->ric_ReportStyle_Name.buf = (uint8_t *)strdup("O-CU-UP Measurement Container for the EPC connected deployment");
ric_report_style_item->ric_ReportStyle_Name.size = strlen("O-CU-UP Measurement Container for the EPC connected deployment");
ric_report_style_item->ric_ActionFormat_Type = 6; //pending
meas_action_item1 = (E2SM_KPM_MeasurementInfo_Action_Item_KPMv2_t *)calloc(1, sizeof(*meas_action_item1));
meas_action_item1->measName.buf = (uint8_t *)strdup(e2sm_kpm_meas_info[0].meas_type_name);
meas_action_item1->measName.size = strlen(e2sm_kpm_meas_info[0].meas_type_name);
E2SM_KPM_MeasurementTypeID_KPMv2_t *measID1;
measID1 = (E2SM_KPM_MeasurementTypeID_KPMv2_t *)calloc(1, sizeof(*measID1));
*measID1 = e2sm_kpm_meas_info[0].meas_type_id;
meas_action_item1->measID = measID1;
ASN_SEQUENCE_ADD(&ric_report_style_item->measInfo_Action_List.list, meas_action_item1);
meas_action_item2 = (E2SM_KPM_MeasurementInfo_Action_Item_KPMv2_t *)calloc(1, sizeof(*meas_action_item2));
meas_action_item2->measName.buf = (uint8_t *)strdup(e2sm_kpm_meas_info[1].meas_type_name); //(uint8_t *)strdup("RRC.ConnEstabSucc.sum");
meas_action_item2->measName.size = strlen(e2sm_kpm_meas_info[1].meas_type_name);
E2SM_KPM_MeasurementTypeID_KPMv2_t *measID2;
measID2 = (E2SM_KPM_MeasurementTypeID_KPMv2_t *)calloc(1, sizeof(*measID2));
*measID2 = e2sm_kpm_meas_info[1].meas_type_id;
meas_action_item2->measID = measID2;
ASN_SEQUENCE_ADD(&ric_report_style_item->measInfo_Action_List.list, meas_action_item2);
meas_action_item3 = (E2SM_KPM_MeasurementInfo_Action_Item_KPMv2_t *)calloc(1, sizeof(*meas_action_item3));
meas_action_item3->measName.buf = (uint8_t *)strdup(e2sm_kpm_meas_info[2].meas_type_name);
meas_action_item3->measName.size = strlen(e2sm_kpm_meas_info[2].meas_type_name);
E2SM_KPM_MeasurementTypeID_KPMv2_t *measID3;
measID3 = (E2SM_KPM_MeasurementTypeID_KPMv2_t *)calloc(1, sizeof(*measID3));
*measID3 = e2sm_kpm_meas_info[2].meas_type_id;
meas_action_item3->measID = measID3;
ASN_SEQUENCE_ADD(&ric_report_style_item->measInfo_Action_List.list, meas_action_item3);
meas_action_item4 = (E2SM_KPM_MeasurementInfo_Action_Item_KPMv2_t *)calloc(1, sizeof(*meas_action_item4));
meas_action_item4->measName.buf = (uint8_t *)strdup(e2sm_kpm_meas_info[3].meas_type_name);
meas_action_item4->measName.size = strlen(e2sm_kpm_meas_info[3].meas_type_name);
E2SM_KPM_MeasurementTypeID_KPMv2_t *measID4;
measID4 = (E2SM_KPM_MeasurementTypeID_KPMv2_t *)calloc(1, sizeof(*measID4));
*measID4 = e2sm_kpm_meas_info[3].meas_type_id;
meas_action_item4->measID = measID4;
ASN_SEQUENCE_ADD(&ric_report_style_item->measInfo_Action_List.list, meas_action_item4);
meas_action_item5 = (E2SM_KPM_MeasurementInfo_Action_Item_KPMv2_t *)calloc(1, sizeof(*meas_action_item5));
meas_action_item5->measName.buf = (uint8_t *)strdup(e2sm_kpm_meas_info[4].meas_type_name);
meas_action_item5->measName.size = strlen(e2sm_kpm_meas_info[4].meas_type_name);
E2SM_KPM_MeasurementTypeID_KPMv2_t *measID5;
measID5 = (E2SM_KPM_MeasurementTypeID_KPMv2_t *)calloc(1, sizeof(*measID5));
*measID5 = e2sm_kpm_meas_info[4].meas_type_id;
meas_action_item5->measID = measID5;
ASN_SEQUENCE_ADD(&ric_report_style_item->measInfo_Action_List.list, meas_action_item5);
ric_report_style_item->ric_IndicationHeaderFormat_Type = 1;
ric_report_style_item->ric_IndicationMessageFormat_Type = 1;
ASN_SEQUENCE_ADD(&func_def->ric_ReportStyle_List->list, ric_report_style_item);
//xer_fprint(stderr, &asn_DEF_E2SM_KPM_E2SM_KPMv2_RANfunction_Description, func_def);
RIC_AGENT_INFO("_______\n");
func->enc_definition_len = e2ap_encode(&asn_DEF_E2SM_KPM_E2SM_KPMv2_RANfunction_Description,0, func_def,&func->enc_definition);
RIC_AGENT_INFO("_______\n");
RIC_AGENT_INFO("------ RAN FUNC DEF ENC Len:%lu-------\n", func->enc_definition_len);
if (func->enc_definition_len < 0) {
RIC_AGENT_ERROR("failed to encode RANfunction_List in E2SM KPM func description; aborting!");
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_E2SM_KPM_E2SM_KPMv2_RANfunction_Description, func_def);
free(func_def);
free(func);
return -1;
}
func->enabled = 1;
func->definition = func_def;
#if 0
/* Test code */
E2SM_KPM_E2SM_KPMv2_RANfunction_Description_t *func_defi;
asn_dec_rval_t decode_result;
decode_result = aper_decode_complete(NULL, &asn_DEF_E2SM_KPM_E2SM_KPMv2_RANfunction_Description,
(void **)&func_defi, func->enc_definition, func->enc_definition_len);
DevAssert(decode_result.code == RC_OK);
#endif
return ric_agent_register_ran_function(func);
}
static int e2sm_kpm_subscription_add(ric_agent_info_t *ric, ric_subscription_t *sub)
{
/* XXX: process E2SM content. */
if (LIST_EMPTY(&ric->subscription_list)) {
LIST_INSERT_HEAD(&ric->subscription_list,sub,subscriptions);
}
else {
LIST_INSERT_BEFORE(LIST_FIRST(&ric->subscription_list),sub,subscriptions);
}
return 0;
}
static int e2sm_kpm_subscription_del(ric_agent_info_t *ric, ric_subscription_t *sub, int force,long *cause,long *cause_detail)
{
timer_remove(ric->e2sm_kpm_timer_id);
LIST_REMOVE(sub, subscriptions);
ric_free_subscription(sub);
return 0;
}
static int e2sm_kpm_control(ric_agent_info_t *ric,ric_control_t *control)
{
return 0;
}
static char *time_stamp(void)
{
char *timestamp = (char *)malloc(sizeof(char) * 128);
time_t ltime;
ltime=time(NULL);
struct tm *tm;
tm=localtime(&ltime);
sprintf(timestamp,"%d/%d/%d | %d:%d:%d", tm->tm_year+1900, tm->tm_mon,
tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec);
return timestamp;
}
static int e2sm_kpm_ricInd_timer_expiry(
ric_agent_info_t *ric,
long timer_id,
ric_ran_function_id_t function_id,
long request_id,
long instance_id,
long action_id,
uint8_t **outbuf,
uint32_t *outlen)
{
E2SM_KPM_E2SM_KPMv2_IndicationMessage_t* indicationmessage;
ric_subscription_t *rs;
DevAssert(timer_id == ric->e2sm_kpm_timer_id);
char *time = time_stamp();
RIC_AGENT_INFO("[%s] ---- Sending KPM RIC Indication, timer_id %ld function_id %ld---------\n",
time, timer_id, function_id);
free(time);
/* Fetch the RIC Subscription */
rs = ric_agent_lookup_subscription(ric,request_id,instance_id,function_id);
if (!rs) {
RIC_AGENT_ERROR("failed to find subscription %ld/%ld/%ld\n", request_id,instance_id,function_id);
}
indicationmessage = encode_kpm_Indication_Msg(ric, rs);
{
char *error_buf = (char*)calloc(300, sizeof(char));
size_t errlen;
asn_check_constraints(&asn_DEF_E2SM_KPM_E2SM_KPMv2_IndicationMessage, indicationmessage, error_buf, &errlen);
//fprintf(stderr,"KPM IND error length %zu\n", errlen);
//fprintf(stderr,"KPM IND error buf %s\n", error_buf);
free(error_buf);
//xer_fprint(stderr, &asn_DEF_E2SM_KPM_E2SM_KPMv2_IndicationMessage, indicationmessage);
}
g_granularityIndx = 0; // Resetting
//xer_fprint(stderr, &asn_DEF_E2SM_KPM_E2SM_KPMv2_IndicationMessage, indicationmessage);
uint8_t e2smbuffer[8192];
size_t e2smbuffer_size = 8192;
asn_enc_rval_t er = asn_encode_to_buffer(NULL,
ATS_ALIGNED_BASIC_PER,
&asn_DEF_E2SM_KPM_E2SM_KPMv2_IndicationMessage,
indicationmessage, e2smbuffer, e2smbuffer_size);
//fprintf(stderr, "er encded is %zu\n", er.encoded);
//fprintf(stderr, "after encoding KPM IND message\n");
E2AP_E2AP_PDU_t *e2ap_pdu = (E2AP_E2AP_PDU_t*)calloc(1, sizeof(E2AP_E2AP_PDU_t));
E2SM_KPM_E2SM_KPMv2_IndicationHeader_t* ind_header_style1 =
(E2SM_KPM_E2SM_KPMv2_IndicationHeader_t*)calloc(1,sizeof(E2SM_KPM_E2SM_KPMv2_IndicationHeader_t));
encode_e2sm_kpm_indication_header(ric->ranid, ind_header_style1);
uint8_t e2sm_header_buf_style1[8192];
size_t e2sm_header_buf_size_style1 = 8192;
asn_enc_rval_t er_header_style1 = asn_encode_to_buffer(
NULL,
ATS_ALIGNED_BASIC_PER,
&asn_DEF_E2SM_KPM_E2SM_KPMv2_IndicationHeader,
ind_header_style1,
e2sm_header_buf_style1,
e2sm_header_buf_size_style1);
if (er_header_style1.encoded < 0) {
fprintf(stderr, "ERROR encoding indication header, name=%s, tag=%s", er_header_style1.failed_type->name, er_header_style1.failed_type->xml_tag);
}
DevAssert(er_header_style1.encoded >= 0);
// TODO - remove hardcoded values
generate_e2apv1_indication_request_parameterized(
e2ap_pdu, request_id, instance_id, function_id, action_id,
0, e2sm_header_buf_style1, er_header_style1.encoded,
e2smbuffer, er.encoded);
*outlen = e2ap_asn1c_encode_pdu(e2ap_pdu, outbuf);
return 0;
}
struct timeval g_captureStartTime;
static int e2sm_kpm_gp_timer_expiry(
ric_agent_info_t *ric,
long timer_id,
ric_ran_function_id_t function_id,
long request_id,
long instance_id,
long action_id,
uint8_t **outbuf,
uint32_t *outlen)
{
int i,j=0;
DevAssert(timer_id == ric->gran_prd_timer_id);
if (g_granularityIndx == 0) /*First Granularity Period Expiry */
{
gettimeofday(&g_captureStartTime, NULL);
}
//char *time = time_stamp();
//RIC_AGENT_INFO("[%s] +++ Granularity Period expired, timer_id %ld function_id %ld +++ \n",
// time, timer_id, function_id);
//free(time);
for (i = 0; i < MAX_KPM_MEAS; i++)
{
if (e2sm_kpm_meas_info[i].subscription_status == true)
{
g_indMsgMeasRecItemArr[g_granularityIndx][j] =
(E2SM_KPM_MeasurementRecordItem_KPMv2_t *)calloc(1,sizeof(E2SM_KPM_MeasurementRecordItem_KPMv2_t));
g_indMsgMeasRecItemArr[g_granularityIndx][j]->present = E2SM_KPM_MeasurementRecordItem_KPMv2_PR_integer;
switch(e2sm_kpm_meas_info[i].meas_type_id)
{
case 1:/*RRC.ConnEstabAtt.sum*/
g_indMsgMeasRecItemArr[g_granularityIndx][j]->choice.integer = 0;
//rrc_kpi_stats.rrc_conn_estab_att_sum;
break;
case 2:/*RRC.ConnEstabSucc.sum*/
g_indMsgMeasRecItemArr[g_granularityIndx][j]->choice.integer = 0;
//rrc_kpi_stats.rrc_conn_estab_succ_sum;
break;
case 3:/*RRC.ConnReEstabAtt.sum*/
g_indMsgMeasRecItemArr[g_granularityIndx][j]->choice.integer = 0;
//rrc_kpi_stats.rrc_conn_reestab_att_sum;
break;
case 4:/*RRC.ConnMean*/
g_indMsgMeasRecItemArr[g_granularityIndx][j]->choice.integer = 0;
//f1ap_cu_inst[ric->ranid].num_ues;
break;
case 5:/*RRC.ConnMax*/
g_indMsgMeasRecItemArr[g_granularityIndx][j]->choice.integer =0; //rrc_kpi_stats.rrc_conn_max;
break;
default:
break;
}
j++;
}
}
g_granularityIndx++;
*outbuf = NULL;
*outlen = 0;
return 0;
}
uint8_t
getMeasIdFromMeasName(uint8_t *measName)
{
uint8_t i =0;
int ret;
for(i=0; i < MAX_KPM_MEAS; i++)
{
ret = strcmp(e2sm_kpm_meas_info[i].meas_type_name, (char *)measName);
if (ret ==0)
{
RIC_AGENT_INFO("[%s] found, MeasId:%d\n",measName, (i+1));
return (i+1);
}
}
return 0xFF;
}
int
e2sm_kpm_decode_and_handle_action_def(uint8_t *def_buf,
size_t def_size,
ric_ran_function_t *func,
uint32_t interval_ms,
ric_subscription_t* rs,
ric_agent_info_t *ric)
{
E2SM_KPM_E2SM_KPMv2_ActionDefinition_t *actionDef = NULL;
// or uncomment below:
//actionDef = calloc(1, sizeof(E2SM_KPM_E2SM_KPMv2_ActionDefinition_t));
E2SM_KPM_E2SM_KPMv2_ActionDefinition_Format1_t *actionDefFormat1;
E2SM_KPM_MeasurementInfoItem_KPMv2_t *actionDefMeasInfoItem;
E2SM_KPM_MeasurementTypeID_KPMv2_t localMeasID;
asn_dec_rval_t decode_result;
uint32_t gp_interval_sec = 0;
uint32_t gp_interval_us = 0;
uint32_t gp_interval_ms = 0;
uint8_t i,ret;
uint16_t subsId = 10;//hack
g_granulPeriod = (E2SM_KPM_GranularityPeriod_KPMv2_t *)calloc(1,sizeof(E2SM_KPM_GranularityPeriod_KPMv2_t));
/*Reset Subscriptions */
for (i = 0; i < MAX_KPM_MEAS; i++)
{
e2sm_kpm_meas_info[i].subscription_status = false;
}
g_indMsgMeasInfoCnt = 0; // resetting
RIC_AGENT_INFO("ACTION Def size:%lu\n", def_size);
if (def_size == 0)
{
/* In case of missing action list, all Meas Info should be reported to RIC */
RIC_AGENT_INFO("ACTION Def missing, populating all KPM Data\n");
for (i = 0; i < MAX_KPM_MEAS; i++)
{
g_indMsgMeasInfoItemArr[g_indMsgMeasInfoCnt] =
(E2SM_KPM_MeasurementInfoItem_KPMv2_t *)calloc(1,sizeof(E2SM_KPM_MeasurementInfoItem_KPMv2_t));
g_indMsgMeasInfoItemArr[g_indMsgMeasInfoCnt]->measType.present = E2SM_KPM_MeasurementType_KPMv2_PR_measName;
g_indMsgMeasInfoItemArr[g_indMsgMeasInfoCnt]->measType.choice.measName.buf =
(uint8_t *)strdup(e2sm_kpm_meas_info[i].meas_type_name);
g_indMsgMeasInfoItemArr[g_indMsgMeasInfoCnt]->measType.choice.measName.size =
strlen(e2sm_kpm_meas_info[i].meas_type_name);
e2sm_kpm_meas_info[i].subscription_status = true;
g_indMsgMeasInfoCnt++;
}
*g_granulPeriod = 10; //Hack
/* Hack - Subscription ID */
//g_subscriptionID.size = sizeof(subsId);
//g_subscriptionID.buf = (uint8_t *)calloc(1,sizeof(subsId));
//*g_subscriptionID.buf = subsId;
g_subscriptionID = subsId;
action_def_missing = true; /* Granularity Timer will not start */
return 0;
}
decode_result = aper_decode_complete(NULL, &asn_DEF_E2SM_KPM_E2SM_KPMv2_ActionDefinition,
(void **)&actionDef, def_buf, def_size);
DevAssert(decode_result.code == RC_OK);
xer_fprint(stdout, &asn_DEF_E2SM_KPM_E2SM_KPMv2_ActionDefinition, actionDef);
if (actionDef->actionDefinition_formats.present == /*E2SM-KPM Action Definition Format 1*/
E2SM_KPM_E2SM_KPMv2_ActionDefinition__actionDefinition_formats_PR_actionDefinition_Format1)
{
actionDefFormat1 = &actionDef->actionDefinition_formats.choice.actionDefinition_Format1;
if (actionDefFormat1->granulPeriod > interval_ms)
{
RIC_AGENT_ERROR("Subscription Failure: Granularity Period:%lu ms Reporting Interval:%u ms\n",
actionDefFormat1->granulPeriod, interval_ms);
return -1;
}
*g_granulPeriod = actionDefFormat1->granulPeriod;
#if 0
if (actionDefFormat1->subscriptID.size)
{
g_subscriptionID.size = actionDefFormat1->subscriptID.size;
g_subscriptionID.buf = (uint8_t *)calloc(1,actionDefFormat1->subscriptID.size);
memcpy(g_subscriptionID.buf,
actionDefFormat1->subscriptID.buf,
actionDefFormat1->subscriptID.size);
}
#endif
g_subscriptionID = actionDefFormat1->subscriptID;
/* Fetch KPM subscription details */
for (i=0; i < actionDefFormat1->measInfoList.list.count; i++)
{
actionDefMeasInfoItem = (E2SM_KPM_MeasurementInfoItem_KPMv2_t *)(actionDefFormat1->measInfoList.list.array[i]);
//if (actionDefMeasInfoItem->measType.present == E2SM_KPM_MeasurementType_PR_measID)
if (actionDefMeasInfoItem->measType.present == E2SM_KPM_MeasurementType_KPMv2_PR_measName)
{
//localMeasID = actionDefMeasInfoItem->measType.choice.measID;
localMeasID = getMeasIdFromMeasName(actionDefMeasInfoItem->measType.choice.measName.buf);
if ( ( (localMeasID > 0) &&
(localMeasID < (MAX_KPM_MEAS+1) ) ) && /*Expecting KPM MeasID to be within limits */
(e2sm_kpm_meas_info[localMeasID-1].subscription_status == false) ) /*Avoid subscribing duplicate */
{
/* Set the Subscription Status */
g_indMsgMeasInfoItemArr[g_indMsgMeasInfoCnt] =
(E2SM_KPM_MeasurementInfoItem_KPMv2_t *)calloc(1,sizeof(E2SM_KPM_MeasurementInfoItem_KPMv2_t));
g_indMsgMeasInfoItemArr[g_indMsgMeasInfoCnt]->measType.present = E2SM_KPM_MeasurementType_KPMv2_PR_measName;
g_indMsgMeasInfoItemArr[g_indMsgMeasInfoCnt]->measType.choice.measName.buf =
(uint8_t *)strdup(e2sm_kpm_meas_info[localMeasID-1].meas_type_name);
g_indMsgMeasInfoItemArr[g_indMsgMeasInfoCnt]->measType.choice.measName.size =
strlen(e2sm_kpm_meas_info[localMeasID-1].meas_type_name);
e2sm_kpm_meas_info[localMeasID-1].subscription_status = true;
g_indMsgMeasInfoCnt++;
}
else
{
RIC_AGENT_ERROR("Act Def Err i=%d MeasId:%ld indMsgMeasInfoCnt:%d\n",
i, localMeasID, g_indMsgMeasInfoCnt);
return -1;
}
}
else
{
RIC_AGENT_ERROR("Meas Name not found in Action Def\n");
return -1;
}
}
gp_interval_ms = actionDefFormat1->granulPeriod;
gp_interval_us = (gp_interval_ms%1000)*1000;
gp_interval_sec = (gp_interval_ms/1000);
ric_ran_function_requestor_info_t* arg_gp
= (ric_ran_function_requestor_info_t*)calloc(1, sizeof(ric_ran_function_requestor_info_t));
arg_gp->function_id = func->function_id;
arg_gp->request_id = rs->request_id;
arg_gp->instance_id = rs->instance_id;
arg_gp->action_id = (LIST_FIRST(&rs->action_list))->id;
/*Start Timer for Granularity Period */
ret = timer_setup(gp_interval_sec, gp_interval_us,
TASK_RIC_AGENT,
ric->ranid,
TIMER_PERIODIC,
(void *)arg_gp,
&ric->gran_prd_timer_id);
if (ret < 0) {
RIC_AGENT_ERROR("failed to start Granularity Period timer\n");
return -1;
}
}
else
{
RIC_AGENT_ERROR("Subscription Failure: Invalid Action Def Format:%d\n",
actionDef->actionDefinition_formats.present);
return -1;
}
return 0;
}
static E2SM_KPM_E2SM_KPMv2_IndicationMessage_t*
encode_kpm_Indication_Msg(ric_agent_info_t* ric, ric_subscription_t *rs)
{
int ret;
uint8_t i,k;
E2SM_KPM_MeasurementDataItem_KPMv2_t* meas_data_item[MAX_GRANULARITY_INDEX];
E2SM_KPM_MeasurementRecord_KPMv2_t* meas_rec[MAX_GRANULARITY_INDEX];
E2SM_KPM_MeasurementData_KPMv2_t* meas_data;
if (action_def_missing == true)
{
for (i = 0; i < MAX_KPM_MEAS; i++)
{
g_indMsgMeasRecItemArr[0][i] = (E2SM_KPM_MeasurementRecordItem_KPMv2_t *)calloc(1,sizeof(E2SM_KPM_MeasurementRecordItem_KPMv2_t));
g_indMsgMeasRecItemArr[0][i]->present = E2SM_KPM_MeasurementRecordItem_KPMv2_PR_integer;
switch(i)
{
case 0:/*RRC.ConnEstabAtt.sum*/
g_indMsgMeasRecItemArr[0][i]->choice.integer =0;// rrc_kpi_stats.rrc_conn_estab_att_sum;
break;
case 1:/*RRC.ConnEstabSucc.sum*/
g_indMsgMeasRecItemArr[0][i]->choice.integer =0;// rrc_kpi_stats.rrc_conn_estab_succ_sum;
break;
case 2:/*RRC.ConnReEstabAtt.sum*/
g_indMsgMeasRecItemArr[0][i]->choice.integer =0;//rrc_kpi_stats.rrc_conn_reestab_att_sum;
break;
case 3:/*RRC.ConnMean*/
g_indMsgMeasRecItemArr[0][i]->choice.integer = 0;//f1ap_cu_inst[ric->ranid].num_ues;
break;
case 4:/*RRC.ConnMax*/
g_indMsgMeasRecItemArr[0][i]->choice.integer =0;// rrc_kpi_stats.rrc_conn_max;
break;
default:
break;
}
}
g_granularityIndx = 1;
}
//RIC_AGENT_INFO("Granularity Idx=:%d\n",g_granularityIndx);
/*
* measData->measurementRecord (List)
*/
meas_data = (E2SM_KPM_MeasurementData_KPMv2_t*)calloc(1, sizeof(E2SM_KPM_MeasurementData_KPMv2_t));
DevAssert(meas_data!=NULL);
for (k=0; k < g_granularityIndx; k++)
{
/*
* Measurement Record->MeasurementRecordItem (List)
*/
meas_rec[k] = (E2SM_KPM_MeasurementRecord_KPMv2_t *)calloc(1, sizeof(E2SM_KPM_MeasurementRecord_KPMv2_t));
for(i=0; i < g_indMsgMeasInfoCnt; i++)
{
/* Meas Records meas_rec[] have to be prepared for each Meas data item */
ret = ASN_SEQUENCE_ADD(&meas_rec[k]->list, g_indMsgMeasRecItemArr[k][i]);
DevAssert(ret == 0);
}
/* MeasDataItem*/
meas_data_item[k] = (E2SM_KPM_MeasurementDataItem_KPMv2_t*)calloc(1, sizeof(E2SM_KPM_MeasurementDataItem_KPMv2_t));
meas_data_item[k]->measRecord = *meas_rec[k];
/* Enqueue Meas data items */
ret = ASN_SEQUENCE_ADD(&meas_data->list, meas_data_item[k]);
DevAssert(ret == 0);
}
/*
* measInfoList
*/
E2SM_KPM_MeasurementInfoList_KPMv2_t* meas_info_list = (E2SM_KPM_MeasurementInfoList_KPMv2_t*)calloc(1, sizeof(E2SM_KPM_MeasurementInfoList_KPMv2_t));
for(i=0; i < g_indMsgMeasInfoCnt; i++)
{
ret = ASN_SEQUENCE_ADD(&meas_info_list->list, g_indMsgMeasInfoItemArr[i]);
DevAssert(ret == 0);
}
/*
* IndicationMessage_Format1 -> measInfoList
* IndicationMessage_Format1 -> measData
*/
E2SM_KPM_E2SM_KPMv2_IndicationMessage_Format1_t* format =
(E2SM_KPM_E2SM_KPMv2_IndicationMessage_Format1_t*)calloc(1, sizeof(E2SM_KPM_E2SM_KPMv2_IndicationMessage_Format1_t));
ASN_STRUCT_RESET(asn_DEF_E2SM_KPM_E2SM_KPMv2_IndicationMessage_Format1, format);
//format->subscriptID.size = g_subscriptionID.size;
//format->subscriptID.buf = g_subscriptionID.buf;
format->subscriptID = g_subscriptionID;
format->measInfoList = meas_info_list;
format->measData = *meas_data;
format->granulPeriod = g_granulPeriod;
/*
* IndicationMessage -> IndicationMessage_Format1
*/
E2SM_KPM_E2SM_KPMv2_IndicationMessage_t* indicationmessage =
(E2SM_KPM_E2SM_KPMv2_IndicationMessage_t*)calloc(1, sizeof(E2SM_KPM_E2SM_KPMv2_IndicationMessage_t));
indicationmessage->indicationMessage_formats.present =
E2SM_KPM_E2SM_KPMv2_IndicationMessage__indicationMessage_formats_PR_indicationMessage_Format1;
indicationmessage->indicationMessage_formats.choice.indicationMessage_Format1 = *format;
return indicationmessage;
}
const unsigned long long EPOCH = 2208988800ULL;
const unsigned long long NTP_SCALE_FRAC = 4294967296ULL;
unsigned int tv_to_ntp(struct timeval tv)
{
unsigned long long tv_ntp, tv_usecs;
tv_ntp = tv.tv_sec + EPOCH;
tv_usecs = (NTP_SCALE_FRAC * tv.tv_usec) / 1000000UL;
return (((tv_ntp << 32) | tv_usecs) & 0xFFFFFFFF);//just returning 32bits
}
void encode_e2sm_kpm_indication_header(ranid_t ranid, E2SM_KPM_E2SM_KPMv2_IndicationHeader_t *ihead)
{
e2node_type_t node_type;
ihead->indicationHeader_formats.present = E2SM_KPM_E2SM_KPMv2_IndicationHeader__indicationHeader_formats_PR_indicationHeader_Format1;
E2SM_KPM_E2SM_KPMv2_IndicationHeader_Format1_t* ind_header = &ihead->indicationHeader_formats.choice.indicationHeader_Format1;
/* KPM Node ID */
ind_header->kpmNodeID = (E2SM_KPM_GlobalKPMnode_ID_KPMv2_t *)calloc(1,sizeof(E2SM_KPM_GlobalKPMnode_ID_KPMv2_t));
ind_header->kpmNodeID->present = E2SM_KPM_GlobalKPMnode_ID_KPMv2_PR_eNB;
node_type = e2_conf[ranid]->e2node_type;
//TODO RIC split
if (node_type == E2NODE_TYPE_GNB_CU || node_type == E2NODE_TYPE_ENB_CU)
{
MCC_MNC_TO_PLMNID(
e2_conf[ranid]->mcc,
e2_conf[ranid]->mnc,
e2_conf[ranid]->mnc_digit_length,
&ind_header->kpmNodeID->choice.eNB.global_eNB_ID.pLMN_Identity);
ind_header->kpmNodeID->choice.eNB.global_eNB_ID.eNB_ID.present = E2SM_KPM_ENB_ID_KPMv2_PR_macro_eNB_ID;
MACRO_ENB_ID_TO_BIT_STRING(
e2_conf[ranid]->cell_identity,
&ind_header->kpmNodeID->choice.eNB.global_eNB_ID.eNB_ID.choice.macro_eNB_ID);
}
/* Collect Start Time Stamp */
/* Encoded in the same format as the first four octets of the 64-bit timestamp format as defined in section 6 of IETF RFC 5905 */
ind_header->colletStartTime.buf = (uint8_t *)calloc(1, 4);
ind_header->colletStartTime.size = 4;
*((uint32_t *)(ind_header->colletStartTime.buf)) = htonl((uint32_t)time(NULL));
//xer_fprint(stderr, &asn_DEF_E2SM_KPM_E2SM_KPMv2_IndicationHeader, ihead);
}

View File

@@ -0,0 +1,40 @@
/*
* SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* 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 _E2SM_COMMON_H_
#define _E2SM_COMMON_H_
extern int e2sm_kpm_init(void);
extern int
e2sm_kpm_decode_and_handle_action_def(uint8_t *def_buf,
size_t def_size,
ric_ran_function_t *func,
uint32_t interval_ms,
ric_subscription_t* rs,
ric_agent_info_t *ric);
#endif /* _E2SM_COMMON_H_ */

View File

@@ -0,0 +1,207 @@
-- ASN1START
-- **************************************************************
-- E2SM-MET 2.0.1 Information Element Definitions
-- **************************************************************
E2SM-MET-IEs {
iso(1) identified-organization(3) dod(6) internet(1) private(4) enterprise(1) oran(53148) e2(1) version2(2) e2sm(2) e2sm-METMON-IEs (98)}
DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
TimeStamp ::= OCTET STRING (SIZE(4))
-- **************************************************************
CellObjectID ::= INTEGER (0.. 255)
GranularityPeriod ::= INTEGER (1.. 4294967295)
SubscriptionID ::= INTEGER (1.. 4294967295)
-- **************************************************************
GlobalMETnode-ID ::= INTEGER (1.. 4294967295)
-- **************************************************************
RANfunction-Name ::= SEQUENCE{
ranFunction-ShortName PrintableString(SIZE(1..150,...)),
ranFunction-E2SM-OID PrintableString(SIZE(1..1000,...)),
ranFunction-Description PrintableString(SIZE(1..150,...)),
...
}
-- **************************************************************
-- Lists
-- **************************************************************
-- ******************
-- UE related defs
maxofUE INTEGER ::= 65535
UEID ::= INTEGER (0.. 255)
UETag ::= PrintableString(SIZE(1.. 150))
UEItem ::= SEQUENCE {
ueID UEID,
ueTag UETag OPTIONAL,
...
}
--****************
MeasurementInfoList ::= SEQUENCE (SIZE(1..65535)) OF MeasurementInfoItem
MeasurementInfoItem::= PrintableString(SIZE(1.. 150))
MeasurementData ::= SEQUENCE (SIZE(1..65535)) OF MeasurementRecord
MeasurementRecord ::= SEQUENCE {
ueID UEID,
ueTag UETag,
measRecordItem SEQUENCE (SIZE(1..65535)) OF MeasurementRecordItem,
...
}
MeasurementRecordItem ::= CHOICE {
integer INTEGER (0..4294967295),
noValue NULL,
...
}
MeasurementInfo-Action-List ::= SEQUENCE (SIZE(1..65535)) OF MeasurementInfo-Action-Item
MeasurementInfo-Action-Item ::= SEQUENCE {
measName MeasurementTypeName,
measID MeasurementTypeID OPTIONAL,
...
}
MeasurementTypeName ::= PrintableString(SIZE(1.. 150))
MeasurementTypeID ::= INTEGER (1.. 65535, ...)
-- **************************************************************
-- E2SM-MET Service Model IEs
-- **************************************************************
-- **************************************************************
-- Event Trigger Definition OCTET STRING contents
-- **************************************************************
E2SM-MET-EventTriggerDefinition ::= SEQUENCE{
eventDefinition-formats CHOICE{
eventDefinition-Format1 E2SM-MET-EventTriggerDefinition-Format1,
...
},
...
}
E2SM-MET-EventTriggerDefinition-Format1 ::= SEQUENCE{
reportingPeriod INTEGER (1.. 4294967295),
...
}
-- **************************************************************
-- Action Definition OCTET STRING contents
-- **************************************************************
E2SM-MET-ActionDefinition ::= SEQUENCE{
ric-Style-Type RIC-Style-Type,
actionDefinition-formats CHOICE{
actionDefinition-Format1 E2SM-MET-ActionDefinition-Format1,
...
},
...
}
E2SM-MET-ActionDefinition-Format1 ::= SEQUENCE {
cellObjID CellObjectID,
measInfoList MeasurementInfoList,
granulPeriod GranularityPeriod,
subscriptID SubscriptionID,
...
}
-- **************************************************************
-- Indication Header OCTET STRING contents
-- **************************************************************
E2SM-MET-IndicationHeader ::= SEQUENCE{
indicationHeader-formats CHOICE{
indicationHeader-Format1 E2SM-MET-IndicationHeader-Format1,
...
},
...
}
E2SM-MET-IndicationHeader-Format1 ::= SEQUENCE{
colletStartTime TimeStamp,
measInfoList MeasurementInfoList,
fileFormatversion PrintableString (SIZE (0..15), ...) OPTIONAL,
senderName PrintableString (SIZE (0..400), ...) OPTIONAL,
metNodeID GlobalMETnode-ID OPTIONAL,
...
}
-- **************************************************************
-- Indication Message OCTET STRING contents
-- **************************************************************
E2SM-MET-IndicationMessage ::= SEQUENCE{
indicationMessage-formats CHOICE{
indicationMessage-Format1 E2SM-MET-IndicationMessage-Format1,
...
},
...
}
E2SM-MET-IndicationMessage-Format1 ::= SEQUENCE {
subscriptID SubscriptionID,
cellObjID CellObjectID OPTIONAL,
granulPeriod GranularityPeriod OPTIONAL,
measInfoList MeasurementInfoList OPTIONAL,
measData MeasurementData,
...
}
-- ***************************************************************
-- RAN Function Definition OCTET STRING contents
-- ***************************************************************
E2SM-MET-RANfunction-Description ::= SEQUENCE{
ranFunction-Name RANfunction-Name,
ric-EventTriggerStyle-List SEQUENCE (SIZE(1..255)) OF RIC-EventTriggerStyle-Item OPTIONAL,
ric-ReportStyle-List SEQUENCE (SIZE(1..255)) OF RIC-ReportStyle-Item OPTIONAL,
...
}
RIC-Style-Type ::= INTEGER (0.. 255, ...)
RIC-Style-Name ::= PrintableString(SIZE(1.. 150, ...))
RIC-Format-Type ::= INTEGER (0.. 255, ...)
RIC-EventTriggerStyle-Item ::= SEQUENCE{
ric-EventTriggerStyle-Type RIC-Style-Type,
ric-EventTriggerStyle-Name RIC-Style-Name,
ric-EventTriggerFormat-Type RIC-Format-Type,
...
}
RIC-ReportStyle-Item ::= SEQUENCE{
ric-ReportStyle-Type RIC-Style-Type,
ric-ReportStyle-Name RIC-Style-Name,
ric-ActionFormat-Type RIC-Format-Type,
measInfo-Action-List MeasurementInfo-Action-List,
ric-IndicationHeaderFormat-Type RIC-Format-Type,
ric-IndicationMessageFormat-Type RIC-Format-Type,
...
}
END
-- ASN1STOP

View File

@@ -0,0 +1,816 @@
#include <sys/time.h>
#include <arpa/inet.h>
#include <stdbool.h>
#include <string.h>
#include "common/utils/assertions.h"
#include "f1ap_common.h"
#include "ric_agent.h"
#include "e2ap_encoder.h"
#include "e2sm_met.h"
#include "e2ap_generate_messages.h"
#include "INTEGER.h"
#include "OCTET_STRING.h"
//HERE
#include "E2SM_MET_E2SM-MET-RANfunction-Description.h"
#include "E2SM_MET_RIC-ReportStyle-Item.h"
#include "E2SM_MET_RIC-EventTriggerStyle-Item.h"
#include "E2SM_MET_MeasurementInfo-Action-Item.h"
#include "E2SM_MET_SubscriptionID.h"
#include "E2SM_MET_MeasurementData.h"
#include "E2SM_MET_MeasurementRecord.h"
#include "E2SM_MET_MeasurementRecordItem.h"
#include "E2SM_MET_GranularityPeriod.h"
#include "E2SM_MET_E2SM-MET-IndicationMessage.h"
#include "E2SM_MET_E2SM-MET-IndicationHeader.h"
#include "E2SM_MET_E2SM-MET-IndicationHeader-Format1.h"
#include "E2SM_MET_MeasurementInfoList.h"
#include "E2SM_MET_MeasurementInfoItem.h"
#include "E2SM_MET_E2SM-MET-IndicationMessage-Format1.h"
#include "E2SM_MET_GlobalMETnode-ID.h"
#include "E2AP_Cause.h"
#include "E2SM_MET_UETag.h"
#include "met_debug.h"
#include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
extern RAN_CONTEXT_t RC;
// extern f1ap_cudu_inst_t f1ap_cu_inst[MAX_eNB];
// extern int global_e2_node_id(ranid_t ranid, E2AP_GlobalE2node_ID_t* node_id);
// extern RAN_CONTEXT_t RC;
// extern eNB_RRC_KPI_STATS rrc_kpi_stats;
/**
** The main thing with this abstraction is that we need per-SM modules
** to handle the details of the function, event trigger, action, etc
** definitions... and to actually do all the logic and implement the
** inner parts of the message encoding. generic e2ap handles the rest.
**/
//Functions of the SM
// SECTION this section is for Constatnts, global vars definitions and function signatures
// debug functions
static int e2sm_met_subscription_add(ric_agent_info_t *ric, ric_subscription_t *sub);
static int e2sm_met_subscription_del(ric_agent_info_t *ric, ric_subscription_t *sub, int force,long *cause,long *cause_detail);
static int e2sm_met_control(ric_agent_info_t *ric,ric_control_t *control);
static char *time_stamp(void);
static int e2sm_met_ricInd_timer_expiry(
ric_agent_info_t *ric,
long timer_id,
ric_ran_function_id_t function_id,
long request_id,
long instance_id,
long action_id,
uint8_t **outbuf,
uint32_t *outlen);
static int e2sm_met_gp_timer_expiry(
ric_agent_info_t *ric,
long timer_id,
ric_ran_function_id_t function_id,
long request_id,
long instance_id,
long action_id,
uint8_t **outbuf,
uint32_t *outlen);
static E2SM_MET_E2SM_MET_IndicationMessage_t* encode_met_Indication_Msg(ric_agent_info_t* ric, ric_subscription_t *rs);
void encode_e2sm_met_indication_header(ranid_t ranid, E2SM_MET_E2SM_MET_IndicationHeader_t *ihead) ;
//TODONOW set the subID and granularity period somewhere
// E2SM_MET_SubscriptionID_t g_subscriptionID;
E2SM_MET_GranularityPeriod_t *g_granulPeriod;
#define MAX_RECORD_ITEM 2 // here max recordItems is the same as THE FIXED number of the measurments we have
#define MAX_UE 5
E2SM_MET_MeasurementRecordItem_t *g_indMsgMeasRecItemArr[MAX_RECORD_ITEM];
static ric_service_model_t e2sm_met_model = {
.name = "e2sm_met",
.oid = "1.3.6.1.4.1.53148.1.2.2.98",
.handle_subscription_add = e2sm_met_subscription_add,
.handle_subscription_del = e2sm_met_subscription_del,
.handle_control = e2sm_met_control,
.handle_ricInd_timer_expiry = e2sm_met_ricInd_timer_expiry,
.handle_gp_timer_expiry = e2sm_met_gp_timer_expiry
};
kmp_meas_info_t e2sm_met_meas_info[MAX_RECORD_ITEM] = {
{1, "RRC.ConnEstabAatt.sum", 0, false},
{2, "RRC.ConnEstabSucc.sum", 0, false},
{3, "RRC.ConnReEstabAtt.sum", 0, false},
{4, "RRC.ConnMean", 0, false},
{5, "RRC.ConnMax", 0, false}
};
//!SECTION
//SECTION Initializes MET Service model state and registers MET e2ap_ran_function_id_t number(s).
/**
* Initializes KPM state and registers KPM e2ap_ran_function_id_t number(s).
*/
int e2sm_met_init(void)
{
ric_ran_function_t *func;
E2SM_MET_E2SM_MET_RANfunction_Description_t *func_def;
E2SM_MET_RIC_ReportStyle_Item_t *ric_report_style_item;
E2SM_MET_RIC_EventTriggerStyle_Item_t *ric_event_trigger_style_item;
E2SM_MET_MeasurementInfo_Action_Item_t *meas_action_item1;
E2SM_MET_MeasurementInfo_Action_Item_t *meas_action_item2;
E2SM_MET_MeasurementInfo_Action_Item_t *meas_action_item3;
E2SM_MET_MeasurementInfo_Action_Item_t *meas_action_item4;
E2SM_MET_MeasurementInfo_Action_Item_t *meas_action_item5;
func = (ric_ran_function_t *)calloc(1, sizeof(*func));
func->model = &e2sm_met_model;
func->revision = 1;
func->name = "Eurecom-MET-SM";
func->description = "MET monitor";
func_def = (E2SM_MET_E2SM_MET_RANfunction_Description_t *)calloc(1, sizeof(*func_def));
/* RAN Function Name */
func_def->ranFunction_Name.ranFunction_ShortName.buf = (uint8_t *)strdup(func->name);
func_def->ranFunction_Name.ranFunction_ShortName.size = strlen(func->name);
func_def->ranFunction_Name.ranFunction_E2SM_OID.buf = (uint8_t *)strdup(func->model->oid);
func_def->ranFunction_Name.ranFunction_E2SM_OID.size = strlen(func->model->oid);
func_def->ranFunction_Name.ranFunction_Description.buf = (uint8_t *)strdup(func->description);
func_def->ranFunction_Name.ranFunction_Description.size = strlen(func->description);
/* Hack for E2t crash */
//REVIEW IMPORTANT
// long *ranFuncInst;
// ranFuncInst = (long *)calloc(1,sizeof(*func_def->ranFunction_Name.ranFunction_Instance));
// *ranFuncInst = 0;
// func_def->ranFunction_Name.ranFunction_Instance = ranFuncInst;
/* Sequence of Event trigger styles */
func_def->ric_EventTriggerStyle_List = (struct E2SM_MET_E2SM_MET_RANfunction_Description__ric_EventTriggerStyle_List *)calloc(1, sizeof(*func_def->ric_EventTriggerStyle_List));
ric_event_trigger_style_item = (E2SM_MET_RIC_EventTriggerStyle_Item_t *)calloc(1, sizeof(*ric_event_trigger_style_item));
ric_event_trigger_style_item->ric_EventTriggerStyle_Type = 1;
ric_event_trigger_style_item->ric_EventTriggerStyle_Name.buf = (uint8_t *)strdup("Trigger1");
ric_event_trigger_style_item->ric_EventTriggerStyle_Name.size = strlen("Trigger1");
ric_event_trigger_style_item->ric_EventTriggerFormat_Type = 1;
ASN_SEQUENCE_ADD(&func_def->ric_EventTriggerStyle_List->list, ric_event_trigger_style_item);
/* Sequence of Report styles */
func_def->ric_ReportStyle_List = (struct E2SM_MET_E2SM_MET_RANfunction_Description__ric_ReportStyle_List *)calloc(1, sizeof(*func_def->ric_ReportStyle_List));
ric_report_style_item = (E2SM_MET_RIC_ReportStyle_Item_t *)calloc(1, sizeof(*ric_report_style_item));
ric_report_style_item->ric_ReportStyle_Type = 6;
ric_report_style_item->ric_ReportStyle_Name.buf = (uint8_t *)strdup("O-CU-UP Measurement Container for the EPC connected deployment");
ric_report_style_item->ric_ReportStyle_Name.size = strlen("O-CU-UP Measurement Container for the EPC connected deployment");
ric_report_style_item->ric_ActionFormat_Type = 6; //pending
meas_action_item1 = (E2SM_MET_MeasurementInfo_Action_Item_t *)calloc(1, sizeof(*meas_action_item1));
meas_action_item1->measName.buf = (uint8_t *)strdup(e2sm_met_meas_info[0].meas_type_name);
meas_action_item1->measName.size = strlen(e2sm_met_meas_info[0].meas_type_name);
E2SM_MET_MeasurementTypeID_t *measID1;
measID1 = (E2SM_MET_MeasurementTypeID_t *)calloc(1, sizeof(*measID1));
*measID1 = e2sm_met_meas_info[0].meas_type_id;
meas_action_item1->measID = measID1;
ASN_SEQUENCE_ADD(&ric_report_style_item->measInfo_Action_List.list, meas_action_item1);
meas_action_item2 = (E2SM_MET_MeasurementInfo_Action_Item_t *)calloc(1, sizeof(*meas_action_item2));
meas_action_item2->measName.buf = (uint8_t *)strdup(e2sm_met_meas_info[1].meas_type_name); //(uint8_t *)strdup("RRC.ConnEstabSucc.sum");
meas_action_item2->measName.size = strlen(e2sm_met_meas_info[1].meas_type_name);
E2SM_MET_MeasurementTypeID_t *measID2;
measID2 = (E2SM_MET_MeasurementTypeID_t *)calloc(1, sizeof(*measID2));
*measID2 = e2sm_met_meas_info[1].meas_type_id;
meas_action_item2->measID = measID2;
ASN_SEQUENCE_ADD(&ric_report_style_item->measInfo_Action_List.list, meas_action_item2);
// meas_action_item3 = (E2SM_MET_MeasurementInfo_Action_Item_t *)calloc(1, sizeof(*meas_action_item3));
// meas_action_item3->measName.buf = (uint8_t *)strdup(e2sm_met_meas_info[2].meas_type_name);
// meas_action_item3->measName.size = strlen(e2sm_met_meas_info[2].meas_type_name);
// E2SM_MET_MeasurementTypeID_t *measID3;
// measID3 = (E2SM_MET_MeasurementTypeID_t *)calloc(1, sizeof(*measID3));
// *measID3 = e2sm_met_meas_info[2].meas_type_id;
// meas_action_item3->measID = measID3;
// ASN_SEQUENCE_ADD(&ric_report_style_item->measInfo_Action_List.list, meas_action_item3);
// meas_action_item4 = (E2SM_MET_MeasurementInfo_Action_Item_t *)calloc(1, sizeof(*meas_action_item4));
// meas_action_item4->measName.buf = (uint8_t *)strdup(e2sm_met_meas_info[3].meas_type_name);
// meas_action_item4->measName.size = strlen(e2sm_met_meas_info[3].meas_type_name);
// E2SM_MET_MeasurementTypeID_t *measID4;
// measID4 = (E2SM_MET_MeasurementTypeID_t *)calloc(1, sizeof(*measID4));
// *measID4 = e2sm_met_meas_info[3].meas_type_id;
// meas_action_item4->measID = measID4;
// ASN_SEQUENCE_ADD(&ric_report_style_item->measInfo_Action_List.list, meas_action_item4);
// meas_action_item5 = (E2SM_MET_MeasurementInfo_Action_Item_t *)calloc(1, sizeof(*meas_action_item5));
// meas_action_item5->measName.buf = (uint8_t *)strdup(e2sm_met_meas_info[4].meas_type_name);
// meas_action_item5->measName.size = strlen(e2sm_met_meas_info[4].meas_type_name);
// E2SM_MET_MeasurementTypeID_t *measID5;
// measID5 = (E2SM_MET_MeasurementTypeID_t *)calloc(1, sizeof(*measID5));
// *measID5 = e2sm_met_meas_info[4].meas_type_id;
// meas_action_item5->measID = measID5;
// ASN_SEQUENCE_ADD(&ric_report_style_item->measInfo_Action_List.list, meas_action_item5);
ric_report_style_item->ric_IndicationHeaderFormat_Type = 1;
ric_report_style_item->ric_IndicationMessageFormat_Type = 1;
ASN_SEQUENCE_ADD(&func_def->ric_ReportStyle_List->list, ric_report_style_item);
//xer_fprint(stderr, &asn_DEF_E2SM_MET_E2SM_MET_RANfunction_Description, func_def);
RIC_AGENT_INFO("_______\n");
func->enc_definition_len = e2ap_encode(&asn_DEF_E2SM_MET_E2SM_MET_RANfunction_Description,0, func_def,&func->enc_definition);
RIC_AGENT_INFO("_______\n");
RIC_AGENT_INFO("------ RAN FUNC DEF ENC Len:%lu-------\n", func->enc_definition_len);
if (func->enc_definition_len < 0) {
RIC_AGENT_ERROR("failed to encode RANfunction_List in E2SM MET func description; aborting!");
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_E2SM_MET_E2SM_MET_RANfunction_Description, func_def);
free(func_def);
free(func);
return -1;
}
func->enabled = 1;
func->definition = func_def;
#if 0
/* Test code */
E2SM_MET_E2SM_MET_RANfunction_Description_t *func_defi;
asn_dec_rval_t decode_result;
decode_result = aper_decode_complete(NULL, &asn_DEF_E2SM_MET_E2SM_MET_RANfunction_Description,
(void **)&func_defi, func->enc_definition, func->enc_definition_len);
DevAssert(decode_result.code == RC_OK);
#endif
return ric_agent_register_ran_function(func);
}
//!SECTION
static int e2sm_met_subscription_add(ric_agent_info_t *ric, ric_subscription_t *sub)
{
/* XXX: process E2SM content. */
if (LIST_EMPTY(&ric->subscription_list)) {
LIST_INSERT_HEAD(&ric->subscription_list,sub,subscriptions);
}
else {
LIST_INSERT_BEFORE(LIST_FIRST(&ric->subscription_list),sub,subscriptions);
}
return 0;
}
static int e2sm_met_subscription_del(ric_agent_info_t *ric, ric_subscription_t *sub, int force,long *cause,long *cause_detail)
{
timer_remove(ric->e2sm_met_timer_id);
LIST_REMOVE(sub, subscriptions);
ric_free_subscription(sub);
return 0;
}
static int e2sm_met_control(ric_agent_info_t *ric,ric_control_t *control)
{
return 0;
}
static char *time_stamp(void)
{
char *timestamp = (char *)malloc(sizeof(char) * 128);
time_t ltime;
ltime=time(NULL);
struct tm *tm;
tm=localtime(&ltime);
sprintf(timestamp,"%d/%d/%d | %d:%d:%d", tm->tm_year+1900, tm->tm_mon,
tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec);
return timestamp;
}
static int e2sm_met_ricInd_timer_expiry(
ric_agent_info_t *ric,
long timer_id,
ric_ran_function_id_t function_id,
long request_id,
long instance_id,
long action_id,
uint8_t **outbuf,
uint32_t *outlen)
{
//call of the debug function
// test_met();
E2SM_MET_E2SM_MET_IndicationMessage_t* indicationmessage;
ric_subscription_t *rs;
DevAssert(timer_id == ric->e2sm_met_timer_id);
char *time = time_stamp();
RIC_AGENT_INFO("[%s] ---- Sending MET RIC Indication, timer_id %ld function_id %ld---------\n",
time, timer_id, function_id);
free(time);
/* Fetch the RIC Subscription */
rs = ric_agent_lookup_subscription(ric,request_id,instance_id,function_id);
if (!rs) {
RIC_AGENT_ERROR("failed to find subscription %ld/%ld/%ld\n", request_id,instance_id,function_id);
}
//REVIEW update the name and the params if necessar
indicationmessage = encode_met_Indication_Msg(ric, rs);
{
char *error_buf = (char*)calloc(300, sizeof(char));
size_t errlen = 0;
asn_check_constraints(&asn_DEF_E2SM_MET_E2SM_MET_IndicationMessage, indicationmessage, error_buf, &errlen);
// fprintf(stderr,"MET IND error length %zu\n", errlen);
// fprintf(stderr,"MET IND error buf %s\n", error_buf);
// free(error_buf);
// xer_fprint(stderr, &asn_DEF_E2SM_MET_E2SM_MET_IndicationMessage, indicationmessage);
}
// g_granularityIndx = 0; // Resetting
// xer_fprint(stderr, &asn_DEF_E2SM_MET_E2SM_MET_IndicationMessage, indicationmessage);
uint8_t e2smbuffer[8192];
size_t e2smbuffer_size = 8192;
asn_enc_rval_t er = asn_encode_to_buffer(NULL,
ATS_ALIGNED_BASIC_PER,
&asn_DEF_E2SM_MET_E2SM_MET_IndicationMessage,
indicationmessage, e2smbuffer, e2smbuffer_size);
fprintf(stderr, "er encded is %zu\n", er.encoded);
fprintf(stderr, "after encoding MET IND message\n");
#if 0
fprintf(stderr, "Here is the message:n\n");
for (int i = 0; i < er.encoded; i++)
{
fprintf(stderr, "0x%02x,", e2smbuffer[i]);
}
if (er.encoded < 0) {
fprintf(stderr, "ERROR encoding indication header, name=%s, tag=%s", er.failed_type->name, er.failed_type->xml_tag);
}
DevAssert(er.encoded >= 0);
#endif
E2AP_E2AP_PDU_t *e2ap_pdu = (E2AP_E2AP_PDU_t*)calloc(1, sizeof(E2AP_E2AP_PDU_t));
E2SM_MET_E2SM_MET_IndicationHeader_t* ind_header_style1 =
(E2SM_MET_E2SM_MET_IndicationHeader_t*)calloc(1,sizeof(E2SM_MET_E2SM_MET_IndicationHeader_t));
//REVIEW update the name and the params if necessar
encode_e2sm_met_indication_header(ric->ranid, ind_header_style1);
uint8_t e2sm_header_buf_style1[8192];
size_t e2sm_header_buf_size_style1 = 8192;
asn_enc_rval_t er_header_style1 = asn_encode_to_buffer(
NULL,
ATS_ALIGNED_BASIC_PER,
&asn_DEF_E2SM_MET_E2SM_MET_IndicationHeader,
ind_header_style1,
e2sm_header_buf_style1,
e2sm_header_buf_size_style1);
if (er_header_style1.encoded < 0) {
fprintf(stderr, "ERROR encoding indication header, name=%s, tag=%s", er_header_style1.failed_type->name, er_header_style1.failed_type->xml_tag);
}
DevAssert(er_header_style1.encoded >= 0);
#if 0
fprintf(stderr, "Here is the ind header: len = %d \n",er_header_style1.encoded);
for (int i = 0; i < er_header_style1.encoded; i++)
{
fprintf(stderr, "0x%02x,", e2sm_header_buf_style1[i]);
}
fprintf(stderr,"\n\n");
if (er.encoded < 0) {
fprintf(stderr, "ERROR encoding indication header, name=%s, tag=%s", er.failed_type->name, er.failed_type->xml_tag);
}
DevAssert(er.encoded >= 0);
#endif
// TODO - remove hardcoded values
generate_e2apv1_indication_request_parameterized(
e2ap_pdu, request_id, instance_id, function_id, action_id,
0, e2sm_header_buf_style1, er_header_style1.encoded,
e2smbuffer, er.encoded);
*outlen = e2ap_asn1c_encode_pdu(e2ap_pdu, outbuf);
return 0;
}
// ANCHOR primary check of the function passed
// TODO this is a requirements (aka used by handle time expircy function) so it is imported here to be later modified to meet MET SM defs
// REVIEW this contains the dummy data, it is not real ones + it is duplicated aka RecordItems are creaated once and duplicated in all Records in measData
// the thing that made this the the use of a table aka array instead of a matrix for troring the measurments : g_indMsgMeasRecItemArr
static E2SM_MET_E2SM_MET_IndicationMessage_t*
encode_met_Indication_Msg(ric_agent_info_t* ric, ric_subscription_t *rs)
{
int ret, ret2;
uint64_t i;
E2SM_MET_MeasurementData_t* meas_data;
E2SM_MET_MeasurementRecord_t* meas_rec[MAX_UE];
//REVIEW this local variable can be used later on to hold the real data then extra saves my be added
// E2SM_MET_MeasurementRecordItem_t* meas_data_item[MAX_RECORD_ITEM];
// if (action_def_missing == TRUE)
// if (1)
// {
// for (i = 0; i < MAX_RECORD_ITEM ; i++)
// {
// g_indMsgMeasRecItemArr[i] = (E2SM_MET_MeasurementRecordItem_t *)calloc(1,sizeof(E2SM_MET_MeasurementRecordItem_t));
// g_indMsgMeasRecItemArr[i]->present = E2SM_MET_MeasurementRecordItem_PR_integer;
// g_indMsgMeasRecItemArr[i]->choice.integer = ;
// // switch(i)
// // {
// // case 0:/*RRC.ConnEstabAtt.sum*/
// // g_indMsgMeasRecItemArr[i]->choice.integer = 21;
// // break;
// // case 1:/*RRC.ConnEstabSucc.sum*/
// // g_indMsgMeasRecItemArr[i]->choice.integer = 10;
// // break;
// // case 2:/*RRC.ConnReEstabAtt.sum*/
// // g_indMsgMeasRecItemArr[i]->choice.integer = 10;
// // break;
// // case 3:/*RRC.ConnMean*/
// // g_indMsgMeasRecItemArr[i]->choice.integer = 10;
// // break;
// // case 4:/*RRC.ConnMax*/
// // g_indMsgMeasRecItemArr[i]->choice.integer = 10;
// // break;
// // default:
// // break;
// // }
// }
// // g_granularityIndx = 1;
// }
//RIC_AGENT_INFO("Granularity Idx=:%d\n",g_granularityIndx);
/*
* measData->measurementRecord (List)
*/
meas_data = (E2SM_MET_MeasurementData_t*)calloc(1, sizeof(E2SM_MET_MeasurementData_t));
DevAssert(meas_data!=NULL);
#if 0
int64_t tmp_id = 11;
E2SM_MET_MeasurementRecord_t *meas_rec_debug = (E2SM_MET_MeasurementRecord_t *)calloc(1, sizeof(E2SM_MET_MeasurementRecord_t));
// meas_rec[k]->ueID = asn_int642INTEGER(meas_rec[k]->ueID,k);
// ret = asn_uint642INTEGER(&meas_rec_debug->ueID,tmp_id);
meas_rec_debug->ueID = 10;
// char *name = "AAAA";
// meas_rec_debug->ueTag.buf = (uint8_t *)strdup(name);
// meas_rec_debug->ueTag.size = strlen(name);
// meas_rec[k]->ueTag = "ABC";
// ret2 = OCTET_STRING_fromString(&meas_rec_debug->ueTag,"ABC");
E2SM_MET_MeasurementRecordItem_t *t = (E2SM_MET_MeasurementRecordItem_t *)calloc(1,sizeof(E2SM_MET_MeasurementRecordItem_t));
t->present = E2SM_MET_MeasurementRecordItem_PR_integer;
t->choice.integer = 10;
E2SM_MET_MeasurementRecordItem_t *t2 = (E2SM_MET_MeasurementRecordItem_t *)calloc(1,sizeof(E2SM_MET_MeasurementRecordItem_t));
t2->present = E2SM_MET_MeasurementRecordItem_PR_integer;
t2->choice.integer = 20;
ret = ASN_SEQUENCE_ADD(&meas_rec_debug->measRecordItem.list, t);
DevAssert(ret == 0);
ret = ASN_SEQUENCE_ADD(&meas_rec_debug->measRecordItem.list, t2);
DevAssert(ret == 0);
// xer_fprint(stderr, &asn_DEF_E2SM_MET_MeasurementRecord,meas_rec_debug);
encode_decode(meas_rec_debug);
// log_buf_content(meas_rec_debug,&asn_DEF_E2SM_MET_MeasurementRecord,"helllooo measRec--" );
#endif
gNB_MAC_INST *gNB_mac = RC.nrmac[0];
NR_UE_info_t *UE_info = &gNB_mac->UE_info;
//int nbue = UE_info->num_UEs;
//printf("UEs number at MAC: %d\n",nbue);
//if (nbue <=0) continue;
int k = 0;
UE_iterator(RC.nrmac[0]->UE_info.list, UE) {
NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl; /*
* Measurement Record->MeasurementRecordItem (List)
*/
const rnti_t rnti = UE->rnti;
NR_mac_stats_t *stats = &UE->mac_stats;
meas_rec[k] = (E2SM_MET_MeasurementRecord_t *)calloc(1, sizeof(E2SM_MET_MeasurementRecord_t));
// meas_rec[k]->ueID = asn_int642INTEGER(meas_rec[k]->ueID,k);
// int ret1 = asn_uint642INTEGER(&meas_rec[k]->ueID,tmp_id);
meas_rec[k]->ueID = k;
// meas_rec[k]->ueTag = "AAA";
// int ret22 = OCTET_STRING_fromString(&meas_rec[k]->ueTag,"ABC");
// E2SM_MET_UETag_t *ueTag = (E2SM_MET_UETag_t *)calloc(1, sizeof(E2SM_MET_UETag_t));
// int ret22 = OCTET_STRING_fromString(ueTag,"AAAA");
meas_rec[k]->ueTag.buf = (uint8_t *)strdup("AAA");
meas_rec[k]->ueTag.size = strlen("AAA");
E2SM_MET_MeasurementRecordItem_t *g_indMsgMeasRecItem = (E2SM_MET_MeasurementRecordItem_t *)calloc(1,sizeof(E2SM_MET_MeasurementRecordItem_t));
g_indMsgMeasRecItem->present = E2SM_MET_MeasurementRecordItem_PR_integer;
g_indMsgMeasRecItem->choice.integer = sched_ctrl->ph;
ret = ASN_SEQUENCE_ADD(&meas_rec[k]->measRecordItem.list, g_indMsgMeasRecItem);
DevAssert(ret == 0);
E2SM_MET_MeasurementRecordItem_t *g_indMsgMeasRecItem1 = (E2SM_MET_MeasurementRecordItem_t *)calloc(1,sizeof(E2SM_MET_MeasurementRecordItem_t));
g_indMsgMeasRecItem1->present = E2SM_MET_MeasurementRecordItem_PR_integer;
g_indMsgMeasRecItem1->choice.integer = sched_ctrl->dl_bler_stats.mcs;
ret = ASN_SEQUENCE_ADD(&meas_rec[k]->measRecordItem.list, g_indMsgMeasRecItem1);
DevAssert(ret == 0);
// for(i=0; i < MAX_RECORD_ITEM; i++)
// {
// /* Meas Records meas_rec[] have to be prepared for each Meas data item */
// E2SM_MET_MeasurementRecordItem_t g_indMsgMeasRecItem = (E2SM_MET_MeasurementRecordItem_t *)calloc(1,sizeof(E2SM_MET_MeasurementRecordItem_t));
// g_indMsgMeasRecItem->present = E2SM_MET_MeasurementRecordItem_PR_integer;
// g_indMsgMeasRecItem->choice.integer = ;
// ret = ASN_SEQUENCE_ADD(&meas_rec[k]->measRecordItem.list, g_indMsgMeasRecItem);
// DevAssert(ret == 0);
// }
//this section is commmented because unlike the original KPM asn1 def the MET does not use DataItem but the structure is
// directly Data -> Record -> RecordItem
// /* MeasDataItem*/
// meas_data_item[k] = (E2SM_KPM_MeasurementDataItem_KPMv2_t*)calloc(1, sizeof(E2SM_KPM_MeasurementDataItem_KPMv2_t));
// meas_data_item[k]->measRecord = *meas_rec[k];
/* Enqueue Meas data items */
ret = ASN_SEQUENCE_ADD(&meas_data->list, meas_rec[k]);
DevAssert(ret == 0);
k++;
}
/*
* measInfoList
*/
E2SM_MET_E2SM_MET_IndicationMessage_Format1_t* format =
(E2SM_MET_E2SM_MET_IndicationMessage_Format1_t*)calloc(1, sizeof(E2SM_MET_E2SM_MET_IndicationMessage_Format1_t));
ASN_STRUCT_RESET(asn_DEF_E2SM_MET_E2SM_MET_IndicationMessage_Format1, format);
// format->measInfoList = (E2SM_MET_MeasurementInfoList_t*)calloc(1, sizeof(E2SM_MET_MeasurementInfoList_t));
/*
* IndicationMessage_Format1 -> measInfoList
* IndicationMessage_Format1 -> measData
*/
// format->subscriptID.size = g_subscriptionID.size;
// format->subscriptID.buf = g_subscriptionID.buf;
uint16_t tmpp = 10;
// format->subscriptID = tmpp;
//ANCHOR This sub Id is important so avoid e2t crash
uint64_t subsId = 10;//hack
// ret = asn_uint642INTEGER(&g_subscriptionID,subsId);
format->subscriptID =10;
format->measData = *meas_data;
// format->granulPeriod = g_granulPeriod;
/*
* IndicationMessage -> IndicationMessage_Format1
*/
E2SM_MET_E2SM_MET_IndicationMessage_t* indicationmessage =
(E2SM_MET_E2SM_MET_IndicationMessage_t*)calloc(1, sizeof(E2SM_MET_E2SM_MET_IndicationMessage_t));
indicationmessage->indicationMessage_formats.present =
E2SM_MET_E2SM_MET_IndicationMessage__indicationMessage_formats_PR_indicationMessage_Format1;
indicationmessage->indicationMessage_formats.choice.indicationMessage_Format1 = *format;
// E2SM_MET_E2SM_MET_IndicationMessage_t* tmp_ind =
// (E2SM_MET_E2SM_MET_IndicationMessage_t*)calloc(1, sizeof(E2SM_MET_E2SM_MET_IndicationMessage_t));
// // encode_decode(&asn_DEF_E2SM_MET_E2SM_MET_IndicationMessage,indicationmessage,tmp_ind);
// E2SM_MET_E2SM_MET_IndicationMessage_t* tmp_indicationmessage =
// (E2SM_MET_E2SM_MET_IndicationMessage_t*)calloc(1, sizeof(E2SM_MET_E2SM_MET_IndicationMessage_t));
// encode_decode(&asn_DEF_E2SM_MET_E2SM_MET_IndicationMessage,indicationmessage,tmp_indicationmessage);
return indicationmessage;
}
//REVIEW AT the end of the function what known isses :
// the granurality period and subId are not set by nay other function
// SECTION
//TODO this is also a requirement of the function e2sm_met_ricInd_timer_expiry imported here to be set to hundle MET SM
//ANCHOR primary check passed
void encode_e2sm_met_indication_header(ranid_t ranid, E2SM_MET_E2SM_MET_IndicationHeader_t *ihead)
{
ihead->indicationHeader_formats.present = E2SM_MET_E2SM_MET_IndicationHeader__indicationHeader_formats_PR_indicationHeader_Format1;
E2SM_MET_E2SM_MET_IndicationHeader_Format1_t* ind_header = &ihead->indicationHeader_formats.choice.indicationHeader_Format1;
/* MET Node ID */
ind_header->metNodeID = (E2SM_MET_GlobalMETnode_ID_t *)calloc(1,sizeof(E2SM_MET_GlobalMETnode_ID_t));
//REVIEW is the init of an int done correctly
*ind_header->metNodeID = 10; // hack
// *(ind_header->metNodeID) = 10; //REVIEW // hack
/* Collect Start Time Stamp */
/* Encoded in the same format as the first four octets of the 64-bit timestamp format as defined in section 6 of IETF RFC 5905 */
ind_header->colletStartTime.buf = (uint8_t *)calloc(1, 4);
ind_header->colletStartTime.size = 4;
*((uint32_t *)(ind_header->colletStartTime.buf)) = htonl((uint32_t)time(NULL));
// E2SM_MET_MeasurementInfoList_t* meas_info_list = (E2SM_MET_MeasurementInfoList_t*)calloc(1, sizeof(E2SM_MET_MeasurementInfoList_t));
E2SM_MET_MeasurementInfoItem_t* meas_info_item1 = (E2SM_MET_MeasurementInfoItem_t*)calloc(1, sizeof(E2SM_MET_MeasurementInfoItem_t));
meas_info_item1->buf = (uint8_t *)strdup("mcs");
meas_info_item1->size = strlen("mcs");
int ret = ASN_SEQUENCE_ADD( &ind_header->measInfoList.list, meas_info_item1);
DevAssert(ret == 0);
E2SM_MET_MeasurementInfoItem_t* meas_info_item2 = (E2SM_MET_MeasurementInfoItem_t*)calloc(1, sizeof(E2SM_MET_MeasurementInfoItem_t));
meas_info_item2->buf = (uint8_t *)strdup("phr");
meas_info_item2->size = strlen("phr");
ret = ASN_SEQUENCE_ADD( &ind_header->measInfoList.list, meas_info_item2);
DevAssert(ret == 0);
E2SM_MET_MeasurementInfoItem_t* meas_info_item3 = (E2SM_MET_MeasurementInfoItem_t*)calloc(1, sizeof(E2SM_MET_MeasurementInfoItem_t));
meas_info_item3->buf = (uint8_t *)strdup("bler");
meas_info_item3->size = strlen("bler");
ret = ASN_SEQUENCE_ADD(&ind_header->measInfoList.list, meas_info_item3);
DevAssert(ret == 0);
E2SM_MET_MeasurementInfoItem_t* meas_info_item4 = (E2SM_MET_MeasurementInfoItem_t*)calloc(1, sizeof(E2SM_MET_MeasurementInfoItem_t));
meas_info_item4->buf = (uint8_t *)strdup("errors");
meas_info_item4->size = strlen("errors");
ret = ASN_SEQUENCE_ADD(&ind_header->measInfoList.list, meas_info_item4);
DevAssert(ret == 0);
E2SM_MET_MeasurementInfoItem_t* meas_info_item5 = (E2SM_MET_MeasurementInfoItem_t*)calloc(1, sizeof(E2SM_MET_MeasurementInfoItem_t));
meas_info_item5->buf = (uint8_t *)strdup("throughput");
meas_info_item5->size = strlen("throughput");
ret = ASN_SEQUENCE_ADD(&ind_header->measInfoList.list, meas_info_item5);
DevAssert(ret == 0);
E2SM_MET_MeasurementInfoItem_t* meas_info_item6 = (E2SM_MET_MeasurementInfoItem_t*)calloc(1, sizeof(E2SM_MET_MeasurementInfoItem_t));
meas_info_item6->buf = (uint8_t *)strdup("snr");
meas_info_item6->size = strlen("snr");
ret = ASN_SEQUENCE_ADD(&ind_header->measInfoList.list, meas_info_item6);
DevAssert(ret == 0);
E2SM_MET_MeasurementInfoItem_t* meas_info_item7 = (E2SM_MET_MeasurementInfoItem_t*)calloc(1, sizeof(E2SM_MET_MeasurementInfoItem_t));
meas_info_item7->buf = (uint8_t *)strdup("rsrp");
meas_info_item7->size = strlen("rsrp");
ret = ASN_SEQUENCE_ADD(&ind_header->measInfoList.list, meas_info_item7);
DevAssert(ret == 0);
E2SM_MET_MeasurementInfoItem_t* meas_info_item8 = (E2SM_MET_MeasurementInfoItem_t*)calloc(1, sizeof(E2SM_MET_MeasurementInfoItem_t));
meas_info_item8->buf = (uint8_t *)strdup("cqi");
meas_info_item8->size = strlen("cqi");
ret = ASN_SEQUENCE_ADD(&ind_header->measInfoList.list, meas_info_item8);
DevAssert(ret == 0);
//debug
E2SM_MET_E2SM_MET_IndicationHeader_t* tmp_ind_header =
(E2SM_MET_E2SM_MET_IndicationHeader_t*)calloc(1,sizeof(E2SM_MET_E2SM_MET_IndicationHeader_t));
encode_decode(&asn_DEF_E2SM_MET_E2SM_MET_IndicationHeader,ihead,tmp_ind_header);
//xer_fprint(stderr, &asn_DEF_E2SM_KPM_E2SM_KPMv2_IndicationHeader, ihead);
}
//REVIEW AT the end of the function what known isses :
// the ranid arg is not used and we are not sure yet whether the IE affectations are correct or not
// !SECTION
//SECTION this function is triggered when the granularity period timer is expired
// unlike KPM, MET service model does not need this function at the present version
// because infos are gathered only when the Indication message is expired
static int e2sm_met_gp_timer_expiry(
ric_agent_info_t *ric,
long timer_id,
ric_ran_function_id_t function_id,
long request_id,
long instance_id,
long action_id,
uint8_t **outbuf,
uint32_t *outlen)
{
// this functions fundles the expiration of the granularity period timer
// in the normal use case this will trigger a data gathering loop that will save
// the needed data in the global structure (matrix) of DataInfoItem
return 0;
}
// !SECTION
// SECTION decode_and_handle_action_def function is responsable for getting the details of the sub and
// the infos needed for the RAN function to work
int
e2sm_met_decode_and_handle_action_def(uint8_t *def_buf,
size_t def_size,
ric_ran_function_t *func,
uint32_t interval_ms,
ric_subscription_t* rs,
ric_agent_info_t *ric)
{
uint64_t subsId = 10;//hack
// g_indMsgMeasInfoCnt = 0; // resetting
//REVIEW here since our SM is a very basic one with one default action Def and report style
// we didn't respect the ORAN structure and we took a shortcut by ignoring the actionDefinitions
// here in the code bellow we just assume that there is no action def
// if (def_size == 0)
{
/* In case of missing action list, all Meas Info should be reported to RIC */
// RIC_AGENT_INFO("ACTION Def missing, populating all KPM Data\n");
// for (i = 0; i < MAX_KPM_MEAS; i++)
// {
// g_indMsgMeasInfoItemArr[g_indMsgMeasInfoCnt] =
// (E2SM_KPM_MeasurementInfoItem_KPMv2_t *)calloc(1,sizeof(E2SM_KPM_MeasurementInfoItem_KPMv2_t));
// g_indMsgMeasInfoItemArr[g_indMsgMeasInfoCnt].present = E2SM_KPM_MeasurementType_KPMv2_PR_measName;
// g_indMsgMeasInfoItemArr[g_indMsgMeasInfoCnt].choice.measName.buf =
// (uint8_t *)strdup(e2sm_met_meas_info[i].meas_type_name);
// g_indMsgMeasInfoItemArr[g_indMsgMeasInfoCnt].choice.measName.size =
// strlen(e2sm_met_meas_info[i].meas_type_name);
// e2sm_met_meas_info[i].subscription_status = TRUE;
// g_indMsgMeasInfoCnt++;
// }
// *g_granulPeriod = 10; //Hack
/* Hack - Subscription ID */
//g_subscriptionID.size = sizeof(subsId);
//g_subscriptionID.buf = (uint8_t *)calloc(1,sizeof(subsId));
//*g_subscriptionID.buf = subsId;
// g_subscriptionID = subsId; // this is a wrong assignment
// asn_uint642INTEGER(&g_subscriptionID,subsId);
// action_def_missing = TRUE; /* Granularity Timer will not start */
return 0;
}
}
// !SECTION

View File

@@ -0,0 +1,15 @@
#ifndef _E2SM_COMMON_H_
#define _E2SM_COMMON_H_
extern int e2sm_met_init(void);
extern int
e2sm_met_decode_and_handle_action_def(uint8_t *def_buf,
size_t def_size,
ric_ran_function_t *func,
uint32_t interval_ms,
ric_subscription_t* rs,
ric_agent_info_t *ric);
#endif /* _E2SM_COMMON_H_ */

View File

@@ -0,0 +1,157 @@
#include <stdio.h>
#include <stddef.h>
#include "met_debug.h"
#include "common/utils/assertions.h"
#include "E2SM_MET_MeasurementRecord.h"
#include "E2SM_MET_MeasurementRecord.h"
#include "E2SM_MET_MeasurementRecordItem.h"
#include "E2SM_MET_MeasurementInfoItem.h"
#include "E2SM_MET_MeasurementInfoList.h"
void encode_decode(const struct asn_TYPE_descriptor_s *td, const void *struct_ptr,const void *empty_struct_ptr );
void test_met(void);
void test_met2(void);
void test_met2(void){
// creating measurment record item
E2SM_MET_MeasurementInfoItem_t *mii = (E2SM_MET_MeasurementInfoItem_t *)calloc(1, sizeof(E2SM_MET_MeasurementInfoItem_t));
mii->buf = (uint8_t *)strdup("test");
mii->size = strlen("test");
E2SM_MET_MeasurementInfoList_t *mil = (E2SM_MET_MeasurementInfoList_t *)calloc(1, sizeof(E2SM_MET_MeasurementInfoList_t));
ASN_SEQUENCE_ADD(mil,mii);
E2SM_MET_MeasurementInfoList_t *miltmp = (E2SM_MET_MeasurementInfoList_t *)calloc(1, sizeof(E2SM_MET_MeasurementInfoList_t));
encode_decode(&asn_DEF_E2SM_MET_MeasurementInfoList,mil,miltmp);
}
void test_met(void){
E2SM_MET_MeasurementInfoList_t* meas_info_list = (E2SM_MET_MeasurementInfoList_t*)calloc(1, sizeof(E2SM_MET_MeasurementInfoList_t));
E2SM_MET_MeasurementInfoList_t* tmpmeas_info_list = (E2SM_MET_MeasurementInfoList_t*)calloc(1, sizeof(E2SM_MET_MeasurementInfoList_t));
E2SM_MET_MeasurementInfoItem_t* meas_info_item1 = (E2SM_MET_MeasurementInfoItem_t*)calloc(1, sizeof(E2SM_MET_MeasurementInfoItem_t));
meas_info_item1->buf = (uint8_t *)strdup("mcs");
meas_info_item1->size = strlen("mcs");
int ret = ASN_SEQUENCE_ADD(&meas_info_list->list, meas_info_item1);
DevAssert(ret == 0);
E2SM_MET_MeasurementInfoItem_t* meas_info_item2 = (E2SM_MET_MeasurementInfoItem_t*)calloc(1, sizeof(E2SM_MET_MeasurementInfoItem_t));
meas_info_item2->buf = (uint8_t *)strdup("phr");
meas_info_item2->size = strlen("phr");
ret = ASN_SEQUENCE_ADD(&meas_info_list->list, meas_info_item2);
DevAssert(ret == 0);
encode_decode(&asn_DEF_E2SM_MET_MeasurementInfoList,meas_info_list,tmpmeas_info_list);
}
// void test_met(void){
// // creating measurment record item
// E2SM_MET_MeasurementRecordItem_t *mri = (E2SM_MET_MeasurementRecordItem_t *)calloc(1, sizeof(E2SM_MET_MeasurementRecordItem_t));
// mri->choice.integer = 10;
// mri->present = E2SM_MET_MeasurementRecordItem_PR_integer;
// //creating measurment record and affecting UEID and the UETAG
// E2SM_MET_MeasurementRecord_t *deb_mr = (E2SM_MET_MeasurementRecord_t *)calloc(1, sizeof(E2SM_MET_MeasurementRecord_t));
// deb_mr->ueID = 11;
// // E2SM_MET_UETag_t *ueTag = (E2SM_MET_UETag_t *)calloc(1, sizeof(E2SM_MET_UETag_t));
// // int ret22 = OCTET_STRING_fromString(ueTag,"AAAA");
// // if (ret22 != 0) exit(-1);
// // fprintf(stderr, " the %s ---- size : %d \n\n", ueTag->buf, ueTag->size);
// // deb_mr->ueTag = ueTag;
// deb_mr->ueTag.buf = (uint8_t *)strdup("AA");
// deb_mr->ueTag.size = strlen("AA");
// //adding reacord item to the list of measrecords
// int ret = ASN_SEQUENCE_ADD(&deb_mr->measRecordItem.list, mri);
// if (ret != 0) exit(-1);
// // tmp record for debug function
// E2SM_MET_MeasurementRecord_t *mritmp = (E2SM_MET_MeasurementRecord_t *)calloc(1, sizeof(E2SM_MET_MeasurementRecord_t));
// E2SM_MET_MeasurementRecordItem_t *mri0 = (E2SM_MET_MeasurementRecordItem_t *)calloc(1, sizeof(E2SM_MET_MeasurementRecordItem_t));
// encode_decode(&asn_DEF_E2SM_MET_MeasurementRecord,deb_mr,mritmp);
// }
void encode_decode(const struct asn_TYPE_descriptor_s *td, const void *struct_ptr,const void *empty_struct_ptr ){
fprintf(stderr,"start-encode decode------------------ --------------------\n");
uint8_t buffer[8192];
size_t buffer_size = 8192;
//encoding
asn_enc_rval_t ret_enc = asn_encode_to_buffer(
0,
ATS_ALIGNED_BASIC_PER,
td,
struct_ptr,
buffer,
buffer_size);
if (ret_enc.encoded < 0) {
fprintf(stderr, "ERROR encoding, name=%s, tag=%s", ret_enc.failed_type->name, ret_enc.failed_type->xml_tag);
}
xer_fprint(stderr, td,struct_ptr);
// uint8_t buffer2[8192] = {0x00, 0x09, 0x02, 0x00, 0x41, 0x41, 0x41, 0x41, 0x02, 0x00, 0x0a, 0x00, 0x14};
for (int i = 0; i < ret_enc.encoded; i++)
{
fprintf(stderr, "0x%02x,", buffer[i]);
}
fprintf(stderr," encoded is : %ld \n\n",ret_enc.encoded);
//decoding
asn_dec_rval_t er = asn_decode(0, ATS_ALIGNED_BASIC_PER,td,(void **) &empty_struct_ptr, buffer, ret_enc.encoded );
if (er.code != RC_OK) {
fprintf(stderr, "\tERROR decoding - consumed : %ld - code %d\n ",er.consumed,er.code);
}else{
fprintf(stderr,"\t ------- start decoding ------------\n");
xer_fprint(stderr, td ,empty_struct_ptr);
}
fprintf(stderr,"\tend-encode-decode------------------ --------------------\n");
}
void log_decode_buf_content(const void *buffer,size_t buf_len,void **struct_to_decode_and_print,const struct asn_TYPE_descriptor_s *type_to_decode, char title[] ){
fprintf(stderr,"\tstart-decode------------------ %s --------------------\n",title);
///hard coded for measItem
E2SM_MET_MeasurementRecordItem_t *mr = (E2SM_MET_MeasurementRecordItem_t *)calloc(1,sizeof(E2SM_MET_MeasurementRecordItem_t));
asn_dec_rval_t er = asn_decode(0, ATS_ALIGNED_BASIC_PER,&asn_DEF_E2SM_MET_MeasurementRecordItem,(void **) &mr, buffer, buf_len);
if (er.code != RC_OK) {
fprintf(stderr, "\tERROR decoding - consumed : %ld - code %d\n ",er.consumed,er.code);
}else{
fprintf(stderr,"\t ------- start decoding ------------\n");
xer_fprint(stderr, &asn_DEF_E2SM_MET_MeasurementRecord,mr);
}
fprintf(stderr,"\tend-decode------------------ %s --------------------\n",title);
}

View File

@@ -0,0 +1,6 @@
#include "E2SM_MET_SubscriptionID.h"
void test_met(void);
void test_met2(void);
void encode_decode(const struct asn_TYPE_descriptor_s *td, const void *struct_ptr,const void *empty_struct_ptr );

View File

@@ -0,0 +1,539 @@
-- ASN1START
-- **************************************************************
-- E2SM
-- Information Element Definitions
--
-- **************************************************************
E2SM-COMMON-IEs {
iso(1) identified-organization(3) dod(6) internet(1) private(4) enterprise(1) 53148 e2(1) version1 (1) e2sm(2) e2sm-COMMON-IEs (0)}
DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
-- --------------------------------------------------
-- Constants
-- --------------------------------------------------
maxE1APid INTEGER ::= 65535
maxF1APid INTEGER ::= 4
-- IEs derived from 3GPP 36.423 (X2AP)
maxEARFCN INTEGER ::= 65535
-- IEs derived from 3GPP 38.473 (F1AP)
maxNRARFCN INTEGER ::= 3279165
maxnoofNrCellBands INTEGER ::= 32
-- --------------------------------------------------
-- E2SM Commmon IEs
-- --------------------------------------------------
CGI ::= CHOICE {
nR-CGI NR-CGI,
eUTRA-CGI EUTRA-CGI,
...
}
CoreCPID ::= CHOICE {
fiveGC GUAMI,
ePC GUMMEI,
...
}
InterfaceIdentifier ::= CHOICE {
nG InterfaceID-NG,
xN InterfaceID-Xn,
f1 InterfaceID-F1,
e1 InterfaceID-E1,
s1 InterfaceID-S1,
x2 InterfaceID-X2,
w1 InterfaceID-W1,
...
}
InterfaceID-NG ::= SEQUENCE {
guami GUAMI,
...
}
InterfaceID-Xn ::= SEQUENCE {
global-NG-RAN-ID GlobalRANNodeID,
...
}
InterfaceID-F1 ::= SEQUENCE {
global-NG-RAN-ID GlobalRANNodeID,
gNB-DU-ID GNB-DU-ID,
...
}
InterfaceID-E1 ::= SEQUENCE {
global-NG-RAN-ID GlobalRANNodeID,
gNB-CU-UP-ID GNB-CU-UP-ID,
...
}
InterfaceID-S1 ::= SEQUENCE {
gUMMEI GUMMEI,
...
}
InterfaceID-X2 ::= SEQUENCE {
nodeType CHOICE {
global-eNB-ID GlobalENB-ID,
global-en-gNB-ID GlobalenGNB-ID,
...
},
...
}
InterfaceID-W1 ::= SEQUENCE {
global-ng-eNB-ID GlobalNgENB-ID,
ng-eNB-DU-ID NGENB-DU-ID,
...
}
Interface-MessageID ::= SEQUENCE {
interfaceProcedureID INTEGER,
messageType ENUMERATED {initiatingMessage, successfulOutcome, unsuccessfulOutcome, ...},
...
}
InterfaceType ::= ENUMERATED {nG, xn, f1, e1, s1, x2, w1, ...}
GroupID ::= CHOICE {
fiveGC FiveQI,
ePC QCI,
...
}
QoSID ::= CHOICE {
fiveGC FiveQI,
ePC QCI,
...
}
RANfunction-Name ::= SEQUENCE{
ranFunction-ShortName PrintableString(SIZE(1..150,...)),
ranFunction-E2SM-OID PrintableString(SIZE(1..1000,...)),
ranFunction-Description PrintableString(SIZE(1..150,...)),
ranFunction-Instance INTEGER OPTIONAL,
...
}
RIC-Format-Type ::= INTEGER
RIC-Style-Type ::= INTEGER
RIC-Style-Name ::= PrintableString(SIZE(1..150,...))
RRC-MessageID ::= SEQUENCE {
rrcType CHOICE {
lTE RRCclass-LTE,
nR RRCclass-NR,
...
},
messageID INTEGER,
...
}
RRCclass-LTE ::= ENUMERATED {bCCH-BCH, bCCH-BCH-MBMS, bCCH-DL-SCH, bCCH-DL-SCH-BR, bCCH-DL-SCH-MBMS, mCCH, pCCH, dL-CCCH, dL-DCCH, uL-CCCH, uL-DCCH, sC-MCCH, ...}
RRCclass-NR ::= ENUMERATED {bCCH-BCH, bCCH-DL-SCH, dL-CCCH, dL-DCCH, pCCH, uL-CCCH, uL-CCCH1, uL-DCCH, ...}
ServingCell-ARFCN ::= CHOICE {
nR NR-ARFCN,
eUTRA E-UTRA-ARFCN,
...
}
ServingCell-PCI ::= CHOICE {
nR NR-PCI,
eUTRA E-UTRA-PCI,
...
}
UEID ::= CHOICE{
gNB-UEID UEID-GNB,
gNB-DU-UEID UEID-GNB-DU,
gNB-CU-UP-UEID UEID-GNB-CU-UP,
ng-eNB-UEID UEID-NG-ENB,
ng-eNB-DU-UEID UEID-NG-ENB-DU,
en-gNB-UEID UEID-EN-GNB,
eNB-UEID UEID-ENB,
...
}
UEID-GNB ::= SEQUENCE{
amf-UE-NGAP-ID AMF-UE-NGAP-ID,
guami GUAMI,
gNB-CU-UE-F1AP-ID-List UEID-GNB-CU-F1AP-ID-List OPTIONAL,
-- C-ifCUDUseparated: This IE shall be present only for a CU-DU separated gNB. More than 1 F1AP ID shall be reported only when NR-DC is established.
gNB-CU-CP-UE-E1AP-ID-List UEID-GNB-CU-CP-E1AP-ID-List OPTIONAL,
-- C-ifCPUPseparated: This IE shall be present only for a CP-UP separated gNB.
ran-UEID RANUEID OPTIONAL,
m-NG-RAN-UE-XnAP-ID NG-RANnodeUEXnAPID OPTIONAL,
-- C-ifDCSetup: This IE shall be present only if DC is established. To be reported by both MN and SN.
globalGNB-ID GlobalGNB-ID OPTIONAL,
-- C-ifDCSetup: This IE shall be present only if DC is established. To be reported only by SN.
...
}
UEID-GNB-CU-CP-E1AP-ID-List ::= SEQUENCE (SIZE(1..maxE1APid)) OF UEID-GNB-CU-CP-E1AP-ID-Item
UEID-GNB-CU-CP-E1AP-ID-Item ::= SEQUENCE{
gNB-CU-CP-UE-E1AP-ID GNB-CU-CP-UE-E1AP-ID,
...
}
UEID-GNB-CU-F1AP-ID-List ::= SEQUENCE (SIZE(1..maxF1APid)) OF UEID-GNB-CU-CP-F1AP-ID-Item
UEID-GNB-CU-CP-F1AP-ID-Item ::= SEQUENCE{
gNB-CU-UE-F1AP-ID GNB-CU-UE-F1AP-ID,
...
}
UEID-GNB-DU ::= SEQUENCE{
gNB-CU-UE-F1AP-ID GNB-CU-UE-F1AP-ID,
ran-UEID RANUEID OPTIONAL,
...
}
UEID-GNB-CU-UP ::= SEQUENCE{
gNB-CU-CP-UE-E1AP-ID GNB-CU-CP-UE-E1AP-ID,
ran-UEID RANUEID OPTIONAL,
...
}
UEID-NG-ENB ::= SEQUENCE{
amf-UE-NGAP-ID AMF-UE-NGAP-ID,
guami GUAMI,
ng-eNB-CU-UE-W1AP-ID NGENB-CU-UE-W1AP-ID OPTIONAL,
-- C-ifCUDUseperated: This IE shall be present only for a CU-DU seperated ng-eNB.
m-NG-RAN-UE-XnAP-ID NG-RANnodeUEXnAPID OPTIONAL,
-- C-ifDCSetup: This IE shall be present only if DC is established. To be reported by both MN and SN.
globalNgENB-ID GlobalNgENB-ID OPTIONAL,
-- C-ifDCSetup: This IE shall be present only if DC is established. To be reported only by SN.
...
}
UEID-NG-ENB-DU ::= SEQUENCE{
ng-eNB-CU-UE-W1AP-ID NGENB-CU-UE-W1AP-ID,
...
}
UEID-EN-GNB ::= SEQUENCE{
m-eNB-UE-X2AP-ID ENB-UE-X2AP-ID,
m-eNB-UE-X2AP-ID-Extension ENB-UE-X2AP-ID-Extension OPTIONAL,
globalENB-ID GlobalENB-ID,
gNB-CU-UE-F1AP-ID GNB-CU-UE-F1AP-ID OPTIONAL,
-- C-ifCUDUseperated: This IE shall be present only for a CU-DU seperated en-gNB.
gNB-CU-CP-UE-E1AP-ID-List UEID-GNB-CU-CP-E1AP-ID-List OPTIONAL,
-- C-ifCPUPseparated: This IE shall be present only for a CP-UP separated en-gNB.
ran-UEID RANUEID OPTIONAL,
...
}
UEID-ENB ::= SEQUENCE{
mME-UE-S1AP-ID MME-UE-S1AP-ID,
gUMMEI GUMMEI,
m-eNB-UE-X2AP-ID ENB-UE-X2AP-ID OPTIONAL,
-- This IE shall be present only if DC is established. To be reported by MeNB and SeNB.
m-eNB-UE-X2AP-ID-Extension ENB-UE-X2AP-ID-Extension OPTIONAL,
globalENB-ID GlobalENB-ID OPTIONAL,
-- This IE shall be present only if DC is established. To be reported only by SeNB.
...
}
-- **************************************************************
-- 3GPP derived IEs
-- **************************************************************
-- NOTE:
-- - Extension fields removed and replaced with "..."
-- - IE names modified across all extracts to use "PLMNIdentity"
-- **************************************************************
-- IEs derived from 3GPP 36.413 (S1AP)
-- **************************************************************
-- **************************************************************
-- copied from v16.5.0
ENB-ID ::= CHOICE {
macro-eNB-ID BIT STRING (SIZE (20)),
home-eNB-ID BIT STRING (SIZE (28)),
... ,
short-Macro-eNB-ID BIT STRING (SIZE(18)),
long-Macro-eNB-ID BIT STRING (SIZE(21))
}
-- copied from v16.5.0
GlobalENB-ID ::= SEQUENCE {
pLMNIdentity PLMNIdentity,
eNB-ID ENB-ID,
...
}
-- copied from v16.5.0
GUMMEI ::= SEQUENCE {
pLMN-Identity PLMNIdentity,
mME-Group-ID MME-Group-ID,
mME-Code MME-Code,
...
}
-- copied from v16.5.0
MME-Group-ID ::= OCTET STRING (SIZE (2))
-- copied from v16.5.0
MME-Code ::= OCTET STRING (SIZE (1))
-- copied from v16.5.0
MME-UE-S1AP-ID ::= INTEGER (0..4294967295)
-- copied from v16.5.0
QCI ::= INTEGER (0..255)
-- copied from v16.5.0
SubscriberProfileIDforRFP ::= INTEGER (1..256)
-- **************************************************************
-- IEs derived from 3GPP 36.423 (X2AP)
-- **************************************************************
-- Extension fields removed.
-- Note: to avoid duplicate names with NGAP, XnAP, etc.:
-- GNB-ID renamed ENGNB-ID,
-- GlobalGNB-ID renamed GlobalenGNB-ID,
-- UE-X2AP-ID renamed ENB-UE-X2AP-ID
-- UE-X2AP-ID-Extension renamed ENB-UE-X2AP-ID-Extension
-- **************************************************************
-- copied from v16.5.0
EN-GNB-ID ::= CHOICE {
en-gNB-ID BIT STRING (SIZE (22..32)),
...
}
-- copied from v16.5.0
ENB-UE-X2AP-ID ::= INTEGER (0..4095)
-- copied from v16.5.0
ENB-UE-X2AP-ID-Extension ::= INTEGER (0..4095, ...)
-- copied from v16.5.0
E-UTRA-ARFCN ::= INTEGER (0..maxEARFCN)
-- copied from v16.5.0
E-UTRA-PCI ::= INTEGER (0..503, ...)
-- copied from v16.5.0
E-UTRA-TAC ::= OCTET STRING (SIZE(2))
-- copied from v16.5.0
GlobalenGNB-ID ::= SEQUENCE {
pLMN-Identity PLMNIdentity,
en-gNB-ID EN-GNB-ID,
...
}
-- **************************************************************
-- IEs derived from 3GPP 37.473 (W1AP)
-- **************************************************************
-- copied from v16.3.0
NGENB-CU-UE-W1AP-ID ::= INTEGER (0..4294967295)
-- copied from v16.3.0
NGENB-DU-ID ::= INTEGER (0..68719476735)
-- **************************************************************
-- IEs derived from 3GPP 38.413 (NGAP)
-- Extension fields removed and replaced with ...
-- **************************************************************
-- copied from v16.2.0
AMFPointer ::= BIT STRING (SIZE(6))
-- copied from v16.2.0
AMFRegionID ::= BIT STRING (SIZE(8))
-- copied from v16.2.0
AMFSetID ::= BIT STRING (SIZE(10))
-- copied from v16.2.0
AMF-UE-NGAP-ID ::= INTEGER (0..1099511627775)
-- copied from v16.2.0
EUTRACellIdentity ::= BIT STRING (SIZE(28))
-- copied from v16.2.0
EUTRA-CGI ::= SEQUENCE {
pLMNIdentity PLMNIdentity,
eUTRACellIdentity EUTRACellIdentity,
...
}
-- copied from v16.2.0
FiveQI ::= INTEGER (0..255, ...)
-- copied from v16.2.0
GlobalGNB-ID ::= SEQUENCE {
pLMNIdentity PLMNIdentity,
gNB-ID GNB-ID,
...
}
-- copied from v16.2.0
GlobalNgENB-ID ::= SEQUENCE {
pLMNIdentity PLMNIdentity,
ngENB-ID NgENB-ID,
...
}
-- copied from v16.2.0
GlobalRANNodeID ::= CHOICE {
globalGNB-ID GlobalGNB-ID,
globalNgENB-ID GlobalNgENB-ID,
...
}
-- copied from v16.2.0
GNB-ID ::= CHOICE {
gNB-ID BIT STRING (SIZE(22..32)),
...
}
-- copied from v16.2.0
GUAMI ::= SEQUENCE {
pLMNIdentity PLMNIdentity,
aMFRegionID AMFRegionID,
aMFSetID AMFSetID,
aMFPointer AMFPointer,
...
}
-- copied from v16.2.0
IndexToRFSP ::= INTEGER (1..256, ...)
-- copied from v16.2.0
NgENB-ID ::= CHOICE {
macroNgENB-ID BIT STRING (SIZE(20)),
shortMacroNgENB-ID BIT STRING (SIZE(18)),
longMacroNgENB-ID BIT STRING (SIZE(21)),
...
}
-- copied from v16.2.0
NRCellIdentity ::= BIT STRING (SIZE(36))
-- copied from v16.2.0
NR-CGI ::= SEQUENCE {
pLMNIdentity PLMNIdentity,
nRCellIdentity NRCellIdentity,
...
}
-- copied from v16.2.0
PLMNIdentity ::= OCTET STRING (SIZE(3))
-- copied from v16.2.0
QosFlowIdentifier ::= INTEGER (0..63, ...)
-- copied from v16.2.0
SD ::= OCTET STRING (SIZE(3))
-- copied from v16.2.0
S-NSSAI ::= SEQUENCE {
sST SST,
sD SD OPTIONAL,
...
}
-- copied from v16.2.0
SST ::= OCTET STRING (SIZE(1))
-- **************************************************************
-- IEs derived from 3GPP 38.423 (XnAP)
-- **************************************************************
-- copied from v16.2.0
NG-RANnodeUEXnAPID ::= INTEGER (0.. 4294967295)
-- **************************************************************
-- IEs derived from 3GPP 38.463 (E1AP)
-- **************************************************************
-- copied from v16.5.0
GNB-CU-CP-UE-E1AP-ID ::= INTEGER (0..4294967295)
-- copied from v16.5.0
GNB-CU-UP-ID ::= INTEGER (0..68719476735)
-- **************************************************************
-- IEs derived from 3GPP 38.473 (F1AP)
-- **************************************************************
-- copied from v16.5.0
FiveGS-TAC ::= OCTET STRING (SIZE(3))
-- copied from v16.5.0
GNB-CU-UE-F1AP-ID ::= INTEGER (0..4294967295)
-- copied from v16.5.0
GNB-DU-ID ::= INTEGER (0..68719476735)
-- copied from v16.5.0
NR-PCI ::= INTEGER (0..1007)
-- copied from v16.5.0
NR-ARFCN ::= SEQUENCE {
nRARFCN INTEGER (0..maxNRARFCN),
freqBandListNr SEQUENCE (SIZE(1..maxnoofNrCellBands)) OF FreqBandNrItem,
...
}
-- copied from v16.5.0
FreqBandNrItem ::= SEQUENCE {
freqBandIndicatorNr INTEGER (1..1024, ...),
...
}
-- copied from v16.5.0
RANUEID ::= OCTET STRING (SIZE (8))
END

View File

@@ -0,0 +1,368 @@
--*************************************************************
-- E2SM-RSM - E2 Service Model for Ran Slicing Management
-- Information Element Definitions
--
-- **************************************************************
E2SM-RSM-IEs {
iso(1) identified-organization(3) dod(6) internet(1) private(4) enterprise(1) oran(53148) e2(1) version1 (1) e2sm(2) e2sm-RSM-IEs (102)}
DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
IMPORTS
RANfunction-Name,
FiveQI,
QCI,
AMF-UE-NGAP-ID,
CGI
FROM E2SM-COMMON-IEs;
-- **************************************************************
-- E2SM-RSM IDs
-- **************************************************************
maxnoofBearers INTEGER ::= 32
maxnoofUEs INTEGER ::= 4294967295
maxnoofSlices INTEGER ::= 4294967295
SliceID ::= INTEGER (1..maxnoofSlices)
SliceIDAssoc ::= INTEGER(0..maxnoofSlices)
UE-Identity ::= CHOICE {
cuUeF1ApID CU-UE-F1AP-ID,
duUeF1ApID DU-UE-F1AP-ID,
ranUeNgapID RAN-UE-NGAP-ID,
amfUeNgapID AMF-UE-NGAP-ID,
enbUeS1ApID ENB-UE-S1AP-ID,
...
}
UE-ID-Type ::= ENUMERATED{
cuUeF1ApID,
duUeF1ApID,
ranUeNgapID,
amfUeNgapID,
enbUeS1ApID,
...
}
CU-UE-F1AP-ID ::= INTEGER(0..4294967295)
DU-UE-F1AP-ID ::= INTEGER(0..4294967295)
RAN-UE-NGAP-ID ::= INTEGER (0..1099511627775)
ENB-UE-S1AP-ID ::= INTEGER (0..16777215)
QFI ::= INTEGER (0.. 63, ...)
-- ***************************************************************
-- Slicing capabilities
-- ***************************************************************
maxnoofSlicingNodes INTEGER ::= 4294967295
SlicingType ::= ENUMERATED{
static,
dynamic,
...
}
NodeSlicingCapability-Item ::= SEQUENCE {
maxNumberOfSlicesDL INTEGER(0..maxnoofSlices),
maxNumberOfSlicesUL INTEGER(0..maxnoofSlices),
slicingType SlicingType,
maxNumberOfUEsPerSlice INTEGER,
supportedConfig SEQUENCE (SIZE(1..5, ...)) OF SupportedSlicingConfig-Item,
...
}
SupportedSlicingConfig-Item ::= SEQUENCE {
slicingConfigType E2SM-RSM-Command,
...
}
-- ***************************************************************
-- Slicing metrics
-- ***************************************************************
SliceMetrics ::= SEQUENCE {
prbUtilization INTEGER(0..100), -- Tells % of Radio Resources utilized per slice
numUeAssocToSlice INTEGER(0..maxnoofUEs),
sliceLevelBLER INTEGER(0..100), -- Number of retransmission happened in slice, BLock Error Rate (BLER)
avgCQI INTEGER(0..15), -- Channel Quality Indicator (CQI)
...
}
-- ***************************************************************
-- E2SM-RSM Event Trigger Definition OCTET STRING
-- ***************************************************************
RSM-EMM-Trigger-Type ::= ENUMERATED{
ueAttach,
ueDetach,
handInUeAttach,
handOutUeAttach,
...
}
E2SM-RSM-EventTriggerDefinition ::= SEQUENCE{
eventDefinition-formats CHOICE{
eventDefinition-Format1 E2SM-RSM-EventTriggerDefinition-Format1,
...
},
...
}
E2SM-RSM-EventTriggerDefinition-Format1 ::= SEQUENCE{
triggerType RSM-RICindication-Trigger-Type,
reportingPeriod-ms INTEGER OPTIONAL,
...
}
RSM-RICindication-Trigger-Type ::= ENUMERATED{
periodic-metrics,
upon-emm-event,
...
}
-- **************************************************************
-- E2SM-RSM Indication Header - to report attach/detach
-- **************************************************************
E2SM-RSM-IndicationHeader ::= CHOICE {
indicationHeader-Format1 E2SM-RSM-IndicationHeader-Format1,
...
}
E2SM-RSM-IndicationHeader-Format1 ::= SEQUENCE {
cgi CGI,
colletStartTime OCTET STRING (SIZE(4)) OPTIONAL,
...
}
-- **************************************************************
-- E2SM-RSM Indication Message
-- **************************************************************
EMMCase::= ENUMERATED {attached, detached, ...}
E2SM-RSM-IndicationMessage ::= CHOICE {
indicationMessage-Format1 E2SM-RSM-IndicationMessage-Format1,
indicationMessage-Format2 E2SM-RSM-IndicationMessage-Format2,
...
}
E2SM-RSM-IndicationMessage-Format1 ::= SEQUENCE {
ueId UE-Identity,
cuUeF1apId CU-UE-F1AP-ID,
duUeF1apId DU-UE-F1AP-ID,
emmCase EMMCase,
ulSlicingMetrics SEQUENCE (SIZE(1..maxnoofSlices)) OF SliceMetrics,
dlSlicingMetrics SEQUENCE (SIZE(1..maxnoofSlices)) OF SliceMetrics,
...
}
E2SM-RSM-IndicationMessage-Format2 ::= SEQUENCE{
emmType RSM-EMM-Trigger-Type,
ueIDlist SEQUENCE (SIZE(1..4, ...)) OF UE-Identity, -- all UE IDs in the list should belong to same UE
prefferedUeIDType UE-ID-Type,
bearerID SEQUENCE (SIZE(1..maxnoofBearers)) OF Bearer-ID OPTIONAL, -- Should be mandatory included in case of UeAttach and handInUeAttach
...
}
-- **************************************************************
-- E2SM-RSM control command types
-- **************************************************************
E2SM-RSM-Command ::= ENUMERATED {
sliceCreate,
sliceUpdate,
sliceDelete,
ueAssociate,
eventTriggers,
...
}
-- **************************************************************
-- E2SM-RSM slice management
-- **************************************************************
SchedulerType ::= ENUMERATED {
roundRobin,
proportionallyFair,
qosBased,
...
}
SliceParameters ::= SEQUENCE {
schedulerType SchedulerType,
weight INTEGER(1.. 100) OPTIONAL,
qosLevel INTEGER(1.. 129, ...) OPTIONAL,
scheduleInfo ScheduleConfig OPTIONAL,
...
}
SliceConfig ::= SEQUENCE {
sliceID SliceID,
sliceDescription PrintableString(SIZE(1.. 160, ...)) OPTIONAL,
sliceConfigParameters SliceParameters,
sliceType SliceType,
...
}
SliceType ::= ENUMERATED{
dlSlice,
ulSlice
}
SliceDelete ::= SEQUENCE {
sliceID SliceID,
sliceType SliceType,
...
}
-- **************************************************************
-- E2SM-RSM UE to Slice association
-- **************************************************************
SliceAssociate ::= SEQUENCE {
ueId UE-Identity,
bearerID SEQUENCE (SIZE(1..maxnoofBearers)) OF Bearer-ID,
downLinkSliceID SliceIDAssoc,
uplinkSliceID SliceIDAssoc OPTIONAL,
...
}
Bearer-ID ::= CHOICE {
drbID Drb-ID,
...
}
Drb-ID ::= CHOICE {
fourGDrbID FourG-Drb-ID,
fiveGDrbID FiveG-Drb-ID,
...
}
FiveG-Drb-ID ::= SEQUENCE {
value INTEGER(1..32),
qfi QFI,
flowsMapToDrb SEQUENCE (SIZE(1..64)) OF QoSflowLevelParameters,
...
}
QoSflowLevelParameters ::= CHOICE {
dynamicFiveQi DynamicFiveQI,
nonDynamicFiveQi NonDynamicFiveQI,
...
}
DynamicFiveQI ::= SEQUENCE {
priorityLevel INTEGER(0..127, ...),
packetDelayBudget INTEGER(0..63, ...),
packetErrorRate INTEGER(0..63, ...),
...
}
NonDynamicFiveQI ::= SEQUENCE {
fiveQi FiveQI,
...
}
FourG-Drb-ID ::= SEQUENCE {
value INTEGER(1..32),
qci QCI,
...
}
-- **************************************************************
-- E2AP IEs defined by E2SM-RSM
-- **************************************************************
-- E2SM-RSM-RANfunction-Description
E2SM-RSM-RANfunction-Description ::= SEQUENCE {
ranFunction-Name RANfunction-Name,
ric-Slicing-Node-Capability-List SEQUENCE (SIZE(1..maxnoofSlicingNodes)) OF NodeSlicingCapability-Item,
...
}
-- E2SM-RSM-ControlHeader IE
E2SM-RSM-ControlHeader ::= SEQUENCE {
rsm-command E2SM-RSM-Command,
...
}
-- E2SM-RSM-ControlMessage IE
E2SM-RSM-ControlMessage ::= CHOICE {
sliceCreate SliceConfig,
sliceUpdate SliceConfig,
sliceDelete SliceDelete,
sliceAssociate SliceAssociate,
...
}
-- **************************************************************
-- E2SM-RSM optional, advanced slice management
-- **************************************************************
ScheduleConfig ::= SEQUENCE {
linkAdaptation LinkAdaptation OPTIONAL,
features FeatureConfig OPTIONAL,
carrierAggregationCap CarrierAggregationLevelCap OPTIONAL,
ulPowerControl ULpowerControl OPTIONAL,
...
}
LinkAdaptation ::= SEQUENCE {
cqiCap INTEGER(0..15) OPTIONAL,
riCap ENUMERATED{one, two, ...} OPTIONAL,
aggregationLevelCap AggregationLevelCap OPTIONAL,
targetBlerDL INTEGER(0.. 100) OPTIONAL,
targetBlerUL INTEGER(0.. 100) OPTIONAL,
maxMCS INTEGER(0..28) OPTIONAL,
minMCS INTEGER(0..28) OPTIONAL,
transmissionMode ENUMERATED{one, two, three, ...} OPTIONAL,
harqRetxCap HARQrextCap OPTIONAL,
...
}
AggregationLevelCap ::= ENUMERATED {
one,
two,
four,
eight,
sixteen
}
HARQrextCap ::= SEQUENCE {
dl INTEGER(1.. MAX) OPTIONAL,
ul INTEGER(1.. MAX) OPTIONAL
}
FeatureConfig ::= SEQUENCE {
ttiBundling FeatureStatus OPTIONAL,
...
}
FeatureStatus ::= ENUMERATED {
enable,
disable
}
CarrierAggregationLevelCap ::= ENUMERATED {
one,
two,
three,
four,
...
}
ULpowerControl ::= SEQUENCE {
puschTargetSNR INTEGER OPTIONAL,
pucchTargetSNR INTEGER OPTIONAL,
...
}
END

View File

@@ -0,0 +1,438 @@
/*
* SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* 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
*/
#include <sys/time.h>
#include <arpa/inet.h>
#include <stdbool.h>
#include <string.h>
#include "common/utils/assertions.h"
#include "f1ap_common.h"
#include "ric_agent.h"
#include "e2ap_encoder.h"
#include "e2ap_generate_messages.h"
#include "e2sm_rsm.h"
#include "E2SM_RSM_E2SM-RSM-RANfunction-Description.h"
#include "E2SM_RSM_NodeSlicingCapability-Item.h"
#include "E2SM_RSM_SupportedSlicingConfig-Item.h"
#include "E2SM_RSM_E2SM-RSM-IndicationHeader.h"
#include "E2SM_RSM_UE-Identity.h"
#include "E2SM_RSM_E2SM-RSM-IndicationMessage-Format2.h"
#include "E2SM_RSM_E2SM-RSM-IndicationMessage.h"
#include "E2SM_RSM_Bearer-ID.h"
static int e2sm_rsm_subscription_add(ric_agent_info_t *ric, ric_subscription_t *sub);
static int e2sm_rsm_subscription_del(ric_agent_info_t *ric, ric_subscription_t *sub, int force,long *cause,long *cause_detail);
extern f1ap_cudu_inst_t f1ap_cu_inst[MAX_eNB];
static ric_service_model_t e2sm_rsm_model = {
.name = "e2sm_rsm-v1",
/* iso(1) identified-organization(3) dod(6) internet(1) private(4) enterprise(1) oran(53148) e2(1) version1 (1) e2sm(2) e2sm-RSM-IEs (102) */
.oid = "1.3.6.1.4.1.53148.1.1.2.102",
.handle_subscription_add = e2sm_rsm_subscription_add,
.handle_subscription_del = e2sm_rsm_subscription_del,
// .handle_control = e2sm_rsm_control,
// .handle_ricInd_timer_expiry = e2sm_rsm_ricInd_timer_expiry,
// .handle_gp_timer_expiry = e2sm_rsm_gp_timer_expiry
};
uint8_t rsm_emm_event_trigger;
int e2sm_rsm_init(e2node_type_t e2node_type)
{
//uint16_t i;
ric_ran_function_t *func;
E2SM_RSM_E2SM_RSM_RANfunction_Description_t *func_def;
E2SM_RSM_NodeSlicingCapability_Item_t *rsm_node_slicing_cap_item;
E2SM_RSM_SupportedSlicingConfig_Item_t *rsm_supported_slicing_cfg_create;
E2SM_RSM_SupportedSlicingConfig_Item_t *rsm_supported_slicing_cfg_update;
E2SM_RSM_SupportedSlicingConfig_Item_t *rsm_supported_slicing_cfg_delete;
E2SM_RSM_SupportedSlicingConfig_Item_t *rsm_supported_slicing_cfg_ueAssoc;
E2SM_RSM_SupportedSlicingConfig_Item_t *rsm_supported_slicing_cfg_eventTrigger;
func = (ric_ran_function_t *)calloc(1, sizeof(*func));
func->model = &e2sm_rsm_model;
func->revision = 1;
func->name = "ORAN-E2SM-RSM";
func->description = "RAN Slicing";
func_def = (E2SM_RSM_E2SM_RSM_RANfunction_Description_t *)calloc(1, sizeof(*func_def));
/* RAN Function Name */
func_def->ranFunction_Name.ranFunction_ShortName.buf = (uint8_t *)strdup(func->name);
func_def->ranFunction_Name.ranFunction_ShortName.size = strlen(func->name);
func_def->ranFunction_Name.ranFunction_E2SM_OID.buf = (uint8_t *)strdup(func->model->oid);
func_def->ranFunction_Name.ranFunction_E2SM_OID.size = strlen(func->model->oid);
func_def->ranFunction_Name.ranFunction_Description.buf = (uint8_t *)strdup(func->description);
func_def->ranFunction_Name.ranFunction_Description.size = strlen(func->description);
/* Hack for E2t crash */
long *ranFuncInst;
ranFuncInst = (long *)calloc(1,sizeof(*func_def->ranFunction_Name.ranFunction_Instance));
*ranFuncInst = 0;
func_def->ranFunction_Name.ranFunction_Instance = ranFuncInst;
rsm_node_slicing_cap_item = (E2SM_RSM_NodeSlicingCapability_Item_t *)calloc(1, sizeof(*rsm_node_slicing_cap_item));
/* Node Slicing Capability */
rsm_node_slicing_cap_item->maxNumberOfSlicesDL = 4;
rsm_node_slicing_cap_item->maxNumberOfSlicesUL = 4;
rsm_node_slicing_cap_item->slicingType = E2SM_RSM_SlicingType_static;
rsm_node_slicing_cap_item->maxNumberOfUEsPerSlice = 4;
/* Supported Slicing Configgurations */
if (e2node_type == E2NODE_TYPE_ENB_DU)
{
rsm_supported_slicing_cfg_create = (E2SM_RSM_SupportedSlicingConfig_Item_t *)calloc(1, sizeof(*rsm_supported_slicing_cfg_create));
rsm_supported_slicing_cfg_create->slicingConfigType = E2SM_RSM_E2SM_RSM_Command_sliceCreate;
ASN_SEQUENCE_ADD(&rsm_node_slicing_cap_item->supportedConfig.list, rsm_supported_slicing_cfg_create);
rsm_supported_slicing_cfg_update = (E2SM_RSM_SupportedSlicingConfig_Item_t *)calloc(1, sizeof(*rsm_supported_slicing_cfg_update));
rsm_supported_slicing_cfg_update->slicingConfigType = E2SM_RSM_E2SM_RSM_Command_sliceUpdate;
ASN_SEQUENCE_ADD(&rsm_node_slicing_cap_item->supportedConfig.list, rsm_supported_slicing_cfg_update);
rsm_supported_slicing_cfg_delete = (E2SM_RSM_SupportedSlicingConfig_Item_t *)calloc(1, sizeof(*rsm_supported_slicing_cfg_delete));
rsm_supported_slicing_cfg_delete->slicingConfigType = E2SM_RSM_E2SM_RSM_Command_sliceDelete;
ASN_SEQUENCE_ADD(&rsm_node_slicing_cap_item->supportedConfig.list, rsm_supported_slicing_cfg_delete);
rsm_supported_slicing_cfg_ueAssoc = (E2SM_RSM_SupportedSlicingConfig_Item_t *)calloc(1, sizeof(*rsm_supported_slicing_cfg_ueAssoc));
rsm_supported_slicing_cfg_ueAssoc->slicingConfigType = E2SM_RSM_E2SM_RSM_Command_ueAssociate;
ASN_SEQUENCE_ADD(&rsm_node_slicing_cap_item->supportedConfig.list, rsm_supported_slicing_cfg_ueAssoc);
}
else if (e2node_type == E2NODE_TYPE_ENB_CU)
{
rsm_supported_slicing_cfg_eventTrigger = (E2SM_RSM_SupportedSlicingConfig_Item_t *)calloc(1, sizeof(*rsm_supported_slicing_cfg_eventTrigger));
rsm_supported_slicing_cfg_eventTrigger->slicingConfigType = E2SM_RSM_E2SM_RSM_Command_eventTriggers;
ASN_SEQUENCE_ADD(&rsm_node_slicing_cap_item->supportedConfig.list, rsm_supported_slicing_cfg_eventTrigger);
}
else
{
RIC_AGENT_ERROR("INCORRECT NODE TYPE:%d\n",e2node_type);
return -1;
}
ASN_SEQUENCE_ADD(&func_def->ric_Slicing_Node_Capability_List.list, rsm_node_slicing_cap_item);
//xer_fprint(stderr, &asn_DEF_E2SM_RSM_E2SM_RSM_RANfunction_Description, func_def);
RIC_AGENT_INFO("_______\n");
func->enc_definition_len = e2ap_encode(&asn_DEF_E2SM_RSM_E2SM_RSM_RANfunction_Description,0, func_def,&func->enc_definition);
RIC_AGENT_INFO("_______\n");
RIC_AGENT_INFO("------ RAN SLICING FUNC DEF ENC Len:%lu-------\n", func->enc_definition_len);
if (func->enc_definition_len < 0) {
RIC_AGENT_ERROR("failed to encode RANfunction_List in E2SM RSM func description; aborting!");
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_E2SM_RSM_E2SM_RSM_RANfunction_Description, func_def);
free(func_def);
free(func);
return -1;
}
func->enabled = 1;
func->definition = func_def;
#if 0
/* Test code */
E2SM_RSM_E2SM_RSM_RANfunction_Description_t *func_defi;
asn_dec_rval_t decode_result;
decode_result = aper_decode_complete(NULL, &asn_DEF_E2SM_RSM_E2SM_RSM_RANfunction_Description,
(void **)&func_defi, func->enc_definition, func->enc_definition_len);
DevAssert(decode_result.code == RC_OK);
#endif
return ric_agent_register_ran_function(func);
}
static int e2sm_rsm_subscription_add(ric_agent_info_t *ric, ric_subscription_t *sub)
{
/* XXX: process E2SM content. */
if (LIST_EMPTY(&ric->subscription_list)) {
LIST_INSERT_HEAD(&ric->subscription_list,sub,subscriptions);
}
else {
LIST_INSERT_BEFORE(LIST_FIRST(&ric->subscription_list),sub,subscriptions);
}
rsm_emm_event_trigger = 1;
ric->e2sm_rsm_function_id = sub->function_id;
ric->e2sm_rsm_request_id = sub->request_id;
ric->e2sm_rsm_instance_id = sub->instance_id;
RIC_AGENT_INFO("RSM Subscription Added Successfully %d!\n",rsm_emm_event_trigger);
return 0;
}
static int e2sm_rsm_subscription_del(ric_agent_info_t *ric, ric_subscription_t *sub, int force,long *cause,long *cause_detail)
{
LIST_REMOVE(sub, subscriptions);
ric_free_subscription(sub);
rsm_emm_event_trigger = 0;
return 0;
}
void encode_e2sm_rsm_indication_header(ranid_t ranid, E2SM_RSM_E2SM_RSM_IndicationHeader_t *ihead)
{
e2node_type_t node_type;
ihead->present = E2SM_RSM_E2SM_RSM_IndicationHeader_PR_indicationHeader_Format1;
E2SM_RSM_E2SM_RSM_IndicationHeader_Format1_t* ind_header = &ihead->choice.indicationHeader_Format1;
node_type = e2_conf[ranid]->e2node_type;
//printf("node_type:%d\n",node_type);
if (node_type == E2NODE_TYPE_ENB_CU)
{
MCC_MNC_TO_PLMNID(
e2_conf[ranid]->mcc,
e2_conf[ranid]->mnc,
e2_conf[ranid]->mnc_digit_length,
&ind_header->cgi.choice.eUTRA_CGI.pLMNIdentity);
//printf("mcc:%d mnc:%d len:%d plmnId:%s\n", e2_conf[ranid]->mcc, e2_conf[ranid]->mnc, e2_conf[ranid]->mnc_digit_length,ind_header->cgi.choice.eUTRA_CGI.pLMNIdentity.buf);
ind_header->cgi.present = E2SM_RSM_CGI_PR_eUTRA_CGI;
//MACRO_ENB_ID_TO_BIT_STRING(
MACRO_ENB_ID_TO_CELL_IDENTITY(
e2_conf[ranid]->cell_identity,0,
&ind_header->cgi.choice.eUTRA_CGI.eUTRACellIdentity);
//printf("cellid:%d eutraCellId:%s\n", e2_conf[ranid]->cell_identity, ind_header->cgi.choice.eUTRA_CGI.eUTRACellIdentity.buf);
}
/* Collect Start Time Stamp */
/* Encoded in the same format as the first four octets of the 64-bit timestamp format as defined in section 6 of IETF RFC 5905 */
//ind_header->colletStartTime.buf = (uint8_t *)calloc(1, 4);
//ind_header->colletStartTime.size = 4;
//*((uint32_t *)(ind_header->colletStartTime.buf)) = htonl((uint32_t)time(NULL));
xer_fprint(stderr, &asn_DEF_E2SM_RSM_E2SM_RSM_IndicationHeader, ihead);
}
static E2SM_RSM_E2SM_RSM_IndicationMessage_t*
encode_rsm_Indication_Msg(ric_agent_info_t* ric, ric_subscription_t *rs, ueStatusInd *emmTriggerBuff, uint16_t trigger_type)
{
int ret;
E2SM_RSM_UE_Identity_t* rsm_ue_id[5];
E2SM_RSM_E2SM_RSM_IndicationMessage_Format2_t* format =
(E2SM_RSM_E2SM_RSM_IndicationMessage_Format2_t*)calloc(1, sizeof(E2SM_RSM_E2SM_RSM_IndicationMessage_Format2_t));
ASN_STRUCT_RESET(asn_DEF_E2SM_RSM_E2SM_RSM_IndicationMessage_Format2, format);
if (trigger_type == UE_ATTACH_EVENT_TRIGGER)
{
format->emmType = E2SM_RSM_RSM_EMM_Trigger_Type_ueAttach;
format->prefferedUeIDType = E2SM_RSM_UE_ID_Type_duUeF1ApID;
rsm_ue_id[0] = (E2SM_RSM_UE_Identity_t *)calloc(1, sizeof(E2SM_RSM_UE_Identity_t));
rsm_ue_id[0]->present = E2SM_RSM_UE_Identity_PR_cuUeF1ApID;
rsm_ue_id[0]->choice.cuUeF1ApID = f1ap_get_cu_ue_f1ap_id(&f1ap_cu_inst[0],//emmTriggerBuff->cu_ue_f1ap_id;
emmTriggerBuff->rnti);
//RIC_AGENT_INFO("cuUeF1ApID:%lu %lu %u\n",rsm_ue_id[0]->choice.cuUeF1ApID, rs->instance_id, emmTriggerBuff->rnti);
ret = ASN_SEQUENCE_ADD(&format->ueIDlist.list, rsm_ue_id[0]);
DevAssert(ret == 0);
rsm_ue_id[1] = (E2SM_RSM_UE_Identity_t *)calloc(1, sizeof(E2SM_RSM_UE_Identity_t));
rsm_ue_id[1]->present = E2SM_RSM_UE_Identity_PR_duUeF1ApID;
rsm_ue_id[1]->choice.duUeF1ApID = f1ap_get_du_ue_f1ap_id(&f1ap_cu_inst[0],//emmTriggerBuff->du_ue_f1ap_id;
emmTriggerBuff->rnti);
//RIC_AGENT_INFO("duUeF1ApID:%lu %lu %u\n",rsm_ue_id[1]->choice.duUeF1ApID, rs->instance_id, emmTriggerBuff->rnti);
ret = ASN_SEQUENCE_ADD(&format->ueIDlist.list, rsm_ue_id[1]);
DevAssert(ret == 0);
rsm_ue_id[2] = (E2SM_RSM_UE_Identity_t *)calloc(1, sizeof(E2SM_RSM_UE_Identity_t));
rsm_ue_id[2]->present = E2SM_RSM_UE_Identity_PR_enbUeS1ApID;
rsm_ue_id[2]->choice.enbUeS1ApID = emmTriggerBuff->eNB_ue_s1ap_id;
//RIC_AGENT_INFO("enbUeS1ApID:%lu\n",rsm_ue_id[2]->choice.enbUeS1ApID);
ret = ASN_SEQUENCE_ADD(&format->ueIDlist.list, rsm_ue_id[2]);
DevAssert(ret == 0);
/* E2SM_RSM_UE_Identity_t struct need to be enhanced to include mme_ue_s1ap_id */
E2SM_RSM_Bearer_ID_t* rsm_bearer_info = (E2SM_RSM_Bearer_ID_t *)calloc(1, sizeof(E2SM_RSM_Bearer_ID_t));
rsm_bearer_info->present = E2SM_RSM_Bearer_ID_PR_drbID;
rsm_bearer_info->choice.drbID.present = E2SM_RSM_Drb_ID_PR_fourGDrbID;
rsm_bearer_info->choice.drbID.choice.fourGDrbID.value = emmTriggerBuff->e_rab_id;
rsm_bearer_info->choice.drbID.choice.fourGDrbID.qci = emmTriggerBuff->qci;
format->bearerID = (struct E2SM_RSM_E2SM_RSM_IndicationMessage_Format2__bearerID *)calloc(1,
sizeof(struct E2SM_RSM_E2SM_RSM_IndicationMessage_Format2__bearerID));
ret = ASN_SEQUENCE_ADD(&format->bearerID->list, rsm_bearer_info);
DevAssert(ret == 0);
}
else if (trigger_type == UE_DETACH_EVENT_TRIGGER)
{
format->emmType = E2SM_RSM_RSM_EMM_Trigger_Type_ueDetach;
format->prefferedUeIDType = E2SM_RSM_UE_ID_Type_enbUeS1ApID;
rsm_ue_id[0] = (E2SM_RSM_UE_Identity_t *)calloc(1, sizeof(E2SM_RSM_UE_Identity_t));
rsm_ue_id[0]->present = E2SM_RSM_UE_Identity_PR_enbUeS1ApID;
rsm_ue_id[0]->choice.enbUeS1ApID = emmTriggerBuff->eNB_ue_s1ap_id;
//RIC_AGENT_INFO("enbUeS1ApID:%lu\n", rsm_ue_id[0]->choice.enbUeS1ApID);
ret = ASN_SEQUENCE_ADD(&format->ueIDlist.list, rsm_ue_id[0]);
DevAssert(ret == 0);
E2SM_RSM_Bearer_ID_t* rsm_bearer_info = (E2SM_RSM_Bearer_ID_t *)calloc(1, sizeof(E2SM_RSM_Bearer_ID_t));
//rsm_bearer_info->present = E2SM_RSM_Bearer_ID_PR_NOTHING;
rsm_bearer_info->present = E2SM_RSM_Bearer_ID_PR_drbID;
rsm_bearer_info->choice.drbID.present = E2SM_RSM_Drb_ID_PR_fourGDrbID;
rsm_bearer_info->choice.drbID.choice.fourGDrbID.value = emmTriggerBuff->e_rab_id;
rsm_bearer_info->choice.drbID.choice.fourGDrbID.qci = emmTriggerBuff->qci;
format->bearerID = (struct E2SM_RSM_E2SM_RSM_IndicationMessage_Format2__bearerID *)calloc(1,
sizeof(struct E2SM_RSM_E2SM_RSM_IndicationMessage_Format2__bearerID));
ret = ASN_SEQUENCE_ADD(&format->bearerID->list, rsm_bearer_info);
DevAssert(ret == 0);
}
/*
* IndicationMessage -> IndicationMessage_Format1
*/
E2SM_RSM_E2SM_RSM_IndicationMessage_t* indicationmessage =
(E2SM_RSM_E2SM_RSM_IndicationMessage_t*)calloc(1, sizeof(E2SM_RSM_E2SM_RSM_IndicationMessage_t));
indicationmessage->present = E2SM_RSM_E2SM_RSM_IndicationMessage_PR_indicationMessage_Format2;
indicationmessage->choice.indicationMessage_Format2 = *format;
return indicationmessage;
}
int e2sm_rsm_ricInd(
ric_agent_info_t *ric,
ric_ran_function_id_t function_id,
long request_id,
long instance_id,
uint16_t trigger_type,
ueStatusInd *emmTriggerBuff,
uint8_t **outbuf,
uint32_t *outlen)
{
E2SM_RSM_E2SM_RSM_IndicationMessage_t* indicationmessage;
ric_subscription_t *rs;
RIC_AGENT_INFO("---- Reporting Event[%d] RSM RIC Ind, function_id %ld ranId:%d---------\n",
trigger_type, function_id, ric->ranid);
/* Fetch the RIC Subscription */
rs = ric_agent_lookup_subscription(ric,request_id,instance_id,function_id);
if (!rs) {
RIC_AGENT_ERROR("failed to find subscription %ld/%ld/%ld\n", request_id,instance_id,function_id);
}
indicationmessage = encode_rsm_Indication_Msg(ric, rs, emmTriggerBuff, trigger_type);
{
char *error_buf = (char*)calloc(300, sizeof(char));
size_t errlen;
asn_check_constraints(&asn_DEF_E2SM_RSM_E2SM_RSM_IndicationMessage, indicationmessage, error_buf, &errlen);
fprintf(stderr,"RSM IND error length %zu\n", errlen);
fprintf(stderr,"RSM IND error buf %s\n", error_buf);
free(error_buf);
//xer_fprint(stderr, &asn_DEF_E2SM_KPM_E2SM_KPMv2_IndicationMessage, indicationmessage);
}
xer_fprint(stderr, &asn_DEF_E2SM_RSM_E2SM_RSM_IndicationMessage, indicationmessage);
uint8_t e2smbuffer[8192];
size_t e2smbuffer_size = 8192;
asn_enc_rval_t er = asn_encode_to_buffer(NULL,
ATS_ALIGNED_BASIC_PER,
&asn_DEF_E2SM_RSM_E2SM_RSM_IndicationMessage,
indicationmessage, e2smbuffer, e2smbuffer_size);
fprintf(stderr, "er encded is %zu %ld\n", er.encoded, er.encoded);
fprintf(stderr, "after encoding RSM IND message\n");
#if 0
/* Test code */
printf("-----test code-----\n");
E2SM_RSM_E2SM_RSM_IndicationMessage_t *func_defi;
asn_dec_rval_t decode_result;
uint8_t enc_def[11] = {0x41,0x00,0x01,0x10,0x01,0x40,0x01,0x10,0x01,0x00,0x09};
decode_result = aper_decode_complete(NULL, &asn_DEF_E2SM_RSM_E2SM_RSM_IndicationMessage,
(void **)&func_defi, enc_def, 11);
DevAssert(decode_result.code == RC_OK);
xer_fprint(stderr, &asn_DEF_E2SM_RSM_E2SM_RSM_IndicationMessage, func_defi);
printf("-----test code-----\n");
#endif
E2AP_E2AP_PDU_t *e2ap_pdu = (E2AP_E2AP_PDU_t*)calloc(1, sizeof(E2AP_E2AP_PDU_t));
E2SM_RSM_E2SM_RSM_IndicationHeader_t* ind_header_style1 =
(E2SM_RSM_E2SM_RSM_IndicationHeader_t*)calloc(1,sizeof(E2SM_RSM_E2SM_RSM_IndicationHeader_t));
encode_e2sm_rsm_indication_header(ric->ranid, ind_header_style1);
uint8_t e2sm_header_buf_style1[8192];
size_t e2sm_header_buf_size_style1 = 8192;
asn_enc_rval_t er_header_style1 = asn_encode_to_buffer(
NULL,
ATS_ALIGNED_BASIC_PER,
&asn_DEF_E2SM_RSM_E2SM_RSM_IndicationHeader,
ind_header_style1,
e2sm_header_buf_style1,
e2sm_header_buf_size_style1);
if (er_header_style1.encoded < 0) {
fprintf(stderr, "ERROR encoding indication header, name=%s, tag=%s", er_header_style1.failed_type->name, er_header_style1.failed_type->xml_tag);
}
DevAssert(er_header_style1.encoded >= 0);
// TODO - remove hardcoded values
generate_e2apv1_indication_request_parameterized(
e2ap_pdu, request_id, instance_id, function_id, 0,
0, e2sm_header_buf_style1, er_header_style1.encoded,
e2smbuffer, er.encoded);
*outlen = e2ap_asn1c_encode_pdu(e2ap_pdu, outbuf);
return 0;
}

View File

@@ -0,0 +1,46 @@
/*
* SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* 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 _E2SM_RSM_H_
#define _E2SM_RSM_H_
extern int e2sm_rsm_init(e2node_type_t e2node_type);
extern int e2sm_rsm_ricInd(
ric_agent_info_t *ric,
ric_ran_function_id_t function_id,
long request_id,
long instance_id,
uint16_t trigger_type,
ueStatusInd *emmTriggerBuff,
uint8_t **outbuf,
uint32_t *outlen);
#endif

View File

@@ -0,0 +1,690 @@
/*
* SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* 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
*/
#include "common/ran_context.h"
#include "ric_agent.h"
#include "e2ap_generate_messages.h"
#include "e2ap_handler.h"
#include "e2sm_kpm.h"
#include "e2sm_met.h"
#include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
#ifdef ENABLE_RAN_SLICING
#include "e2sm_rsm.h"
#endif
#define DISABLE_SCTP_MULTIHOMING 1
extern RAN_CONTEXT_t RC;
ric_agent_info_t **ric_agent_info;
e2_conf_t **e2_conf;
ric_ran_function_t **ran_functions = NULL;
unsigned int ran_functions_len = 0;
static unsigned int ran_functions_alloc_len = 0;
static void ric_agent_send_sctp_data(
ric_agent_info_t *ric,
uint16_t stream,
uint8_t *buf,
uint32_t len,
uint32_t assoc_id);
int ric_agent_register_ran_function(ric_ran_function_t *func)
{
ric_ran_function_t **tmp, **tmp2;
ric_ran_function_id_t new_id;
DevAssert(func != NULL);
if (ran_functions == NULL || ran_functions_alloc_len == ran_functions_len) {
tmp = (ric_ran_function_t **)realloc(ran_functions,sizeof(*ran_functions)*(ran_functions_alloc_len+8));
if (tmp == NULL) {
RIC_AGENT_ERROR("failed to allocate more memory for ran_function table");
return -1;
}
if (ran_functions && ran_functions != tmp) {
memcpy(tmp,ran_functions,ran_functions_alloc_len);
tmp2 = ran_functions;
ran_functions = tmp;
if (tmp2) {
free(tmp2);
}
} else {
ran_functions = tmp;
}
ran_functions_alloc_len += 8;
}
// if (!strcmp(func->name,"Eurecom-MET-SM")){
// new_id = 3;
// ran_functions[new_id-1] = func;
// func->function_id = 3;
// ran_functions_len+=2;
// }else{
new_id = ran_functions_len++;
ran_functions[new_id] = func;
func->function_id = new_id + 1;
//}
return 0;
}
ric_ran_function_t *ric_agent_lookup_ran_function(ric_ran_function_id_t function_id)
{
int index = function_id - 1;
if (index < 0 || index >= ran_functions_len)
return NULL;
return ran_functions[index];
}
ric_ran_function_t *ric_agent_lookup_ran_function_by_name(char *name)
{
int i;
for (i = 0; i < ran_functions_len; ++i) {
if (strcmp(name,ran_functions[i]->name) == 0)
return ran_functions[i];
}
return NULL;
}
ric_subscription_t *ric_agent_lookup_subscription(
ric_agent_info_t *ric,
long request_id,
long instance_id,
ric_ran_function_id_t function_id)
{
ric_subscription_t *sub;
LIST_FOREACH(sub, &ric->subscription_list, subscriptions) {
if (sub->request_id == request_id
&& sub->instance_id == instance_id
&& sub->function_id == function_id)
return sub;
}
return NULL;
}
ric_agent_info_t *ric_agent_get_info(ranid_t ranid, int32_t assoc_id)
{
ric_agent_info_t *ric;
ric = ric_agent_info[ranid];
//if ( (ric->assoc_id != assoc_id) ||
// (ric->data_conn_assoc_id != assoc_id) )
if ( (ric->assoc_id == assoc_id) ||
(ric->data_conn_assoc_id == assoc_id) )
{
//return NULL;
return ric;
}
//return ric;
return NULL;
}
void ric_free_action(ric_action_t *action)
{
if (action->def_buf)
free(action->def_buf);
free(action);
}
void ric_free_subscription(ric_subscription_t *sub)
{
ric_action_t *action,*next;
action = LIST_FIRST(&sub->action_list);
while (action != NULL) {
next = LIST_NEXT(action,actions);
ric_free_action(action);
action = next;
}
if (sub->event_trigger.buf)
free(sub->event_trigger.buf);
free(sub);
}
/*
* This must not fail. But if it must, the only way forward is to
* terminate the current connection to its RIC, and reestablish.
*/
int ric_agent_reset(ric_agent_info_t *ric)
{
ric_subscription_t *sub,*subnext;
int ret;
long cause,cause_detail;
ric_ran_function_t *func;
sub = LIST_FIRST(&ric->subscription_list);
while (sub != NULL) {
subnext = LIST_NEXT(sub,subscriptions);
func = ric_agent_lookup_ran_function(sub->function_id);
DevAssert(func);
ret = func->model->handle_subscription_del(ric,sub,0,&cause,&cause_detail);
if (ret) {
RIC_AGENT_ERROR("subscription delete in reset failed (%ld/%ld); forcing!\n",
cause, cause_detail);
func->model->handle_subscription_del(ric,sub,1,&cause,&cause_detail);
}
sub = subnext;
}
LIST_INIT(&ric->subscription_list);
return 0;
}
static int ric_agent_connect(ranid_t ranid)
{
MessageDef *msg;
sctp_new_association_req_t *req;
ric_agent_info_t *ric;
ric = ric_agent_get_info(ranid, -1);
if (ric == NULL) {
RIC_AGENT_ERROR("ric_agent_connect: ric agent info not found %u\n", ranid);
return -1;
}
msg = itti_alloc_new_message(TASK_RIC_AGENT,0, SCTP_NEW_ASSOCIATION_REQ);
req = &msg->ittiMsg.sctp_new_association_req;
req->ppid = E2AP_SCTP_PPID;
req->port = e2_conf[ranid]->remote_port;
req->in_streams = 1;
req->out_streams = 1;
req->remote_address.ipv4 = 1;
strncpy(req->remote_address.ipv4_address, e2_conf[ranid]->remote_ipv4_addr,
sizeof(req->remote_address.ipv4_address));
req->remote_address.ipv4_address[sizeof(req->remote_address.ipv4_address)-1] = '\0';
#if DISABLE_SCTP_MULTIHOMING
// Comment out if testing with loopback
req->local_address.ipv4 = 1;
strncpy(req->local_address.ipv4_address, e2_conf[ranid]->local_ipv4_addr, //TODO RIC
sizeof(req->local_address.ipv4_address));
req->local_address.ipv4_address[sizeof(req->local_address.ipv4_address)-1] = '\0';
#endif
req->ulp_cnx_id = 1;
ric = ric_agent_info[ranid];
RIC_AGENT_INFO("ranid %u connecting to RIC at %s:%u with IP %s\n",
ranid,req->remote_address.ipv4_address, req->port, req->local_address.ipv4_address);
itti_send_msg_to_task(TASK_SCTP, ranid, msg);
return 0;
}
static void ric_agent_send_sctp_data(
ric_agent_info_t *ric,
uint16_t stream,
uint8_t *buf,
uint32_t len,
uint32_t assoc_id)
{
MessageDef *msg;
sctp_data_req_t *sctp_data_req;
msg = itti_alloc_new_message(TASK_RIC_AGENT,0, SCTP_DATA_REQ);
sctp_data_req = &msg->ittiMsg.sctp_data_req;
sctp_data_req->assoc_id = assoc_id;
sctp_data_req->stream = stream;
sctp_data_req->buffer = buf;
sctp_data_req->buffer_length = len;
RIC_AGENT_INFO("Send SCTP data, ranid:%u, assoc_id:%d, len:%d\n", ric->ranid, assoc_id, len);
itti_send_msg_to_task(TASK_SCTP, ric->ranid, msg);
}
static void ric_agent_disconnect(ric_agent_info_t *ric)
{
MessageDef *msg;
sctp_close_association_t *sctp_close_association;
msg = itti_alloc_new_message(TASK_RIC_AGENT,0, SCTP_CLOSE_ASSOCIATION);
sctp_close_association = &msg->ittiMsg.sctp_close_association;
sctp_close_association->assoc_id = ric->assoc_id;
itti_send_msg_to_task(TASK_SCTP, ric->ranid,msg);
ric->assoc_id = -1;
}
static int ric_agent_handle_sctp_new_association_resp(
instance_t instance,
sctp_new_association_resp_t *resp,
uint8_t **outbuf,
uint32_t *outlen,
uint32_t *assoc_id)
{
ric_agent_info_t *ric;
int ret;
DevAssert(resp != NULL);
RIC_AGENT_INFO("new sctp assoc resp %d, sctp_state %d for nb %u\n", resp->assoc_id, resp->sctp_state, instance);
if (resp->sctp_state != SCTP_STATE_ESTABLISHED) {
if (ric_agent_info[instance] != NULL) {
RIC_AGENT_INFO("resetting RIC connection %u\n", instance);
timer_remove(ric_agent_info[instance]->e2sm_kpm_timer_id);
//#MET
timer_remove(ric_agent_info[instance]->e2sm_met_timer_id);
ric_agent_info[instance]->e2sm_kpm_timer_id = 0;
//#MET
ric_agent_info[instance]->e2sm_met_timer_id = 0;
ric_agent_info[instance]->assoc_id = -1;
timer_setup(5, 0, TASK_RIC_AGENT, instance, TIMER_PERIODIC, NULL, &ric_agent_info[instance]->ric_connect_timer_id);
} else {
RIC_AGENT_ERROR("invalid nb/instance %u in sctp_new_association_resp\n", instance);
return -1;
}
return 0;
}
/*
else if (ric_agent_info[instance]->assoc_id != -1) {
RIC_AGENT_ERROR("nb %u already associated (%d); ignoring new resp (%d)\n",
instance,ric_agent_info[instance]->assoc_id,resp->assoc_id);
}
*/
RIC_AGENT_INFO("new sctp assoc resp %d for nb %u\n", resp->assoc_id, instance);
ric = ric_agent_get_info(instance, -1);
if (ric == NULL) {
RIC_AGENT_ERROR("[%s]: ric agent info not found %u\n", __func__, instance);
return -1;
}
if (ric->assoc_id == -1)
{
ric->assoc_id = resp->assoc_id;
timer_remove(ric->ric_connect_timer_id);
/* Send an E2Setup request to RIC. */
ret = e2ap_generate_e2_setup_request(ric->ranid, outbuf, outlen, e2_conf[0]->e2node_type);
if (ret) {
RIC_AGENT_ERROR("failed to generate E2setupRequest; disabling ranid %u!\n",
ric->ranid);
ric_agent_disconnect(ric);
return 1;
}
*assoc_id = ric->assoc_id;
}
else
{
RIC_AGENT_INFO("Data Connection Assoc Id:%d updated\n",resp->assoc_id);
ric->data_conn_assoc_id = resp->assoc_id;
RIC_AGENT_INFO("e2ap_generate_e2_config_update\n");
/*Send E2 Configuration Update to RIC */
ret = e2ap_generate_e2_config_update(ric->ranid, outbuf, outlen, e2_conf[0]->e2node_type);
if (ret) {
RIC_AGENT_ERROR("failed to generate E2setupRequest; disabling ranid %u!\n",
ric->ranid);
ric_agent_disconnect(ric);
return 1;
}
*assoc_id = ric->data_conn_assoc_id;
}
return 0;
}
static void ric_agent_handle_sctp_data_ind(
instance_t instance,
sctp_data_ind_t *ind,
uint8_t **outbuf,
uint32_t *outlen,
uint32_t *assoc_id)
{
int ret;
ric_agent_info_t *ric;
DevAssert(ind != NULL);
ric = ric_agent_get_info(instance, ind->assoc_id);
if (ric == NULL) {
RIC_AGENT_ERROR("ric_agent_handle_sctp_data_ind: ric agent info not found %u\n", instance);
return;
}
RIC_AGENT_DEBUG("sctp_data_ind instance %u assoc %d", instance, ind->assoc_id);
e2ap_handle_message(ric, ind->stream, ind->buffer, ind->buffer_length, outbuf, outlen, assoc_id);
ret = itti_free(TASK_UNKNOWN, ind->buffer);
AssertFatal(ret == EXIT_SUCCESS, "failed to free sctp data buf (%d)\n",ret);
}
static void ric_agent_handle_timer_expiry(
instance_t instance,
long timer_id,
void* arg,
uint8_t **outbuf,
uint32_t *outlen,
uint32_t *assoc_id)
{
ric_agent_info_t* ric;
int ret = 0;
ric = ric_agent_info[instance];
//TODO look into this
if (timer_id == ric->ric_connect_timer_id) {
ric_agent_connect(instance);
} else if (timer_id == ric->e2sm_kpm_timer_id) {
ret = e2ap_handle_timer_expiry(ric, timer_id, arg, outbuf, outlen);
*assoc_id = ric->data_conn_assoc_id;
}else if (timer_id == ric->e2sm_met_timer_id) {
ret = e2ap_handle_timer_expiry(ric, timer_id, arg, outbuf, outlen);
*assoc_id = ric->data_conn_assoc_id;
} else if (timer_id == ric->gran_prd_timer_id) {
ret = e2ap_handle_gp_timer_expiry(ric, timer_id, arg, outbuf, outlen);
} else {
RIC_AGENT_INFO("invalid timer expiry instance %u timer_id %ld", instance, timer_id);
}
DevAssert(ret == 0);
}
#ifdef ENABLE_RAN_SLICING
static void ric_agent_prepare_ric_ind(
instance_t instance,
eventTrigger *CUeventTrigger,
uint8_t **outbuf,
uint32_t *outlen,
uint32_t *assoc_id)
{
ric_agent_info_t* ric;
ueStatusInd *ueAttachDetachEvTrigger;
int ret = 0;
ric = ric_agent_info[instance];
ueAttachDetachEvTrigger = (ueStatusInd *)CUeventTrigger->eventTriggerBuff;
ret = e2sm_rsm_ricInd(ric,
ric->e2sm_rsm_function_id,
ric->e2sm_rsm_request_id,
ric->e2sm_rsm_instance_id,
CUeventTrigger->eventTriggerType,
ueAttachDetachEvTrigger,
outbuf,
outlen);
DevAssert(ret == 0);
*assoc_id = ric->data_conn_assoc_id;
return;
}
#endif
void *ric_agent_task(void *args)
{
MessageDef *msg = NULL;
int res;
uint16_t i;
uint8_t *outbuf = NULL;
uint32_t outlen = 0;
uint32_t assoc_id = 0;
RIC_AGENT_INFO("starting CU E2 agent task\n");
e2sm_kpm_init();
#ifdef ENABLE_RAN_SLICING
e2sm_rsm_init(e2_conf[0]->e2node_type);
#endif
//REVIEW
e2sm_met_init();
//TODO RIC: hqndle multiple gNBs
for (i = 0; i < 1; ++i) {
if (e2_conf[i]->enabled) {
timer_setup(5, 0, TASK_RIC_AGENT, i, TIMER_PERIODIC, NULL, &ric_agent_info[i]->ric_connect_timer_id);
}
}
gNB_MAC_INST *gNB_mac = RC.nrmac[0];
<<<<<<< HEAD
NR_UEs_t *UE_info = &gNB_mac->UE_info;
=======
NR_UE_info_t *UE_info = &gNB_mac->UE_info;
>>>>>>> 69d037263ed14b497aeb9e7316b18b027893ec1a
while (1) {
itti_receive_msg(TASK_RIC_AGENT, &msg);
switch (ITTI_MSG_ID(msg)) {
case SCTP_NEW_ASSOCIATION_IND:
RIC_AGENT_INFO("Received SCTP_NEW_ASSOCIATION_IND for instance %d\n",
ITTI_MSG_DESTINATION_INSTANCE(msg));
break;
case SCTP_NEW_ASSOCIATION_RESP:
ric_agent_handle_sctp_new_association_resp(
ITTI_MSG_DESTINATION_INSTANCE(msg),
&msg->ittiMsg.sctp_new_association_resp,
&outbuf,
&outlen,
&assoc_id);
break;
case SCTP_DATA_IND:
ric_agent_handle_sctp_data_ind(
ITTI_MSG_DESTINATION_INSTANCE(msg),
&msg->ittiMsg.sctp_data_ind,
&outbuf,
&outlen,
&assoc_id);
break;
case TERMINATE_MESSAGE:
RIC_AGENT_WARN("exiting RIC agent task\n");
itti_exit_task();
break;
case SCTP_CLOSE_ASSOCIATION:
RIC_AGENT_WARN("sctp connection to RIC closed\n");
break;
case TIMER_HAS_EXPIRED:
if (UE_info->num_UEs <=0) continue;
ric_agent_handle_timer_expiry(
ITTI_MSG_DESTINATION_INSTANCE(msg),
TIMER_HAS_EXPIRED(msg).timer_id,
TIMER_HAS_EXPIRED(msg).arg,
&outbuf,
&outlen,
&assoc_id);
break;
#ifdef ENABLE_RAN_SLICING
case CU_EVENT_TRIGGER:
RIC_AGENT_INFO("Received CU_EVENT_TRIGGER for instance %d\n",
ITTI_MSG_DESTINATION_INSTANCE(msg));
ric_agent_prepare_ric_ind(
ITTI_MSG_DESTINATION_INSTANCE(msg),
&msg->ittiMsg.cu_event_trigger,
&outbuf,
&outlen,
&assoc_id);
break;
#endif
default:
RIC_AGENT_ERROR("unhandled message: %d:%s\n",
ITTI_MSG_ID(msg), ITTI_MSG_NAME(msg));
break;
}
if (outlen) {
instance_t instance = ITTI_MSG_DESTINATION_INSTANCE(msg);
ric_agent_info_t *ric = ric_agent_info[instance];
//sctp_data_ind_t *ind = &msg->ittiMsg.sctp_data_ind;
// ric_agent_info_t *ric = ric_agent_get_info(instance, ind->assoc_id);
AssertFatal(ric != NULL, "ric agent info not found %u\n", instance);
AssertFatal(assoc_id != 0, "Association ID not updated %u\n", assoc_id);
ric_agent_send_sctp_data(ric, 0, outbuf, outlen, assoc_id);
outlen = 0;
}
res = itti_free(ITTI_MSG_ORIGIN_ID(msg), msg);
AssertFatal(res == EXIT_SUCCESS, "failed to free msg (%d)!\n",res);
msg = NULL;
}
return NULL;
}
#define RIC_CONFIG_STRING_ENABLED "enabled"
#define RIC_CONFIG_STRING_REMOTE_IPV4_ADDR "remote_ipv4_addr"
#define RIC_CONFIG_STRING_LOCAL_IPV4_ADDR "local_ipv4_addr"
#define RIC_CONFIG_STRING_REMOTE_PORT "remote_port"
#define RIC_CONFIG_IDX_ENABLED 0
#define RIC_CONFIG_IDX_REMOTE_IPV4_ADDR 1
#define RIC_CONFIG_IDX_LOCAL_IPV4_ADDR 2
#define RIC_CONFIG_IDX_REMOTE_PORT 3
#define RIC_CONFIG_IDX_FUNCTIONS_ENABLED 4
#define RIC_PORT 36421
#define RICPARAMS_DESC { \
{ RIC_CONFIG_STRING_ENABLED, \
"yes/no", 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0 }, \
{ RIC_CONFIG_STRING_REMOTE_IPV4_ADDR, \
NULL, 0, strptr:NULL, defstrval: "127.0.0.1", TYPE_STRING, 0 }, \
{ RIC_CONFIG_STRING_LOCAL_IPV4_ADDR, \
NULL, 0, strptr:NULL, defstrval: "127.0.0.1", TYPE_STRING, 0 }, \
{ RIC_CONFIG_STRING_REMOTE_PORT, \
NULL, 0, uptr:NULL, defintval:RIC_PORT, TYPE_UINT, 0 } \
}
void RCconfig_ric_agent(void)
{
uint16_t i;
char buf[16];
paramdef_t ric_params[] = RICPARAMS_DESC;
e2_conf = (e2_conf_t **)calloc(256, sizeof(e2_conf_t));
/*if (NODE_IS_CU(RC.rrc[0]->node_type))
{
ric_agent_info = (ric_agent_info_t **)calloc(250, sizeof(ric_agent_info_t));
}
else if (NODE_IS_DU(RC.rrc[0]->node_type))
{
du_ric_agent_info = (du_ric_agent_info_t **)calloc(250, sizeof(du_ric_agent_info_t));
}*/
//TODO RIC: check if monolithic or split first
ric_agent_info = (ric_agent_info_t **)calloc(250, sizeof(ric_agent_info_t));
//TODO RIC: add many RIC agents per gNB RC.nb_inst equiv
RIC_AGENT_INFO("start RIC configuration\n");
//printf("start RIC configuration-------------------------------------\n");
//assert(1==2);
for (i = 0; i < 1; i++)
{
/* if (!NODE_IS_CU(RC.rrc[i]->node_type)) {
continue;
}
*/
/* Get RIC configuration. */
snprintf(buf, sizeof(buf), "%s.[%u].RIC", "gNBs", i); // TODO RIC: get string from GNB_CONFIG_STRING_GNB_LIST
config_get(ric_params, sizeof(ric_params)/sizeof(paramdef_t), buf);
if (ric_params[RIC_CONFIG_IDX_ENABLED].strptr != NULL
&& strcmp(*ric_params[RIC_CONFIG_IDX_ENABLED].strptr, "yes") == 0)
{
//RIC_AGENT_INFO("NODE[%d] enabled for NB %u\n",RC.rrc[i]->node_type, i);
RIC_AGENT_INFO("RIC enabled\n");
e2_conf[i] = (e2_conf_t *)calloc(1,sizeof(e2_conf_t));
// TODO RIC: mono or split
ric_agent_info[i] = (ric_agent_info_t *)calloc(1, sizeof(ric_agent_info_t));
ric_agent_info[i]->assoc_id = -1;
ric_agent_info[i]->data_conn_assoc_id = -1;
/*
if (NODE_IS_CU(RC.rrc[i]->node_type))
{
ric_agent_info[i] = (ric_agent_info_t *)calloc(1, sizeof(ric_agent_info_t));
ric_agent_info[i]->assoc_id = -1;
ric_agent_info[i]->data_conn_assoc_id = -1;
}
else if (NODE_IS_DU(RC.rrc[i]->node_type))
{
du_ric_agent_info[i] = (du_ric_agent_info_t *)calloc(1, sizeof(du_ric_agent_info_t));
du_ric_agent_info[i]->du_assoc_id = -1;
du_ric_agent_info[i]->du_data_conn_assoc_id = -1;
}*/
e2_conf[i]->enabled = 1;
e2_conf[i]->node_name = "oai";//strdup(RC.rrc[i]->node_name);
e2_conf[i]->cell_identity =1;// RC.nrrrc[i]->configuration.cell_identity;
//TODO RIC: many plmns
e2_conf[i]->mcc = 505;// RC.nrrrc[i]->configuration.mcc[0];
e2_conf[i]->mnc = 01;//RC.nrrrc[i]->configuration.mnc[0];
e2_conf[i]->mnc_digit_length = 2;//RC.nrrrc[i]->configuration.mnc_digit_length[0]; // TODO RIC
/*switch (RC.rrc[i]->node_type) {
case ngran_eNB_CU:
e2_conf[i]->e2node_type = E2NODE_TYPE_ENB_CU;
break;
case ngran_ng_eNB_CU:
e2_conf[i]->e2node_type = E2NODE_TYPE_NG_ENB_CU;
break;
case ngran_gNB_CU:
e2_conf[i]->e2node_type = E2NODE_TYPE_GNB_CU;
break;
case ngran_eNB_DU:
e2_conf[i]->e2node_type = E2NODE_TYPE_ENB_DU;
break;
default:
break;
}*/
e2_conf[i]->e2node_type = E2NODE_TYPE_GNB_CU;
e2_conf[i]->remote_ipv4_addr = strdup(*ric_params[RIC_CONFIG_IDX_REMOTE_IPV4_ADDR].strptr);
e2_conf[i]->local_ipv4_addr = strdup(*ric_params[RIC_CONFIG_IDX_LOCAL_IPV4_ADDR].strptr); //malloc(20*sizeof(char));
//strcpy(e2_conf[i]->local_ipv4_addr,"192.168.18.195");
//printf("-------------------------------ip adress RIC %s\n",e2_conf[i]->remote_ipv4_addr);
e2_conf[i]->remote_port = *ric_params[RIC_CONFIG_IDX_REMOTE_PORT].uptr;
}
RIC_AGENT_INFO("end RIC configuration\n");
}
}

View File

@@ -0,0 +1,246 @@
/*
* SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* 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 _RIC_AGENT_H
#define _RIC_AGENT_H
#include <stdint.h>
#include <stdbool.h>
#include "list.h"
#include "common/utils/LOG/log.h"
#define E2AP_SCTP_PPID 70 /*< E2AP SCTP Payload Protocol Identifier (PPID) */
#define UE_ATTACH_EVENT_TRIGGER 100
#define UE_DETACH_EVENT_TRIGGER 200
typedef uint16_t ranid_t;
#define RIC_AGENT_ERROR(msg, args...) LOG_E(RIC_AGENT, msg, ##args)
#define RIC_AGENT_INFO(msg, args...) LOG_I(RIC_AGENT, msg, ##args)
#define RIC_AGENT_WARN(msg, args...) LOG_W(RIC_AGENT, msg, ##args)
#define RIC_AGENT_DEBUG(msg, args...) LOG_D(RIC_AGENT, msg, ##args)
#define DISABLE_SCTP_MULTIHOMING 1
/**
* These are local function IDs. Each service model might expose many
* functions. E2SM functions do not currently have global IDs, unless
* you concat the E2SM OID and the function name. There is no
* requirement that function IDs be the same for different E2Setup/Reset
* sessions, so we allow e2sm modules to register functions.
*/
typedef long ric_ran_function_id_t;
typedef struct ric_action {
long id;
long type;
long error_cause;
long error_cause_detail;
size_t def_size;
uint8_t *def_buf;
long subsequent_action;
long time_to_wait;
int enabled;
void *state;
LIST_ENTRY(ric_action) actions;
} ric_action_t;
typedef struct ric_event_trigger {
uint8_t *buf;
size_t size;
} ric_event_trigger_t;
typedef struct ric_subscription {
long request_id;
long instance_id;
ric_ran_function_id_t function_id;
ric_event_trigger_t event_trigger;
int enabled;
void *state;
LIST_HEAD(ric_subscription_action_list,ric_action) action_list;
LIST_ENTRY(ric_subscription) subscriptions;
} ric_subscription_t;
typedef struct ric_event_trigger ric_control_header_t;
typedef struct ric_event_trigger ric_control_msg_t;
typedef struct ric_control {
long request_id;
long instance_id;
ric_ran_function_id_t function_id;
ric_control_header_t control_hdr;
long failure_cause;
uint16_t control_req_type;
ric_control_msg_t control_msg;
} ric_control_t;
typedef struct {
int32_t assoc_id;
int32_t data_conn_assoc_id;
ranid_t ranid;
uint16_t ric_mcc;
uint16_t ric_mnc;
uint16_t ric_mnc_digit_len;
uint32_t ric_id;
long e2sm_kpm_timer_id;
//#MET
long e2sm_met_timer_id;
long gran_prd_timer_id;
long gran_prd_met_timer_id;
long ric_connect_timer_id;
ric_ran_function_id_t e2sm_rsm_function_id;
long e2sm_rsm_request_id;
long e2sm_rsm_instance_id;
LIST_HEAD(ric_subscription_list, ric_subscription) subscription_list;
} ric_agent_info_t;
typedef struct {
int32_t du_assoc_id;
int32_t du_data_conn_assoc_id;
ranid_t ranid;
uint16_t ric_mcc;
uint16_t ric_mnc;
uint16_t ric_mnc_digit_len;
uint32_t ric_id;
long du_ric_connect_timer_id;
} du_ric_agent_info_t;
typedef struct ric_ran_function_requestor_info {
ric_ran_function_id_t function_id;
long request_id;
long instance_id;
long action_id;
} ric_ran_function_requestor_info_t;
/**
* An abstraction that describes an E2 service model.
*/
typedef struct {
long meas_type_id;
char *meas_type_name;
uint16_t meas_data;
bool subscription_status;
} kmp_meas_info_t;
typedef struct {
char *name;
char *oid;
int (*handle_subscription_add)(ric_agent_info_t *ric, ric_subscription_t *sub);
int (*handle_subscription_del)(ric_agent_info_t *ric, ric_subscription_t *sub,
int force, long *cause, long *cause_detail);
int (*handle_control)(ric_agent_info_t *ric,ric_control_t *control);
int (*handle_ricInd_timer_expiry)(
ric_agent_info_t *ric,
long timer_id,
ric_ran_function_id_t function_id,
long request_id,
long instance_id,
long action_id,
uint8_t **outbuf,
uint32_t *outlen);
int (*handle_gp_timer_expiry)(
ric_agent_info_t *ric,
long timer_id,
ric_ran_function_id_t function_id,
long request_id,
long instance_id,
long action_id,
uint8_t **outbuf,
uint32_t *outlen);
} ric_service_model_t;
typedef struct ric_ran_function {
ric_ran_function_id_t function_id;
ric_service_model_t *model;
long revision;
char *name;
char *description;
uint8_t *enc_definition;
size_t enc_definition_len;
int enabled;
void *definition;
} ric_ran_function_t;
typedef enum {
E2NODE_TYPE_NONE,
E2NODE_TYPE_ENB_CU,
E2NODE_TYPE_NG_ENB_CU,
E2NODE_TYPE_GNB_CU,
E2NODE_TYPE_ENB_DU
} e2node_type_t;
typedef struct e2_conf {
int enabled;
e2node_type_t e2node_type;
char *node_name;
uint32_t cell_identity;
uint16_t mcc;
uint16_t mnc;
uint8_t mnc_digit_length;
char *remote_ipv4_addr;
char *local_ipv4_addr;
uint16_t remote_port;
char data_conn_remote_ipv4[16];
uint16_t data_conn_remote_port;
} e2_conf_t;
extern ric_agent_info_t **ric_agent_info;
extern du_ric_agent_info_t **du_ric_agent_info;
extern e2_conf_t **e2_conf;
void *ric_agent_task(void *args);
void *du_ric_agent_task(void *args);
void RCconfig_ric_agent(void);
int ric_agent_reset(ric_agent_info_t *ric);
int ric_agent_register_ran_function(ric_ran_function_t *func);
ric_ran_function_t *ric_agent_lookup_ran_function(
ric_ran_function_id_t function_id);
ric_ran_function_t *ric_agent_lookup_ran_function_by_name(char *name);
ric_subscription_t *ric_agent_lookup_subscription(ric_agent_info_t *ric,
long request_id, long instance_id,
ric_ran_function_id_t function_id);
void ric_free_action(ric_action_t *action);
void ric_free_subscription(ric_subscription_t *sub);
#endif /* _RIC_AGENT_H */

View File

@@ -0,0 +1,413 @@
/*
* SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* 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
*/
#include "ric_agent.h"
#include "flexran_agent_mac.h"
#include "openair2/LAYER2/MAC/mac.h"
#include "e2ap_generate_messages.h"
#include "e2ap_handler.h"
#ifdef ENABLE_RAN_SLICING
#include "e2sm_rsm.h"
#endif
du_ric_agent_info_t **du_ric_agent_info;
extern e2_conf_t **e2_conf;
#ifdef ENABLE_RAN_SLICING
#if 0
int g_duSocket;
struct sockaddr_in g_RicAddr;
struct sockaddr_in g_duAddr;
socklen_t g_addr_size;
static void connectWithRic(void)
{
/*Create UDP socket*/
g_duSocket = socket(PF_INET, SOCK_DGRAM, 0);
/*Configure settings in address struct*/
g_duAddr.sin_family = AF_INET;
g_duAddr.sin_port = htons(7891);
g_duAddr.sin_addr.s_addr = inet_addr("127.0.0.1");
memset(g_duAddr.sin_zero, '\0', sizeof g_duAddr.sin_zero);
/*Configure settings in address struct*/
g_RicAddr.sin_family = AF_INET;
g_RicAddr.sin_port = htons(7890);
g_RicAddr.sin_addr.s_addr = inet_addr("127.0.0.1");
memset(g_RicAddr.sin_zero, '\0', sizeof g_RicAddr.sin_zero);
printf("binding socket\n");
/*Bind socket with address struct*/
bind(g_duSocket, (struct sockaddr *) &g_duAddr, sizeof(g_duAddr));
/*Initialize size variable to be used later on*/
g_addr_size = sizeof g_duAddr;
return;
}
#endif
du_ric_agent_info_t *du_ric_agent_get_info(ranid_t ranid, int32_t assoc_id)
{
du_ric_agent_info_t *ric;
ric = du_ric_agent_info[ranid];
if ( (ric->du_assoc_id == assoc_id) ||
(ric->du_data_conn_assoc_id == assoc_id) )
{
return ric;
}
return NULL;
}
static void du_ric_agent_disconnect(du_ric_agent_info_t *ric)
{
MessageDef *msg;
sctp_close_association_t *sctp_close_association;
msg = itti_alloc_new_message(TASK_RIC_AGENT_DU, SCTP_CLOSE_ASSOCIATION);
sctp_close_association = &msg->ittiMsg.sctp_close_association;
sctp_close_association->assoc_id = ric->du_assoc_id;
itti_send_msg_to_task(TASK_SCTP, ric->ranid,msg);
ric->du_assoc_id = -1;
}
static int du_ric_agent_handle_sctp_new_association_resp(
instance_t instance,
sctp_new_association_resp_t *resp,
uint8_t **outbuf,
uint32_t *outlen,
uint32_t *du_assoc_id)
{
du_ric_agent_info_t *ric;
int ret;
DevAssert(resp != NULL);
RIC_AGENT_INFO("new sctp assoc resp %d, sctp_state %d for nb %u\n", resp->assoc_id, resp->sctp_state, instance);
if (resp->sctp_state != SCTP_STATE_ESTABLISHED) {
if (du_ric_agent_info[instance] != NULL) {
RIC_AGENT_INFO("resetting RIC connection %u\n", instance);
//timer_remove(du_ric_agent_info[instance]->e2sm_kpm_timer_id);
//ric_agent_info[instance]->e2sm_kpm_timer_id = 0;
du_ric_agent_info[instance]->du_assoc_id = -1;
timer_setup(5, 0, TASK_RIC_AGENT_DU, instance, TIMER_PERIODIC, NULL, &du_ric_agent_info[instance]->du_ric_connect_timer_id);
} else {
RIC_AGENT_ERROR("invalid nb/instance %u in sctp_new_association_resp\n", instance);
return -1;
}
return 0;
}
/*
else if (ric_agent_info[instance]->assoc_id != -1) {
RIC_AGENT_ERROR("nb %u already associated (%d); ignoring new resp (%d)\n",
instance,ric_agent_info[instance]->assoc_id,resp->assoc_id);
}
*/
RIC_AGENT_INFO("new sctp assoc resp %d for nb %u\n", resp->assoc_id, instance);
ric = du_ric_agent_get_info(instance, -1);
if (ric == NULL) {
RIC_AGENT_ERROR("du_ric_agent_handle_sctp_new_association_resp: ric agent info not found %u\n", instance);
return -1;
}
if (ric->du_assoc_id == -1)
{
ric->du_assoc_id = resp->assoc_id;
timer_remove(ric->du_ric_connect_timer_id);
/* Send an E2Setup request to RIC. */
ret = e2ap_generate_e2_setup_request(ric->ranid, outbuf, outlen, e2_conf[0]->e2node_type);
if (ret) {
RIC_AGENT_ERROR("failed to generate E2setupRequest; disabling ranid %u!\n",
ric->ranid);
du_ric_agent_disconnect(ric);
return 1;
}
*du_assoc_id = ric->du_assoc_id;
}
else
{
RIC_AGENT_INFO("Data Connection Assoc Id:%d updated\n",resp->assoc_id);
ric->du_data_conn_assoc_id = resp->assoc_id;
RIC_AGENT_INFO("e2ap_generate_e2_config_update\n");
/*Send E2 Configuration Update to RIC */
ret = e2ap_generate_e2_config_update(ric->ranid, outbuf, outlen, e2_conf[0]->e2node_type);
if (ret) {
RIC_AGENT_ERROR("failed to generate E2ConfigUpdate; disabling ranid %u!\n",
ric->ranid);
du_ric_agent_disconnect(ric);
return 1;
}
*du_assoc_id = ric->du_data_conn_assoc_id;
}
return 0;
}
static int du_ric_agent_connect(ranid_t ranid)
{
MessageDef *msg;
sctp_new_association_req_t *req;
du_ric_agent_info_t *ric;
ric = du_ric_agent_get_info(ranid, -1);
if (ric == NULL) {
RIC_AGENT_ERROR("ric_agent_connect: ric agent info not found %u\n", ranid);
return -1;
}
msg = itti_alloc_new_message(TASK_RIC_AGENT_DU, SCTP_NEW_ASSOCIATION_REQ);
req = &msg->ittiMsg.sctp_new_association_req;
req->ppid = E2AP_SCTP_PPID;
req->port = e2_conf[ranid]->remote_port;
req->in_streams = 1;
req->out_streams = 1;
req->remote_address.ipv4 = 1;
strncpy(req->remote_address.ipv4_address, e2_conf[ranid]->remote_ipv4_addr,
sizeof(req->remote_address.ipv4_address));
req->remote_address.ipv4_address[sizeof(req->remote_address.ipv4_address)-1] = '\0';
#if DISABLE_SCTP_MULTIHOMING
// Comment out if testing with loopback
req->local_address.ipv4 = 1;
strncpy(req->local_address.ipv4_address, RC.rrc[0]->eth_params_s.my_addr,
sizeof(req->local_address.ipv4_address));
req->local_address.ipv4_address[sizeof(req->local_address.ipv4_address)-1] = '\0';
#endif
req->ulp_cnx_id = 1;
ric = du_ric_agent_info[ranid];
RIC_AGENT_INFO("ranid %u connecting to RIC at %s:%u with IP %s\n",
ranid,req->remote_address.ipv4_address, req->port, req->local_address.ipv4_address);
itti_send_msg_to_task(TASK_SCTP, ranid, msg);
return 0;
}
static void du_ric_agent_handle_timer_expiry(
instance_t instance,
long timer_id,
void* arg,
uint8_t **outbuf,
uint32_t *outlen)
{
du_ric_agent_info_t* ric;
int ret = 0;
ric = du_ric_agent_info[instance];
if (timer_id == ric->du_ric_connect_timer_id)
{
du_ric_agent_connect(instance);
} else {
RIC_AGENT_INFO("invalid timer expiry instance %u timer_id %ld", instance, timer_id);
}
DevAssert(ret == 0);
}
static void du_ric_agent_send_sctp_data(
du_ric_agent_info_t *ric,
uint16_t stream,
uint8_t *buf,
uint32_t len,
uint32_t du_assoc_id)
{
MessageDef *msg;
sctp_data_req_t *sctp_data_req;
msg = itti_alloc_new_message(TASK_RIC_AGENT_DU, SCTP_DATA_REQ);
sctp_data_req = &msg->ittiMsg.sctp_data_req;
sctp_data_req->assoc_id = du_assoc_id;
sctp_data_req->stream = stream;
sctp_data_req->buffer = buf;
sctp_data_req->buffer_length = len;
RIC_AGENT_INFO("Send SCTP data, ranid:%u, assoc_id:%d, len:%d\n", ric->ranid, du_assoc_id, len);
itti_send_msg_to_task(TASK_SCTP, ric->ranid, msg);
}
static void du_ric_agent_handle_sctp_data_ind(
instance_t instance,
sctp_data_ind_t *ind,
uint8_t **outbuf,
uint32_t *outlen,
uint32_t *du_assoc_id)
{
int ret;
du_ric_agent_info_t *ric;
DevAssert(ind != NULL);
ric = du_ric_agent_get_info(instance, ind->assoc_id);
if (ric == NULL) {
RIC_AGENT_ERROR("ric_agent_handle_sctp_data_ind: ric agent info not found %u\n", instance);
return;
}
RIC_AGENT_DEBUG("sctp_data_ind instance %u assoc %d", instance, ind->assoc_id);
du_e2ap_handle_message(ric, ind->stream, ind->buffer, ind->buffer_length, outbuf, outlen, du_assoc_id);
ret = itti_free(TASK_UNKNOWN, ind->buffer);
AssertFatal(ret == EXIT_SUCCESS, "failed to free sctp data buf (%d)\n",ret);
}
void *du_ric_agent_task(void *args)
{
//int nBytes;
//apiMsg rxApi;
MessageDef *msg = NULL;
int res;
uint16_t i;
uint8_t *outbuf = NULL;
uint32_t outlen = 0;
uint32_t du_assoc_id = 0;
RIC_AGENT_INFO("starting DU E2 agent task\n");
e2sm_rsm_init(e2_conf[0]->e2node_type);
//connectWithRic();
for (i = 0; i < RC.nb_inst; ++i)
{
if (e2_conf[i]->enabled)
{
timer_setup(5, 0, TASK_RIC_AGENT_DU, i, TIMER_PERIODIC, NULL, &du_ric_agent_info[i]->du_ric_connect_timer_id);
}
}
while (1)
{
itti_receive_msg(TASK_RIC_AGENT_DU, &msg);
switch (ITTI_MSG_ID(msg))
{
case SCTP_NEW_ASSOCIATION_IND:
RIC_AGENT_INFO("Received SCTP_NEW_ASSOCIATION_IND for instance %d\n",
ITTI_MESSAGE_GET_INSTANCE(msg));
break;
case SCTP_NEW_ASSOCIATION_RESP:
du_ric_agent_handle_sctp_new_association_resp(
ITTI_MESSAGE_GET_INSTANCE(msg),
&msg->ittiMsg.sctp_new_association_resp,
&outbuf,
&outlen,
&du_assoc_id);
break;
case SCTP_DATA_IND:
du_ric_agent_handle_sctp_data_ind(
ITTI_MESSAGE_GET_INSTANCE(msg),
&msg->ittiMsg.sctp_data_ind,
&outbuf,
&outlen,
&du_assoc_id);
break;
case TERMINATE_MESSAGE:
RIC_AGENT_WARN("exiting RIC agent task\n");
itti_exit_task();
break;
case SCTP_CLOSE_ASSOCIATION:
RIC_AGENT_WARN("sctp connection to RIC closed\n");
break;
case TIMER_HAS_EXPIRED:
du_ric_agent_handle_timer_expiry(
ITTI_MESSAGE_GET_INSTANCE(msg),
TIMER_HAS_EXPIRED(msg).timer_id,
TIMER_HAS_EXPIRED(msg).arg,
&outbuf,
&outlen);
break;
case DU_SLICE_API_RESP:
RIC_AGENT_INFO("Received DU_SLICE_API_RESP for instance %d\n",
ITTI_MESSAGE_GET_INSTANCE(msg));
du_e2ap_prepare_ric_control_response(
du_ric_agent_info[0],
&msg->ittiMsg.du_slice_api_resp,
&outbuf,
&outlen,
&du_assoc_id);
break;
default:
RIC_AGENT_ERROR("unhandled message: %d:%s\n",
ITTI_MSG_ID(msg), ITTI_MSG_NAME(msg));
break;
}
if (outlen) {
instance_t instance = ITTI_MESSAGE_GET_INSTANCE(msg);
du_ric_agent_info_t *ric = du_ric_agent_info[instance];
//sctp_data_ind_t *ind = &msg->ittiMsg.sctp_data_ind;
// ric_agent_info_t *ric = ric_agent_get_info(instance, ind->assoc_id);
AssertFatal(ric != NULL, "ric agent info not found %u\n", instance);
AssertFatal(du_assoc_id != 0, "Association ID not updated %u\n", du_assoc_id);
du_ric_agent_send_sctp_data(ric, 0, outbuf, outlen, du_assoc_id);
outlen = 0;
}
res = itti_free(ITTI_MSG_ORIGIN_ID(msg), msg);
AssertFatal(res == EXIT_SUCCESS, "failed to free msg (%d)!\n",res);
msg = NULL;
}
#if 0
while(1)
{
/* Recv incoming pkts from RIC */
nBytes = recvfrom(g_duSocket,&rxApi,sizeof(apiMsg),0,NULL, NULL);
LOG_I(MAC,"Received %d bytes from RIC\n",nBytes);
if (nBytes > 0)
{
handle_slicing_api_req(&rxApi);
}
}
#endif
return NULL;
}
#endif

View File

@@ -0,0 +1,450 @@
/*
* Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#include <asn_internal.h>
#include <ANY.h>
#include <errno.h>
asn_OCTET_STRING_specifics_t asn_SPC_ANY_specs = {
sizeof(ANY_t),
offsetof(ANY_t, _asn_ctx),
ASN_OSUBV_ANY
};
asn_TYPE_operation_t asn_OP_ANY = {
OCTET_STRING_free,
OCTET_STRING_print,
OCTET_STRING_compare,
OCTET_STRING_decode_ber,
OCTET_STRING_encode_der,
OCTET_STRING_decode_xer_hex,
ANY_encode_xer,
#ifdef ASN_DISABLE_OER_SUPPORT
0,
0,
#else
0,
0,
#endif /* ASN_DISABLE_OER_SUPPORT */
#ifdef ASN_DISABLE_PER_SUPPORT
0, 0, 0, 0,
#else
ANY_decode_uper,
ANY_encode_uper,
ANY_decode_aper,
ANY_encode_aper,
#endif /* ASN_DISABLE_PER_SUPPORT */
0, /* Random fill is not defined for ANY type */
0 /* Use generic outmost tag fetcher */
};
asn_TYPE_descriptor_t asn_DEF_ANY = {
"ANY",
"ANY",
&asn_OP_ANY,
0, 0, 0, 0,
{ 0, 0, asn_generic_no_constraint }, /* No constraints */
0, 0, /* No members */
&asn_SPC_ANY_specs,
};
#undef RETURN
#define RETURN(_code) \
do { \
asn_dec_rval_t tmprval; \
tmprval.code = _code; \
tmprval.consumed = consumed_myself; \
return tmprval; \
} while(0)
asn_enc_rval_t
ANY_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb,
void *app_key) {
if(flags & XER_F_CANONICAL) {
/*
* Canonical XER-encoding of ANY type is not supported.
*/
ASN__ENCODE_FAILED;
}
/* Dump as binary */
return OCTET_STRING_encode_xer(td, sptr, ilevel, flags, cb, app_key);
}
struct _callback_arg {
uint8_t *buffer;
size_t offset;
size_t size;
};
static int ANY__consume_bytes(const void *buffer, size_t size, void *key);
int
ANY_fromType(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr) {
struct _callback_arg arg;
asn_enc_rval_t erval = {0,0,0};
if(!st || !td) {
errno = EINVAL;
return -1;
}
if(!sptr) {
if(st->buf) FREEMEM(st->buf);
st->size = 0;
return 0;
}
arg.offset = arg.size = 0;
arg.buffer = 0;
erval = der_encode(td, sptr, ANY__consume_bytes, &arg);
if(erval.encoded == -1) {
if(arg.buffer) FREEMEM(arg.buffer);
return -1;
}
assert((size_t)erval.encoded == arg.offset);
if(st->buf) FREEMEM(st->buf);
st->buf = arg.buffer;
st->size = arg.offset;
return 0;
}
int
ANY_fromType_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr) {
uint8_t *buffer = NULL;
ssize_t erval;
if(!st || !td) {
errno = EINVAL;
return -1;
}
if(!sptr) {
if(st->buf) FREEMEM(st->buf);
st->size = 0;
return 0;
}
erval = aper_encode_to_new_buffer(td, td->encoding_constraints.per_constraints, sptr, (void**)&buffer);
if(erval == -1) {
if(buffer) FREEMEM(buffer);
return -1;
}
assert((size_t)erval > 0);
if(st->buf) FREEMEM(st->buf);
st->buf = buffer;
st->size = erval;
return 0;
}
ANY_t *
ANY_new_fromType(asn_TYPE_descriptor_t *td, void *sptr) {
ANY_t tmp;
ANY_t *st;
if(!td || !sptr) {
errno = EINVAL;
return 0;
}
memset(&tmp, 0, sizeof(tmp));
if(ANY_fromType(&tmp, td, sptr)) return 0;
st = (ANY_t *)CALLOC(1, sizeof(ANY_t));
if(st) {
*st = tmp;
return st;
} else {
FREEMEM(tmp.buf);
return 0;
}
}
ANY_t *
ANY_new_fromType_aper(asn_TYPE_descriptor_t *td, void *sptr) {
ANY_t tmp;
ANY_t *st;
if(!td || !sptr) {
errno = EINVAL;
return 0;
}
memset(&tmp, 0, sizeof(tmp));
if(ANY_fromType_aper(&tmp, td, sptr)) return 0;
st = (ANY_t *)CALLOC(1, sizeof(ANY_t));
if(st) {
*st = tmp;
return st;
} else {
FREEMEM(tmp.buf);
return 0;
}
}
int
ANY_to_type(ANY_t *st, asn_TYPE_descriptor_t *td, void **struct_ptr) {
asn_dec_rval_t rval;
void *newst = 0;
if(!st || !td || !struct_ptr) {
errno = EINVAL;
return -1;
}
if(st->buf == 0) {
/* Nothing to convert, make it empty. */
*struct_ptr = (void *)0;
return 0;
}
rval = ber_decode(0, td, (void **)&newst, st->buf, st->size);
if(rval.code == RC_OK) {
*struct_ptr = newst;
return 0;
} else {
/* Remove possibly partially decoded data. */
ASN_STRUCT_FREE(*td, newst);
return -1;
}
}
int
ANY_to_type_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void **struct_ptr) {
asn_dec_rval_t rval;
void *newst = 0;
if(!st || !td || !struct_ptr) {
errno = EINVAL;
return -1;
}
if(st->buf == 0) {
/* Nothing to convert, make it empty. */
*struct_ptr = (void *)0;
return 0;
}
rval = aper_decode(0, td, (void **)&newst, st->buf, st->size, 0, 0);
if(rval.code == RC_OK) {
*struct_ptr = newst;
return 0;
} else {
/* Remove possibly partially decoded data. */
ASN_STRUCT_FREE(*td, newst);
return -1;
}
}
static int ANY__consume_bytes(const void *buffer, size_t size, void *key) {
struct _callback_arg *arg = (struct _callback_arg *)key;
if((arg->offset + size) >= arg->size) {
size_t nsize = (arg->size ? arg->size << 2 : 16) + size;
void *p = REALLOC(arg->buffer, nsize);
if(!p) return -1;
arg->buffer = (uint8_t *)p;
arg->size = nsize;
}
memcpy(arg->buffer + arg->offset, buffer, size);
arg->offset += size;
assert(arg->offset < arg->size);
return 0;
}
#ifndef ASN_DISABLE_PER_SUPPORT
asn_dec_rval_t
ANY_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void **sptr,
asn_per_data_t *pd) {
const asn_OCTET_STRING_specifics_t *specs =
td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_SPC_ANY_specs;
size_t consumed_myself = 0;
int repeat;
ANY_t *st = (ANY_t *)*sptr;
(void)opt_codec_ctx;
(void)constraints;
/*
* Allocate the structure.
*/
if(!st) {
st = (ANY_t *)(*sptr = CALLOC(1, specs->struct_size));
if(!st) RETURN(RC_FAIL);
}
ASN_DEBUG("UPER Decoding ANY type");
st->size = 0;
do {
ssize_t raw_len;
ssize_t len_bytes;
ssize_t len_bits;
void *p;
int ret;
/* Get the PER length */
raw_len = uper_get_length(pd, -1, 0, &repeat);
if(raw_len < 0) RETURN(RC_WMORE);
if(raw_len == 0 && st->buf) break;
ASN_DEBUG("Got PER length len %" ASN_PRI_SIZE ", %s (%s)", raw_len,
repeat ? "repeat" : "once", td->name);
len_bytes = raw_len;
len_bits = len_bytes * 8;
p = REALLOC(st->buf, st->size + len_bytes + 1);
if(!p) RETURN(RC_FAIL);
st->buf = (uint8_t *)p;
ret = per_get_many_bits(pd, &st->buf[st->size], 0, len_bits);
if(ret < 0) RETURN(RC_WMORE);
consumed_myself += len_bits;
st->size += len_bytes;
} while(repeat);
st->buf[st->size] = 0; /* nul-terminate */
RETURN(RC_OK);
}
asn_enc_rval_t
ANY_encode_uper(const asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, const void *sptr,
asn_per_outp_t *po) {
const ANY_t *st = (const ANY_t *)sptr;
asn_enc_rval_t er = {0, 0, 0};
const uint8_t *buf;
size_t size;
int ret;
(void)constraints;
if(!st || (!st->buf && st->size)) ASN__ENCODE_FAILED;
buf = st->buf;
size = st->size;
do {
int need_eom = 0;
ssize_t may_save = uper_put_length(po, size, &need_eom);
if(may_save < 0) ASN__ENCODE_FAILED;
ret = per_put_many_bits(po, buf, may_save * 8);
if(ret) ASN__ENCODE_FAILED;
buf += may_save;
size -= may_save;
assert(!(may_save & 0x07) || !size);
if(need_eom && uper_put_length(po, 0, 0))
ASN__ENCODE_FAILED; /* End of Message length */
} while(size);
ASN__ENCODED_OK(er);
}
asn_dec_rval_t
ANY_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void **sptr,
asn_per_data_t *pd) {
const asn_OCTET_STRING_specifics_t *specs =
td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_SPC_ANY_specs;
size_t consumed_myself = 0;
int repeat;
ANY_t *st = (ANY_t *)*sptr;
(void)opt_codec_ctx;
(void)constraints;
/*
* Allocate the structure.
*/
if(!st) {
st = (ANY_t *)(*sptr = CALLOC(1, specs->struct_size));
if(!st) RETURN(RC_FAIL);
}
ASN_DEBUG("APER Decoding ANY type");
st->size = 0;
do {
ssize_t raw_len;
ssize_t len_bytes;
ssize_t len_bits;
void *p;
int ret;
/* Get the PER length */
raw_len = aper_get_length(pd, -1, 0, &repeat);
if(raw_len < 0) RETURN(RC_WMORE);
if(raw_len == 0 && st->buf) break;
ASN_DEBUG("Got PER length len %" ASN_PRI_SIZE ", %s (%s)", raw_len,
repeat ? "repeat" : "once", td->name);
len_bytes = raw_len;
len_bits = len_bytes * 8;
p = REALLOC(st->buf, st->size + len_bytes + 1);
if(!p) RETURN(RC_FAIL);
st->buf = (uint8_t *)p;
ret = per_get_many_bits(pd, &st->buf[st->size], 0, len_bits);
if(ret < 0) RETURN(RC_WMORE);
consumed_myself += len_bits;
st->size += len_bytes;
} while(repeat);
st->buf[st->size] = 0; /* nul-terminate */
RETURN(RC_OK);
}
asn_enc_rval_t
ANY_encode_aper(const asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, const void *sptr,
asn_per_outp_t *po) {
const ANY_t *st = (const ANY_t *)sptr;
asn_enc_rval_t er = {0, 0, 0};
const uint8_t *buf;
size_t size;
int ret;
(void)constraints;
if(!st || (!st->buf && st->size)) ASN__ENCODE_FAILED;
buf = st->buf;
size = st->size;
do {
int need_eom = 0;
ssize_t may_save = uper_put_length(po, size, &need_eom);
if(may_save < 0) ASN__ENCODE_FAILED;
ret = per_put_many_bits(po, buf, may_save * 8);
if(ret) ASN__ENCODE_FAILED;
buf += may_save;
size -= may_save;
assert(!(may_save & 0x07) || !size);
if(need_eom && uper_put_length(po, 0, 0))
ASN__ENCODE_FAILED; /* End of Message length */
} while(size);
ASN__ENCODED_OK(er);
}
#endif /* ASN_DISABLE_PER_SUPPORT */

View File

@@ -0,0 +1,65 @@
/*-
* Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#ifndef ASN_TYPE_ANY_H
#define ASN_TYPE_ANY_H
#include <OCTET_STRING.h> /* Implemented via OCTET STRING type */
#ifdef __cplusplus
extern "C" {
#endif
typedef struct ANY {
uint8_t *buf; /* BER-encoded ANY contents */
int size; /* Size of the above buffer */
asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */
} ANY_t;
extern asn_TYPE_descriptor_t asn_DEF_ANY;
extern asn_TYPE_operation_t asn_OP_ANY;
extern asn_OCTET_STRING_specifics_t asn_SPC_ANY_specs;
asn_struct_free_f ANY_free;
asn_struct_print_f ANY_print;
ber_type_decoder_f ANY_decode_ber;
der_type_encoder_f ANY_encode_der;
xer_type_encoder_f ANY_encode_xer;
per_type_decoder_f ANY_decode_uper;
per_type_encoder_f ANY_encode_uper;
per_type_decoder_f ANY_decode_aper;
per_type_encoder_f ANY_encode_aper;
#define ANY_free OCTET_STRING_free
#define ANY_print OCTET_STRING_print
#define ANY_compare OCTET_STRING_compare
#define ANY_constraint asn_generic_no_constraint
#define ANY_decode_ber OCTET_STRING_decode_ber
#define ANY_encode_der OCTET_STRING_encode_der
#define ANY_decode_xer OCTET_STRING_decode_xer_hex
/******************************
* Handy conversion routines. *
******************************/
/* Convert another ASN.1 type into the ANY. This implies DER encoding. */
int ANY_fromType(ANY_t *, asn_TYPE_descriptor_t *td, void *struct_ptr);
int ANY_fromType_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr);
ANY_t *ANY_new_fromType(asn_TYPE_descriptor_t *td, void *struct_ptr);
ANY_t *ANY_new_fromType_aper(asn_TYPE_descriptor_t *td, void *sptr);
/* Convert the contents of the ANY type into the specified type. */
int ANY_to_type(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr);
int ANY_to_type_aper(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr);
#define ANY_fromBuf(s, buf, size) OCTET_STRING_fromBuf((s), (buf), (size))
#define ANY_new_fromBuf(buf, size) OCTET_STRING_new_fromBuf( \
&asn_DEF_ANY, (buf), (size))
#ifdef __cplusplus
}
#endif
#endif /* ASN_TYPE_ANY_H */

View File

@@ -0,0 +1,656 @@
/*-
* Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#include <asn_internal.h>
#include <BIT_STRING.h>
#include <asn_internal.h>
/*
* BIT STRING basic type description.
*/
static const ber_tlv_tag_t asn_DEF_BIT_STRING_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (3 << 2))
};
asn_OCTET_STRING_specifics_t asn_SPC_BIT_STRING_specs = {
sizeof(BIT_STRING_t),
offsetof(BIT_STRING_t, _asn_ctx),
ASN_OSUBV_BIT
};
asn_TYPE_operation_t asn_OP_BIT_STRING = {
OCTET_STRING_free, /* Implemented in terms of OCTET STRING */
BIT_STRING_print,
BIT_STRING_compare,
OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */
OCTET_STRING_encode_der, /* Implemented in terms of OCTET STRING */
OCTET_STRING_decode_xer_binary,
BIT_STRING_encode_xer,
#ifdef ASN_DISABLE_OER_SUPPORT
0,
0,
#else
BIT_STRING_decode_oer,
BIT_STRING_encode_oer,
#endif /* ASN_DISABLE_OER_SUPPORT */
#ifdef ASN_DISABLE_PER_SUPPORT
0,
0,
0,
0,
#else
BIT_STRING_decode_uper, /* Unaligned PER decoder */
BIT_STRING_encode_uper, /* Unaligned PER encoder */
OCTET_STRING_decode_aper, /* Aligned PER decoder */
OCTET_STRING_encode_aper, /* Aligned PER encoder */
#endif /* ASN_DISABLE_PER_SUPPORT */
BIT_STRING_random_fill,
0 /* Use generic outmost tag fetcher */
};
asn_TYPE_descriptor_t asn_DEF_BIT_STRING = {
"BIT STRING",
"BIT_STRING",
&asn_OP_BIT_STRING,
asn_DEF_BIT_STRING_tags,
sizeof(asn_DEF_BIT_STRING_tags)
/ sizeof(asn_DEF_BIT_STRING_tags[0]),
asn_DEF_BIT_STRING_tags, /* Same as above */
sizeof(asn_DEF_BIT_STRING_tags)
/ sizeof(asn_DEF_BIT_STRING_tags[0]),
{ 0, 0, BIT_STRING_constraint },
0, 0, /* No members */
&asn_SPC_BIT_STRING_specs
};
/*
* BIT STRING generic constraint.
*/
int
BIT_STRING_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
if(st && st->buf) {
if((st->size == 0 && st->bits_unused)
|| st->bits_unused < 0 || st->bits_unused > 7) {
ASN__CTFAIL(app_key, td, sptr,
"%s: invalid padding byte (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
} else {
ASN__CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
return 0;
}
static const char *_bit_pattern[16] = {
"0000", "0001", "0010", "0011", "0100", "0101", "0110", "0111",
"1000", "1001", "1010", "1011", "1100", "1101", "1110", "1111"
};
asn_enc_rval_t
BIT_STRING_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr,
int ilevel, enum xer_encoder_flags_e flags,
asn_app_consume_bytes_f *cb, void *app_key) {
asn_enc_rval_t er = {0, 0, 0};
char scratch[128];
char *p = scratch;
char *scend = scratch + (sizeof(scratch) - 10);
const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
int xcan = (flags & XER_F_CANONICAL);
uint8_t *buf;
uint8_t *end;
if(!st || !st->buf)
ASN__ENCODE_FAILED;
er.encoded = 0;
buf = st->buf;
end = buf + st->size - 1; /* Last byte is special */
/*
* Binary dump
*/
for(; buf < end; buf++) {
int v = *buf;
int nline = xcan?0:(((buf - st->buf) % 8) == 0);
if(p >= scend || nline) {
ASN__CALLBACK(scratch, p - scratch);
p = scratch;
if(nline) ASN__TEXT_INDENT(1, ilevel);
}
memcpy(p + 0, _bit_pattern[v >> 4], 4);
memcpy(p + 4, _bit_pattern[v & 0x0f], 4);
p += 8;
}
if(!xcan && ((buf - st->buf) % 8) == 0)
ASN__TEXT_INDENT(1, ilevel);
ASN__CALLBACK(scratch, p - scratch);
p = scratch;
if(buf == end) {
int v = *buf;
int ubits = st->bits_unused;
int i;
for(i = 7; i >= ubits; i--)
*p++ = (v & (1 << i)) ? 0x31 : 0x30;
ASN__CALLBACK(scratch, p - scratch);
}
if(!xcan) ASN__TEXT_INDENT(1, ilevel - 1);
ASN__ENCODED_OK(er);
cb_failed:
ASN__ENCODE_FAILED;
}
/*
* BIT STRING specific contents printer.
*/
int
BIT_STRING_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
asn_app_consume_bytes_f *cb, void *app_key) {
const char * const h2c = "0123456789ABCDEF";
char scratch[64];
const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
uint8_t *buf;
uint8_t *end;
char *p = scratch;
(void)td; /* Unused argument */
if(!st || !st->buf)
return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
ilevel++;
buf = st->buf;
end = buf + st->size;
/*
* Hexadecimal dump.
*/
for(; buf < end; buf++) {
if((buf - st->buf) % 16 == 0 && (st->size > 16)
&& buf != st->buf) {
_i_INDENT(1);
/* Dump the string */
if(cb(scratch, p - scratch, app_key) < 0) return -1;
p = scratch;
}
*p++ = h2c[*buf >> 4];
*p++ = h2c[*buf & 0x0F];
*p++ = 0x20;
}
if(p > scratch) {
p--; /* Eat the tailing space */
if((st->size > 16)) {
_i_INDENT(1);
}
/* Dump the incomplete 16-bytes row */
if(cb(scratch, p - scratch, app_key) < 0)
return -1;
}
if(st->bits_unused) {
int ret = snprintf(scratch, sizeof(scratch), " (%d bit%s unused)",
st->bits_unused, st->bits_unused == 1 ? "" : "s");
assert(ret > 0 && ret < (ssize_t)sizeof(scratch));
if(ret > 0 && ret < (ssize_t)sizeof(scratch)
&& cb(scratch, ret, app_key) < 0)
return -1;
}
return 0;
}
/*
* Non-destructively remove the trailing 0-bits from the given bit string.
*/
static const BIT_STRING_t *
BIT_STRING__compactify(const BIT_STRING_t *st, BIT_STRING_t *tmp) {
const uint8_t *b;
union {
const uint8_t *c_buf;
uint8_t *nc_buf;
} unconst;
if(st->size == 0) {
assert(st->bits_unused == 0);
return st;
} else {
for(b = &st->buf[st->size - 1]; b > st->buf && *b == 0; b--) {
;
}
/* b points to the last byte which may contain data */
if(*b) {
int unused = 7;
uint8_t v = *b;
v &= -(int8_t)v;
if(v & 0x0F) unused -= 4;
if(v & 0x33) unused -= 2;
if(v & 0x55) unused -= 1;
tmp->size = b-st->buf + 1;
tmp->bits_unused = unused;
} else {
tmp->size = b-st->buf;
tmp->bits_unused = 0;
}
assert(b >= st->buf);
}
unconst.c_buf = st->buf;
tmp->buf = unconst.nc_buf;
return tmp;
}
/*
* Lexicographically compare the common prefix of both strings,
* and if it is the same return -1 for the smallest string.
*/
int
BIT_STRING_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
const void *bptr) {
/*
* Remove information about trailing bits, since
* X.680 (08/2015) #22.7 "ensure that different semantics are not"
* "associated with [values that differ only in] the trailing 0 bits."
*/
BIT_STRING_t compact_a, compact_b;
const BIT_STRING_t *a = BIT_STRING__compactify(aptr, &compact_a);
const BIT_STRING_t *b = BIT_STRING__compactify(bptr, &compact_b);
const asn_OCTET_STRING_specifics_t *specs = td->specifics;
assert(specs && specs->subvariant == ASN_OSUBV_BIT);
if(a && b) {
size_t common_prefix_size = a->size <= b->size ? a->size : b->size;
int ret = memcmp(a->buf, b->buf, common_prefix_size);
if(ret == 0) {
/* Figure out which string with equal prefixes is longer. */
if(a->size < b->size) {
return -1;
} else if(a->size > b->size) {
return 1;
} else {
/* Figure out how many unused bits */
if(a->bits_unused > b->bits_unused) {
return -1;
} else if(a->bits_unused < b->bits_unused) {
return 1;
} else {
return 0;
}
}
} else {
return ret;
}
} else if(!a && !b) {
return 0;
} else if(!a) {
return -1;
} else {
return 1;
}
}
#ifndef ASN_DISABLE_PER_SUPPORT
#undef RETURN
#define RETURN(_code) \
do { \
asn_dec_rval_t tmprval; \
tmprval.code = _code; \
tmprval.consumed = consumed_myself; \
return tmprval; \
} while(0)
static asn_per_constraint_t asn_DEF_BIT_STRING_constraint_size = {
APC_SEMI_CONSTRAINED, -1, -1, 0, 0};
asn_dec_rval_t
BIT_STRING_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints, void **sptr,
asn_per_data_t *pd) {
const asn_OCTET_STRING_specifics_t *specs = td->specifics
? (const asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_SPC_BIT_STRING_specs;
const asn_per_constraints_t *pc =
constraints ? constraints : td->encoding_constraints.per_constraints;
const asn_per_constraint_t *csiz;
asn_dec_rval_t rval = { RC_OK, 0 };
BIT_STRING_t *st = (BIT_STRING_t *)*sptr;
ssize_t consumed_myself = 0;
int repeat;
(void)opt_codec_ctx;
if(pc) {
csiz = &pc->size;
} else {
csiz = &asn_DEF_BIT_STRING_constraint_size;
}
if(specs->subvariant != ASN_OSUBV_BIT) {
ASN_DEBUG("Subvariant %d is not BIT OSUBV_BIT", specs->subvariant);
RETURN(RC_FAIL);
}
/*
* Allocate the string.
*/
if(!st) {
st = (BIT_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
if(!st) RETURN(RC_FAIL);
}
ASN_DEBUG("PER Decoding %s size %ld .. %ld bits %d",
csiz->flags & APC_EXTENSIBLE ? "extensible" : "non-extensible",
csiz->lower_bound, csiz->upper_bound, csiz->effective_bits);
if(csiz->flags & APC_EXTENSIBLE) {
int inext = per_get_few_bits(pd, 1);
if(inext < 0) RETURN(RC_WMORE);
if(inext) {
csiz = &asn_DEF_BIT_STRING_constraint_size;
}
}
if(csiz->effective_bits >= 0) {
FREEMEM(st->buf);
st->size = (csiz->upper_bound + 7) >> 3;
st->buf = (uint8_t *)MALLOC(st->size + 1);
if(!st->buf) { st->size = 0; RETURN(RC_FAIL); }
}
/* X.691, #16.5: zero-length encoding */
/* X.691, #16.6: short fixed length encoding (up to 2 octets) */
/* X.691, #16.7: long fixed length encoding (up to 64K octets) */
if(csiz->effective_bits == 0) {
int ret;
ASN_DEBUG("Encoding BIT STRING size %ld", csiz->upper_bound);
ret = per_get_many_bits(pd, st->buf, 0, csiz->upper_bound);
if(ret < 0) RETURN(RC_WMORE);
consumed_myself += csiz->upper_bound;
st->buf[st->size] = 0;
st->bits_unused = (8 - (csiz->upper_bound & 0x7)) & 0x7;
RETURN(RC_OK);
}
st->size = 0;
do {
ssize_t raw_len;
ssize_t len_bytes;
ssize_t len_bits;
void *p;
int ret;
/* Get the PER length */
raw_len = uper_get_length(pd, csiz->effective_bits, csiz->lower_bound,
&repeat);
if(raw_len < 0) RETURN(RC_WMORE);
if(raw_len == 0 && st->buf) break;
ASN_DEBUG("Got PER length eb %ld, len %ld, %s (%s)",
(long)csiz->effective_bits, (long)raw_len,
repeat ? "repeat" : "once", td->name);
len_bits = raw_len;
len_bytes = (len_bits + 7) >> 3;
if(len_bits & 0x7) st->bits_unused = 8 - (len_bits & 0x7);
/* len_bits be multiple of 16K if repeat is set */
p = REALLOC(st->buf, st->size + len_bytes + 1);
if(!p) RETURN(RC_FAIL);
st->buf = (uint8_t *)p;
ret = per_get_many_bits(pd, &st->buf[st->size], 0, len_bits);
if(ret < 0) RETURN(RC_WMORE);
st->size += len_bytes;
} while(repeat);
st->buf[st->size] = 0; /* nul-terminate */
return rval;
}
asn_enc_rval_t
BIT_STRING_encode_uper(const asn_TYPE_descriptor_t *td,
const asn_per_constraints_t *constraints,
const void *sptr, asn_per_outp_t *po) {
const asn_OCTET_STRING_specifics_t *specs =
td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_SPC_BIT_STRING_specs;
const asn_per_constraints_t *pc =
constraints ? constraints : td->encoding_constraints.per_constraints;
const asn_per_constraint_t *csiz;
const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
BIT_STRING_t compact_bstr; /* Do not modify this directly! */
asn_enc_rval_t er = { 0, 0, 0 };
int inext = 0; /* Lies not within extension root */
size_t size_in_bits;
const uint8_t *buf;
int ret;
int ct_extensible;
if(!st || (!st->buf && st->size))
ASN__ENCODE_FAILED;
if(specs->subvariant == ASN_OSUBV_BIT) {
if((st->size == 0 && st->bits_unused) || (st->bits_unused & ~7))
ASN__ENCODE_FAILED;
} else {
ASN__ENCODE_FAILED;
}
if(pc) {
csiz = &pc->size;
} else {
csiz = &asn_DEF_BIT_STRING_constraint_size;
}
ct_extensible = csiz->flags & APC_EXTENSIBLE;
/* Figure out the size without the trailing bits */
st = BIT_STRING__compactify(st, &compact_bstr);
size_in_bits = 8 * st->size - st->bits_unused;
ASN_DEBUG(
"Encoding %s into %" ASN_PRI_SIZE " bits"
" (%ld..%ld, effective %d)%s",
td->name, size_in_bits, csiz->lower_bound, csiz->upper_bound,
csiz->effective_bits, ct_extensible ? " EXT" : "");
/* Figure out whether size lies within PER visible constraint */
if(csiz->effective_bits >= 0) {
if((ssize_t)size_in_bits > csiz->upper_bound) {
if(ct_extensible) {
csiz = &asn_DEF_BIT_STRING_constraint_size;
inext = 1;
} else {
ASN__ENCODE_FAILED;
}
}
} else {
inext = 0;
}
if(ct_extensible) {
/* Declare whether length is [not] within extension root */
if(per_put_few_bits(po, inext, 1))
ASN__ENCODE_FAILED;
}
if(csiz->effective_bits >= 0 && !inext) {
int add_trailer = (ssize_t)size_in_bits < csiz->lower_bound;
ASN_DEBUG(
"Encoding %" ASN_PRI_SIZE " bytes (%ld), length (in %d bits) trailer %d; actual "
"value %" ASN_PRI_SSIZE "",
st->size, size_in_bits - csiz->lower_bound, csiz->effective_bits,
add_trailer,
add_trailer ? 0 : (ssize_t)size_in_bits - csiz->lower_bound);
ret = per_put_few_bits(
po, add_trailer ? 0 : (ssize_t)size_in_bits - csiz->lower_bound,
csiz->effective_bits);
if(ret) ASN__ENCODE_FAILED;
ret = per_put_many_bits(po, st->buf, size_in_bits);
if(ret) ASN__ENCODE_FAILED;
if(add_trailer) {
static const uint8_t zeros[16];
size_t trailing_zero_bits = csiz->lower_bound - size_in_bits;
while(trailing_zero_bits > 0) {
if(trailing_zero_bits > 8 * sizeof(zeros)) {
ret = per_put_many_bits(po, zeros, 8 * sizeof(zeros));
trailing_zero_bits -= 8 * sizeof(zeros);
} else {
ret = per_put_many_bits(po, zeros, trailing_zero_bits);
trailing_zero_bits = 0;
}
if(ret) ASN__ENCODE_FAILED;
}
}
ASN__ENCODED_OK(er);
}
ASN_DEBUG("Encoding %" ASN_PRI_SIZE " bytes", st->size);
buf = st->buf;
do {
int need_eom = 0;
ssize_t maySave = uper_put_length(po, size_in_bits, &need_eom);
if(maySave < 0) ASN__ENCODE_FAILED;
ASN_DEBUG("Encoding %" ASN_PRI_SSIZE " of %" ASN_PRI_SIZE "", maySave, size_in_bits);
ret = per_put_many_bits(po, buf, maySave);
if(ret) ASN__ENCODE_FAILED;
buf += maySave >> 3;
size_in_bits -= maySave;
assert(!(maySave & 0x07) || !size_in_bits);
if(need_eom && uper_put_length(po, 0, 0))
ASN__ENCODE_FAILED; /* End of Message length */
} while(size_in_bits);
ASN__ENCODED_OK(er);
}
#endif /* ASN_DISABLE_PER_SUPPORT */
asn_random_fill_result_t
BIT_STRING_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
const asn_encoding_constraints_t *constraints,
size_t max_length) {
const asn_OCTET_STRING_specifics_t *specs =
td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_SPC_BIT_STRING_specs;
asn_random_fill_result_t result_ok = {ARFILL_OK, 1};
asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
static unsigned lengths[] = {0, 1, 2, 3, 4, 8,
126, 127, 128, 16383, 16384, 16385,
65534, 65535, 65536, 65537};
uint8_t *buf;
uint8_t *bend;
uint8_t *b;
size_t rnd_bits, rnd_len;
BIT_STRING_t *st;
if(max_length == 0) return result_skipped;
switch(specs->subvariant) {
case ASN_OSUBV_ANY:
return result_failed;
case ASN_OSUBV_BIT:
break;
default:
break;
}
/* Figure out how far we should go */
rnd_bits = lengths[asn_random_between(
0, sizeof(lengths) / sizeof(lengths[0]) - 1)];
if(!constraints || !constraints->per_constraints)
constraints = &td->encoding_constraints;
if(constraints->per_constraints) {
const asn_per_constraint_t *pc = &constraints->per_constraints->size;
if(pc->flags & APC_CONSTRAINED) {
long suggested_upper_bound = pc->upper_bound < (ssize_t)max_length
? pc->upper_bound
: (ssize_t)max_length;
if(max_length < (size_t)pc->lower_bound) {
return result_skipped;
}
if(pc->flags & APC_EXTENSIBLE) {
switch(asn_random_between(0, 5)) {
case 0:
if(pc->lower_bound > 0) {
rnd_bits = pc->lower_bound - 1;
break;
}
/* Fall through */
case 1:
rnd_bits = pc->upper_bound + 1;
break;
case 2:
/* Keep rnd_bits from the table */
if(rnd_bits < max_length) {
break;
}
/* Fall through */
default:
rnd_bits = asn_random_between(pc->lower_bound,
suggested_upper_bound);
}
} else {
rnd_bits =
asn_random_between(pc->lower_bound, suggested_upper_bound);
}
} else {
rnd_bits = asn_random_between(0, max_length - 1);
}
} else if(rnd_bits >= max_length) {
rnd_bits = asn_random_between(0, max_length - 1);
}
rnd_len = (rnd_bits + 7) / 8;
buf = CALLOC(1, rnd_len + 1);
if(!buf) return result_failed;
bend = &buf[rnd_len];
for(b = buf; b < bend; b++) {
*(uint8_t *)b = asn_random_between(0, 255);
}
*b = 0; /* Zero-terminate just in case. */
if(*sptr) {
st = *sptr;
FREEMEM(st->buf);
} else {
st = (BIT_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
if(!st) {
FREEMEM(buf);
return result_failed;
}
}
st->buf = buf;
st->size = rnd_len;
st->bits_unused = (8 - (rnd_bits & 0x7)) & 0x7;
if(st->bits_unused) {
assert(st->size > 0);
st->buf[st->size-1] &= 0xff << st->bits_unused;
}
result_ok.length = st->size;
return result_ok;
}

View File

@@ -0,0 +1,48 @@
/*-
* Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#ifndef _BIT_STRING_H_
#define _BIT_STRING_H_
#include <OCTET_STRING.h> /* Some help from OCTET STRING */
#ifdef __cplusplus
extern "C" {
#endif
typedef struct BIT_STRING_s {
uint8_t *buf; /* BIT STRING body */
size_t size; /* Size of the above buffer */
int bits_unused;/* Unused trailing bits in the last octet (0..7) */
asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */
} BIT_STRING_t;
extern asn_TYPE_descriptor_t asn_DEF_BIT_STRING;
extern asn_TYPE_operation_t asn_OP_BIT_STRING;
extern asn_OCTET_STRING_specifics_t asn_SPC_BIT_STRING_specs;
asn_struct_print_f BIT_STRING_print; /* Human-readable output */
asn_struct_compare_f BIT_STRING_compare;
asn_constr_check_f BIT_STRING_constraint;
xer_type_encoder_f BIT_STRING_encode_xer;
oer_type_decoder_f BIT_STRING_decode_oer;
oer_type_encoder_f BIT_STRING_encode_oer;
per_type_decoder_f BIT_STRING_decode_uper;
per_type_encoder_f BIT_STRING_encode_uper;
asn_random_fill_f BIT_STRING_random_fill;
#define BIT_STRING_free OCTET_STRING_free
#define BIT_STRING_decode_ber OCTET_STRING_decode_ber
#define BIT_STRING_encode_der OCTET_STRING_encode_der
#define BIT_STRING_decode_xer OCTET_STRING_decode_xer_binary
#define BIT_STRING_decode_aper OCTET_STRING_decode_aper
#define BIT_STRING_encode_aper OCTET_STRING_encode_aper
#ifdef __cplusplus
}
#endif
#endif /* _BIT_STRING_H_ */

View File

@@ -0,0 +1,174 @@
/*
* Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
* All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#ifndef ASN_DISABLE_OER_SUPPORT
#include <asn_internal.h>
#include <BIT_STRING.h>
#include <errno.h>
asn_dec_rval_t
BIT_STRING_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td,
const asn_oer_constraints_t *constraints, void **sptr,
const void *ptr, size_t size) {
BIT_STRING_t *st = (BIT_STRING_t *)*sptr;
const asn_oer_constraints_t *cts =
constraints ? constraints : td->encoding_constraints.oer_constraints;
ssize_t ct_size = cts ? cts->size : -1;
asn_dec_rval_t rval = {RC_OK, 0};
size_t expected_length = 0;
(void)opt_codec_ctx;
if(!st) {
st = (BIT_STRING_t *)(*sptr = CALLOC(1, sizeof(*st)));
if(!st) ASN__DECODE_FAILED;
}
if(ct_size >= 0) {
expected_length = (ct_size + 7) >> 3;
st->bits_unused = (8 - (ct_size & 7)) & 7;
} else {
/*
* X.696 (08/2015) #13.3.1
* Encode length determinant as _number of octets_, but only
* if upper bound is not equal to lower bound.
*/
ssize_t len_len = oer_fetch_length(ptr, size, &expected_length);
if(len_len > 0) {
ptr = (const char *)ptr + len_len;
size -= len_len;
} else if(len_len == 0) {
ASN__DECODE_STARVED;
} else if(len_len < 0) {
ASN__DECODE_FAILED;
}
if(expected_length < 1) {
ASN__DECODE_FAILED;
} else if(expected_length > size) {
ASN__DECODE_STARVED;
}
st->bits_unused = ((const uint8_t *)ptr)[0];
if(st->bits_unused & ~7) {
ASN_DEBUG("%s: unused bits outside of 0..7 range", td->name);
ASN__DECODE_FAILED;
}
ptr = (const char *)ptr + 1;
size--;
expected_length--;
rval.consumed = len_len + 1;
}
if(size < expected_length) {
ASN__DECODE_STARVED;
} else {
uint8_t *buf = MALLOC(expected_length + 1);
if(buf == NULL) {
ASN__DECODE_FAILED;
} else {
memcpy(buf, ptr, expected_length);
buf[expected_length] = '\0';
}
FREEMEM(st->buf);
st->buf = buf;
st->size = expected_length;
if(expected_length > 0) {
buf[expected_length - 1] &= (0xff << st->bits_unused);
}
rval.consumed += expected_length;
return rval;
}
}
/*
* Encode as Canonical OER.
*/
asn_enc_rval_t
BIT_STRING_encode_oer(const asn_TYPE_descriptor_t *td,
const asn_oer_constraints_t *constraints,
const void *sptr, asn_app_consume_bytes_f *cb,
void *app_key) {
const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
asn_enc_rval_t erval = {0, 0, 0};
const asn_oer_constraints_t *cts =
constraints ? constraints : td->encoding_constraints.oer_constraints;
ssize_t ct_size = cts ? cts->size : -1;
size_t trailing_zeros = 0;
int fix_last_byte = 0;
if(!st) ASN__ENCODE_FAILED;
if(st->bits_unused & ~7) {
ASN_DEBUG("BIT STRING unused bits %d out of 0..7 range",
st->bits_unused);
ASN__ENCODE_FAILED;
}
if(st->bits_unused && !(st->size && st->buf)) {
ASN_DEBUG("BIT STRING %s size 0 can't support unused bits %d", td->name,
st->bits_unused);
ASN__ENCODE_FAILED;
}
if(ct_size >= 0) {
size_t ct_bytes = (ct_size + 7) >> 3;
if(st->size > ct_bytes) {
ASN_DEBUG("More bits in BIT STRING %s (%" ASN_PRI_SSIZE ") than constrained %" ASN_PRI_SSIZE "",
td->name, 8 * st->size - st->bits_unused, ct_size);
ASN__ENCODE_FAILED;
}
trailing_zeros = ct_bytes - st->size; /* Allow larger constraint */
} else {
uint8_t ub = st->bits_unused & 7;
ssize_t len_len = oer_serialize_length(1 + st->size, cb, app_key);
if(len_len < 0) ASN__ENCODE_FAILED;
if(cb(&ub, 1, app_key) < 0) {
ASN__ENCODE_FAILED;
}
erval.encoded += len_len + 1;
}
if(st->bits_unused) {
if(st->buf[st->size - 1] & (0xff << st->bits_unused)) {
fix_last_byte = 1;
}
}
if(cb(st->buf, st->size - fix_last_byte, app_key) < 0) {
ASN__ENCODE_FAILED;
}
if(fix_last_byte) {
uint8_t b = st->buf[st->size - 1] & (0xff << st->bits_unused);
if(cb(&b, 1, app_key) < 0) {
ASN__ENCODE_FAILED;
}
}
erval.encoded += st->size;
if(trailing_zeros) {
static uint8_t zeros[16];
while(trailing_zeros > 0) {
int ret;
if(trailing_zeros < sizeof(zeros)) {
ret = cb(zeros, trailing_zeros, app_key);
erval.encoded += trailing_zeros;
} else {
ret = cb(zeros, sizeof(zeros), app_key);
erval.encoded += sizeof(zeros);
}
if(ret < 0) ASN__ENCODE_FAILED;
}
}
return erval;
}
#endif /* ASN_DISABLE_OER_SUPPORT */

View File

@@ -0,0 +1,65 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2SM-KPM-IEs"
* found in "/home/rshacham/e2sm-kpm-v01.02.asn"
* `asn1c -fcompound-names`
*/
#include "C-RNTI.h"
int
C_RNTI_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
size_t size;
if(!sptr) {
ASN__CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
size = st->size;
if((size == 2)) {
/* Constraint check succeeded */
return 0;
} else {
ASN__CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
/*
* This type is implemented using OCTET_STRING,
* so here we adjust the DEF accordingly.
*/
static asn_oer_constraints_t asn_OER_type_C_RNTI_constr_1 CC_NOTUSED = {
{ 0, 0 },
2 /* (SIZE(2..2)) */};
asn_per_constraints_t asn_PER_type_C_RNTI_constr_1 CC_NOTUSED = {
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
{ APC_CONSTRAINED, 0, 0, 2, 2 } /* (SIZE(2..2)) */,
0, 0 /* No PER value map */
};
static const ber_tlv_tag_t asn_DEF_C_RNTI_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
};
asn_TYPE_descriptor_t asn_DEF_C_RNTI = {
"C-RNTI",
"C-RNTI",
&asn_OP_OCTET_STRING,
asn_DEF_C_RNTI_tags_1,
sizeof(asn_DEF_C_RNTI_tags_1)
/sizeof(asn_DEF_C_RNTI_tags_1[0]), /* 1 */
asn_DEF_C_RNTI_tags_1, /* Same as above */
sizeof(asn_DEF_C_RNTI_tags_1)
/sizeof(asn_DEF_C_RNTI_tags_1[0]), /* 1 */
{ &asn_OER_type_C_RNTI_constr_1, &asn_PER_type_C_RNTI_constr_1, C_RNTI_constraint },
0, 0, /* No members */
&asn_SPC_OCTET_STRING_specs /* Additional specs */
};

View File

@@ -0,0 +1,46 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2SM-KPM-IEs"
* found in "/home/rshacham/e2sm-kpm-v01.02.asn"
* `asn1c -fcompound-names`
*/
#ifndef _C_RNTI_H_
#define _C_RNTI_H_
#include <asn_application.h>
/* Including external dependencies */
#include <OCTET_STRING.h>
#ifdef __cplusplus
extern "C" {
#endif
/* C-RNTI */
typedef OCTET_STRING_t C_RNTI_t;
/* Implementation */
extern asn_per_constraints_t asn_PER_type_C_RNTI_constr_1;
extern asn_TYPE_descriptor_t asn_DEF_C_RNTI;
asn_struct_free_f C_RNTI_free;
asn_struct_print_f C_RNTI_print;
asn_constr_check_f C_RNTI_constraint;
ber_type_decoder_f C_RNTI_decode_ber;
der_type_encoder_f C_RNTI_encode_der;
xer_type_decoder_f C_RNTI_decode_xer;
xer_type_encoder_f C_RNTI_encode_xer;
oer_type_decoder_f C_RNTI_decode_oer;
oer_type_encoder_f C_RNTI_encode_oer;
per_type_decoder_f C_RNTI_decode_uper;
per_type_encoder_f C_RNTI_encode_uper;
per_type_decoder_f C_RNTI_decode_aper;
per_type_encoder_f C_RNTI_encode_aper;
#ifdef __cplusplus
}
#endif
#endif /* _C_RNTI_H_ */
#include <asn_internal.h>

View File

@@ -0,0 +1,139 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2SM-KPM-IEs"
* found in "/home/rshacham/e2sm-kpm-v01.02.asn"
* `asn1c -fcompound-names`
*/
#include "CU-CP-Usage-Report-CellResourceReportItem.h"
static int
memb_ueResourceReportList_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
size_t size;
if(!sptr) {
ASN__CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
/* Determine the number of elements */
size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
if((size >= 1 && size <= 32)) {
/* Perform validation of the inner elements */
return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
} else {
ASN__CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static asn_oer_constraints_t asn_OER_type_ueResourceReportList_constr_3 CC_NOTUSED = {
{ 0, 0 },
-1 /* (SIZE(1..32)) */};
static asn_per_constraints_t asn_PER_type_ueResourceReportList_constr_3 CC_NOTUSED = {
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
{ APC_CONSTRAINED, 5, 5, 1, 32 } /* (SIZE(1..32)) */,
0, 0 /* No PER value map */
};
static asn_oer_constraints_t asn_OER_memb_ueResourceReportList_constr_3 CC_NOTUSED = {
{ 0, 0 },
-1 /* (SIZE(1..32)) */};
static asn_per_constraints_t asn_PER_memb_ueResourceReportList_constr_3 CC_NOTUSED = {
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
{ APC_CONSTRAINED, 5, 5, 1, 32 } /* (SIZE(1..32)) */,
0, 0 /* No PER value map */
};
static asn_TYPE_member_t asn_MBR_ueResourceReportList_3[] = {
{ ATF_POINTER, 0, 0,
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
0,
&asn_DEF_CU_CP_Usage_Report_UeResourceReportItem,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
""
},
};
static const ber_tlv_tag_t asn_DEF_ueResourceReportList_tags_3[] = {
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_SET_OF_specifics_t asn_SPC_ueResourceReportList_specs_3 = {
sizeof(struct CU_CP_Usage_Report_CellResourceReportItem__ueResourceReportList),
offsetof(struct CU_CP_Usage_Report_CellResourceReportItem__ueResourceReportList, _asn_ctx),
0, /* XER encoding is XMLDelimitedItemList */
};
static /* Use -fall-defs-global to expose */
asn_TYPE_descriptor_t asn_DEF_ueResourceReportList_3 = {
"ueResourceReportList",
"ueResourceReportList",
&asn_OP_SEQUENCE_OF,
asn_DEF_ueResourceReportList_tags_3,
sizeof(asn_DEF_ueResourceReportList_tags_3)
/sizeof(asn_DEF_ueResourceReportList_tags_3[0]) - 1, /* 1 */
asn_DEF_ueResourceReportList_tags_3, /* Same as above */
sizeof(asn_DEF_ueResourceReportList_tags_3)
/sizeof(asn_DEF_ueResourceReportList_tags_3[0]), /* 2 */
{ &asn_OER_type_ueResourceReportList_constr_3, &asn_PER_type_ueResourceReportList_constr_3, SEQUENCE_OF_constraint },
asn_MBR_ueResourceReportList_3,
1, /* Single element */
&asn_SPC_ueResourceReportList_specs_3 /* Additional specs */
};
asn_TYPE_member_t asn_MBR_CU_CP_Usage_Report_CellResourceReportItem_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct CU_CP_Usage_Report_CellResourceReportItem, nRCGI),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_NRCGI,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"nRCGI"
},
{ ATF_NOFLAGS, 0, offsetof(struct CU_CP_Usage_Report_CellResourceReportItem, ueResourceReportList),
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
0,
&asn_DEF_ueResourceReportList_3,
0,
{ &asn_OER_memb_ueResourceReportList_constr_3, &asn_PER_memb_ueResourceReportList_constr_3, memb_ueResourceReportList_constraint_1 },
0, 0, /* No default value */
"ueResourceReportList"
},
};
static const ber_tlv_tag_t asn_DEF_CU_CP_Usage_Report_CellResourceReportItem_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_CU_CP_Usage_Report_CellResourceReportItem_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* nRCGI */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* ueResourceReportList */
};
asn_SEQUENCE_specifics_t asn_SPC_CU_CP_Usage_Report_CellResourceReportItem_specs_1 = {
sizeof(struct CU_CP_Usage_Report_CellResourceReportItem),
offsetof(struct CU_CP_Usage_Report_CellResourceReportItem, _asn_ctx),
asn_MAP_CU_CP_Usage_Report_CellResourceReportItem_tag2el_1,
2, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
2, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_CU_CP_Usage_Report_CellResourceReportItem = {
"CU-CP-Usage-Report-CellResourceReportItem",
"CU-CP-Usage-Report-CellResourceReportItem",
&asn_OP_SEQUENCE,
asn_DEF_CU_CP_Usage_Report_CellResourceReportItem_tags_1,
sizeof(asn_DEF_CU_CP_Usage_Report_CellResourceReportItem_tags_1)
/sizeof(asn_DEF_CU_CP_Usage_Report_CellResourceReportItem_tags_1[0]), /* 1 */
asn_DEF_CU_CP_Usage_Report_CellResourceReportItem_tags_1, /* Same as above */
sizeof(asn_DEF_CU_CP_Usage_Report_CellResourceReportItem_tags_1)
/sizeof(asn_DEF_CU_CP_Usage_Report_CellResourceReportItem_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_CU_CP_Usage_Report_CellResourceReportItem_1,
2, /* Elements count */
&asn_SPC_CU_CP_Usage_Report_CellResourceReportItem_specs_1 /* Additional specs */
};

View File

@@ -0,0 +1,58 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2SM-KPM-IEs"
* found in "/home/rshacham/e2sm-kpm-v01.02.asn"
* `asn1c -fcompound-names`
*/
#ifndef _CU_CP_Usage_Report_CellResourceReportItem_H_
#define _CU_CP_Usage_Report_CellResourceReportItem_H_
#include <asn_application.h>
/* Including external dependencies */
#include "NRCGI.h"
#include <asn_SEQUENCE_OF.h>
#include <constr_SEQUENCE_OF.h>
#include <constr_SEQUENCE.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Forward declarations */
struct CU_CP_Usage_Report_UeResourceReportItem;
/* CU-CP-Usage-Report-CellResourceReportItem */
typedef struct CU_CP_Usage_Report_CellResourceReportItem {
NRCGI_t nRCGI;
struct CU_CP_Usage_Report_CellResourceReportItem__ueResourceReportList {
A_SEQUENCE_OF(struct CU_CP_Usage_Report_UeResourceReportItem) list;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} ueResourceReportList;
/*
* This type is extensible,
* possible extensions are below.
*/
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} CU_CP_Usage_Report_CellResourceReportItem_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_CU_CP_Usage_Report_CellResourceReportItem;
extern asn_SEQUENCE_specifics_t asn_SPC_CU_CP_Usage_Report_CellResourceReportItem_specs_1;
extern asn_TYPE_member_t asn_MBR_CU_CP_Usage_Report_CellResourceReportItem_1[2];
#ifdef __cplusplus
}
#endif
/* Referred external types */
#include "CU-CP-Usage-Report-UeResourceReportItem.h"
#endif /* _CU_CP_Usage_Report_CellResourceReportItem_H_ */
#include <asn_internal.h>

View File

@@ -0,0 +1,129 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2SM-KPM-IEs"
* found in "/home/rshacham/e2sm-kpm-v01.02.asn"
* `asn1c -fcompound-names`
*/
#include "CU-CP-Usage-Report-Per-UE.h"
static int
memb_cellResourceReportList_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
size_t size;
if(!sptr) {
ASN__CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
/* Determine the number of elements */
size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
if((size >= 1 && size <= 16384)) {
/* Perform validation of the inner elements */
return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
} else {
ASN__CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static asn_oer_constraints_t asn_OER_type_cellResourceReportList_constr_2 CC_NOTUSED = {
{ 0, 0 },
-1 /* (SIZE(1..16384)) */};
static asn_per_constraints_t asn_PER_type_cellResourceReportList_constr_2 CC_NOTUSED = {
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
{ APC_CONSTRAINED, 14, 14, 1, 16384 } /* (SIZE(1..16384)) */,
0, 0 /* No PER value map */
};
static asn_oer_constraints_t asn_OER_memb_cellResourceReportList_constr_2 CC_NOTUSED = {
{ 0, 0 },
-1 /* (SIZE(1..16384)) */};
static asn_per_constraints_t asn_PER_memb_cellResourceReportList_constr_2 CC_NOTUSED = {
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
{ APC_CONSTRAINED, 14, 14, 1, 16384 } /* (SIZE(1..16384)) */,
0, 0 /* No PER value map */
};
static asn_TYPE_member_t asn_MBR_cellResourceReportList_2[] = {
{ ATF_POINTER, 0, 0,
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
0,
&asn_DEF_CU_CP_Usage_Report_CellResourceReportItem,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
""
},
};
static const ber_tlv_tag_t asn_DEF_cellResourceReportList_tags_2[] = {
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_SET_OF_specifics_t asn_SPC_cellResourceReportList_specs_2 = {
sizeof(struct CU_CP_Usage_Report_Per_UE__cellResourceReportList),
offsetof(struct CU_CP_Usage_Report_Per_UE__cellResourceReportList, _asn_ctx),
0, /* XER encoding is XMLDelimitedItemList */
};
static /* Use -fall-defs-global to expose */
asn_TYPE_descriptor_t asn_DEF_cellResourceReportList_2 = {
"cellResourceReportList",
"cellResourceReportList",
&asn_OP_SEQUENCE_OF,
asn_DEF_cellResourceReportList_tags_2,
sizeof(asn_DEF_cellResourceReportList_tags_2)
/sizeof(asn_DEF_cellResourceReportList_tags_2[0]) - 1, /* 1 */
asn_DEF_cellResourceReportList_tags_2, /* Same as above */
sizeof(asn_DEF_cellResourceReportList_tags_2)
/sizeof(asn_DEF_cellResourceReportList_tags_2[0]), /* 2 */
{ &asn_OER_type_cellResourceReportList_constr_2, &asn_PER_type_cellResourceReportList_constr_2, SEQUENCE_OF_constraint },
asn_MBR_cellResourceReportList_2,
1, /* Single element */
&asn_SPC_cellResourceReportList_specs_2 /* Additional specs */
};
asn_TYPE_member_t asn_MBR_CU_CP_Usage_Report_Per_UE_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct CU_CP_Usage_Report_Per_UE, cellResourceReportList),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
0,
&asn_DEF_cellResourceReportList_2,
0,
{ &asn_OER_memb_cellResourceReportList_constr_2, &asn_PER_memb_cellResourceReportList_constr_2, memb_cellResourceReportList_constraint_1 },
0, 0, /* No default value */
"cellResourceReportList"
},
};
static const ber_tlv_tag_t asn_DEF_CU_CP_Usage_Report_Per_UE_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_CU_CP_Usage_Report_Per_UE_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* cellResourceReportList */
};
asn_SEQUENCE_specifics_t asn_SPC_CU_CP_Usage_Report_Per_UE_specs_1 = {
sizeof(struct CU_CP_Usage_Report_Per_UE),
offsetof(struct CU_CP_Usage_Report_Per_UE, _asn_ctx),
asn_MAP_CU_CP_Usage_Report_Per_UE_tag2el_1,
1, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
1, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_CU_CP_Usage_Report_Per_UE = {
"CU-CP-Usage-Report-Per-UE",
"CU-CP-Usage-Report-Per-UE",
&asn_OP_SEQUENCE,
asn_DEF_CU_CP_Usage_Report_Per_UE_tags_1,
sizeof(asn_DEF_CU_CP_Usage_Report_Per_UE_tags_1)
/sizeof(asn_DEF_CU_CP_Usage_Report_Per_UE_tags_1[0]), /* 1 */
asn_DEF_CU_CP_Usage_Report_Per_UE_tags_1, /* Same as above */
sizeof(asn_DEF_CU_CP_Usage_Report_Per_UE_tags_1)
/sizeof(asn_DEF_CU_CP_Usage_Report_Per_UE_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_CU_CP_Usage_Report_Per_UE_1,
1, /* Elements count */
&asn_SPC_CU_CP_Usage_Report_Per_UE_specs_1 /* Additional specs */
};

View File

@@ -0,0 +1,56 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2SM-KPM-IEs"
* found in "/home/rshacham/e2sm-kpm-v01.02.asn"
* `asn1c -fcompound-names`
*/
#ifndef _CU_CP_Usage_Report_Per_UE_H_
#define _CU_CP_Usage_Report_Per_UE_H_
#include <asn_application.h>
/* Including external dependencies */
#include <asn_SEQUENCE_OF.h>
#include <constr_SEQUENCE_OF.h>
#include <constr_SEQUENCE.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Forward declarations */
struct CU_CP_Usage_Report_CellResourceReportItem;
/* CU-CP-Usage-Report-Per-UE */
typedef struct CU_CP_Usage_Report_Per_UE {
struct CU_CP_Usage_Report_Per_UE__cellResourceReportList {
A_SEQUENCE_OF(struct CU_CP_Usage_Report_CellResourceReportItem) list;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} cellResourceReportList;
/*
* This type is extensible,
* possible extensions are below.
*/
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} CU_CP_Usage_Report_Per_UE_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_CU_CP_Usage_Report_Per_UE;
extern asn_SEQUENCE_specifics_t asn_SPC_CU_CP_Usage_Report_Per_UE_specs_1;
extern asn_TYPE_member_t asn_MBR_CU_CP_Usage_Report_Per_UE_1[1];
#ifdef __cplusplus
}
#endif
/* Referred external types */
#include "CU-CP-Usage-Report-CellResourceReportItem.h"
#endif /* _CU_CP_Usage_Report_Per_UE_H_ */
#include <asn_internal.h>

View File

@@ -0,0 +1,72 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2SM-KPM-IEs"
* found in "/home/rshacham/e2sm-kpm-v01.02.asn"
* `asn1c -fcompound-names`
*/
#include "CU-CP-Usage-Report-UeResourceReportItem.h"
asn_TYPE_member_t asn_MBR_CU_CP_Usage_Report_UeResourceReportItem_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct CU_CP_Usage_Report_UeResourceReportItem, c_RNTI),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_C_RNTI,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"c-RNTI"
},
{ ATF_POINTER, 2, offsetof(struct CU_CP_Usage_Report_UeResourceReportItem, serving_Cell_RF_Type),
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_OCTET_STRING,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"serving-Cell-RF-Type"
},
{ ATF_POINTER, 1, offsetof(struct CU_CP_Usage_Report_UeResourceReportItem, neighbor_Cell_RF),
(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_OCTET_STRING,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"neighbor-Cell-RF"
},
};
static const int asn_MAP_CU_CP_Usage_Report_UeResourceReportItem_oms_1[] = { 1, 2 };
static const ber_tlv_tag_t asn_DEF_CU_CP_Usage_Report_UeResourceReportItem_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_CU_CP_Usage_Report_UeResourceReportItem_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* c-RNTI */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* serving-Cell-RF-Type */
{ (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* neighbor-Cell-RF */
};
asn_SEQUENCE_specifics_t asn_SPC_CU_CP_Usage_Report_UeResourceReportItem_specs_1 = {
sizeof(struct CU_CP_Usage_Report_UeResourceReportItem),
offsetof(struct CU_CP_Usage_Report_UeResourceReportItem, _asn_ctx),
asn_MAP_CU_CP_Usage_Report_UeResourceReportItem_tag2el_1,
3, /* Count of tags in the map */
asn_MAP_CU_CP_Usage_Report_UeResourceReportItem_oms_1, /* Optional members */
2, 0, /* Root/Additions */
3, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_CU_CP_Usage_Report_UeResourceReportItem = {
"CU-CP-Usage-Report-UeResourceReportItem",
"CU-CP-Usage-Report-UeResourceReportItem",
&asn_OP_SEQUENCE,
asn_DEF_CU_CP_Usage_Report_UeResourceReportItem_tags_1,
sizeof(asn_DEF_CU_CP_Usage_Report_UeResourceReportItem_tags_1)
/sizeof(asn_DEF_CU_CP_Usage_Report_UeResourceReportItem_tags_1[0]), /* 1 */
asn_DEF_CU_CP_Usage_Report_UeResourceReportItem_tags_1, /* Same as above */
sizeof(asn_DEF_CU_CP_Usage_Report_UeResourceReportItem_tags_1)
/sizeof(asn_DEF_CU_CP_Usage_Report_UeResourceReportItem_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_CU_CP_Usage_Report_UeResourceReportItem_1,
3, /* Elements count */
&asn_SPC_CU_CP_Usage_Report_UeResourceReportItem_specs_1 /* Additional specs */
};

View File

@@ -0,0 +1,47 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2SM-KPM-IEs"
* found in "/home/rshacham/e2sm-kpm-v01.02.asn"
* `asn1c -fcompound-names`
*/
#ifndef _CU_CP_Usage_Report_UeResourceReportItem_H_
#define _CU_CP_Usage_Report_UeResourceReportItem_H_
#include <asn_application.h>
/* Including external dependencies */
#include "C-RNTI.h"
#include <OCTET_STRING.h>
#include <constr_SEQUENCE.h>
#ifdef __cplusplus
extern "C" {
#endif
/* CU-CP-Usage-Report-UeResourceReportItem */
typedef struct CU_CP_Usage_Report_UeResourceReportItem {
C_RNTI_t c_RNTI;
OCTET_STRING_t *serving_Cell_RF_Type; /* OPTIONAL */
OCTET_STRING_t *neighbor_Cell_RF; /* OPTIONAL */
/*
* This type is extensible,
* possible extensions are below.
*/
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} CU_CP_Usage_Report_UeResourceReportItem_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_CU_CP_Usage_Report_UeResourceReportItem;
extern asn_SEQUENCE_specifics_t asn_SPC_CU_CP_Usage_Report_UeResourceReportItem_specs_1;
extern asn_TYPE_member_t asn_MBR_CU_CP_Usage_Report_UeResourceReportItem_1[3];
#ifdef __cplusplus
}
#endif
#endif /* _CU_CP_Usage_Report_UeResourceReportItem_H_ */
#include <asn_internal.h>

View File

@@ -0,0 +1,139 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2SM-KPM-IEs"
* found in "/home/rshacham/e2sm-kpm-v01.02.asn"
* `asn1c -fcompound-names`
*/
#include "CU-UP-Usage-Report-CellResourceReportItem.h"
static int
memb_ueResourceReportList_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
size_t size;
if(!sptr) {
ASN__CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
/* Determine the number of elements */
size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
if((size >= 1 && size <= 32)) {
/* Perform validation of the inner elements */
return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
} else {
ASN__CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static asn_oer_constraints_t asn_OER_type_ueResourceReportList_constr_3 CC_NOTUSED = {
{ 0, 0 },
-1 /* (SIZE(1..32)) */};
static asn_per_constraints_t asn_PER_type_ueResourceReportList_constr_3 CC_NOTUSED = {
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
{ APC_CONSTRAINED, 5, 5, 1, 32 } /* (SIZE(1..32)) */,
0, 0 /* No PER value map */
};
static asn_oer_constraints_t asn_OER_memb_ueResourceReportList_constr_3 CC_NOTUSED = {
{ 0, 0 },
-1 /* (SIZE(1..32)) */};
static asn_per_constraints_t asn_PER_memb_ueResourceReportList_constr_3 CC_NOTUSED = {
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
{ APC_CONSTRAINED, 5, 5, 1, 32 } /* (SIZE(1..32)) */,
0, 0 /* No PER value map */
};
static asn_TYPE_member_t asn_MBR_ueResourceReportList_3[] = {
{ ATF_POINTER, 0, 0,
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
0,
&asn_DEF_CU_UP_Usage_Report_UeResourceReportItem,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
""
},
};
static const ber_tlv_tag_t asn_DEF_ueResourceReportList_tags_3[] = {
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_SET_OF_specifics_t asn_SPC_ueResourceReportList_specs_3 = {
sizeof(struct CU_UP_Usage_Report_CellResourceReportItem__ueResourceReportList),
offsetof(struct CU_UP_Usage_Report_CellResourceReportItem__ueResourceReportList, _asn_ctx),
0, /* XER encoding is XMLDelimitedItemList */
};
static /* Use -fall-defs-global to expose */
asn_TYPE_descriptor_t asn_DEF_ueResourceReportList_3 = {
"ueResourceReportList",
"ueResourceReportList",
&asn_OP_SEQUENCE_OF,
asn_DEF_ueResourceReportList_tags_3,
sizeof(asn_DEF_ueResourceReportList_tags_3)
/sizeof(asn_DEF_ueResourceReportList_tags_3[0]) - 1, /* 1 */
asn_DEF_ueResourceReportList_tags_3, /* Same as above */
sizeof(asn_DEF_ueResourceReportList_tags_3)
/sizeof(asn_DEF_ueResourceReportList_tags_3[0]), /* 2 */
{ &asn_OER_type_ueResourceReportList_constr_3, &asn_PER_type_ueResourceReportList_constr_3, SEQUENCE_OF_constraint },
asn_MBR_ueResourceReportList_3,
1, /* Single element */
&asn_SPC_ueResourceReportList_specs_3 /* Additional specs */
};
asn_TYPE_member_t asn_MBR_CU_UP_Usage_Report_CellResourceReportItem_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct CU_UP_Usage_Report_CellResourceReportItem, nRCGI),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_NRCGI,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"nRCGI"
},
{ ATF_NOFLAGS, 0, offsetof(struct CU_UP_Usage_Report_CellResourceReportItem, ueResourceReportList),
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
0,
&asn_DEF_ueResourceReportList_3,
0,
{ &asn_OER_memb_ueResourceReportList_constr_3, &asn_PER_memb_ueResourceReportList_constr_3, memb_ueResourceReportList_constraint_1 },
0, 0, /* No default value */
"ueResourceReportList"
},
};
static const ber_tlv_tag_t asn_DEF_CU_UP_Usage_Report_CellResourceReportItem_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_CU_UP_Usage_Report_CellResourceReportItem_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* nRCGI */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* ueResourceReportList */
};
asn_SEQUENCE_specifics_t asn_SPC_CU_UP_Usage_Report_CellResourceReportItem_specs_1 = {
sizeof(struct CU_UP_Usage_Report_CellResourceReportItem),
offsetof(struct CU_UP_Usage_Report_CellResourceReportItem, _asn_ctx),
asn_MAP_CU_UP_Usage_Report_CellResourceReportItem_tag2el_1,
2, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
2, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_CU_UP_Usage_Report_CellResourceReportItem = {
"CU-UP-Usage-Report-CellResourceReportItem",
"CU-UP-Usage-Report-CellResourceReportItem",
&asn_OP_SEQUENCE,
asn_DEF_CU_UP_Usage_Report_CellResourceReportItem_tags_1,
sizeof(asn_DEF_CU_UP_Usage_Report_CellResourceReportItem_tags_1)
/sizeof(asn_DEF_CU_UP_Usage_Report_CellResourceReportItem_tags_1[0]), /* 1 */
asn_DEF_CU_UP_Usage_Report_CellResourceReportItem_tags_1, /* Same as above */
sizeof(asn_DEF_CU_UP_Usage_Report_CellResourceReportItem_tags_1)
/sizeof(asn_DEF_CU_UP_Usage_Report_CellResourceReportItem_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_CU_UP_Usage_Report_CellResourceReportItem_1,
2, /* Elements count */
&asn_SPC_CU_UP_Usage_Report_CellResourceReportItem_specs_1 /* Additional specs */
};

View File

@@ -0,0 +1,58 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2SM-KPM-IEs"
* found in "/home/rshacham/e2sm-kpm-v01.02.asn"
* `asn1c -fcompound-names`
*/
#ifndef _CU_UP_Usage_Report_CellResourceReportItem_H_
#define _CU_UP_Usage_Report_CellResourceReportItem_H_
#include <asn_application.h>
/* Including external dependencies */
#include "NRCGI.h"
#include <asn_SEQUENCE_OF.h>
#include <constr_SEQUENCE_OF.h>
#include <constr_SEQUENCE.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Forward declarations */
struct CU_UP_Usage_Report_UeResourceReportItem;
/* CU-UP-Usage-Report-CellResourceReportItem */
typedef struct CU_UP_Usage_Report_CellResourceReportItem {
NRCGI_t nRCGI;
struct CU_UP_Usage_Report_CellResourceReportItem__ueResourceReportList {
A_SEQUENCE_OF(struct CU_UP_Usage_Report_UeResourceReportItem) list;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} ueResourceReportList;
/*
* This type is extensible,
* possible extensions are below.
*/
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} CU_UP_Usage_Report_CellResourceReportItem_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_CU_UP_Usage_Report_CellResourceReportItem;
extern asn_SEQUENCE_specifics_t asn_SPC_CU_UP_Usage_Report_CellResourceReportItem_specs_1;
extern asn_TYPE_member_t asn_MBR_CU_UP_Usage_Report_CellResourceReportItem_1[2];
#ifdef __cplusplus
}
#endif
/* Referred external types */
#include "CU-UP-Usage-Report-UeResourceReportItem.h"
#endif /* _CU_UP_Usage_Report_CellResourceReportItem_H_ */
#include <asn_internal.h>

View File

@@ -0,0 +1,129 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2SM-KPM-IEs"
* found in "/home/rshacham/e2sm-kpm-v01.02.asn"
* `asn1c -fcompound-names`
*/
#include "CU-UP-Usage-Report-Per-UE.h"
static int
memb_cellResourceReportList_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
size_t size;
if(!sptr) {
ASN__CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
/* Determine the number of elements */
size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
if((size >= 1 && size <= 512)) {
/* Perform validation of the inner elements */
return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
} else {
ASN__CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static asn_oer_constraints_t asn_OER_type_cellResourceReportList_constr_2 CC_NOTUSED = {
{ 0, 0 },
-1 /* (SIZE(1..512)) */};
static asn_per_constraints_t asn_PER_type_cellResourceReportList_constr_2 CC_NOTUSED = {
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
{ APC_CONSTRAINED, 9, 9, 1, 512 } /* (SIZE(1..512)) */,
0, 0 /* No PER value map */
};
static asn_oer_constraints_t asn_OER_memb_cellResourceReportList_constr_2 CC_NOTUSED = {
{ 0, 0 },
-1 /* (SIZE(1..512)) */};
static asn_per_constraints_t asn_PER_memb_cellResourceReportList_constr_2 CC_NOTUSED = {
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
{ APC_CONSTRAINED, 9, 9, 1, 512 } /* (SIZE(1..512)) */,
0, 0 /* No PER value map */
};
static asn_TYPE_member_t asn_MBR_cellResourceReportList_2[] = {
{ ATF_POINTER, 0, 0,
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
0,
&asn_DEF_CU_UP_Usage_Report_CellResourceReportItem,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
""
},
};
static const ber_tlv_tag_t asn_DEF_cellResourceReportList_tags_2[] = {
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_SET_OF_specifics_t asn_SPC_cellResourceReportList_specs_2 = {
sizeof(struct CU_UP_Usage_Report_Per_UE__cellResourceReportList),
offsetof(struct CU_UP_Usage_Report_Per_UE__cellResourceReportList, _asn_ctx),
0, /* XER encoding is XMLDelimitedItemList */
};
static /* Use -fall-defs-global to expose */
asn_TYPE_descriptor_t asn_DEF_cellResourceReportList_2 = {
"cellResourceReportList",
"cellResourceReportList",
&asn_OP_SEQUENCE_OF,
asn_DEF_cellResourceReportList_tags_2,
sizeof(asn_DEF_cellResourceReportList_tags_2)
/sizeof(asn_DEF_cellResourceReportList_tags_2[0]) - 1, /* 1 */
asn_DEF_cellResourceReportList_tags_2, /* Same as above */
sizeof(asn_DEF_cellResourceReportList_tags_2)
/sizeof(asn_DEF_cellResourceReportList_tags_2[0]), /* 2 */
{ &asn_OER_type_cellResourceReportList_constr_2, &asn_PER_type_cellResourceReportList_constr_2, SEQUENCE_OF_constraint },
asn_MBR_cellResourceReportList_2,
1, /* Single element */
&asn_SPC_cellResourceReportList_specs_2 /* Additional specs */
};
asn_TYPE_member_t asn_MBR_CU_UP_Usage_Report_Per_UE_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct CU_UP_Usage_Report_Per_UE, cellResourceReportList),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
0,
&asn_DEF_cellResourceReportList_2,
0,
{ &asn_OER_memb_cellResourceReportList_constr_2, &asn_PER_memb_cellResourceReportList_constr_2, memb_cellResourceReportList_constraint_1 },
0, 0, /* No default value */
"cellResourceReportList"
},
};
static const ber_tlv_tag_t asn_DEF_CU_UP_Usage_Report_Per_UE_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_CU_UP_Usage_Report_Per_UE_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* cellResourceReportList */
};
asn_SEQUENCE_specifics_t asn_SPC_CU_UP_Usage_Report_Per_UE_specs_1 = {
sizeof(struct CU_UP_Usage_Report_Per_UE),
offsetof(struct CU_UP_Usage_Report_Per_UE, _asn_ctx),
asn_MAP_CU_UP_Usage_Report_Per_UE_tag2el_1,
1, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
1, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_CU_UP_Usage_Report_Per_UE = {
"CU-UP-Usage-Report-Per-UE",
"CU-UP-Usage-Report-Per-UE",
&asn_OP_SEQUENCE,
asn_DEF_CU_UP_Usage_Report_Per_UE_tags_1,
sizeof(asn_DEF_CU_UP_Usage_Report_Per_UE_tags_1)
/sizeof(asn_DEF_CU_UP_Usage_Report_Per_UE_tags_1[0]), /* 1 */
asn_DEF_CU_UP_Usage_Report_Per_UE_tags_1, /* Same as above */
sizeof(asn_DEF_CU_UP_Usage_Report_Per_UE_tags_1)
/sizeof(asn_DEF_CU_UP_Usage_Report_Per_UE_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_CU_UP_Usage_Report_Per_UE_1,
1, /* Elements count */
&asn_SPC_CU_UP_Usage_Report_Per_UE_specs_1 /* Additional specs */
};

View File

@@ -0,0 +1,56 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2SM-KPM-IEs"
* found in "/home/rshacham/e2sm-kpm-v01.02.asn"
* `asn1c -fcompound-names`
*/
#ifndef _CU_UP_Usage_Report_Per_UE_H_
#define _CU_UP_Usage_Report_Per_UE_H_
#include <asn_application.h>
/* Including external dependencies */
#include <asn_SEQUENCE_OF.h>
#include <constr_SEQUENCE_OF.h>
#include <constr_SEQUENCE.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Forward declarations */
struct CU_UP_Usage_Report_CellResourceReportItem;
/* CU-UP-Usage-Report-Per-UE */
typedef struct CU_UP_Usage_Report_Per_UE {
struct CU_UP_Usage_Report_Per_UE__cellResourceReportList {
A_SEQUENCE_OF(struct CU_UP_Usage_Report_CellResourceReportItem) list;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} cellResourceReportList;
/*
* This type is extensible,
* possible extensions are below.
*/
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} CU_UP_Usage_Report_Per_UE_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_CU_UP_Usage_Report_Per_UE;
extern asn_SEQUENCE_specifics_t asn_SPC_CU_UP_Usage_Report_Per_UE_specs_1;
extern asn_TYPE_member_t asn_MBR_CU_UP_Usage_Report_Per_UE_1[1];
#ifdef __cplusplus
}
#endif
/* Referred external types */
#include "CU-UP-Usage-Report-CellResourceReportItem.h"
#endif /* _CU_UP_Usage_Report_Per_UE_H_ */
#include <asn_internal.h>

View File

@@ -0,0 +1,150 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2SM-KPM-IEs"
* found in "/home/rshacham/e2sm-kpm-v01.02.asn"
* `asn1c -fcompound-names`
*/
#include "CU-UP-Usage-Report-UeResourceReportItem.h"
static int
memb_pDCPBytesDL_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
const INTEGER_t *st = (const INTEGER_t *)sptr;
long value;
if(!sptr) {
ASN__CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
if(asn_INTEGER2long(st, &value)) {
ASN__CTFAIL(app_key, td, sptr,
"%s: value too large (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
if((value >= 0 && value <= 10000000000)) {
/* Constraint check succeeded */
return 0;
} else {
ASN__CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static int
memb_pDCPBytesUL_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
const INTEGER_t *st = (const INTEGER_t *)sptr;
long value;
if(!sptr) {
ASN__CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
if(asn_INTEGER2long(st, &value)) {
ASN__CTFAIL(app_key, td, sptr,
"%s: value too large (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
if((value >= 0 && value <= 10000000000)) {
/* Constraint check succeeded */
return 0;
} else {
ASN__CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static asn_oer_constraints_t asn_OER_memb_pDCPBytesDL_constr_3 CC_NOTUSED = {
{ 0, 0 },
-1};
static asn_per_constraints_t asn_PER_memb_pDCPBytesDL_constr_3 CC_NOTUSED = {
{ APC_CONSTRAINED | APC_EXTENSIBLE, 34, -1, 0, 10000000000 } /* (0..10000000000,...) */,
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
0, 0 /* No PER value map */
};
static asn_oer_constraints_t asn_OER_memb_pDCPBytesUL_constr_4 CC_NOTUSED = {
{ 0, 0 },
-1};
static asn_per_constraints_t asn_PER_memb_pDCPBytesUL_constr_4 CC_NOTUSED = {
{ APC_CONSTRAINED | APC_EXTENSIBLE, 34, -1, 0, 10000000000 } /* (0..10000000000,...) */,
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
0, 0 /* No PER value map */
};
asn_TYPE_member_t asn_MBR_CU_UP_Usage_Report_UeResourceReportItem_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct CU_UP_Usage_Report_UeResourceReportItem, c_RNTI),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_C_RNTI,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"c-RNTI"
},
{ ATF_POINTER, 2, offsetof(struct CU_UP_Usage_Report_UeResourceReportItem, pDCPBytesDL),
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_INTEGER,
0,
{ &asn_OER_memb_pDCPBytesDL_constr_3, &asn_PER_memb_pDCPBytesDL_constr_3, memb_pDCPBytesDL_constraint_1 },
0, 0, /* No default value */
"pDCPBytesDL"
},
{ ATF_POINTER, 1, offsetof(struct CU_UP_Usage_Report_UeResourceReportItem, pDCPBytesUL),
(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_INTEGER,
0,
{ &asn_OER_memb_pDCPBytesUL_constr_4, &asn_PER_memb_pDCPBytesUL_constr_4, memb_pDCPBytesUL_constraint_1 },
0, 0, /* No default value */
"pDCPBytesUL"
},
};
static const int asn_MAP_CU_UP_Usage_Report_UeResourceReportItem_oms_1[] = { 1, 2 };
static const ber_tlv_tag_t asn_DEF_CU_UP_Usage_Report_UeResourceReportItem_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_CU_UP_Usage_Report_UeResourceReportItem_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* c-RNTI */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* pDCPBytesDL */
{ (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* pDCPBytesUL */
};
asn_SEQUENCE_specifics_t asn_SPC_CU_UP_Usage_Report_UeResourceReportItem_specs_1 = {
sizeof(struct CU_UP_Usage_Report_UeResourceReportItem),
offsetof(struct CU_UP_Usage_Report_UeResourceReportItem, _asn_ctx),
asn_MAP_CU_UP_Usage_Report_UeResourceReportItem_tag2el_1,
3, /* Count of tags in the map */
asn_MAP_CU_UP_Usage_Report_UeResourceReportItem_oms_1, /* Optional members */
2, 0, /* Root/Additions */
3, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_CU_UP_Usage_Report_UeResourceReportItem = {
"CU-UP-Usage-Report-UeResourceReportItem",
"CU-UP-Usage-Report-UeResourceReportItem",
&asn_OP_SEQUENCE,
asn_DEF_CU_UP_Usage_Report_UeResourceReportItem_tags_1,
sizeof(asn_DEF_CU_UP_Usage_Report_UeResourceReportItem_tags_1)
/sizeof(asn_DEF_CU_UP_Usage_Report_UeResourceReportItem_tags_1[0]), /* 1 */
asn_DEF_CU_UP_Usage_Report_UeResourceReportItem_tags_1, /* Same as above */
sizeof(asn_DEF_CU_UP_Usage_Report_UeResourceReportItem_tags_1)
/sizeof(asn_DEF_CU_UP_Usage_Report_UeResourceReportItem_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_CU_UP_Usage_Report_UeResourceReportItem_1,
3, /* Elements count */
&asn_SPC_CU_UP_Usage_Report_UeResourceReportItem_specs_1 /* Additional specs */
};

View File

@@ -0,0 +1,47 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2SM-KPM-IEs"
* found in "/home/rshacham/e2sm-kpm-v01.02.asn"
* `asn1c -fcompound-names`
*/
#ifndef _CU_UP_Usage_Report_UeResourceReportItem_H_
#define _CU_UP_Usage_Report_UeResourceReportItem_H_
#include <asn_application.h>
/* Including external dependencies */
#include "C-RNTI.h"
#include <INTEGER.h>
#include <constr_SEQUENCE.h>
#ifdef __cplusplus
extern "C" {
#endif
/* CU-UP-Usage-Report-UeResourceReportItem */
typedef struct CU_UP_Usage_Report_UeResourceReportItem {
C_RNTI_t c_RNTI;
INTEGER_t *pDCPBytesDL; /* OPTIONAL */
INTEGER_t *pDCPBytesUL; /* OPTIONAL */
/*
* This type is extensible,
* possible extensions are below.
*/
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} CU_UP_Usage_Report_UeResourceReportItem_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_CU_UP_Usage_Report_UeResourceReportItem;
extern asn_SEQUENCE_specifics_t asn_SPC_CU_UP_Usage_Report_UeResourceReportItem_specs_1;
extern asn_TYPE_member_t asn_MBR_CU_UP_Usage_Report_UeResourceReportItem_1[3];
#ifdef __cplusplus
}
#endif
#endif /* _CU_UP_Usage_Report_UeResourceReportItem_H_ */
#include <asn_internal.h>

View File

@@ -0,0 +1,129 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2SM-KPM-IEs"
* found in "/home/rshacham/e2sm-kpm-v01.02.asn"
* `asn1c -fcompound-names`
*/
#include "CUUPMeasurement-Container.h"
static int
memb_plmnList_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
size_t size;
if(!sptr) {
ASN__CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
/* Determine the number of elements */
size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
if((size >= 1 && size <= 12)) {
/* Perform validation of the inner elements */
return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
} else {
ASN__CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static asn_oer_constraints_t asn_OER_type_plmnList_constr_2 CC_NOTUSED = {
{ 0, 0 },
-1 /* (SIZE(1..12)) */};
static asn_per_constraints_t asn_PER_type_plmnList_constr_2 CC_NOTUSED = {
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
{ APC_CONSTRAINED, 4, 4, 1, 12 } /* (SIZE(1..12)) */,
0, 0 /* No PER value map */
};
static asn_oer_constraints_t asn_OER_memb_plmnList_constr_2 CC_NOTUSED = {
{ 0, 0 },
-1 /* (SIZE(1..12)) */};
static asn_per_constraints_t asn_PER_memb_plmnList_constr_2 CC_NOTUSED = {
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
{ APC_CONSTRAINED, 4, 4, 1, 12 } /* (SIZE(1..12)) */,
0, 0 /* No PER value map */
};
static asn_TYPE_member_t asn_MBR_plmnList_2[] = {
{ ATF_POINTER, 0, 0,
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
0,
&asn_DEF_PlmnID_List,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
""
},
};
static const ber_tlv_tag_t asn_DEF_plmnList_tags_2[] = {
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_SET_OF_specifics_t asn_SPC_plmnList_specs_2 = {
sizeof(struct CUUPMeasurement_Container__plmnList),
offsetof(struct CUUPMeasurement_Container__plmnList, _asn_ctx),
0, /* XER encoding is XMLDelimitedItemList */
};
static /* Use -fall-defs-global to expose */
asn_TYPE_descriptor_t asn_DEF_plmnList_2 = {
"plmnList",
"plmnList",
&asn_OP_SEQUENCE_OF,
asn_DEF_plmnList_tags_2,
sizeof(asn_DEF_plmnList_tags_2)
/sizeof(asn_DEF_plmnList_tags_2[0]) - 1, /* 1 */
asn_DEF_plmnList_tags_2, /* Same as above */
sizeof(asn_DEF_plmnList_tags_2)
/sizeof(asn_DEF_plmnList_tags_2[0]), /* 2 */
{ &asn_OER_type_plmnList_constr_2, &asn_PER_type_plmnList_constr_2, SEQUENCE_OF_constraint },
asn_MBR_plmnList_2,
1, /* Single element */
&asn_SPC_plmnList_specs_2 /* Additional specs */
};
asn_TYPE_member_t asn_MBR_CUUPMeasurement_Container_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct CUUPMeasurement_Container, plmnList),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
0,
&asn_DEF_plmnList_2,
0,
{ &asn_OER_memb_plmnList_constr_2, &asn_PER_memb_plmnList_constr_2, memb_plmnList_constraint_1 },
0, 0, /* No default value */
"plmnList"
},
};
static const ber_tlv_tag_t asn_DEF_CUUPMeasurement_Container_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_CUUPMeasurement_Container_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* plmnList */
};
asn_SEQUENCE_specifics_t asn_SPC_CUUPMeasurement_Container_specs_1 = {
sizeof(struct CUUPMeasurement_Container),
offsetof(struct CUUPMeasurement_Container, _asn_ctx),
asn_MAP_CUUPMeasurement_Container_tag2el_1,
1, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
1, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_CUUPMeasurement_Container = {
"CUUPMeasurement-Container",
"CUUPMeasurement-Container",
&asn_OP_SEQUENCE,
asn_DEF_CUUPMeasurement_Container_tags_1,
sizeof(asn_DEF_CUUPMeasurement_Container_tags_1)
/sizeof(asn_DEF_CUUPMeasurement_Container_tags_1[0]), /* 1 */
asn_DEF_CUUPMeasurement_Container_tags_1, /* Same as above */
sizeof(asn_DEF_CUUPMeasurement_Container_tags_1)
/sizeof(asn_DEF_CUUPMeasurement_Container_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_CUUPMeasurement_Container_1,
1, /* Elements count */
&asn_SPC_CUUPMeasurement_Container_specs_1 /* Additional specs */
};

View File

@@ -0,0 +1,56 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2SM-KPM-IEs"
* found in "/home/rshacham/e2sm-kpm-v01.02.asn"
* `asn1c -fcompound-names`
*/
#ifndef _CUUPMeasurement_Container_H_
#define _CUUPMeasurement_Container_H_
#include <asn_application.h>
/* Including external dependencies */
#include <asn_SEQUENCE_OF.h>
#include <constr_SEQUENCE_OF.h>
#include <constr_SEQUENCE.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Forward declarations */
struct PlmnID_List;
/* CUUPMeasurement-Container */
typedef struct CUUPMeasurement_Container {
struct CUUPMeasurement_Container__plmnList {
A_SEQUENCE_OF(struct PlmnID_List) list;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} plmnList;
/*
* This type is extensible,
* possible extensions are below.
*/
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} CUUPMeasurement_Container_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_CUUPMeasurement_Container;
extern asn_SEQUENCE_specifics_t asn_SPC_CUUPMeasurement_Container_specs_1;
extern asn_TYPE_member_t asn_MBR_CUUPMeasurement_Container_1[1];
#ifdef __cplusplus
}
#endif
/* Referred external types */
#include "PlmnID-List.h"
#endif /* _CUUPMeasurement_Container_H_ */
#include <asn_internal.h>

View File

@@ -0,0 +1,92 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2AP-IEs"
* found in "/home/rshacham/e2ap-v01.00.00.asn"
* `asn1c -fcompound-names -fincludes-quoted -fno-include-deps -findirect-choice -gen-PER -no-gen-OER -D .`
*/
#include "Cause.h"
asn_per_constraints_t asn_PER_type_Cause_constr_1 CC_NOTUSED = {
{ APC_CONSTRAINED | APC_EXTENSIBLE, 3, 3, 0, 4 } /* (0..4,...) */,
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
0, 0 /* No PER value map */
};
asn_TYPE_member_t asn_MBR_Cause_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct Cause, choice.ricRequest),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_CauseRIC,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"ricRequest"
},
{ ATF_NOFLAGS, 0, offsetof(struct Cause, choice.ricService),
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_CauseRICservice,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"ricService"
},
{ ATF_NOFLAGS, 0, offsetof(struct Cause, choice.transport),
(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_CauseTransport,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"transport"
},
{ ATF_NOFLAGS, 0, offsetof(struct Cause, choice.protocol),
(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_CauseProtocol,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"protocol"
},
{ ATF_NOFLAGS, 0, offsetof(struct Cause, choice.misc),
(ASN_TAG_CLASS_CONTEXT | (4 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_CauseMisc,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"misc"
},
};
static const asn_TYPE_tag2member_t asn_MAP_Cause_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ricRequest */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ricService */
{ (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* transport */
{ (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* protocol */
{ (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* misc */
};
asn_CHOICE_specifics_t asn_SPC_Cause_specs_1 = {
sizeof(struct Cause),
offsetof(struct Cause, _asn_ctx),
offsetof(struct Cause, present),
sizeof(((struct Cause *)0)->present),
asn_MAP_Cause_tag2el_1,
5, /* Count of tags in the map */
0, 0,
5 /* Extensions start */
};
asn_TYPE_descriptor_t asn_DEF_Cause = {
"Cause",
"Cause",
&asn_OP_CHOICE,
0, /* No effective tags (pointer) */
0, /* No effective tags (count) */
0, /* No tags (pointer) */
0, /* No tags (count) */
{ 0, &asn_PER_type_Cause_constr_1, CHOICE_constraint },
asn_MBR_Cause_1,
5, /* Elements count */
&asn_SPC_Cause_specs_1 /* Additional specs */
};

View File

@@ -0,0 +1,68 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2AP-IEs"
* found in "/home/rshacham/e2ap-v01.00.00.asn"
* `asn1c -fcompound-names -fincludes-quoted -fno-include-deps -findirect-choice -gen-PER -no-gen-OER -D .`
*/
#ifndef _Cause_H_
#define _Cause_H_
#include "asn_application.h"
/* Including external dependencies */
#include "CauseRIC.h"
#include "CauseRICservice.h"
#include "CauseTransport.h"
#include "CauseProtocol.h"
#include "CauseMisc.h"
#include "constr_CHOICE.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Dependencies */
typedef enum Cause_PR {
Cause_PR_NOTHING, /* No components present */
Cause_PR_ricRequest,
Cause_PR_ricService,
Cause_PR_transport,
Cause_PR_protocol,
Cause_PR_misc
/* Extensions may appear below */
} Cause_PR;
/* Cause */
typedef struct Cause {
Cause_PR present;
union Cause_u {
CauseRIC_t ricRequest;
CauseRICservice_t ricService;
CauseTransport_t transport;
CauseProtocol_t protocol;
CauseMisc_t misc;
/*
* This type is extensible,
* possible extensions are below.
*/
} choice;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} Cause_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_Cause;
extern asn_CHOICE_specifics_t asn_SPC_Cause_specs_1;
extern asn_TYPE_member_t asn_MBR_Cause_1[5];
extern asn_per_constraints_t asn_PER_type_Cause_constr_1;
#ifdef __cplusplus
}
#endif
#endif /* _Cause_H_ */
#include "asn_internal.h"

View File

@@ -0,0 +1,59 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2AP-IEs"
* found in "/home/rshacham/e2ap-v01.00.00.asn"
* `asn1c -fcompound-names -fincludes-quoted -fno-include-deps -findirect-choice -gen-PER -no-gen-OER -D .`
*/
#include "CauseMisc.h"
/*
* This type is implemented using NativeEnumerated,
* so here we adjust the DEF accordingly.
*/
asn_per_constraints_t asn_PER_type_CauseMisc_constr_1 CC_NOTUSED = {
{ APC_CONSTRAINED | APC_EXTENSIBLE, 2, 2, 0, 3 } /* (0..3,...) */,
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
0, 0 /* No PER value map */
};
static const asn_INTEGER_enum_map_t asn_MAP_CauseMisc_value2enum_1[] = {
{ 0, 27, "control-processing-overload" },
{ 1, 16, "hardware-failure" },
{ 2, 15, "om-intervention" },
{ 3, 11, "unspecified" }
/* This list is extensible */
};
static const unsigned int asn_MAP_CauseMisc_enum2value_1[] = {
0, /* control-processing-overload(0) */
1, /* hardware-failure(1) */
2, /* om-intervention(2) */
3 /* unspecified(3) */
/* This list is extensible */
};
const asn_INTEGER_specifics_t asn_SPC_CauseMisc_specs_1 = {
asn_MAP_CauseMisc_value2enum_1, /* "tag" => N; sorted by tag */
asn_MAP_CauseMisc_enum2value_1, /* N => "tag"; sorted by N */
4, /* Number of elements in the maps */
5, /* Extensions before this member */
1, /* Strict enumeration */
0, /* Native long size */
0
};
static const ber_tlv_tag_t asn_DEF_CauseMisc_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
};
asn_TYPE_descriptor_t asn_DEF_CauseMisc = {
"CauseMisc",
"CauseMisc",
&asn_OP_NativeEnumerated,
asn_DEF_CauseMisc_tags_1,
sizeof(asn_DEF_CauseMisc_tags_1)
/sizeof(asn_DEF_CauseMisc_tags_1[0]), /* 1 */
asn_DEF_CauseMisc_tags_1, /* Same as above */
sizeof(asn_DEF_CauseMisc_tags_1)
/sizeof(asn_DEF_CauseMisc_tags_1[0]), /* 1 */
{ 0, &asn_PER_type_CauseMisc_constr_1, NativeEnumerated_constraint },
0, 0, /* Defined elsewhere */
&asn_SPC_CauseMisc_specs_1 /* Additional specs */
};

View File

@@ -0,0 +1,56 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2AP-IEs"
* found in "/home/rshacham/e2ap-v01.00.00.asn"
* `asn1c -fcompound-names -fincludes-quoted -fno-include-deps -findirect-choice -gen-PER -no-gen-OER -D .`
*/
#ifndef _CauseMisc_H_
#define _CauseMisc_H_
#include "asn_application.h"
/* Including external dependencies */
#include "NativeEnumerated.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Dependencies */
typedef enum CauseMisc {
CauseMisc_control_processing_overload = 0,
CauseMisc_hardware_failure = 1,
CauseMisc_om_intervention = 2,
CauseMisc_unspecified = 3
/*
* Enumeration is extensible
*/
} e_CauseMisc;
/* CauseMisc */
typedef long CauseMisc_t;
/* Implementation */
extern asn_per_constraints_t asn_PER_type_CauseMisc_constr_1;
extern asn_TYPE_descriptor_t asn_DEF_CauseMisc;
extern const asn_INTEGER_specifics_t asn_SPC_CauseMisc_specs_1;
asn_struct_free_f CauseMisc_free;
asn_struct_print_f CauseMisc_print;
asn_constr_check_f CauseMisc_constraint;
ber_type_decoder_f CauseMisc_decode_ber;
der_type_encoder_f CauseMisc_encode_der;
xer_type_decoder_f CauseMisc_decode_xer;
xer_type_encoder_f CauseMisc_encode_xer;
per_type_decoder_f CauseMisc_decode_uper;
per_type_encoder_f CauseMisc_encode_uper;
per_type_decoder_f CauseMisc_decode_aper;
per_type_encoder_f CauseMisc_encode_aper;
#ifdef __cplusplus
}
#endif
#endif /* _CauseMisc_H_ */
#include "asn_internal.h"

View File

@@ -0,0 +1,65 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2AP-IEs"
* found in "/home/rshacham/e2ap-v01.00.00.asn"
* `asn1c -fcompound-names -fincludes-quoted -fno-include-deps -findirect-choice -gen-PER -no-gen-OER -D .`
*/
#include "CauseProtocol.h"
/*
* This type is implemented using NativeEnumerated,
* so here we adjust the DEF accordingly.
*/
asn_per_constraints_t asn_PER_type_CauseProtocol_constr_1 CC_NOTUSED = {
{ APC_CONSTRAINED | APC_EXTENSIBLE, 3, 3, 0, 6 } /* (0..6,...) */,
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
0, 0 /* No PER value map */
};
static const asn_INTEGER_enum_map_t asn_MAP_CauseProtocol_value2enum_1[] = {
{ 0, 21, "transfer-syntax-error" },
{ 1, 28, "abstract-syntax-error-reject" },
{ 2, 39, "abstract-syntax-error-ignore-and-notify" },
{ 3, 42, "message-not-compatible-with-receiver-state" },
{ 4, 14, "semantic-error" },
{ 5, 49, "abstract-syntax-error-falsely-constructed-message" },
{ 6, 11, "unspecified" }
/* This list is extensible */
};
static const unsigned int asn_MAP_CauseProtocol_enum2value_1[] = {
5, /* abstract-syntax-error-falsely-constructed-message(5) */
2, /* abstract-syntax-error-ignore-and-notify(2) */
1, /* abstract-syntax-error-reject(1) */
3, /* message-not-compatible-with-receiver-state(3) */
4, /* semantic-error(4) */
0, /* transfer-syntax-error(0) */
6 /* unspecified(6) */
/* This list is extensible */
};
const asn_INTEGER_specifics_t asn_SPC_CauseProtocol_specs_1 = {
asn_MAP_CauseProtocol_value2enum_1, /* "tag" => N; sorted by tag */
asn_MAP_CauseProtocol_enum2value_1, /* N => "tag"; sorted by N */
7, /* Number of elements in the maps */
8, /* Extensions before this member */
1, /* Strict enumeration */
0, /* Native long size */
0
};
static const ber_tlv_tag_t asn_DEF_CauseProtocol_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
};
asn_TYPE_descriptor_t asn_DEF_CauseProtocol = {
"CauseProtocol",
"CauseProtocol",
&asn_OP_NativeEnumerated,
asn_DEF_CauseProtocol_tags_1,
sizeof(asn_DEF_CauseProtocol_tags_1)
/sizeof(asn_DEF_CauseProtocol_tags_1[0]), /* 1 */
asn_DEF_CauseProtocol_tags_1, /* Same as above */
sizeof(asn_DEF_CauseProtocol_tags_1)
/sizeof(asn_DEF_CauseProtocol_tags_1[0]), /* 1 */
{ 0, &asn_PER_type_CauseProtocol_constr_1, NativeEnumerated_constraint },
0, 0, /* Defined elsewhere */
&asn_SPC_CauseProtocol_specs_1 /* Additional specs */
};

View File

@@ -0,0 +1,59 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2AP-IEs"
* found in "/home/rshacham/e2ap-v01.00.00.asn"
* `asn1c -fcompound-names -fincludes-quoted -fno-include-deps -findirect-choice -gen-PER -no-gen-OER -D .`
*/
#ifndef _CauseProtocol_H_
#define _CauseProtocol_H_
#include "asn_application.h"
/* Including external dependencies */
#include "NativeEnumerated.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Dependencies */
typedef enum CauseProtocol {
CauseProtocol_transfer_syntax_error = 0,
CauseProtocol_abstract_syntax_error_reject = 1,
CauseProtocol_abstract_syntax_error_ignore_and_notify = 2,
CauseProtocol_message_not_compatible_with_receiver_state = 3,
CauseProtocol_semantic_error = 4,
CauseProtocol_abstract_syntax_error_falsely_constructed_message = 5,
CauseProtocol_unspecified = 6
/*
* Enumeration is extensible
*/
} e_CauseProtocol;
/* CauseProtocol */
typedef long CauseProtocol_t;
/* Implementation */
extern asn_per_constraints_t asn_PER_type_CauseProtocol_constr_1;
extern asn_TYPE_descriptor_t asn_DEF_CauseProtocol;
extern const asn_INTEGER_specifics_t asn_SPC_CauseProtocol_specs_1;
asn_struct_free_f CauseProtocol_free;
asn_struct_print_f CauseProtocol_print;
asn_constr_check_f CauseProtocol_constraint;
ber_type_decoder_f CauseProtocol_decode_ber;
der_type_encoder_f CauseProtocol_encode_der;
xer_type_decoder_f CauseProtocol_decode_xer;
xer_type_encoder_f CauseProtocol_encode_xer;
per_type_decoder_f CauseProtocol_decode_uper;
per_type_encoder_f CauseProtocol_encode_uper;
per_type_decoder_f CauseProtocol_decode_aper;
per_type_encoder_f CauseProtocol_encode_aper;
#ifdef __cplusplus
}
#endif
#endif /* _CauseProtocol_H_ */
#include "asn_internal.h"

View File

@@ -0,0 +1,73 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2AP-IEs"
* found in "/home/rshacham/e2ap-v01.00.00.asn"
* `asn1c -fcompound-names -fincludes-quoted -fno-include-deps -findirect-choice -gen-PER -no-gen-OER -D .`
*/
#include "CauseRIC.h"
/*
* This type is implemented using NativeEnumerated,
* so here we adjust the DEF accordingly.
*/
asn_per_constraints_t asn_PER_type_CauseRIC_constr_1 CC_NOTUSED = {
{ APC_CONSTRAINED | APC_EXTENSIBLE, 4, 4, 0, 10 } /* (0..10,...) */,
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
0, 0 /* No PER value map */
};
static const asn_INTEGER_enum_map_t asn_MAP_CauseRIC_value2enum_1[] = {
{ 0, 23, "ran-function-id-Invalid" },
{ 1, 20, "action-not-supported" },
{ 2, 17, "excessive-actions" },
{ 3, 16, "duplicate-action" },
{ 4, 15, "duplicate-event" },
{ 5, 23, "function-resource-limit" },
{ 6, 18, "request-id-unknown" },
{ 7, 46, "inconsistent-action-subsequent-action-sequence" },
{ 8, 23, "control-message-invalid" },
{ 9, 23, "call-process-id-invalid" },
{ 10, 11, "unspecified" }
/* This list is extensible */
};
static const unsigned int asn_MAP_CauseRIC_enum2value_1[] = {
1, /* action-not-supported(1) */
9, /* call-process-id-invalid(9) */
8, /* control-message-invalid(8) */
3, /* duplicate-action(3) */
4, /* duplicate-event(4) */
2, /* excessive-actions(2) */
5, /* function-resource-limit(5) */
7, /* inconsistent-action-subsequent-action-sequence(7) */
0, /* ran-function-id-Invalid(0) */
6, /* request-id-unknown(6) */
10 /* unspecified(10) */
/* This list is extensible */
};
const asn_INTEGER_specifics_t asn_SPC_CauseRIC_specs_1 = {
asn_MAP_CauseRIC_value2enum_1, /* "tag" => N; sorted by tag */
asn_MAP_CauseRIC_enum2value_1, /* N => "tag"; sorted by N */
11, /* Number of elements in the maps */
12, /* Extensions before this member */
1, /* Strict enumeration */
0, /* Native long size */
0
};
static const ber_tlv_tag_t asn_DEF_CauseRIC_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
};
asn_TYPE_descriptor_t asn_DEF_CauseRIC = {
"CauseRIC",
"CauseRIC",
&asn_OP_NativeEnumerated,
asn_DEF_CauseRIC_tags_1,
sizeof(asn_DEF_CauseRIC_tags_1)
/sizeof(asn_DEF_CauseRIC_tags_1[0]), /* 1 */
asn_DEF_CauseRIC_tags_1, /* Same as above */
sizeof(asn_DEF_CauseRIC_tags_1)
/sizeof(asn_DEF_CauseRIC_tags_1[0]), /* 1 */
{ 0, &asn_PER_type_CauseRIC_constr_1, NativeEnumerated_constraint },
0, 0, /* Defined elsewhere */
&asn_SPC_CauseRIC_specs_1 /* Additional specs */
};

View File

@@ -0,0 +1,63 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2AP-IEs"
* found in "/home/rshacham/e2ap-v01.00.00.asn"
* `asn1c -fcompound-names -fincludes-quoted -fno-include-deps -findirect-choice -gen-PER -no-gen-OER -D .`
*/
#ifndef _CauseRIC_H_
#define _CauseRIC_H_
#include "asn_application.h"
/* Including external dependencies */
#include "NativeEnumerated.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Dependencies */
typedef enum CauseRIC {
CauseRIC_ran_function_id_Invalid = 0,
CauseRIC_action_not_supported = 1,
CauseRIC_excessive_actions = 2,
CauseRIC_duplicate_action = 3,
CauseRIC_duplicate_event = 4,
CauseRIC_function_resource_limit = 5,
CauseRIC_request_id_unknown = 6,
CauseRIC_inconsistent_action_subsequent_action_sequence = 7,
CauseRIC_control_message_invalid = 8,
CauseRIC_call_process_id_invalid = 9,
CauseRIC_unspecified = 10
/*
* Enumeration is extensible
*/
} e_CauseRIC;
/* CauseRIC */
typedef long CauseRIC_t;
/* Implementation */
extern asn_per_constraints_t asn_PER_type_CauseRIC_constr_1;
extern asn_TYPE_descriptor_t asn_DEF_CauseRIC;
extern const asn_INTEGER_specifics_t asn_SPC_CauseRIC_specs_1;
asn_struct_free_f CauseRIC_free;
asn_struct_print_f CauseRIC_print;
asn_constr_check_f CauseRIC_constraint;
ber_type_decoder_f CauseRIC_decode_ber;
der_type_encoder_f CauseRIC_encode_der;
xer_type_decoder_f CauseRIC_decode_xer;
xer_type_encoder_f CauseRIC_encode_xer;
per_type_decoder_f CauseRIC_decode_uper;
per_type_encoder_f CauseRIC_encode_uper;
per_type_decoder_f CauseRIC_decode_aper;
per_type_encoder_f CauseRIC_encode_aper;
#ifdef __cplusplus
}
#endif
#endif /* _CauseRIC_H_ */
#include "asn_internal.h"

View File

@@ -0,0 +1,57 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2AP-IEs"
* found in "/home/rshacham/e2ap-v01.00.00.asn"
* `asn1c -fcompound-names -fincludes-quoted -fno-include-deps -findirect-choice -gen-PER -no-gen-OER -D .`
*/
#include "CauseRICservice.h"
/*
* This type is implemented using NativeEnumerated,
* so here we adjust the DEF accordingly.
*/
asn_per_constraints_t asn_PER_type_CauseRICservice_constr_1 CC_NOTUSED = {
{ APC_CONSTRAINED | APC_EXTENSIBLE, 2, 2, 0, 2 } /* (0..2,...) */,
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
0, 0 /* No PER value map */
};
static const asn_INTEGER_enum_map_t asn_MAP_CauseRICservice_value2enum_1[] = {
{ 0, 21, "function-not-required" },
{ 1, 19, "excessive-functions" },
{ 2, 18, "ric-resource-limit" }
/* This list is extensible */
};
static const unsigned int asn_MAP_CauseRICservice_enum2value_1[] = {
1, /* excessive-functions(1) */
0, /* function-not-required(0) */
2 /* ric-resource-limit(2) */
/* This list is extensible */
};
const asn_INTEGER_specifics_t asn_SPC_CauseRICservice_specs_1 = {
asn_MAP_CauseRICservice_value2enum_1, /* "tag" => N; sorted by tag */
asn_MAP_CauseRICservice_enum2value_1, /* N => "tag"; sorted by N */
3, /* Number of elements in the maps */
4, /* Extensions before this member */
1, /* Strict enumeration */
0, /* Native long size */
0
};
static const ber_tlv_tag_t asn_DEF_CauseRICservice_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
};
asn_TYPE_descriptor_t asn_DEF_CauseRICservice = {
"CauseRICservice",
"CauseRICservice",
&asn_OP_NativeEnumerated,
asn_DEF_CauseRICservice_tags_1,
sizeof(asn_DEF_CauseRICservice_tags_1)
/sizeof(asn_DEF_CauseRICservice_tags_1[0]), /* 1 */
asn_DEF_CauseRICservice_tags_1, /* Same as above */
sizeof(asn_DEF_CauseRICservice_tags_1)
/sizeof(asn_DEF_CauseRICservice_tags_1[0]), /* 1 */
{ 0, &asn_PER_type_CauseRICservice_constr_1, NativeEnumerated_constraint },
0, 0, /* Defined elsewhere */
&asn_SPC_CauseRICservice_specs_1 /* Additional specs */
};

View File

@@ -0,0 +1,55 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2AP-IEs"
* found in "/home/rshacham/e2ap-v01.00.00.asn"
* `asn1c -fcompound-names -fincludes-quoted -fno-include-deps -findirect-choice -gen-PER -no-gen-OER -D .`
*/
#ifndef _CauseRICservice_H_
#define _CauseRICservice_H_
#include "asn_application.h"
/* Including external dependencies */
#include "NativeEnumerated.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Dependencies */
typedef enum CauseRICservice {
CauseRICservice_function_not_required = 0,
CauseRICservice_excessive_functions = 1,
CauseRICservice_ric_resource_limit = 2
/*
* Enumeration is extensible
*/
} e_CauseRICservice;
/* CauseRICservice */
typedef long CauseRICservice_t;
/* Implementation */
extern asn_per_constraints_t asn_PER_type_CauseRICservice_constr_1;
extern asn_TYPE_descriptor_t asn_DEF_CauseRICservice;
extern const asn_INTEGER_specifics_t asn_SPC_CauseRICservice_specs_1;
asn_struct_free_f CauseRICservice_free;
asn_struct_print_f CauseRICservice_print;
asn_constr_check_f CauseRICservice_constraint;
ber_type_decoder_f CauseRICservice_decode_ber;
der_type_encoder_f CauseRICservice_encode_der;
xer_type_decoder_f CauseRICservice_decode_xer;
xer_type_encoder_f CauseRICservice_encode_xer;
per_type_decoder_f CauseRICservice_decode_uper;
per_type_encoder_f CauseRICservice_encode_uper;
per_type_decoder_f CauseRICservice_decode_aper;
per_type_encoder_f CauseRICservice_encode_aper;
#ifdef __cplusplus
}
#endif
#endif /* _CauseRICservice_H_ */
#include "asn_internal.h"

View File

@@ -0,0 +1,55 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2AP-IEs"
* found in "/home/rshacham/e2ap-v01.00.00.asn"
* `asn1c -fcompound-names -fincludes-quoted -fno-include-deps -findirect-choice -gen-PER -no-gen-OER -D .`
*/
#include "CauseTransport.h"
/*
* This type is implemented using NativeEnumerated,
* so here we adjust the DEF accordingly.
*/
asn_per_constraints_t asn_PER_type_CauseTransport_constr_1 CC_NOTUSED = {
{ APC_CONSTRAINED | APC_EXTENSIBLE, 1, 1, 0, 1 } /* (0..1,...) */,
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
0, 0 /* No PER value map */
};
static const asn_INTEGER_enum_map_t asn_MAP_CauseTransport_value2enum_1[] = {
{ 0, 11, "unspecified" },
{ 1, 30, "transport-resource-unavailable" }
/* This list is extensible */
};
static const unsigned int asn_MAP_CauseTransport_enum2value_1[] = {
1, /* transport-resource-unavailable(1) */
0 /* unspecified(0) */
/* This list is extensible */
};
const asn_INTEGER_specifics_t asn_SPC_CauseTransport_specs_1 = {
asn_MAP_CauseTransport_value2enum_1, /* "tag" => N; sorted by tag */
asn_MAP_CauseTransport_enum2value_1, /* N => "tag"; sorted by N */
2, /* Number of elements in the maps */
3, /* Extensions before this member */
1, /* Strict enumeration */
0, /* Native long size */
0
};
static const ber_tlv_tag_t asn_DEF_CauseTransport_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
};
asn_TYPE_descriptor_t asn_DEF_CauseTransport = {
"CauseTransport",
"CauseTransport",
&asn_OP_NativeEnumerated,
asn_DEF_CauseTransport_tags_1,
sizeof(asn_DEF_CauseTransport_tags_1)
/sizeof(asn_DEF_CauseTransport_tags_1[0]), /* 1 */
asn_DEF_CauseTransport_tags_1, /* Same as above */
sizeof(asn_DEF_CauseTransport_tags_1)
/sizeof(asn_DEF_CauseTransport_tags_1[0]), /* 1 */
{ 0, &asn_PER_type_CauseTransport_constr_1, NativeEnumerated_constraint },
0, 0, /* Defined elsewhere */
&asn_SPC_CauseTransport_specs_1 /* Additional specs */
};

View File

@@ -0,0 +1,54 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2AP-IEs"
* found in "/home/rshacham/e2ap-v01.00.00.asn"
* `asn1c -fcompound-names -fincludes-quoted -fno-include-deps -findirect-choice -gen-PER -no-gen-OER -D .`
*/
#ifndef _CauseTransport_H_
#define _CauseTransport_H_
#include "asn_application.h"
/* Including external dependencies */
#include "NativeEnumerated.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Dependencies */
typedef enum CauseTransport {
CauseTransport_unspecified = 0,
CauseTransport_transport_resource_unavailable = 1
/*
* Enumeration is extensible
*/
} e_CauseTransport;
/* CauseTransport */
typedef long CauseTransport_t;
/* Implementation */
extern asn_per_constraints_t asn_PER_type_CauseTransport_constr_1;
extern asn_TYPE_descriptor_t asn_DEF_CauseTransport;
extern const asn_INTEGER_specifics_t asn_SPC_CauseTransport_specs_1;
asn_struct_free_f CauseTransport_free;
asn_struct_print_f CauseTransport_print;
asn_constr_check_f CauseTransport_constraint;
ber_type_decoder_f CauseTransport_decode_ber;
der_type_encoder_f CauseTransport_encode_der;
xer_type_decoder_f CauseTransport_decode_xer;
xer_type_encoder_f CauseTransport_encode_xer;
per_type_decoder_f CauseTransport_decode_uper;
per_type_encoder_f CauseTransport_encode_uper;
per_type_decoder_f CauseTransport_decode_aper;
per_type_encoder_f CauseTransport_encode_aper;
#ifdef __cplusplus
}
#endif
#endif /* _CauseTransport_H_ */
#include "asn_internal.h"

View File

@@ -0,0 +1,227 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2SM-KPM-IEs"
* found in "/home/rshacham/e2sm-kpm-v01.02.asn"
* `asn1c -fcompound-names`
*/
#include "CellResourceReportListItem.h"
static int
memb_dl_TotalofAvailablePRBs_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
long value;
if(!sptr) {
ASN__CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
value = *(const long *)sptr;
if((value >= 0 && value <= 273)) {
/* Constraint check succeeded */
return 0;
} else {
ASN__CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static int
memb_ul_TotalofAvailablePRBs_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
long value;
if(!sptr) {
ASN__CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
value = *(const long *)sptr;
if((value >= 0 && value <= 273)) {
/* Constraint check succeeded */
return 0;
} else {
ASN__CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static int
memb_servedPlmnPerCellList_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
size_t size;
if(!sptr) {
ASN__CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
/* Determine the number of elements */
size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
if((size >= 1 && size <= 12)) {
/* Perform validation of the inner elements */
return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
} else {
ASN__CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static asn_oer_constraints_t asn_OER_type_servedPlmnPerCellList_constr_5 CC_NOTUSED = {
{ 0, 0 },
-1 /* (SIZE(1..12)) */};
static asn_per_constraints_t asn_PER_type_servedPlmnPerCellList_constr_5 CC_NOTUSED = {
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
{ APC_CONSTRAINED, 4, 4, 1, 12 } /* (SIZE(1..12)) */,
0, 0 /* No PER value map */
};
static asn_oer_constraints_t asn_OER_memb_dl_TotalofAvailablePRBs_constr_3 CC_NOTUSED = {
{ 2, 1 } /* (0..273) */,
-1};
static asn_per_constraints_t asn_PER_memb_dl_TotalofAvailablePRBs_constr_3 CC_NOTUSED = {
{ APC_CONSTRAINED, 9, 9, 0, 273 } /* (0..273) */,
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
0, 0 /* No PER value map */
};
static asn_oer_constraints_t asn_OER_memb_ul_TotalofAvailablePRBs_constr_4 CC_NOTUSED = {
{ 2, 1 } /* (0..273) */,
-1};
static asn_per_constraints_t asn_PER_memb_ul_TotalofAvailablePRBs_constr_4 CC_NOTUSED = {
{ APC_CONSTRAINED, 9, 9, 0, 273 } /* (0..273) */,
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
0, 0 /* No PER value map */
};
static asn_oer_constraints_t asn_OER_memb_servedPlmnPerCellList_constr_5 CC_NOTUSED = {
{ 0, 0 },
-1 /* (SIZE(1..12)) */};
static asn_per_constraints_t asn_PER_memb_servedPlmnPerCellList_constr_5 CC_NOTUSED = {
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
{ APC_CONSTRAINED, 4, 4, 1, 12 } /* (SIZE(1..12)) */,
0, 0 /* No PER value map */
};
static asn_TYPE_member_t asn_MBR_servedPlmnPerCellList_5[] = {
{ ATF_POINTER, 0, 0,
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
0,
&asn_DEF_ServedPlmnPerCellListItem,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
""
},
};
static const ber_tlv_tag_t asn_DEF_servedPlmnPerCellList_tags_5[] = {
(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_SET_OF_specifics_t asn_SPC_servedPlmnPerCellList_specs_5 = {
sizeof(struct CellResourceReportListItem__servedPlmnPerCellList),
offsetof(struct CellResourceReportListItem__servedPlmnPerCellList, _asn_ctx),
0, /* XER encoding is XMLDelimitedItemList */
};
static /* Use -fall-defs-global to expose */
asn_TYPE_descriptor_t asn_DEF_servedPlmnPerCellList_5 = {
"servedPlmnPerCellList",
"servedPlmnPerCellList",
&asn_OP_SEQUENCE_OF,
asn_DEF_servedPlmnPerCellList_tags_5,
sizeof(asn_DEF_servedPlmnPerCellList_tags_5)
/sizeof(asn_DEF_servedPlmnPerCellList_tags_5[0]) - 1, /* 1 */
asn_DEF_servedPlmnPerCellList_tags_5, /* Same as above */
sizeof(asn_DEF_servedPlmnPerCellList_tags_5)
/sizeof(asn_DEF_servedPlmnPerCellList_tags_5[0]), /* 2 */
{ &asn_OER_type_servedPlmnPerCellList_constr_5, &asn_PER_type_servedPlmnPerCellList_constr_5, SEQUENCE_OF_constraint },
asn_MBR_servedPlmnPerCellList_5,
1, /* Single element */
&asn_SPC_servedPlmnPerCellList_specs_5 /* Additional specs */
};
asn_TYPE_member_t asn_MBR_CellResourceReportListItem_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct CellResourceReportListItem, nRCGI),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_NRCGI,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"nRCGI"
},
{ ATF_POINTER, 2, offsetof(struct CellResourceReportListItem, dl_TotalofAvailablePRBs),
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_NativeInteger,
0,
{ &asn_OER_memb_dl_TotalofAvailablePRBs_constr_3, &asn_PER_memb_dl_TotalofAvailablePRBs_constr_3, memb_dl_TotalofAvailablePRBs_constraint_1 },
0, 0, /* No default value */
"dl-TotalofAvailablePRBs"
},
{ ATF_POINTER, 1, offsetof(struct CellResourceReportListItem, ul_TotalofAvailablePRBs),
(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_NativeInteger,
0,
{ &asn_OER_memb_ul_TotalofAvailablePRBs_constr_4, &asn_PER_memb_ul_TotalofAvailablePRBs_constr_4, memb_ul_TotalofAvailablePRBs_constraint_1 },
0, 0, /* No default value */
"ul-TotalofAvailablePRBs"
},
{ ATF_NOFLAGS, 0, offsetof(struct CellResourceReportListItem, servedPlmnPerCellList),
(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
0,
&asn_DEF_servedPlmnPerCellList_5,
0,
{ &asn_OER_memb_servedPlmnPerCellList_constr_5, &asn_PER_memb_servedPlmnPerCellList_constr_5, memb_servedPlmnPerCellList_constraint_1 },
0, 0, /* No default value */
"servedPlmnPerCellList"
},
};
static const int asn_MAP_CellResourceReportListItem_oms_1[] = { 1, 2 };
static const ber_tlv_tag_t asn_DEF_CellResourceReportListItem_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_CellResourceReportListItem_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* nRCGI */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* dl-TotalofAvailablePRBs */
{ (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* ul-TotalofAvailablePRBs */
{ (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* servedPlmnPerCellList */
};
asn_SEQUENCE_specifics_t asn_SPC_CellResourceReportListItem_specs_1 = {
sizeof(struct CellResourceReportListItem),
offsetof(struct CellResourceReportListItem, _asn_ctx),
asn_MAP_CellResourceReportListItem_tag2el_1,
4, /* Count of tags in the map */
asn_MAP_CellResourceReportListItem_oms_1, /* Optional members */
2, 0, /* Root/Additions */
4, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_CellResourceReportListItem = {
"CellResourceReportListItem",
"CellResourceReportListItem",
&asn_OP_SEQUENCE,
asn_DEF_CellResourceReportListItem_tags_1,
sizeof(asn_DEF_CellResourceReportListItem_tags_1)
/sizeof(asn_DEF_CellResourceReportListItem_tags_1[0]), /* 1 */
asn_DEF_CellResourceReportListItem_tags_1, /* Same as above */
sizeof(asn_DEF_CellResourceReportListItem_tags_1)
/sizeof(asn_DEF_CellResourceReportListItem_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_CellResourceReportListItem_1,
4, /* Elements count */
&asn_SPC_CellResourceReportListItem_specs_1 /* Additional specs */
};

View File

@@ -0,0 +1,61 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2SM-KPM-IEs"
* found in "/home/rshacham/e2sm-kpm-v01.02.asn"
* `asn1c -fcompound-names`
*/
#ifndef _CellResourceReportListItem_H_
#define _CellResourceReportListItem_H_
#include <asn_application.h>
/* Including external dependencies */
#include "NRCGI.h"
#include <NativeInteger.h>
#include <asn_SEQUENCE_OF.h>
#include <constr_SEQUENCE_OF.h>
#include <constr_SEQUENCE.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Forward declarations */
struct ServedPlmnPerCellListItem;
/* CellResourceReportListItem */
typedef struct CellResourceReportListItem {
NRCGI_t nRCGI;
long *dl_TotalofAvailablePRBs; /* OPTIONAL */
long *ul_TotalofAvailablePRBs; /* OPTIONAL */
struct CellResourceReportListItem__servedPlmnPerCellList {
A_SEQUENCE_OF(struct ServedPlmnPerCellListItem) list;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} servedPlmnPerCellList;
/*
* This type is extensible,
* possible extensions are below.
*/
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} CellResourceReportListItem_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_CellResourceReportListItem;
extern asn_SEQUENCE_specifics_t asn_SPC_CellResourceReportListItem_specs_1;
extern asn_TYPE_member_t asn_MBR_CellResourceReportListItem_1[4];
#ifdef __cplusplus
}
#endif
/* Referred external types */
#include "ServedPlmnPerCellListItem.h"
#endif /* _CellResourceReportListItem_H_ */
#include <asn_internal.h>

View File

@@ -0,0 +1,55 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2AP-CommonDataTypes"
* found in "/home/rshacham/e2ap-v01.00.00.asn"
* `asn1c -fcompound-names -fincludes-quoted -fno-include-deps -findirect-choice -gen-PER -no-gen-OER -D .`
*/
#include "Criticality.h"
/*
* This type is implemented using NativeEnumerated,
* so here we adjust the DEF accordingly.
*/
asn_per_constraints_t asn_PER_type_Criticality_constr_1 CC_NOTUSED = {
{ APC_CONSTRAINED, 2, 2, 0, 2 } /* (0..2) */,
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
0, 0 /* No PER value map */
};
static const asn_INTEGER_enum_map_t asn_MAP_Criticality_value2enum_1[] = {
{ 0, 6, "reject" },
{ 1, 6, "ignore" },
{ 2, 6, "notify" }
};
static const unsigned int asn_MAP_Criticality_enum2value_1[] = {
1, /* ignore(1) */
2, /* notify(2) */
0 /* reject(0) */
};
const asn_INTEGER_specifics_t asn_SPC_Criticality_specs_1 = {
asn_MAP_Criticality_value2enum_1, /* "tag" => N; sorted by tag */
asn_MAP_Criticality_enum2value_1, /* N => "tag"; sorted by N */
3, /* Number of elements in the maps */
0, /* Enumeration is not extensible */
1, /* Strict enumeration */
0, /* Native long size */
0
};
static const ber_tlv_tag_t asn_DEF_Criticality_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
};
asn_TYPE_descriptor_t asn_DEF_Criticality = {
"Criticality",
"Criticality",
&asn_OP_NativeEnumerated,
asn_DEF_Criticality_tags_1,
sizeof(asn_DEF_Criticality_tags_1)
/sizeof(asn_DEF_Criticality_tags_1[0]), /* 1 */
asn_DEF_Criticality_tags_1, /* Same as above */
sizeof(asn_DEF_Criticality_tags_1)
/sizeof(asn_DEF_Criticality_tags_1[0]), /* 1 */
{ 0, &asn_PER_type_Criticality_constr_1, NativeEnumerated_constraint },
0, 0, /* Defined elsewhere */
&asn_SPC_Criticality_specs_1 /* Additional specs */
};

View File

@@ -0,0 +1,52 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2AP-CommonDataTypes"
* found in "/home/rshacham/e2ap-v01.00.00.asn"
* `asn1c -fcompound-names -fincludes-quoted -fno-include-deps -findirect-choice -gen-PER -no-gen-OER -D .`
*/
#ifndef _Criticality_H_
#define _Criticality_H_
#include "asn_application.h"
/* Including external dependencies */
#include "NativeEnumerated.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Dependencies */
typedef enum Criticality {
Criticality_reject = 0,
Criticality_ignore = 1,
Criticality_notify = 2
} e_Criticality;
/* Criticality */
typedef long Criticality_t;
/* Implementation */
extern asn_per_constraints_t asn_PER_type_Criticality_constr_1;
extern asn_TYPE_descriptor_t asn_DEF_Criticality;
extern const asn_INTEGER_specifics_t asn_SPC_Criticality_specs_1;
asn_struct_free_f Criticality_free;
asn_struct_print_f Criticality_print;
asn_constr_check_f Criticality_constraint;
ber_type_decoder_f Criticality_decode_ber;
der_type_encoder_f Criticality_encode_der;
xer_type_decoder_f Criticality_decode_xer;
xer_type_encoder_f Criticality_encode_xer;
per_type_decoder_f Criticality_decode_uper;
per_type_encoder_f Criticality_encode_uper;
per_type_decoder_f Criticality_decode_aper;
per_type_encoder_f Criticality_encode_aper;
#ifdef __cplusplus
}
#endif
#endif /* _Criticality_H_ */
#include "asn_internal.h"

View File

@@ -0,0 +1,70 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2AP-IEs"
* found in "/home/rshacham/e2ap-v01.00.00.asn"
* `asn1c -fcompound-names -fincludes-quoted -fno-include-deps -findirect-choice -gen-PER -no-gen-OER -D .`
*/
#include "CriticalityDiagnostics-IE-Item.h"
asn_TYPE_member_t asn_MBR_CriticalityDiagnostics_IE_Item_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct CriticalityDiagnostics_IE_Item, iECriticality),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_Criticality,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"iECriticality"
},
{ ATF_NOFLAGS, 0, offsetof(struct CriticalityDiagnostics_IE_Item, iE_ID),
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_ProtocolIE_ID,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"iE-ID"
},
{ ATF_NOFLAGS, 0, offsetof(struct CriticalityDiagnostics_IE_Item, typeOfError),
(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_TypeOfError,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"typeOfError"
},
};
static const ber_tlv_tag_t asn_DEF_CriticalityDiagnostics_IE_Item_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_CriticalityDiagnostics_IE_Item_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* iECriticality */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* iE-ID */
{ (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* typeOfError */
};
asn_SEQUENCE_specifics_t asn_SPC_CriticalityDiagnostics_IE_Item_specs_1 = {
sizeof(struct CriticalityDiagnostics_IE_Item),
offsetof(struct CriticalityDiagnostics_IE_Item, _asn_ctx),
asn_MAP_CriticalityDiagnostics_IE_Item_tag2el_1,
3, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
3, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_CriticalityDiagnostics_IE_Item = {
"CriticalityDiagnostics-IE-Item",
"CriticalityDiagnostics-IE-Item",
&asn_OP_SEQUENCE,
asn_DEF_CriticalityDiagnostics_IE_Item_tags_1,
sizeof(asn_DEF_CriticalityDiagnostics_IE_Item_tags_1)
/sizeof(asn_DEF_CriticalityDiagnostics_IE_Item_tags_1[0]), /* 1 */
asn_DEF_CriticalityDiagnostics_IE_Item_tags_1, /* Same as above */
sizeof(asn_DEF_CriticalityDiagnostics_IE_Item_tags_1)
/sizeof(asn_DEF_CriticalityDiagnostics_IE_Item_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_CriticalityDiagnostics_IE_Item_1,
3, /* Elements count */
&asn_SPC_CriticalityDiagnostics_IE_Item_specs_1 /* Additional specs */
};

View File

@@ -0,0 +1,48 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2AP-IEs"
* found in "/home/rshacham/e2ap-v01.00.00.asn"
* `asn1c -fcompound-names -fincludes-quoted -fno-include-deps -findirect-choice -gen-PER -no-gen-OER -D .`
*/
#ifndef _CriticalityDiagnostics_IE_Item_H_
#define _CriticalityDiagnostics_IE_Item_H_
#include "asn_application.h"
/* Including external dependencies */
#include "Criticality.h"
#include "ProtocolIE-ID.h"
#include "TypeOfError.h"
#include "constr_SEQUENCE.h"
#ifdef __cplusplus
extern "C" {
#endif
/* CriticalityDiagnostics-IE-Item */
typedef struct CriticalityDiagnostics_IE_Item {
Criticality_t iECriticality;
ProtocolIE_ID_t iE_ID;
TypeOfError_t typeOfError;
/*
* This type is extensible,
* possible extensions are below.
*/
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} CriticalityDiagnostics_IE_Item_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_CriticalityDiagnostics_IE_Item;
extern asn_SEQUENCE_specifics_t asn_SPC_CriticalityDiagnostics_IE_Item_specs_1;
extern asn_TYPE_member_t asn_MBR_CriticalityDiagnostics_IE_Item_1[3];
#ifdef __cplusplus
}
#endif
#endif /* _CriticalityDiagnostics_IE_Item_H_ */
#include "asn_internal.h"

View File

@@ -0,0 +1,50 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2AP-IEs"
* found in "/home/rshacham/e2ap-v01.00.00.asn"
* `asn1c -fcompound-names -fincludes-quoted -fno-include-deps -findirect-choice -gen-PER -no-gen-OER -D .`
*/
#include "CriticalityDiagnostics-IE-List.h"
#include "CriticalityDiagnostics-IE-Item.h"
asn_per_constraints_t asn_PER_type_CriticalityDiagnostics_IE_List_constr_1 CC_NOTUSED = {
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
{ APC_CONSTRAINED, 8, 8, 1, 256 } /* (SIZE(1..256)) */,
0, 0 /* No PER value map */
};
asn_TYPE_member_t asn_MBR_CriticalityDiagnostics_IE_List_1[] = {
{ ATF_POINTER, 0, 0,
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
0,
&asn_DEF_CriticalityDiagnostics_IE_Item,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
""
},
};
static const ber_tlv_tag_t asn_DEF_CriticalityDiagnostics_IE_List_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
asn_SET_OF_specifics_t asn_SPC_CriticalityDiagnostics_IE_List_specs_1 = {
sizeof(struct CriticalityDiagnostics_IE_List),
offsetof(struct CriticalityDiagnostics_IE_List, _asn_ctx),
0, /* XER encoding is XMLDelimitedItemList */
};
asn_TYPE_descriptor_t asn_DEF_CriticalityDiagnostics_IE_List = {
"CriticalityDiagnostics-IE-List",
"CriticalityDiagnostics-IE-List",
&asn_OP_SEQUENCE_OF,
asn_DEF_CriticalityDiagnostics_IE_List_tags_1,
sizeof(asn_DEF_CriticalityDiagnostics_IE_List_tags_1)
/sizeof(asn_DEF_CriticalityDiagnostics_IE_List_tags_1[0]), /* 1 */
asn_DEF_CriticalityDiagnostics_IE_List_tags_1, /* Same as above */
sizeof(asn_DEF_CriticalityDiagnostics_IE_List_tags_1)
/sizeof(asn_DEF_CriticalityDiagnostics_IE_List_tags_1[0]), /* 1 */
{ 0, &asn_PER_type_CriticalityDiagnostics_IE_List_constr_1, SEQUENCE_OF_constraint },
asn_MBR_CriticalityDiagnostics_IE_List_1,
1, /* Single element */
&asn_SPC_CriticalityDiagnostics_IE_List_specs_1 /* Additional specs */
};

View File

@@ -0,0 +1,44 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2AP-IEs"
* found in "/home/rshacham/e2ap-v01.00.00.asn"
* `asn1c -fcompound-names -fincludes-quoted -fno-include-deps -findirect-choice -gen-PER -no-gen-OER -D .`
*/
#ifndef _CriticalityDiagnostics_IE_List_H_
#define _CriticalityDiagnostics_IE_List_H_
#include "asn_application.h"
/* Including external dependencies */
#include "asn_SEQUENCE_OF.h"
#include "constr_SEQUENCE_OF.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Forward declarations */
struct CriticalityDiagnostics_IE_Item;
/* CriticalityDiagnostics-IE-List */
typedef struct CriticalityDiagnostics_IE_List {
A_SEQUENCE_OF(struct CriticalityDiagnostics_IE_Item) list;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} CriticalityDiagnostics_IE_List_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_CriticalityDiagnostics_IE_List;
extern asn_SET_OF_specifics_t asn_SPC_CriticalityDiagnostics_IE_List_specs_1;
extern asn_TYPE_member_t asn_MBR_CriticalityDiagnostics_IE_List_1[1];
extern asn_per_constraints_t asn_PER_type_CriticalityDiagnostics_IE_List_constr_1;
#ifdef __cplusplus
}
#endif
#endif /* _CriticalityDiagnostics_IE_List_H_ */
#include "asn_internal.h"

View File

@@ -0,0 +1,94 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2AP-IEs"
* found in "/home/rshacham/e2ap-v01.00.00.asn"
* `asn1c -fcompound-names -fincludes-quoted -fno-include-deps -findirect-choice -gen-PER -no-gen-OER -D .`
*/
#include "CriticalityDiagnostics.h"
#include "RICrequestID.h"
#include "CriticalityDiagnostics-IE-List.h"
static asn_TYPE_member_t asn_MBR_CriticalityDiagnostics_1[] = {
{ ATF_POINTER, 5, offsetof(struct CriticalityDiagnostics, procedureCode),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_ProcedureCode,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"procedureCode"
},
{ ATF_POINTER, 4, offsetof(struct CriticalityDiagnostics, triggeringMessage),
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_TriggeringMessage,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"triggeringMessage"
},
{ ATF_POINTER, 3, offsetof(struct CriticalityDiagnostics, procedureCriticality),
(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_Criticality,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"procedureCriticality"
},
{ ATF_POINTER, 2, offsetof(struct CriticalityDiagnostics, ricRequestorID),
(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_RICrequestID,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"ricRequestorID"
},
{ ATF_POINTER, 1, offsetof(struct CriticalityDiagnostics, iEsCriticalityDiagnostics),
(ASN_TAG_CLASS_CONTEXT | (4 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_CriticalityDiagnostics_IE_List,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"iEsCriticalityDiagnostics"
},
};
static const int asn_MAP_CriticalityDiagnostics_oms_1[] = { 0, 1, 2, 3, 4 };
static const ber_tlv_tag_t asn_DEF_CriticalityDiagnostics_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_CriticalityDiagnostics_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* procedureCode */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* triggeringMessage */
{ (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* procedureCriticality */
{ (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* ricRequestorID */
{ (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* iEsCriticalityDiagnostics */
};
static asn_SEQUENCE_specifics_t asn_SPC_CriticalityDiagnostics_specs_1 = {
sizeof(struct CriticalityDiagnostics),
offsetof(struct CriticalityDiagnostics, _asn_ctx),
asn_MAP_CriticalityDiagnostics_tag2el_1,
5, /* Count of tags in the map */
asn_MAP_CriticalityDiagnostics_oms_1, /* Optional members */
5, 0, /* Root/Additions */
5, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_CriticalityDiagnostics = {
"CriticalityDiagnostics",
"CriticalityDiagnostics",
&asn_OP_SEQUENCE,
asn_DEF_CriticalityDiagnostics_tags_1,
sizeof(asn_DEF_CriticalityDiagnostics_tags_1)
/sizeof(asn_DEF_CriticalityDiagnostics_tags_1[0]), /* 1 */
asn_DEF_CriticalityDiagnostics_tags_1, /* Same as above */
sizeof(asn_DEF_CriticalityDiagnostics_tags_1)
/sizeof(asn_DEF_CriticalityDiagnostics_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_CriticalityDiagnostics_1,
5, /* Elements count */
&asn_SPC_CriticalityDiagnostics_specs_1 /* Additional specs */
};

View File

@@ -0,0 +1,52 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2AP-IEs"
* found in "/home/rshacham/e2ap-v01.00.00.asn"
* `asn1c -fcompound-names -fincludes-quoted -fno-include-deps -findirect-choice -gen-PER -no-gen-OER -D .`
*/
#ifndef _CriticalityDiagnostics_H_
#define _CriticalityDiagnostics_H_
#include "asn_application.h"
/* Including external dependencies */
#include "ProcedureCode.h"
#include "TriggeringMessage.h"
#include "Criticality.h"
#include "constr_SEQUENCE.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Forward declarations */
struct RICrequestID;
struct CriticalityDiagnostics_IE_List;
/* CriticalityDiagnostics */
typedef struct CriticalityDiagnostics {
ProcedureCode_t *procedureCode; /* OPTIONAL */
TriggeringMessage_t *triggeringMessage; /* OPTIONAL */
Criticality_t *procedureCriticality; /* OPTIONAL */
struct RICrequestID *ricRequestorID; /* OPTIONAL */
struct CriticalityDiagnostics_IE_List *iEsCriticalityDiagnostics; /* OPTIONAL */
/*
* This type is extensible,
* possible extensions are below.
*/
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} CriticalityDiagnostics_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_CriticalityDiagnostics;
#ifdef __cplusplus
}
#endif
#endif /* _CriticalityDiagnostics_H_ */
#include "asn_internal.h"

View File

@@ -0,0 +1,139 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2SM-KPM-IEs"
* found in "/home/rshacham/e2sm-kpm-v01.02.asn"
* `asn1c -fcompound-names`
*/
#include "DU-Usage-Report-CellResourceReportItem.h"
static int
memb_ueResourceReportList_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
size_t size;
if(!sptr) {
ASN__CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
/* Determine the number of elements */
size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
if((size >= 1 && size <= 32)) {
/* Perform validation of the inner elements */
return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
} else {
ASN__CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static asn_oer_constraints_t asn_OER_type_ueResourceReportList_constr_3 CC_NOTUSED = {
{ 0, 0 },
-1 /* (SIZE(1..32)) */};
static asn_per_constraints_t asn_PER_type_ueResourceReportList_constr_3 CC_NOTUSED = {
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
{ APC_CONSTRAINED, 5, 5, 1, 32 } /* (SIZE(1..32)) */,
0, 0 /* No PER value map */
};
static asn_oer_constraints_t asn_OER_memb_ueResourceReportList_constr_3 CC_NOTUSED = {
{ 0, 0 },
-1 /* (SIZE(1..32)) */};
static asn_per_constraints_t asn_PER_memb_ueResourceReportList_constr_3 CC_NOTUSED = {
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
{ APC_CONSTRAINED, 5, 5, 1, 32 } /* (SIZE(1..32)) */,
0, 0 /* No PER value map */
};
static asn_TYPE_member_t asn_MBR_ueResourceReportList_3[] = {
{ ATF_POINTER, 0, 0,
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
0,
&asn_DEF_DU_Usage_Report_UeResourceReportItem,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
""
},
};
static const ber_tlv_tag_t asn_DEF_ueResourceReportList_tags_3[] = {
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_SET_OF_specifics_t asn_SPC_ueResourceReportList_specs_3 = {
sizeof(struct DU_Usage_Report_CellResourceReportItem__ueResourceReportList),
offsetof(struct DU_Usage_Report_CellResourceReportItem__ueResourceReportList, _asn_ctx),
0, /* XER encoding is XMLDelimitedItemList */
};
static /* Use -fall-defs-global to expose */
asn_TYPE_descriptor_t asn_DEF_ueResourceReportList_3 = {
"ueResourceReportList",
"ueResourceReportList",
&asn_OP_SEQUENCE_OF,
asn_DEF_ueResourceReportList_tags_3,
sizeof(asn_DEF_ueResourceReportList_tags_3)
/sizeof(asn_DEF_ueResourceReportList_tags_3[0]) - 1, /* 1 */
asn_DEF_ueResourceReportList_tags_3, /* Same as above */
sizeof(asn_DEF_ueResourceReportList_tags_3)
/sizeof(asn_DEF_ueResourceReportList_tags_3[0]), /* 2 */
{ &asn_OER_type_ueResourceReportList_constr_3, &asn_PER_type_ueResourceReportList_constr_3, SEQUENCE_OF_constraint },
asn_MBR_ueResourceReportList_3,
1, /* Single element */
&asn_SPC_ueResourceReportList_specs_3 /* Additional specs */
};
asn_TYPE_member_t asn_MBR_DU_Usage_Report_CellResourceReportItem_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct DU_Usage_Report_CellResourceReportItem, nRCGI),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_NRCGI,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"nRCGI"
},
{ ATF_NOFLAGS, 0, offsetof(struct DU_Usage_Report_CellResourceReportItem, ueResourceReportList),
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
0,
&asn_DEF_ueResourceReportList_3,
0,
{ &asn_OER_memb_ueResourceReportList_constr_3, &asn_PER_memb_ueResourceReportList_constr_3, memb_ueResourceReportList_constraint_1 },
0, 0, /* No default value */
"ueResourceReportList"
},
};
static const ber_tlv_tag_t asn_DEF_DU_Usage_Report_CellResourceReportItem_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_DU_Usage_Report_CellResourceReportItem_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* nRCGI */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* ueResourceReportList */
};
asn_SEQUENCE_specifics_t asn_SPC_DU_Usage_Report_CellResourceReportItem_specs_1 = {
sizeof(struct DU_Usage_Report_CellResourceReportItem),
offsetof(struct DU_Usage_Report_CellResourceReportItem, _asn_ctx),
asn_MAP_DU_Usage_Report_CellResourceReportItem_tag2el_1,
2, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
2, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_DU_Usage_Report_CellResourceReportItem = {
"DU-Usage-Report-CellResourceReportItem",
"DU-Usage-Report-CellResourceReportItem",
&asn_OP_SEQUENCE,
asn_DEF_DU_Usage_Report_CellResourceReportItem_tags_1,
sizeof(asn_DEF_DU_Usage_Report_CellResourceReportItem_tags_1)
/sizeof(asn_DEF_DU_Usage_Report_CellResourceReportItem_tags_1[0]), /* 1 */
asn_DEF_DU_Usage_Report_CellResourceReportItem_tags_1, /* Same as above */
sizeof(asn_DEF_DU_Usage_Report_CellResourceReportItem_tags_1)
/sizeof(asn_DEF_DU_Usage_Report_CellResourceReportItem_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_DU_Usage_Report_CellResourceReportItem_1,
2, /* Elements count */
&asn_SPC_DU_Usage_Report_CellResourceReportItem_specs_1 /* Additional specs */
};

View File

@@ -0,0 +1,58 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2SM-KPM-IEs"
* found in "/home/rshacham/e2sm-kpm-v01.02.asn"
* `asn1c -fcompound-names`
*/
#ifndef _DU_Usage_Report_CellResourceReportItem_H_
#define _DU_Usage_Report_CellResourceReportItem_H_
#include <asn_application.h>
/* Including external dependencies */
#include "NRCGI.h"
#include <asn_SEQUENCE_OF.h>
#include <constr_SEQUENCE_OF.h>
#include <constr_SEQUENCE.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Forward declarations */
struct DU_Usage_Report_UeResourceReportItem;
/* DU-Usage-Report-CellResourceReportItem */
typedef struct DU_Usage_Report_CellResourceReportItem {
NRCGI_t nRCGI;
struct DU_Usage_Report_CellResourceReportItem__ueResourceReportList {
A_SEQUENCE_OF(struct DU_Usage_Report_UeResourceReportItem) list;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} ueResourceReportList;
/*
* This type is extensible,
* possible extensions are below.
*/
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} DU_Usage_Report_CellResourceReportItem_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_DU_Usage_Report_CellResourceReportItem;
extern asn_SEQUENCE_specifics_t asn_SPC_DU_Usage_Report_CellResourceReportItem_specs_1;
extern asn_TYPE_member_t asn_MBR_DU_Usage_Report_CellResourceReportItem_1[2];
#ifdef __cplusplus
}
#endif
/* Referred external types */
#include "DU-Usage-Report-UeResourceReportItem.h"
#endif /* _DU_Usage_Report_CellResourceReportItem_H_ */
#include <asn_internal.h>

View File

@@ -0,0 +1,129 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2SM-KPM-IEs"
* found in "/home/rshacham/e2sm-kpm-v01.02.asn"
* `asn1c -fcompound-names`
*/
#include "DU-Usage-Report-Per-UE.h"
static int
memb_cellResourceReportList_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
size_t size;
if(!sptr) {
ASN__CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
/* Determine the number of elements */
size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
if((size >= 1 && size <= 512)) {
/* Perform validation of the inner elements */
return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
} else {
ASN__CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static asn_oer_constraints_t asn_OER_type_cellResourceReportList_constr_2 CC_NOTUSED = {
{ 0, 0 },
-1 /* (SIZE(1..512)) */};
static asn_per_constraints_t asn_PER_type_cellResourceReportList_constr_2 CC_NOTUSED = {
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
{ APC_CONSTRAINED, 9, 9, 1, 512 } /* (SIZE(1..512)) */,
0, 0 /* No PER value map */
};
static asn_oer_constraints_t asn_OER_memb_cellResourceReportList_constr_2 CC_NOTUSED = {
{ 0, 0 },
-1 /* (SIZE(1..512)) */};
static asn_per_constraints_t asn_PER_memb_cellResourceReportList_constr_2 CC_NOTUSED = {
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
{ APC_CONSTRAINED, 9, 9, 1, 512 } /* (SIZE(1..512)) */,
0, 0 /* No PER value map */
};
static asn_TYPE_member_t asn_MBR_cellResourceReportList_2[] = {
{ ATF_POINTER, 0, 0,
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
0,
&asn_DEF_DU_Usage_Report_CellResourceReportItem,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
""
},
};
static const ber_tlv_tag_t asn_DEF_cellResourceReportList_tags_2[] = {
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_SET_OF_specifics_t asn_SPC_cellResourceReportList_specs_2 = {
sizeof(struct DU_Usage_Report_Per_UE__cellResourceReportList),
offsetof(struct DU_Usage_Report_Per_UE__cellResourceReportList, _asn_ctx),
0, /* XER encoding is XMLDelimitedItemList */
};
static /* Use -fall-defs-global to expose */
asn_TYPE_descriptor_t asn_DEF_cellResourceReportList_2 = {
"cellResourceReportList",
"cellResourceReportList",
&asn_OP_SEQUENCE_OF,
asn_DEF_cellResourceReportList_tags_2,
sizeof(asn_DEF_cellResourceReportList_tags_2)
/sizeof(asn_DEF_cellResourceReportList_tags_2[0]) - 1, /* 1 */
asn_DEF_cellResourceReportList_tags_2, /* Same as above */
sizeof(asn_DEF_cellResourceReportList_tags_2)
/sizeof(asn_DEF_cellResourceReportList_tags_2[0]), /* 2 */
{ &asn_OER_type_cellResourceReportList_constr_2, &asn_PER_type_cellResourceReportList_constr_2, SEQUENCE_OF_constraint },
asn_MBR_cellResourceReportList_2,
1, /* Single element */
&asn_SPC_cellResourceReportList_specs_2 /* Additional specs */
};
asn_TYPE_member_t asn_MBR_DU_Usage_Report_Per_UE_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct DU_Usage_Report_Per_UE, cellResourceReportList),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
0,
&asn_DEF_cellResourceReportList_2,
0,
{ &asn_OER_memb_cellResourceReportList_constr_2, &asn_PER_memb_cellResourceReportList_constr_2, memb_cellResourceReportList_constraint_1 },
0, 0, /* No default value */
"cellResourceReportList"
},
};
static const ber_tlv_tag_t asn_DEF_DU_Usage_Report_Per_UE_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_DU_Usage_Report_Per_UE_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* cellResourceReportList */
};
asn_SEQUENCE_specifics_t asn_SPC_DU_Usage_Report_Per_UE_specs_1 = {
sizeof(struct DU_Usage_Report_Per_UE),
offsetof(struct DU_Usage_Report_Per_UE, _asn_ctx),
asn_MAP_DU_Usage_Report_Per_UE_tag2el_1,
1, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
1, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_DU_Usage_Report_Per_UE = {
"DU-Usage-Report-Per-UE",
"DU-Usage-Report-Per-UE",
&asn_OP_SEQUENCE,
asn_DEF_DU_Usage_Report_Per_UE_tags_1,
sizeof(asn_DEF_DU_Usage_Report_Per_UE_tags_1)
/sizeof(asn_DEF_DU_Usage_Report_Per_UE_tags_1[0]), /* 1 */
asn_DEF_DU_Usage_Report_Per_UE_tags_1, /* Same as above */
sizeof(asn_DEF_DU_Usage_Report_Per_UE_tags_1)
/sizeof(asn_DEF_DU_Usage_Report_Per_UE_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_DU_Usage_Report_Per_UE_1,
1, /* Elements count */
&asn_SPC_DU_Usage_Report_Per_UE_specs_1 /* Additional specs */
};

View File

@@ -0,0 +1,56 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2SM-KPM-IEs"
* found in "/home/rshacham/e2sm-kpm-v01.02.asn"
* `asn1c -fcompound-names`
*/
#ifndef _DU_Usage_Report_Per_UE_H_
#define _DU_Usage_Report_Per_UE_H_
#include <asn_application.h>
/* Including external dependencies */
#include <asn_SEQUENCE_OF.h>
#include <constr_SEQUENCE_OF.h>
#include <constr_SEQUENCE.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Forward declarations */
struct DU_Usage_Report_CellResourceReportItem;
/* DU-Usage-Report-Per-UE */
typedef struct DU_Usage_Report_Per_UE {
struct DU_Usage_Report_Per_UE__cellResourceReportList {
A_SEQUENCE_OF(struct DU_Usage_Report_CellResourceReportItem) list;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} cellResourceReportList;
/*
* This type is extensible,
* possible extensions are below.
*/
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} DU_Usage_Report_Per_UE_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_DU_Usage_Report_Per_UE;
extern asn_SEQUENCE_specifics_t asn_SPC_DU_Usage_Report_Per_UE_specs_1;
extern asn_TYPE_member_t asn_MBR_DU_Usage_Report_Per_UE_1[1];
#ifdef __cplusplus
}
#endif
/* Referred external types */
#include "DU-Usage-Report-CellResourceReportItem.h"
#endif /* _DU_Usage_Report_Per_UE_H_ */
#include <asn_internal.h>

View File

@@ -0,0 +1,138 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2SM-KPM-IEs"
* found in "/home/rshacham/e2sm-kpm-v01.02.asn"
* `asn1c -fcompound-names`
*/
#include "DU-Usage-Report-UeResourceReportItem.h"
static int
memb_dl_PRBUsage_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
long value;
if(!sptr) {
ASN__CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
value = *(const long *)sptr;
if((value >= 0 && value <= 1000000000)) {
/* Constraint check succeeded */
return 0;
} else {
ASN__CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static int
memb_ul_PRBUsage_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
long value;
if(!sptr) {
ASN__CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
value = *(const long *)sptr;
if((value >= 0 && value <= 1000000000)) {
/* Constraint check succeeded */
return 0;
} else {
ASN__CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static asn_oer_constraints_t asn_OER_memb_dl_PRBUsage_constr_3 CC_NOTUSED = {
{ 0, 0 },
-1};
static asn_per_constraints_t asn_PER_memb_dl_PRBUsage_constr_3 CC_NOTUSED = {
{ APC_CONSTRAINED | APC_EXTENSIBLE, 30, -1, 0, 1000000000 } /* (0..1000000000,...) */,
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
0, 0 /* No PER value map */
};
static asn_oer_constraints_t asn_OER_memb_ul_PRBUsage_constr_4 CC_NOTUSED = {
{ 0, 0 },
-1};
static asn_per_constraints_t asn_PER_memb_ul_PRBUsage_constr_4 CC_NOTUSED = {
{ APC_CONSTRAINED | APC_EXTENSIBLE, 30, -1, 0, 1000000000 } /* (0..1000000000,...) */,
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
0, 0 /* No PER value map */
};
asn_TYPE_member_t asn_MBR_DU_Usage_Report_UeResourceReportItem_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct DU_Usage_Report_UeResourceReportItem, c_RNTI),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_C_RNTI,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"c-RNTI"
},
{ ATF_POINTER, 2, offsetof(struct DU_Usage_Report_UeResourceReportItem, dl_PRBUsage),
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_NativeInteger,
0,
{ &asn_OER_memb_dl_PRBUsage_constr_3, &asn_PER_memb_dl_PRBUsage_constr_3, memb_dl_PRBUsage_constraint_1 },
0, 0, /* No default value */
"dl-PRBUsage"
},
{ ATF_POINTER, 1, offsetof(struct DU_Usage_Report_UeResourceReportItem, ul_PRBUsage),
(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_NativeInteger,
0,
{ &asn_OER_memb_ul_PRBUsage_constr_4, &asn_PER_memb_ul_PRBUsage_constr_4, memb_ul_PRBUsage_constraint_1 },
0, 0, /* No default value */
"ul-PRBUsage"
},
};
static const int asn_MAP_DU_Usage_Report_UeResourceReportItem_oms_1[] = { 1, 2 };
static const ber_tlv_tag_t asn_DEF_DU_Usage_Report_UeResourceReportItem_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_DU_Usage_Report_UeResourceReportItem_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* c-RNTI */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* dl-PRBUsage */
{ (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* ul-PRBUsage */
};
asn_SEQUENCE_specifics_t asn_SPC_DU_Usage_Report_UeResourceReportItem_specs_1 = {
sizeof(struct DU_Usage_Report_UeResourceReportItem),
offsetof(struct DU_Usage_Report_UeResourceReportItem, _asn_ctx),
asn_MAP_DU_Usage_Report_UeResourceReportItem_tag2el_1,
3, /* Count of tags in the map */
asn_MAP_DU_Usage_Report_UeResourceReportItem_oms_1, /* Optional members */
2, 0, /* Root/Additions */
3, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_DU_Usage_Report_UeResourceReportItem = {
"DU-Usage-Report-UeResourceReportItem",
"DU-Usage-Report-UeResourceReportItem",
&asn_OP_SEQUENCE,
asn_DEF_DU_Usage_Report_UeResourceReportItem_tags_1,
sizeof(asn_DEF_DU_Usage_Report_UeResourceReportItem_tags_1)
/sizeof(asn_DEF_DU_Usage_Report_UeResourceReportItem_tags_1[0]), /* 1 */
asn_DEF_DU_Usage_Report_UeResourceReportItem_tags_1, /* Same as above */
sizeof(asn_DEF_DU_Usage_Report_UeResourceReportItem_tags_1)
/sizeof(asn_DEF_DU_Usage_Report_UeResourceReportItem_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_DU_Usage_Report_UeResourceReportItem_1,
3, /* Elements count */
&asn_SPC_DU_Usage_Report_UeResourceReportItem_specs_1 /* Additional specs */
};

View File

@@ -0,0 +1,47 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2SM-KPM-IEs"
* found in "/home/rshacham/e2sm-kpm-v01.02.asn"
* `asn1c -fcompound-names`
*/
#ifndef _DU_Usage_Report_UeResourceReportItem_H_
#define _DU_Usage_Report_UeResourceReportItem_H_
#include <asn_application.h>
/* Including external dependencies */
#include "C-RNTI.h"
#include <NativeInteger.h>
#include <constr_SEQUENCE.h>
#ifdef __cplusplus
extern "C" {
#endif
/* DU-Usage-Report-UeResourceReportItem */
typedef struct DU_Usage_Report_UeResourceReportItem {
C_RNTI_t c_RNTI;
long *dl_PRBUsage; /* OPTIONAL */
long *ul_PRBUsage; /* OPTIONAL */
/*
* This type is extensible,
* possible extensions are below.
*/
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} DU_Usage_Report_UeResourceReportItem_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_DU_Usage_Report_UeResourceReportItem;
extern asn_SEQUENCE_specifics_t asn_SPC_DU_Usage_Report_UeResourceReportItem_specs_1;
extern asn_TYPE_member_t asn_MBR_DU_Usage_Report_UeResourceReportItem_1[3];
#ifdef __cplusplus
}
#endif
#endif /* _DU_Usage_Report_UeResourceReportItem_H_ */
#include <asn_internal.h>

View File

@@ -0,0 +1,75 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2AP-PDU-Descriptions"
* found in "/home/rshacham/e2ap-v01.00.00.asn"
* `asn1c -fcompound-names -fincludes-quoted -fno-include-deps -findirect-choice -gen-PER -no-gen-OER -D .`
*/
#include "E2AP-PDU.h"
#include "InitiatingMessage.h"
#include "SuccessfulOutcome.h"
#include "UnsuccessfulOutcome.h"
static asn_per_constraints_t asn_PER_type_E2AP_PDU_constr_1 CC_NOTUSED = {
{ APC_CONSTRAINED | APC_EXTENSIBLE, 2, 2, 0, 2 } /* (0..2,...) */,
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
0, 0 /* No PER value map */
};
static asn_TYPE_member_t asn_MBR_E2AP_PDU_1[] = {
{ ATF_POINTER, 0, offsetof(struct E2AP_PDU, choice.initiatingMessage),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_InitiatingMessage,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"initiatingMessage"
},
{ ATF_POINTER, 0, offsetof(struct E2AP_PDU, choice.successfulOutcome),
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_SuccessfulOutcome,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"successfulOutcome"
},
{ ATF_POINTER, 0, offsetof(struct E2AP_PDU, choice.unsuccessfulOutcome),
(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_UnsuccessfulOutcome,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"unsuccessfulOutcome"
},
};
static const asn_TYPE_tag2member_t asn_MAP_E2AP_PDU_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* initiatingMessage */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* successfulOutcome */
{ (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* unsuccessfulOutcome */
};
static asn_CHOICE_specifics_t asn_SPC_E2AP_PDU_specs_1 = {
sizeof(struct E2AP_PDU),
offsetof(struct E2AP_PDU, _asn_ctx),
offsetof(struct E2AP_PDU, present),
sizeof(((struct E2AP_PDU *)0)->present),
asn_MAP_E2AP_PDU_tag2el_1,
3, /* Count of tags in the map */
0, 0,
3 /* Extensions start */
};
asn_TYPE_descriptor_t asn_DEF_E2AP_PDU = {
"E2AP-PDU",
"E2AP-PDU",
&asn_OP_CHOICE,
0, /* No effective tags (pointer) */
0, /* No effective tags (count) */
0, /* No tags (pointer) */
0, /* No tags (count) */
{ 0, &asn_PER_type_E2AP_PDU_constr_1, CHOICE_constraint },
asn_MBR_E2AP_PDU_1,
3, /* Elements count */
&asn_SPC_E2AP_PDU_specs_1 /* Additional specs */
};

View File

@@ -0,0 +1,61 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2AP-PDU-Descriptions"
* found in "/home/rshacham/e2ap-v01.00.00.asn"
* `asn1c -fcompound-names -fincludes-quoted -fno-include-deps -findirect-choice -gen-PER -no-gen-OER -D .`
*/
#ifndef _E2AP_PDU_H_
#define _E2AP_PDU_H_
#include "asn_application.h"
/* Including external dependencies */
#include "constr_CHOICE.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Dependencies */
typedef enum E2AP_PDU_PR {
E2AP_PDU_PR_NOTHING, /* No components present */
E2AP_PDU_PR_initiatingMessage,
E2AP_PDU_PR_successfulOutcome,
E2AP_PDU_PR_unsuccessfulOutcome
/* Extensions may appear below */
} E2AP_PDU_PR;
/* Forward declarations */
struct InitiatingMessage;
struct SuccessfulOutcome;
struct UnsuccessfulOutcome;
/* E2AP-PDU */
typedef struct E2AP_PDU {
E2AP_PDU_PR present;
union E2AP_PDU_u {
struct InitiatingMessage *initiatingMessage;
struct SuccessfulOutcome *successfulOutcome;
struct UnsuccessfulOutcome *unsuccessfulOutcome;
/*
* This type is extensible,
* possible extensions are below.
*/
} choice;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} E2AP_PDU_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_E2AP_PDU;
#ifdef __cplusplus
}
#endif
#endif /* _E2AP_PDU_H_ */
#include "asn_internal.h"

View File

@@ -0,0 +1,50 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2SM-KPM-IEs"
* found in "/home/rshacham/e2sm-kpm-v01.02.asn"
* `asn1c -fcompound-names`
*/
#include "E2SM-KPM-ActionDefinition.h"
static asn_TYPE_member_t asn_MBR_E2SM_KPM_ActionDefinition_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct E2SM_KPM_ActionDefinition, ric_Style_Type),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_RIC_Style_Type,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"ric-Style-Type"
},
};
static const ber_tlv_tag_t asn_DEF_E2SM_KPM_ActionDefinition_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_E2SM_KPM_ActionDefinition_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* ric-Style-Type */
};
static asn_SEQUENCE_specifics_t asn_SPC_E2SM_KPM_ActionDefinition_specs_1 = {
sizeof(struct E2SM_KPM_ActionDefinition),
offsetof(struct E2SM_KPM_ActionDefinition, _asn_ctx),
asn_MAP_E2SM_KPM_ActionDefinition_tag2el_1,
1, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
1, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_E2SM_KPM_ActionDefinition = {
"E2SM-KPM-ActionDefinition",
"E2SM-KPM-ActionDefinition",
&asn_OP_SEQUENCE,
asn_DEF_E2SM_KPM_ActionDefinition_tags_1,
sizeof(asn_DEF_E2SM_KPM_ActionDefinition_tags_1)
/sizeof(asn_DEF_E2SM_KPM_ActionDefinition_tags_1[0]), /* 1 */
asn_DEF_E2SM_KPM_ActionDefinition_tags_1, /* Same as above */
sizeof(asn_DEF_E2SM_KPM_ActionDefinition_tags_1)
/sizeof(asn_DEF_E2SM_KPM_ActionDefinition_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_E2SM_KPM_ActionDefinition_1,
1, /* Elements count */
&asn_SPC_E2SM_KPM_ActionDefinition_specs_1 /* Additional specs */
};

View File

@@ -0,0 +1,42 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2SM-KPM-IEs"
* found in "/home/rshacham/e2sm-kpm-v01.02.asn"
* `asn1c -fcompound-names`
*/
#ifndef _E2SM_KPM_ActionDefinition_H_
#define _E2SM_KPM_ActionDefinition_H_
#include <asn_application.h>
/* Including external dependencies */
#include "RIC-Style-Type.h"
#include <constr_SEQUENCE.h>
#ifdef __cplusplus
extern "C" {
#endif
/* E2SM-KPM-ActionDefinition */
typedef struct E2SM_KPM_ActionDefinition {
RIC_Style_Type_t ric_Style_Type;
/*
* This type is extensible,
* possible extensions are below.
*/
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} E2SM_KPM_ActionDefinition_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_E2SM_KPM_ActionDefinition;
#ifdef __cplusplus
}
#endif
#endif /* _E2SM_KPM_ActionDefinition_H_ */
#include <asn_internal.h>

View File

@@ -0,0 +1,131 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2SM-KPM-IEs"
* found in "/home/rshacham/e2sm-kpm-v01.02.asn"
* `asn1c -fcompound-names`
*/
#include "E2SM-KPM-EventTriggerDefinition-Format1.h"
static int
memb_policyTest_List_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
size_t size;
if(!sptr) {
ASN__CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
/* Determine the number of elements */
size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
if((size >= 1 && size <= 15)) {
/* Perform validation of the inner elements */
return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
} else {
ASN__CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static asn_oer_constraints_t asn_OER_type_policyTest_List_constr_2 CC_NOTUSED = {
{ 0, 0 },
-1 /* (SIZE(1..15)) */};
static asn_per_constraints_t asn_PER_type_policyTest_List_constr_2 CC_NOTUSED = {
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
{ APC_CONSTRAINED, 4, 4, 1, 15 } /* (SIZE(1..15)) */,
0, 0 /* No PER value map */
};
static asn_oer_constraints_t asn_OER_memb_policyTest_List_constr_2 CC_NOTUSED = {
{ 0, 0 },
-1 /* (SIZE(1..15)) */};
static asn_per_constraints_t asn_PER_memb_policyTest_List_constr_2 CC_NOTUSED = {
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
{ APC_CONSTRAINED, 4, 4, 1, 15 } /* (SIZE(1..15)) */,
0, 0 /* No PER value map */
};
static asn_TYPE_member_t asn_MBR_policyTest_List_2[] = {
{ ATF_POINTER, 0, 0,
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
0,
&asn_DEF_Trigger_ConditionIE_Item,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
""
},
};
static const ber_tlv_tag_t asn_DEF_policyTest_List_tags_2[] = {
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_SET_OF_specifics_t asn_SPC_policyTest_List_specs_2 = {
sizeof(struct E2SM_KPM_EventTriggerDefinition_Format1__policyTest_List),
offsetof(struct E2SM_KPM_EventTriggerDefinition_Format1__policyTest_List, _asn_ctx),
0, /* XER encoding is XMLDelimitedItemList */
};
static /* Use -fall-defs-global to expose */
asn_TYPE_descriptor_t asn_DEF_policyTest_List_2 = {
"policyTest-List",
"policyTest-List",
&asn_OP_SEQUENCE_OF,
asn_DEF_policyTest_List_tags_2,
sizeof(asn_DEF_policyTest_List_tags_2)
/sizeof(asn_DEF_policyTest_List_tags_2[0]) - 1, /* 1 */
asn_DEF_policyTest_List_tags_2, /* Same as above */
sizeof(asn_DEF_policyTest_List_tags_2)
/sizeof(asn_DEF_policyTest_List_tags_2[0]), /* 2 */
{ &asn_OER_type_policyTest_List_constr_2, &asn_PER_type_policyTest_List_constr_2, SEQUENCE_OF_constraint },
asn_MBR_policyTest_List_2,
1, /* Single element */
&asn_SPC_policyTest_List_specs_2 /* Additional specs */
};
asn_TYPE_member_t asn_MBR_E2SM_KPM_EventTriggerDefinition_Format1_1[] = {
{ ATF_POINTER, 1, offsetof(struct E2SM_KPM_EventTriggerDefinition_Format1, policyTest_List),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
0,
&asn_DEF_policyTest_List_2,
0,
{ &asn_OER_memb_policyTest_List_constr_2, &asn_PER_memb_policyTest_List_constr_2, memb_policyTest_List_constraint_1 },
0, 0, /* No default value */
"policyTest-List"
},
};
static const int asn_MAP_E2SM_KPM_EventTriggerDefinition_Format1_oms_1[] = { 0 };
static const ber_tlv_tag_t asn_DEF_E2SM_KPM_EventTriggerDefinition_Format1_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_E2SM_KPM_EventTriggerDefinition_Format1_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* policyTest-List */
};
asn_SEQUENCE_specifics_t asn_SPC_E2SM_KPM_EventTriggerDefinition_Format1_specs_1 = {
sizeof(struct E2SM_KPM_EventTriggerDefinition_Format1),
offsetof(struct E2SM_KPM_EventTriggerDefinition_Format1, _asn_ctx),
asn_MAP_E2SM_KPM_EventTriggerDefinition_Format1_tag2el_1,
1, /* Count of tags in the map */
asn_MAP_E2SM_KPM_EventTriggerDefinition_Format1_oms_1, /* Optional members */
1, 0, /* Root/Additions */
1, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_E2SM_KPM_EventTriggerDefinition_Format1 = {
"E2SM-KPM-EventTriggerDefinition-Format1",
"E2SM-KPM-EventTriggerDefinition-Format1",
&asn_OP_SEQUENCE,
asn_DEF_E2SM_KPM_EventTriggerDefinition_Format1_tags_1,
sizeof(asn_DEF_E2SM_KPM_EventTriggerDefinition_Format1_tags_1)
/sizeof(asn_DEF_E2SM_KPM_EventTriggerDefinition_Format1_tags_1[0]), /* 1 */
asn_DEF_E2SM_KPM_EventTriggerDefinition_Format1_tags_1, /* Same as above */
sizeof(asn_DEF_E2SM_KPM_EventTriggerDefinition_Format1_tags_1)
/sizeof(asn_DEF_E2SM_KPM_EventTriggerDefinition_Format1_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_E2SM_KPM_EventTriggerDefinition_Format1_1,
1, /* Elements count */
&asn_SPC_E2SM_KPM_EventTriggerDefinition_Format1_specs_1 /* Additional specs */
};

View File

@@ -0,0 +1,58 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2SM-KPM-IEs"
* found in "/home/rshacham/e2sm-kpm-v01.02.asn"
* `asn1c -fcompound-names`
*/
#ifndef _E2SM_KPM_EventTriggerDefinition_Format1_H_
#define _E2SM_KPM_EventTriggerDefinition_Format1_H_
#include <asn_application.h>
/* Including external dependencies */
#include <asn_SEQUENCE_OF.h>
#include <constr_SEQUENCE_OF.h>
#include <constr_SEQUENCE.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Forward declarations */
struct Trigger_ConditionIE_Item;
typedef struct E2SM_KPM_EventTriggerDefinition_Format1__policyTest_List {
A_SEQUENCE_OF(struct Trigger_ConditionIE_Item) list;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} E2SM_KPM_EventTriggerDefinition_Format1__policyTest_List_t;
/* E2SM-KPM-EventTriggerDefinition-Format1 */
typedef struct E2SM_KPM_EventTriggerDefinition_Format1 {
E2SM_KPM_EventTriggerDefinition_Format1__policyTest_List_t *policyTest_List;
/*
* This type is extensible,
* possible extensions are below.
*/
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} E2SM_KPM_EventTriggerDefinition_Format1_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_E2SM_KPM_EventTriggerDefinition_Format1;
extern asn_SEQUENCE_specifics_t asn_SPC_E2SM_KPM_EventTriggerDefinition_Format1_specs_1;
extern asn_TYPE_member_t asn_MBR_E2SM_KPM_EventTriggerDefinition_Format1_1[1];
#ifdef __cplusplus
}
#endif
/* Referred external types */
#include "Trigger-ConditionIE-Item.h"
#endif /* _E2SM_KPM_EventTriggerDefinition_Format1_H_ */
#include <asn_internal.h>

View File

@@ -0,0 +1,55 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2SM-KPM-IEs"
* found in "/home/rshacham/e2sm-kpm-v01.02.asn"
* `asn1c -fcompound-names`
*/
#include "E2SM-KPM-EventTriggerDefinition.h"
static asn_oer_constraints_t asn_OER_type_E2SM_KPM_EventTriggerDefinition_constr_1 CC_NOTUSED = {
{ 0, 0 },
-1};
static asn_per_constraints_t asn_PER_type_E2SM_KPM_EventTriggerDefinition_constr_1 CC_NOTUSED = {
{ APC_CONSTRAINED | APC_EXTENSIBLE, 0, 0, 0, 0 } /* (0..0,...) */,
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
0, 0 /* No PER value map */
};
static asn_TYPE_member_t asn_MBR_E2SM_KPM_EventTriggerDefinition_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct E2SM_KPM_EventTriggerDefinition, choice.eventDefinition_Format1),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_E2SM_KPM_EventTriggerDefinition_Format1,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"eventDefinition-Format1"
},
};
static const asn_TYPE_tag2member_t asn_MAP_E2SM_KPM_EventTriggerDefinition_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* eventDefinition-Format1 */
};
static asn_CHOICE_specifics_t asn_SPC_E2SM_KPM_EventTriggerDefinition_specs_1 = {
sizeof(struct E2SM_KPM_EventTriggerDefinition),
offsetof(struct E2SM_KPM_EventTriggerDefinition, _asn_ctx),
offsetof(struct E2SM_KPM_EventTriggerDefinition, present),
sizeof(((struct E2SM_KPM_EventTriggerDefinition *)0)->present),
asn_MAP_E2SM_KPM_EventTriggerDefinition_tag2el_1,
1, /* Count of tags in the map */
0, 0,
1 /* Extensions start */
};
asn_TYPE_descriptor_t asn_DEF_E2SM_KPM_EventTriggerDefinition = {
"E2SM-KPM-EventTriggerDefinition",
"E2SM-KPM-EventTriggerDefinition",
&asn_OP_CHOICE,
0, /* No effective tags (pointer) */
0, /* No effective tags (count) */
0, /* No tags (pointer) */
0, /* No tags (count) */
{ &asn_OER_type_E2SM_KPM_EventTriggerDefinition_constr_1, &asn_PER_type_E2SM_KPM_EventTriggerDefinition_constr_1, CHOICE_constraint },
asn_MBR_E2SM_KPM_EventTriggerDefinition_1,
1, /* Elements count */
&asn_SPC_E2SM_KPM_EventTriggerDefinition_specs_1 /* Additional specs */
};

View File

@@ -0,0 +1,53 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "E2SM-KPM-IEs"
* found in "/home/rshacham/e2sm-kpm-v01.02.asn"
* `asn1c -fcompound-names`
*/
#ifndef _E2SM_KPM_EventTriggerDefinition_H_
#define _E2SM_KPM_EventTriggerDefinition_H_
#include <asn_application.h>
/* Including external dependencies */
#include "E2SM-KPM-EventTriggerDefinition-Format1.h"
#include <constr_CHOICE.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Dependencies */
typedef enum E2SM_KPM_EventTriggerDefinition_PR {
E2SM_KPM_EventTriggerDefinition_PR_NOTHING, /* No components present */
E2SM_KPM_EventTriggerDefinition_PR_eventDefinition_Format1
/* Extensions may appear below */
} E2SM_KPM_EventTriggerDefinition_PR;
/* E2SM-KPM-EventTriggerDefinition */
typedef struct E2SM_KPM_EventTriggerDefinition {
E2SM_KPM_EventTriggerDefinition_PR present;
union E2SM_KPM_EventTriggerDefinition_u {
E2SM_KPM_EventTriggerDefinition_Format1_t eventDefinition_Format1;
/*
* This type is extensible,
* possible extensions are below.
*/
} choice;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} E2SM_KPM_EventTriggerDefinition_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_E2SM_KPM_EventTriggerDefinition;
#ifdef __cplusplus
}
#endif
#endif /* _E2SM_KPM_EventTriggerDefinition_H_ */
#include <asn_internal.h>

Some files were not shown because too many files have changed in this diff Show More