From f6a4a6b99aedb6648f17154982305f6e551d8206 Mon Sep 17 00:00:00 2001
From: yilmazt <yilmazt@eurecom.fr>
Date: Thu, 23 May 2019 21:47:49 +0200
Subject: [PATCH] phy_simulators do compile, but
 dlsim&nr_(ulsch/dlsch/pbch)sims do not pass tests + Raphael's CI patch
 applied.

---
 ci-scripts/oai-ci-vm-tool                     |  4 +-
 ci-scripts/reportBuildLocally.sh              | 20 ++++---
 cmake_targets/CMakeLists.txt                  | 15 ++---
 cmake_targets/autotests/test_case_list.xml    | 30 +++++-----
 common/config/config_paramdesc.h              |  3 -
 common/utils/LOG/log.h                        |  6 ++
 executables/nr-ru.c                           |  2 +-
 openair1/PHY/NR_UE_TRANSPORT/dci_nr.c         |  6 +-
 .../NR_UE_TRANSPORT/nr_dlsch_demodulation.c   |  2 +-
 openair1/PHY/phy_extern.h                     |  2 +-
 openair1/PHY/phy_extern_nr_ue.h               |  2 +-
 openair1/PHY/phy_extern_ue.h                  |  2 +-
 openair1/PHY/phy_vars.h                       |  2 +-
 openair1/PHY/phy_vars_nr_ue.h                 |  2 +-
 openair1/PHY/phy_vars_ue.h                    |  2 +-
 .../NR_UE_PHY/unit_tests/src/pss_util_test.c  |  2 +-
 openair2/COMMON/rrc_messages_types.h          |  4 +-
 openair2/ENB_APP/RRC_paramsvalues.h           |  4 +-
 openair2/ENB_APP/enb_paramdef.h               | 12 ----
 openair2/ENB_APP/flexran_agent_defs.h         |  2 +
 openair2/GNB_APP/RRC_nr_paramsvalues.h        | 47 ++++++++-------
 openair2/GNB_APP/gnb_config.c                 | 50 +++++++++-------
 openair2/GNB_APP/gnb_paramdef.h               | 58 +++++++++----------
 openair2/LAYER2/MAC/eNB_scheduler_RA.c        |  2 +-
 openair2/NR_PHY_INTERFACE/NR_IF_Module.c      | 50 +++++++---------
 openair2/RRC/LTE/MESSAGES/asn1_msg.c          | 41 ++++---------
 openair2/RRC/LTE/rrc_vars.h                   |  2 +-
 openair2/RRC/NR/nr_rrc_extern.h               |  7 ++-
 openair2/RRC/NR/rrc_gNB.c                     |  4 --
 openair2/UTIL/OTG/otg_form.c                  |  2 +-
 openair2/UTIL/OTG/otg_kpi.c                   |  2 +-
 openair2/UTIL/OTG/otg_rx.c                    |  2 +-
 openair2/UTIL/OTG/otg_tx.c                    |  2 +-
 targets/RT/USER/nr-ru.c                       |  2 +-
 34 files changed, 186 insertions(+), 209 deletions(-)

diff --git a/ci-scripts/oai-ci-vm-tool b/ci-scripts/oai-ci-vm-tool
index 60b6d5c5f8a..e9e4ad06ae0 100755
--- a/ci-scripts/oai-ci-vm-tool
+++ b/ci-scripts/oai-ci-vm-tool
@@ -259,7 +259,7 @@ case $key in
     VM_NAME=ci-phy-sim
     ARCHIVES_LOC=phy_sim
     LOG_PATTERN=.Rel15.txt
-    NB_PATTERN_FILES=10
+    NB_PATTERN_FILES=8
     BUILD_OPTIONS="--phy_simulators"
     VM_MEMORY=8192
     RUN_OPTIONS="./run_exec_autotests.bash -g \"01510*\" -q -np -b"
@@ -372,7 +372,7 @@ case $key in
         VM_NAME=ci-phy-sim
         ARCHIVES_LOC=phy_sim
         LOG_PATTERN=.Rel15.txt
-        NB_PATTERN_FILES=10
+        NB_PATTERN_FILES=8
         BUILD_OPTIONS="--phy_simulators"
 	VM_MEMORY=8192
         RUN_OPTIONS="./run_exec_autotests.bash -g \"01510*\" -q -np -b"
diff --git a/ci-scripts/reportBuildLocally.sh b/ci-scripts/reportBuildLocally.sh
index ee1a5ca43f2..b28f8cf6e0a 100755
--- a/ci-scripts/reportBuildLocally.sh
+++ b/ci-scripts/reportBuildLocally.sh
@@ -574,26 +574,32 @@ function report_build {
     summary_table_header "OAI Build Physical simulators option" ./archives/phy_sim
     summary_table_row "DL Simulator - Release 15" ./archives/phy_sim/dlsim.Rel15.txt "Built target dlsim" ./phy_sim_row1.html
     summary_table_row "UL Simulator - Release 15" ./archives/phy_sim/ulsim.Rel15.txt "Built target ulsim" ./phy_sim_row2.html
-    summary_table_row "Coding - Release 15" ./archives/phy_sim/coding.Rel15.txt "Built target coding" ./phy_sim_row3.html
     if [ -f ./archives/phy_sim/ldpctest.Rel15.txt ]
     then
-        summary_table_row "LDPC Test - Release 15" ./archives/phy_sim/ldpctest.Rel15.txt "Built target ldpctest" ./phy_sim_row4.html
+        summary_table_row "LDPC Test - Release 15" ./archives/phy_sim/ldpctest.Rel15.txt "Built target ldpctest" ./phy_sim_row3.html
     fi
     if [ -f ./archives/phy_sim/polartest.Rel15.txt ]
     then
-        summary_table_row "Polar Test - Release 15" ./archives/phy_sim/polartest.Rel15.txt "Built target polartest" ./phy_sim_row5.html
+        summary_table_row "Polar Test - Release 15" ./archives/phy_sim/polartest.Rel15.txt "Built target polartest" ./phy_sim_row4.html
     fi
     if [ -f ./archives/phy_sim/nr_pbchsim.Rel15.txt ]
     then
-        summary_table_row "PBCH Test - Release 15" ./archives/phy_sim/nr_pbchsim.Rel15.txt "Built target nr_pbchsim" ./phy_sim_row6.html
+        summary_table_row "PBCH Test - Release 15" ./archives/phy_sim/nr_pbchsim.Rel15.txt "Built target nr_pbchsim" ./phy_sim_row5.html
     fi
     if [ -f ./archives/phy_sim/nr_dlschsim.Rel15.txt ]
     then
-        summary_table_row "DLSCH Test - Release 15" ./archives/phy_sim/nr_dlschsim.Rel15.txt "Built target nr_dlschsim" ./phy_sim_row7.html
+        summary_table_row "DLSCH Test - Release 15" ./archives/phy_sim/nr_dlschsim.Rel15.txt "Built target nr_dlschsim" ./phy_sim_row6.html
+    fi
+    if [ -f ./archives/phy_sim/smallblocktest.Rel15.txt ]
+    then
+        summary_table_row "Small Block Test - Release 15" ./archives/phy_sim/smallblocktest.Rel15.txt "Built target smallblocktest" ./phy_sim_row7.html
+    fi
+    if [ -f ./archives/phy_sim/nr_dlsim.Rel15.txt ]
+    then
+        summary_table_row "NR DL Simulator - Release 15" ./archives/phy_sim/nr_dlsim.Rel15.txt "Built target nr_dlsim" ./phy_sim_row8.html
     fi
     summary_table_footer
 
-
     if [ -f archives/gnb_usrp/nr-softmodem.Rel15.txt ]
     then
         summary_table_header "OAI Build gNB -- USRP option" ./archives/gnb_usrp
@@ -666,7 +672,7 @@ function report_build {
             cat $DETAILS_TABLE >> ./build_results.html
         done
     fi
-    if [ -f ./phy_sim_row1.html ] || [ -f ./phy_sim_row2.html ] || [ -f ./phy_sim_row3.html ]
+    if [ -f ./phy_sim_row1.html ] || [ -f ./phy_sim_row2.html ] || [ -f ./phy_sim_row3.html ] || [ -f ./phy_sim_row4.html ] || [ -f ./phy_sim_row5.html ] || [ -f ./phy_sim_row6.html ] || [ -f ./phy_sim_row7.html ] || [ -f ./phy_sim_row8.html ]
     then
         for DETAILS_TABLE in `ls ./phy_sim_row*.html`
         do
diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt
index de3f75eb5ec..9d25cd546d1 100644
--- a/cmake_targets/CMakeLists.txt
+++ b/cmake_targets/CMakeLists.txt
@@ -177,6 +177,7 @@ set(CMAKE_CXX_FLAGS
 	"${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} -std=c++11 -D${MKVER}"
 )
 
+add_definitions("-DASN_DISABLE_OER_SUPPORT")
 
 #########################
 set(CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,${CMAKE_CURRENT_BINARY_DIR}")
@@ -282,12 +283,11 @@ set(asn1_generated_dir ${OPENAIR_BIN_DIR})
 set(protoc_call "${OPENAIR_CMAKE}/tools/generate_protobuf")
 set(protobuf_generated_dir ${OPENAIR_BIN_DIR})
 
+
 # RRC
 ######
-
 add_list2_option(RRC_ASN1_VERSION "Rel15" "ASN.1 version of RRC interface" "Rel8" "Rel10" "Rel14" "CBA")
 
-
 if (${RRC_ASN1_VERSION} STREQUAL "Rel8")
   make_version(LTE_RRC_VERSION 8 6 0)
   set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1c/ASN1_files/EUTRA-RRC-Definitions-86.asn)
@@ -311,8 +311,8 @@ elseif (${RRC_ASN1_VERSION} STREQUAL "Rel14")
   make_version(LTE_RRC_VERSION 14 7 0)
   set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1c/ASN1_files/lte-rrc-14.7.0.asn1)
 elseif (${RRC_ASN1_VERSION} STREQUAL "Rel15")
-  make_version(LTE_RRC_VERSION 15 2 2)
-  set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1c/ASN1_files/lte-rrc-15.2.2.asn1)
+  make_version(LTE_RRC_VERSION 15 3 0)
+  set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1c/ASN1_files/lte-rrc-15.3.0.asn1)
 endif  (${RRC_ASN1_VERSION} STREQUAL "Rel8")
 add_definitions(-DLTE_RRC_VERSION=${LTE_RRC_VERSION})
 set (RRC_FULL_DIR ${asn1_generated_dir}/RRC_${RRC_ASN1_VERSION})
@@ -337,9 +337,9 @@ add_library(RRC_LIB ${rrc_source}
 add_dependencies(RRC_LIB rrc_flag)
 include_directories ("${RRC_FULL_DIR}")
 
+
 #NR RRC
 #######
-
 add_list2_option(NR_RRC_ASN1_VERSION "NR_Rel15" "ASN.1 version of NR_RRC interface")
 
 if (${NR_RRC_ASN1_VERSION} STREQUAL "NR_Rel15")
@@ -2823,6 +2823,7 @@ if (${T_TRACER})
         dlsim_tm4 nr_dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim
         pdcchsim pucchsim prachsim syncsim ulsim ldpctest polartest
         cu_test du_test
+        
         #all "add_library" definitions
         ITTI RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB F1AP_LIB
         F1AP params_libconfig oai_exmimodevif oai_usrpdevif oai_bladerfdevif
@@ -2965,7 +2966,3 @@ ADD_CUSTOM_TARGET(oarf
 )
 
 include (${OPENAIR_DIR}/common/utils/telnetsrv/telnetsrv_CMakeLists.txt)
-
-
-
-
diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml
index d44a37ed178..6719a53ec02 100644
--- a/cmake_targets/autotests/test_case_list.xml
+++ b/cmake_targets/autotests/test_case_list.xml
@@ -1019,14 +1019,14 @@
       <main_exec> $OPENAIR_DIR/targets/bin/ldpctest.Rel15</main_exec>
       <main_exec_args>-l3872 -s10 -n100
                       -l4224 -s10 -n100
-		      -l4576 -s10 -n100
-		      -l4928 -s10 -n100
-		      -l5280 -s10 -n100
-		      -l5632 -s10 -n100
-		      -l6336 -s10 -n100
-		      -l7040 -s10 -n100
-		      -l7744 -s10 -n100
-		      -l8448 -s10 -n100</main_exec_args>
+		              -l4576 -s10 -n100
+	        	      -l4928 -s10 -n100
+	        	      -l5280 -s10 -n100
+	        	      -l5632 -s10 -n100
+	        	      -l6336 -s10 -n100
+	        	      -l7040 -s10 -n100
+	        	      -l7744 -s10 -n100
+	        	      -l8448 -s10 -n100</main_exec_args>
       <tags>ldpctest.test1 ldpctest.test2 ldpctest.test3 ldpctest.test4 ldpctest.test5 ldpctest.test6 ldpctest.test7 ldpctest.test8 ldpctest.test9 ldpctest.test10</tags>
       <search_expr_true>BLER 0.000000</search_expr_true>
       <search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
@@ -1067,9 +1067,9 @@
       <main_exec> $OPENAIR_DIR/targets/bin/nr_pbchsim.Rel15</main_exec>
       <main_exec_args>-s0 -S1 -n1000 -R106
                       -s0 -S1 -n10 -I -R106
-		      -s0 -S1 -n1000 -R217
+		              -s0 -S1 -n1000 -R217
                       -s0 -S1 -n10 -I -R217
-		      -s0 -S1 -n1000 -R273
+		              -s0 -S1 -n1000 -R273
                       -s0 -S1 -n10 -I -R273</main_exec_args>
       <tags>nr_pbchsim.test1 nr_pbchsim.test2 nr_pbchsim.test3 nr_pbchsim.test4 nr_pbchsim.test5 nr_pbchsim.test6</tags>
       <search_expr_true>PBCH test OK</search_expr_true>
@@ -1089,8 +1089,8 @@
       <pre_exec_args></pre_exec_args>
       <main_exec> $OPENAIR_DIR/targets/bin/nr_dlsim.Rel15</main_exec>
       <main_exec_args>-n100 -R106
-		      -n100 -R217
-		      -n100 -R273</main_exec_args>
+		              -n100 -R217
+		              -n100 -R273</main_exec_args>
       <tags>nr_dlsim.test1 nr_dlsim.test2 nr_dlsim.test3</tags>
       <search_expr_true>PDCCH test OK</search_expr_true>
       <search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
@@ -1130,9 +1130,9 @@
       <pre_exec_args></pre_exec_args>
       <main_exec> $OPENAIR_DIR/targets/bin/smallblocktest.Rel15</main_exec>
       <main_exec_args>-l 3 -s -4 -d 1 -i 10000
-      -l 6 -s -4 -d 1 -i 10000
-      -l 7 -s -4 -d 1 -i 10000
-      -l 11 -s -4 -d 1 -i 10000</main_exec_args>
+                      -l 6 -s -4 -d 1 -i 10000
+                      -l 7 -s -4 -d 1 -i 10000
+                      -l 11 -s -4 -d 1 -i 10000</main_exec_args>
       <tags>smallblocktest.test1 smallblocktest.test2 smallblocktest.test3 smallblocktest.test4</tags>
       <search_expr_true>BLER= 0.000000</search_expr_true>
       <search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
diff --git a/common/config/config_paramdesc.h b/common/config/config_paramdesc.h
index 627c232f85f..e0fa39c0c77 100644
--- a/common/config/config_paramdesc.h
+++ b/common/config/config_paramdesc.h
@@ -34,9 +34,6 @@
 #define INCLUDE_CONFIG_PARAMDESC_H
 
 
-
-
-
 #define MAX_OPTNAME_SIZE 64
 #define CONFIG_MAXOPTLENGTH 512 /* max full option length, full option name exemple: (prefix1.[<index>].prefix2.optname */
 
diff --git a/common/utils/LOG/log.h b/common/utils/LOG/log.h
index 4d87d40320f..abb9d0b2000 100644
--- a/common/utils/LOG/log.h
+++ b/common/utils/LOG/log.h
@@ -183,6 +183,7 @@ typedef enum {
   MIN_LOG_COMPONENTS = 0,
   PHY = MIN_LOG_COMPONENTS,
   MAC,
+  EMU,
   SIM,
   OCG,
   OMG,
@@ -199,6 +200,7 @@ typedef enum {
   NAS,
   PERF,
   OIP,
+  CLI,
   MSC,
   OCM,
   UDP_,
@@ -219,6 +221,10 @@ typedef enum {
   PROTO_AGENT,
   F1U,
   X2AP,
+  GNB_APP,
+  NR_RRC,
+  NR_MAC,
+  NR_PHY,
   LOADER,
   ASN,
   NFAPI_VNF,
diff --git a/executables/nr-ru.c b/executables/nr-ru.c
index e6e62ad5532..442f40662c9 100644
--- a/executables/nr-ru.c
+++ b/executables/nr-ru.c
@@ -2146,7 +2146,7 @@ void stop_RU(int nb_ru) {
 void RCconfig_RU(void) {
   int               j                             = 0;
   int               i                             = 0;
-  paramdef_t RUParams[] = RUPARAMS_DESC;
+  paramdef_t RUParams[] = GNBRUPARAMS_DESC;
   paramlist_def_t RUParamList = {CONFIG_STRING_RU_LIST,NULL,0};
   config_getlist( &RUParamList,RUParams,sizeof(RUParams)/sizeof(paramdef_t), NULL);
 
diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c
index 9b309983b19..b91a2a5bc41 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c
@@ -335,8 +335,10 @@ void nr_pdcch_extract_rbs_single(int32_t **rxdataF,
 #ifdef NR_PDCCH_DCI_DEBUG
   int nushiftmod3 = frame_parms->nushift % 3;
 #endif
-  uint8_t symbol_mod;
-  symbol_mod = (symbol >= (7 - frame_parms->Ncp)) ? symbol - (7 - frame_parms->Ncp) : symbol;
+
+#if defined(DEBUG_DCI_DECODING) || defined(NR_PDCCH_DCI_DEBUG)
+  uint8_t symbol_mod = (symbol >= (7 - frame_parms->Ncp)) ? symbol - (7 - frame_parms->Ncp) : symbol;
+#endif
   c_rb = n_BWP_start; // c_rb is the common resource block: RB within the BWP
 #ifdef DEBUG_DCI_DECODING
   LOG_I(PHY, "extract_rbs_single: symbol_mod %d\n",symbol_mod);
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
index 4bdc30540d7..d0e383feb36 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
@@ -2172,7 +2172,7 @@ void nr_dlsch_detection_mrc_core(int **rxdataF_comp,
   __m128i *dl_ch_mag128_0, *dl_ch_mag128_1, *dl_ch_mag128_2, *dl_ch_mag128_3;
   __m128i *dl_ch_mag128_0b, *dl_ch_mag128_1b,  *dl_ch_mag128_2b,  *dl_ch_mag128_3b;
   __m128i *rho128_0, *rho128_1, *rho128_2=NULL, *rho128_3=NULL;
-  __m128i *rho128_i0, *rho128_i1, *rho128_i2, *rho128_i3;
+  __m128i *rho128_i0, *rho128_i1, *rho128_i2=NULL, *rho128_i3=NULL;
   int length_mod4 = 0;
   int length2;
 
diff --git a/openair1/PHY/phy_extern.h b/openair1/PHY/phy_extern.h
index 9baf8bf21d6..e20d17db7a2 100644
--- a/openair1/PHY/phy_extern.h
+++ b/openair1/PHY/phy_extern.h
@@ -67,7 +67,7 @@ extern unsigned char NB_RU;
 
 #ifndef OPENAIR2
 extern unsigned char NB_eNB_INST;
-extern unsigned char NB_UE_INST;
+extern uint16_t NB_UE_INST;
 extern unsigned char NB_RN_INST;
 #endif
 
diff --git a/openair1/PHY/phy_extern_nr_ue.h b/openair1/PHY/phy_extern_nr_ue.h
index 70fbd21ffa8..ead709b886f 100644
--- a/openair1/PHY/phy_extern_nr_ue.h
+++ b/openair1/PHY/phy_extern_nr_ue.h
@@ -62,7 +62,7 @@ extern unsigned char NB_RU;
 
 #ifndef OPENAIR2
 extern unsigned char NB_eNB_INST;
-extern unsigned char NB_UE_INST;
+extern uint16_t NB_UE_INST;
 extern unsigned char NB_RN_INST;
 #endif
 
diff --git a/openair1/PHY/phy_extern_ue.h b/openair1/PHY/phy_extern_ue.h
index 6fd53ac15ca..490d7b578f6 100644
--- a/openair1/PHY/phy_extern_ue.h
+++ b/openair1/PHY/phy_extern_ue.h
@@ -62,7 +62,7 @@ extern char mode_string[4][20];
 
 #ifndef OPENAIR2
 extern unsigned char NB_eNB_INST;
-extern unsigned char NB_UE_INST;
+extern uint16_t NB_UE_INST;
 extern unsigned char NB_RN_INST;
 #endif
 
diff --git a/openair1/PHY/phy_vars.h b/openair1/PHY/phy_vars.h
index 4cf029e968c..1ae23e28b1c 100644
--- a/openair1/PHY/phy_vars.h
+++ b/openair1/PHY/phy_vars.h
@@ -60,7 +60,7 @@ unsigned char NB_RU=0;
 
 #ifndef OPENAIR2
 unsigned char NB_eNB_INST=0;
-unsigned char NB_UE_INST=0;
+uint16_t NB_UE_INST=0;
 unsigned char NB_RN_INST=0;
 unsigned char NB_INST=0;
 #endif
diff --git a/openair1/PHY/phy_vars_nr_ue.h b/openair1/PHY/phy_vars_nr_ue.h
index 77163c0bc0a..46260cf3061 100644
--- a/openair1/PHY/phy_vars_nr_ue.h
+++ b/openair1/PHY/phy_vars_nr_ue.h
@@ -59,7 +59,7 @@ unsigned char NB_RU=0;
 
 #ifndef OPENAIR2
 unsigned char NB_eNB_INST=0;
-unsigned char NB_UE_INST=0;
+uint16_t NB_UE_INST=0;
 unsigned char NB_RN_INST=0;
 unsigned char NB_INST=0;
 #endif
diff --git a/openair1/PHY/phy_vars_ue.h b/openair1/PHY/phy_vars_ue.h
index 1021253ba16..ccce93c41fe 100644
--- a/openair1/PHY/phy_vars_ue.h
+++ b/openair1/PHY/phy_vars_ue.h
@@ -52,7 +52,7 @@ short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};
 
 #ifndef OPENAIR2
   unsigned char NB_eNB_INST=0;
-  unsigned char NB_UE_INST=0;
+  uint16_t NB_UE_INST=0;
   unsigned char NB_RN_INST=0;
   unsigned char NB_INST=0;
 #endif
diff --git a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pss_util_test.c b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pss_util_test.c
index 9a4df025c73..3d5d483be88 100644
--- a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pss_util_test.c
+++ b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pss_util_test.c
@@ -254,7 +254,7 @@ int init_test(unsigned char N_tx, unsigned char N_rx, unsigned char transmission
   }
 
   /* dummy initialisation of global structure PHY_vars_UE_g */
-  unsigned char NB_UE_INST=1;
+  uint16_t NB_UE_INST=1;
   PHY_vars_UE_g = (PHY_VARS_NR_UE ** *)calloc( NB_UE_INST, sizeof(PHY_VARS_NR_UE **));
 
   for (int UE_id=0; UE_id<NB_UE_INST; UE_id++) {
diff --git a/openair2/COMMON/rrc_messages_types.h b/openair2/COMMON/rrc_messages_types.h
index b7533373de7..6fd10edf04a 100644
--- a/openair2/COMMON/rrc_messages_types.h
+++ b/openair2/COMMON/rrc_messages_types.h
@@ -40,7 +40,7 @@
 #include "LTE_SL-CP-Len-r12.h"
 #include "LTE_SL-PeriodComm-r12.h"
 #include "LTE_SL-DiscResourcePool-r12.h"
-
+#include "NR_RACH-ConfigCommon.h"
 
 //-------------------------------------------------------------------------------------------//
 // Messages for RRC logging
@@ -484,7 +484,7 @@ typedef struct NRRrcConfigurationReq_s {
   uint32_t                rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_sixteen[MAX_NUM_CCs];
   BOOLEAN_t               rach_groupBconfigured[MAX_NUM_CCs];
   long                    rach_ra_Msg3SizeGroupA[MAX_NUM_CCs];
-  long                    rach_messagePowerOffsetGroupB[MAX_NUM_CCs];
+  e_NR_RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB                    rach_messagePowerOffsetGroupB[MAX_NUM_CCs];
   long                    rach_numberOfRA_PreamblesGroupA[MAX_NUM_CCs];
   long                    rach_ra_ContentionResolutionTimer[MAX_NUM_CCs];
   long                    rsrp_ThresholdSSB[MAX_NUM_CCs];
diff --git a/openair2/ENB_APP/RRC_paramsvalues.h b/openair2/ENB_APP/RRC_paramsvalues.h
index ea559ff74b8..3aeee1417e5 100644
--- a/openair2/ENB_APP/RRC_paramsvalues.h
+++ b/openair2/ENB_APP/RRC_paramsvalues.h
@@ -81,9 +81,9 @@
 #define UETT310(A)                                              LTE_UE_TimersAndConstants__t310_ ## A
 #define UETIMER_T310_MODVALUES                                  { UETT310(ms0), UETT310(ms50),UETT310(ms100),UETT310(ms200),UETT310(ms500),UETT310(ms1000),UETT310(ms2000)}
 
-#define UETIMER_T311_OKVALUES                                   {1000,3110,5000,10000,15000,20000,31100}
+#define UETIMER_T311_OKVALUES                                   {1000,3000,5000,10000,15000,20000,30000}
 #define UETT311(A)                                              LTE_UE_TimersAndConstants__t311_ ## A
-#define UETIMER_T311_MODVALUES                                  { UETT311(ms1000), UETT311(ms3000),UETT311(ms5000),UETT311(ms10000),UETT311(ms15000),UETT311(ms20000),UETT311(ms30000)}
+#define UETIMER_T311_MODVALUES                                  { UETT311(ms1000), UETT311(ms3000), UETT311(ms5000), UETT311(ms10000), UETT311(ms15000), UETT311(ms20000), UETT311(ms30000)}
 
 #define UETIMER_N310_OKVALUES                                   {1,2,3,4,6,8,10,20}
 #define UETN310(A)                                              LTE_UE_TimersAndConstants__n310_ ## A
diff --git a/openair2/ENB_APP/enb_paramdef.h b/openair2/ENB_APP/enb_paramdef.h
index dff16ff9d77..7998f455dd4 100644
--- a/openair2/ENB_APP/enb_paramdef.h
+++ b/openair2/ENB_APP/enb_paramdef.h
@@ -35,28 +35,16 @@
 #include "common/config/config_paramdesc.h"
 #include "RRC_paramsvalues.h"
 
-
-
 #define ENB_CONFIG_STRING_CC_NODE_FUNCTION                              "node_function"
 #define ENB_CONFIG_STRING_CC_NODE_TIMING                                "node_timing"   
 #define ENB_CONFIG_STRING_CC_NODE_SYNCH_REF                             "node_synch_ref"   
 
-
 // OTG config per ENB-UE DL
 #define ENB_CONF_STRING_OTG_CONFIG                         "otg_config"
 #define ENB_CONF_STRING_OTG_UE_ID                          "ue_id"
 #define ENB_CONF_STRING_OTG_APP_TYPE                       "app_type"
 #define ENB_CONF_STRING_OTG_BG_TRAFFIC                     "bg_traffic"
 
-
-
-
-
-
-
-
-
-
 #ifdef LIBCONFIG_LONG
 #define libconfig_int long
 #else
diff --git a/openair2/ENB_APP/flexran_agent_defs.h b/openair2/ENB_APP/flexran_agent_defs.h
index b97e56092da..706688286d7 100644
--- a/openair2/ENB_APP/flexran_agent_defs.h
+++ b/openair2/ENB_APP/flexran_agent_defs.h
@@ -162,6 +162,8 @@ typedef struct {
   char    *cache_name;
 
   mid_t    mod_id;
+  uint64_t agent_id;
+  uint16_t capability_mask;
 
   /* lock for waiting before starting or soft-restart */
   pthread_cond_t      cond_node_ctrl;
diff --git a/openair2/GNB_APP/RRC_nr_paramsvalues.h b/openair2/GNB_APP/RRC_nr_paramsvalues.h
index ca7c659355a..687851116cf 100644
--- a/openair2/GNB_APP/RRC_nr_paramsvalues.h
+++ b/openair2/GNB_APP/RRC_nr_paramsvalues.h
@@ -21,14 +21,15 @@
 
 /*! \file openair2/GNB_APP/RRC_nr_paramsvalues.h
  * \brief macro definitions for RRC authorized and asn1 parameters values, to be used in paramdef_t/chechedparam_t structure initializations 
- * \author Francois TABURET, WEI-TAI CHEN
+ * \author Francois TABURET, WEI-TAI CHEN, Turker Yilmaz
  * \date 2018
  * \version 0.1
- * \company NOKIA BellLabs France, NTUST
- * \email: francois.taburet@nokia-bell-labs.com, kroempa@gmail.com
+ * \company NOKIA BellLabs France, NTUST, EURECOM
+ * \email: francois.taburet@nokia-bell-labs.com, kroempa@gmail.com, turker.yilmaz@eurecom.fr
  * \note
  * \warning
  */
+
 #ifndef __NR_RRC_PARAMSVALUES__H__
 #define __NR_RRC_PARAMSVALUES__H__
 /*    cell configuration section name */
@@ -62,28 +63,32 @@
 
 #define NRBDL_OKVALUES                                          {6,15,25,50,75,100}
 
-#define UETIMER_T300_OKVALUES                                   {100,200,300,400,600,1000,1500,2000}
-#define UETT300(A)                                              UE_TimersAndConstants__t300_ ## A
-#define UETIMER_T300_MODVALUES                                  { UETT300(ms100), UETT300(ms200),UETT300(ms300),UETT300(ms400),UETT300(ms600),UETT300(ms1000),UETT300(ms1500),UETT300(ms2000)}              
+#define NRUETIMER_T300_OKVALUES                                 {100,200,300,400,600,1000,1500,2000}
+#define NRUETT300(A)                                            NR_UE_TimersAndConstants__t300_ ## A
+#define NRUETIMER_T300_MODVALUES                                { NRUETT300(ms100), NRUETT300(ms200), NRUETT300(ms300), NRUETT300(ms400), NRUETT300(ms600), NRUETT300(ms1000), NRUETT300(ms1500), NRUETT300(ms2000)}
+
+#define NRUETIMER_T301_OKVALUES                                 {100,200,300,400,600,1000,1500,2000}
+#define NRUETT301(A)                                            NR_UE_TimersAndConstants__t301_ ## A
+#define NRUETIMER_T301_MODVALUES                                { NRUETT301(ms100), NRUETT301(ms200), NRUETT301(ms300), NRUETT301(ms400), NRUETT301(ms600), NRUETT301(ms1000), NRUETT301(ms1500), NRUETT301(ms2000)}
 
-#define UETIMER_T301_OKVALUES                                   {100,200,300,400,600,1000,1500,2000}
-#define UETT301(A)                                              UE_TimersAndConstants__t301_ ## A
-#define UETIMER_T301_MODVALUES                                  { UETT301(ms100), UETT301(ms200),UETT301(ms300),UETT301(ms400),UETT301(ms600),UETT301(ms1000),UETT301(ms1500),UETT301(ms2000)}
+#define NRUETIMER_T310_OKVALUES                                 {0,50,100,200,500,1000,2000}
+#define NRUETT310(A)                                            NR_UE_TimersAndConstants__t310_ ## A
+#define NRUETIMER_T310_MODVALUES                                { NRUETT310(ms0), NRUETT310(ms50), NRUETT310(ms100), NRUETT310(ms200), NRUETT310(ms500), NRUETT310(ms1000), NRUETT310(ms2000)}
 
-#define UETIMER_T310_OKVALUES                                   {0,50,100,200,500,1000,2000}
-#define UETT310(A)                                              UE_TimersAndConstants__t310_ ## A
-#define UETIMER_T310_MODVALUES                                  { UETT310(ms0), UETT310(ms50),UETT310(ms100),UETT310(ms200),UETT310(ms500),UETT310(ms1000),UETT310(ms2000)}
+#define NRUETIMER_T311_OKVALUES                                 {1000,3000,5000,10000,15000,20000,30000}
+#define NRUETT311(A)                                            NR_UE_TimersAndConstants__t311_ ## A
+#define NRUETIMER_T311_MODVALUES                                { NRUETT311(ms1000), NRUETT311(ms3000), NRUETT311(ms5000), NRUETT311(ms10000), NRUETT311(ms15000), NRUETT311(ms20000), NRUETT311(ms30000)}
 
-#define UETIMER_T311_OKVALUES                                   {1000,3110,5000,10000,15000,20000,31100}
-#define UETT311(A)                                              UE_TimersAndConstants__t311_ ## A
-#define UETIMER_T311_MODVALUES                                  { UETT311(ms1000), UETT311(ms3000),UETT311(ms5000),UETT311(ms10000),UETT311(ms15000),UETT311(ms20000),UETT311(ms30000)}
+#define NRUETIMER_T319_OKVALUES                                 {100,200,300,400,600,1000,1500,2000}
+#define NRUETT319(A)                                            NR_UE_TimersAndConstants__t319_ ## A
+#define NRUETIMER_T319_MODVALUES                                { NRUETT319(ms100), NRUETT319(ms200), NRUETT319(ms300), NRUETT319(ms400), NRUETT319(ms600), NRUETT319(ms1000), NRUETT319(ms1500), NRUETT319(ms2000}
 
-#define UETIMER_N310_OKVALUES                                   {1,2,3,4,6,8,10,20}
-#define UETN310(A)                                              UE_TimersAndConstants__n310_ ## A
-#define UETIMER_N310_MODVALUES                                  { UETN310(n1), UETN310(n2),UETN310(n3),UETN310(n4),UETN310(n6),UETN310(n8),UETN310(n10),UETN310(n20)}
+#define NRUETIMER_N310_OKVALUES                                 {1,2,3,4,6,8,10,20}
+#define NRUETN310(A)                                            NR_UE_TimersAndConstants__n310_ ## A
+#define NRUETIMER_N310_MODVALUES                                { NRUETN310(n1), NRUETN310(n2), NRUETN310(n3), NRUETN310(n4), NRUETN310(n6), NRUETN310(n8), NRUETN310(n10), NRUETN310(n20)}
 
-#define UETIMER_N311_OKVALUES                                   {1,2,3,4,5,6,8,10}
-#define UETN311(A)                                              UE_TimersAndConstants__n311_ ## A
-#define UETIMER_N311_MODVALUES                                  { UETN311(n1), UETN311(n2),UETN311(n3),UETN311(n4),UETN311(n5),UETN311(n6),UETN311(n8),UETN311(n10)}
+#define NRUETIMER_N311_OKVALUES                                 {1,2,3,4,5,6,8,10}
+#define NRUETN311(A)                                            NR_UE_TimersAndConstants__n311_ ## A
+#define NRUETIMER_N311_MODVALUES                                { NRUETN311(n1), NRUETN311(n2), NRUETN311(n3), NRUETN311(n4), NRUETN311(n5), NRUETN311(n6), NRUETN311(n8), NRUETN311(n10)}
 
 #endif
diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c
index ab36765445f..4c30ef91407 100644
--- a/openair2/GNB_APP/gnb_config.c
+++ b/openair2/GNB_APP/gnb_config.c
@@ -249,12 +249,20 @@ void RCconfig_nr_flexran()
     RC.flexran[i]->mod_id   = i;
     RC.flexran[i]->agent_id = (((uint64_t)i) << 48) | (((uint64_t)gnb_id) << 16) | ((uint64_t)Nid_cell_tr);
 
-    /* assume for the moment the monolithic case, i.e. agent can provide
-     * information for all layers */
-    RC.flexran[i]->capability_mask = FLEXRAN_CAP_LOPHY | FLEXRAN_CAP_HIPHY
-                                   | FLEXRAN_CAP_LOMAC | FLEXRAN_CAP_HIMAC
-                                   | FLEXRAN_CAP_RLC   | FLEXRAN_CAP_PDCP
-                                   | FLEXRAN_CAP_SDAP  | FLEXRAN_CAP_RRC;
+    /*
+     * Assume for the moment the monolithic case, i.e. agent can provide information for all layers
+     * Consider using uint16_t flexran_get_capabilities_mask(mid_t mod_id),
+     *                    with RC.rrc[mod_id]->node_type = ngran_gNB
+     */
+    RC.flexran[i]->capability_mask = (1 << PROTOCOL__FLEX_BS_CAPABILITY__LOPHY)
+    		                       | (1 << PROTOCOL__FLEX_BS_CAPABILITY__HIPHY)
+								   | (1 << PROTOCOL__FLEX_BS_CAPABILITY__LOMAC)
+								   | (1 << PROTOCOL__FLEX_BS_CAPABILITY__HIMAC)
+								   | (1 << PROTOCOL__FLEX_BS_CAPABILITY__RLC)
+								   | (1 << PROTOCOL__FLEX_BS_CAPABILITY__PDCP)
+								   | (1 << PROTOCOL__FLEX_BS_CAPABILITY__SDAP)
+								   | (1 << PROTOCOL__FLEX_BS_CAPABILITY__RRC);
+
   }
 }
 
@@ -634,7 +642,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
   paramdef_t CCsParams[] = NRCCPARAMS_DESC;
   paramlist_def_t CCsParamList = {GNB_CONFIG_STRING_COMPONENT_CARRIERS,NULL,0};
   
-  //paramdef_t SRB1Params[] = SRB1PARAMS_DESC;
+  //paramdef_t SRB1Params[] = GNBSRB1PARAMS_DESC;
 
   /* get global parameters, defined outside any section in the config file */
  
@@ -701,7 +709,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
         char gnbpath[MAX_OPTNAME_SIZE + 8];
         sprintf(gnbpath,"%s.[%i]",GNB_CONFIG_STRING_GNB_LIST,k);
 
-        paramdef_t PLMNParams[] = PLMNPARAMS_DESC;
+        paramdef_t PLMNParams[] = GNBPLMNPARAMS_DESC;
         paramlist_def_t PLMNParamList = {GNB_CONFIG_STRING_PLMN_LIST, NULL, 0};
         /* map parameter checking array instances to parameter definition array instances */
         checkedparam_t config_check_PLMNParams [] = PLMNPARAMS_CHECK;
@@ -1617,21 +1625,21 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
               }// End switch (rach_ra_Msg3SizeGroupA)
 
               if (strcmp(rach_messagePowerOffsetGroupB,"minusinfinity")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = NR_RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB_minusinfinity;
+                NRRRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = NR_RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB_minusinfinity;
               }else if (strcmp(rach_messagePowerOffsetGroupB,"dB0")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = NR_RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB_dB0;
+                NRRRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = NR_RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB_dB0;
               }else if (strcmp(rach_messagePowerOffsetGroupB,"dB5")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = NR_RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB_dB5;
+                NRRRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = NR_RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB_dB5;
               }else if (strcmp(rach_messagePowerOffsetGroupB,"dB8")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = NR_RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB_dB8;
+                NRRRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = NR_RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB_dB8;
               }else if (strcmp(rach_messagePowerOffsetGroupB,"dB10")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = NR_RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB_dB10;
+                NRRRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = NR_RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB_dB10;
               }else if (strcmp(rach_messagePowerOffsetGroupB,"dB12")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = NR_RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB_dB12;
+                NRRRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = NR_RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB_dB12;
               }else if (strcmp(rach_messagePowerOffsetGroupB,"dB15")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = NR_RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB_dB15;
+                NRRRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = NR_RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB_dB15;
               }else if (strcmp(rach_messagePowerOffsetGroupB,"dB18")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = NR_RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB_dB18;
+                NRRRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = NR_RACH_ConfigCommon__groupBconfigured__messagePowerOffsetGroupB_dB18;
               }else{
                 AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for rach_messagePowerOffsetGroupB choice: minusinfinity,dB0,dB5,dB8,dB10,dB12,dB15,dB18!\n",
                              RC.config_file_name, i, rach_messagePowerOffsetGroupB);
@@ -2740,7 +2748,7 @@ int RCconfig_nr_gtpu(void ) {
 
   paramdef_t GNBSParams[] = GNBSPARAMS_DESC;
   
-  paramdef_t GTPUParams[]  = GTPUPARAMS_DESC;
+  paramdef_t GTPUParams[]  = GNBGTPUPARAMS_DESC;
   LOG_I(GTPU,"Configuring GTPu\n");
 
 /* get number of active eNodeBs */
@@ -2845,7 +2853,7 @@ int RCconfig_NR_S1(MessageDef *msg_p, uint32_t i) {
 	// search if in active list
 	for (j=0; j < GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt; j++) {
 	  if (strcmp(GNBSParams[GNB_ACTIVE_GNBS_IDX].strlistptr[j], *(GNBParamList.paramarray[k][GNB_GNB_NAME_IDX].strptr)) == 0) {
-            paramdef_t PLMNParams[] = PLMNPARAMS_DESC;
+            paramdef_t PLMNParams[] = GNBPLMNPARAMS_DESC;
             paramlist_def_t PLMNParamList = {GNB_CONFIG_STRING_PLMN_LIST, NULL, 0};
             /* map parameter checking array instances to parameter definition array instances */
             checkedparam_t config_check_PLMNParams [] = PLMNPARAMS_CHECK;
@@ -2853,11 +2861,11 @@ int RCconfig_NR_S1(MessageDef *msg_p, uint32_t i) {
             for (int I = 0; I < sizeof(PLMNParams) / sizeof(paramdef_t); ++I)
               PLMNParams[I].chkPptr = &(config_check_PLMNParams[I]);
 
-	    paramdef_t S1Params[]  = S1PARAMS_DESC;
+	    paramdef_t S1Params[]  = GNBS1PARAMS_DESC;
 	    paramlist_def_t S1ParamList = {GNB_CONFIG_STRING_MME_IP_ADDRESS,NULL,0};
 	    
-	    paramdef_t SCTPParams[]  = SCTPPARAMS_DESC;
-	    paramdef_t NETParams[]  =  NETPARAMS_DESC;
+	    paramdef_t SCTPParams[]  = GNBSCTPPARAMS_DESC;
+	    paramdef_t NETParams[]  =  GNBNETPARAMS_DESC;
 	    char aprefix[MAX_OPTNAME_SIZE*2 + 8];
 	    
 	    S1AP_REGISTER_ENB_REQ (msg_p).eNB_id = gnb_id;
diff --git a/openair2/GNB_APP/gnb_paramdef.h b/openair2/GNB_APP/gnb_paramdef.h
index 6ac5bfc42d4..f0e209e5aa1 100644
--- a/openair2/GNB_APP/gnb_paramdef.h
+++ b/openair2/GNB_APP/gnb_paramdef.h
@@ -57,12 +57,12 @@ extern int asn1_xer_print;
 #endif
 
 typedef enum {
-  RU     = 0,
-  L1     = 1,
-  L2     = 2,
-  L3     = 3,
-  S1     = 4,
-  lastel = 5
+	NRRU     = 0,
+	NRL1     = 1,
+	NRL2     = 2,
+	NRL3     = 3,
+	NRS1     = 4,
+	NRlastel = 5
 } NRRC_config_functions_t;
 
 #define CONFIG_STRING_ACTIVE_RUS                  "Active_RUs"
@@ -119,25 +119,25 @@ typedef enum {
 /*                                            RU configuration parameters                                                                  */
 /*   optname                                   helpstr   paramflags    XXXptr        defXXXval                   type           numelt     */
 /*-----------------------------------------------------------------------------------------------------------------------------------------*/
-#define RUPARAMS_DESC { \
-{CONFIG_STRING_RU_LOCAL_IF_NAME,            	 NULL,       0,       strptr:NULL,     defstrval:"lo",  	TYPE_STRING,	  0}, \
-{CONFIG_STRING_RU_LOCAL_ADDRESS,            	 NULL,       0,       strptr:NULL,     defstrval:"127.0.0.2",	TYPE_STRING,	  0}, \
-{CONFIG_STRING_RU_REMOTE_ADDRESS,           	 NULL,       0,       strptr:NULL,     defstrval:"127.0.0.1",	TYPE_STRING,	  0}, \
-{CONFIG_STRING_RU_LOCAL_PORTC,              	 NULL,       0,       uptr:NULL,       defuintval:50000,	TYPE_UINT,	  0}, \
-{CONFIG_STRING_RU_REMOTE_PORTC,             	 NULL,       0,       uptr:NULL,       defuintval:50000,	TYPE_UINT,	  0}, \
-{CONFIG_STRING_RU_LOCAL_PORTD,              	 NULL,       0,       uptr:NULL,       defuintval:50001,	TYPE_UINT,	  0}, \
-{CONFIG_STRING_RU_REMOTE_PORTD,             	 NULL,       0,       uptr:NULL,       defuintval:50001,	TYPE_UINT,	  0}, \
-{CONFIG_STRING_RU_TRANSPORT_PREFERENCE,     	 NULL,       0,       strptr:NULL,     defstrval:"udp_if5",	TYPE_STRING,	  0}, \
-{CONFIG_STRING_RU_LOCAL_RF,                 	 NULL,       0,       strptr:NULL,     defstrval:"yes", 	TYPE_STRING,	  0}, \
-{CONFIG_STRING_RU_NB_TX,                    	 NULL,       0,       uptr:NULL,       defuintval:1,		TYPE_UINT,	  0}, \
-{CONFIG_STRING_RU_NB_RX,                    	 NULL,       0,       uptr:NULL,       defuintval:1,		TYPE_UINT,	  0}, \
-{CONFIG_STRING_RU_MAX_RS_EPRE,              	 NULL,       0,       iptr:NULL,       defintval:-29,		TYPE_INT,	  0}, \
-{CONFIG_STRING_RU_MAX_RXGAIN,               	 NULL,       0,       iptr:NULL,       defintval:120,		TYPE_INT,	  0}, \
+#define GNBRUPARAMS_DESC { \
+{CONFIG_STRING_RU_LOCAL_IF_NAME,            	 NULL,       0,       strptr:NULL,     defstrval:"lo",  	    TYPE_STRING,      0}, \
+{CONFIG_STRING_RU_LOCAL_ADDRESS,            	 NULL,       0,       strptr:NULL,     defstrval:"127.0.0.2",	TYPE_STRING,      0}, \
+{CONFIG_STRING_RU_REMOTE_ADDRESS,           	 NULL,       0,       strptr:NULL,     defstrval:"127.0.0.1",	TYPE_STRING,      0}, \
+{CONFIG_STRING_RU_LOCAL_PORTC,              	 NULL,       0,       uptr:NULL,       defuintval:50000,        TYPE_UINT,        0}, \
+{CONFIG_STRING_RU_REMOTE_PORTC,             	 NULL,       0,       uptr:NULL,       defuintval:50000,        TYPE_UINT,        0}, \
+{CONFIG_STRING_RU_LOCAL_PORTD,              	 NULL,       0,       uptr:NULL,       defuintval:50001,        TYPE_UINT,        0}, \
+{CONFIG_STRING_RU_REMOTE_PORTD,             	 NULL,       0,       uptr:NULL,       defuintval:50001,        TYPE_UINT,        0}, \
+{CONFIG_STRING_RU_TRANSPORT_PREFERENCE,     	 NULL,       0,       strptr:NULL,     defstrval:"udp_if5",     TYPE_STRING,	  0}, \
+{CONFIG_STRING_RU_LOCAL_RF,                 	 NULL,       0,       strptr:NULL,     defstrval:"yes",         TYPE_STRING,	  0}, \
+{CONFIG_STRING_RU_NB_TX,                    	 NULL,       0,       uptr:NULL,       defuintval:1,            TYPE_UINT,        0}, \
+{CONFIG_STRING_RU_NB_RX,                    	 NULL,       0,       uptr:NULL,       defuintval:1,            TYPE_UINT,        0}, \
+{CONFIG_STRING_RU_MAX_RS_EPRE,              	 NULL,       0,       iptr:NULL,       defintval:-29,           TYPE_INT,	      0}, \
+{CONFIG_STRING_RU_MAX_RXGAIN,               	 NULL,       0,       iptr:NULL,       defintval:120,           TYPE_INT,	      0}, \
 {CONFIG_STRING_RU_BAND_LIST,                	 NULL,       0,       uptr:NULL,       defintarrayval:DEFBANDS, TYPE_INTARRAY,    1}, \
 {CONFIG_STRING_RU_GNB_LIST,                 	 NULL,       0,       uptr:NULL,       defintarrayval:DEFGNBS,  TYPE_INTARRAY,    1}, \
-{CONFIG_STRING_RU_ATT_TX,                   	 NULL,       0,       uptr:NULL,       defintval:0,		TYPE_UINT,	  0}, \
-{CONFIG_STRING_RU_ATT_RX,                   	 NULL,       0,       uptr:NULL,       defintval:0,		TYPE_UINT,	  0}, \
-{CONFIG_STRING_RU_NBIOTRRC_LIST,               NULL,       0,       uptr:NULL,       defintarrayval:DEFGNBS,  TYPE_INTARRAY,    1}, \
+{CONFIG_STRING_RU_ATT_TX,                   	 NULL,       0,       uptr:NULL,       defintval:0,             TYPE_UINT,        0}, \
+{CONFIG_STRING_RU_ATT_RX,                   	 NULL,       0,       uptr:NULL,       defintval:0,             TYPE_UINT,        0}, \
+{CONFIG_STRING_RU_NBIOTRRC_LIST,                 NULL,       0,       uptr:NULL,       defintarrayval:DEFGNBS,  TYPE_INTARRAY,    1}, \
 }
 
 /*---------------------------------------------------------------------------------------------------------------------------------------*/
@@ -250,7 +250,7 @@ typedef enum {
 #define GNB_MOBILE_NETWORK_CODE_IDX     1
 #define GNB_MNC_DIGIT_LENGTH            2
 
-#define PLMNPARAMS_DESC {                                                                  \
+#define GNBPLMNPARAMS_DESC {                                                                  \
 /*   optname                              helpstr               paramflags XXXptr     def val          type    numelt */ \
   {GNB_CONFIG_STRING_MOBILE_COUNTRY_CODE, "mobile country code",        0, uptr:NULL, defuintval:1000, TYPE_UINT, 0},    \
   {GNB_CONFIG_STRING_MOBILE_NETWORK_CODE, "mobile network code",        0, uptr:NULL, defuintval:1000, TYPE_UINT, 0},    \
@@ -913,7 +913,7 @@ typedef enum {
 /*                                            SRB1 configuration parameters                                                                                  */
 /*   optname                                          helpstr   paramflags    XXXptr                             defXXXval         type           numelt     */
 /*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/
-#define SRB1PARAMS_DESC {                                                                                                \
+#define GNBSRB1PARAMS_DESC {                                                                                                \
 {GNB_CONFIG_STRING_SRB1_TIMER_POLL_RETRANSMIT,         NULL,   0,            iptr:&srb1_timer_poll_retransmit,   defintval:80,     TYPE_UINT,      0},       \
 {GNB_CONFIG_STRING_SRB1_TIMER_REORDERING,              NULL,   0,            iptr:&srb1_timer_reordering,        defintval:35,     TYPE_UINT,      0},       \
 {GNB_CONFIG_STRING_SRB1_TIMER_STATUS_PROHIBIT,         NULL,   0,            iptr:&srb1_timer_status_prohibit,   defintval:0,      TYPE_UINT,      0},       \
@@ -940,7 +940,7 @@ typedef enum {
 /*                                            MME configuration parameters                                                             */
 /*   optname                                          helpstr   paramflags    XXXptr       defXXXval         type           numelt     */
 /*-------------------------------------------------------------------------------------------------------------------------------------*/
-#define S1PARAMS_DESC {  \
+#define GNBS1PARAMS_DESC {  \
 {GNB_CONFIG_STRING_MME_IPV4_ADDRESS,                   NULL,      0,         uptr:NULL,   defstrval:NULL,   TYPE_STRING,   0},          \
 {GNB_CONFIG_STRING_MME_IPV6_ADDRESS,                   NULL,      0,         uptr:NULL,   defstrval:NULL,   TYPE_STRING,   0},          \
 {GNB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE,              NULL,      0,         uptr:NULL,   defstrval:NULL,   TYPE_STRING,   0},          \
@@ -967,7 +967,7 @@ typedef enum {
 /*                                            SRB1 configuration parameters                                                                                  */
 /*   optname                                          helpstr   paramflags    XXXptr                             defXXXval         type           numelt     */
 /*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/
-#define SCTPPARAMS_DESC {  \
+#define GNBSCTPPARAMS_DESC {  \
 {GNB_CONFIG_STRING_SCTP_INSTREAMS,                       NULL,   0,   uptr:NULL,   defintval:-1,    TYPE_UINT,   0},       \
 {GNB_CONFIG_STRING_SCTP_OUTSTREAMS,                      NULL,   0,   uptr:NULL,   defintval:-1,    TYPE_UINT,   0}        \
 }
@@ -996,7 +996,7 @@ typedef enum {
 /*                                            S1 interface configuration parameters                                                                 */
 /*   optname                                            helpstr   paramflags    XXXptr              defXXXval             type           numelt     */
 /*--------------------------------------------------------------------------------------------------------------------------------------------------*/
-#define NETPARAMS_DESC {  \
+#define GNBNETPARAMS_DESC {  \
 {GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_S1_MME,        NULL,      0,         strptr:NULL,         defstrval:NULL,      TYPE_STRING,      0},      \
 {GNB_CONFIG_STRING_GNB_IPV4_ADDRESS_FOR_S1_MME,          NULL,      0,         strptr:NULL,         defstrval:NULL,      TYPE_STRING,      0},      \
 {GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_S1U,           NULL,      0,         strptr:NULL,         defstrval:NULL,      TYPE_STRING,      0},      \
@@ -1010,7 +1010,7 @@ typedef enum {
 /*                                            GTPU  configuration parameters                                                                                                      */
 /*   optname                                            helpstr   paramflags    XXXptr              defXXXval                                           type           numelt     */
 /*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
-#define GTPUPARAMS_DESC { \
+#define GNBGTPUPARAMS_DESC { \
 {GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_S1U,           NULL,    0,            strptr:&gnb_interface_name_for_S1U,      defstrval:"lo",                TYPE_STRING,   0},        \
 {GNB_CONFIG_STRING_GNB_IPV4_ADDR_FOR_S1U,                NULL,    0,            strptr:&gnb_ipv4_address_for_S1U,        defstrval:"127.0.0.1",         TYPE_STRING,   0},        \
 {GNB_CONFIG_STRING_GNB_PORT_FOR_S1U,                     NULL,    0,            uptr:&gnb_port_for_S1U,                  defintval:2152,                TYPE_UINT,     0}         \
diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c
index 1608a5239fb..70afd510b68 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c
@@ -1312,7 +1312,7 @@ initiate_ra_proc(module_id_t module_idP,
                  int16_t timing_offset,
 				 uint16_t ra_rnti
 #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
-  , uint8_t rach_resource_type
+                ,uint8_t rach_resource_type
 #endif
                 ) {
   uint8_t i;
diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c
index d46ed8ccf8a..bfb8abfa06c 100644
--- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c
+++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c
@@ -52,9 +52,8 @@ extern int oai_nfapi_rx_ind(nfapi_rx_indication_t *ind);
 extern uint8_t nfapi_mode;
 extern uint16_t sf_ahead;
 
-void handle_nr_rach(NR_UL_IND_t *UL_info) {
-  int i;
-
+void handle_nr_rach(NR_UL_IND_t *UL_info)
+{
   if (UL_info->rach_ind.rach_indication_body.number_of_preambles>0) {
 
     AssertFatal(UL_info->rach_ind.rach_indication_body.number_of_preambles==1,"More than 1 preamble not supported\n");
@@ -67,7 +66,8 @@ void handle_nr_rach(NR_UL_IND_t *UL_info) {
 					 UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.preamble,
 					 UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.timing_advance,
 					 UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.rnti
-#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
+#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) || (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
+//#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
                     ,0
 #endif
                      );
@@ -77,7 +77,7 @@ void handle_nr_rach(NR_UL_IND_t *UL_info) {
   if (UL_info->rach_ind_br.rach_indication_body.number_of_preambles>0) {
 
     AssertFatal(UL_info->rach_ind_br.rach_indication_body.number_of_preambles<5,"More than 4 preambles not supported\n");
-    for (i=0;i<UL_info->rach_ind_br.rach_indication_body.number_of_preambles;i++) {
+    for (int i=0;i<UL_info->rach_ind_br.rach_indication_body.number_of_preambles;i++) {
       AssertFatal(UL_info->rach_ind_br.rach_indication_body.preamble_list[i].preamble_rel13.rach_resource_type>0,
       "Got regular PRACH preamble, not BL/CE\n");
       LOG_D(MAC,"Frame %d, Slot %d Calling initiate_ra_proc (CE_level %d)\n",UL_info->frame,UL_info->slot,
@@ -96,10 +96,8 @@ void handle_nr_rach(NR_UL_IND_t *UL_info) {
 #endif
 }
 
-void handle_nr_sr(NR_UL_IND_t *UL_info) {
-
-  int i;
-
+void handle_nr_sr(NR_UL_IND_t *UL_info)
+{
   if (nfapi_mode == 1)  // PNF
   {
     if (UL_info->sr_ind.sr_indication_body.number_of_srs>0)
@@ -109,7 +107,7 @@ void handle_nr_sr(NR_UL_IND_t *UL_info) {
   }
   else
   {
-    for (i=0;i<UL_info->sr_ind.sr_indication_body.number_of_srs;i++)
+    for (int i=0;i<UL_info->sr_ind.sr_indication_body.number_of_srs;i++)
       SR_indication(UL_info->module_id,
           UL_info->CC_id,
           UL_info->frame,
@@ -123,8 +121,6 @@ void handle_nr_sr(NR_UL_IND_t *UL_info) {
 
 void handle_nr_cqi(NR_UL_IND_t *UL_info) {
 
-  int i;
-
   if (nfapi_mode == 1)
   {
     if (UL_info->cqi_ind.number_of_cqis>0)
@@ -143,7 +139,7 @@ void handle_nr_cqi(NR_UL_IND_t *UL_info) {
   }
   else
   {
-    for (i=0;i<UL_info->cqi_ind.number_of_cqis;i++) 
+    for (int i=0;i<UL_info->cqi_ind.number_of_cqis;i++)
       cqi_indication(UL_info->module_id,
           UL_info->CC_id,
           UL_info->frame,
@@ -159,8 +155,6 @@ void handle_nr_cqi(NR_UL_IND_t *UL_info) {
 
 void handle_nr_harq(NR_UL_IND_t *UL_info) {
 
-  int i;
-
   if (nfapi_mode == 1 && UL_info->harq_ind.harq_indication_body.number_of_harqs>0) // PNF
   {
     //LOG_D(PHY, "UL_info->harq_ind.harq_indication_body.number_of_harqs:%d Send to VNF\n", UL_info->harq_ind.harq_indication_body.number_of_harqs);
@@ -176,7 +170,7 @@ void handle_nr_harq(NR_UL_IND_t *UL_info) {
   }
   else
   {
-    for (i=0;i<UL_info->harq_ind.harq_indication_body.number_of_harqs;i++)
+    for (int i=0;i<UL_info->harq_ind.harq_indication_body.number_of_harqs;i++)
       harq_indication(UL_info->module_id,
           UL_info->CC_id,
           NFAPI_SFNSF2SFN(UL_info->harq_ind.sfn_sf),
@@ -189,8 +183,6 @@ void handle_nr_harq(NR_UL_IND_t *UL_info) {
 
 void handle_nr_ulsch(NR_UL_IND_t *UL_info) {
 
-  int i,j;
-
   if(nfapi_mode == 1)
   {
     if (UL_info->crc_ind.crc_indication_body.number_of_crcs>0)
@@ -212,8 +204,8 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) {
   else
   {
     if (UL_info->rx_ind.rx_indication_body.number_of_pdus>0 && UL_info->crc_ind.crc_indication_body.number_of_crcs>0) {
-      for (i=0;i<UL_info->rx_ind.rx_indication_body.number_of_pdus;i++) {
-        for (j=0;j<UL_info->crc_ind.crc_indication_body.number_of_crcs;j++) {
+      for (int i=0;i<UL_info->rx_ind.rx_indication_body.number_of_pdus;i++) {
+        for (int j=0;j<UL_info->crc_ind.crc_indication_body.number_of_crcs;j++) {
           // find crc_indication j corresponding rx_indication i
           LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.crc_pdu_list[%d].rx_ue_information.rnti:%04x UL_info->rx_ind.rx_indication_body.rx_pdu_list[%d].rx_ue_information.rnti:%04x\n", j, UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].rx_ue_information.rnti, i, UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti);
           if (UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].rx_ue_information.rnti ==
@@ -262,18 +254,17 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) {
 
 void NR_UL_indication(NR_UL_IND_t *UL_info)
 {
-
   AssertFatal(UL_info!=NULL,"UL_INFO is null\n");
 
 #ifdef DUMP_FAPI
   dump_ul(UL_info);
 #endif
 
-  module_id_t  module_id   = UL_info->module_id;
-  int          CC_id       = UL_info->CC_id;
-  NR_Sched_Rsp_t  *sched_info = &Sched_INFO[module_id][CC_id];
-  NR_IF_Module_t  *ifi        = if_inst[module_id];
-  gNB_MAC_INST *mac        = RC.nrmac[module_id];
+  module_id_t      module_id   = UL_info->module_id;
+  int              CC_id       = UL_info->CC_id;
+  NR_Sched_Rsp_t   *sched_info = &Sched_INFO[module_id][CC_id];
+  NR_IF_Module_t   *ifi        = if_inst[module_id];
+  gNB_MAC_INST     *mac        = RC.nrmac[module_id];
 
   LOG_D(PHY,"SFN/SF:%d%d module_id:%d CC_id:%d UL_info[rx_ind:%d harqs:%d crcs:%d cqis:%d preambles:%d sr_ind:%d]\n",
         UL_info->frame,UL_info->slot,
@@ -293,7 +284,6 @@ void NR_UL_indication(NR_UL_IND_t *UL_info)
     ifi->CC_mask |= (1<<CC_id);
   }
 
-
   // clear DL/UL info for new scheduling round
   clear_nr_nfapi_information(mac,CC_id,UL_info->frame,UL_info->slot);
 
@@ -330,7 +320,7 @@ void NR_UL_indication(NR_UL_IND_t *UL_info)
       sched_info->module_id   = module_id;
       sched_info->CC_id       = CC_id;
       sched_info->frame       = (UL_info->frame + ((UL_info->slot>(spf-1-sf_ahead)) ? 1 : 0)) % 1024;
-      sched_info->slot    = (UL_info->slot+sf_ahead)%spf;
+      sched_info->slot        = (UL_info->slot+sf_ahead)%spf;
       sched_info->DL_req      = &mac->DL_req[CC_id];
       sched_info->HI_DCI0_req = &mac->HI_DCI0_req[CC_id];
       if ((mac->common_channels[CC_id].tdd_Config==NULL) ||
@@ -359,8 +349,8 @@ void NR_UL_indication(NR_UL_IND_t *UL_info)
   }
 }
 
-NR_IF_Module_t *NR_IF_Module_init(int Mod_id){
-
+NR_IF_Module_t *NR_IF_Module_init(int Mod_id)
+{
   AssertFatal(Mod_id<MAX_MODULES,"Asking for Module %d > %d\n",Mod_id,MAX_IF_MODULES);
 
   LOG_D(PHY,"Installing callbacks for IF_Module - UL_indication\n");
diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.c b/openair2/RRC/LTE/MESSAGES/asn1_msg.c
index 07523ca9d3e..0dd29abccf0 100644
--- a/openair2/RRC/LTE/MESSAGES/asn1_msg.c
+++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.c
@@ -2203,28 +2203,7 @@ uint8_t do_RRCConnectionRequest(uint8_t Mod_id, uint8_t *buffer,uint8_t *rv) {
                                    buffer,
                                    100);
   AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n", enc_rval.failed_type->name, enc_rval.encoded);
-
-#if defined(ENABLE_ITTI)
-# if !defined(DISABLE_XER_SPRINT)
-  {
-    char        message_string[20000];
-    size_t      message_string_size;
-
-    if ((message_string_size = xer_sprint(message_string, sizeof(message_string), &asn_DEF_UL_CCCH_Message, (void *) &ul_ccch_msg)) > 0) {
-      MessageDef *msg_p;
-
-      msg_p = itti_alloc_new_message_sized (TASK_RRC_UE, RRC_UL_CCCH, message_string_size + sizeof (IttiMsgText));
-      msg_p->ittiMsg.rrc_ul_ccch.size = message_string_size;
-      memcpy(&msg_p->ittiMsg.rrc_ul_ccch.text, message_string, message_string_size);
-
-      itti_send_msg_to_task(TASK_UNKNOWN, NB_eNB_INST + Mod_id, msg_p);
-    }
-  }
-# endif
-#endif
-
-  LOG_D(RRC,"[UE] RRCConnectionRequest Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8);
-
+  LOG_D(RRC,"[UE] RRCConnectionRequest Encoded %zd bits (%zd bytes)\n", enc_rval.encoded, (enc_rval.encoded+7)/8);
   return((enc_rval.encoded+7)/8);
 }
 
@@ -4483,15 +4462,15 @@ OAI_UECapability_t *fill_ue_capability(char *UE_EUTRA_Capability_xer_fname) {
     InterFreqBandInfo[3][3].interFreqNeedForGaps = 0;
     UE_EUTRA_Capability->accessStratumRelease = 0;//AccessStratumRelease_rel8;
     UE_EUTRA_Capability->ue_Category          = 4;
-    UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0001=0;
-    UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0002=0;
-    UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0003=0;
-    UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0004=0;
-    UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0006=0;
-    UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0101=0;
-    UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0102=0;
-    UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0103=0;
-    UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0104=0;
+    UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0001_r15=0;
+    UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0002_r15=0;
+    UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0003_r15=0;
+    UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0004_r15=0;
+    UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0006_r15=0;
+    UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0101_r15=0;
+    UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0102_r15=0;
+    UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0103_r15=0;
+    UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0104_r15=0;
     UE_EUTRA_Capability->pdcp_Parameters.maxNumberROHC_ContextSessions = &maxNumberROHC_ContextSessions;
     UE_EUTRA_Capability->phyLayerParameters.ue_TxAntennaSelectionSupported = 0;
     UE_EUTRA_Capability->phyLayerParameters.ue_SpecificRefSigsSupported    = 0;
diff --git a/openair2/RRC/LTE/rrc_vars.h b/openair2/RRC/LTE/rrc_vars.h
index 512d421168d..84739a8a35c 100644
--- a/openair2/RRC/LTE/rrc_vars.h
+++ b/openair2/RRC/LTE/rrc_vars.h
@@ -45,7 +45,7 @@ UE_RRC_INST *UE_rrc_inst = NULL;
 uint8_t DRB2LCHAN[8];
 
 long logicalChannelGroup0 = 0;
-long  logicalChannelSR_Mask_r9=0;
+long logicalChannelSR_Mask_r9=0;
 
 struct LTE_LogicalChannelConfig__ul_SpecificParameters LCSRB1 =  {1,
          LTE_LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_infinity,
diff --git a/openair2/RRC/NR/nr_rrc_extern.h b/openair2/RRC/NR/nr_rrc_extern.h
index f8abbe585cb..8373a53584d 100644
--- a/openair2/RRC/NR/nr_rrc_extern.h
+++ b/openair2/RRC/NR/nr_rrc_extern.h
@@ -39,13 +39,14 @@ extern UE_RRC_INST *UE_rrc_inst;
 
 extern uint8_t DRB2LCHAN[8];
 
-extern NR_LogicalChannelConfig_t SRB1_logicalChannelConfig_defaultValue;
-extern LogicalChannelConfig_t SRB2_logicalChannelConfig_defaultValue;
+extern NR_LogicalChannelConfig_t NR_SRB1_logicalChannelConfig_defaultValue;
+extern NR_LogicalChannelConfig_t NR_SRB2_logicalChannelConfig_defaultValue;
+extern NR_LogicalChannelConfig_t NR_SRB3_logicalChannelConfig_defaultValue;
 
 
 extern unsigned char NB_INST;
 extern unsigned char NB_eNB_INST;
-extern unsigned char NB_UE_INST;
+extern uint16_t NB_UE_INST;
 extern unsigned short NODE_ID[1];
 extern void* bigphys_malloc(int);
 
diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c
index 749320b3572..9c973252cf7 100644
--- a/openair2/RRC/NR/rrc_gNB.c
+++ b/openair2/RRC/NR/rrc_gNB.c
@@ -58,10 +58,6 @@
 
 #include "T.h"
 
-//#if defined(Rel10) || defined(Rel14)
-#include "MeasResults.h"
-//#endif
-
 #include "RRC/NAS/nas_config.h"
 #include "RRC/NAS/rb_config.h"
 #include "OCG.h"
diff --git a/openair2/UTIL/OTG/otg_form.c b/openair2/UTIL/OTG/otg_form.c
index aea5d388827..7a421eef608 100644
--- a/openair2/UTIL/OTG/otg_form.c
+++ b/openair2/UTIL/OTG/otg_form.c
@@ -36,7 +36,7 @@
 #include "otg_kpi.h"
 
 extern unsigned char NB_eNB_INST;
-extern unsigned char NB_UE_INST;
+extern uint16_t NB_UE_INST;
 
 FD_otg *form_dl, *form_ul;
 FL_FORM *fclock;
diff --git a/openair2/UTIL/OTG/otg_kpi.c b/openair2/UTIL/OTG/otg_kpi.c
index 3af84adc8b3..ac2fff89fe4 100644
--- a/openair2/UTIL/OTG/otg_kpi.c
+++ b/openair2/UTIL/OTG/otg_kpi.c
@@ -41,7 +41,7 @@ unsigned int start_log_jitter=0;
 #include"otg_externs.h"
 
 extern unsigned char NB_eNB_INST;
-extern unsigned char NB_UE_INST;
+extern uint16_t NB_UE_INST;
 
 void tx_throughput(int src, int dst, int application) {
   if (otg_info->tx_num_bytes[src][dst][application]>0) {
diff --git a/openair2/UTIL/OTG/otg_rx.c b/openair2/UTIL/OTG/otg_rx.c
index a8b18e23b7a..4cd0496bde2 100644
--- a/openair2/UTIL/OTG/otg_rx.c
+++ b/openair2/UTIL/OTG/otg_rx.c
@@ -44,7 +44,7 @@
 #endif
 
 extern unsigned char NB_eNB_INST;
-extern unsigned char NB_UE_INST;
+extern uint16_t NB_UE_INST;
 
 //#include "LAYER2/MAC/extern.h"
 
diff --git a/openair2/UTIL/OTG/otg_tx.c b/openair2/UTIL/OTG/otg_tx.c
index 2459bb73388..02ee8ba3913 100644
--- a/openair2/UTIL/OTG/otg_tx.c
+++ b/openair2/UTIL/OTG/otg_tx.c
@@ -36,7 +36,7 @@
 #include "otg_externs.h"
 
 extern unsigned char NB_eNB_INST;
-extern unsigned char NB_UE_INST;
+extern uint16_t NB_UE_INST;
 
 
 // char string for payload gen
diff --git a/targets/RT/USER/nr-ru.c b/targets/RT/USER/nr-ru.c
index 5506e4841cd..2cb02632344 100644
--- a/targets/RT/USER/nr-ru.c
+++ b/targets/RT/USER/nr-ru.c
@@ -2307,7 +2307,7 @@ void RCconfig_RU(void) {
   int               i                             = 0;
 
   
-  paramdef_t RUParams[] = RUPARAMS_DESC;
+  paramdef_t RUParams[] = GNBRUPARAMS_DESC;
   paramlist_def_t RUParamList = {CONFIG_STRING_RU_LIST,NULL,0};
 
 
-- 
GitLab