Commit 72cc6b16 authored by masayuki.harada's avatar masayuki.harada

Merge branch 'develop_SA_L3' into 'master'

develop_SA_L3_20201021

See merge request !2
parents af35e37c 0312db24
This diff is collapsed.
......@@ -879,6 +879,7 @@ add_boolean_option(UE_EXPANSION False "enable UE_EXPANSION w
add_boolean_option(PHY_TX_THREAD False "enable UE_EXPANSION with max 256 UE")
add_boolean_option(PRE_SCD_THREAD False "enable UE_EXPANSION with max 256 UE")
add_boolean_option(UESIM_EXPANSION False "enable UESIM_EXPANSION with max 256 UE")
add_boolean_option(ITTI_SIM False "enable itti simulator")
########################
# Include order
......@@ -2912,7 +2913,7 @@ add_executable(nr-uesoftmodem
target_link_libraries (nr-uesoftmodem
-Wl,--start-group
RRC_LIB NR_RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB
RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB
PHY_COMMON PHY_NR_COMMON PHY_UE PHY_NR_UE PHY_RU LFDS NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB
NFAPI_USER_LIB S1AP_LIB S1AP_ENB
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES}
......@@ -3223,7 +3224,7 @@ if (${T_TRACER})
foreach(i
#all "add_executable" definitions (except tests, rb_tool, updatefw)
lte-softmodem lte-uesoftmodem nr-softmodem
nr-uesoftmodem dlsim dlsim_tm4 dlsim_tm7
nr-uesoftmodem dlsim dlsim_tm4 dlsim_tm7 nr-ittisim
ulsim pbchsim scansim mbmssim pdcchsim pucchsim prachsim
syncsim nr_ulsim nr_dlsim nr_dlschsim nr_pbchsim nr_pucchsim
nr_ulschsim ldpctest polartest smallblocktest cu_test du_test
......@@ -3310,6 +3311,60 @@ add_executable(rb_tool
)
target_include_directories(rb_tool PRIVATE ${OPENAIR2_DIR}/NETWORK_DRIVER/MESH/)
# nr-ittisim
###################################################
add_executable(nr-ittisim
${rrc_h}
${nr_rrc_h}
${OPENAIR2_DIR}/GNB_APP/gnb_app.c
${OPENAIR2_DIR}/GNB_APP/gnb_config.c
${OPENAIR_DIR}/executables/nr-gnb.c
${OPENAIR_DIR}/executables/nr-ru.c
${OPENAIR2_DIR}/SIMULATION/NR_RRC/itti_sim.c
${OPENAIR_DIR}/executables/softmodem-common.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
${OPENAIR_TARGETS}/ARCH/COMMON/record_player.c
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
${OPENAIR2_DIR}/RRC/NAS/rb_config.c
${OPENAIR3_DIR}/GTPV1-U/gtpv1u_gNB.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
${OPENAIR_DIR}/common/utils/utils.c
${OPENAIR_DIR}/common/utils/system.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c
${GTPU_need_ITTI}
${XFORMSINTERFACE_SOURCE}
${T_SOURCE}
${CONFIG_SOURCES}
${SHLIB_LOADER_SOURCES}
)
#target_link_libraries (nr-ittisim
# -Wl,--start-group
# UTIL HASHTABLE SCTP_CLIENT UDP LFDS NR_GTPV1U SECU_CN SECU_OSA
# ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB
# NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB
# X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${PROTO_AGENT_LIB} ${FSPT_MSG_LIB}
# -Wl,--end-group z dl)
target_link_libraries (nr-ittisim
-Wl,--start-group
UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS NR_GTPV1U SECU_CN SECU_OSA
${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_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 ${PROTO_AGENT_LIB} ${FSPT_MSG_LIB}
NR_L2_UE
-Wl,--end-group z dl)
target_link_libraries (nr-ittisim ${LIBXML2_LIBRARIES})
target_link_libraries (nr-ittisim pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
target_link_libraries (nr-ittisim ${LIB_LMS_LIBRARIES})
target_link_libraries (nr-ittisim ${T_LIB})
add_dependencies( nr-ittisim ldpc_orig ldpc_optim ldpc_optim8seg ldpc )
# ???
####################
list(APPEND oai_nw_drv_src device.c common.c ioctl.c classifier.c tool.c)
......
......@@ -67,6 +67,7 @@ UE_TIMING_TRACE="False"
USRP_REC_PLAY="False"
BUILD_ECLIPSE=0
NR="False"
ITTI_SIM="False"
OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope msc"
trap handle_ctrl_c INT
......@@ -160,6 +161,8 @@ Options
Build for I/Q record-playback modes
-k | --skip-shared-libraries
Skip build for shared libraries to reduce compilation time when building frequently for debugging purposes
--ittiSIM
Makes the itti simulator
-h | --help
Print this help
......@@ -418,6 +421,11 @@ function main() {
CMAKE_CMD="$CMAKE_CMD -GNinja"
MAKE_CMD=ninja
shift;;
--ittiSIM)
ittiSIM=1
ITTI_SIM="True"
echo_info "Will compile itti simulator"
shift;;
-h | --help)
print_help
exit 1;;
......@@ -580,7 +588,7 @@ function main() {
config_libconfig_shlib=params_libconfig
# first generate the CMakefile in the right directory
if [ "$eNB" = "1" -o "$eNBocp" = "1" -o "$UE" = "1" -o "$gNB" = "1" -o "$nrUE" = "1" -o "$HW" = "EXMIMO" ] ; then
if [ "$eNB" = "1" -o "$eNBocp" = "1" -o "$UE" = "1" -o "$gNB" = "1" -o "$nrUE" = "1" -o "$HW" = "EXMIMO" -o "$ittiSIM" = "1" ] ; then
# softmodem compilation
......@@ -605,6 +613,7 @@ function main() {
echo "set ( UE_TIMING_TRACE $UE_TIMING_TRACE )" >> $cmake_file
echo "set ( USRP_REC_PLAY $USRP_REC_PLAY )" >> $cmake_file
echo "set ( SKIP_SHARED_LIB_FLAG $SKIP_SHARED_LIB_FLAG )" >> $cmake_file
echo "set ( ITTI_SIM $ITTI_SIM )" >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
cd $DIR/$build_dir/build
eval $CMAKE_CMD
......@@ -626,6 +635,10 @@ function main() {
execlist="$execlist nr-uesoftmodem"
fi
if [ "$ittiSIM" = "1" ] ; then
execlist="$execlist nr-ittisim"
fi
for f in $execlist ; do
echo_info "Compiling $f..."
compilations \
......
......@@ -17,3 +17,7 @@
#include "openair2/COMMON/flexran_messages_def.h"
#include "openair2/COMMON/f1ap_messages_def.h"
#include "openair2/COMMON/ngap_messages_def.h"
#if ITTI_SIM
#include "openair2/COMMON/itti_sim_messages_def.h"
#endif
......@@ -260,7 +260,11 @@ typedef struct IttiMsgText_s {
#include <openair3/GTPV1-U/gtpv1u_gNB_task.h>
void *rrc_enb_process_itti_msg(void *);
#include <openair3/SCTP/sctp_eNB_task.h>
#include <openair3/S1AP/s1ap_eNB.h>
#include <openair3/NGAP/ngap_gNB.h>
#ifdef ITTI_SIM
#include <openair2/COMMON/itti_sim_messages_types.h>
#endif
/*
static const char *const messages_definition_xml = {
......@@ -331,6 +335,7 @@ void * rrc_enb_process_msg(void*);
TASK_DEF(TASK_RLC_UE, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_PDCP_UE, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_RRC_UE, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_RRC_NRUE, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_NAS_UE, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_RAL_UE, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_MSC, TASK_PRIORITY_MED, 200, NULL, NULL)\
......@@ -338,6 +343,8 @@ void * rrc_enb_process_msg(void*);
TASK_DEF(TASK_UDP, TASK_PRIORITY_MED, 1000, NULL, NULL)\
TASK_DEF(TASK_CU_F1, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_DU_F1, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_RRC_UE_SIM, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_RRC_GNB_SIM, 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 },
......
......@@ -1796,7 +1796,7 @@ void init_RU_proc(RU_t *ru) {
pthread_cond_init( &proc->cond_asynch_rxtx, NULL);
pthread_cond_init( &proc->cond_synch,NULL);
pthread_cond_init( &proc->cond_gNBs, NULL);
//threadCreate( &proc->pthread_FH, ru_thread, (void *)ru, "thread_FH", -1, OAI_PRIORITY_RT_MAX );
threadCreate( &proc->pthread_FH, ru_thread, (void *)ru, "thread_FH", -1, OAI_PRIORITY_RT_MAX );
if (get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT)
threadCreate( &proc->pthread_FH1, ru_thread_tx, (void *)ru, "thread_FH1", -1, OAI_PRIORITY_RT );
......
......@@ -401,7 +401,7 @@ int create_gNB_tasks(uint32_t gnb_nb) {
}
}
if (EPC_MODE_ENABLED && (get_softmodem_params()->phy_test==0 && get_softmodem_params()->do_ra==0)) {
if (AMF_MODE_ENABLED && (get_softmodem_params()->phy_test==0 && get_softmodem_params()->do_ra==0)) {
if (gnb_nb > 0) {
/*
if (itti_create_task (TASK_SCTP, sctp_eNB_task, NULL) < 0) {
......@@ -824,7 +824,7 @@ int main( int argc, char **argv )
}
openair0_cfg[0].threequarter_fs = threequarter_fs;
EPC_MODE_ENABLED = !IS_SOFTMODEM_NOS1; //!get_softmodem_params()->phy_test;
AMF_MODE_ENABLED = !IS_SOFTMODEM_NOS1; //!get_softmodem_params()->phy_test;
if (get_softmodem_params()->do_ra)
AssertFatal(get_softmodem_params()->phy_test == 0,"RA and phy_test are mutually exclusive\n");
......
......@@ -235,8 +235,8 @@ void fill_scc(NR_ServingCellConfigCommon_t *scc,uint64_t *ssb_bitmap,int N_RB_DL
void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap);
void prepare_scc(NR_ServingCellConfigCommon_t *scc);
s1ap_eNB_config_t s1ap_config;
uint32_t s1ap_generate_eNB_id(void) {return 0;}
ngap_gNB_config_t ngap_config;
uint32_t ngap_generate_gNB_id(void) {return 0;}
void configure_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port) { return;}
void configure_nfapi_vnf(char *vnf_addr, int vnf_p5_port) { return;}
......
/*!
\file itti_sim_messages_def.h
\brief itti message for itti simulator
\author Yoshio INOUE, Masayuki HARADA
\email: yoshio.inoue@fujitsu.com,masayuki.harada@fujitsu.com
\date 2020
\version 0.1
*/
MESSAGE_DEF(GNB_RRC_BCCH_DATA_IND, MESSAGE_PRIORITY_MED, itti_sim_rrc_ch_t, GNBBCCHind)
MESSAGE_DEF(GNB_RRC_CCCH_DATA_IND, MESSAGE_PRIORITY_MED, itti_sim_rrc_ch_t, GNBCCCHind)
MESSAGE_DEF(GNB_RRC_DCCH_DATA_IND, MESSAGE_PRIORITY_MED, itti_sim_rrc_ch_t, GNBDCCHind)
MESSAGE_DEF(UE_RRC_CCCH_DATA_IND, MESSAGE_PRIORITY_MED, itti_sim_rrc_ch_t, UECCCHind)
MESSAGE_DEF(UE_RRC_DCCH_DATA_IND, MESSAGE_PRIORITY_MED, itti_sim_rrc_ch_t, UEDCCHind)
/*!
\file itti_sim_messages_types.h
\brief itti message for itti simulator
\author Yoshio INOUE, Masayuki HARADA
\email: yoshio.inoue@fujitsu.com,masayuki.harada@fujitsu.com
\date 2020
\version 0.1
*/
#ifndef ITTI_SIM_MESSAGES_TYPES_H_
#define ITTI_SIM_MESSAGES_TYPES_H_
#include "LTE_asn_constant.h"
#define GNB_RRC_BCCH_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.GNBBCCHind
#define GNB_RRC_CCCH_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.GNBCCCHind
#define GNB_RRC_DCCH_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.GNBDCCHind
#define UE_RRC_CCCH_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.UECCCHind
#define UE_RRC_DCCH_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.UEDCCHind
typedef struct itti_sim_rrc_ch_s {
const rb_id_t rbid;
uint8_t *sdu;
int size;
} itti_sim_rrc_ch_t;
#endif /* ITTI_SIM_MESSAGES_TYPES_H_ */
......@@ -41,8 +41,6 @@ MESSAGE_DEF(RRC_MAC_CCCH_DATA_REQ, MESSAGE_PRIORITY_MED_PLUS, RrcMacCcchDat
MESSAGE_DEF(RRC_MAC_CCCH_DATA_CNF, MESSAGE_PRIORITY_MED_PLUS, RrcMacCcchDataCnf, rrc_mac_ccch_data_cnf)
MESSAGE_DEF(RRC_MAC_CCCH_DATA_IND, MESSAGE_PRIORITY_MED_PLUS, RrcMacCcchDataInd, rrc_mac_ccch_data_ind)
// gNB
MESSAGE_DEF(NR_RRC_MAC_CCCH_DATA_IND, MESSAGE_PRIORITY_MED_PLUS, NRRrcMacCcchDataInd, nr_rrc_mac_ccch_data_ind)
MESSAGE_DEF(RRC_MAC_MCCH_DATA_REQ, MESSAGE_PRIORITY_MED_PLUS, RrcMacMcchDataReq, rrc_mac_mcch_data_req)
MESSAGE_DEF(RRC_MAC_MCCH_DATA_IND, MESSAGE_PRIORITY_MED_PLUS, RrcMacMcchDataInd, rrc_mac_mcch_data_ind)
......@@ -50,4 +48,9 @@ MESSAGE_DEF(RRC_MAC_MCCH_DATA_IND, MESSAGE_PRIORITY_MED_PLUS, RrcMacMcchDat
MESSAGE_DEF(RRC_MAC_PCCH_DATA_REQ, MESSAGE_PRIORITY_MED_PLUS, RrcMacPcchDataReq, rrc_mac_pcch_data_req)
/* RRC configures DRX context (MAC timers) of a UE */
MESSAGE_DEF(RRC_MAC_DRX_CONFIG_REQ, MESSAGE_PRIORITY_MED, rrc_mac_drx_config_req_t, rrc_mac_drx_config_req)
\ No newline at end of file
MESSAGE_DEF(RRC_MAC_DRX_CONFIG_REQ, MESSAGE_PRIORITY_MED, rrc_mac_drx_config_req_t, rrc_mac_drx_config_req)
// gNB
MESSAGE_DEF(NR_RRC_MAC_CCCH_DATA_IND, MESSAGE_PRIORITY_MED_PLUS, NRRrcMacCcchDataInd, nr_rrc_mac_ccch_data_ind)
MESSAGE_DEF(NR_RRC_MAC_BCCH_DATA_IND, MESSAGE_PRIORITY_MED_PLUS, NRRrcMacBcchDataInd, nr_rrc_mac_bcch_data_ind)
......@@ -38,6 +38,7 @@
#define RRC_MAC_BCCH_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_bcch_data_req
#define RRC_MAC_BCCH_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_bcch_data_ind
#define NR_RRC_MAC_BCCH_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.nr_rrc_mac_bcch_data_ind
#define RRC_MAC_BCCH_MBMS_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_bcch_mbms_data_req
#define RRC_MAC_BCCH_MBMS_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_bcch_mbms_data_ind
......@@ -87,6 +88,15 @@ typedef struct RrcMacBcchDataInd_s {
uint8_t rsrp;
} RrcMacBcchDataInd;
typedef struct NRRrcMacBcchDataInd_s {
uint32_t frame;
uint8_t sub_frame;
uint32_t sdu_size;
uint8_t sdu[BCCH_SDU_SIZE];
uint8_t gnb_index;
uint8_t rsrq;
uint8_t rsrp;
} NRRrcMacBcchDataInd;
typedef struct RrcMacBcchMbmsDataReq_s {
uint32_t frame;
......
......@@ -74,6 +74,7 @@ TASK_DEF(TASK_PROTO_AGENT, TASK_PRIORITY_MED, 200)
/// Radio Resource Control task
TASK_DEF(TASK_RRC_UE, TASK_PRIORITY_MED, 200)
TASK_DEF(TASK_RRC_NRUE, TASK_PRIORITY_MED, 200)
/// Non Access Stratum task
TASK_DEF(TASK_NAS_UE, TASK_PRIORITY_MED, 200)
TASK_DEF(TASK_RAL_UE, TASK_PRIORITY_MED, 200)
......@@ -81,3 +82,8 @@ TASK_DEF(TASK_RAL_UE, TASK_PRIORITY_MED, 200)
//MESSAGE GENERATOR TASK
TASK_DEF(TASK_MSC, TASK_PRIORITY_MED, 200)
#ifdef ITTI_SIM
TASK_DEF(TASK_RRC_GNB_SIM, TASK_PRIORITY_MED, 200)
TASK_DEF(TASK_RRC_UE_SIM, TASK_PRIORITY_MED, 200)
#endif
......@@ -173,7 +173,7 @@ void *gNB_app_task(void *args_p)
__attribute__((unused)) uint32_t x2_register_gnb_pending = gNB_app_register_x2 (gnb_id_start, gnb_id_end);
}
if (EPC_MODE_ENABLED) {
if (AMF_MODE_ENABLED) {
/* Try to register each gNB */
//registered_gnb = 0;
__attribute__((unused)) uint32_t register_gnb_pending = gNB_app_register (gnb_id_start, gnb_id_end);//, gnb_properties_p);
......
......@@ -342,7 +342,7 @@ void RCconfig_nr_flexran()
/* gNB ID from configuration, as read in by RCconfig_RRC() */
if (!GNBParamList.paramarray[i][GNB_GNB_ID_IDX].uptr) {
// Calculate a default gNB ID
if (EPC_MODE_ENABLED)
if (AMF_MODE_ENABLED)
gnb_id = i + (ngap_generate_gNB_id () & 0xFFFFFF8);
else
gnb_id = i;
......@@ -536,7 +536,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
AssertFatal (i<num_gnbs,"Failed to parse config file no %ith element in %s \n",i, GNB_CONFIG_STRING_ACTIVE_GNBS);
/*
if (EPC_MODE_ENABLED) {
if (AMF_MODE_ENABLED) {
if (strcasecmp( *(GNBSParams[GNB_ASN1_VERBOSITY_IDX].strptr), GNB_CONFIG_STRING_ASN1_VERBOSITY_NONE) == 0) {
asn_debug = 0;
asn1_xer_print = 0;
......@@ -562,7 +562,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
if (GNBParamList.paramarray[i][GNB_GNB_ID_IDX].uptr == NULL) {
// Calculate a default gNB ID
if (EPC_MODE_ENABLED) {
if (AMF_MODE_ENABLED) {
uint32_t hash;
hash = ngap_generate_gNB_id ();
gnb_id = i + (hash & 0xFFFFFF8);
......@@ -742,7 +742,7 @@ int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) {
config_get( GNBSParams,sizeof(GNBSParams)/sizeof(paramdef_t),NULL);
/*
if (EPC_MODE_ENABLED) {
if (AMF_MODE_ENABLED) {
if (strcasecmp( *(GNBSParams[GNB_ASN1_VERBOSITY_IDX].strptr), GNB_CONFIG_STRING_ASN1_VERBOSITY_NONE) == 0) {
asn_debug = 0;
asn1_xer_print = 0;
......@@ -771,7 +771,7 @@ int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) {
for (k = 0; k < GNBParamList.numelt; k++) {
if (GNBParamList.paramarray[k][GNB_GNB_ID_IDX].uptr == NULL) {
// Calculate a default gNB ID
if (EPC_MODE_ENABLED) {
if (AMF_MODE_ENABLED) {
uint32_t hash;
hash = ngap_generate_gNB_id ();
......@@ -925,7 +925,7 @@ int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) {
// SCTP SETTING
NGAP_REGISTER_GNB_REQ (msg_p).sctp_out_streams = SCTP_OUT_STREAMS;
NGAP_REGISTER_GNB_REQ (msg_p).sctp_in_streams = SCTP_IN_STREAMS;
if (EPC_MODE_ENABLED) {
if (AMF_MODE_ENABLED) {
sprintf(aprefix,"%s.[%i].%s",GNB_CONFIG_STRING_GNB_LIST,k,GNB_CONFIG_STRING_SCTP_CONFIG);
config_get( SCTPParams,sizeof(SCTPParams)/sizeof(paramdef_t),aprefix);
NGAP_REGISTER_GNB_REQ (msg_p).sctp_in_streams = (uint16_t)*(SCTPParams[GNB_SCTP_INSTREAMS_IDX].uptr);
......@@ -1044,7 +1044,7 @@ int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i) {
for (k = 0; k < GNBParamList.numelt; k++) {
if (GNBParamList.paramarray[k][GNB_GNB_ID_IDX].uptr == NULL) {
// Calculate a default eNB ID
if (EPC_MODE_ENABLED) {
if (AMF_MODE_ENABLED) {
uint32_t hash;
hash = ngap_generate_gNB_id ();
gnb_id = k + (hash & 0xFFFFFF8);
......@@ -1173,7 +1173,7 @@ int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i) {
X2AP_REGISTER_ENB_REQ (msg_p).sctp_out_streams = SCTP_OUT_STREAMS;
X2AP_REGISTER_ENB_REQ (msg_p).sctp_in_streams = SCTP_IN_STREAMS;
if (EPC_MODE_ENABLED) {
if (AMF_MODE_ENABLED) {
sprintf(aprefix,"%s.[%i].%s",GNB_CONFIG_STRING_GNB_LIST,k,GNB_CONFIG_STRING_SCTP_CONFIG);
config_get( SCTPParams,sizeof(SCTPParams)/sizeof(paramdef_t),aprefix);
X2AP_REGISTER_ENB_REQ (msg_p).sctp_in_streams = (uint16_t)*(SCTPParams[GNB_SCTP_INSTREAMS_IDX].uptr);
......
......@@ -863,10 +863,45 @@ boolean_t pdcp_remove_UE(
return 1;
}
void pdcp_config_set_security(const protocol_ctxt_t* const ctxt_pP, pdcp_t *pdcp_pP, rb_id_t rb_id,
uint16_t lc_idP, uint8_t security_modeP, uint8_t *kRRCenc_pP, uint8_t *kRRCint_pP, uint8_t *kUPenc_pP)
void pdcp_config_set_security(
const protocol_ctxt_t* const ctxt_pP,
pdcp_t *const pdcp_pP,
const rb_id_t rb_id,
const uint16_t lc_idP,
const uint8_t security_modeP,
uint8_t *const kRRCenc_pP,
uint8_t *const kRRCint_pP,
uint8_t *const kUPenc_pP)
{
TODO;
DevAssert(pdcp_pP != NULL);
if ((security_modeP >= 0) && (security_modeP <= 0x77)) {
pdcp_pP->cipheringAlgorithm = security_modeP & 0x0f;
pdcp_pP->integrityProtAlgorithm = (security_modeP>>4) & 0xf;
LOG_D(PDCP, PROTOCOL_PDCP_CTXT_FMT" CONFIG_ACTION_SET_SECURITY_MODE: cipheringAlgorithm %d integrityProtAlgorithm %d\n",
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP,pdcp_pP),
pdcp_pP->cipheringAlgorithm,
pdcp_pP->integrityProtAlgorithm);
pdcp_pP->kRRCenc = kRRCenc_pP;
pdcp_pP->kRRCint = kRRCint_pP;
pdcp_pP->kUPenc = kUPenc_pP;
/* Activate security */
pdcp_pP->security_activated = 1;
MSC_LOG_EVENT(
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
"0 Set security ciph %X integ %x UE %"PRIx16" ",
pdcp_pP->cipheringAlgorithm,
pdcp_pP->integrityProtAlgorithm,
ctxt_pP->rnti);
} else {
MSC_LOG_EVENT(
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
"0 Set security failed UE %"PRIx16" ",
ctxt_pP->rnti);
LOG_E(PDCP,PROTOCOL_PDCP_CTXT_FMT" bad security mode %d",
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP,pdcp_pP),
security_modeP);
}
}
static boolean_t pdcp_data_req_drb(
......
......@@ -37,6 +37,9 @@
#include "COMMON/s1ap_messages_types.h"
#include "COMMON/rrc_messages_types.h"
#if ITTI_SIM
#include "COMMON/itti_sim_messages_types.h"
#endif
#include "collection/tree.h"
#include "rrc_types_NB_IoT.h"
......
This diff is collapsed.
......@@ -99,6 +99,10 @@ uint8_t do_NR_SecurityModeCommand(
const uint8_t cipheringAlgorithm,
NR_IntegrityProtAlgorithm_t *integrityProtAlgorithm);
uint8_t do_NR_UECapabilityEnquiry_nr( const protocol_ctxt_t *const ctxt_pP,
uint8_t *const buffer,
const uint8_t Transaction_id);
uint8_t do_NR_RRCConnectionRelease(uint8_t *buffer,
uint8_t Transaction_id);
uint16_t do_RRCReconfiguration(
......@@ -107,3 +111,10 @@ uint16_t do_RRCReconfiguration(
uint8_t *buffer,
uint8_t Transaction_id,
gNB_RRC_INST *gnb_rrc_inst);
uint8_t do_RRCSetupComplete(uint8_t Mod_id,
uint8_t *buffer,
const uint8_t Transaction_id,
uint8_t sel_plmn_id,
const int dedicatedInfoNASLength,
const char *dedicatedInfoNAS);
\ No newline at end of file
......@@ -134,8 +134,6 @@ typedef enum UE_STATE_NR_e {
/* TS 36.331: RRC-TransactionIdentifier ::= INTEGER (0..3) */
#define NR_RRC_TRANSACTION_IDENTIFIER_NUMBER 3
#define ENABLE_SECURITY 1
typedef struct {
unsigned short transport_block_size; /*!< \brief Minimum PDU size in bytes provided by RLC to MAC layer interface */
unsigned short max_transport_blocks; /*!< \brief Maximum PDU size in bytes provided by RLC to MAC layer interface */
......@@ -289,13 +287,12 @@ typedef struct gNB_RRC_UE_s {
ImsiMobileIdentity_t imsi;
#if defined(ENABLE_SECURITY)
/* KeNB as derived from KASME received from EPC */
uint8_t kenb[32];
int8_t kenb_ncc;
/* KgNB as derived from KASME received from EPC */
uint8_t kgnb[32];
int8_t kgnb_ncc;
uint8_t nh[32];
int8_t nh_ncc;
#endif
/* Used integrity/ciphering algorithms */
NR_CipheringAlgorithm_t ciphering_algorithm;
e_NR_IntegrityProtAlgorithm integrity_algorithm;
......@@ -322,7 +319,7 @@ typedef struct gNB_RRC_UE_s {
uint64_t amf_ue_ngap_id:40;
nr_rrc_guami_t ue_guami;
security_capabilities_t security_capabilities;
ngap_security_capabilities_t security_capabilities;
/* Total number of e_rab already setup in the list */
uint8_t setup_e_rabs;
......
......@@ -68,9 +68,7 @@
#include "OCG.h"
#include "OCG_extern.h"
#if defined(ENABLE_SECURITY)
#include "UTIL/OSA/osa_defs.h"
#endif
#include "UTIL/OSA/osa_defs.h"
#include "rrc_eNB_S1AP.h"
#include "rrc_gNB_NGAP.h"
......@@ -92,6 +90,28 @@
extern RAN_CONTEXT_t RC;
extern boolean_t nr_rrc_pdcp_config_asn1_req(
const protocol_ctxt_t *const ctxt_pP,
NR_SRB_ToAddModList_t *const srb2add_list,
NR_DRB_ToAddModList_t *const drb2add_list,
NR_DRB_ToReleaseList_t *const drb2release_list,
const uint8_t security_modeP,
uint8_t *const kRRCenc,
uint8_t *const kRRCint,
uint8_t *const kUPenc
#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0))
,LTE_PMCH_InfoList_r9_t *pmch_InfoList_r9
#endif
,rb_id_t *const defaultDRB,
struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list);
extern rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP,
const NR_SRB_ToAddModList_t * const srb2add_listP,
const NR_DRB_ToAddModList_t * const drb2add_listP,
const NR_DRB_ToReleaseList_t * const drb2release_listP,
const LTE_PMCH_InfoList_r9_t * const pmch_InfoList_r9_pP,
struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list);
mui_t rrc_gNB_mui = 0;
///---------------------------------------------------------------------------------------------------------------///
......@@ -347,7 +367,7 @@ rrc_gNB_generate_RRCSetup(
)
//-----------------------------------------------------------------------------
{
LOG_I(RRC, "rrc_gNB_generate_RRCSetup \n");
LOG_I(NR_RRC, "rrc_gNB_generate_RRCSetup \n");
NR_SRB_ToAddModList_t *SRB_configList = NULL;
// T(T_GNB_RRC_SETUP,
......@@ -357,7 +377,7 @@ rrc_gNB_generate_RRCSetup(
// T_INT(ctxt_pP->rnti));
gNB_RRC_UE_t *ue_p = &ue_context_pP->ue_context;
SRB_configList = ue_p->SRB_configList;
do_RRCSetup(ctxt_pP,
ue_p->Srb0.Tx_buffer.payload_size = do_RRCSetup(ctxt_pP,
ue_context_pP,
CC_id,
(uint8_t *) ue_p->Srb0.Tx_buffer.Payload,
......@@ -420,6 +440,13 @@ rrc_gNB_generate_RRCSetup(
ue_context_pP->ue_context.ue_release_timer_thres = 1000;
/* init timers */
// ue_context_pP->ue_context.ue_rrc_inactivity_timer = 0;
#ifdef ITTI_SIM
MessageDef *message_p;
message_p = itti_alloc_new_message (TASK_RRC_UE_SIM, GNB_RRC_CCCH_DATA_IND);
GNB_RRC_CCCH_DATA_IND (message_p).sdu = (uint8_t*)ue_p->Srb0.Tx_buffer.Payload;
GNB_RRC_CCCH_DATA_IND (message_p).size = ue_p->Srb0.Tx_buffer.payload_size;
itti_send_msg_to_task (TASK_RRC_UE_SIM, ctxt_pP->instance, message_p);
#endif
}
void
......@@ -562,18 +589,18 @@ rrc_gNB_process_RRCReconfigurationComplete(
return;
}
/* Derive the keys from kenb */
/* Derive the keys from kgnb */
if (DRB_configList != NULL) {
derive_key_up_enc(ue_context_pP->ue_context.ciphering_algorithm,
ue_context_pP->ue_context.kenb,
ue_context_pP->ue_context.kgnb,
&kUPenc);
}
derive_key_rrc_enc(ue_context_pP->ue_context.ciphering_algorithm,
ue_context_pP->ue_context.kenb,
ue_context_pP->ue_context.kgnb,
&kRRCenc);
derive_key_rrc_int(ue_context_pP->ue_context.integrity_algorithm,
ue_context_pP->ue_context.kenb,
ue_context_pP->ue_context.kgnb,
&kRRCint);
/* Refresh SRBs/DRBs */
......@@ -590,6 +617,7 @@ rrc_gNB_process_RRCReconfigurationComplete(
kRRCint,
kUPenc,
NULL,
NULL,
NULL);
/* Refresh SRBs/DRBs */
nr_rrc_rlc_config_asn1_req(ctxt_pP,
......@@ -597,9 +625,7 @@ rrc_gNB_process_RRCReconfigurationComplete(
DRB_configList,
DRB_Release_configList2,
NULL,
0,
0
);
NULL);
/* Loop through DRBs and establish if necessary */
if (DRB_configList != NULL) {
......
......@@ -47,6 +47,7 @@
#include "S1AP_NAS-PDU.h"
#include "executables/softmodem-common.h"
#include "UTIL/OSA/osa_defs.h"
extern RAN_CONTEXT_t RC;
......@@ -115,6 +116,75 @@ rrc_gNB_get_ue_context_from_ngap_ids(
return NULL;
}
//------------------------------------------------------------------------------
void
nr_rrc_pdcp_config_security(
const protocol_ctxt_t *const ctxt_pP,
rrc_gNB_ue_context_t *const ue_context_pP,
const uint8_t send_security_mode_command
)
//------------------------------------------------------------------------------
{
NR_SRB_ToAddModList_t *SRB_configList = ue_context_pP->ue_context.SRB_configList;
uint8_t *kRRCenc = NULL;
uint8_t *kRRCint = NULL;
uint8_t *kUPenc = NULL;
pdcp_t *pdcp_p = NULL;
static int print_keys= 1;
hashtable_rc_t h_rc;
hash_key_t key;
/* Derive the keys from kgnb */
if (SRB_configList != NULL) {
derive_key_up_enc(ue_context_pP->ue_context.ciphering_algorithm,
ue_context_pP->ue_context.kgnb,
&kUPenc);
}
derive_key_rrc_enc(ue_context_pP->ue_context.ciphering_algorithm,
ue_context_pP->ue_context.kgnb,
&kRRCenc);
derive_key_rrc_int(ue_context_pP->ue_context.integrity_algorithm,
ue_context_pP->ue_context.kgnb,
&kRRCint);
if (!IS_SOFTMODEM_IQPLAYER) {
SET_LOG_DUMP(DEBUG_SECURITY) ;
}
if ( LOG_DUMPFLAG( DEBUG_SECURITY ) ) {
if (print_keys == 1 ) {
print_keys =0;
LOG_DUMPMSG(NR_RRC, DEBUG_SECURITY, ue_context_pP->ue_context.kgnb, 32,"\nKgNB:" );
LOG_DUMPMSG(NR_RRC, DEBUG_SECURITY, kRRCenc, 32,"\nKRRCenc:" );
LOG_DUMPMSG(NR_RRC, DEBUG_SECURITY, kRRCint, 32,"\nKRRCint:" );
}
}
key = PDCP_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, DCCH, SRB_FLAG_YES);
h_rc = hashtable_get(pdcp_coll_p, key, (void **)&pdcp_p);
if (h_rc == HASH_TABLE_OK) {
pdcp_config_set_security(
ctxt_pP,
pdcp_p,
DCCH,
DCCH+2,
(send_security_mode_command == TRUE) ?
0 | (ue_context_pP->ue_context.integrity_algorithm << 4) :
(ue_context_pP->ue_context.ciphering_algorithm ) |
(ue_context_pP->ue_context.integrity_algorithm << 4),
kRRCenc,
kRRCint,
kUPenc);
} else {
LOG_E(NR_RRC,
PROTOCOL_NR_RRC_CTXT_UE_FMT"Could not get PDCP instance for SRB DCCH %u\n",
PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP),
DCCH);
}
}
//------------------------------------------------------------------------------
/*
* Initial UE NAS message on S1AP.
......@@ -280,7 +350,7 @@ rrc_gNB_process_NGAP_INITIAL_CONTEXT_SETUP_REQ(
uint8_t send_security_mode_command = TRUE;
rrc_pdcp_config_security(
nr_rrc_pdcp_config_security(
&ctxt,
ue_context_p,
send_security_mode_command);
......@@ -289,7 +359,7 @@ rrc_gNB_process_NGAP_INITIAL_CONTEXT_SETUP_REQ(
rrc_gNB_generate_SecurityModeCommand (&ctxt, ue_context_p);
send_security_mode_command = FALSE;
rrc_pdcp_config_security(
nr_rrc_pdcp_config_security(
&ctxt,
ue_context_p,
send_security_mode_command);
......@@ -370,7 +440,7 @@ int
rrc_gNB_process_security(
const protocol_ctxt_t *const ctxt_pP,
rrc_gNB_ue_context_t *const ue_context_pP,
security_capabilities_t *security_capabilities_pP
ngap_security_capabilities_t *security_capabilities_pP
) {
boolean_t changed = FALSE;
NR_CipheringAlgorithm_t cipheringAlgorithm;
......@@ -381,19 +451,19 @@ rrc_gNB_process_security(
LOG_D(NR_RRC,
"[eNB %d] NAS security_capabilities.encryption_algorithms %u AS ciphering_algorithm %lu NAS security_capabilities.integrity_algorithms %u AS integrity_algorithm %u\n",
ctxt_pP->module_id,
ue_context_pP->ue_context.security_capabilities.encryption_algorithms,
ue_context_pP->ue_context.security_capabilities.nRencryption_algorithms,
(unsigned long)ue_context_pP->ue_context.ciphering_algorithm,
ue_context_pP->ue_context.security_capabilities.integrity_algorithms,
ue_context_pP->ue_context.security_capabilities.nRintegrity_algorithms,
ue_context_pP->ue_context.integrity_algorithm);
/* Select relevant algorithms */
cipheringAlgorithm = rrc_gNB_select_ciphering (ue_context_pP->ue_context.security_capabilities.encryption_algorithms);
cipheringAlgorithm = rrc_gNB_select_ciphering (ue_context_pP->ue_context.security_capabilities.nRencryption_algorithms);
if (ue_context_pP->ue_context.ciphering_algorithm != cipheringAlgorithm) {
ue_context_pP->ue_context.ciphering_algorithm = cipheringAlgorithm;
changed = TRUE;
}
integrityProtAlgorithm = rrc_gNB_select_integrity (ue_context_pP->ue_context.security_capabilities.integrity_algorithms);
integrityProtAlgorithm = rrc_gNB_select_integrity (ue_context_pP->ue_context.security_capabilities.nRintegrity_algorithms);
if (ue_context_pP->ue_context.integrity_algorithm != integrityProtAlgorithm) {
ue_context_pP->ue_context.integrity_algorithm = integrityProtAlgorithm;
......
......@@ -74,7 +74,7 @@ int
rrc_gNB_process_security(
const protocol_ctxt_t *const ctxt_pP,
rrc_gNB_ue_context_t *const ue_context_pP,
security_capabilities_t *security_capabilities_pP
ngap_security_capabilities_t *security_capabilities_pP
);
#endif
......@@ -67,4 +67,43 @@ int8_t mac_rrc_nr_data_req_ue(const module_id_t Mod_idP,
// todo
return 0;
}
\ No newline at end of file
}
uint8_t
rrc_data_req_ue(
const protocol_ctxt_t *const ctxt_pP,
const rb_id_t rb_idP,
const mui_t muiP,
const confirm_t confirmP,
const sdu_size_t sdu_sizeP,
uint8_t *const buffer_pP,
const pdcp_transmission_mode_t modeP
)
{
MessageDef *message_p;
// Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling).
uint8_t *message_buffer;
message_buffer = itti_malloc (
ctxt_pP->enb_flag ? TASK_RRC_ENB : TASK_RRC_UE,
ctxt_pP->enb_flag ? TASK_PDCP_ENB : TASK_PDCP_UE,
sdu_sizeP);
memcpy (message_buffer, buffer_pP, sdu_sizeP);
message_p = itti_alloc_new_message (ctxt_pP->enb_flag ? TASK_RRC_ENB : TASK_RRC_UE, RRC_DCCH_DATA_REQ);
RRC_DCCH_DATA_REQ (message_p).frame = ctxt_pP->frame;
RRC_DCCH_DATA_REQ (message_p).enb_flag = ctxt_pP->enb_flag;
RRC_DCCH_DATA_REQ (message_p).rb_id = rb_idP;
RRC_DCCH_DATA_REQ (message_p).muip = muiP;
RRC_DCCH_DATA_REQ (message_p).confirmp = confirmP;
RRC_DCCH_DATA_REQ (message_p).sdu_size = sdu_sizeP;
RRC_DCCH_DATA_REQ (message_p).sdu_p = message_buffer;
RRC_DCCH_DATA_REQ (message_p).mode = modeP;
RRC_DCCH_DATA_REQ (message_p).module_id = ctxt_pP->module_id;
RRC_DCCH_DATA_REQ (message_p).rnti = ctxt_pP->rnti;
RRC_DCCH_DATA_REQ (message_p).eNB_index = ctxt_pP->eNB_index;
itti_send_msg_to_task (
TASK_PDCP_UE,
ctxt_pP->instance,
message_p);
return TRUE; // TODO should be changed to a CNF message later, currently RRC lite does not used the returned value anyway.
}
This diff is collapsed.
......@@ -53,8 +53,15 @@
#include "NR_MIB.h"
#include "NR_BCCH-BCH-Message.h"
#include "NR_DL-DCCH-Message.h"
#include "../NR/nr_rrc_defs.h"
#define NB_NR_UE_INST 1
#define NB_CNX_UE 2//MAX_MANAGED_RG_PER_MOBILE
#define NB_SIG_CNX_UE 2 //MAX_MANAGED_RG_PER_MOBILE
#define MAX_MEAS_OBJ 6
#define MAX_MEAS_CONFIG 6
#define MAX_MEAS_ID 6
typedef uint32_t channel_t;
......@@ -68,9 +75,53 @@ typedef struct NR_UE_RRC_INST_s {
NR_MeasConfig_t *meas_config;
NR_CellGroupConfig_t *cell_group_config;
NR_RadioBearerConfig_t *radio_bearer_config;
NR_MeasObjectToAddMod_t *MeasObj[NB_CNX_UE][MAX_MEAS_OBJ];
NR_ReportConfigToAddMod_t *ReportConfig[NB_CNX_UE][MAX_MEAS_CONFIG];
NR_QuantityConfig_t *QuantityConfig[NB_CNX_UE];
NR_MeasIdToAddMod_t *MeasId[NB_CNX_UE][MAX_MEAS_ID];
NR_MeasGapConfig_t *measGapConfig[NB_CNX_UE];
NR_RSRP_Range_t s_measure;
NR_SRB_ToAddMod_t *SRB1_config[NB_CNX_UE];
NR_SRB_ToAddMod_t *SRB2_config[NB_CNX_UE];
NR_DRB_ToAddMod_t *DRB_config[NB_CNX_UE][8];
rb_id_t *defaultDRB; // remember the ID of the default DRB
NR_SRB_INFO Srb0[NB_SIG_CNX_UE];
NR_SRB_INFO_TABLE_ENTRY Srb1[NB_CNX_UE];
NR_SRB_INFO_TABLE_ENTRY Srb2[NB_CNX_UE];
uint8_t MBMS_flag;
NR_SystemInformation_t *si[NB_CNX_UE];
NR_SIB1_t *sib1[NB_CNX_UE];
NR_SIB2_t *sib2[NB_CNX_UE];
NR_SIB3_t *sib3[NB_CNX_UE];
NR_SIB4_t *sib4[NB_CNX_UE];
NR_SIB5_t *sib5[NB_CNX_UE];
NR_SIB6_t *sib6[NB_CNX_UE];
NR_SIB7_t *sib7[NB_CNX_UE];
NR_SIB8_t *sib8[NB_CNX_UE];
NR_SIB9_t *sib9[NB_CNX_UE];
NR_SIB10_r16_t *sib10[NB_CNX_UE];
NR_SIB11_r16_t *sib11[NB_CNX_UE];
NR_SIB12_r16_t *sib12[NB_CNX_UE];
NR_SIB13_r16_t *sib13[NB_CNX_UE];
NR_SIB14_r16_t *sib14[NB_CNX_UE];
plmn_t plmnID;
NR_UE_RRC_INFO Info[NB_SIG_CNX_UE];
NR_MIB_t *mib;
/* KeNB as computed from parameters within USIM card */
uint8_t kgnb[32];
/* Used integrity/ciphering algorithms */
//RRC_LIST_TYPE(NR_SecurityAlgorithmConfig_t, NR_SecurityAlgorithmConfig) SecurityAlgorithmConfig_list;
NR_CipheringAlgorithm_t cipheringAlgorithm;
e_NR_IntegrityProtAlgorithm integrityProtAlgorithm;
// lists
// CellGroupConfig.rlc-BearerToAddModList
RRC_LIST_TYPE(NR_RLC_BearerConfig_t, NR_maxLC_ID) RLC_Bearer_Config_list;
......@@ -118,7 +169,10 @@ typedef struct NR_UE_RRC_INST_s {
RRC_LIST_TYPE(NR_CSI_ResourceConfig_t, NR_maxNrofCSI_ResourceConfigurations) CSI_ResourceConfig_list;
// CellGroupConfig.spCellConfig.spCellConfigDedicated
RRC_LIST_TYPE(NR_CSI_ReportConfig_t, NR_maxNrofCSI_ReportConfigurations) CSI_ReportConfig_list;
long selected_plmn_identity;
Rrc_State_NR_t nrRrcState;
Rrc_Sub_State_NR_t nrRrcSubState;
} NR_UE_RRC_INST_t;
#endif
......
......@@ -114,6 +114,10 @@ int8_t mac_rrc_nr_data_req_ue(const module_id_t Mod_idP,
const rb_id_t Srb_id,
uint8_t *const buffer_pP);
/**\brief RRC UE task.
\param void *args_p Pointer on arguments to start the task. */
void *rrc_nrue_task(void *args_p);
/** @}*/
#endif
This diff is collapsed.
......@@ -65,6 +65,7 @@
#include "oaisim_amf_test_s1c.h"
#endif
ngap_gNB_config_t ngap_config;
static int ngap_gNB_generate_ng_setup_request(
ngap_gNB_instance_t *instance_p, ngap_gNB_amf_data_t *ngap_amf_data_p);
......
......@@ -39,6 +39,16 @@
#ifndef NGAP_GNB_H_
#define NGAP_GNB_H_
typedef struct ngap_gNB_config_s {
// MME related params
unsigned char amf_enabled; ///< AMF enabled ?
} ngap_gNB_config_t;
extern ngap_gNB_config_t ngap_config;
#define AMF_MODE_ENABLED ngap_config.amf_enabled
void *ngap_gNB_process_itti_msg(void*);
void ngap_gNB_init(void);
void *ngap_gNB_task(void *arg);
......
This diff is collapsed.
This diff is collapsed.
......@@ -49,38 +49,7 @@ int ngap_gNB_handle_overload_start(uint32_t assoc_id,
uint32_t stream,
NGAP_NGAP_PDU_t *pdu)
{
#if 0
ngap_gNB_amf_data_t *amf_desc_p;
NGAP_OverloadStart_t *container;
NGAP_OverloadStartIEs_t *ie;
DevAssert(pdu != NULL);
container = &pdu->choice.initiatingMessage.value.choice.OverloadStart;
NGAP_FIND_PROTOCOLIE_BY_ID(NGAP_OverloadStartIEs_t, ie, container,
NGAP_ProtocolIE_ID_id_OverloadResponse, true);
if (ie != NULL) {
DevCheck(ie->value.choice.OverloadResponse.present ==
NGAP_OverloadResponse_PR_overloadAction,
NGAP_OverloadResponse_PR_overloadAction, 0, 0);
}
/* Non UE-associated signalling -> stream 0 */
DevCheck(stream == 0, stream, 0, 0);
if ((amf_desc_p = ngap_gNB_get_AMF(NULL, assoc_id, 0)) == NULL) {
/* No AMF context associated */
return -1;
}
/* Mark the AMF as overloaded and set the overload state according to
* the value received.
*/
amf_desc_p->state = NGAP_GNB_OVERLOAD;
amf_desc_p->overload_state =
ie->value.choice.OverloadResponse.choice.overloadAction;
#endif
//TODO
return 0;
}
......
......@@ -50,38 +50,7 @@ int ngap_gNB_handle_trace_start(uint32_t assoc_id,
uint32_t stream,
NGAP_NGAP_PDU_t *pdu)
{
#if 0
NGAP_TraceStart_t *container;
NGAP_TraceStartIEs_t *ie;
struct ngap_gNB_ue_context_s *ue_desc_p = NULL;
struct ngap_gNB_amf_data_s *amf_ref_p;
DevAssert(pdu != NULL);
container = &pdu->choice.initiatingMessage.value.choice.TraceStart;
NGAP_FIND_PROTOCOLIE_BY_ID(NGAP_TraceStartIEs_t, ie, container,
NGAP_ProtocolIE_ID_id_gNB_UE_NGAP_ID, TRUE);
amf_ref_p = ngap_gNB_get_AMF(NULL, assoc_id, 0);
DevAssert(amf_ref_p != NULL);
if (ie != NULL) {
ue_desc_p = ngap_gNB_get_ue_context(amf_ref_p->ngap_gNB_instance,
ie->value.choice.GNB_UE_NGAP_ID);
}
if (ue_desc_p == NULL) {
/* Could not find context associated with this gNB_ue_ngap_id -> generate
* trace failure indication.
*/
NGAP_E_UTRAN_Trace_ID_t trace_id;
NGAP_Cause_t cause;
memset(&trace_id, 0, sizeof(NGAP_E_UTRAN_Trace_ID_t));
memset(&cause, 0, sizeof(NGAP_Cause_t));
cause.present = NGAP_Cause_PR_radioNetwork;
cause.choice.radioNetwork = NGAP_CauseRadioNetwork_unknown_pair_ue_ngap_id;
ngap_gNB_generate_trace_failure(NULL, &trace_id, &cause);
}
#endif
//TODO
return 0;
}
......
......@@ -26,7 +26,7 @@
# ifdef OPENAIR2
#include "sctp_eNB_task.h"
#include "s1ap_eNB.h"
#include "ngap_gNB.h"
#include "nas_ue_task.h"
#include "udp_eNB_task.h"
#include "gtpv1u_eNB_task.h"
......@@ -59,7 +59,7 @@ int create_gNB_tasks(uint32_t gnb_nb)
}
if (EPC_MODE_ENABLED) {
if (AMF_MODE_ENABLED) {
if (gnb_nb > 0) {
/*if (itti_create_task (TASK_SCTP, sctp_eNB_task, NULL) < 0) {
LOG_E(SCTP, "Create task for SCTP failed\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment