From 9f8a468d947247cc58795e6668cb36750be1935e Mon Sep 17 00:00:00 2001
From: laurent <laurent Thomas>
Date: Mon, 28 Nov 2022 15:22:52 +0100
Subject: [PATCH] remove eNB threads for RRC and MAC, MAC thread was only for
 DRX config (useless) and RRC thread has many race conditions with MAC+PHY

---
 common/utils/ocp_itti/intertask_interface.h   |  97 ++-
 executables/create_tasks.c                    |  13 +-
 executables/lte-softmodem.c                   |   1 +
 openair2/ENB_APP/enb_config.c                 | 545 +++++++-------
 openair2/ENB_APP/enb_config.h                 |   4 +-
 openair2/ENB_APP/enb_config_SL.c              | 200 +++---
 openair2/ENB_APP/enb_config_eMTC.c            | 674 +++++++++---------
 openair2/F1AP/f1ap_du_rrc_message_transfer.c  |   7 +-
 openair2/LAYER2/MAC/eNB_scheduler.c           |   2 +-
 openair2/LAYER2/MAC/eNB_scheduler_RA.c        |  12 +-
 openair2/LAYER2/MAC/eNB_scheduler_fairRR.c    |   6 +-
 .../LAYER2/MAC/eNB_scheduler_primitives.c     |   4 +-
 openair2/LAYER2/MAC/main.c                    |  45 +-
 openair2/RRC/LTE/rrc_eNB.c                    | 195 ++---
 14 files changed, 835 insertions(+), 970 deletions(-)

diff --git a/common/utils/ocp_itti/intertask_interface.h b/common/utils/ocp_itti/intertask_interface.h
index 2b17c7e3ef2..3874d528297 100644
--- a/common/utils/ocp_itti/intertask_interface.h
+++ b/common/utils/ocp_itti/intertask_interface.h
@@ -296,55 +296,54 @@ typedef struct {
 //TASK_DEF(TASK_GTPV1_U,  TASK_PRIORITY_MED,  1000,NULL, NULL)
 //TASK_DEF(TASK_UDP,      TASK_PRIORITY_MED,  1000, NULL, NULL)
 void *rrc_enb_process_msg(void *);
-#define FOREACH_TASK(TASK_DEF) \
-  TASK_DEF(TASK_UNKNOWN,  TASK_PRIORITY_MED, 50, NULL, NULL)  \
-  TASK_DEF(TASK_TIMER,    TASK_PRIORITY_MED, 10, NULL, NULL)   \
-  TASK_DEF(TASK_L2L1,     TASK_PRIORITY_MAX, 200, NULL, NULL)   \
-  TASK_DEF(TASK_BM,       TASK_PRIORITY_MED, 200, NULL, NULL)   \
-  TASK_DEF(TASK_PHY_ENB,  TASK_PRIORITY_MED, 200, NULL, NULL)   \
-  TASK_DEF(TASK_MAC_ENB,  TASK_PRIORITY_MED, 200, NULL, NULL)   \
-  TASK_DEF(TASK_MAC_GNB,  TASK_PRIORITY_MED, 200, NULL, NULL)   \
-  TASK_DEF(TASK_RLC_ENB,  TASK_PRIORITY_MED, 200, NULL, NULL)   \
-  TASK_DEF(TASK_RRC_ENB_NB_IoT,  TASK_PRIORITY_MED, 200, NULL, NULL) \
-  TASK_DEF(TASK_PDCP_ENB, TASK_PRIORITY_MED, 200, NULL, NULL)   \
-  TASK_DEF(TASK_PDCP_GNB, TASK_PRIORITY_MED, 200, NULL, NULL)   \
-  TASK_DEF(TASK_DATA_FORWARDING, TASK_PRIORITY_MED, 200, NULL, NULL)   \
-  TASK_DEF(TASK_END_MARKER, TASK_PRIORITY_MED, 200, NULL, NULL)   \
-  TASK_DEF(TASK_RRC_ENB,  TASK_PRIORITY_MED,  200, NULL,NULL)\
-  TASK_DEF(TASK_RRC_GNB,  TASK_PRIORITY_MED,  200, NULL,NULL)\
-  TASK_DEF(TASK_RAL_ENB,  TASK_PRIORITY_MED,  200, NULL, NULL)  \
-  TASK_DEF(TASK_S1AP,     TASK_PRIORITY_MED,  200, NULL, NULL)  \
-  TASK_DEF(TASK_NGAP,     TASK_PRIORITY_MED,  200, NULL, NULL)  \
-  TASK_DEF(TASK_X2AP,     TASK_PRIORITY_MED,  200, NULL, NULL)  \
-  TASK_DEF(TASK_M2AP_ENB,     TASK_PRIORITY_MED,  200, NULL, NULL)  \
-  TASK_DEF(TASK_M2AP_MCE,     TASK_PRIORITY_MED,  200, NULL, NULL)  \
-  TASK_DEF(TASK_M3AP,     TASK_PRIORITY_MED,  200, NULL, NULL)  \
-  TASK_DEF(TASK_M3AP_MME,     TASK_PRIORITY_MED,  200, NULL, NULL)  \
-  TASK_DEF(TASK_M3AP_MCE,     TASK_PRIORITY_MED,  200, NULL, NULL)  \
-  TASK_DEF(TASK_SCTP,     TASK_PRIORITY_MED,  200, NULL, NULL)  \
-  TASK_DEF(TASK_ENB_APP,  TASK_PRIORITY_MED,  200, NULL, NULL)  \
-  TASK_DEF(TASK_GNB_APP,  TASK_PRIORITY_MED,  200, NULL, NULL)  \
-  TASK_DEF(TASK_MCE_APP,  TASK_PRIORITY_MED,  200, NULL, NULL)  \
-  TASK_DEF(TASK_MME_APP,  TASK_PRIORITY_MED,  200, NULL, NULL)  \
-  TASK_DEF(TASK_PHY_UE,   TASK_PRIORITY_MED,  200, NULL, NULL)  \
-  TASK_DEF(TASK_MAC_UE,   TASK_PRIORITY_MED,  200, NULL, NULL)  \
-  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_GTPV1_U,  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_CUCP_E1,  TASK_PRIORITY_MED,  200, NULL, NULL) \
-  TASK_DEF(TASK_CUUP_E1,  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_RRC_NSA_UE,   TASK_PRIORITY_MED,  200, NULL, NULL)  \
-  TASK_DEF(TASK_RRC_NSA_NRUE,   TASK_PRIORITY_MED,  200, NULL, NULL)  \
-  TASK_DEF(TASK_NAS_NRUE,     TASK_PRIORITY_MED,  200, NULL, NULL)  \
-  TASK_DEF(TASK_MAX,      TASK_PRIORITY_MED,  200, NULL, NULL)
+#define FOREACH_TASK(TASK_DEF)                                       \
+  TASK_DEF(TASK_UNKNOWN, TASK_PRIORITY_MED, 50, NULL, NULL)          \
+  TASK_DEF(TASK_TIMER, TASK_PRIORITY_MED, 10, NULL, NULL)            \
+  TASK_DEF(TASK_L2L1, TASK_PRIORITY_MAX, 200, NULL, NULL)            \
+  TASK_DEF(TASK_BM, TASK_PRIORITY_MED, 200, NULL, NULL)              \
+  TASK_DEF(TASK_PHY_ENB, TASK_PRIORITY_MED, 200, NULL, NULL)         \
+  TASK_DEF(TASK_MAC_GNB, TASK_PRIORITY_MED, 200, NULL, NULL)         \
+  TASK_DEF(TASK_RLC_ENB, TASK_PRIORITY_MED, 200, NULL, NULL)         \
+  TASK_DEF(TASK_RRC_ENB_NB_IoT, TASK_PRIORITY_MED, 200, NULL, NULL)  \
+  TASK_DEF(TASK_PDCP_ENB, TASK_PRIORITY_MED, 200, NULL, NULL)        \
+  TASK_DEF(TASK_PDCP_GNB, TASK_PRIORITY_MED, 200, NULL, NULL)        \
+  TASK_DEF(TASK_DATA_FORWARDING, TASK_PRIORITY_MED, 200, NULL, NULL) \
+  TASK_DEF(TASK_END_MARKER, TASK_PRIORITY_MED, 200, NULL, NULL)      \
+  TASK_DEF(TASK_RRC_ENB, TASK_PRIORITY_MED, 200, NULL, NULL)         \
+  TASK_DEF(TASK_RRC_GNB, TASK_PRIORITY_MED, 200, NULL, NULL)         \
+  TASK_DEF(TASK_RAL_ENB, TASK_PRIORITY_MED, 200, NULL, NULL)         \
+  TASK_DEF(TASK_S1AP, TASK_PRIORITY_MED, 200, NULL, NULL)            \
+  TASK_DEF(TASK_NGAP, TASK_PRIORITY_MED, 200, NULL, NULL)            \
+  TASK_DEF(TASK_X2AP, TASK_PRIORITY_MED, 200, NULL, NULL)            \
+  TASK_DEF(TASK_M2AP_ENB, TASK_PRIORITY_MED, 200, NULL, NULL)        \
+  TASK_DEF(TASK_M2AP_MCE, TASK_PRIORITY_MED, 200, NULL, NULL)        \
+  TASK_DEF(TASK_M3AP, TASK_PRIORITY_MED, 200, NULL, NULL)            \
+  TASK_DEF(TASK_M3AP_MME, TASK_PRIORITY_MED, 200, NULL, NULL)        \
+  TASK_DEF(TASK_M3AP_MCE, TASK_PRIORITY_MED, 200, NULL, NULL)        \
+  TASK_DEF(TASK_SCTP, TASK_PRIORITY_MED, 200, NULL, NULL)            \
+  TASK_DEF(TASK_ENB_APP, TASK_PRIORITY_MED, 200, NULL, NULL)         \
+  TASK_DEF(TASK_GNB_APP, TASK_PRIORITY_MED, 200, NULL, NULL)         \
+  TASK_DEF(TASK_MCE_APP, TASK_PRIORITY_MED, 200, NULL, NULL)         \
+  TASK_DEF(TASK_MME_APP, TASK_PRIORITY_MED, 200, NULL, NULL)         \
+  TASK_DEF(TASK_PHY_UE, TASK_PRIORITY_MED, 200, NULL, NULL)          \
+  TASK_DEF(TASK_MAC_UE, TASK_PRIORITY_MED, 200, NULL, NULL)          \
+  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_GTPV1_U, 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_CUCP_E1, TASK_PRIORITY_MED, 200, NULL, NULL)         \
+  TASK_DEF(TASK_CUUP_E1, 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_RRC_NSA_UE, TASK_PRIORITY_MED, 200, NULL, NULL)      \
+  TASK_DEF(TASK_RRC_NSA_NRUE, TASK_PRIORITY_MED, 200, NULL, NULL)    \
+  TASK_DEF(TASK_NAS_NRUE, TASK_PRIORITY_MED, 200, NULL, NULL)        \
+  TASK_DEF(TASK_MAX, TASK_PRIORITY_MED, 200, NULL, NULL)
 
 #define TASK_DEF(TaskID, pRIO, qUEUEsIZE, FuNc, ThreadFunc)          { pRIO, qUEUEsIZE, #TaskID, FuNc, ThreadFunc },
 
diff --git a/executables/create_tasks.c b/executables/create_tasks.c
index 12504f55d5b..4bbda1e876e 100644
--- a/executables/create_tasks.c
+++ b/executables/create_tasks.c
@@ -53,11 +53,8 @@ int create_tasks(uint32_t enb_nb) {
   LOG_I(ENB_APP, "Creating ENB_APP eNB Task\n");
   rc = itti_create_task (TASK_ENB_APP, eNB_app_task, NULL);
   AssertFatal(rc >= 0, "Create task for eNB APP failed\n");
-
-  LOG_I(RRC,"Creating RRC eNB Task\n");
-  rc = itti_create_task (TASK_RRC_ENB, rrc_enb_task, NULL);
-  AssertFatal(rc >= 0, "Create task for RRC eNB failed\n");
-
+  rrc_enb_init();
+  itti_mark_task_ready(TASK_RRC_ENB);
   if (get_softmodem_params()->emulate_l1 || (EPC_MODE_ENABLED && split73 != SPLIT73_DU)) {
     rc = itti_create_task(TASK_SCTP, sctp_eNB_task, NULL);
     AssertFatal(rc >= 0, "Create task for SCTP failed\n");
@@ -89,11 +86,5 @@ int create_tasks(uint32_t enb_nb) {
     AssertFatal(rc >= 0, "Create task for GTPV1U failed\n");
   }
 
-  if (!NODE_IS_CU(type)) {
-    LOG_I(MAC,"Creating MAC eNB Task\n");
-    rc = itti_create_task(TASK_MAC_ENB, mac_enb_task, NULL);
-    AssertFatal(rc >= 0, "Create task for MAC eNB failed\n");
-  }
-
   return 0;
 }
diff --git a/executables/lte-softmodem.c b/executables/lte-softmodem.c
index dfdf8fa6f49..a01fcf6a042 100644
--- a/executables/lte-softmodem.c
+++ b/executables/lte-softmodem.c
@@ -482,6 +482,7 @@ int main ( int argc, char **argv )
       MessageDef *msg_p = itti_alloc_new_message (TASK_ENB_APP, 0, RRC_CONFIGURATION_REQ);
       RRC_CONFIGURATION_REQ(msg_p) = RC.rrc[enb_id]->configuration;
       itti_send_msg_to_task (TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
+      rrc_enb_process_itti_msg(NULL);
     }
     node_type = RC.rrc[0]->node_type;
   }
diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c
index 776c89c02b5..c37581d04ad 100644
--- a/openair2/ENB_APP/enb_config.c
+++ b/openair2/ENB_APP/enb_config.c
@@ -265,8 +265,8 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
   int               nb_cc                         = 0;
   int32_t           offsetMaxLimit                = 0;
   int32_t           cycleNb                       = 0;
-   
-  MessageDef *msg_p = itti_alloc_new_message(TASK_RRC_ENB, 0, RRC_CONFIGURATION_REQ);
+
+  RrcConfigurationReq *RRCcfg = &rrc->configuration;
   ccparams_lte_t ccparams_lte;
   ccparams_sidelink_t SLconfig;
   ccparams_eMTC_t eMTCconfig;
@@ -369,9 +369,9 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
           PLMNParams[I].chkPptr = &(config_check_PLMNParams[I]);
 
         // In the configuration file it is in seconds. For RRC it has to be in milliseconds
-        RRC_CONFIGURATION_REQ (msg_p).rrc_inactivity_timer_thres = (*ENBParamList.paramarray[i][ENB_RRC_INACTIVITY_THRES_IDX].uptr) * 1000;
-        RRC_CONFIGURATION_REQ (msg_p).cell_identity = enb_id;
-        RRC_CONFIGURATION_REQ (msg_p).tac = *ENBParamList.paramarray[i][ENB_TRACKING_AREA_CODE_IDX].uptr;
+        RRCcfg->rrc_inactivity_timer_thres = (*ENBParamList.paramarray[i][ENB_RRC_INACTIVITY_THRES_IDX].uptr) * 1000;
+        RRCcfg->cell_identity = enb_id;
+        RRCcfg->tac = *ENBParamList.paramarray[i][ENB_TRACKING_AREA_CODE_IDX].uptr;
         AssertFatal(!ENBParamList.paramarray[i][ENB_MOBILE_COUNTRY_CODE_IDX_OLD].strptr
                     && !ENBParamList.paramarray[i][ENB_MOBILE_NETWORK_CODE_IDX_OLD].strptr,
                     "It seems that you use an old configuration file. Please change the existing\n"
@@ -387,41 +387,38 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
           AssertFatal(0, "The number of PLMN IDs must be in [1,6], but is %d\n",
                       PLMNParamList.numelt);
 
-        RRC_CONFIGURATION_REQ(msg_p).num_plmn = PLMNParamList.numelt;
+        RRCcfg->num_plmn = PLMNParamList.numelt;
 
         for (int l = 0; l < PLMNParamList.numelt; ++l) {
-          RRC_CONFIGURATION_REQ(msg_p).mcc[l] = *PLMNParamList.paramarray[l][ENB_MOBILE_COUNTRY_CODE_IDX].uptr;
-          RRC_CONFIGURATION_REQ(msg_p).mnc[l] = *PLMNParamList.paramarray[l][ENB_MOBILE_NETWORK_CODE_IDX].uptr;
-          RRC_CONFIGURATION_REQ(msg_p).mnc_digit_length[l] = *PLMNParamList.paramarray[l][ENB_MNC_DIGIT_LENGTH].u8ptr;
-          AssertFatal(RRC_CONFIGURATION_REQ(msg_p).mnc_digit_length[l] == 3
-                      || RRC_CONFIGURATION_REQ(msg_p).mnc[l] < 100,
-                      "MNC %d cannot be encoded in two digits as requested (change mnc_digit_length to 3)\n",
-                      RRC_CONFIGURATION_REQ(msg_p).mnc[l]);
+          RRCcfg->mcc[l] = *PLMNParamList.paramarray[l][ENB_MOBILE_COUNTRY_CODE_IDX].uptr;
+          RRCcfg->mnc[l] = *PLMNParamList.paramarray[l][ENB_MOBILE_NETWORK_CODE_IDX].uptr;
+          RRCcfg->mnc_digit_length[l] = *PLMNParamList.paramarray[l][ENB_MNC_DIGIT_LENGTH].u8ptr;
+          AssertFatal(RRCcfg->mnc_digit_length[l] == 3 || RRCcfg->mnc[l] < 100, "MNC %d cannot be encoded in two digits as requested (change mnc_digit_length to 3)\n", RRCcfg->mnc[l]);
         }
 
         /* measurement reports enabled? */
         if (ENBParamList.paramarray[i][ENB_ENABLE_MEASUREMENT_REPORTS].strptr != NULL &&
             *(ENBParamList.paramarray[i][ENB_ENABLE_MEASUREMENT_REPORTS].strptr) != NULL &&
             !strcmp(*(ENBParamList.paramarray[i][ENB_ENABLE_MEASUREMENT_REPORTS].strptr), "yes"))
-          RRC_CONFIGURATION_REQ (msg_p).enable_measurement_reports = 1;
+          RRCcfg->enable_measurement_reports = 1;
         else
-          RRC_CONFIGURATION_REQ (msg_p).enable_measurement_reports = 0;
+          RRCcfg->enable_measurement_reports = 0;
 
         /* x2 enabled? */
         if (ENBParamList.paramarray[i][ENB_ENABLE_X2].strptr != NULL &&
             *(ENBParamList.paramarray[i][ENB_ENABLE_X2].strptr) != NULL &&
             !strcmp(*(ENBParamList.paramarray[i][ENB_ENABLE_X2].strptr), "yes"))
-          RRC_CONFIGURATION_REQ (msg_p).enable_x2 = 1;
+          RRCcfg->enable_x2 = 1;
         else
-          RRC_CONFIGURATION_REQ (msg_p).enable_x2 = 0;
+          RRCcfg->enable_x2 = 0;
 
        /* m2 enabled */
        if (ENBParamList.paramarray[i][ENB_ENABLE_ENB_M2].strptr != NULL &&
             *(ENBParamList.paramarray[i][ENB_ENABLE_ENB_M2].strptr) != NULL &&
             !strcmp(*(ENBParamList.paramarray[i][ENB_ENABLE_ENB_M2].strptr), "yes"))
-          RRC_CONFIGURATION_REQ (msg_p).eMBMS_M2_configured = 1;
+         RRCcfg->eMBMS_M2_configured = 1;
         else
-          RRC_CONFIGURATION_REQ (msg_p).eMBMS_M2_configured = 0;
+          RRCcfg->eMBMS_M2_configured = 0;
 
         // Parse optional physical parameters
         config_getlist( &CCsParamList,NULL,0,enbpath);
@@ -437,11 +434,11 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
             //printf("Component carrier %d\n",component_carrier);
             nb_cc++;
             // Cell params, MIB/SIB1 in DU
-            RRC_CONFIGURATION_REQ (msg_p).tdd_config[j] = ccparams_lte.tdd_config;
+            RRCcfg->tdd_config[j] = ccparams_lte.tdd_config;
             AssertFatal (ccparams_lte.tdd_config <= LTE_TDD_Config__subframeAssignment_sa6,
                          "Failed to parse eNB configuration file %s, enb %u illegal tdd_config %d (should be 0-%d)!",
                          RC.config_file_name, i, ccparams_lte.tdd_config, LTE_TDD_Config__subframeAssignment_sa6);
-            RRC_CONFIGURATION_REQ (msg_p).tdd_config_s[j] = ccparams_lte.tdd_config_s;
+            RRCcfg->tdd_config_s[j] = ccparams_lte.tdd_config_s;
             AssertFatal (ccparams_lte.tdd_config_s <= LTE_TDD_Config__specialSubframePatterns_ssp8,
                          "Failed to parse eNB configuration file %s, enb %u illegal tdd_config_s %d (should be 0-%d)!",
                          RC.config_file_name, i, ccparams_lte.tdd_config_s, LTE_TDD_Config__specialSubframePatterns_ssp8);
@@ -451,9 +448,9 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                            "Failed to parse eNB configuration file %s, enb %u define %s: NORMAL,EXTENDED!\n",
                            RC.config_file_name, i, ENB_CONFIG_STRING_PREFIX_TYPE);
             else if (strcmp(ccparams_lte.prefix_type, "NORMAL") == 0) {
-              RRC_CONFIGURATION_REQ (msg_p).prefix_type[j] = NORMAL;
+              RRCcfg->prefix_type[j] = NORMAL;
             } else  if (strcmp(ccparams_lte.prefix_type, "EXTENDED") == 0) {
-              RRC_CONFIGURATION_REQ (msg_p).prefix_type[j] = EXTENDED;
+              RRCcfg->prefix_type[j] = EXTENDED;
             } else {
               AssertFatal (0,
                            "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for prefix_type choice: NORMAL or EXTENDED !\n",
@@ -465,19 +462,19 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                            "Failed to parse eNB configuration file %s, enb %u define %s: TRUE,FALSE!\n",
                            RC.config_file_name, i, ENB_CONFIG_STRING_PBCH_REPETITION);
             else if (strcmp(ccparams_lte.pbch_repetition, "TRUE") == 0) {
-              RRC_CONFIGURATION_REQ (msg_p).pbch_repetition[j] = 1;
+              RRCcfg->pbch_repetition[j] = 1;
             } else  if (strcmp(ccparams_lte.pbch_repetition, "FALSE") == 0) {
-              RRC_CONFIGURATION_REQ (msg_p).pbch_repetition[j] = 0;
+              RRCcfg->pbch_repetition[j] = 0;
             } else {
               AssertFatal (0,
                            "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for pbch_repetition choice: TRUE or FALSE !\n",
                            RC.config_file_name, i, ccparams_lte.pbch_repetition);
             }
 
-            RRC_CONFIGURATION_REQ (msg_p).eutra_band[j] = ccparams_lte.eutra_band;
-            RRC_CONFIGURATION_REQ (msg_p).downlink_frequency[j] = (uint32_t) ccparams_lte.downlink_frequency;
-            RRC_CONFIGURATION_REQ (msg_p).uplink_frequency_offset[j] = (unsigned int) ccparams_lte.uplink_frequency_offset;
-            RRC_CONFIGURATION_REQ (msg_p).Nid_cell[j]= ccparams_lte.Nid_cell;
+            RRCcfg->eutra_band[j] = ccparams_lte.eutra_band;
+            RRCcfg->downlink_frequency[j] = (uint32_t)ccparams_lte.downlink_frequency;
+            RRCcfg->uplink_frequency_offset[j] = (unsigned int)ccparams_lte.uplink_frequency_offset;
+            RRCcfg->Nid_cell[j] = ccparams_lte.Nid_cell;
 
             if (ccparams_lte.Nid_cell>503) {
               AssertFatal (0,
@@ -485,7 +482,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                            RC.config_file_name, i, ccparams_lte.Nid_cell);
             }
 
-            RRC_CONFIGURATION_REQ (msg_p).N_RB_DL[j]= ccparams_lte.N_RB_DL;
+            RRCcfg->N_RB_DL[j] = ccparams_lte.N_RB_DL;
 
             if ((ccparams_lte.N_RB_DL!=6) &&
                 (ccparams_lte.N_RB_DL!=15) &&
@@ -499,20 +496,16 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
             }
 
             if (strcmp(ccparams_lte.frame_type, "FDD") == 0) {
-              RRC_CONFIGURATION_REQ (msg_p).frame_type[j] = FDD;
+              RRCcfg->frame_type[j] = FDD;
             } else  if (strcmp(ccparams_lte.frame_type, "TDD") == 0) {
-              RRC_CONFIGURATION_REQ (msg_p).frame_type[j] = TDD;
+              RRCcfg->frame_type[j] = TDD;
             } else {
               AssertFatal (0,
                            "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for frame_type choice: FDD or TDD !\n",
                            RC.config_file_name, i, ccparams_lte.frame_type);
             }
 
-            if (config_check_band_frequencies(j,
-                                              RRC_CONFIGURATION_REQ (msg_p).eutra_band[j],
-                                              RRC_CONFIGURATION_REQ (msg_p).downlink_frequency[j],
-                                              RRC_CONFIGURATION_REQ (msg_p).uplink_frequency_offset[j],
-                                              RRC_CONFIGURATION_REQ (msg_p).frame_type[j])) {
+            if (config_check_band_frequencies(j, RRCcfg->eutra_band[j], RRCcfg->downlink_frequency[j], RRCcfg->uplink_frequency_offset[j], RRCcfg->frame_type[j])) {
               AssertFatal(0, "error calling enb_check_band_frequencies\n");
             }
 
@@ -521,18 +514,18 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                            "Failed to parse eNB configuration file %s, enb %u unknown value \"%d\" for nb_antenna_ports choice: 1..2 !\n",
                            RC.config_file_name, i, ccparams_lte.nb_antenna_ports);
 
-            RRC_CONFIGURATION_REQ (msg_p).nb_antenna_ports[j] = ccparams_lte.nb_antenna_ports;
+            RRCcfg->nb_antenna_ports[j] = ccparams_lte.nb_antenna_ports;
 
             if (!NODE_IS_DU(rrc->node_type)) { //this is CU or eNB, SIB2-20 in CU
               // Radio Resource Configuration (SIB2)
-              RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].prach_root =  ccparams_lte.prach_root;
+              RRCcfg->radioresourceconfig[j].prach_root = ccparams_lte.prach_root;
 
               if ((ccparams_lte.prach_root <0) || (ccparams_lte.prach_root > 1023))
                 AssertFatal (0,
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%d\" for prach_root choice: 0..1023 !\n",
                              RC.config_file_name, i, ccparams_lte.prach_root);
 
-              RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].prach_config_index = ccparams_lte.prach_config_index;
+              RRCcfg->radioresourceconfig[j].prach_config_index = ccparams_lte.prach_config_index;
 
               if ((ccparams_lte.prach_config_index <0) || (ccparams_lte.prach_config_index > 63))
                 AssertFatal (0,
@@ -544,15 +537,15 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                              "Failed to parse eNB configuration file %s, enb %u define %s: ENABLE,DISABLE!\n",
                              RC.config_file_name, i, ENB_CONFIG_STRING_PRACH_HIGH_SPEED);
               else if (strcmp(ccparams_lte.prach_high_speed, "ENABLE") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].prach_high_speed = true;
+                RRCcfg->radioresourceconfig[j].prach_high_speed = true;
               } else if (strcmp(ccparams_lte.prach_high_speed, "DISABLE") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].prach_high_speed = false;
+                RRCcfg->radioresourceconfig[j].prach_high_speed = false;
               } else
                 AssertFatal (0,
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for prach_config choice: ENABLE,DISABLE !\n",
                              RC.config_file_name, i, ccparams_lte.prach_high_speed);
 
-              RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].prach_zero_correlation = ccparams_lte.prach_zero_correlation;
+              RRCcfg->radioresourceconfig[j].prach_zero_correlation = ccparams_lte.prach_zero_correlation;
 
               if ((ccparams_lte.prach_zero_correlation <0) ||
                   (ccparams_lte.prach_zero_correlation > 15))
@@ -560,7 +553,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%d\" for prach_zero_correlation choice: 0..15!\n",
                              RC.config_file_name, i, ccparams_lte.prach_zero_correlation);
 
-              RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].prach_freq_offset = ccparams_lte.prach_freq_offset;
+              RRCcfg->radioresourceconfig[j].prach_freq_offset = ccparams_lte.prach_freq_offset;
 
               if ((ccparams_lte.prach_freq_offset <0) ||
                   (ccparams_lte.prach_freq_offset > 94))
@@ -568,7 +561,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%d\" for prach_freq_offset choice: 0..94!\n",
                              RC.config_file_name, i, ccparams_lte.prach_freq_offset);
 
-              RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_delta_shift = ccparams_lte.pucch_delta_shift-1;
+              RRCcfg->radioresourceconfig[j].pucch_delta_shift = ccparams_lte.pucch_delta_shift - 1;
 
               if ((ccparams_lte.pucch_delta_shift <1) ||
                   (ccparams_lte.pucch_delta_shift > 3))
@@ -576,7 +569,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%d\" for pucch_delta_shift choice: 1..3!\n",
                              RC.config_file_name, i, ccparams_lte.pucch_delta_shift);
 
-              RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_nRB_CQI = ccparams_lte.pucch_nRB_CQI;
+              RRCcfg->radioresourceconfig[j].pucch_nRB_CQI = ccparams_lte.pucch_nRB_CQI;
 
               if ((ccparams_lte.pucch_nRB_CQI <0) ||
                   (ccparams_lte.pucch_nRB_CQI > 98))
@@ -584,7 +577,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%d\" for pucch_nRB_CQI choice: 0..98!\n",
                              RC.config_file_name, i, ccparams_lte.pucch_nRB_CQI);
 
-              RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_nCS_AN = ccparams_lte.pucch_nCS_AN;
+              RRCcfg->radioresourceconfig[j].pucch_nCS_AN = ccparams_lte.pucch_nCS_AN;
 
               if ((ccparams_lte.pucch_nCS_AN <0) ||
                   (ccparams_lte.pucch_nCS_AN > 7))
@@ -592,7 +585,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%d\" for pucch_nCS_AN choice: 0..7!\n",
                              RC.config_file_name, i, ccparams_lte.pucch_nCS_AN);
 
-              RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_n1_AN = ccparams_lte.pucch_n1_AN;
+              RRCcfg->radioresourceconfig[j].pucch_n1_AN = ccparams_lte.pucch_n1_AN;
 
               if ((ccparams_lte.pucch_n1_AN <0) ||
                   (ccparams_lte.pucch_n1_AN > 2047))
@@ -600,7 +593,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%d\" for pucch_n1_AN choice: 0..2047!\n",
                              RC.config_file_name, i, ccparams_lte.pucch_n1_AN);
 
-              RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pdsch_referenceSignalPower = ccparams_lte.pdsch_referenceSignalPower;
+              RRCcfg->radioresourceconfig[j].pdsch_referenceSignalPower = ccparams_lte.pdsch_referenceSignalPower;
 
               if ((ccparams_lte.pdsch_referenceSignalPower <-60) ||
                   (ccparams_lte.pdsch_referenceSignalPower > 50))
@@ -608,7 +601,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%d\" for pdsch_referenceSignalPower choice:-60..50!\n",
                              RC.config_file_name, i, ccparams_lte.pdsch_referenceSignalPower);
 
-              RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pdsch_p_b = ccparams_lte.pdsch_p_b;
+              RRCcfg->radioresourceconfig[j].pdsch_p_b = ccparams_lte.pdsch_p_b;
 
               if ((ccparams_lte.pdsch_p_b <0) ||
                   (ccparams_lte.pdsch_p_b > 3))
@@ -616,7 +609,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%d\" for pdsch_p_b choice: 0..3!\n",
                              RC.config_file_name, i, ccparams_lte.pdsch_p_b);
 
-              RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_n_SB = ccparams_lte.pusch_n_SB;
+              RRCcfg->radioresourceconfig[j].pusch_n_SB = ccparams_lte.pusch_n_SB;
 
               if ((ccparams_lte.pusch_n_SB <1) ||
                   (ccparams_lte.pusch_n_SB > 4))
@@ -629,15 +622,15 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                              "Failed to parse eNB configuration file %s, enb %u define %s: interSubframe,intraAndInterSubframe!\n",
                              RC.config_file_name, i, ENB_CONFIG_STRING_PUSCH_HOPPINGMODE);
               else if (strcmp(ccparams_lte.pusch_hoppingMode,"interSubFrame")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_hoppingMode = LTE_PUSCH_ConfigCommon__pusch_ConfigBasic__hoppingMode_interSubFrame;
+                RRCcfg->radioresourceconfig[j].pusch_hoppingMode = LTE_PUSCH_ConfigCommon__pusch_ConfigBasic__hoppingMode_interSubFrame;
               } else if (strcmp(ccparams_lte.pusch_hoppingMode,"intraAndInterSubFrame")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_hoppingMode = LTE_PUSCH_ConfigCommon__pusch_ConfigBasic__hoppingMode_intraAndInterSubFrame;
+                RRCcfg->radioresourceconfig[j].pusch_hoppingMode = LTE_PUSCH_ConfigCommon__pusch_ConfigBasic__hoppingMode_intraAndInterSubFrame;
               } else
                 AssertFatal (0,
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for pusch_hoppingMode choice: interSubframe,intraAndInterSubframe!\n",
                              RC.config_file_name, i, ccparams_lte.pusch_hoppingMode);
 
-              RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_hoppingOffset = ccparams_lte.pusch_hoppingOffset;
+              RRCcfg->radioresourceconfig[j].pusch_hoppingOffset = ccparams_lte.pusch_hoppingOffset;
 
               if ((ccparams_lte.pusch_hoppingOffset<0) ||
                   (ccparams_lte.pusch_hoppingOffset>98))
@@ -650,9 +643,9 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                              "Failed to parse eNB configuration file %s, enb %u define %s: ENABLE,DISABLE!\n",
                              RC.config_file_name, i, ENB_CONFIG_STRING_PUSCH_ENABLE64QAM);
               else if (strcmp(ccparams_lte.pusch_enable64QAM, "ENABLE") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_enable64QAM = true;
+                RRCcfg->radioresourceconfig[j].pusch_enable64QAM = true;
               } else if (strcmp(ccparams_lte.pusch_enable64QAM, "DISABLE") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_enable64QAM = false;
+                RRCcfg->radioresourceconfig[j].pusch_enable64QAM = false;
               } else
                 AssertFatal (0,
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for pusch_enable64QAM choice: ENABLE,DISABLE!\n",
@@ -663,15 +656,15 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                              "Failed to parse eNB configuration file %s, enb %u define %s: ENABLE,DISABLE!\n",
                              RC.config_file_name, i, ENB_CONFIG_STRING_PUSCH_GROUP_HOPPING_EN);
               else if (strcmp(ccparams_lte.pusch_groupHoppingEnabled, "ENABLE") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_groupHoppingEnabled = true;
+                RRCcfg->radioresourceconfig[j].pusch_groupHoppingEnabled = true;
               } else if (strcmp(ccparams_lte.pusch_groupHoppingEnabled, "DISABLE") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_groupHoppingEnabled= false;
+                RRCcfg->radioresourceconfig[j].pusch_groupHoppingEnabled = false;
               } else
                 AssertFatal (0,
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for pusch_groupHoppingEnabled choice: ENABLE,DISABLE!\n",
                              RC.config_file_name, i, ccparams_lte.pusch_groupHoppingEnabled);
 
-              RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_groupAssignment = ccparams_lte.pusch_groupAssignment;
+              RRCcfg->radioresourceconfig[j].pusch_groupAssignment = ccparams_lte.pusch_groupAssignment;
 
               if ((ccparams_lte.pusch_groupAssignment<0)||
                   (ccparams_lte.pusch_groupAssignment>29))
@@ -684,15 +677,15 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                              "Failed to parse eNB configuration file %s, enb %u define %s: ENABLE,DISABLE!\n",
                              RC.config_file_name, i, ENB_CONFIG_STRING_PUSCH_SEQUENCE_HOPPING_EN);
               else if (strcmp(ccparams_lte.pusch_sequenceHoppingEnabled, "ENABLE") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_sequenceHoppingEnabled = true;
+                RRCcfg->radioresourceconfig[j].pusch_sequenceHoppingEnabled = true;
               } else if (strcmp(ccparams_lte.pusch_sequenceHoppingEnabled, "DISABLE") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_sequenceHoppingEnabled = false;
+                RRCcfg->radioresourceconfig[j].pusch_sequenceHoppingEnabled = false;
               } else
                 AssertFatal (0,
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for pusch_sequenceHoppingEnabled choice: ENABLE,DISABLE!\n",
                              RC.config_file_name, i, ccparams_lte.pusch_sequenceHoppingEnabled);
 
-              RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_nDMRS1= ccparams_lte.pusch_nDMRS1;  //cyclic_shift in RRC!
+              RRCcfg->radioresourceconfig[j].pusch_nDMRS1 = ccparams_lte.pusch_nDMRS1; // cyclic_shift in RRC!
 
               if ((ccparams_lte.pusch_nDMRS1 <0) ||
                   (ccparams_lte.pusch_nDMRS1>7))
@@ -701,49 +694,51 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                              RC.config_file_name, i, ccparams_lte.pusch_nDMRS1);
 
               if (strcmp(ccparams_lte.phich_duration,"NORMAL")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].phich_duration= LTE_PHICH_Config__phich_Duration_normal;
+                RRCcfg->radioresourceconfig[j].phich_duration = LTE_PHICH_Config__phich_Duration_normal;
               } else if (strcmp(ccparams_lte.phich_duration,"EXTENDED")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].phich_duration= LTE_PHICH_Config__phich_Duration_extended;
+                RRCcfg->radioresourceconfig[j].phich_duration = LTE_PHICH_Config__phich_Duration_extended;
               } else
                 AssertFatal (0,
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for phich_duration choice: NORMAL,EXTENDED!\n",
                              RC.config_file_name, i, ccparams_lte.phich_duration);
 
               if (strcmp(ccparams_lte.phich_resource,"ONESIXTH")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].phich_resource= LTE_PHICH_Config__phich_Resource_oneSixth ;
+                RRCcfg->radioresourceconfig[j].phich_resource = LTE_PHICH_Config__phich_Resource_oneSixth;
               } else if (strcmp(ccparams_lte.phich_resource,"HALF")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].phich_resource= LTE_PHICH_Config__phich_Resource_half;
+                RRCcfg->radioresourceconfig[j].phich_resource = LTE_PHICH_Config__phich_Resource_half;
               } else if (strcmp(ccparams_lte.phich_resource,"ONE")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].phich_resource= LTE_PHICH_Config__phich_Resource_one;
+                RRCcfg->radioresourceconfig[j].phich_resource = LTE_PHICH_Config__phich_Resource_one;
               } else if (strcmp(ccparams_lte.phich_resource,"TWO")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].phich_resource= LTE_PHICH_Config__phich_Resource_two;
+                RRCcfg->radioresourceconfig[j].phich_resource = LTE_PHICH_Config__phich_Resource_two;
               } else
                 AssertFatal (0,
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for phich_resource choice: ONESIXTH,HALF,ONE,TWO!\n",
                              RC.config_file_name, i, ccparams_lte.phich_resource);
 
               printf("phich.resource %ld (%s), phich.duration %ld (%s)\n",
-                     RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].phich_resource,ccparams_lte.phich_resource,
-                     RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].phich_duration,ccparams_lte.phich_duration);
+                     RRCcfg->radioresourceconfig[j].phich_resource,
+                     ccparams_lte.phich_resource,
+                     RRCcfg->radioresourceconfig[j].phich_duration,
+                     ccparams_lte.phich_duration);
 
               if (strcmp(ccparams_lte.srs_enable, "ENABLE") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].srs_enable= true;
+                RRCcfg->radioresourceconfig[j].srs_enable = true;
               } else if (strcmp(ccparams_lte.srs_enable, "DISABLE") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].srs_enable= false;
+                RRCcfg->radioresourceconfig[j].srs_enable = false;
               } else
                 AssertFatal (0,
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for srs_BandwidthConfig choice: ENABLE,DISABLE !\n",
                              RC.config_file_name, i, ccparams_lte.srs_enable);
 
-              if (RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].srs_enable== true) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].srs_BandwidthConfig= ccparams_lte.srs_BandwidthConfig;
+              if (RRCcfg->radioresourceconfig[j].srs_enable == true) {
+                RRCcfg->radioresourceconfig[j].srs_BandwidthConfig = ccparams_lte.srs_BandwidthConfig;
 
                 if ((ccparams_lte.srs_BandwidthConfig < 0) ||
                     (ccparams_lte.srs_BandwidthConfig >7))
                   AssertFatal (0, "Failed to parse eNB configuration file %s, enb %u unknown value %d for srs_BandwidthConfig choice: 0...7\n",
                                RC.config_file_name, i, ccparams_lte.srs_BandwidthConfig);
 
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].srs_SubframeConfig= ccparams_lte.srs_SubframeConfig;
+                RRCcfg->radioresourceconfig[j].srs_SubframeConfig = ccparams_lte.srs_SubframeConfig;
 
                 if ((ccparams_lte.srs_SubframeConfig<0) ||
                     (ccparams_lte.srs_SubframeConfig>15))
@@ -752,25 +747,25 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                                RC.config_file_name, i, ccparams_lte.srs_SubframeConfig);
 
                 if (strcmp(ccparams_lte.srs_ackNackST, "ENABLE") == 0) {
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].srs_ackNackST= true;
+                  RRCcfg->radioresourceconfig[j].srs_ackNackST = true;
                 } else if (strcmp(ccparams_lte.srs_ackNackST, "DISABLE") == 0) {
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].srs_ackNackST= false;
+                  RRCcfg->radioresourceconfig[j].srs_ackNackST = false;
                 } else
                   AssertFatal (0,
                                "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for srs_BandwidthConfig choice: ENABLE,DISABLE !\n",
                                RC.config_file_name, i, ccparams_lte.srs_ackNackST);
 
                 if (strcmp(ccparams_lte.srs_MaxUpPts, "ENABLE") == 0) {
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].srs_MaxUpPts= true;
+                  RRCcfg->radioresourceconfig[j].srs_MaxUpPts = true;
                 } else if (strcmp(ccparams_lte.srs_MaxUpPts, "DISABLE") == 0) {
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].srs_MaxUpPts= false;
+                  RRCcfg->radioresourceconfig[j].srs_MaxUpPts = false;
                 } else
                   AssertFatal (0,
                                "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for srs_MaxUpPts choice: ENABLE,DISABLE !\n",
                                RC.config_file_name, i, ccparams_lte.srs_MaxUpPts);
               }
 
-              RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_p0_Nominal= ccparams_lte.pusch_p0_Nominal;
+              RRCcfg->radioresourceconfig[j].pusch_p0_Nominal = ccparams_lte.pusch_p0_Nominal;
 
               if ((ccparams_lte.pusch_p0_Nominal<-126) ||
                   (ccparams_lte.pusch_p0_Nominal>24))
@@ -779,27 +774,27 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                              RC.config_file_name, i, ccparams_lte.pusch_p0_Nominal);
 
               if (strcmp(ccparams_lte.pusch_alpha,"AL0")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_alpha= LTE_Alpha_r12_al0;
+                RRCcfg->radioresourceconfig[j].pusch_alpha = LTE_Alpha_r12_al0;
               } else if (strcmp(ccparams_lte.pusch_alpha,"AL04")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_alpha= LTE_Alpha_r12_al04;
+                RRCcfg->radioresourceconfig[j].pusch_alpha = LTE_Alpha_r12_al04;
               } else if (strcmp(ccparams_lte.pusch_alpha,"AL05")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_alpha= LTE_Alpha_r12_al05;
+                RRCcfg->radioresourceconfig[j].pusch_alpha = LTE_Alpha_r12_al05;
               } else if (strcmp(ccparams_lte.pusch_alpha,"AL06")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_alpha= LTE_Alpha_r12_al06;
+                RRCcfg->radioresourceconfig[j].pusch_alpha = LTE_Alpha_r12_al06;
               } else if (strcmp(ccparams_lte.pusch_alpha,"AL07")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_alpha= LTE_Alpha_r12_al07;
+                RRCcfg->radioresourceconfig[j].pusch_alpha = LTE_Alpha_r12_al07;
               } else if (strcmp(ccparams_lte.pusch_alpha,"AL08")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_alpha= LTE_Alpha_r12_al08;
+                RRCcfg->radioresourceconfig[j].pusch_alpha = LTE_Alpha_r12_al08;
               } else if (strcmp(ccparams_lte.pusch_alpha,"AL09")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_alpha= LTE_Alpha_r12_al09;
+                RRCcfg->radioresourceconfig[j].pusch_alpha = LTE_Alpha_r12_al09;
               } else if (strcmp(ccparams_lte.pusch_alpha,"AL1")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_alpha= LTE_Alpha_r12_al1;
+                RRCcfg->radioresourceconfig[j].pusch_alpha = LTE_Alpha_r12_al1;
               } else
                 AssertFatal (0,
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for pucch_Alpha choice: AL0,AL04,AL05,AL06,AL07,AL08,AL09,AL1!\n",
                              RC.config_file_name, i, ccparams_lte.pusch_alpha);
 
-              RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_p0_Nominal= ccparams_lte.pucch_p0_Nominal;
+              RRCcfg->radioresourceconfig[j].pucch_p0_Nominal = ccparams_lte.pucch_p0_Nominal;
 
               if ((ccparams_lte.pucch_p0_Nominal<-127) ||
                   (ccparams_lte.pucch_p0_Nominal>-96))
@@ -807,7 +802,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%d\" for pucch_p0_Nominal choice: -127..-96 !\n",
                              RC.config_file_name, i, ccparams_lte.pucch_p0_Nominal);
 
-              RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].msg3_delta_Preamble= ccparams_lte.msg3_delta_Preamble;
+              RRCcfg->radioresourceconfig[j].msg3_delta_Preamble = ccparams_lte.msg3_delta_Preamble;
 
               if ((ccparams_lte.msg3_delta_Preamble<-1) ||
                   (ccparams_lte.msg3_delta_Preamble>6))
@@ -816,63 +811,63 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                              RC.config_file_name, i, ccparams_lte.msg3_delta_Preamble);
 
               if (strcmp(ccparams_lte.pucch_deltaF_Format1,"deltaF_2")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_deltaF_Format1= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1_deltaF_2;
+                RRCcfg->radioresourceconfig[j].pucch_deltaF_Format1 = LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1_deltaF_2;
               } else if (strcmp(ccparams_lte.pucch_deltaF_Format1,"deltaF0")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_deltaF_Format1= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1_deltaF0;
+                RRCcfg->radioresourceconfig[j].pucch_deltaF_Format1 = LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1_deltaF0;
               } else if (strcmp(ccparams_lte.pucch_deltaF_Format1,"deltaF2")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_deltaF_Format1= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1_deltaF2;
+                RRCcfg->radioresourceconfig[j].pucch_deltaF_Format1 = LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1_deltaF2;
               } else
                 AssertFatal (0,
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for pucch_deltaF_Format1 choice: deltaF_2,dltaF0,deltaF2!\n",
                              RC.config_file_name, i, ccparams_lte.pucch_deltaF_Format1);
 
               if (strcmp(ccparams_lte.pucch_deltaF_Format1b,"deltaF1")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_deltaF_Format1b= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1b_deltaF1;
+                RRCcfg->radioresourceconfig[j].pucch_deltaF_Format1b = LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1b_deltaF1;
               } else if (strcmp(ccparams_lte.pucch_deltaF_Format1b,"deltaF3")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_deltaF_Format1b= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1b_deltaF3;
+                RRCcfg->radioresourceconfig[j].pucch_deltaF_Format1b = LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1b_deltaF3;
               } else if (strcmp(ccparams_lte.pucch_deltaF_Format1b,"deltaF5")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_deltaF_Format1b= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1b_deltaF5;
+                RRCcfg->radioresourceconfig[j].pucch_deltaF_Format1b = LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1b_deltaF5;
               } else
                 AssertFatal (0,
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for pucch_deltaF_Format1b choice: deltaF1,dltaF3,deltaF5!\n",
                              RC.config_file_name, i, ccparams_lte.pucch_deltaF_Format1b);
 
               if (strcmp(ccparams_lte.pucch_deltaF_Format2,"deltaF_2")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_deltaF_Format2= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF_2;
+                RRCcfg->radioresourceconfig[j].pucch_deltaF_Format2 = LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF_2;
               } else if (strcmp(ccparams_lte.pucch_deltaF_Format2,"deltaF0")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_deltaF_Format2= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF0;
+                RRCcfg->radioresourceconfig[j].pucch_deltaF_Format2 = LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF0;
               } else if (strcmp(ccparams_lte.pucch_deltaF_Format2,"deltaF1")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_deltaF_Format2= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF1;
+                RRCcfg->radioresourceconfig[j].pucch_deltaF_Format2 = LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF1;
               } else if (strcmp(ccparams_lte.pucch_deltaF_Format2,"deltaF2")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_deltaF_Format2= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF2;
+                RRCcfg->radioresourceconfig[j].pucch_deltaF_Format2 = LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF2;
               } else
                 AssertFatal (0,
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for pucch_deltaF_Format2 choice: deltaF_2,dltaF0,deltaF1,deltaF2!\n",
                              RC.config_file_name, i, ccparams_lte.pucch_deltaF_Format2);
 
               if (strcmp(ccparams_lte.pucch_deltaF_Format2a,"deltaF_2")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_deltaF_Format2a= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2a_deltaF_2;
+                RRCcfg->radioresourceconfig[j].pucch_deltaF_Format2a = LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2a_deltaF_2;
               } else if (strcmp(ccparams_lte.pucch_deltaF_Format2a,"deltaF0")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_deltaF_Format2a= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2a_deltaF0;
+                RRCcfg->radioresourceconfig[j].pucch_deltaF_Format2a = LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2a_deltaF0;
               } else if (strcmp(ccparams_lte.pucch_deltaF_Format2a,"deltaF2")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_deltaF_Format2a= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2a_deltaF2;
+                RRCcfg->radioresourceconfig[j].pucch_deltaF_Format2a = LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2a_deltaF2;
               } else
                 AssertFatal (0,
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for pucch_deltaF_Format2a choice: deltaF_2,dltaF0,deltaF2!\n",
                              RC.config_file_name, i, ccparams_lte.pucch_deltaF_Format2a);
 
               if (strcmp(ccparams_lte.pucch_deltaF_Format2b,"deltaF_2")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_deltaF_Format2b= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2b_deltaF_2;
+                RRCcfg->radioresourceconfig[j].pucch_deltaF_Format2b = LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2b_deltaF_2;
               } else if (strcmp(ccparams_lte.pucch_deltaF_Format2b,"deltaF0")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_deltaF_Format2b= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2b_deltaF0;
+                RRCcfg->radioresourceconfig[j].pucch_deltaF_Format2b = LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2b_deltaF0;
               } else if (strcmp(ccparams_lte.pucch_deltaF_Format2b,"deltaF2")==0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_deltaF_Format2b= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2b_deltaF2;
+                RRCcfg->radioresourceconfig[j].pucch_deltaF_Format2b = LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2b_deltaF2;
               } else
                 AssertFatal (0,
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for pucch_deltaF_Format2b choice: deltaF_2,dltaF0,deltaF2!\n",
                              RC.config_file_name, i, ccparams_lte.pucch_deltaF_Format2b);
 
-              RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_numberOfRA_Preambles= (ccparams_lte.rach_numberOfRA_Preambles/4)-1;
+              RRCcfg->radioresourceconfig[j].rach_numberOfRA_Preambles = (ccparams_lte.rach_numberOfRA_Preambles / 4) - 1;
 
               if ((ccparams_lte.rach_numberOfRA_Preambles <4) ||
                   (ccparams_lte.rach_numberOfRA_Preambles>64) ||
@@ -882,8 +877,8 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                              RC.config_file_name, i, ccparams_lte.rach_numberOfRA_Preambles);
 
               if (strcmp(ccparams_lte.rach_preamblesGroupAConfig, "ENABLE") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_preamblesGroupAConfig= true;
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_sizeOfRA_PreamblesGroupA= (ccparams_lte.rach_sizeOfRA_PreamblesGroupA/4)-1;
+                RRCcfg->radioresourceconfig[j].rach_preamblesGroupAConfig = true;
+                RRCcfg->radioresourceconfig[j].rach_sizeOfRA_PreamblesGroupA = (ccparams_lte.rach_sizeOfRA_PreamblesGroupA / 4) - 1;
 
                 if ((ccparams_lte.rach_numberOfRA_Preambles <4) ||
                     (ccparams_lte.rach_numberOfRA_Preambles>60) ||
@@ -894,19 +889,19 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
 
                 switch (ccparams_lte.rach_messageSizeGroupA) {
                   case 56:
-                    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_messageSizeGroupA= LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messageSizeGroupA_b56;
+                    RRCcfg->radioresourceconfig[j].rach_messageSizeGroupA = LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messageSizeGroupA_b56;
                     break;
 
                   case 144:
-                    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_messageSizeGroupA= LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messageSizeGroupA_b144;
+                    RRCcfg->radioresourceconfig[j].rach_messageSizeGroupA = LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messageSizeGroupA_b144;
                     break;
 
                   case 208:
-                    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_messageSizeGroupA= LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messageSizeGroupA_b208;
+                    RRCcfg->radioresourceconfig[j].rach_messageSizeGroupA = LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messageSizeGroupA_b208;
                     break;
 
                   case 256:
-                    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_messageSizeGroupA= LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messageSizeGroupA_b256;
+                    RRCcfg->radioresourceconfig[j].rach_messageSizeGroupA = LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messageSizeGroupA_b256;
                     break;
 
                   default:
@@ -917,33 +912,33 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                 }
 
                 if (strcmp(ccparams_lte.rach_messagePowerOffsetGroupB,"minusinfinity")==0) {
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_messagePowerOffsetGroupB= LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_minusinfinity;
+                  RRCcfg->radioresourceconfig[j].rach_messagePowerOffsetGroupB = LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_minusinfinity;
                 } else if (strcmp(ccparams_lte.rach_messagePowerOffsetGroupB,"dB0")==0) {
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_messagePowerOffsetGroupB= LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB0;
+                  RRCcfg->radioresourceconfig[j].rach_messagePowerOffsetGroupB = LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB0;
                 } else if (strcmp(ccparams_lte.rach_messagePowerOffsetGroupB,"dB5")==0) {
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_messagePowerOffsetGroupB= LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB5;
+                  RRCcfg->radioresourceconfig[j].rach_messagePowerOffsetGroupB = LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB5;
                 } else if (strcmp(ccparams_lte.rach_messagePowerOffsetGroupB,"dB8")==0) {
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_messagePowerOffsetGroupB= LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB8;
+                  RRCcfg->radioresourceconfig[j].rach_messagePowerOffsetGroupB = LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB8;
                 } else if (strcmp(ccparams_lte.rach_messagePowerOffsetGroupB,"dB10")==0) {
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_messagePowerOffsetGroupB= LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB10;
+                  RRCcfg->radioresourceconfig[j].rach_messagePowerOffsetGroupB = LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB10;
                 } else if (strcmp(ccparams_lte.rach_messagePowerOffsetGroupB,"dB12")==0) {
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_messagePowerOffsetGroupB= LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB12;
+                  RRCcfg->radioresourceconfig[j].rach_messagePowerOffsetGroupB = LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB12;
                 } else if (strcmp(ccparams_lte.rach_messagePowerOffsetGroupB,"dB15")==0) {
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_messagePowerOffsetGroupB= LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB15;
+                  RRCcfg->radioresourceconfig[j].rach_messagePowerOffsetGroupB = LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB15;
                 } else if (strcmp(ccparams_lte.rach_messagePowerOffsetGroupB,"dB18")==0) {
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_messagePowerOffsetGroupB= LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB18;
+                  RRCcfg->radioresourceconfig[j].rach_messagePowerOffsetGroupB = LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB18;
                 } else
                   AssertFatal (0,
                                "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for rach_messagePowerOffsetGroupB choice: minusinfinity,dB0,dB5,dB8,dB10,dB12,dB15,dB18!\n",
                                RC.config_file_name, i, ccparams_lte.rach_messagePowerOffsetGroupB);
               } else if (strcmp(ccparams_lte.rach_preamblesGroupAConfig, "DISABLE") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_preamblesGroupAConfig= false;
+                RRCcfg->radioresourceconfig[j].rach_preamblesGroupAConfig = false;
               } else
                 AssertFatal (0,
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for rach_preamblesGroupAConfig choice: ENABLE,DISABLE !\n",
                              RC.config_file_name, i, ccparams_lte.rach_preamblesGroupAConfig);
 
-              RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_preambleInitialReceivedTargetPower= (ccparams_lte.rach_preambleInitialReceivedTargetPower+120)/2;
+              RRCcfg->radioresourceconfig[j].rach_preambleInitialReceivedTargetPower = (ccparams_lte.rach_preambleInitialReceivedTargetPower + 120) / 2;
 
               if ((ccparams_lte.rach_preambleInitialReceivedTargetPower<-120) ||
                   (ccparams_lte.rach_preambleInitialReceivedTargetPower>-90) ||
@@ -952,7 +947,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%d\" for rach_preambleInitialReceivedTargetPower choice: -120,-118,...,-90 !\n",
                              RC.config_file_name, i, ccparams_lte.rach_preambleInitialReceivedTargetPower);
 
-              RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_powerRampingStep= ccparams_lte.rach_powerRampingStep/2;
+              RRCcfg->radioresourceconfig[j].rach_powerRampingStep = ccparams_lte.rach_powerRampingStep / 2;
 
               if ((ccparams_lte.rach_powerRampingStep<0) ||
                   (ccparams_lte.rach_powerRampingStep>6) ||
@@ -963,47 +958,47 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
 
               switch (ccparams_lte.rach_preambleTransMax) {
                 case 3:
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_preambleTransMax= LTE_PreambleTransMax_n3;
+                  RRCcfg->radioresourceconfig[j].rach_preambleTransMax = LTE_PreambleTransMax_n3;
                   break;
 
                 case 4:
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_preambleTransMax= LTE_PreambleTransMax_n4;
+                  RRCcfg->radioresourceconfig[j].rach_preambleTransMax = LTE_PreambleTransMax_n4;
                   break;
 
                 case 5:
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_preambleTransMax= LTE_PreambleTransMax_n5;
+                  RRCcfg->radioresourceconfig[j].rach_preambleTransMax = LTE_PreambleTransMax_n5;
                   break;
 
                 case 6:
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_preambleTransMax= LTE_PreambleTransMax_n6;
+                  RRCcfg->radioresourceconfig[j].rach_preambleTransMax = LTE_PreambleTransMax_n6;
                   break;
 
                 case 7:
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_preambleTransMax= LTE_PreambleTransMax_n7;
+                  RRCcfg->radioresourceconfig[j].rach_preambleTransMax = LTE_PreambleTransMax_n7;
                   break;
 
                 case 8:
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_preambleTransMax= LTE_PreambleTransMax_n8;
+                  RRCcfg->radioresourceconfig[j].rach_preambleTransMax = LTE_PreambleTransMax_n8;
                   break;
 
                 case 10:
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_preambleTransMax= LTE_PreambleTransMax_n10;
+                  RRCcfg->radioresourceconfig[j].rach_preambleTransMax = LTE_PreambleTransMax_n10;
                   break;
 
                 case 20:
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_preambleTransMax= LTE_PreambleTransMax_n20;
+                  RRCcfg->radioresourceconfig[j].rach_preambleTransMax = LTE_PreambleTransMax_n20;
                   break;
 
                 case 50:
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_preambleTransMax= LTE_PreambleTransMax_n50;
+                  RRCcfg->radioresourceconfig[j].rach_preambleTransMax = LTE_PreambleTransMax_n50;
                   break;
 
                 case 100:
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_preambleTransMax= LTE_PreambleTransMax_n100;
+                  RRCcfg->radioresourceconfig[j].rach_preambleTransMax = LTE_PreambleTransMax_n100;
                   break;
 
                 case 200:
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_preambleTransMax= LTE_PreambleTransMax_n200;
+                  RRCcfg->radioresourceconfig[j].rach_preambleTransMax = LTE_PreambleTransMax_n200;
                   break;
 
                 default:
@@ -1013,7 +1008,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                   break;
               }
 
-              RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_raResponseWindowSize=  (ccparams_lte.rach_raResponseWindowSize==10)?7:ccparams_lte.rach_raResponseWindowSize-2;
+              RRCcfg->radioresourceconfig[j].rach_raResponseWindowSize = (ccparams_lte.rach_raResponseWindowSize == 10) ? 7 : ccparams_lte.rach_raResponseWindowSize - 2;
 
               if ((ccparams_lte.rach_raResponseWindowSize<0)||
                   (ccparams_lte.rach_raResponseWindowSize==9)||
@@ -1022,7 +1017,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%d\" for rach_raResponseWindowSize choice: 2,3,4,5,6,7,8,10!\n",
                              RC.config_file_name, i, ccparams_lte.rach_preambleTransMax);
 
-              RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_macContentionResolutionTimer= (ccparams_lte.rach_macContentionResolutionTimer/8)-1;
+              RRCcfg->radioresourceconfig[j].rach_macContentionResolutionTimer = (ccparams_lte.rach_macContentionResolutionTimer / 8) - 1;
 
               if ((ccparams_lte.rach_macContentionResolutionTimer<8) ||
                   (ccparams_lte.rach_macContentionResolutionTimer>64) ||
@@ -1031,7 +1026,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%d\" for rach_macContentionResolutionTimer choice: 8,16,...,56,64!\n",
                              RC.config_file_name, i, ccparams_lte.rach_preambleTransMax);
 
-              RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_maxHARQ_Msg3Tx= ccparams_lte.rach_maxHARQ_Msg3Tx;
+              RRCcfg->radioresourceconfig[j].rach_maxHARQ_Msg3Tx = ccparams_lte.rach_maxHARQ_Msg3Tx;
 
               if ((ccparams_lte.rach_maxHARQ_Msg3Tx<0) ||
                   (ccparams_lte.rach_maxHARQ_Msg3Tx>8))
@@ -1041,19 +1036,19 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
 
               switch (ccparams_lte.pcch_defaultPagingCycle) {
                 case 32:
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_defaultPagingCycle= LTE_PCCH_Config__defaultPagingCycle_rf32;
+                  RRCcfg->radioresourceconfig[j].pcch_defaultPagingCycle = LTE_PCCH_Config__defaultPagingCycle_rf32;
                   break;
 
                 case 64:
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_defaultPagingCycle= LTE_PCCH_Config__defaultPagingCycle_rf64;
+                  RRCcfg->radioresourceconfig[j].pcch_defaultPagingCycle = LTE_PCCH_Config__defaultPagingCycle_rf64;
                   break;
 
                 case 128:
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_defaultPagingCycle= LTE_PCCH_Config__defaultPagingCycle_rf128;
+                  RRCcfg->radioresourceconfig[j].pcch_defaultPagingCycle = LTE_PCCH_Config__defaultPagingCycle_rf128;
                   break;
 
                 case 256:
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_defaultPagingCycle= LTE_PCCH_Config__defaultPagingCycle_rf256;
+                  RRCcfg->radioresourceconfig[j].pcch_defaultPagingCycle = LTE_PCCH_Config__defaultPagingCycle_rf256;
                   break;
 
                 default:
@@ -1064,21 +1059,21 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
               }
 
               if (strcmp(ccparams_lte.pcch_nB, "fourT") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_fourT;
+                RRCcfg->radioresourceconfig[j].pcch_nB = LTE_PCCH_Config__nB_fourT;
               } else if (strcmp(ccparams_lte.pcch_nB, "twoT") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_twoT;
+                RRCcfg->radioresourceconfig[j].pcch_nB = LTE_PCCH_Config__nB_twoT;
               } else if (strcmp(ccparams_lte.pcch_nB, "oneT") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_oneT;
+                RRCcfg->radioresourceconfig[j].pcch_nB = LTE_PCCH_Config__nB_oneT;
               } else if (strcmp(ccparams_lte.pcch_nB, "halfT") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_halfT;
+                RRCcfg->radioresourceconfig[j].pcch_nB = LTE_PCCH_Config__nB_halfT;
               } else if (strcmp(ccparams_lte.pcch_nB, "quarterT") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_quarterT;
+                RRCcfg->radioresourceconfig[j].pcch_nB = LTE_PCCH_Config__nB_quarterT;
               } else if (strcmp(ccparams_lte.pcch_nB, "oneEighthT") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_oneEighthT;
+                RRCcfg->radioresourceconfig[j].pcch_nB = LTE_PCCH_Config__nB_oneEighthT;
               } else if (strcmp(ccparams_lte.pcch_nB, "oneSixteenthT") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_oneSixteenthT;
+                RRCcfg->radioresourceconfig[j].pcch_nB = LTE_PCCH_Config__nB_oneSixteenthT;
               } else if (strcmp(ccparams_lte.pcch_nB, "oneThirtySecondT") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_oneThirtySecondT;
+                RRCcfg->radioresourceconfig[j].pcch_nB = LTE_PCCH_Config__nB_oneThirtySecondT;
               } else {
                 AssertFatal (0, "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for pcch_nB choice: fourT,twoT,oneT,halfT,quarterT,oneighthT,oneSixteenthT,oneThirtySecondT !\n",
                              RC.config_file_name,
@@ -1087,11 +1082,11 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
               }
 
               if (strcmp(ccparams_lte.drx_Config_present, "prNothing") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_Config_present = LTE_DRX_Config_PR_NOTHING;
+                RRCcfg->radioresourceconfig[j].drx_Config_present = LTE_DRX_Config_PR_NOTHING;
               } else if (strcmp(ccparams_lte.drx_Config_present, "prRelease") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_Config_present = LTE_DRX_Config_PR_release;
+                RRCcfg->radioresourceconfig[j].drx_Config_present = LTE_DRX_Config_PR_release;
               } else if (strcmp(ccparams_lte.drx_Config_present, "prSetup") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_Config_present = LTE_DRX_Config_PR_setup;
+                RRCcfg->radioresourceconfig[j].drx_Config_present = LTE_DRX_Config_PR_setup;
               } else {
                 AssertFatal (0,
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for drx_Config_present choice: prNothing, prRelease, prSetup!\n",
@@ -1099,37 +1094,37 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
               }
 
               if (strcmp(ccparams_lte.drx_onDurationTimer, "psf1") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_onDurationTimer = (long) LTE_DRX_Config__setup__onDurationTimer_psf1;
+                RRCcfg->radioresourceconfig[j].drx_onDurationTimer = (long)LTE_DRX_Config__setup__onDurationTimer_psf1;
               } else if (strcmp(ccparams_lte.drx_onDurationTimer, "psf2") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_onDurationTimer = (long) LTE_DRX_Config__setup__onDurationTimer_psf2;
+                RRCcfg->radioresourceconfig[j].drx_onDurationTimer = (long)LTE_DRX_Config__setup__onDurationTimer_psf2;
               } else if (strcmp(ccparams_lte.drx_onDurationTimer, "psf3") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_onDurationTimer = (long) LTE_DRX_Config__setup__onDurationTimer_psf3;
+                RRCcfg->radioresourceconfig[j].drx_onDurationTimer = (long)LTE_DRX_Config__setup__onDurationTimer_psf3;
               } else if (strcmp(ccparams_lte.drx_onDurationTimer, "psf4") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_onDurationTimer = (long) LTE_DRX_Config__setup__onDurationTimer_psf4;
+                RRCcfg->radioresourceconfig[j].drx_onDurationTimer = (long)LTE_DRX_Config__setup__onDurationTimer_psf4;
               } else if (strcmp(ccparams_lte.drx_onDurationTimer, "psf5") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_onDurationTimer = (long) LTE_DRX_Config__setup__onDurationTimer_psf5;
+                RRCcfg->radioresourceconfig[j].drx_onDurationTimer = (long)LTE_DRX_Config__setup__onDurationTimer_psf5;
               } else if (strcmp(ccparams_lte.drx_onDurationTimer, "psf6") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_onDurationTimer = (long) LTE_DRX_Config__setup__onDurationTimer_psf6;
+                RRCcfg->radioresourceconfig[j].drx_onDurationTimer = (long)LTE_DRX_Config__setup__onDurationTimer_psf6;
               } else if (strcmp(ccparams_lte.drx_onDurationTimer, "psf8") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_onDurationTimer = (long) LTE_DRX_Config__setup__onDurationTimer_psf8;
+                RRCcfg->radioresourceconfig[j].drx_onDurationTimer = (long)LTE_DRX_Config__setup__onDurationTimer_psf8;
               } else if (strcmp(ccparams_lte.drx_onDurationTimer, "psf10") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_onDurationTimer = (long) LTE_DRX_Config__setup__onDurationTimer_psf10;
+                RRCcfg->radioresourceconfig[j].drx_onDurationTimer = (long)LTE_DRX_Config__setup__onDurationTimer_psf10;
               } else if (strcmp(ccparams_lte.drx_onDurationTimer, "psf20") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_onDurationTimer = (long) LTE_DRX_Config__setup__onDurationTimer_psf20;
+                RRCcfg->radioresourceconfig[j].drx_onDurationTimer = (long)LTE_DRX_Config__setup__onDurationTimer_psf20;
               } else if (strcmp(ccparams_lte.drx_onDurationTimer, "psf30") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_onDurationTimer = (long) LTE_DRX_Config__setup__onDurationTimer_psf30;
+                RRCcfg->radioresourceconfig[j].drx_onDurationTimer = (long)LTE_DRX_Config__setup__onDurationTimer_psf30;
               } else if (strcmp(ccparams_lte.drx_onDurationTimer, "psf40") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_onDurationTimer = (long) LTE_DRX_Config__setup__onDurationTimer_psf40;
+                RRCcfg->radioresourceconfig[j].drx_onDurationTimer = (long)LTE_DRX_Config__setup__onDurationTimer_psf40;
               } else if (strcmp(ccparams_lte.drx_onDurationTimer, "psf50") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_onDurationTimer = (long) LTE_DRX_Config__setup__onDurationTimer_psf50;
+                RRCcfg->radioresourceconfig[j].drx_onDurationTimer = (long)LTE_DRX_Config__setup__onDurationTimer_psf50;
               } else if (strcmp(ccparams_lte.drx_onDurationTimer, "psf60") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_onDurationTimer = (long) LTE_DRX_Config__setup__onDurationTimer_psf60;
+                RRCcfg->radioresourceconfig[j].drx_onDurationTimer = (long)LTE_DRX_Config__setup__onDurationTimer_psf60;
               } else if (strcmp(ccparams_lte.drx_onDurationTimer, "psf80") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_onDurationTimer = (long) LTE_DRX_Config__setup__onDurationTimer_psf80;
+                RRCcfg->radioresourceconfig[j].drx_onDurationTimer = (long)LTE_DRX_Config__setup__onDurationTimer_psf80;
               } else if (strcmp(ccparams_lte.drx_onDurationTimer, "psf100") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_onDurationTimer = (long) LTE_DRX_Config__setup__onDurationTimer_psf100;
+                RRCcfg->radioresourceconfig[j].drx_onDurationTimer = (long)LTE_DRX_Config__setup__onDurationTimer_psf100;
               } else if (strcmp(ccparams_lte.drx_onDurationTimer, "psf200") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_onDurationTimer = (long) LTE_DRX_Config__setup__onDurationTimer_psf200;
+                RRCcfg->radioresourceconfig[j].drx_onDurationTimer = (long)LTE_DRX_Config__setup__onDurationTimer_psf200;
               } else {
                 AssertFatal (0,
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for drx_onDurationTimer choice !\n",
@@ -1138,69 +1133,69 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
               }
 
               if (strcmp(ccparams_lte.drx_InactivityTimer, "psf1") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf1;
+                RRCcfg->radioresourceconfig[j].drx_InactivityTimer = (long)LTE_DRX_Config__setup__drx_InactivityTimer_psf1;
               } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf2") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf2;
+                RRCcfg->radioresourceconfig[j].drx_InactivityTimer = (long)LTE_DRX_Config__setup__drx_InactivityTimer_psf2;
               } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf3") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf3;
+                RRCcfg->radioresourceconfig[j].drx_InactivityTimer = (long)LTE_DRX_Config__setup__drx_InactivityTimer_psf3;
               } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf4") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf4;
+                RRCcfg->radioresourceconfig[j].drx_InactivityTimer = (long)LTE_DRX_Config__setup__drx_InactivityTimer_psf4;
               } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf5") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf5;
+                RRCcfg->radioresourceconfig[j].drx_InactivityTimer = (long)LTE_DRX_Config__setup__drx_InactivityTimer_psf5;
               } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf6") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf6;
+                RRCcfg->radioresourceconfig[j].drx_InactivityTimer = (long)LTE_DRX_Config__setup__drx_InactivityTimer_psf6;
               } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf8") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf8;
+                RRCcfg->radioresourceconfig[j].drx_InactivityTimer = (long)LTE_DRX_Config__setup__drx_InactivityTimer_psf8;
               } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf10") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf10;
+                RRCcfg->radioresourceconfig[j].drx_InactivityTimer = (long)LTE_DRX_Config__setup__drx_InactivityTimer_psf10;
               } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf20") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf20;
+                RRCcfg->radioresourceconfig[j].drx_InactivityTimer = (long)LTE_DRX_Config__setup__drx_InactivityTimer_psf20;
               } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf30") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf30;
+                RRCcfg->radioresourceconfig[j].drx_InactivityTimer = (long)LTE_DRX_Config__setup__drx_InactivityTimer_psf30;
               } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf40") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf40;
+                RRCcfg->radioresourceconfig[j].drx_InactivityTimer = (long)LTE_DRX_Config__setup__drx_InactivityTimer_psf40;
               } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf50") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf50;
+                RRCcfg->radioresourceconfig[j].drx_InactivityTimer = (long)LTE_DRX_Config__setup__drx_InactivityTimer_psf50;
               } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf60") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf60;
+                RRCcfg->radioresourceconfig[j].drx_InactivityTimer = (long)LTE_DRX_Config__setup__drx_InactivityTimer_psf60;
               } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf80") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf80;
+                RRCcfg->radioresourceconfig[j].drx_InactivityTimer = (long)LTE_DRX_Config__setup__drx_InactivityTimer_psf80;
               } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf100") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf100;
+                RRCcfg->radioresourceconfig[j].drx_InactivityTimer = (long)LTE_DRX_Config__setup__drx_InactivityTimer_psf100;
               } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf200") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf200;
+                RRCcfg->radioresourceconfig[j].drx_InactivityTimer = (long)LTE_DRX_Config__setup__drx_InactivityTimer_psf200;
               } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf300") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf300;
+                RRCcfg->radioresourceconfig[j].drx_InactivityTimer = (long)LTE_DRX_Config__setup__drx_InactivityTimer_psf300;
               } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf500") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf500;
+                RRCcfg->radioresourceconfig[j].drx_InactivityTimer = (long)LTE_DRX_Config__setup__drx_InactivityTimer_psf500;
               } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf750") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf750;
+                RRCcfg->radioresourceconfig[j].drx_InactivityTimer = (long)LTE_DRX_Config__setup__drx_InactivityTimer_psf750;
               } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf1280") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf1280;
+                RRCcfg->radioresourceconfig[j].drx_InactivityTimer = (long)LTE_DRX_Config__setup__drx_InactivityTimer_psf1280;
               } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf1920") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf1920;
+                RRCcfg->radioresourceconfig[j].drx_InactivityTimer = (long)LTE_DRX_Config__setup__drx_InactivityTimer_psf1920;
               } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf2560") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf2560;
+                RRCcfg->radioresourceconfig[j].drx_InactivityTimer = (long)LTE_DRX_Config__setup__drx_InactivityTimer_psf2560;
               } else if (strcmp(ccparams_lte.drx_InactivityTimer, "psf0-v1020") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_psf0_v1020;
+                RRCcfg->radioresourceconfig[j].drx_InactivityTimer = (long)LTE_DRX_Config__setup__drx_InactivityTimer_psf0_v1020;
               } else if (strcmp(ccparams_lte.drx_InactivityTimer, "spare9") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_spare9;
+                RRCcfg->radioresourceconfig[j].drx_InactivityTimer = (long)LTE_DRX_Config__setup__drx_InactivityTimer_spare9;
               } else if (strcmp(ccparams_lte.drx_InactivityTimer, "spare8") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_spare8;
+                RRCcfg->radioresourceconfig[j].drx_InactivityTimer = (long)LTE_DRX_Config__setup__drx_InactivityTimer_spare8;
               } else if (strcmp(ccparams_lte.drx_InactivityTimer, "spare7") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_spare7;
+                RRCcfg->radioresourceconfig[j].drx_InactivityTimer = (long)LTE_DRX_Config__setup__drx_InactivityTimer_spare7;
               } else if (strcmp(ccparams_lte.drx_InactivityTimer, "spare6") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_spare6;
+                RRCcfg->radioresourceconfig[j].drx_InactivityTimer = (long)LTE_DRX_Config__setup__drx_InactivityTimer_spare6;
               } else if (strcmp(ccparams_lte.drx_InactivityTimer, "spare5") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_spare5;
+                RRCcfg->radioresourceconfig[j].drx_InactivityTimer = (long)LTE_DRX_Config__setup__drx_InactivityTimer_spare5;
               } else if (strcmp(ccparams_lte.drx_InactivityTimer, "spare4") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_spare4;
+                RRCcfg->radioresourceconfig[j].drx_InactivityTimer = (long)LTE_DRX_Config__setup__drx_InactivityTimer_spare4;
               } else if (strcmp(ccparams_lte.drx_InactivityTimer, "spare3") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_spare3;
+                RRCcfg->radioresourceconfig[j].drx_InactivityTimer = (long)LTE_DRX_Config__setup__drx_InactivityTimer_spare3;
               } else if (strcmp(ccparams_lte.drx_InactivityTimer, "spare2") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_spare2;
+                RRCcfg->radioresourceconfig[j].drx_InactivityTimer = (long)LTE_DRX_Config__setup__drx_InactivityTimer_spare2;
               } else if (strcmp(ccparams_lte.drx_InactivityTimer, "spare1") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_InactivityTimer = (long) LTE_DRX_Config__setup__drx_InactivityTimer_spare1;
+                RRCcfg->radioresourceconfig[j].drx_InactivityTimer = (long)LTE_DRX_Config__setup__drx_InactivityTimer_spare1;
               } else {
                 AssertFatal (0,
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for drx_InactivityTimer choice !\n",
@@ -1208,16 +1203,16 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                 break;
               }
 
-              RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].ue_multiple_max= ccparams_lte.ue_multiple_max;
+              RRCcfg->radioresourceconfig[j].ue_multiple_max = ccparams_lte.ue_multiple_max;
 
               if (!ccparams_lte.mbms_dedicated_serving_cell)
                 AssertFatal (0,
                              "Failed to parse eNB configuration file %s, enb %u define %s: TRUE,FALSE!\n",
                              RC.config_file_name, i, ENB_CONFIG_STRING_MBMS_DEDICATED_SERVING_CELL);
               else if (strcmp(ccparams_lte.mbms_dedicated_serving_cell, "ENABLE") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].mbms_dedicated_serving_cell = true;
+                RRCcfg->radioresourceconfig[j].mbms_dedicated_serving_cell = true;
               } else  if (strcmp(ccparams_lte.mbms_dedicated_serving_cell, "DISABLE") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].mbms_dedicated_serving_cell  = false;
+                RRCcfg->radioresourceconfig[j].mbms_dedicated_serving_cell = false;
               } else {
                 AssertFatal (0,
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for mbms_dedicated_serving_cell choice: TRUE or FALSE !\n",
@@ -1260,21 +1255,21 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
               }
 
               if (strcmp(ccparams_lte.drx_RetransmissionTimer, "psf1") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_RetransmissionTimer = (long) LTE_DRX_Config__setup__drx_RetransmissionTimer_psf1;
+                RRCcfg->radioresourceconfig[j].drx_RetransmissionTimer = (long)LTE_DRX_Config__setup__drx_RetransmissionTimer_psf1;
               } else if (strcmp(ccparams_lte.drx_RetransmissionTimer, "psf2") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_RetransmissionTimer = (long) LTE_DRX_Config__setup__drx_RetransmissionTimer_psf2;
+                RRCcfg->radioresourceconfig[j].drx_RetransmissionTimer = (long)LTE_DRX_Config__setup__drx_RetransmissionTimer_psf2;
               } else if (strcmp(ccparams_lte.drx_RetransmissionTimer, "psf4") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_RetransmissionTimer = (long) LTE_DRX_Config__setup__drx_RetransmissionTimer_psf4;
+                RRCcfg->radioresourceconfig[j].drx_RetransmissionTimer = (long)LTE_DRX_Config__setup__drx_RetransmissionTimer_psf4;
               } else if (strcmp(ccparams_lte.drx_RetransmissionTimer, "psf6") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_RetransmissionTimer = (long) LTE_DRX_Config__setup__drx_RetransmissionTimer_psf6;
+                RRCcfg->radioresourceconfig[j].drx_RetransmissionTimer = (long)LTE_DRX_Config__setup__drx_RetransmissionTimer_psf6;
               } else if (strcmp(ccparams_lte.drx_RetransmissionTimer, "psf8") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_RetransmissionTimer = (long) LTE_DRX_Config__setup__drx_RetransmissionTimer_psf8;
+                RRCcfg->radioresourceconfig[j].drx_RetransmissionTimer = (long)LTE_DRX_Config__setup__drx_RetransmissionTimer_psf8;
               } else if (strcmp(ccparams_lte.drx_RetransmissionTimer, "psf16") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_RetransmissionTimer = (long) LTE_DRX_Config__setup__drx_RetransmissionTimer_psf16;
+                RRCcfg->radioresourceconfig[j].drx_RetransmissionTimer = (long)LTE_DRX_Config__setup__drx_RetransmissionTimer_psf16;
               } else if (strcmp(ccparams_lte.drx_RetransmissionTimer, "psf24") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_RetransmissionTimer = (long) LTE_DRX_Config__setup__drx_RetransmissionTimer_psf24;
+                RRCcfg->radioresourceconfig[j].drx_RetransmissionTimer = (long)LTE_DRX_Config__setup__drx_RetransmissionTimer_psf24;
               } else if (strcmp(ccparams_lte.drx_RetransmissionTimer, "psf33") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_RetransmissionTimer = (long) LTE_DRX_Config__setup__drx_RetransmissionTimer_psf33;
+                RRCcfg->radioresourceconfig[j].drx_RetransmissionTimer = (long)LTE_DRX_Config__setup__drx_RetransmissionTimer_psf33;
               } else {
                 AssertFatal (0,
                              "Failed to parse eNB configuration file %s, enb %u unknown value \"%s\" for drx_RetransmissionTimer choice !\n",
@@ -1283,55 +1278,55 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
               }
 
               if (ccparams_lte.drx_longDrx_CycleStartOffset_present == NULL || strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prNothing") == 0) {
-                RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_NOTHING;
+                RRCcfg->radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_NOTHING;
               } else {
                 if (strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prSf10") == 0) {
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf10;
+                  RRCcfg->radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf10;
                   offsetMaxLimit = 10;
                 } else if (strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prSf20") == 0) {
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf20;
+                  RRCcfg->radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf20;
                   offsetMaxLimit = 20;
                 } else if (strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prSf32") == 0) {
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf32;
+                  RRCcfg->radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf32;
                   offsetMaxLimit = 32;
                 } else if (strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prSf40") == 0) {
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf40;
+                  RRCcfg->radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf40;
                   offsetMaxLimit = 40;
                 } else if (strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prSf64") == 0) {
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf64;
+                  RRCcfg->radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf64;
                   offsetMaxLimit = 64;
                 } else if (strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prSf80") == 0) {
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf80;
+                  RRCcfg->radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf80;
                   offsetMaxLimit = 80;
                 } else if (strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prSf128") == 0) {
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf128;
+                  RRCcfg->radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf128;
                   offsetMaxLimit = 128;
                 } else if (strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prSf160") == 0) {
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf160;
+                  RRCcfg->radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf160;
                   offsetMaxLimit = 160;
                 } else if (strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prSf256") == 0) {
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf256;
+                  RRCcfg->radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf256;
                   offsetMaxLimit = 256;
                 } else if (strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prSf320") == 0) {
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf320;
+                  RRCcfg->radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf320;
                   offsetMaxLimit = 320;
                 } else if (strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prSf512") == 0) {
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf512;
+                  RRCcfg->radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf512;
                   offsetMaxLimit = 512;
                 } else if (strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prSf640") == 0) {
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf640;
+                  RRCcfg->radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf640;
                   offsetMaxLimit = 640;
                 } else if (strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prSf1024") == 0) {
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf1024;
+                  RRCcfg->radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf1024;
                   offsetMaxLimit = 1024;
                 } else if (strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prSf1280") == 0) {
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf1280;
+                  RRCcfg->radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf1280;
                   offsetMaxLimit = 1280;
                 } else if (strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prSf2048") == 0) {
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf2048;
+                  RRCcfg->radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf2048;
                   offsetMaxLimit = 2048;
                 } else if (strcmp(ccparams_lte.drx_longDrx_CycleStartOffset_present, "prSf2560") == 0) {
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf2560;
+                  RRCcfg->radioresourceconfig[j].drx_longDrx_CycleStartOffset_present = LTE_DRX_Config__setup__longDRX_CycleStartOffset_PR_sf2560;
                   offsetMaxLimit = 2560;
                 } else {
                   AssertFatal (0,
@@ -1340,7 +1335,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                 }
 
                 if (ccparams_lte.drx_longDrx_CycleStartOffset >= 0 && ccparams_lte.drx_longDrx_CycleStartOffset < offsetMaxLimit) {
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_longDrx_CycleStartOffset = ccparams_lte.drx_longDrx_CycleStartOffset;
+                  RRCcfg->radioresourceconfig[j].drx_longDrx_CycleStartOffset = ccparams_lte.drx_longDrx_CycleStartOffset;
                 } else {
                   AssertFatal (0,
                                "Failed to parse eNB configuration file %s, enb %u incoherent value \"%d\" for drx_longDrx_CycleStartOffset !\n",
@@ -1354,58 +1349,58 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                                "Failed to parse eNB configuration file %s, enb %u incoherent values \"%s\" -  \"%d\" for drx_shortDrx_Cycle or drx_shortDrx_ShortCycleTimer choice !\n",
                                RC.config_file_name, i, ccparams_lte.drx_shortDrx_Cycle, ccparams_lte.drx_shortDrx_ShortCycleTimer);
                 } else {
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = -1;
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_ShortCycleTimer = 0;
+                  RRCcfg->radioresourceconfig[j].drx_shortDrx_Cycle = -1;
+                  RRCcfg->radioresourceconfig[j].drx_shortDrx_ShortCycleTimer = 0;
                 }
               } else {
                 if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "sf2") == 0) {
                   cycleNb = 2;
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf2;
+                  RRCcfg->radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf2;
                 } else if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "sf5") == 0) {
                   cycleNb = 5;
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf5;
+                  RRCcfg->radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf5;
                 } else if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "sf8") == 0) {
                   cycleNb = 8;
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf8;
+                  RRCcfg->radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf8;
                 } else if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "sf10") == 0) {
                   cycleNb = 10;
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf10;
+                  RRCcfg->radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf10;
                 } else if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "sf16") == 0) {
                   cycleNb = 16;
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf16;
+                  RRCcfg->radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf16;
                 } else if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "sf20") == 0) {
                   cycleNb = 20;
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf20;
+                  RRCcfg->radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf20;
                 } else if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "sf32") == 0) {
                   cycleNb = 32;
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf32;
+                  RRCcfg->radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf32;
                 } else if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "sf40") == 0) {
                   cycleNb = 40;
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf40;
+                  RRCcfg->radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf40;
                 } else if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "sf64") == 0) {
                   cycleNb = 64;
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf64;
+                  RRCcfg->radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf64;
                 } else if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "sf80") == 0) {
                   cycleNb = 80;
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf80;
+                  RRCcfg->radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf80;
                 } else if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "sf128") == 0) {
                   cycleNb = 128;
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf128;
+                  RRCcfg->radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf128;
                 } else if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "sf160") == 0) {
                   cycleNb = 160;
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf160;
+                  RRCcfg->radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf160;
                 } else if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "sf256") == 0) {
                   cycleNb = 256;
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf256;
+                  RRCcfg->radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf256;
                 } else if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "sf320") == 0) {
                   cycleNb = 320;
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf320;
+                  RRCcfg->radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf320;
                 } else if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "sf512") == 0) {
                   cycleNb = 512;
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf512;
+                  RRCcfg->radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf512;
                 } else if (strcmp(ccparams_lte.drx_shortDrx_Cycle, "sf640") == 0) {
                   cycleNb = 640;
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf640;
+                  RRCcfg->radioresourceconfig[j].drx_shortDrx_Cycle = LTE_DRX_Config__setup__shortDRX__shortDRX_Cycle_sf640;
                 } else {
                   AssertFatal (0,
                                "Failed to parse eNB configuration file %s, enb %u incoherent value \"%s\" for drx_shortDrx_Cycle !\n",
@@ -1419,7 +1414,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                 }
 
                 if (ccparams_lte.drx_shortDrx_ShortCycleTimer >= 1 && ccparams_lte.drx_shortDrx_ShortCycleTimer <= 16 ) {
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].drx_shortDrx_ShortCycleTimer = ccparams_lte.drx_shortDrx_ShortCycleTimer;
+                  RRCcfg->radioresourceconfig[j].drx_shortDrx_ShortCycleTimer = ccparams_lte.drx_shortDrx_ShortCycleTimer;
                 } else {
                   AssertFatal (0,
                                "Failed to parse eNB configuration file %s, enb %u unknown value \"%d\" for drx_shortDrx_ShortCycleTimer choice !\n",
@@ -1429,19 +1424,19 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
 
               switch (ccparams_lte.bcch_modificationPeriodCoeff) {
                 case 2:
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].bcch_modificationPeriodCoeff= LTE_BCCH_Config__modificationPeriodCoeff_n2;
+                  RRCcfg->radioresourceconfig[j].bcch_modificationPeriodCoeff = LTE_BCCH_Config__modificationPeriodCoeff_n2;
                   break;
 
                 case 4:
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].bcch_modificationPeriodCoeff= LTE_BCCH_Config__modificationPeriodCoeff_n4;
+                  RRCcfg->radioresourceconfig[j].bcch_modificationPeriodCoeff = LTE_BCCH_Config__modificationPeriodCoeff_n4;
                   break;
 
                 case 8:
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].bcch_modificationPeriodCoeff= LTE_BCCH_Config__modificationPeriodCoeff_n8;
+                  RRCcfg->radioresourceconfig[j].bcch_modificationPeriodCoeff = LTE_BCCH_Config__modificationPeriodCoeff_n8;
                   break;
 
                 case 16:
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].bcch_modificationPeriodCoeff= LTE_BCCH_Config__modificationPeriodCoeff_n16;
+                  RRCcfg->radioresourceconfig[j].bcch_modificationPeriodCoeff = LTE_BCCH_Config__modificationPeriodCoeff_n16;
                   break;
 
                 default:
@@ -1451,40 +1446,40 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                   break;
               }
 
-              RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].ue_TimersAndConstants_t300= ccparams_lte.ue_TimersAndConstants_t300;
-              RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].ue_TimersAndConstants_t301= ccparams_lte.ue_TimersAndConstants_t301;
-              RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].ue_TimersAndConstants_t310= ccparams_lte.ue_TimersAndConstants_t310;
-              RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].ue_TimersAndConstants_t311= ccparams_lte.ue_TimersAndConstants_t311;
-              RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].ue_TimersAndConstants_n310= ccparams_lte.ue_TimersAndConstants_n310;
-              RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].ue_TimersAndConstants_n311= ccparams_lte.ue_TimersAndConstants_n311;
+              RRCcfg->radioresourceconfig[j].ue_TimersAndConstants_t300 = ccparams_lte.ue_TimersAndConstants_t300;
+              RRCcfg->radioresourceconfig[j].ue_TimersAndConstants_t301 = ccparams_lte.ue_TimersAndConstants_t301;
+              RRCcfg->radioresourceconfig[j].ue_TimersAndConstants_t310 = ccparams_lte.ue_TimersAndConstants_t310;
+              RRCcfg->radioresourceconfig[j].ue_TimersAndConstants_t311 = ccparams_lte.ue_TimersAndConstants_t311;
+              RRCcfg->radioresourceconfig[j].ue_TimersAndConstants_n310 = ccparams_lte.ue_TimersAndConstants_n310;
+              RRCcfg->radioresourceconfig[j].ue_TimersAndConstants_n311 = ccparams_lte.ue_TimersAndConstants_n311;
 
               switch (ccparams_lte.ue_TransmissionMode) {
                 case 1:
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].ue_TransmissionMode= LTE_AntennaInfoDedicated__transmissionMode_tm1;
+                  RRCcfg->radioresourceconfig[j].ue_TransmissionMode = LTE_AntennaInfoDedicated__transmissionMode_tm1;
                   break;
 
                 case 2:
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].ue_TransmissionMode= LTE_AntennaInfoDedicated__transmissionMode_tm2;
+                  RRCcfg->radioresourceconfig[j].ue_TransmissionMode = LTE_AntennaInfoDedicated__transmissionMode_tm2;
                   break;
 
                 case 3:
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].ue_TransmissionMode= LTE_AntennaInfoDedicated__transmissionMode_tm3;
+                  RRCcfg->radioresourceconfig[j].ue_TransmissionMode = LTE_AntennaInfoDedicated__transmissionMode_tm3;
                   break;
 
                 case 4:
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].ue_TransmissionMode= LTE_AntennaInfoDedicated__transmissionMode_tm4;
+                  RRCcfg->radioresourceconfig[j].ue_TransmissionMode = LTE_AntennaInfoDedicated__transmissionMode_tm4;
                   break;
 
                 case 5:
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].ue_TransmissionMode= LTE_AntennaInfoDedicated__transmissionMode_tm5;
+                  RRCcfg->radioresourceconfig[j].ue_TransmissionMode = LTE_AntennaInfoDedicated__transmissionMode_tm5;
                   break;
 
                 case 6:
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].ue_TransmissionMode= LTE_AntennaInfoDedicated__transmissionMode_tm6;
+                  RRCcfg->radioresourceconfig[j].ue_TransmissionMode = LTE_AntennaInfoDedicated__transmissionMode_tm6;
                   break;
 
                 case 7:
-                  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].ue_TransmissionMode= LTE_AntennaInfoDedicated__transmissionMode_tm7;
+                  RRCcfg->radioresourceconfig[j].ue_TransmissionMode = LTE_AntennaInfoDedicated__transmissionMode_tm7;
                   break;
 
                 default:
@@ -1494,7 +1489,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
                   break;
               }
 
-              RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].ue_multiple_max= ccparams_lte.ue_multiple_max;
+              RRCcfg->radioresourceconfig[j].ue_multiple_max = ccparams_lte.ue_multiple_max;
 
               switch (ccparams_lte.N_RB_DL) {
                 case 25:
@@ -1532,15 +1527,16 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
               }
 
               // eMBMS configuration
-              RRC_CONFIGURATION_REQ(msg_p).eMBMS_configured = 0;
+              RRCcfg->eMBMS_configured = 0;
               printf("No eMBMS configuration, skipping it\n");
               // eMTC configuration
               char brparamspath[MAX_OPTNAME_SIZE*2 + 160];
               sprintf(brparamspath,"%s.%s", ccspath, ENB_CONFIG_STRING_EMTC_PARAMETERS);
               config_get(eMTCParams, sizeof(eMTCParams)/sizeof(paramdef_t), brparamspath);
-              RRC_CONFIGURATION_REQ(msg_p).eMTC_configured = eMTCconfig.eMTC_configured&1;
+              RRCcfg->eMTC_configured = eMTCconfig.eMTC_configured & 1;
 
-              if (eMTCconfig.eMTC_configured > 0) fill_eMTC_configuration(msg_p,&eMTCconfig, i,j,RC.config_file_name,brparamspath);
+              if (eMTCconfig.eMTC_configured > 0)
+                fill_eMTC_configuration(RRCcfg, &eMTCconfig, i, j, RC.config_file_name, brparamspath);
               else                            printf("No eMTC configuration, skipping it\n");
 
               // Sidelink configuration
@@ -1548,14 +1544,15 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
               sprintf(SLparamspath,"%s.%s", ccspath, ENB_CONFIG_STRING_SL_PARAMETERS);
               config_get( SLParams, sizeof(SLParams)/sizeof(paramdef_t), SLparamspath);
               // Sidelink Resource pool information
-              RRC_CONFIGURATION_REQ (msg_p).SL_configured=SLconfig.sidelink_configured&1;
+              RRCcfg->SL_configured = SLconfig.sidelink_configured & 1;
 
-              if (SLconfig.sidelink_configured==1) fill_SL_configuration(msg_p,&SLconfig,i,j,RC.config_file_name);
+              if (SLconfig.sidelink_configured == 1)
+                fill_SL_configuration(RRCcfg, &SLconfig, i, j, RC.config_file_name);
               else                                 printf("No SL configuration skipping it\n");
             } // !NODE_IS_DU(node_type)
           }
 
-          RRC_CONFIGURATION_REQ (msg_p).nr_scg_ssb_freq = ccparams_lte.nr_scg_ssb_freq;
+          RRCcfg->nr_scg_ssb_freq = ccparams_lte.nr_scg_ssb_freq;
 
           if (!NODE_IS_DU(rrc->node_type)) {
             char srb1path[MAX_OPTNAME_SIZE*2 + 8];
@@ -1861,8 +1858,6 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
         }
       }
     }
-
-    memcpy(&rrc->configuration, &RRC_CONFIGURATION_REQ(msg_p), sizeof(RRC_CONFIGURATION_REQ(msg_p)));
   }
 
   LOG_I(RRC,"Node type %d \n ", rrc->node_type);
diff --git a/openair2/ENB_APP/enb_config.h b/openair2/ENB_APP/enb_config.h
index c7f65f1d0e8..904ace1b73f 100644
--- a/openair2/ENB_APP/enb_config.h
+++ b/openair2/ENB_APP/enb_config.h
@@ -116,8 +116,8 @@ void read_config_and_init(void);
 int RCconfig_X2(MessageDef *msg_p, uint32_t i);
 int RCconfig_M2(MessageDef *msg_p, uint32_t i);
 
-void fill_SL_configuration(MessageDef *msg_p,  ccparams_sidelink_t *SLconfig,int cell_idx,int cc_idx,char *config_fname);
-void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, int cell_idx,int cc_idx,char *config_fname,char *brparamspath);
+void fill_SL_configuration(RrcConfigurationReq *RRCcfg, ccparams_sidelink_t *SLconfig, int cell_idx, int cc_idx, char *config_fname);
+void fill_eMTC_configuration(RrcConfigurationReq *RRCcfg, ccparams_eMTC_t *eMTCconfig, int cell_idx, int cc_idx, char *config_fname, char *brparamspath);
 
 int RCconfig_DU_F1(MessageDef *msg_p, uint32_t i);
 void handle_f1ap_setup_resp(f1ap_setup_resp_t *resp);
diff --git a/openair2/ENB_APP/enb_config_SL.c b/openair2/ENB_APP/enb_config_SL.c
index aecede2db8d..64c31d73970 100644
--- a/openair2/ENB_APP/enb_config_SL.c
+++ b/openair2/ENB_APP/enb_config_SL.c
@@ -40,254 +40,254 @@
 #include "enb_paramdef.h"
 #include "enb_paramdef_sidelink.h"
 
-void fill_SL_configuration(MessageDef *msg_p,  ccparams_sidelink_t *SLconfig,int cell_idx,int cc_idx,char *config_fname) {
-
+void fill_SL_configuration(RrcConfigurationReq *RRCcfg, ccparams_sidelink_t *SLconfig, int cell_idx, int cc_idx, char *config_fname)
+{
   printf("Configuring SL\n");
   //SIB18
   if (strcmp(SLconfig->rxPool_sc_CP_Len,"normal")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_CP_Len[cc_idx] = LTE_SL_CP_Len_r12_normal;
+    RRCcfg->rxPool_sc_CP_Len[cc_idx] = LTE_SL_CP_Len_r12_normal;
   } else if (strcmp(SLconfig->rxPool_sc_CP_Len,"extended")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_CP_Len[cc_idx] = LTE_SL_CP_Len_r12_extended;
+    RRCcfg->rxPool_sc_CP_Len[cc_idx] = LTE_SL_CP_Len_r12_extended;
   } else
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for rxPool_sc_CP_Len choice: normal,extended!\n",
 		 config_fname, cell_idx, SLconfig->rxPool_sc_CP_Len);
 
   if (strcmp(SLconfig->rxPool_sc_Period,"sf40")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_sf40;
+    RRCcfg->rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_sf40;
   } else if (strcmp(SLconfig->rxPool_sc_Period,"sf60")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_sf60;
+    RRCcfg->rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_sf60;
   } else if (strcmp(SLconfig->rxPool_sc_Period,"sf70")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_sf70;
+    RRCcfg->rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_sf70;
   } else if (strcmp(SLconfig->rxPool_sc_Period,"sf80")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_sf80;
+    RRCcfg->rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_sf80;
   } else if (strcmp(SLconfig->rxPool_sc_Period,"sf120")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_sf120;
+    RRCcfg->rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_sf120;
   } else if (strcmp(SLconfig->rxPool_sc_Period,"sf140")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_sf140;
+    RRCcfg->rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_sf140;
   } else if (strcmp(SLconfig->rxPool_sc_Period,"sf160")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_sf160;
+    RRCcfg->rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_sf160;
   } else if (strcmp(SLconfig->rxPool_sc_Period,"sf240")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_sf240;
+    RRCcfg->rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_sf240;
   } else if (strcmp(SLconfig->rxPool_sc_Period,"sf280")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_sf280;
+    RRCcfg->rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_sf280;
   } else if (strcmp(SLconfig->rxPool_sc_Period,"sf320")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_sf320;
+    RRCcfg->rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_sf320;
   } else if (strcmp(SLconfig->rxPool_sc_Period,"spare6")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_spare6;
+    RRCcfg->rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_spare6;
   } else if (strcmp(SLconfig->rxPool_sc_Period,"spare5")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_spare5;
+    RRCcfg->rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_spare5;
   } else if (strcmp(SLconfig->rxPool_sc_Period,"spare4")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_spare4;
+    RRCcfg->rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_spare4;
   } else if (strcmp(SLconfig->rxPool_sc_Period,"spare3")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_spare3;
+    RRCcfg->rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_spare3;
   } else if (strcmp(SLconfig->rxPool_sc_Period,"spare2")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_spare2;
+    RRCcfg->rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_spare2;
   } else if (strcmp(SLconfig->rxPool_sc_Period,"spare")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_spare;
+    RRCcfg->rxPool_sc_Period[cc_idx] = LTE_SL_PeriodComm_r12_spare;
   } else
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for rxPool_sc_Period choice: sf40,sf60,sf70,sf80,sf120,sf140,sf160,sf240,sf280,sf320,spare6,spare5,spare4,spare3,spare2,spare!\n",
 		 config_fname, cell_idx, SLconfig->rxPool_sc_Period);
 
   if (strcmp(SLconfig->rxPool_data_CP_Len,"normal")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).rxPool_data_CP_Len[cc_idx] = LTE_SL_CP_Len_r12_normal;
+    RRCcfg->rxPool_data_CP_Len[cc_idx] = LTE_SL_CP_Len_r12_normal;
   } else if (strcmp(SLconfig->rxPool_data_CP_Len,"extended")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).rxPool_data_CP_Len[cc_idx] = LTE_SL_CP_Len_r12_extended;
+    RRCcfg->rxPool_data_CP_Len[cc_idx] = LTE_SL_CP_Len_r12_extended;
   } else
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for rxPool_data_CP_Len choice: normal,extended!\n",
 		 config_fname, cell_idx, SLconfig->rxPool_data_CP_Len);
 
-  RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_prb_Num[cc_idx] = SLconfig->rxPool_ResourceConfig_prb_Num;
-  RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_prb_Start[cc_idx] = SLconfig->rxPool_ResourceConfig_prb_Start;
-  RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_prb_End[cc_idx] = SLconfig->rxPool_ResourceConfig_prb_End;
+  RRCcfg->rxPool_ResourceConfig_prb_Num[cc_idx] = SLconfig->rxPool_ResourceConfig_prb_Num;
+  RRCcfg->rxPool_ResourceConfig_prb_Start[cc_idx] = SLconfig->rxPool_ResourceConfig_prb_Start;
+  RRCcfg->rxPool_ResourceConfig_prb_End[cc_idx] = SLconfig->rxPool_ResourceConfig_prb_End;
 
   if (strcmp(SLconfig->rxPool_ResourceConfig_offsetIndicator_present,"prNothing")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_offsetIndicator_present[cc_idx] = LTE_SL_OffsetIndicator_r12_PR_NOTHING;
+    RRCcfg->rxPool_ResourceConfig_offsetIndicator_present[cc_idx] = LTE_SL_OffsetIndicator_r12_PR_NOTHING;
   } else if (strcmp(SLconfig->rxPool_ResourceConfig_offsetIndicator_present,"prSmall")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_offsetIndicator_present[cc_idx] = LTE_SL_OffsetIndicator_r12_PR_small_r12;
+    RRCcfg->rxPool_ResourceConfig_offsetIndicator_present[cc_idx] = LTE_SL_OffsetIndicator_r12_PR_small_r12;
   } else if (strcmp(SLconfig->rxPool_ResourceConfig_offsetIndicator_present,"prLarge")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_offsetIndicator_present[cc_idx] = LTE_SL_OffsetIndicator_r12_PR_large_r12;
+    RRCcfg->rxPool_ResourceConfig_offsetIndicator_present[cc_idx] = LTE_SL_OffsetIndicator_r12_PR_large_r12;
   } else
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for rxPool_ResourceConfig_offsetIndicator_present choice: prNothing,prSmal,prLarge!\n",
 		 config_fname, cell_idx, SLconfig->rxPool_ResourceConfig_offsetIndicator_present);
 
-  RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_offsetIndicator_choice[cc_idx] = SLconfig->rxPool_ResourceConfig_offsetIndicator_choice;
+  RRCcfg->rxPool_ResourceConfig_offsetIndicator_choice[cc_idx] = SLconfig->rxPool_ResourceConfig_offsetIndicator_choice;
 
   if (strcmp(SLconfig->rxPool_ResourceConfig_subframeBitmap_present,"prNothing")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_NOTHING;
+    RRCcfg->rxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_NOTHING;
   } else if (strcmp(SLconfig->rxPool_ResourceConfig_subframeBitmap_present,"prBs4")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs4_r12;
+    RRCcfg->rxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs4_r12;
   } else if (strcmp(SLconfig->rxPool_ResourceConfig_subframeBitmap_present,"prBs8")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs8_r12;
+    RRCcfg->rxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs8_r12;
   } else if (strcmp(SLconfig->rxPool_ResourceConfig_subframeBitmap_present,"prBs12")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs12_r12;
+    RRCcfg->rxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs12_r12;
   } else if (strcmp(SLconfig->rxPool_ResourceConfig_subframeBitmap_present,"prBs16")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs16_r12;
+    RRCcfg->rxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs16_r12;
   } else if (strcmp(SLconfig->rxPool_ResourceConfig_subframeBitmap_present,"prBs30")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs30_r12;
+    RRCcfg->rxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs30_r12;
   } else if (strcmp(SLconfig->rxPool_ResourceConfig_subframeBitmap_present,"prBs40")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs40_r12;
+    RRCcfg->rxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs40_r12;
   } else if (strcmp(SLconfig->rxPool_ResourceConfig_subframeBitmap_present,"prBs42")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs42_r12;
+    RRCcfg->rxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs42_r12;
   } else
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for rxPool_ResourceConfig_subframeBitmap_present choice: prNothing,prBs4,prBs8,prBs12,prBs16,prBs30,prBs40,prBs42!\n",
 		 config_fname, cell_idx, SLconfig->rxPool_ResourceConfig_subframeBitmap_present);
 
-  RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_subframeBitmap_choice_bs_buf[cc_idx] = SLconfig->rxPool_ResourceConfig_subframeBitmap_choice_bs_buf;
-  RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_subframeBitmap_choice_bs_size[cc_idx] = SLconfig->rxPool_ResourceConfig_subframeBitmap_choice_bs_size;
-  RRC_CONFIGURATION_REQ (msg_p).rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused[cc_idx] = SLconfig->rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused;
+  RRCcfg->rxPool_ResourceConfig_subframeBitmap_choice_bs_buf[cc_idx] = SLconfig->rxPool_ResourceConfig_subframeBitmap_choice_bs_buf;
+  RRCcfg->rxPool_ResourceConfig_subframeBitmap_choice_bs_size[cc_idx] = SLconfig->rxPool_ResourceConfig_subframeBitmap_choice_bs_size;
+  RRCcfg->rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused[cc_idx] = SLconfig->rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused;
 
   //SIB19 - for discRxPool
   if (strcmp(SLconfig->discRxPool_cp_Len,"normal")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPool_cp_Len[cc_idx] = LTE_SL_CP_Len_r12_normal;
+    RRCcfg->discRxPool_cp_Len[cc_idx] = LTE_SL_CP_Len_r12_normal;
   } else if (strcmp(SLconfig->discRxPool_cp_Len,"extended")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPool_cp_Len[cc_idx] = LTE_SL_CP_Len_r12_extended;
+    RRCcfg->discRxPool_cp_Len[cc_idx] = LTE_SL_CP_Len_r12_extended;
   } else
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for discRxPool_cp_Len choice: normal,extended!\n",
 		 config_fname, cell_idx, SLconfig->discRxPool_cp_Len);
 
   if (strcmp(SLconfig->discRxPool_discPeriod,"rf32")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPool_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf32;
+    RRCcfg->discRxPool_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf32;
   } else if (strcmp(SLconfig->discRxPool_discPeriod,"rf64")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPool_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf64;
+    RRCcfg->discRxPool_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf64;
   } else if (strcmp(SLconfig->discRxPool_discPeriod,"rf128")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPool_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf128;
+    RRCcfg->discRxPool_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf128;
   } else if (strcmp(SLconfig->discRxPool_discPeriod,"rf256")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPool_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf256;
+    RRCcfg->discRxPool_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf256;
   } else if (strcmp(SLconfig->discRxPool_discPeriod,"rf512")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPool_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf512;
+    RRCcfg->discRxPool_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf512;
   } else if (strcmp(SLconfig->discRxPool_discPeriod,"rf1024")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPool_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf1024;
+    RRCcfg->discRxPool_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf1024;
   } else if (strcmp(SLconfig->discRxPool_discPeriod,"rf16")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPool_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf16_v1310;
+    RRCcfg->discRxPool_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf16_v1310;
   } else if (strcmp(SLconfig->discRxPool_discPeriod,"spare")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPool_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_spare;
+    RRCcfg->discRxPool_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_spare;
   } else
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for discRxPool_discPeriod choice: rf32,rf64,rf128,rf512,rf1024,rf16,spare!\n",
 		 config_fname, cell_idx, SLconfig->discRxPool_discPeriod);
 
-  RRC_CONFIGURATION_REQ (msg_p).discRxPool_numRetx[cc_idx] = SLconfig->discRxPool_numRetx;
-  RRC_CONFIGURATION_REQ (msg_p).discRxPool_numRepetition[cc_idx] = SLconfig->discRxPool_numRepetition;
-  RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_prb_Num[cc_idx] = SLconfig->discRxPool_ResourceConfig_prb_Num;
-  RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_prb_Start[cc_idx] = SLconfig->discRxPool_ResourceConfig_prb_Start;
-  RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_prb_End[cc_idx] = SLconfig->discRxPool_ResourceConfig_prb_End;
+  RRCcfg->discRxPool_numRetx[cc_idx] = SLconfig->discRxPool_numRetx;
+  RRCcfg->discRxPool_numRepetition[cc_idx] = SLconfig->discRxPool_numRepetition;
+  RRCcfg->discRxPool_ResourceConfig_prb_Num[cc_idx] = SLconfig->discRxPool_ResourceConfig_prb_Num;
+  RRCcfg->discRxPool_ResourceConfig_prb_Start[cc_idx] = SLconfig->discRxPool_ResourceConfig_prb_Start;
+  RRCcfg->discRxPool_ResourceConfig_prb_End[cc_idx] = SLconfig->discRxPool_ResourceConfig_prb_End;
 
   if (strcmp(SLconfig->discRxPool_ResourceConfig_offsetIndicator_present,"prNothing")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_offsetIndicator_present[cc_idx] = LTE_SL_OffsetIndicator_r12_PR_NOTHING;
+    RRCcfg->discRxPool_ResourceConfig_offsetIndicator_present[cc_idx] = LTE_SL_OffsetIndicator_r12_PR_NOTHING;
   } else if (strcmp(SLconfig->discRxPool_ResourceConfig_offsetIndicator_present,"prSmall")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_offsetIndicator_present[cc_idx] = LTE_SL_OffsetIndicator_r12_PR_small_r12;
+    RRCcfg->discRxPool_ResourceConfig_offsetIndicator_present[cc_idx] = LTE_SL_OffsetIndicator_r12_PR_small_r12;
   } else if (strcmp(SLconfig->discRxPool_ResourceConfig_offsetIndicator_present,"prLarge")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_offsetIndicator_present[cc_idx] = LTE_SL_OffsetIndicator_r12_PR_large_r12;
+    RRCcfg->discRxPool_ResourceConfig_offsetIndicator_present[cc_idx] = LTE_SL_OffsetIndicator_r12_PR_large_r12;
   } else
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for discRxPool_ResourceConfig_offsetIndicator_present choice: prNothing,prSmal,prLarge!\n",
 		 config_fname, cell_idx, SLconfig->discRxPool_ResourceConfig_offsetIndicator_present);
 
-  RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_offsetIndicator_choice[cc_idx] = SLconfig->discRxPool_ResourceConfig_offsetIndicator_choice;
+  RRCcfg->discRxPool_ResourceConfig_offsetIndicator_choice[cc_idx] = SLconfig->discRxPool_ResourceConfig_offsetIndicator_choice;
 
   if (strcmp(SLconfig->discRxPool_ResourceConfig_subframeBitmap_present,"prNothing")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_NOTHING;
+    RRCcfg->discRxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_NOTHING;
   } else if (strcmp(SLconfig->discRxPool_ResourceConfig_subframeBitmap_present,"prBs4")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs4_r12;
+    RRCcfg->discRxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs4_r12;
   } else if (strcmp(SLconfig->discRxPool_ResourceConfig_subframeBitmap_present,"prBs8")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs8_r12;
+    RRCcfg->discRxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs8_r12;
   } else if (strcmp(SLconfig->discRxPool_ResourceConfig_subframeBitmap_present,"prBs12")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs12_r12;
+    RRCcfg->discRxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs12_r12;
   } else if (strcmp(SLconfig->discRxPool_ResourceConfig_subframeBitmap_present,"prBs16")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs16_r12;
+    RRCcfg->discRxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs16_r12;
   } else if (strcmp(SLconfig->discRxPool_ResourceConfig_subframeBitmap_present,"prBs30")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs30_r12;
+    RRCcfg->discRxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs30_r12;
   } else if (strcmp(SLconfig->discRxPool_ResourceConfig_subframeBitmap_present,"prBs40")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs40_r12;
+    RRCcfg->discRxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs40_r12;
   } else if (strcmp(SLconfig->discRxPool_ResourceConfig_subframeBitmap_present,"prBs42")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs42_r12;
+    RRCcfg->discRxPool_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs42_r12;
   } else
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for discRxPool_ResourceConfig_subframeBitmap_present choice: prNothing,prBs4,prBs8,prBs12,prBs16,prBs30,prBs40,prBs42!\n",
 		 config_fname, cell_idx, SLconfig->discRxPool_ResourceConfig_subframeBitmap_present);
 
-  RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf[cc_idx] = SLconfig->discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf;
-  RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_subframeBitmap_choice_bs_size[cc_idx] = SLconfig->discRxPool_ResourceConfig_subframeBitmap_choice_bs_size;
-  RRC_CONFIGURATION_REQ (msg_p).discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused[cc_idx] = SLconfig->discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused;
+  RRCcfg->discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf[cc_idx] = SLconfig->discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf;
+  RRCcfg->discRxPool_ResourceConfig_subframeBitmap_choice_bs_size[cc_idx] = SLconfig->discRxPool_ResourceConfig_subframeBitmap_choice_bs_size;
+  RRCcfg->discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused[cc_idx] = SLconfig->discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused;
 
   //SIB19 - For discRxPoolPS
   if (strcmp(SLconfig->discRxPoolPS_cp_Len,"normal")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_cp_Len[cc_idx] = LTE_SL_CP_Len_r12_normal;
+    RRCcfg->discRxPoolPS_cp_Len[cc_idx] = LTE_SL_CP_Len_r12_normal;
   } else if (strcmp(SLconfig->discRxPoolPS_cp_Len,"extended")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_cp_Len[cc_idx] = LTE_SL_CP_Len_r12_extended;
+    RRCcfg->discRxPoolPS_cp_Len[cc_idx] = LTE_SL_CP_Len_r12_extended;
   } else
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for discRxPoolPS_cp_Len choice: normal,extended!\n",
 		 config_fname, cell_idx, SLconfig->discRxPoolPS_cp_Len);
 
   if (strcmp(SLconfig->discRxPoolPS_discPeriod,"rf32")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf32;
+    RRCcfg->discRxPoolPS_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf32;
   } else if (strcmp(SLconfig->discRxPoolPS_discPeriod,"rf64")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf64;
+    RRCcfg->discRxPoolPS_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf64;
   } else if (strcmp(SLconfig->discRxPoolPS_discPeriod,"rf128")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf128;
+    RRCcfg->discRxPoolPS_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf128;
   } else if (strcmp(SLconfig->discRxPoolPS_discPeriod,"rf256")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf256;
+    RRCcfg->discRxPoolPS_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf256;
   } else if (strcmp(SLconfig->discRxPoolPS_discPeriod,"rf512")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf512;
+    RRCcfg->discRxPoolPS_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf512;
   } else if (strcmp(SLconfig->discRxPoolPS_discPeriod,"rf1024")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf1024;
+    RRCcfg->discRxPoolPS_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf1024;
   } else if (strcmp(SLconfig->discRxPoolPS_discPeriod,"rf16")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf16_v1310;
+    RRCcfg->discRxPoolPS_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_rf16_v1310;
   } else if (strcmp(SLconfig->discRxPoolPS_discPeriod,"spare")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_spare;
+    RRCcfg->discRxPoolPS_discPeriod[cc_idx] = LTE_SL_DiscResourcePool_r12__discPeriod_r12_spare;
   } else
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for discRxPoolPS_discPeriod choice: rf32,rf64,rf128,rf512,rf1024,rf16,spare!\n",
 		 config_fname, cell_idx, SLconfig->discRxPoolPS_discPeriod);
 
-  RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_numRetx[cc_idx] = SLconfig->discRxPoolPS_numRetx;
-  RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_numRepetition[cc_idx] = SLconfig->discRxPoolPS_numRepetition;
-  RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_prb_Num[cc_idx] = SLconfig->discRxPoolPS_ResourceConfig_prb_Num;
-  RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_prb_Start[cc_idx] = SLconfig->discRxPoolPS_ResourceConfig_prb_Start;
-  RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_prb_End[cc_idx] = SLconfig->discRxPoolPS_ResourceConfig_prb_End;
+  RRCcfg->discRxPoolPS_numRetx[cc_idx] = SLconfig->discRxPoolPS_numRetx;
+  RRCcfg->discRxPoolPS_numRepetition[cc_idx] = SLconfig->discRxPoolPS_numRepetition;
+  RRCcfg->discRxPoolPS_ResourceConfig_prb_Num[cc_idx] = SLconfig->discRxPoolPS_ResourceConfig_prb_Num;
+  RRCcfg->discRxPoolPS_ResourceConfig_prb_Start[cc_idx] = SLconfig->discRxPoolPS_ResourceConfig_prb_Start;
+  RRCcfg->discRxPoolPS_ResourceConfig_prb_End[cc_idx] = SLconfig->discRxPoolPS_ResourceConfig_prb_End;
 
   if (strcmp(SLconfig->discRxPoolPS_ResourceConfig_offsetIndicator_present,"prNothing")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_offsetIndicator_present[cc_idx] = LTE_SL_OffsetIndicator_r12_PR_NOTHING;
+    RRCcfg->discRxPoolPS_ResourceConfig_offsetIndicator_present[cc_idx] = LTE_SL_OffsetIndicator_r12_PR_NOTHING;
   } else if (strcmp(SLconfig->discRxPoolPS_ResourceConfig_offsetIndicator_present,"prSmall")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_offsetIndicator_present[cc_idx] = LTE_SL_OffsetIndicator_r12_PR_small_r12;
+    RRCcfg->discRxPoolPS_ResourceConfig_offsetIndicator_present[cc_idx] = LTE_SL_OffsetIndicator_r12_PR_small_r12;
   } else if (strcmp(SLconfig->discRxPoolPS_ResourceConfig_offsetIndicator_present,"prLarge")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_offsetIndicator_present[cc_idx] = LTE_SL_OffsetIndicator_r12_PR_large_r12;
+    RRCcfg->discRxPoolPS_ResourceConfig_offsetIndicator_present[cc_idx] = LTE_SL_OffsetIndicator_r12_PR_large_r12;
   } else
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for discRxPoolPS_ResourceConfig_offsetIndicator_present choice: prNothing,prSmal,prLarge!\n",
 		 config_fname, cell_idx, SLconfig->discRxPoolPS_ResourceConfig_offsetIndicator_present);
 
-  RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_offsetIndicator_choice[cc_idx] = SLconfig->discRxPoolPS_ResourceConfig_offsetIndicator_choice;
+  RRCcfg->discRxPoolPS_ResourceConfig_offsetIndicator_choice[cc_idx] = SLconfig->discRxPoolPS_ResourceConfig_offsetIndicator_choice;
 
   if (strcmp(SLconfig->discRxPoolPS_ResourceConfig_subframeBitmap_present,"prNothing")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_NOTHING;
+    RRCcfg->discRxPoolPS_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_NOTHING;
   } else if (strcmp(SLconfig->discRxPoolPS_ResourceConfig_subframeBitmap_present,"prBs4")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs4_r12;
+    RRCcfg->discRxPoolPS_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs4_r12;
   } else if (strcmp(SLconfig->discRxPoolPS_ResourceConfig_subframeBitmap_present,"prBs8")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs8_r12;
+    RRCcfg->discRxPoolPS_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs8_r12;
   } else if (strcmp(SLconfig->discRxPoolPS_ResourceConfig_subframeBitmap_present,"prBs12")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs12_r12;
+    RRCcfg->discRxPoolPS_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs12_r12;
   } else if (strcmp(SLconfig->discRxPoolPS_ResourceConfig_subframeBitmap_present,"prBs16")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs16_r12;
+    RRCcfg->discRxPoolPS_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs16_r12;
   } else if (strcmp(SLconfig->discRxPoolPS_ResourceConfig_subframeBitmap_present,"prBs30")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs30_r12;
+    RRCcfg->discRxPoolPS_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs30_r12;
   } else if (strcmp(SLconfig->discRxPoolPS_ResourceConfig_subframeBitmap_present,"prBs40")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs40_r12;
+    RRCcfg->discRxPoolPS_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs40_r12;
   } else if (strcmp(SLconfig->discRxPoolPS_ResourceConfig_subframeBitmap_present,"prBs42")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs42_r12;
+    RRCcfg->discRxPoolPS_ResourceConfig_subframeBitmap_present[cc_idx] = LTE_SubframeBitmapSL_r12_PR_bs42_r12;
   } else
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for discRxPoolPS_ResourceConfig_subframeBitmap_present choice: prNothing,prBs4,prBs8,prBs12,prBs16,prBs30,prBs40,prBs42!\n",
 		 config_fname, cell_idx, SLconfig->discRxPoolPS_ResourceConfig_subframeBitmap_present);
 
-  RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_buf[cc_idx] = SLconfig->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_buf;
-  RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_size[cc_idx] = SLconfig->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_size;
-  RRC_CONFIGURATION_REQ (msg_p).discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_bits_unused[cc_idx] = SLconfig->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_bits_unused;
+  RRCcfg->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_buf[cc_idx] = SLconfig->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_buf;
+  RRCcfg->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_size[cc_idx] = SLconfig->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_size;
+  RRCcfg->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_bits_unused[cc_idx] = SLconfig->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_bits_unused;
 } // sidelink_configured==1
diff --git a/openair2/ENB_APP/enb_config_eMTC.c b/openair2/ENB_APP/enb_config_eMTC.c
index e4ff458886b..26eff604609 100644
--- a/openair2/ENB_APP/enb_config_eMTC.c
+++ b/openair2/ENB_APP/enb_config_eMTC.c
@@ -39,8 +39,8 @@
 #include "RRC_config_tools.h"
 #include "enb_paramdef.h"
 
-void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, int cell_idx,int cc_idx,char *config_fname,char *brparamspath) {
-
+void fill_eMTC_configuration(RrcConfigurationReq *RRCcfg, ccparams_eMTC_t *eMTCconfig, int cell_idx, int cc_idx, char *config_fname, char *brparamspath)
+{
   paramdef_t schedulingInfoBrParams[] = SI_INFO_BR_DESC(eMTCconfig);
   paramlist_def_t schedulingInfoBrParamList = {ENB_CONFIG_STRING_SCHEDULING_INFO_BR, NULL, 0};
   paramdef_t rachcelevelParams[]     = RACH_CE_LEVELINFOLIST_R13_DESC(eMTCconfig);
@@ -57,96 +57,88 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
 
 
   printf("Found parameters for eMTC from %s : %s\n",config_fname,brparamspath);
-  RRC_CONFIGURATION_REQ(msg_p).schedulingInfoSIB1_BR_r13[cc_idx] = eMTCconfig->schedulingInfoSIB1_BR_r13;
-
+  RRCcfg->schedulingInfoSIB1_BR_r13[cc_idx] = eMTCconfig->schedulingInfoSIB1_BR_r13;
 
   if (!strcmp(eMTCconfig->cellSelectionInfoCE_r13, "ENABLE")) {
-    RRC_CONFIGURATION_REQ(msg_p).cellSelectionInfoCE_r13[cc_idx] = true;
-    RRC_CONFIGURATION_REQ(msg_p).q_RxLevMinCE_r13[cc_idx]= eMTCconfig->q_RxLevMinCE_r13;
-    //                            RRC_CONFIGURATION_REQ(msg_p).q_QualMinRSRQ_CE_r13[cc_idx]= calloc(1, sizeof(long));
-    //                            *RRC_CONFIGURATION_REQ(msg_p).q_QualMinRSRQ_CE_r13[cc_idx]= q_QualMinRSRQ_CE_r13;
+    RRCcfg->cellSelectionInfoCE_r13[cc_idx] = true;
+    RRCcfg->q_RxLevMinCE_r13[cc_idx] = eMTCconfig->q_RxLevMinCE_r13;
+    //                            RRCcfg->q_QualMinRSRQ_CE_r13[cc_idx]= calloc(1, sizeof(long));
+    //                            *RRCcfg->q_QualMinRSRQ_CE_r13[cc_idx]= q_QualMinRSRQ_CE_r13;
   } else {
-    RRC_CONFIGURATION_REQ(msg_p).cellSelectionInfoCE_r13[cc_idx] = false;
+    RRCcfg->cellSelectionInfoCE_r13[cc_idx] = false;
   }
 
 
 
   if (!strcmp(eMTCconfig->bandwidthReducedAccessRelatedInfo_r13, "ENABLE")) {
-    RRC_CONFIGURATION_REQ(msg_p).bandwidthReducedAccessRelatedInfo_r13[cc_idx] = true;
-
-
+    RRCcfg->bandwidthReducedAccessRelatedInfo_r13[cc_idx] = true;
 
     if (!strcmp(eMTCconfig->si_WindowLength_BR_r13, "ms20")) {
-      RRC_CONFIGURATION_REQ(msg_p).si_WindowLength_BR_r13[cc_idx] = 0;
+      RRCcfg->si_WindowLength_BR_r13[cc_idx] = 0;
     } else if (!strcmp(eMTCconfig->si_WindowLength_BR_r13, "ms40")) {
-      RRC_CONFIGURATION_REQ(msg_p).si_WindowLength_BR_r13[cc_idx] = 1;
+      RRCcfg->si_WindowLength_BR_r13[cc_idx] = 1;
     } else if (!strcmp(eMTCconfig->si_WindowLength_BR_r13, "ms60")) {
-      RRC_CONFIGURATION_REQ(msg_p).si_WindowLength_BR_r13[cc_idx] = 2;
+      RRCcfg->si_WindowLength_BR_r13[cc_idx] = 2;
     } else if (!strcmp(eMTCconfig->si_WindowLength_BR_r13, "ms80")) {
-      RRC_CONFIGURATION_REQ(msg_p).si_WindowLength_BR_r13[cc_idx] = 3;
+      RRCcfg->si_WindowLength_BR_r13[cc_idx] = 3;
     } else if (!strcmp(eMTCconfig->si_WindowLength_BR_r13, "ms120")) {
-      RRC_CONFIGURATION_REQ(msg_p).si_WindowLength_BR_r13[cc_idx] = 4;
+      RRCcfg->si_WindowLength_BR_r13[cc_idx] = 4;
     } else if (!strcmp(eMTCconfig->si_WindowLength_BR_r13, "ms160")) {
-      RRC_CONFIGURATION_REQ(msg_p).si_WindowLength_BR_r13[cc_idx] = 5;
+      RRCcfg->si_WindowLength_BR_r13[cc_idx] = 5;
     } else if (!strcmp(eMTCconfig->si_WindowLength_BR_r13, "ms200")) {
-      RRC_CONFIGURATION_REQ(msg_p).si_WindowLength_BR_r13[cc_idx] = 6;
+      RRCcfg->si_WindowLength_BR_r13[cc_idx] = 6;
     } else if (!strcmp(eMTCconfig->si_WindowLength_BR_r13, "spare")) {
-      RRC_CONFIGURATION_REQ(msg_p).si_WindowLength_BR_r13[cc_idx] = 7;
+      RRCcfg->si_WindowLength_BR_r13[cc_idx] = 7;
     }
 
 
     if (!strcmp(eMTCconfig->si_RepetitionPattern_r13, "everyRF")) {
-      RRC_CONFIGURATION_REQ(msg_p).si_RepetitionPattern_r13[cc_idx] = 0;
+      RRCcfg->si_RepetitionPattern_r13[cc_idx] = 0;
     } else if (!strcmp(eMTCconfig->si_RepetitionPattern_r13, "every2ndRF")) {
-      RRC_CONFIGURATION_REQ(msg_p).si_RepetitionPattern_r13[cc_idx] = 1;
+      RRCcfg->si_RepetitionPattern_r13[cc_idx] = 1;
     } else if (!strcmp(eMTCconfig->si_RepetitionPattern_r13, "every4thRF")) {
-      RRC_CONFIGURATION_REQ(msg_p).si_RepetitionPattern_r13[cc_idx] = 2;
+      RRCcfg->si_RepetitionPattern_r13[cc_idx] = 2;
     } else if (!strcmp(eMTCconfig->si_RepetitionPattern_r13, "every8thRF")) {
-      RRC_CONFIGURATION_REQ(msg_p).si_RepetitionPattern_r13[cc_idx] = 3;
+      RRCcfg->si_RepetitionPattern_r13[cc_idx] = 3;
     }
 
   } else {
-    RRC_CONFIGURATION_REQ(msg_p).bandwidthReducedAccessRelatedInfo_r13[cc_idx] = false;
+    RRCcfg->bandwidthReducedAccessRelatedInfo_r13[cc_idx] = false;
   }
 
   char schedulingInfoBrPath[MAX_OPTNAME_SIZE * 2];
   config_getlist(&schedulingInfoBrParamList, NULL, 0, brparamspath);
-  RRC_CONFIGURATION_REQ (msg_p).scheduling_info_br_size[cc_idx] = schedulingInfoBrParamList.numelt;
+  RRCcfg->scheduling_info_br_size[cc_idx] = schedulingInfoBrParamList.numelt;
   int siInfoindex;
   for (siInfoindex = 0; siInfoindex < schedulingInfoBrParamList.numelt; siInfoindex++) {
     sprintf(schedulingInfoBrPath, "%s.%s.[%i]", brparamspath, ENB_CONFIG_STRING_EMTC_PARAMETERS, siInfoindex);
     config_get(schedulingInfoBrParams, sizeof(schedulingInfoBrParams) / sizeof(paramdef_t), schedulingInfoBrPath);
-    RRC_CONFIGURATION_REQ (msg_p).si_Narrowband_r13[cc_idx][siInfoindex] = eMTCconfig->si_Narrowband_r13;
-    RRC_CONFIGURATION_REQ (msg_p).si_TBS_r13[cc_idx][siInfoindex] = eMTCconfig->si_TBS_r13;
+    RRCcfg->si_Narrowband_r13[cc_idx][siInfoindex] = eMTCconfig->si_Narrowband_r13;
+    RRCcfg->si_TBS_r13[cc_idx][siInfoindex] = eMTCconfig->si_TBS_r13;
   }
 
+  //                        RRCcfg->radioresourceconfig[cc_idx].system_info_value_tag_SI_size[cc_idx] = 0;
 
-
-  //                        RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[cc_idx].system_info_value_tag_SI_size[cc_idx] = 0;
-
-
-  RRC_CONFIGURATION_REQ(msg_p).fdd_DownlinkOrTddSubframeBitmapBR_r13[cc_idx] = CALLOC(1, sizeof(BOOLEAN_t));
+  RRCcfg->fdd_DownlinkOrTddSubframeBitmapBR_r13[cc_idx] = CALLOC(1, sizeof(BOOLEAN_t));
   if (!strcmp(eMTCconfig->fdd_DownlinkOrTddSubframeBitmapBR_r13, "subframePattern40-r13")) {
-    *RRC_CONFIGURATION_REQ(msg_p).fdd_DownlinkOrTddSubframeBitmapBR_r13[cc_idx] = false;
-    RRC_CONFIGURATION_REQ(msg_p).fdd_DownlinkOrTddSubframeBitmapBR_val_r13[cc_idx] = eMTCconfig->fdd_DownlinkOrTddSubframeBitmapBR_val_r13;
+    *RRCcfg->fdd_DownlinkOrTddSubframeBitmapBR_r13[cc_idx] = false;
+    RRCcfg->fdd_DownlinkOrTddSubframeBitmapBR_val_r13[cc_idx] = eMTCconfig->fdd_DownlinkOrTddSubframeBitmapBR_val_r13;
   } else {
-    *RRC_CONFIGURATION_REQ(msg_p).fdd_DownlinkOrTddSubframeBitmapBR_r13[cc_idx] = true;
-    RRC_CONFIGURATION_REQ(msg_p).fdd_DownlinkOrTddSubframeBitmapBR_val_r13[cc_idx] = eMTCconfig->fdd_DownlinkOrTddSubframeBitmapBR_val_r13;
+    *RRCcfg->fdd_DownlinkOrTddSubframeBitmapBR_r13[cc_idx] = true;
+    RRCcfg->fdd_DownlinkOrTddSubframeBitmapBR_val_r13[cc_idx] = eMTCconfig->fdd_DownlinkOrTddSubframeBitmapBR_val_r13;
   }
 
-  RRC_CONFIGURATION_REQ(msg_p).startSymbolBR_r13[cc_idx] = eMTCconfig->startSymbolBR_r13;
-
+  RRCcfg->startSymbolBR_r13[cc_idx] = eMTCconfig->startSymbolBR_r13;
 
   if (!strcmp(eMTCconfig->si_HoppingConfigCommon_r13, "off")) {
-    RRC_CONFIGURATION_REQ(msg_p).si_HoppingConfigCommon_r13[cc_idx] = 1;
+    RRCcfg->si_HoppingConfigCommon_r13[cc_idx] = 1;
   } else if (!strcmp(eMTCconfig->si_HoppingConfigCommon_r13, "on")) {
-    RRC_CONFIGURATION_REQ(msg_p).si_HoppingConfigCommon_r13[cc_idx] = 0;
+    RRCcfg->si_HoppingConfigCommon_r13[cc_idx] = 0;
   }
 
-
-  RRC_CONFIGURATION_REQ(msg_p).si_ValidityTime_r13[cc_idx] = calloc(1, sizeof(long));
+  RRCcfg->si_ValidityTime_r13[cc_idx] = calloc(1, sizeof(long));
   if (!strcmp(eMTCconfig->si_ValidityTime_r13, "true")) {
-    *RRC_CONFIGURATION_REQ(msg_p).si_ValidityTime_r13[cc_idx] = 0;
+    *RRCcfg->si_ValidityTime_r13[cc_idx] = 0;
   } else {
     AssertFatal(0,
 		"Failed to parse eNB configuration file %s, enb %d  si_ValidityTime_r13 unknown value!\n",
@@ -156,107 +148,100 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
 
   if (!strcmp(eMTCconfig->freqHoppingParametersDL_r13, "ENABLE"))
     {
-      RRC_CONFIGURATION_REQ(msg_p).freqHoppingParametersDL_r13[cc_idx] = true;
-
-      if (!strcmp(eMTCconfig->interval_DLHoppingConfigCommonModeA_r13, "interval-TDD-r13"))
-	RRC_CONFIGURATION_REQ(msg_p).interval_DLHoppingConfigCommonModeA_r13[cc_idx] = false;
-      else
-	RRC_CONFIGURATION_REQ(msg_p).interval_DLHoppingConfigCommonModeA_r13[cc_idx] = true;
-      RRC_CONFIGURATION_REQ(msg_p).interval_DLHoppingConfigCommonModeA_r13_val[cc_idx] = eMTCconfig->interval_DLHoppingConfigCommonModeA_r13_val;
-
-      if (!strcmp(eMTCconfig->interval_DLHoppingConfigCommonModeB_r13, "interval-TDD-r13"))
-	RRC_CONFIGURATION_REQ(msg_p).interval_DLHoppingConfigCommonModeB_r13[cc_idx] = false;
-      else
-	RRC_CONFIGURATION_REQ(msg_p).interval_DLHoppingConfigCommonModeB_r13[cc_idx] = true;
-      RRC_CONFIGURATION_REQ(msg_p).interval_DLHoppingConfigCommonModeB_r13_val[cc_idx] = eMTCconfig->interval_DLHoppingConfigCommonModeB_r13_val;
-
-      RRC_CONFIGURATION_REQ(msg_p).mpdcch_pdsch_HoppingNB_r13[cc_idx] = calloc(1, sizeof(long));
-      if (!strcmp(eMTCconfig->mpdcch_pdsch_HoppingNB_r13, "nb2")) {
-	*RRC_CONFIGURATION_REQ(msg_p).mpdcch_pdsch_HoppingNB_r13[cc_idx] = 0;
+    RRCcfg->freqHoppingParametersDL_r13[cc_idx] = true;
+
+    if (!strcmp(eMTCconfig->interval_DLHoppingConfigCommonModeA_r13, "interval-TDD-r13"))
+      RRCcfg->interval_DLHoppingConfigCommonModeA_r13[cc_idx] = false;
+    else
+      RRCcfg->interval_DLHoppingConfigCommonModeA_r13[cc_idx] = true;
+    RRCcfg->interval_DLHoppingConfigCommonModeA_r13_val[cc_idx] = eMTCconfig->interval_DLHoppingConfigCommonModeA_r13_val;
+
+    if (!strcmp(eMTCconfig->interval_DLHoppingConfigCommonModeB_r13, "interval-TDD-r13"))
+      RRCcfg->interval_DLHoppingConfigCommonModeB_r13[cc_idx] = false;
+    else
+      RRCcfg->interval_DLHoppingConfigCommonModeB_r13[cc_idx] = true;
+    RRCcfg->interval_DLHoppingConfigCommonModeB_r13_val[cc_idx] = eMTCconfig->interval_DLHoppingConfigCommonModeB_r13_val;
+
+    RRCcfg->mpdcch_pdsch_HoppingNB_r13[cc_idx] = calloc(1, sizeof(long));
+    if (!strcmp(eMTCconfig->mpdcch_pdsch_HoppingNB_r13, "nb2")) {
+      *RRCcfg->mpdcch_pdsch_HoppingNB_r13[cc_idx] = 0;
       } else if (!strcmp(eMTCconfig->mpdcch_pdsch_HoppingNB_r13, "nb4")) {
-	*RRC_CONFIGURATION_REQ(msg_p).mpdcch_pdsch_HoppingNB_r13[cc_idx] = 1;
+        *RRCcfg->mpdcch_pdsch_HoppingNB_r13[cc_idx] = 1;
       } else {
 	AssertFatal(0,
 		    "Failed to parse eNB configuration file %s, enb %d  mpdcch_pdsch_HoppingNB_r13 unknown value!\n",
 		    config_fname, cell_idx);
       }
 
-
-      RRC_CONFIGURATION_REQ(msg_p).mpdcch_pdsch_HoppingOffset_r13[cc_idx] = calloc(1, sizeof(long));
-      *RRC_CONFIGURATION_REQ(msg_p).mpdcch_pdsch_HoppingOffset_r13[cc_idx] = eMTCconfig->mpdcch_pdsch_HoppingOffset_r13;
+      RRCcfg->mpdcch_pdsch_HoppingOffset_r13[cc_idx] = calloc(1, sizeof(long));
+      *RRCcfg->mpdcch_pdsch_HoppingOffset_r13[cc_idx] = eMTCconfig->mpdcch_pdsch_HoppingOffset_r13;
 
     }
   else
     {
-      RRC_CONFIGURATION_REQ(msg_p).freqHoppingParametersDL_r13[cc_idx] = false;
+      RRCcfg->freqHoppingParametersDL_r13[cc_idx] = false;
     }
 
   /** ------------------------------SIB2/3 BR------------------------------------------ */
 
+    RRCcfg->radioresourceconfig_BR[cc_idx].prach_root = eMTCconfig->ccparams.prach_root;
 
-  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].prach_root =  eMTCconfig->ccparams.prach_root;
-
-  if ((eMTCconfig->ccparams.prach_root <0) || (eMTCconfig->ccparams.prach_root > 1023))
-    AssertFatal (0,
-		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_root choice: 0..1023 !\n",
-		 config_fname, cell_idx,eMTCconfig->ccparams.prach_root);
+    if ((eMTCconfig->ccparams.prach_root < 0) || (eMTCconfig->ccparams.prach_root > 1023))
+      AssertFatal(0, "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_root choice: 0..1023 !\n", config_fname, cell_idx, eMTCconfig->ccparams.prach_root);
 
-  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].prach_config_index = eMTCconfig->ccparams.prach_config_index;
+    RRCcfg->radioresourceconfig_BR[cc_idx].prach_config_index = eMTCconfig->ccparams.prach_config_index;
 
-  if ((eMTCconfig->ccparams.prach_config_index <0) || (eMTCconfig->ccparams.prach_config_index > 63))
-    AssertFatal (0,
-		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_config_index choice: 0..1023 !\n",
-		 config_fname, cell_idx,eMTCconfig->ccparams.prach_config_index);
+    if ((eMTCconfig->ccparams.prach_config_index < 0) || (eMTCconfig->ccparams.prach_config_index > 63))
+      AssertFatal(
+          0, "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_config_index choice: 0..1023 !\n", config_fname, cell_idx, eMTCconfig->ccparams.prach_config_index);
 
-  if (!eMTCconfig->ccparams.prach_high_speed)
-    AssertFatal (0,
-		 "Failed to parse eNB configuration file %s, enb %d define %s: ENABLE,DISABLE!\n",
-		 config_fname, cell_idx,ENB_CONFIG_STRING_PRACH_HIGH_SPEED);
-  else if (strcmp(eMTCconfig->ccparams.prach_high_speed, "ENABLE") == 0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].prach_high_speed = true;
+    if (!eMTCconfig->ccparams.prach_high_speed)
+      AssertFatal(0, "Failed to parse eNB configuration file %s, enb %d define %s: ENABLE,DISABLE!\n", config_fname, cell_idx, ENB_CONFIG_STRING_PRACH_HIGH_SPEED);
+    else if (strcmp(eMTCconfig->ccparams.prach_high_speed, "ENABLE") == 0) {
+      RRCcfg->radioresourceconfig_BR[cc_idx].prach_high_speed = true;
   } else if (strcmp(eMTCconfig->ccparams.prach_high_speed, "DISABLE") == 0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].prach_high_speed = false;
+    RRCcfg->radioresourceconfig_BR[cc_idx].prach_high_speed = false;
   } else
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for prach_config choice: ENABLE,DISABLE !\n",
 		 config_fname, cell_idx,eMTCconfig->ccparams.prach_high_speed);
 
-  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].prach_zero_correlation = eMTCconfig->ccparams.prach_zero_correlation;
+  RRCcfg->radioresourceconfig_BR[cc_idx].prach_zero_correlation = eMTCconfig->ccparams.prach_zero_correlation;
 
   if ((eMTCconfig->ccparams.prach_zero_correlation <0) || (eMTCconfig->ccparams.prach_zero_correlation > 15))
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_zero_correlation choice: 0..15!\n",
 		 config_fname, cell_idx,eMTCconfig->ccparams.prach_zero_correlation);
 
-  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].prach_freq_offset = eMTCconfig->ccparams.prach_freq_offset;
+  RRCcfg->radioresourceconfig_BR[cc_idx].prach_freq_offset = eMTCconfig->ccparams.prach_freq_offset;
 
   if ((eMTCconfig->ccparams.prach_freq_offset <0) || (eMTCconfig->ccparams.prach_freq_offset > 94))
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_freq_offset choice: 0..94!\n",
 		 config_fname, cell_idx,eMTCconfig->ccparams.prach_freq_offset);
 
-  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pucch_delta_shift = eMTCconfig->ccparams.pucch_delta_shift-1;
+  RRCcfg->radioresourceconfig_BR[cc_idx].pucch_delta_shift = eMTCconfig->ccparams.pucch_delta_shift - 1;
 
   if ((eMTCconfig->ccparams.pucch_delta_shift <1) || (eMTCconfig->ccparams.pucch_delta_shift > 3))
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pucch_delta_shift choice: 1..3!\n",
 		 config_fname, cell_idx,eMTCconfig->ccparams.pucch_delta_shift);
 
-  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pucch_nRB_CQI = eMTCconfig->ccparams.pucch_nRB_CQI;
+  RRCcfg->radioresourceconfig_BR[cc_idx].pucch_nRB_CQI = eMTCconfig->ccparams.pucch_nRB_CQI;
 
   if ((eMTCconfig->ccparams.pucch_nRB_CQI <0) || (eMTCconfig->ccparams.pucch_nRB_CQI > 98))
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pucch_nRB_CQI choice: 0..98!\n",
 		 config_fname, cell_idx,eMTCconfig->ccparams.pucch_nRB_CQI);
 
-  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pucch_nCS_AN = eMTCconfig->ccparams.pucch_nCS_AN;
+  RRCcfg->radioresourceconfig_BR[cc_idx].pucch_nCS_AN = eMTCconfig->ccparams.pucch_nCS_AN;
 
   if ((eMTCconfig->ccparams.pucch_nCS_AN <0) || (eMTCconfig->ccparams.pucch_nCS_AN > 7))
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pucch_nCS_AN choice: 0..7!\n",
 		 config_fname, cell_idx,eMTCconfig->ccparams.pucch_nCS_AN);
 
-  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pucch_n1_AN = eMTCconfig->ccparams.pucch_n1_AN;
+  RRCcfg->radioresourceconfig_BR[cc_idx].pucch_n1_AN = eMTCconfig->ccparams.pucch_n1_AN;
 
   if ((eMTCconfig->ccparams.pucch_n1_AN <0) || (eMTCconfig->ccparams.pucch_n1_AN > 2047))
     AssertFatal (0,
@@ -264,21 +249,21 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
 		 config_fname, cell_idx,eMTCconfig->ccparams.pucch_n1_AN);
 
   //#endif
-  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pdsch_referenceSignalPower = eMTCconfig->ccparams.pdsch_referenceSignalPower;
+  RRCcfg->radioresourceconfig_BR[cc_idx].pdsch_referenceSignalPower = eMTCconfig->ccparams.pdsch_referenceSignalPower;
 
   if ((eMTCconfig->ccparams.pdsch_referenceSignalPower <-60) || (eMTCconfig->ccparams.pdsch_referenceSignalPower > 50))
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pdsch_referenceSignalPower choice:-60..50!\n",
 		 config_fname, cell_idx,eMTCconfig->ccparams.pdsch_referenceSignalPower);
 
-  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pdsch_p_b = eMTCconfig->ccparams.pdsch_p_b;
+  RRCcfg->radioresourceconfig_BR[cc_idx].pdsch_p_b = eMTCconfig->ccparams.pdsch_p_b;
 
   if ((eMTCconfig->ccparams.pdsch_p_b <0) || (eMTCconfig->ccparams.pdsch_p_b > 3))
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pdsch_p_b choice: 0..3!\n",
 		 config_fname, cell_idx,eMTCconfig->ccparams.pdsch_p_b);
 
-  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pusch_n_SB = eMTCconfig->ccparams.pusch_n_SB;
+  RRCcfg->radioresourceconfig_BR[cc_idx].pusch_n_SB = eMTCconfig->ccparams.pusch_n_SB;
 
   if ((eMTCconfig->ccparams.pusch_n_SB <1) || (eMTCconfig->ccparams.pusch_n_SB > 4))
     AssertFatal (0,
@@ -290,15 +275,15 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
 		 "Failed to parse eNB configuration file %s, enb %d define %s: interSubframe,intraAndInterSubframe!\n",
 		 config_fname, cell_idx,ENB_CONFIG_STRING_PUSCH_HOPPINGMODE);
   else if (strcmp(eMTCconfig->ccparams.pusch_hoppingMode,"interSubFrame")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pusch_hoppingMode = LTE_PUSCH_ConfigCommon__pusch_ConfigBasic__hoppingMode_interSubFrame;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pusch_hoppingMode = LTE_PUSCH_ConfigCommon__pusch_ConfigBasic__hoppingMode_interSubFrame;
   }  else if (strcmp(eMTCconfig->ccparams.pusch_hoppingMode,"intraAndInterSubFrame")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pusch_hoppingMode = LTE_PUSCH_ConfigCommon__pusch_ConfigBasic__hoppingMode_intraAndInterSubFrame;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pusch_hoppingMode = LTE_PUSCH_ConfigCommon__pusch_ConfigBasic__hoppingMode_intraAndInterSubFrame;
   } else
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pusch_hoppingMode choice: interSubframe,intraAndInterSubframe!\n",
 		 config_fname, cell_idx,eMTCconfig->ccparams.pusch_hoppingMode);
 
-  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pusch_hoppingOffset = eMTCconfig->ccparams.pusch_hoppingOffset;
+  RRCcfg->radioresourceconfig_BR[cc_idx].pusch_hoppingOffset = eMTCconfig->ccparams.pusch_hoppingOffset;
 
   if ((eMTCconfig->ccparams.pusch_hoppingOffset<0) || (eMTCconfig->ccparams.pusch_hoppingOffset>98))
     AssertFatal (0,
@@ -310,9 +295,9 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
 		 "Failed to parse eNB configuration file %s, enb %d define %s: ENABLE,DISABLE!\n",
 		 config_fname, cell_idx,ENB_CONFIG_STRING_PUSCH_ENABLE64QAM);
   else if (strcmp(eMTCconfig->ccparams.pusch_enable64QAM, "ENABLE") == 0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pusch_enable64QAM = true;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pusch_enable64QAM = true;
   }  else if (strcmp(eMTCconfig->ccparams.pusch_enable64QAM, "DISABLE") == 0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pusch_enable64QAM = false;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pusch_enable64QAM = false;
   } else
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pusch_enable64QAM choice: ENABLE,DISABLE!\n",
@@ -323,15 +308,15 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
 		 "Failed to parse eNB configuration file %s, enb %d define %s: ENABLE,DISABLE!\n",
 		 config_fname, cell_idx,ENB_CONFIG_STRING_PUSCH_GROUP_HOPPING_EN);
   else if (strcmp(eMTCconfig->ccparams.pusch_groupHoppingEnabled, "ENABLE") == 0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pusch_groupHoppingEnabled = true;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pusch_groupHoppingEnabled = true;
   }  else if (strcmp(eMTCconfig->ccparams.pusch_groupHoppingEnabled, "DISABLE") == 0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pusch_groupHoppingEnabled= false;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pusch_groupHoppingEnabled = false;
   } else
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pusch_groupHoppingEnabled choice: ENABLE,DISABLE!\n",
 		 config_fname, cell_idx,eMTCconfig->ccparams.pusch_groupHoppingEnabled);
 
-  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pusch_groupAssignment = eMTCconfig->ccparams.pusch_groupAssignment;
+  RRCcfg->radioresourceconfig_BR[cc_idx].pusch_groupAssignment = eMTCconfig->ccparams.pusch_groupAssignment;
 
   if ((eMTCconfig->ccparams.pusch_groupAssignment<0)||(eMTCconfig->ccparams.pusch_groupAssignment>29))
     AssertFatal (0,
@@ -343,15 +328,15 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
 		 "Failed to parse eNB configuration file %s, enb %d define %s: ENABLE,DISABLE!\n",
 		 config_fname, cell_idx,ENB_CONFIG_STRING_PUSCH_SEQUENCE_HOPPING_EN);
   else if (strcmp(eMTCconfig->ccparams.pusch_sequenceHoppingEnabled, "ENABLE") == 0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pusch_sequenceHoppingEnabled = true;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pusch_sequenceHoppingEnabled = true;
   }  else if (strcmp(eMTCconfig->ccparams.pusch_sequenceHoppingEnabled, "DISABLE") == 0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pusch_sequenceHoppingEnabled = false;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pusch_sequenceHoppingEnabled = false;
   } else
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pusch_sequenceHoppingEnabled choice: ENABLE,DISABLE!\n",
 		 config_fname, cell_idx,eMTCconfig->ccparams.pusch_sequenceHoppingEnabled);
 
-  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pusch_nDMRS1= eMTCconfig->ccparams.pusch_nDMRS1;  //cyclic_shift in RRC!
+  RRCcfg->radioresourceconfig_BR[cc_idx].pusch_nDMRS1 = eMTCconfig->ccparams.pusch_nDMRS1; // cyclic_shift in RRC!
 
   if ((eMTCconfig->ccparams.pusch_nDMRS1 <0) || (eMTCconfig->ccparams.pusch_nDMRS1>7))
     AssertFatal (0,
@@ -359,48 +344,50 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
 		 config_fname, cell_idx,eMTCconfig->ccparams.pusch_nDMRS1);
 
   if (strcmp(eMTCconfig->ccparams.phich_duration,"NORMAL")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].phich_duration= LTE_PHICH_Config__phich_Duration_normal;
+    RRCcfg->radioresourceconfig_BR[cc_idx].phich_duration = LTE_PHICH_Config__phich_Duration_normal;
   } else if (strcmp(eMTCconfig->ccparams.phich_duration,"EXTENDED")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].phich_duration= LTE_PHICH_Config__phich_Duration_extended;
+    RRCcfg->radioresourceconfig_BR[cc_idx].phich_duration = LTE_PHICH_Config__phich_Duration_extended;
   } else
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for phich_duration choice: NORMAL,EXTENDED!\n",
 		 config_fname, cell_idx,eMTCconfig->ccparams.phich_duration);
 
   if (strcmp(eMTCconfig->ccparams.phich_resource,"ONESIXTH")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].phich_resource= LTE_PHICH_Config__phich_Resource_oneSixth ;
+    RRCcfg->radioresourceconfig_BR[cc_idx].phich_resource = LTE_PHICH_Config__phich_Resource_oneSixth;
   } else if (strcmp(eMTCconfig->ccparams.phich_resource,"HALF")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].phich_resource= LTE_PHICH_Config__phich_Resource_half;
+    RRCcfg->radioresourceconfig_BR[cc_idx].phich_resource = LTE_PHICH_Config__phich_Resource_half;
   } else if (strcmp(eMTCconfig->ccparams.phich_resource,"ONE")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].phich_resource= LTE_PHICH_Config__phich_Resource_one;
+    RRCcfg->radioresourceconfig_BR[cc_idx].phich_resource = LTE_PHICH_Config__phich_Resource_one;
   } else if (strcmp(eMTCconfig->ccparams.phich_resource,"TWO")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].phich_resource= LTE_PHICH_Config__phich_Resource_two;
+    RRCcfg->radioresourceconfig_BR[cc_idx].phich_resource = LTE_PHICH_Config__phich_Resource_two;
   } else
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for phich_resource choice: ONESIXTH,HALF,ONE,TWO!\n",
 		 config_fname, cell_idx,eMTCconfig->ccparams.phich_resource);
 
   printf("phich.resource eMTC %ld (%s), phich.duration eMTC %ld (%s)\n",
-	 RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].phich_resource,eMTCconfig->ccparams.phich_resource,
-	 RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].phich_duration,eMTCconfig->ccparams.phich_duration);
+         RRCcfg->radioresourceconfig_BR[cc_idx].phich_resource,
+         eMTCconfig->ccparams.phich_resource,
+         RRCcfg->radioresourceconfig_BR[cc_idx].phich_duration,
+         eMTCconfig->ccparams.phich_duration);
 
   if (strcmp(eMTCconfig->ccparams.srs_enable, "ENABLE") == 0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].srs_enable= true;
+    RRCcfg->radioresourceconfig_BR[cc_idx].srs_enable = true;
   } else if (strcmp(eMTCconfig->ccparams.srs_enable, "DISABLE") == 0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].srs_enable= false;
+    RRCcfg->radioresourceconfig_BR[cc_idx].srs_enable = false;
   } else
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for srs_BandwidthConfig choice: ENABLE,DISABLE !\n",
 		 config_fname, cell_idx,eMTCconfig->ccparams.srs_enable);
 
-  if (RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].srs_enable== true) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].srs_BandwidthConfig= eMTCconfig->ccparams.srs_BandwidthConfig;
+  if (RRCcfg->radioresourceconfig_BR[cc_idx].srs_enable == true) {
+    RRCcfg->radioresourceconfig_BR[cc_idx].srs_BandwidthConfig = eMTCconfig->ccparams.srs_BandwidthConfig;
 
     if ((eMTCconfig->ccparams.srs_BandwidthConfig < 0) || (eMTCconfig->ccparams.srs_BandwidthConfig >7))
       AssertFatal (0, "Failed to parse eNB configuration file %s, enb %d unknown value %d for srs_BandwidthConfig choice: 0...7\n",
 		   config_fname, cell_idx,eMTCconfig->ccparams.srs_BandwidthConfig);
 
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].srs_SubframeConfig= eMTCconfig->ccparams.srs_SubframeConfig;
+    RRCcfg->radioresourceconfig_BR[cc_idx].srs_SubframeConfig = eMTCconfig->ccparams.srs_SubframeConfig;
 
     if ((eMTCconfig->ccparams.srs_SubframeConfig<0) || (eMTCconfig->ccparams.srs_SubframeConfig>15))
       AssertFatal (0,
@@ -408,25 +395,25 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
 		   config_fname, cell_idx,eMTCconfig->ccparams.srs_SubframeConfig);
 
     if (strcmp(eMTCconfig->ccparams.srs_ackNackST, "ENABLE") == 0) {
-      RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].srs_ackNackST= true;
+      RRCcfg->radioresourceconfig_BR[cc_idx].srs_ackNackST = true;
     } else if (strcmp(eMTCconfig->ccparams.srs_ackNackST, "DISABLE") == 0) {
-      RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].srs_ackNackST= false;
+      RRCcfg->radioresourceconfig_BR[cc_idx].srs_ackNackST = false;
     } else
       AssertFatal (0,
 		   "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for srs_BandwidthConfig choice: ENABLE,DISABLE !\n",
 		   config_fname, cell_idx,eMTCconfig->ccparams.srs_ackNackST);
 
     if (strcmp(eMTCconfig->ccparams.srs_MaxUpPts, "ENABLE") == 0) {
-      RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].srs_MaxUpPts= true;
+      RRCcfg->radioresourceconfig_BR[cc_idx].srs_MaxUpPts = true;
     } else if (strcmp(eMTCconfig->ccparams.srs_MaxUpPts, "DISABLE") == 0) {
-      RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].srs_MaxUpPts= false;
+      RRCcfg->radioresourceconfig_BR[cc_idx].srs_MaxUpPts = false;
     } else
       AssertFatal (0,
 		   "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for srs_MaxUpPts choice: ENABLE,DISABLE !\n",
 		   config_fname, cell_idx,eMTCconfig->ccparams.srs_MaxUpPts);
   }
 
-  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pusch_p0_Nominal= eMTCconfig->ccparams.pusch_p0_Nominal;
+  RRCcfg->radioresourceconfig_BR[cc_idx].pusch_p0_Nominal = eMTCconfig->ccparams.pusch_p0_Nominal;
 
   if ((eMTCconfig->ccparams.pusch_p0_Nominal<-126) || (eMTCconfig->ccparams.pusch_p0_Nominal>24))
     AssertFatal (0,
@@ -434,21 +421,21 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
 		 config_fname, cell_idx,eMTCconfig->ccparams.pusch_p0_Nominal);
 
   if (strcmp(eMTCconfig->ccparams.pusch_alpha,"AL0")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pusch_alpha= LTE_Alpha_r12_al0;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pusch_alpha = LTE_Alpha_r12_al0;
   } else if (strcmp(eMTCconfig->ccparams.pusch_alpha,"AL04")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pusch_alpha= LTE_Alpha_r12_al04;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pusch_alpha = LTE_Alpha_r12_al04;
   } else if (strcmp(eMTCconfig->ccparams.pusch_alpha,"AL05")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pusch_alpha= LTE_Alpha_r12_al05;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pusch_alpha = LTE_Alpha_r12_al05;
   } else if (strcmp(eMTCconfig->ccparams.pusch_alpha,"AL06")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pusch_alpha= LTE_Alpha_r12_al06;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pusch_alpha = LTE_Alpha_r12_al06;
   } else if (strcmp(eMTCconfig->ccparams.pusch_alpha,"AL07")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pusch_alpha= LTE_Alpha_r12_al07;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pusch_alpha = LTE_Alpha_r12_al07;
   } else if (strcmp(eMTCconfig->ccparams.pusch_alpha,"AL08")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pusch_alpha= LTE_Alpha_r12_al08;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pusch_alpha = LTE_Alpha_r12_al08;
   } else if (strcmp(eMTCconfig->ccparams.pusch_alpha,"AL09")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pusch_alpha= LTE_Alpha_r12_al09;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pusch_alpha = LTE_Alpha_r12_al09;
   } else if (strcmp(eMTCconfig->ccparams.pusch_alpha,"AL1")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pusch_alpha= LTE_Alpha_r12_al1;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pusch_alpha = LTE_Alpha_r12_al1;
   }
 
   else
@@ -456,14 +443,14 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_Alpha choice: AL0,AL04,AL05,AL06,AL07,AL08,AL09,AL1!\n",
 		 config_fname, cell_idx,eMTCconfig->ccparams.pusch_alpha);
 
-  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pucch_p0_Nominal= eMTCconfig->ccparams.pucch_p0_Nominal;
+  RRCcfg->radioresourceconfig_BR[cc_idx].pucch_p0_Nominal = eMTCconfig->ccparams.pucch_p0_Nominal;
 
   if ((eMTCconfig->ccparams.pucch_p0_Nominal<-127) || (eMTCconfig->ccparams.pucch_p0_Nominal>-96))
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pucch_p0_Nominal choice: -127..-96 !\n",
 		 config_fname, cell_idx,eMTCconfig->ccparams.pucch_p0_Nominal);
 
-  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].msg3_delta_Preamble= eMTCconfig->ccparams.msg3_delta_Preamble;
+  RRCcfg->radioresourceconfig_BR[cc_idx].msg3_delta_Preamble = eMTCconfig->ccparams.msg3_delta_Preamble;
 
   if ((eMTCconfig->ccparams.msg3_delta_Preamble<-1) || (eMTCconfig->ccparams.msg3_delta_Preamble>6))
     AssertFatal (0,
@@ -471,63 +458,63 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
 		 config_fname, cell_idx,eMTCconfig->ccparams.msg3_delta_Preamble);
 
   if (strcmp(eMTCconfig->ccparams.pucch_deltaF_Format1,"deltaF_2")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pucch_deltaF_Format1= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1_deltaF_2;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pucch_deltaF_Format1 = LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1_deltaF_2;
   } else if (strcmp(eMTCconfig->ccparams.pucch_deltaF_Format1,"deltaF0")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pucch_deltaF_Format1= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1_deltaF0;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pucch_deltaF_Format1 = LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1_deltaF0;
   } else if (strcmp(eMTCconfig->ccparams.pucch_deltaF_Format1,"deltaF2")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pucch_deltaF_Format1= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1_deltaF2;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pucch_deltaF_Format1 = LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1_deltaF2;
   } else
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_deltaF_Format1 choice: deltaF_2,dltaF0,deltaF2!\n",
 		 config_fname, cell_idx,eMTCconfig->ccparams.pucch_deltaF_Format1);
 
   if (strcmp(eMTCconfig->ccparams.pucch_deltaF_Format1b,"deltaF1")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pucch_deltaF_Format1b= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1b_deltaF1;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pucch_deltaF_Format1b = LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1b_deltaF1;
   } else if (strcmp(eMTCconfig->ccparams.pucch_deltaF_Format1b,"deltaF3")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pucch_deltaF_Format1b= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1b_deltaF3;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pucch_deltaF_Format1b = LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1b_deltaF3;
   } else if (strcmp(eMTCconfig->ccparams.pucch_deltaF_Format1b,"deltaF5")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pucch_deltaF_Format1b= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1b_deltaF5;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pucch_deltaF_Format1b = LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1b_deltaF5;
   } else
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_deltaF_Format1b choice: deltaF1,dltaF3,deltaF5!\n",
 		 config_fname, cell_idx,eMTCconfig->ccparams.pucch_deltaF_Format1b);
 
   if (strcmp(eMTCconfig->ccparams.pucch_deltaF_Format2,"deltaF_2")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pucch_deltaF_Format2= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF_2;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pucch_deltaF_Format2 = LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF_2;
   } else if (strcmp(eMTCconfig->ccparams.pucch_deltaF_Format2,"deltaF0")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pucch_deltaF_Format2= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF0;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pucch_deltaF_Format2 = LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF0;
   } else if (strcmp(eMTCconfig->ccparams.pucch_deltaF_Format2,"deltaF1")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pucch_deltaF_Format2= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF1;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pucch_deltaF_Format2 = LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF1;
   } else if (strcmp(eMTCconfig->ccparams.pucch_deltaF_Format2,"deltaF2")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pucch_deltaF_Format2= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF2;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pucch_deltaF_Format2 = LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF2;
   } else
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_deltaF_Format2 choice: deltaF_2,dltaF0,deltaF1,deltaF2!\n",
 		 config_fname, cell_idx,eMTCconfig->ccparams.pucch_deltaF_Format2);
 
   if (strcmp(eMTCconfig->ccparams.pucch_deltaF_Format2a,"deltaF_2")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pucch_deltaF_Format2a= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2a_deltaF_2;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pucch_deltaF_Format2a = LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2a_deltaF_2;
   } else if (strcmp(eMTCconfig->ccparams.pucch_deltaF_Format2a,"deltaF0")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pucch_deltaF_Format2a= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2a_deltaF0;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pucch_deltaF_Format2a = LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2a_deltaF0;
   } else if (strcmp(eMTCconfig->ccparams.pucch_deltaF_Format2a,"deltaF2")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pucch_deltaF_Format2a= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2a_deltaF2;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pucch_deltaF_Format2a = LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2a_deltaF2;
   } else
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_deltaF_Format2a choice: deltaF_2,dltaF0,deltaF2!\n",
 		 config_fname, cell_idx,eMTCconfig->ccparams.pucch_deltaF_Format2a);
 
   if (strcmp(eMTCconfig->ccparams.pucch_deltaF_Format2b,"deltaF_2")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pucch_deltaF_Format2b= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2b_deltaF_2;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pucch_deltaF_Format2b = LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2b_deltaF_2;
   } else if (strcmp(eMTCconfig->ccparams.pucch_deltaF_Format2b,"deltaF0")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pucch_deltaF_Format2b= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2b_deltaF0;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pucch_deltaF_Format2b = LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2b_deltaF0;
   } else if (strcmp(eMTCconfig->ccparams.pucch_deltaF_Format2b,"deltaF2")==0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pucch_deltaF_Format2b= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2b_deltaF2;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pucch_deltaF_Format2b = LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2b_deltaF2;
   } else
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_deltaF_Format2b choice: deltaF_2,dltaF0,deltaF2!\n",
 		 config_fname, cell_idx,eMTCconfig->ccparams.pucch_deltaF_Format2b);
 
-  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].rach_numberOfRA_Preambles= (eMTCconfig->ccparams.rach_numberOfRA_Preambles/4)-1;
+  RRCcfg->radioresourceconfig_BR[cc_idx].rach_numberOfRA_Preambles = (eMTCconfig->ccparams.rach_numberOfRA_Preambles / 4) - 1;
 
   if ((eMTCconfig->ccparams.rach_numberOfRA_Preambles <4) || (eMTCconfig->ccparams.rach_numberOfRA_Preambles >64) || ((eMTCconfig->ccparams.rach_numberOfRA_Preambles&3)!=0))
     AssertFatal (0,
@@ -535,8 +522,8 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
 		 config_fname, cell_idx,eMTCconfig->ccparams.rach_numberOfRA_Preambles);
 
   if (strcmp(eMTCconfig->ccparams.rach_preamblesGroupAConfig, "ENABLE") == 0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].rach_preamblesGroupAConfig= true;
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].rach_sizeOfRA_PreamblesGroupA= (eMTCconfig->ccparams.rach_sizeOfRA_PreamblesGroupA/4)-1;
+    RRCcfg->radioresourceconfig_BR[cc_idx].rach_preamblesGroupAConfig = true;
+    RRCcfg->radioresourceconfig_BR[cc_idx].rach_sizeOfRA_PreamblesGroupA = (eMTCconfig->ccparams.rach_sizeOfRA_PreamblesGroupA / 4) - 1;
 
     if ((eMTCconfig->ccparams.rach_numberOfRA_Preambles <4) || (eMTCconfig->ccparams.rach_numberOfRA_Preambles>60) || ((eMTCconfig->ccparams.rach_numberOfRA_Preambles&3)!=0))
       AssertFatal (0,
@@ -545,19 +532,19 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
 
     switch (eMTCconfig->ccparams.rach_messageSizeGroupA) {
     case 56:
-      RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].rach_messageSizeGroupA= LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messageSizeGroupA_b56;
+      RRCcfg->radioresourceconfig_BR[cc_idx].rach_messageSizeGroupA = LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messageSizeGroupA_b56;
       break;
 
     case 144:
-      RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].rach_messageSizeGroupA= LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messageSizeGroupA_b144;
+      RRCcfg->radioresourceconfig_BR[cc_idx].rach_messageSizeGroupA = LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messageSizeGroupA_b144;
       break;
 
     case 208:
-      RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].rach_messageSizeGroupA= LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messageSizeGroupA_b208;
+      RRCcfg->radioresourceconfig_BR[cc_idx].rach_messageSizeGroupA = LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messageSizeGroupA_b208;
       break;
 
     case 256:
-      RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].rach_messageSizeGroupA= LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messageSizeGroupA_b256;
+      RRCcfg->radioresourceconfig_BR[cc_idx].rach_messageSizeGroupA = LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messageSizeGroupA_b256;
       break;
 
     default:
@@ -568,40 +555,40 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
     }
 
     if (strcmp(eMTCconfig->ccparams.rach_messagePowerOffsetGroupB,"minusinfinity")==0) {
-      RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].rach_messagePowerOffsetGroupB= LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_minusinfinity;
+      RRCcfg->radioresourceconfig_BR[cc_idx].rach_messagePowerOffsetGroupB = LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_minusinfinity;
     } else if (strcmp(eMTCconfig->ccparams.rach_messagePowerOffsetGroupB,"dB0")==0) {
-      RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].rach_messagePowerOffsetGroupB= LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB0;
+      RRCcfg->radioresourceconfig_BR[cc_idx].rach_messagePowerOffsetGroupB = LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB0;
     } else if (strcmp(eMTCconfig->ccparams.rach_messagePowerOffsetGroupB,"dB5")==0) {
-      RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].rach_messagePowerOffsetGroupB= LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB5;
+      RRCcfg->radioresourceconfig_BR[cc_idx].rach_messagePowerOffsetGroupB = LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB5;
     } else if (strcmp(eMTCconfig->ccparams.rach_messagePowerOffsetGroupB,"dB8")==0) {
-      RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].rach_messagePowerOffsetGroupB= LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB8;
+      RRCcfg->radioresourceconfig_BR[cc_idx].rach_messagePowerOffsetGroupB = LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB8;
     } else if (strcmp(eMTCconfig->ccparams.rach_messagePowerOffsetGroupB,"dB10")==0) {
-      RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].rach_messagePowerOffsetGroupB= LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB10;
+      RRCcfg->radioresourceconfig_BR[cc_idx].rach_messagePowerOffsetGroupB = LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB10;
     } else if (strcmp(eMTCconfig->ccparams.rach_messagePowerOffsetGroupB,"dB12")==0) {
-      RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].rach_messagePowerOffsetGroupB= LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB12;
+      RRCcfg->radioresourceconfig_BR[cc_idx].rach_messagePowerOffsetGroupB = LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB12;
     } else if (strcmp(eMTCconfig->ccparams.rach_messagePowerOffsetGroupB,"dB15")==0) {
-      RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].rach_messagePowerOffsetGroupB= LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB15;
+      RRCcfg->radioresourceconfig_BR[cc_idx].rach_messagePowerOffsetGroupB = LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB15;
     } else if (strcmp(eMTCconfig->ccparams.rach_messagePowerOffsetGroupB,"dB18")==0) {
-      RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].rach_messagePowerOffsetGroupB= LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB18;
+      RRCcfg->radioresourceconfig_BR[cc_idx].rach_messagePowerOffsetGroupB = LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB18;
     } else
       AssertFatal (0,
 		   "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for rach_messagePowerOffsetGroupB choice: minusinfinity,dB0,dB5,dB8,dB10,dB12,dB15,dB18!\n",
 		   config_fname, cell_idx,eMTCconfig->ccparams.rach_messagePowerOffsetGroupB);
   } else if (strcmp(eMTCconfig->ccparams.rach_preamblesGroupAConfig, "DISABLE") == 0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].rach_preamblesGroupAConfig= false;
+    RRCcfg->radioresourceconfig_BR[cc_idx].rach_preamblesGroupAConfig = false;
   } else
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for rach_preamblesGroupAConfig choice: ENABLE,DISABLE !\n",
 		 config_fname, cell_idx,eMTCconfig->ccparams.rach_preamblesGroupAConfig);
 
-  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].rach_preambleInitialReceivedTargetPower= (eMTCconfig->ccparams.rach_preambleInitialReceivedTargetPower+120)/2;
+  RRCcfg->radioresourceconfig_BR[cc_idx].rach_preambleInitialReceivedTargetPower = (eMTCconfig->ccparams.rach_preambleInitialReceivedTargetPower + 120) / 2;
 
   if ((eMTCconfig->ccparams.rach_preambleInitialReceivedTargetPower<-120) || (eMTCconfig->ccparams.rach_preambleInitialReceivedTargetPower>-90) || ((eMTCconfig->ccparams.rach_preambleInitialReceivedTargetPower&1)!=0))
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_preambleInitialReceivedTargetPower choice: -120,-118,...,-90 !\n",
 		 config_fname, cell_idx,eMTCconfig->ccparams.rach_preambleInitialReceivedTargetPower);
 
-  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].rach_powerRampingStep= eMTCconfig->ccparams.rach_powerRampingStep/2;
+  RRCcfg->radioresourceconfig_BR[cc_idx].rach_powerRampingStep = eMTCconfig->ccparams.rach_powerRampingStep / 2;
 
   if ((eMTCconfig->ccparams.rach_powerRampingStep<0) || (eMTCconfig->ccparams.rach_powerRampingStep>6) || ((eMTCconfig->ccparams.rach_powerRampingStep&1)!=0))
     AssertFatal (0,
@@ -610,47 +597,47 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
 
   switch (eMTCconfig->ccparams.rach_preambleTransMax) {
   case 3:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].rach_preambleTransMax=  LTE_PreambleTransMax_n3;
+    RRCcfg->radioresourceconfig_BR[cc_idx].rach_preambleTransMax = LTE_PreambleTransMax_n3;
     break;
 
   case 4:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].rach_preambleTransMax=  LTE_PreambleTransMax_n4;
+    RRCcfg->radioresourceconfig_BR[cc_idx].rach_preambleTransMax = LTE_PreambleTransMax_n4;
     break;
 
   case 5:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].rach_preambleTransMax=  LTE_PreambleTransMax_n5;
+    RRCcfg->radioresourceconfig_BR[cc_idx].rach_preambleTransMax = LTE_PreambleTransMax_n5;
     break;
 
   case 6:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].rach_preambleTransMax=  LTE_PreambleTransMax_n6;
+    RRCcfg->radioresourceconfig_BR[cc_idx].rach_preambleTransMax = LTE_PreambleTransMax_n6;
     break;
 
   case 7:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].rach_preambleTransMax=  LTE_PreambleTransMax_n7;
+    RRCcfg->radioresourceconfig_BR[cc_idx].rach_preambleTransMax = LTE_PreambleTransMax_n7;
     break;
 
   case 8:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].rach_preambleTransMax=  LTE_PreambleTransMax_n8;
+    RRCcfg->radioresourceconfig_BR[cc_idx].rach_preambleTransMax = LTE_PreambleTransMax_n8;
     break;
 
   case 10:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].rach_preambleTransMax=  LTE_PreambleTransMax_n10;
+    RRCcfg->radioresourceconfig_BR[cc_idx].rach_preambleTransMax = LTE_PreambleTransMax_n10;
     break;
 
   case 20:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].rach_preambleTransMax=  LTE_PreambleTransMax_n20;
+    RRCcfg->radioresourceconfig_BR[cc_idx].rach_preambleTransMax = LTE_PreambleTransMax_n20;
     break;
 
   case 50:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].rach_preambleTransMax=  LTE_PreambleTransMax_n50;
+    RRCcfg->radioresourceconfig_BR[cc_idx].rach_preambleTransMax = LTE_PreambleTransMax_n50;
     break;
 
   case 100:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].rach_preambleTransMax=  LTE_PreambleTransMax_n100;
+    RRCcfg->radioresourceconfig_BR[cc_idx].rach_preambleTransMax = LTE_PreambleTransMax_n100;
     break;
 
   case 200:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].rach_preambleTransMax=  LTE_PreambleTransMax_n200;
+    RRCcfg->radioresourceconfig_BR[cc_idx].rach_preambleTransMax = LTE_PreambleTransMax_n200;
     break;
 
   default:
@@ -660,21 +647,21 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
     break;
   }
 
-  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].rach_raResponseWindowSize=  (eMTCconfig->ccparams.rach_raResponseWindowSize==10)?7:eMTCconfig->ccparams.rach_raResponseWindowSize-2;
+  RRCcfg->radioresourceconfig_BR[cc_idx].rach_raResponseWindowSize = (eMTCconfig->ccparams.rach_raResponseWindowSize == 10) ? 7 : eMTCconfig->ccparams.rach_raResponseWindowSize - 2;
 
   if ((eMTCconfig->ccparams.rach_raResponseWindowSize<0)||(eMTCconfig->ccparams.rach_raResponseWindowSize==9)||(eMTCconfig->ccparams.rach_raResponseWindowSize>10))
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_raResponseWindowSize choice: 2,3,4,5,6,7,8,10!\n",
 		 config_fname, cell_idx,eMTCconfig->ccparams.rach_raResponseWindowSize);
 
-  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].rach_macContentionResolutionTimer= (eMTCconfig->ccparams.rach_macContentionResolutionTimer/8)-1;
+  RRCcfg->radioresourceconfig_BR[cc_idx].rach_macContentionResolutionTimer = (eMTCconfig->ccparams.rach_macContentionResolutionTimer / 8) - 1;
 
   if ((eMTCconfig->ccparams.rach_macContentionResolutionTimer<8) || (eMTCconfig->ccparams.rach_macContentionResolutionTimer>64) || ((eMTCconfig->ccparams.rach_macContentionResolutionTimer&7)!=0))
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_macContentionResolutionTimer choice: 8,16,...,56,64!\n",
 		 config_fname, cell_idx,eMTCconfig->ccparams.rach_macContentionResolutionTimer);
 
-  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].rach_maxHARQ_Msg3Tx= eMTCconfig->ccparams.rach_maxHARQ_Msg3Tx;
+  RRCcfg->radioresourceconfig_BR[cc_idx].rach_maxHARQ_Msg3Tx = eMTCconfig->ccparams.rach_maxHARQ_Msg3Tx;
 
   if ((eMTCconfig->ccparams.rach_maxHARQ_Msg3Tx<0) || (eMTCconfig->ccparams.rach_maxHARQ_Msg3Tx>8))
     AssertFatal (0,
@@ -683,47 +670,47 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
 
   switch (eMTCconfig->preambleTransMax_CE_r13) {
   case 3:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].preambleTransMax_CE_r13=  LTE_PreambleTransMax_n3;
+    RRCcfg->radioresourceconfig_BR[cc_idx].preambleTransMax_CE_r13 = LTE_PreambleTransMax_n3;
     break;
 
   case 4:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].preambleTransMax_CE_r13=  LTE_PreambleTransMax_n4;
+    RRCcfg->radioresourceconfig_BR[cc_idx].preambleTransMax_CE_r13 = LTE_PreambleTransMax_n4;
     break;
 
   case 5:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].preambleTransMax_CE_r13=  LTE_PreambleTransMax_n5;
+    RRCcfg->radioresourceconfig_BR[cc_idx].preambleTransMax_CE_r13 = LTE_PreambleTransMax_n5;
     break;
 
   case 6:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].preambleTransMax_CE_r13=  LTE_PreambleTransMax_n6;
+    RRCcfg->radioresourceconfig_BR[cc_idx].preambleTransMax_CE_r13 = LTE_PreambleTransMax_n6;
     break;
 
   case 7:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].preambleTransMax_CE_r13=  LTE_PreambleTransMax_n7;
+    RRCcfg->radioresourceconfig_BR[cc_idx].preambleTransMax_CE_r13 = LTE_PreambleTransMax_n7;
     break;
 
   case 8:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].preambleTransMax_CE_r13=  LTE_PreambleTransMax_n8;
+    RRCcfg->radioresourceconfig_BR[cc_idx].preambleTransMax_CE_r13 = LTE_PreambleTransMax_n8;
     break;
 
   case 10:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].preambleTransMax_CE_r13=  LTE_PreambleTransMax_n10;
+    RRCcfg->radioresourceconfig_BR[cc_idx].preambleTransMax_CE_r13 = LTE_PreambleTransMax_n10;
     break;
 
   case 20:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].preambleTransMax_CE_r13=  LTE_PreambleTransMax_n20;
+    RRCcfg->radioresourceconfig_BR[cc_idx].preambleTransMax_CE_r13 = LTE_PreambleTransMax_n20;
     break;
 
   case 50:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].preambleTransMax_CE_r13=  LTE_PreambleTransMax_n50;
+    RRCcfg->radioresourceconfig_BR[cc_idx].preambleTransMax_CE_r13 = LTE_PreambleTransMax_n50;
     break;
 
   case 100:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].preambleTransMax_CE_r13=  LTE_PreambleTransMax_n100;
+    RRCcfg->radioresourceconfig_BR[cc_idx].preambleTransMax_CE_r13 = LTE_PreambleTransMax_n100;
     break;
 
   case 200:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].preambleTransMax_CE_r13=  LTE_PreambleTransMax_n200;
+    RRCcfg->radioresourceconfig_BR[cc_idx].preambleTransMax_CE_r13 = LTE_PreambleTransMax_n200;
     break;
 
   default:
@@ -735,19 +722,19 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
 
   switch (eMTCconfig->ccparams.pcch_defaultPagingCycle) {
   case 32:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pcch_defaultPagingCycle= LTE_PCCH_Config__defaultPagingCycle_rf32;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pcch_defaultPagingCycle = LTE_PCCH_Config__defaultPagingCycle_rf32;
     break;
 
   case 64:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pcch_defaultPagingCycle= LTE_PCCH_Config__defaultPagingCycle_rf64;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pcch_defaultPagingCycle = LTE_PCCH_Config__defaultPagingCycle_rf64;
     break;
 
   case 128:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pcch_defaultPagingCycle= LTE_PCCH_Config__defaultPagingCycle_rf128;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pcch_defaultPagingCycle = LTE_PCCH_Config__defaultPagingCycle_rf128;
     break;
 
   case 256:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pcch_defaultPagingCycle= LTE_PCCH_Config__defaultPagingCycle_rf256;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pcch_defaultPagingCycle = LTE_PCCH_Config__defaultPagingCycle_rf256;
     break;
 
   default:
@@ -758,21 +745,21 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
   }
 
   if (strcmp(eMTCconfig->ccparams.pcch_nB, "fourT") == 0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pcch_nB= LTE_PCCH_Config__nB_fourT;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pcch_nB = LTE_PCCH_Config__nB_fourT;
   } else if (strcmp(eMTCconfig->ccparams.pcch_nB, "twoT") == 0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pcch_nB= LTE_PCCH_Config__nB_twoT;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pcch_nB = LTE_PCCH_Config__nB_twoT;
   } else if (strcmp(eMTCconfig->ccparams.pcch_nB, "oneT") == 0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pcch_nB= LTE_PCCH_Config__nB_oneT;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pcch_nB = LTE_PCCH_Config__nB_oneT;
   } else if (strcmp(eMTCconfig->ccparams.pcch_nB, "halfT") == 0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pcch_nB= LTE_PCCH_Config__nB_halfT;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pcch_nB = LTE_PCCH_Config__nB_halfT;
   } else if (strcmp(eMTCconfig->ccparams.pcch_nB, "quarterT") == 0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pcch_nB= LTE_PCCH_Config__nB_quarterT;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pcch_nB = LTE_PCCH_Config__nB_quarterT;
   } else if (strcmp(eMTCconfig->ccparams.pcch_nB, "oneEighthT") == 0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pcch_nB= LTE_PCCH_Config__nB_oneEighthT;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pcch_nB = LTE_PCCH_Config__nB_oneEighthT;
   } else if (strcmp(eMTCconfig->ccparams.pcch_nB, "oneSixteenthT") == 0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pcch_nB= LTE_PCCH_Config__nB_oneSixteenthT;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pcch_nB = LTE_PCCH_Config__nB_oneSixteenthT;
   } else if (strcmp(eMTCconfig->ccparams.pcch_nB, "oneThirtySecondT") == 0) {
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].pcch_nB= LTE_PCCH_Config__nB_oneThirtySecondT;
+    RRCcfg->radioresourceconfig_BR[cc_idx].pcch_nB = LTE_PCCH_Config__nB_oneThirtySecondT;
   } else
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pcch_nB choice: fourT,twoT,oneT,halfT,quarterT,oneighthT,oneSixteenthT,oneThirtySecondT !\n",
@@ -780,19 +767,19 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
 
   switch (eMTCconfig->ccparams.bcch_modificationPeriodCoeff) {
   case 2:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].bcch_modificationPeriodCoeff= LTE_BCCH_Config__modificationPeriodCoeff_n2;
+    RRCcfg->radioresourceconfig_BR[cc_idx].bcch_modificationPeriodCoeff = LTE_BCCH_Config__modificationPeriodCoeff_n2;
     break;
 
   case 4:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].bcch_modificationPeriodCoeff= LTE_BCCH_Config__modificationPeriodCoeff_n4;
+    RRCcfg->radioresourceconfig_BR[cc_idx].bcch_modificationPeriodCoeff = LTE_BCCH_Config__modificationPeriodCoeff_n4;
     break;
 
   case 8:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].bcch_modificationPeriodCoeff= LTE_BCCH_Config__modificationPeriodCoeff_n8;
+    RRCcfg->radioresourceconfig_BR[cc_idx].bcch_modificationPeriodCoeff = LTE_BCCH_Config__modificationPeriodCoeff_n8;
     break;
 
   case 16:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].bcch_modificationPeriodCoeff= LTE_BCCH_Config__modificationPeriodCoeff_n16;
+    RRCcfg->radioresourceconfig_BR[cc_idx].bcch_modificationPeriodCoeff = LTE_BCCH_Config__modificationPeriodCoeff_n16;
     break;
 
   default:
@@ -802,40 +789,40 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
     break;
   }
 
-  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].ue_TimersAndConstants_t300= eMTCconfig->ccparams.ue_TimersAndConstants_t300;
-  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].ue_TimersAndConstants_t301= eMTCconfig->ccparams.ue_TimersAndConstants_t301;
-  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].ue_TimersAndConstants_t310= eMTCconfig->ccparams.ue_TimersAndConstants_t310;
-  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].ue_TimersAndConstants_t311= eMTCconfig->ccparams.ue_TimersAndConstants_t311;
-  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].ue_TimersAndConstants_n310= eMTCconfig->ccparams.ue_TimersAndConstants_n310;
-  RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].ue_TimersAndConstants_n311= eMTCconfig->ccparams.ue_TimersAndConstants_n311;
+  RRCcfg->radioresourceconfig_BR[cc_idx].ue_TimersAndConstants_t300 = eMTCconfig->ccparams.ue_TimersAndConstants_t300;
+  RRCcfg->radioresourceconfig_BR[cc_idx].ue_TimersAndConstants_t301 = eMTCconfig->ccparams.ue_TimersAndConstants_t301;
+  RRCcfg->radioresourceconfig_BR[cc_idx].ue_TimersAndConstants_t310 = eMTCconfig->ccparams.ue_TimersAndConstants_t310;
+  RRCcfg->radioresourceconfig_BR[cc_idx].ue_TimersAndConstants_t311 = eMTCconfig->ccparams.ue_TimersAndConstants_t311;
+  RRCcfg->radioresourceconfig_BR[cc_idx].ue_TimersAndConstants_n310 = eMTCconfig->ccparams.ue_TimersAndConstants_n310;
+  RRCcfg->radioresourceconfig_BR[cc_idx].ue_TimersAndConstants_n311 = eMTCconfig->ccparams.ue_TimersAndConstants_n311;
 
   switch (eMTCconfig->ccparams.ue_TransmissionMode) {
   case 1:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].ue_TransmissionMode= LTE_AntennaInfoDedicated__transmissionMode_tm1;
+    RRCcfg->radioresourceconfig_BR[cc_idx].ue_TransmissionMode = LTE_AntennaInfoDedicated__transmissionMode_tm1;
     break;
 
   case 2:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].ue_TransmissionMode= LTE_AntennaInfoDedicated__transmissionMode_tm2;
+    RRCcfg->radioresourceconfig_BR[cc_idx].ue_TransmissionMode = LTE_AntennaInfoDedicated__transmissionMode_tm2;
     break;
 
   case 3:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].ue_TransmissionMode= LTE_AntennaInfoDedicated__transmissionMode_tm3;
+    RRCcfg->radioresourceconfig_BR[cc_idx].ue_TransmissionMode = LTE_AntennaInfoDedicated__transmissionMode_tm3;
     break;
 
   case 4:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].ue_TransmissionMode= LTE_AntennaInfoDedicated__transmissionMode_tm4;
+    RRCcfg->radioresourceconfig_BR[cc_idx].ue_TransmissionMode = LTE_AntennaInfoDedicated__transmissionMode_tm4;
     break;
 
   case 5:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].ue_TransmissionMode= LTE_AntennaInfoDedicated__transmissionMode_tm5;
+    RRCcfg->radioresourceconfig_BR[cc_idx].ue_TransmissionMode = LTE_AntennaInfoDedicated__transmissionMode_tm5;
     break;
 
   case 6:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].ue_TransmissionMode= LTE_AntennaInfoDedicated__transmissionMode_tm6;
+    RRCcfg->radioresourceconfig_BR[cc_idx].ue_TransmissionMode = LTE_AntennaInfoDedicated__transmissionMode_tm6;
     break;
 
   case 7:
-    RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[cc_idx].ue_TransmissionMode= LTE_AntennaInfoDedicated__transmissionMode_tm7;
+    RRCcfg->radioresourceconfig_BR[cc_idx].ue_TransmissionMode = LTE_AntennaInfoDedicated__transmissionMode_tm7;
     break;
 
   default:
@@ -847,79 +834,77 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
 
 
   if (!strcmp(eMTCconfig->prach_ConfigCommon_v1310, "ENABLE")) {
-    RRC_CONFIGURATION_REQ(msg_p).radioresourceconfig_BR[cc_idx].prach_ConfigCommon_v1310 = true;
+    RRCcfg->radioresourceconfig_BR[cc_idx].prach_ConfigCommon_v1310 = true;
 
-    RRC_CONFIGURATION_REQ(msg_p).radioresourceconfig_BR[cc_idx].mpdcch_startSF_CSS_RA_r13 = calloc(1, sizeof(BOOLEAN_t));
+    RRCcfg->radioresourceconfig_BR[cc_idx].mpdcch_startSF_CSS_RA_r13 = calloc(1, sizeof(BOOLEAN_t));
 
     if (!strcmp(eMTCconfig->mpdcch_startSF_CSS_RA_r13, "tdd-r13")) {
-      *RRC_CONFIGURATION_REQ(msg_p).radioresourceconfig_BR[cc_idx].mpdcch_startSF_CSS_RA_r13 = false;
+      *RRCcfg->radioresourceconfig_BR[cc_idx].mpdcch_startSF_CSS_RA_r13 = false;
     } else {
-      *RRC_CONFIGURATION_REQ(msg_p).radioresourceconfig_BR[cc_idx].mpdcch_startSF_CSS_RA_r13 = true;
+      *RRCcfg->radioresourceconfig_BR[cc_idx].mpdcch_startSF_CSS_RA_r13 = true;
     }
 
     if (!strcmp(eMTCconfig->mpdcch_startSF_CSS_RA_r13_val, "v1")) {
-      RRC_CONFIGURATION_REQ(msg_p).radioresourceconfig_BR[cc_idx].mpdcch_startSF_CSS_RA_r13_val = 0;
+      RRCcfg->radioresourceconfig_BR[cc_idx].mpdcch_startSF_CSS_RA_r13_val = 0;
     } else if (!strcmp(eMTCconfig->mpdcch_startSF_CSS_RA_r13_val, "v1dot5")) {
-      RRC_CONFIGURATION_REQ(msg_p).radioresourceconfig_BR[cc_idx].mpdcch_startSF_CSS_RA_r13_val = 1;
+      RRCcfg->radioresourceconfig_BR[cc_idx].mpdcch_startSF_CSS_RA_r13_val = 1;
     } else if (!strcmp(eMTCconfig->mpdcch_startSF_CSS_RA_r13_val, "v2")) {
-      RRC_CONFIGURATION_REQ(msg_p).radioresourceconfig_BR[cc_idx].mpdcch_startSF_CSS_RA_r13_val = 2;
+      RRCcfg->radioresourceconfig_BR[cc_idx].mpdcch_startSF_CSS_RA_r13_val = 2;
     } else if (!strcmp(eMTCconfig->mpdcch_startSF_CSS_RA_r13_val, "v2dot5")) {
-      RRC_CONFIGURATION_REQ(msg_p).radioresourceconfig_BR[cc_idx].mpdcch_startSF_CSS_RA_r13_val = 3;
+      RRCcfg->radioresourceconfig_BR[cc_idx].mpdcch_startSF_CSS_RA_r13_val = 3;
     } else if (!strcmp(eMTCconfig->mpdcch_startSF_CSS_RA_r13_val, "v4")) {
-      RRC_CONFIGURATION_REQ(msg_p).radioresourceconfig_BR[cc_idx].mpdcch_startSF_CSS_RA_r13_val = 4;
+      RRCcfg->radioresourceconfig_BR[cc_idx].mpdcch_startSF_CSS_RA_r13_val = 4;
     } else if (!strcmp(eMTCconfig->mpdcch_startSF_CSS_RA_r13_val, "v5")) {
-      RRC_CONFIGURATION_REQ(msg_p).radioresourceconfig_BR[cc_idx].mpdcch_startSF_CSS_RA_r13_val = 5;
+      RRCcfg->radioresourceconfig_BR[cc_idx].mpdcch_startSF_CSS_RA_r13_val = 5;
     } else if (!strcmp(eMTCconfig->mpdcch_startSF_CSS_RA_r13_val, "v8")) {
-      RRC_CONFIGURATION_REQ(msg_p).radioresourceconfig_BR[cc_idx].mpdcch_startSF_CSS_RA_r13_val = 6;
+      RRCcfg->radioresourceconfig_BR[cc_idx].mpdcch_startSF_CSS_RA_r13_val = 6;
     } else if (!strcmp(eMTCconfig->mpdcch_startSF_CSS_RA_r13_val, "10")) {
-      RRC_CONFIGURATION_REQ(msg_p).radioresourceconfig_BR[cc_idx].mpdcch_startSF_CSS_RA_r13_val = 7;
+      RRCcfg->radioresourceconfig_BR[cc_idx].mpdcch_startSF_CSS_RA_r13_val = 7;
     } else {
       AssertFatal(0,
 		  "Failed to parse eNB configuration file %s, enb %d mpdcch_startSF_CSS_RA_r13_val! Unknown Value !!\n",
 		  config_fname, cell_idx);
     }
 
-    RRC_CONFIGURATION_REQ(msg_p).radioresourceconfig_BR[cc_idx].prach_HoppingOffset_r13 = calloc(1, sizeof(long));
-    *RRC_CONFIGURATION_REQ(msg_p).radioresourceconfig_BR[cc_idx].prach_HoppingOffset_r13 = eMTCconfig->prach_HoppingOffset_r13;
+    RRCcfg->radioresourceconfig_BR[cc_idx].prach_HoppingOffset_r13 = calloc(1, sizeof(long));
+    *RRCcfg->radioresourceconfig_BR[cc_idx].prach_HoppingOffset_r13 = eMTCconfig->prach_HoppingOffset_r13;
   } else {
-    RRC_CONFIGURATION_REQ(msg_p).radioresourceconfig_BR[cc_idx].prach_ConfigCommon_v1310 = false;
+    RRCcfg->radioresourceconfig_BR[cc_idx].prach_ConfigCommon_v1310 = false;
   }
 
-
-  RRC_CONFIGURATION_REQ(msg_p).pdsch_maxNumRepetitionCEmodeA_r13[cc_idx] = CALLOC(1, sizeof(long));
+  RRCcfg->pdsch_maxNumRepetitionCEmodeA_r13[cc_idx] = CALLOC(1, sizeof(long));
   if (!strcmp(eMTCconfig->pdsch_maxNumRepetitionCEmodeA_r13, "r16")) {
-    *RRC_CONFIGURATION_REQ(msg_p).pdsch_maxNumRepetitionCEmodeA_r13[cc_idx] = 0;
+    *RRCcfg->pdsch_maxNumRepetitionCEmodeA_r13[cc_idx] = 0;
   } else if (!strcmp(eMTCconfig->pdsch_maxNumRepetitionCEmodeA_r13, "r32")) {
-    *RRC_CONFIGURATION_REQ(msg_p).pdsch_maxNumRepetitionCEmodeA_r13[cc_idx] = 1;
+    *RRCcfg->pdsch_maxNumRepetitionCEmodeA_r13[cc_idx] = 1;
   } else {
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, pdsch_maxNumRepetitionCEmodeA_r13 unknown value!\n",
 		 config_fname);
   }
 
-
-  RRC_CONFIGURATION_REQ(msg_p).pusch_maxNumRepetitionCEmodeA_r13[cc_idx] = CALLOC(1, sizeof(long));
+  RRCcfg->pusch_maxNumRepetitionCEmodeA_r13[cc_idx] = CALLOC(1, sizeof(long));
   if (!strcmp(eMTCconfig->pusch_maxNumRepetitionCEmodeA_r13, "r8")) {
-    *RRC_CONFIGURATION_REQ(msg_p).pusch_maxNumRepetitionCEmodeA_r13[cc_idx] =  0;
+    *RRCcfg->pusch_maxNumRepetitionCEmodeA_r13[cc_idx] = 0;
   } else if (!strcmp(eMTCconfig->pusch_maxNumRepetitionCEmodeA_r13, "r16")) {
-    *RRC_CONFIGURATION_REQ(msg_p).pusch_maxNumRepetitionCEmodeA_r13[cc_idx] =  1;
+    *RRCcfg->pusch_maxNumRepetitionCEmodeA_r13[cc_idx] = 1;
   } else if (!strcmp(eMTCconfig->pusch_maxNumRepetitionCEmodeA_r13, "r32")) {
-    *RRC_CONFIGURATION_REQ(msg_p).pusch_maxNumRepetitionCEmodeA_r13[cc_idx] =  2;
+    *RRCcfg->pusch_maxNumRepetitionCEmodeA_r13[cc_idx] = 2;
   } else {
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, pusch_maxNumRepetitionCEmodeA_r13 unknown value!\n",
 		 config_fname);
   }
 
-  RRC_CONFIGURATION_REQ(msg_p).pusch_repetitionLevelCEmodeA_r13[cc_idx] = CALLOC(1, sizeof(long));
+  RRCcfg->pusch_repetitionLevelCEmodeA_r13[cc_idx] = CALLOC(1, sizeof(long));
   if (!strcmp(eMTCconfig->pusch_repetitionLevelCEmodeA_r13, "l1")) {
-    *RRC_CONFIGURATION_REQ(msg_p).pusch_repetitionLevelCEmodeA_r13[cc_idx] =  0;
+    *RRCcfg->pusch_repetitionLevelCEmodeA_r13[cc_idx] = 0;
   } else if (!strcmp(eMTCconfig->pusch_repetitionLevelCEmodeA_r13, "l2")) {
-    *RRC_CONFIGURATION_REQ(msg_p).pusch_repetitionLevelCEmodeA_r13[cc_idx] =  1;
+    *RRCcfg->pusch_repetitionLevelCEmodeA_r13[cc_idx] = 1;
   } else if (!strcmp(eMTCconfig->pusch_repetitionLevelCEmodeA_r13, "l3")) {
-    *RRC_CONFIGURATION_REQ(msg_p).pusch_repetitionLevelCEmodeA_r13[cc_idx] =  2;
+    *RRCcfg->pusch_repetitionLevelCEmodeA_r13[cc_idx] = 2;
   } else if (!strcmp(eMTCconfig->pusch_repetitionLevelCEmodeA_r13, "l4")) {
-    *RRC_CONFIGURATION_REQ(msg_p).pusch_repetitionLevelCEmodeA_r13[cc_idx] =  3;
+    *RRCcfg->pusch_repetitionLevelCEmodeA_r13[cc_idx] = 3;
   } else {
     AssertFatal (0,
     "Failed to parse eNB configuration file %s, pusch_repetitionLevelCEmodeA_r13 unknown value!\n",
@@ -928,39 +913,39 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
 
   char rachCELevelInfoListPath[MAX_OPTNAME_SIZE * 2];
   config_getlist(&rachcelevellist, NULL, 0, brparamspath);
-  RRC_CONFIGURATION_REQ (msg_p).rach_CE_LevelInfoList_r13_size[cc_idx] = rachcelevellist.numelt;
+  RRCcfg->rach_CE_LevelInfoList_r13_size[cc_idx] = rachcelevellist.numelt;
   int rachCEInfoIndex;
   for (rachCEInfoIndex = 0; rachCEInfoIndex < rachcelevellist.numelt; rachCEInfoIndex++) {
     sprintf(rachCELevelInfoListPath, "%s.%s.[%i]", brparamspath, ENB_CONFIG_STRING_RACH_CE_LEVELINFOLIST_R13, rachCEInfoIndex);
     config_get(rachcelevelParams, sizeof(rachcelevelParams) / sizeof(paramdef_t), rachCELevelInfoListPath);
 
-    RRC_CONFIGURATION_REQ (msg_p).firstPreamble_r13[cc_idx][rachCEInfoIndex] = eMTCconfig->firstPreamble_r13;
-    RRC_CONFIGURATION_REQ (msg_p).lastPreamble_r13[cc_idx][rachCEInfoIndex]  = eMTCconfig->lastPreamble_r13;
+    RRCcfg->firstPreamble_r13[cc_idx][rachCEInfoIndex] = eMTCconfig->firstPreamble_r13;
+    RRCcfg->lastPreamble_r13[cc_idx][rachCEInfoIndex] = eMTCconfig->lastPreamble_r13;
 
     switch (eMTCconfig->ra_ResponseWindowSize_r13) {
     case 20:
-      RRC_CONFIGURATION_REQ (msg_p).ra_ResponseWindowSize_r13[cc_idx][rachCEInfoIndex] = LTE_RACH_CE_LevelInfo_r13__ra_ResponseWindowSize_r13_sf20;
+      RRCcfg->ra_ResponseWindowSize_r13[cc_idx][rachCEInfoIndex] = LTE_RACH_CE_LevelInfo_r13__ra_ResponseWindowSize_r13_sf20;
       break;
     case 50:
-      RRC_CONFIGURATION_REQ (msg_p).ra_ResponseWindowSize_r13[cc_idx][rachCEInfoIndex] = LTE_RACH_CE_LevelInfo_r13__ra_ResponseWindowSize_r13_sf50;
+      RRCcfg->ra_ResponseWindowSize_r13[cc_idx][rachCEInfoIndex] = LTE_RACH_CE_LevelInfo_r13__ra_ResponseWindowSize_r13_sf50;
       break;
     case 80:
-      RRC_CONFIGURATION_REQ (msg_p).ra_ResponseWindowSize_r13[cc_idx][rachCEInfoIndex] = LTE_RACH_CE_LevelInfo_r13__ra_ResponseWindowSize_r13_sf80;
+      RRCcfg->ra_ResponseWindowSize_r13[cc_idx][rachCEInfoIndex] = LTE_RACH_CE_LevelInfo_r13__ra_ResponseWindowSize_r13_sf80;
       break;
     case 120:
-      RRC_CONFIGURATION_REQ (msg_p).ra_ResponseWindowSize_r13[cc_idx][rachCEInfoIndex] = LTE_RACH_CE_LevelInfo_r13__ra_ResponseWindowSize_r13_sf120;
+      RRCcfg->ra_ResponseWindowSize_r13[cc_idx][rachCEInfoIndex] = LTE_RACH_CE_LevelInfo_r13__ra_ResponseWindowSize_r13_sf120;
       break;
     case 180:
-      RRC_CONFIGURATION_REQ (msg_p).ra_ResponseWindowSize_r13[cc_idx][rachCEInfoIndex] = LTE_RACH_CE_LevelInfo_r13__ra_ResponseWindowSize_r13_sf180;
+      RRCcfg->ra_ResponseWindowSize_r13[cc_idx][rachCEInfoIndex] = LTE_RACH_CE_LevelInfo_r13__ra_ResponseWindowSize_r13_sf180;
       break;
     case 240:
-      RRC_CONFIGURATION_REQ (msg_p).ra_ResponseWindowSize_r13[cc_idx][rachCEInfoIndex] = LTE_RACH_CE_LevelInfo_r13__ra_ResponseWindowSize_r13_sf240;
+      RRCcfg->ra_ResponseWindowSize_r13[cc_idx][rachCEInfoIndex] = LTE_RACH_CE_LevelInfo_r13__ra_ResponseWindowSize_r13_sf240;
       break;
     case 320:
-      RRC_CONFIGURATION_REQ (msg_p).ra_ResponseWindowSize_r13[cc_idx][rachCEInfoIndex] = LTE_RACH_CE_LevelInfo_r13__ra_ResponseWindowSize_r13_sf320;
+      RRCcfg->ra_ResponseWindowSize_r13[cc_idx][rachCEInfoIndex] = LTE_RACH_CE_LevelInfo_r13__ra_ResponseWindowSize_r13_sf320;
       break;
     case 400:
-      RRC_CONFIGURATION_REQ (msg_p).ra_ResponseWindowSize_r13[cc_idx][rachCEInfoIndex] = LTE_RACH_CE_LevelInfo_r13__ra_ResponseWindowSize_r13_sf400;
+      RRCcfg->ra_ResponseWindowSize_r13[cc_idx][rachCEInfoIndex] = LTE_RACH_CE_LevelInfo_r13__ra_ResponseWindowSize_r13_sf400;
       break;
     default:
       AssertFatal(1==0,
@@ -970,35 +955,35 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
 
     switch(eMTCconfig->mac_ContentionResolutionTimer_r13) {
     case 80:
-      RRC_CONFIGURATION_REQ (msg_p).mac_ContentionResolutionTimer_r13[cc_idx][rachCEInfoIndex] = LTE_RACH_CE_LevelInfo_r13__mac_ContentionResolutionTimer_r13_sf80;
+      RRCcfg->mac_ContentionResolutionTimer_r13[cc_idx][rachCEInfoIndex] = LTE_RACH_CE_LevelInfo_r13__mac_ContentionResolutionTimer_r13_sf80;
       break;
     case 100:
-      RRC_CONFIGURATION_REQ (msg_p).mac_ContentionResolutionTimer_r13[cc_idx][rachCEInfoIndex] = LTE_RACH_CE_LevelInfo_r13__mac_ContentionResolutionTimer_r13_sf100;
+      RRCcfg->mac_ContentionResolutionTimer_r13[cc_idx][rachCEInfoIndex] = LTE_RACH_CE_LevelInfo_r13__mac_ContentionResolutionTimer_r13_sf100;
       break;
     case 120:
-      RRC_CONFIGURATION_REQ (msg_p).mac_ContentionResolutionTimer_r13[cc_idx][rachCEInfoIndex] = LTE_RACH_CE_LevelInfo_r13__mac_ContentionResolutionTimer_r13_sf120;
+      RRCcfg->mac_ContentionResolutionTimer_r13[cc_idx][rachCEInfoIndex] = LTE_RACH_CE_LevelInfo_r13__mac_ContentionResolutionTimer_r13_sf120;
       break;
     case 160:
-      RRC_CONFIGURATION_REQ (msg_p).mac_ContentionResolutionTimer_r13[cc_idx][rachCEInfoIndex] = LTE_RACH_CE_LevelInfo_r13__mac_ContentionResolutionTimer_r13_sf160;
+      RRCcfg->mac_ContentionResolutionTimer_r13[cc_idx][rachCEInfoIndex] = LTE_RACH_CE_LevelInfo_r13__mac_ContentionResolutionTimer_r13_sf160;
       break;
     case 200:
-      RRC_CONFIGURATION_REQ (msg_p).mac_ContentionResolutionTimer_r13[cc_idx][rachCEInfoIndex] = LTE_RACH_CE_LevelInfo_r13__mac_ContentionResolutionTimer_r13_sf200;
+      RRCcfg->mac_ContentionResolutionTimer_r13[cc_idx][rachCEInfoIndex] = LTE_RACH_CE_LevelInfo_r13__mac_ContentionResolutionTimer_r13_sf200;
       break;
     case 240:
-      RRC_CONFIGURATION_REQ (msg_p).mac_ContentionResolutionTimer_r13[cc_idx][rachCEInfoIndex] = LTE_RACH_CE_LevelInfo_r13__mac_ContentionResolutionTimer_r13_sf240;
+      RRCcfg->mac_ContentionResolutionTimer_r13[cc_idx][rachCEInfoIndex] = LTE_RACH_CE_LevelInfo_r13__mac_ContentionResolutionTimer_r13_sf240;
       break;
     case 480:
-      RRC_CONFIGURATION_REQ (msg_p).mac_ContentionResolutionTimer_r13[cc_idx][rachCEInfoIndex] = LTE_RACH_CE_LevelInfo_r13__mac_ContentionResolutionTimer_r13_sf480;
+      RRCcfg->mac_ContentionResolutionTimer_r13[cc_idx][rachCEInfoIndex] = LTE_RACH_CE_LevelInfo_r13__mac_ContentionResolutionTimer_r13_sf480;
       break;
     case 960:
-      RRC_CONFIGURATION_REQ (msg_p).mac_ContentionResolutionTimer_r13[cc_idx][rachCEInfoIndex] = LTE_RACH_CE_LevelInfo_r13__mac_ContentionResolutionTimer_r13_sf960;
+      RRCcfg->mac_ContentionResolutionTimer_r13[cc_idx][rachCEInfoIndex] = LTE_RACH_CE_LevelInfo_r13__mac_ContentionResolutionTimer_r13_sf960;
       break;
     default:
       AssertFatal(1==0,"Illegal mac_ContentionResolutionTimer_r13 %d\n",
 		  eMTCconfig->mac_ContentionResolutionTimer_r13);
       break;
     }
-    RRC_CONFIGURATION_REQ (msg_p).rar_HoppingConfig_r13[cc_idx][rachCEInfoIndex] = eMTCconfig->rar_HoppingConfig_r13;
+    RRCcfg->rar_HoppingConfig_r13[cc_idx][rachCEInfoIndex] = eMTCconfig->rar_HoppingConfig_r13;
 
     AssertFatal(eMTCconfig->rar_HoppingConfig_r13 == 1 ,
 		            "illegal rar_HoppingConfig_r13 %d (should be 1 only for now, can be 0 when RAR frequency hopping is supported\n",eMTCconfig->rar_HoppingConfig_r13);
@@ -1006,55 +991,53 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
 
   char rsrpRangeListPath[MAX_OPTNAME_SIZE * 2];
   config_getlist(&rsrprangelist, NULL, 0, brparamspath);
-  RRC_CONFIGURATION_REQ (msg_p).rsrp_range_list_size[cc_idx] = rsrprangelist.numelt;
-
+  RRCcfg->rsrp_range_list_size[cc_idx] = rsrprangelist.numelt;
 
   int rsrprangeindex;
   for (rsrprangeindex = 0; rsrprangeindex < rsrprangelist.numelt; rsrprangeindex++) {
     sprintf(rsrpRangeListPath, "%s.%s.[%i]", brparamspath, ENB_CONFIG_STRING_RSRP_RANGE_LIST, rsrprangeindex);
     config_get(rsrprangeParams, sizeof(rsrprangeParams) / sizeof(paramdef_t), rsrpRangeListPath);
-    RRC_CONFIGURATION_REQ (msg_p).rsrp_range[cc_idx][rsrprangeindex] = eMTCconfig->rsrp_range_br;
-
+    RRCcfg->rsrp_range[cc_idx][rsrprangeindex] = eMTCconfig->rsrp_range_br;
   }
 
 
   char prachparameterscePath[MAX_OPTNAME_SIZE * 2];
   config_getlist(&prachParamslist, NULL, 0, brparamspath);
-  RRC_CONFIGURATION_REQ (msg_p).prach_parameters_list_size[cc_idx] = prachParamslist.numelt;
+  RRCcfg->prach_parameters_list_size[cc_idx] = prachParamslist.numelt;
 
   int prachparamsindex;
   for (prachparamsindex = 0; prachparamsindex < prachParamslist.numelt; prachparamsindex++) {
     sprintf(prachparameterscePath, "%s.%s.[%i]", brparamspath, ENB_CONFIG_STRING_PRACH_PARAMETERS_CE_R13, prachparamsindex);
     config_get(prachParams, sizeof(prachParams) / sizeof(paramdef_t), prachparameterscePath);
 
-    RRC_CONFIGURATION_REQ (msg_p).prach_config_index[cc_idx][prachparamsindex]                  = eMTCconfig->prach_config_index_br;
-    RRC_CONFIGURATION_REQ (msg_p).prach_freq_offset[cc_idx][prachparamsindex]                   = eMTCconfig->prach_freq_offset_br;
+    RRCcfg->prach_config_index[cc_idx][prachparamsindex] = eMTCconfig->prach_config_index_br;
+    RRCcfg->prach_freq_offset[cc_idx][prachparamsindex] = eMTCconfig->prach_freq_offset_br;
 
-    RRC_CONFIGURATION_REQ (msg_p).prach_StartingSubframe_r13[cc_idx][prachparamsindex] = calloc(1, sizeof(long));
+    RRCcfg->prach_StartingSubframe_r13[cc_idx][prachparamsindex] = calloc(1, sizeof(long));
     switch(eMTCconfig->prach_StartingSubframe_r13) {
     case 2:
-      *RRC_CONFIGURATION_REQ (msg_p).prach_StartingSubframe_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__prach_StartingSubframe_r13_sf2;
+      *RRCcfg->prach_StartingSubframe_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__prach_StartingSubframe_r13_sf2;
       break;
     case 4:
-      *RRC_CONFIGURATION_REQ (msg_p).prach_StartingSubframe_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__prach_StartingSubframe_r13_sf4;
+      *RRCcfg->prach_StartingSubframe_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__prach_StartingSubframe_r13_sf4;
       break;
     case 8:
-      *RRC_CONFIGURATION_REQ (msg_p).prach_StartingSubframe_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__prach_StartingSubframe_r13_sf8;
+      *RRCcfg->prach_StartingSubframe_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__prach_StartingSubframe_r13_sf8;
       break;
     case 16:
-      *RRC_CONFIGURATION_REQ (msg_p).prach_StartingSubframe_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__prach_StartingSubframe_r13_sf16;
+      *RRCcfg->prach_StartingSubframe_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__prach_StartingSubframe_r13_sf16;
       break;
     case 32:
-      *RRC_CONFIGURATION_REQ (msg_p).prach_StartingSubframe_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__prach_StartingSubframe_r13_sf32;
+      *RRCcfg->prach_StartingSubframe_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__prach_StartingSubframe_r13_sf32;
       break;
     case 64:
-      *RRC_CONFIGURATION_REQ (msg_p).prach_StartingSubframe_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__prach_StartingSubframe_r13_sf64;
+      *RRCcfg->prach_StartingSubframe_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__prach_StartingSubframe_r13_sf64;
       break;
     case 128:
-      *RRC_CONFIGURATION_REQ (msg_p).prach_StartingSubframe_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__prach_StartingSubframe_r13_sf128;
+      *RRCcfg->prach_StartingSubframe_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__prach_StartingSubframe_r13_sf128;
       break;
     case 256:
-      *RRC_CONFIGURATION_REQ (msg_p).prach_StartingSubframe_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__prach_StartingSubframe_r13_sf256;
+      *RRCcfg->prach_StartingSubframe_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__prach_StartingSubframe_r13_sf256;
       break;
     default:
       AssertFatal(1==0,"prach_StartingSubframe_r13 %d is illegal\n",
@@ -1062,9 +1045,11 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
       break;
     }
 
-    RRC_CONFIGURATION_REQ (msg_p).maxNumPreambleAttemptCE_r13[cc_idx][prachparamsindex] = calloc(1, sizeof(long));
-    if (eMTCconfig->maxNumPreambleAttemptCE_r13==10)  *RRC_CONFIGURATION_REQ (msg_p).maxNumPreambleAttemptCE_r13[cc_idx][prachparamsindex] = 6;
-    else                                              *RRC_CONFIGURATION_REQ (msg_p).maxNumPreambleAttemptCE_r13[cc_idx][prachparamsindex] = eMTCconfig->maxNumPreambleAttemptCE_r13-3;
+    RRCcfg->maxNumPreambleAttemptCE_r13[cc_idx][prachparamsindex] = calloc(1, sizeof(long));
+    if (eMTCconfig->maxNumPreambleAttemptCE_r13 == 10)
+      *RRCcfg->maxNumPreambleAttemptCE_r13[cc_idx][prachparamsindex] = 6;
+    else
+      *RRCcfg->maxNumPreambleAttemptCE_r13[cc_idx][prachparamsindex] = eMTCconfig->maxNumPreambleAttemptCE_r13 - 3;
     AssertFatal(eMTCconfig->maxNumPreambleAttemptCE_r13 > 2 && eMTCconfig->maxNumPreambleAttemptCE_r13 <11,
 		"prachparamsindex %d: Illegal maxNumPreambleAttemptCE_r13 %d\n",
 		prachparamsindex,eMTCconfig->maxNumPreambleAttemptCE_r13);
@@ -1072,28 +1057,28 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
 
     switch(eMTCconfig->numRepetitionPerPreambleAttempt_r13) {
     case 1:
-      RRC_CONFIGURATION_REQ (msg_p).numRepetitionPerPreambleAttempt_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__numRepetitionPerPreambleAttempt_r13_n1;
+      RRCcfg->numRepetitionPerPreambleAttempt_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__numRepetitionPerPreambleAttempt_r13_n1;
       break;
     case 2:
-      RRC_CONFIGURATION_REQ (msg_p).numRepetitionPerPreambleAttempt_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__numRepetitionPerPreambleAttempt_r13_n2;
+      RRCcfg->numRepetitionPerPreambleAttempt_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__numRepetitionPerPreambleAttempt_r13_n2;
       break;
     case 4:
-      RRC_CONFIGURATION_REQ (msg_p).numRepetitionPerPreambleAttempt_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__numRepetitionPerPreambleAttempt_r13_n4;
+      RRCcfg->numRepetitionPerPreambleAttempt_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__numRepetitionPerPreambleAttempt_r13_n4;
       break;
     case 8:
-      RRC_CONFIGURATION_REQ (msg_p).numRepetitionPerPreambleAttempt_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__numRepetitionPerPreambleAttempt_r13_n8;
+      RRCcfg->numRepetitionPerPreambleAttempt_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__numRepetitionPerPreambleAttempt_r13_n8;
       break;
     case 16:
-      RRC_CONFIGURATION_REQ (msg_p).numRepetitionPerPreambleAttempt_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__numRepetitionPerPreambleAttempt_r13_n16;
+      RRCcfg->numRepetitionPerPreambleAttempt_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__numRepetitionPerPreambleAttempt_r13_n16;
       break;
     case 32:
-      RRC_CONFIGURATION_REQ (msg_p).numRepetitionPerPreambleAttempt_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__numRepetitionPerPreambleAttempt_r13_n32;
+      RRCcfg->numRepetitionPerPreambleAttempt_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__numRepetitionPerPreambleAttempt_r13_n32;
       break;
     case 64:
-      RRC_CONFIGURATION_REQ (msg_p).numRepetitionPerPreambleAttempt_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__numRepetitionPerPreambleAttempt_r13_n64;
+      RRCcfg->numRepetitionPerPreambleAttempt_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__numRepetitionPerPreambleAttempt_r13_n64;
       break;
     case 128:
-      RRC_CONFIGURATION_REQ (msg_p).numRepetitionPerPreambleAttempt_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__numRepetitionPerPreambleAttempt_r13_n128;
+      RRCcfg->numRepetitionPerPreambleAttempt_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__numRepetitionPerPreambleAttempt_r13_n128;
       break;
     default:
       AssertFatal(1==0,
@@ -1103,32 +1088,32 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
     }
     switch (eMTCconfig->mpdcch_NumRepetition_RA_r13) {
     case 1:
-      RRC_CONFIGURATION_REQ (msg_p).mpdcch_NumRepetition_RA_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__mpdcch_NumRepetition_RA_r13_r1;
-	break;
+      RRCcfg->mpdcch_NumRepetition_RA_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__mpdcch_NumRepetition_RA_r13_r1;
+      break;
     case 2:
-      RRC_CONFIGURATION_REQ (msg_p).mpdcch_NumRepetition_RA_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__mpdcch_NumRepetition_RA_r13_r2;
-	break;
+      RRCcfg->mpdcch_NumRepetition_RA_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__mpdcch_NumRepetition_RA_r13_r2;
+      break;
     case 4:
-      RRC_CONFIGURATION_REQ (msg_p).mpdcch_NumRepetition_RA_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__mpdcch_NumRepetition_RA_r13_r4;
-	break;
+      RRCcfg->mpdcch_NumRepetition_RA_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__mpdcch_NumRepetition_RA_r13_r4;
+      break;
     case 8:
-      RRC_CONFIGURATION_REQ (msg_p).mpdcch_NumRepetition_RA_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__mpdcch_NumRepetition_RA_r13_r8;
-	break;
+      RRCcfg->mpdcch_NumRepetition_RA_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__mpdcch_NumRepetition_RA_r13_r8;
+      break;
     case 16:
-      RRC_CONFIGURATION_REQ (msg_p).mpdcch_NumRepetition_RA_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__mpdcch_NumRepetition_RA_r13_r16;
-	break;
+      RRCcfg->mpdcch_NumRepetition_RA_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__mpdcch_NumRepetition_RA_r13_r16;
+      break;
     case 32:
-      RRC_CONFIGURATION_REQ (msg_p).mpdcch_NumRepetition_RA_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__mpdcch_NumRepetition_RA_r13_r32;
-	break;
+      RRCcfg->mpdcch_NumRepetition_RA_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__mpdcch_NumRepetition_RA_r13_r32;
+      break;
     case 64:
-      RRC_CONFIGURATION_REQ (msg_p).mpdcch_NumRepetition_RA_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__mpdcch_NumRepetition_RA_r13_r64;
-	break;
+      RRCcfg->mpdcch_NumRepetition_RA_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__mpdcch_NumRepetition_RA_r13_r64;
+      break;
     case 128:
-      RRC_CONFIGURATION_REQ (msg_p).mpdcch_NumRepetition_RA_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__mpdcch_NumRepetition_RA_r13_r128;
-	break;
+      RRCcfg->mpdcch_NumRepetition_RA_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__mpdcch_NumRepetition_RA_r13_r128;
+      break;
     case 256:
-      RRC_CONFIGURATION_REQ (msg_p).mpdcch_NumRepetition_RA_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__mpdcch_NumRepetition_RA_r13_r256;
-	break;
+      RRCcfg->mpdcch_NumRepetition_RA_r13[cc_idx][prachparamsindex] = LTE_PRACH_ParametersCE_r13__mpdcch_NumRepetition_RA_r13_r256;
+      break;
     default:
       AssertFatal (1==0,
 		 "illegal mpdcch_NumRepeition_RA_r13 %d\n",
@@ -1136,7 +1121,7 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
       break;
     }
 
-    RRC_CONFIGURATION_REQ (msg_p).prach_HoppingConfig_r13[cc_idx][prachparamsindex] = eMTCconfig->prach_HoppingConfig_r13;
+    RRCcfg->prach_HoppingConfig_r13[cc_idx][prachparamsindex] = eMTCconfig->prach_HoppingConfig_r13;
 
     AssertFatal (eMTCconfig->prach_HoppingConfig_r13 >=0 && eMTCconfig->prach_HoppingConfig_r13 < 2,
 		 "Illegal prach_HoppingConfig_r13 %d\n",eMTCconfig->prach_HoppingConfig_r13);
@@ -1144,22 +1129,22 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
 
     int maxavailablenarrowband_count = prachParams[7].numelt;
 
-    RRC_CONFIGURATION_REQ (msg_p).max_available_narrow_band_size[cc_idx][prachparamsindex] = maxavailablenarrowband_count;
+    RRCcfg->max_available_narrow_band_size[cc_idx][prachparamsindex] = maxavailablenarrowband_count;
     int narrow_band_index;
     for (narrow_band_index = 0; narrow_band_index < maxavailablenarrowband_count; narrow_band_index++) {
-      RRC_CONFIGURATION_REQ (msg_p).max_available_narrow_band[cc_idx][prachparamsindex][narrow_band_index] = prachParams[7].iptr[narrow_band_index];
+      RRCcfg->max_available_narrow_band[cc_idx][prachparamsindex][narrow_band_index] = prachParams[7].iptr[narrow_band_index];
     }
   }
 
   char n1PUCCHInfoParamsPath[MAX_OPTNAME_SIZE * 2];
   config_getlist(&n1PUCCHInfoList, NULL, 0, brparamspath);
-  RRC_CONFIGURATION_REQ (msg_p).pucch_info_value_size[cc_idx] = n1PUCCHInfoList.numelt;
+  RRCcfg->pucch_info_value_size[cc_idx] = n1PUCCHInfoList.numelt;
 
   int n1PUCCHinfolistindex;
   for (n1PUCCHinfolistindex = 0; n1PUCCHinfolistindex < n1PUCCHInfoList.numelt; n1PUCCHinfolistindex++) {
     sprintf(n1PUCCHInfoParamsPath, "%s.%s.[%i]", brparamspath, ENB_CONFIG_STRING_N1PUCCH_AN_INFOLIST_R13, n1PUCCHinfolistindex);
     config_get(n1PUCCH_ANR13Params, sizeof(n1PUCCH_ANR13Params) / sizeof(paramdef_t), n1PUCCHInfoParamsPath);
-    RRC_CONFIGURATION_REQ (msg_p).pucch_info_value[cc_idx][n1PUCCHinfolistindex] = eMTCconfig->pucch_info_value;
+    RRCcfg->pucch_info_value[cc_idx][n1PUCCHinfolistindex] = eMTCconfig->pucch_info_value;
   }
 
   char PCCHConfigv1310Path[MAX_OPTNAME_SIZE*2 + 16];
@@ -1169,9 +1154,9 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
 
 
   /** PCCH CONFIG V1310 */
-  RRC_CONFIGURATION_REQ(msg_p).pcch_config_v1310[cc_idx] = true;
-  RRC_CONFIGURATION_REQ(msg_p).paging_narrowbands_r13[cc_idx] = eMTCconfig->paging_narrowbands_r13;
-  RRC_CONFIGURATION_REQ(msg_p).mpdcch_numrepetition_paging_r13[cc_idx] = eMTCconfig->mpdcch_numrepetition_paging_r13;
+  RRCcfg->pcch_config_v1310[cc_idx] = true;
+  RRCcfg->paging_narrowbands_r13[cc_idx] = eMTCconfig->paging_narrowbands_r13;
+  RRCcfg->mpdcch_numrepetition_paging_r13[cc_idx] = eMTCconfig->mpdcch_numrepetition_paging_r13;
 
   AssertFatal (eMTCconfig->mpdcch_numrepetition_paging_r13 == 0 ||
           eMTCconfig->mpdcch_numrepetition_paging_r13 == 1 ||
@@ -1186,31 +1171,29 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
 	       "illegal mpdcch_numrepetition_paging_r13 %d\n",
 	       eMTCconfig->mpdcch_numrepetition_paging_r13);
 
-  //                        RRC_CONFIGURATION_REQ(msg_p).nb_v1310[cc_idx] = CALLOC(1, sizeof(long));
+  //                        RRCcfg->nb_v1310[cc_idx] = CALLOC(1, sizeof(long));
   //                        if (!strcmp(nb_v1310, "one64thT")) {
-  //                            *RRC_CONFIGURATION_REQ(msg_p).nb_v1310[cc_idx] = 0;
+  //                            *RRCcfg->nb_v1310[cc_idx] = 0;
   //                        } else if (!strcmp(nb_v1310, "one128thT")) {
-  //                            *RRC_CONFIGURATION_REQ(msg_p).nb_v1310[cc_idx] = 1;
+  //                            *RRCcfg->nb_v1310[cc_idx] = 1;
   //                        } else if (!strcmp(nb_v1310, "one256thT")) {
-  //                            *RRC_CONFIGURATION_REQ(msg_p).nb_v1310[cc_idx] = 2;
+  //                            *RRCcfg->nb_v1310[cc_idx] = 2;
   //                        } else {
   //                            AssertFatal(0,
   //                                        "Failed to parse eNB configuration file %s, nb_v1310, unknown value !\n",
   //                                        config_fname);
   //                        }
 
-
-
-  RRC_CONFIGURATION_REQ (msg_p).pucch_NumRepetitionCE_Msg4_Level0_r13[cc_idx] = CALLOC(1, sizeof(long));
+  RRCcfg->pucch_NumRepetitionCE_Msg4_Level0_r13[cc_idx] = CALLOC(1, sizeof(long));
   // ++cnt; // check this ,, the conter is up above
   if (!strcmp(eMTCconfig->pucch_NumRepetitionCE_Msg4_Level0_r13, "n1")) {
-    *RRC_CONFIGURATION_REQ (msg_p).pucch_NumRepetitionCE_Msg4_Level0_r13[cc_idx] = 0;
+    *RRCcfg->pucch_NumRepetitionCE_Msg4_Level0_r13[cc_idx] = 0;
   } else if (!strcmp(eMTCconfig->pucch_NumRepetitionCE_Msg4_Level0_r13, "n2")) {
-    *RRC_CONFIGURATION_REQ (msg_p).pucch_NumRepetitionCE_Msg4_Level0_r13[cc_idx] = 1;
+    *RRCcfg->pucch_NumRepetitionCE_Msg4_Level0_r13[cc_idx] = 1;
   } else if (!strcmp(eMTCconfig->pucch_NumRepetitionCE_Msg4_Level0_r13, "n4")) {
-    *RRC_CONFIGURATION_REQ (msg_p).pucch_NumRepetitionCE_Msg4_Level0_r13[cc_idx] = 2;
+    *RRCcfg->pucch_NumRepetitionCE_Msg4_Level0_r13[cc_idx] = 2;
   } else if (!strcmp(eMTCconfig->pucch_NumRepetitionCE_Msg4_Level0_r13, "n8")) {
-    *RRC_CONFIGURATION_REQ (msg_p).pucch_NumRepetitionCE_Msg4_Level0_r13[cc_idx] = 3;
+    *RRCcfg->pucch_NumRepetitionCE_Msg4_Level0_r13[cc_idx] = 3;
   } else {
     AssertFatal (0,
 		 "Failed to parse eNB configuration file %s, pucch_NumRepetitionCE_Msg4_Level0_r13 unknown value!\n",
@@ -1220,29 +1203,28 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
 
 
   /** SIB2 FREQ HOPPING PARAMETERS R13 */
-  RRC_CONFIGURATION_REQ(msg_p).sib2_freq_hoppingParameters_r13_exists[cc_idx] = true;
+  RRCcfg->sib2_freq_hoppingParameters_r13_exists[cc_idx] = true;
 
   char sib2FreqHoppingParametersR13Path[MAX_OPTNAME_SIZE*2 + 16];
   sprintf(sib2FreqHoppingParametersR13Path, "%s.%s", brparamspath, ENB_CONFIG_STRING_SIB2_FREQ_HOPPINGPARAMETERS_R13);
   config_get(sib2freqhoppingParams, sizeof(sib2freqhoppingParams)/sizeof(paramdef_t), sib2FreqHoppingParametersR13Path);
 
-
-  RRC_CONFIGURATION_REQ(msg_p).sib2_interval_ULHoppingConfigCommonModeA_r13[cc_idx] = CALLOC(1, sizeof(long));
+  RRCcfg->sib2_interval_ULHoppingConfigCommonModeA_r13[cc_idx] = CALLOC(1, sizeof(long));
   if (!strcmp(eMTCconfig->sib2_interval_ULHoppingConfigCommonModeA_r13, "FDD")) {
-    *RRC_CONFIGURATION_REQ(msg_p).sib2_interval_ULHoppingConfigCommonModeA_r13[cc_idx] = 0;
+    *RRCcfg->sib2_interval_ULHoppingConfigCommonModeA_r13[cc_idx] = 0;
 
     switch(eMTCconfig->sib2_interval_ULHoppingConfigCommonModeA_r13_val) {
     case 1:
-      RRC_CONFIGURATION_REQ(msg_p).sib2_interval_ULHoppingConfigCommonModeA_r13_val[cc_idx] = 0;
+      RRCcfg->sib2_interval_ULHoppingConfigCommonModeA_r13_val[cc_idx] = 0;
       break;
     case 2:
-      RRC_CONFIGURATION_REQ(msg_p).sib2_interval_ULHoppingConfigCommonModeA_r13_val[cc_idx] = 1;
+      RRCcfg->sib2_interval_ULHoppingConfigCommonModeA_r13_val[cc_idx] = 1;
       break;
     case 4:
-      RRC_CONFIGURATION_REQ(msg_p).sib2_interval_ULHoppingConfigCommonModeA_r13_val[cc_idx] = 2;
+      RRCcfg->sib2_interval_ULHoppingConfigCommonModeA_r13_val[cc_idx] = 2;
       break;
     case 8:
-      RRC_CONFIGURATION_REQ(msg_p).sib2_interval_ULHoppingConfigCommonModeA_r13_val[cc_idx] = 3;
+      RRCcfg->sib2_interval_ULHoppingConfigCommonModeA_r13_val[cc_idx] = 3;
       break;
     default:
       AssertFatal(1==0,
@@ -1250,19 +1232,19 @@ void fill_eMTC_configuration(MessageDef *msg_p,  ccparams_eMTC_t *eMTCconfig, in
 		  eMTCconfig->sib2_interval_ULHoppingConfigCommonModeA_r13_val);
     }
   } else if (!strcmp(eMTCconfig->sib2_interval_ULHoppingConfigCommonModeA_r13, "TDD")) {
-    *RRC_CONFIGURATION_REQ(msg_p).sib2_interval_ULHoppingConfigCommonModeA_r13[cc_idx] = 1;
+    *RRCcfg->sib2_interval_ULHoppingConfigCommonModeA_r13[cc_idx] = 1;
     switch(eMTCconfig->sib2_interval_ULHoppingConfigCommonModeA_r13_val) {
     case 1:
-      RRC_CONFIGURATION_REQ(msg_p).sib2_interval_ULHoppingConfigCommonModeA_r13_val[cc_idx] = 0;
+      RRCcfg->sib2_interval_ULHoppingConfigCommonModeA_r13_val[cc_idx] = 0;
       break;
     case 5:
-      RRC_CONFIGURATION_REQ(msg_p).sib2_interval_ULHoppingConfigCommonModeA_r13_val[cc_idx] = 1;
+      RRCcfg->sib2_interval_ULHoppingConfigCommonModeA_r13_val[cc_idx] = 1;
       break;
     case 10:
-      RRC_CONFIGURATION_REQ(msg_p).sib2_interval_ULHoppingConfigCommonModeA_r13_val[cc_idx] = 2;
+      RRCcfg->sib2_interval_ULHoppingConfigCommonModeA_r13_val[cc_idx] = 2;
       break;
     case 20:
-      RRC_CONFIGURATION_REQ(msg_p).sib2_interval_ULHoppingConfigCommonModeA_r13_val[cc_idx] = 3;
+      RRCcfg->sib2_interval_ULHoppingConfigCommonModeA_r13_val[cc_idx] = 3;
       break;
     default:
       AssertFatal(1==0,
diff --git a/openair2/F1AP/f1ap_du_rrc_message_transfer.c b/openair2/F1AP/f1ap_du_rrc_message_transfer.c
index c3e1595f423..d7e32d9dafb 100644
--- a/openair2/F1AP/f1ap_du_rrc_message_transfer.c
+++ b/openair2/F1AP/f1ap_du_rrc_message_transfer.c
@@ -353,12 +353,9 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t       instance,
                   if (mac_MainConfig->drx_Config == NULL) {
                     LOG_W(F1AP, "drx_Configuration parameter is NULL, cannot configure local UE parameters or CDRX is deactivated\n");
                   } else {
-                    MessageDef *message_p = NULL;
+                    rrc_mac_drx_config_req_t req = {.rnti = ctxt.rntiMaybeUEid, .drx_Configuration = mac_MainConfig->drx_Config};
                     /* Send DRX configuration to MAC task to configure timers of local UE context */
-                    message_p = itti_alloc_new_message(TASK_DU_F1, 0, RRC_MAC_DRX_CONFIG_REQ);
-                    RRC_MAC_DRX_CONFIG_REQ(message_p).rnti = ctxt.rntiMaybeUEid;
-                    RRC_MAC_DRX_CONFIG_REQ(message_p).drx_Configuration = mac_MainConfig->drx_Config;
-                    itti_send_msg_to_task(TASK_MAC_ENB, ctxt.instance, message_p);
+                    eNB_Config_Local_DRX(instance, &req);
                     LOG_D(F1AP, "DRX configured in MAC Main Configuration for RRC Connection Reconfiguration\n");
                   }
 
diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c
index 3b07b274429..cc30b29dc59 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler.c
@@ -470,7 +470,7 @@ check_ul_failure(module_id_t module_idP, int CC_id, int UE_id,
     if (UE_info->UE_sched_ctrl[UE_id].ul_failure_timer > 4000) {
       // note: probably ul_failure_timer should be less than UE radio link failure time(see T310/N310/N311)
       if (NODE_IS_DU(RC.rrc[module_idP]->node_type)) {
-        MessageDef *m = itti_alloc_new_message(TASK_MAC_ENB, 0, F1AP_UE_CONTEXT_RELEASE_REQ);
+        MessageDef *m = itti_alloc_new_message(TASK_PHY_ENB, 0, F1AP_UE_CONTEXT_RELEASE_REQ);
         F1AP_UE_CONTEXT_RELEASE_REQ(m).rnti = rnti;
         F1AP_UE_CONTEXT_RELEASE_REQ(m).cause = F1AP_CAUSE_RADIO_NETWORK;
         F1AP_UE_CONTEXT_RELEASE_REQ(m).cause_value = 1; // 1 = F1AP_CauseRadioNetwork_rl_failure
diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c
index c659df8d31a..12f37c3b68b 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c
@@ -1396,10 +1396,16 @@ initiate_ra_proc(module_id_t module_idP,
       ra[i].RA_rnti = ra_rnti;
       ra[i].preamble_index = preamble_index;
       failure_cnt = 0;
-      LOG_D(MAC,
+      LOG_I(MAC,
             "[eNB %d][RAPROC] CC_id %d Frame %d Activating RAR generation in Frame %d, subframe %d for process %d, rnti %x, state %d\n",
-            module_idP, CC_id, frameP, ra[i].Msg2_frame,
-            ra[i].Msg2_subframe, i, ra[i].rnti, ra[i].state);
+            module_idP,
+            CC_id,
+            frameP,
+            ra[i].Msg2_frame,
+            ra[i].Msg2_subframe,
+            i,
+            ra[i].rnti,
+            ra[i].state);
       return;
     }
   }
diff --git a/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c b/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c
index 1cfc8ee838e..fb113cbb5c6 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c
@@ -3206,11 +3206,7 @@ void schedule_ulsch_rnti_fairRR(module_id_t   module_idP,
         UE_template->nb_rb_ul[harq_pid]    = rb_table[rb_table_index];
         UE_template->first_rb_ul[harq_pid] = first_rb[CC_id];
         UE_template->cqi_req[harq_pid] = cqi_req;
-        UE_sched_ctrl->ul_scheduled |= (1<<harq_pid);
-
-        if (UE_id == UE_info->list.head)
-          VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SCHEDULED,UE_sched_ctrl->ul_scheduled);
-
+        UE_sched_ctrl->ul_scheduled |= (1 << harq_pid);
         // adjust total UL buffer status by TBS, wait for UL sdus to do final update
         /*LOG_D(MAC,"[eNB %d] CC_id %d UE %d/%x : adjusting ul_total_buffer, old %d, TBS %d\n", module_idP,CC_id,UE_id,rnti,UE_template->ul_total_buffer,UE_template->TBS_UL[harq_pid]);
         if (UE_template->ul_total_buffer > UE_template->TBS_UL[harq_pid])
diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c
index 3aa9d946ce8..c2e51db3efe 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c
@@ -1989,12 +1989,11 @@ find_UE_id(module_id_t mod_idP,
            rnti_t rntiP)
 //------------------------------------------------------------------------------
 {
-  int UE_id;
   UE_info_t *UE_info = &RC.mac[mod_idP]->UE_info;
   if(!UE_info)
     return -1;
 
-  for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) {
+  for (int UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) {
     if (UE_info->active[UE_id] == true) {
       int CC_id = UE_PCCID(mod_idP, UE_id);
       if (CC_id>=0 && CC_id<NFAPI_CC_MAX && UE_info->UE_template[CC_id][UE_id].rnti == rntiP) {
@@ -2144,6 +2143,7 @@ inline void add_ue_list(UE_list_t *listP, int UE_id) {
   while (*cur >= 0)
     cur = &listP->next[*cur];
   *cur = UE_id;
+  LOG_D(MAC, "added UE %d in UE list\n", UE_id);
 }
 
 //------------------------------------------------------------------------------
diff --git a/openair2/LAYER2/MAC/main.c b/openair2/LAYER2/MAC/main.c
index 8de14a13abe..36f258d06cd 100644
--- a/openair2/LAYER2/MAC/main.c
+++ b/openair2/LAYER2/MAC/main.c
@@ -109,6 +109,7 @@ void lte_dump_mac_stats(eNB_MAC_INST *mac, FILE *fd)
               UE_info->eNB_UE_stats[CC_id][UE_id].dlsch_errors);
     }
   }
+  fflush(fd);
   return;
 }
 
@@ -270,47 +271,3 @@ int l2_init_eNB(void)
 
     return (1);
 }
-
-//-----------------------------------------------------------------------------
-/*
- * Main loop of MAC itti message handling
- */
-void *mac_enb_task(void *arg)
-//-----------------------------------------------------------------------------
-{
-  MessageDef *received_msg = NULL;
-  int         result;
-
-  itti_mark_task_ready(TASK_MAC_ENB); // void function 10/2019
-  LOG_I(MAC,"Starting main loop of MAC message task\n");
-
-  while (1) {
-    itti_receive_msg(TASK_MAC_ENB, &received_msg);
-
-    switch (ITTI_MSG_ID(received_msg)) {
-      case RRC_MAC_DRX_CONFIG_REQ:
-        LOG_I(MAC, "MAC Task Received RRC_MAC_DRX_CONFIG_REQ\n");
-        /* Set timers and thresholds values in local MAC context of UE */
-        eNB_Config_Local_DRX(ITTI_MSG_DESTINATION_INSTANCE(received_msg), &received_msg->ittiMsg.rrc_mac_drx_config_req);
-        break;
-
-      case TERMINATE_MESSAGE:
-        LOG_W(MAC, " *** Exiting MAC thread\n");
-        itti_exit_task();
-        break;
-
-      default:
-        LOG_E(MAC, "MAC instance received unhandled message: %d:%s\n",
-              ITTI_MSG_ID(received_msg), 
-              ITTI_MSG_NAME(received_msg));
-        break;  
-    } // end switch
-
-    result = itti_free(ITTI_MSG_ORIGIN_ID(received_msg), received_msg);
-    AssertFatal(result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
-    
-    received_msg = NULL;
-  } // end while
-
-  return NULL;
-}
diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c
index 171e69ea599..ee90ee1862d 100644
--- a/openair2/RRC/LTE/rrc_eNB.c
+++ b/openair2/RRC/LTE/rrc_eNB.c
@@ -971,48 +971,50 @@ void release_UE_in_freeList(module_id_t mod_id) {
 
   for(int ue_num = 0; ue_num < sizeofArray(eNB_MAC->UE_free_ctrl) ; ue_num++) {
     rnti_t rnti = eNB_MAC->UE_free_ctrl[ue_num].rnti;
-
-    if(rnti != 0) {
+    if (!rnti)
+      continue;
       protocol_ctxt_t  ctxt;
-      PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, mod_id, ENB_FLAG_YES, rnti, 0, 0,mod_id);
+    PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, mod_id, ENB_FLAG_YES, rnti, 0, 0, mod_id);
 
       for (int CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
         eNB_PHY = RC.eNB[mod_id][CC_id];
         int id;
         // clean ULSCH entries for rnti
-        id = find_ulsch(rnti,eNB_PHY,eNB_MAC->UE_free_ctrl[ue_num].raFlag ? SEARCH_EXIST_RA : SEARCH_EXIST);
+      id = find_ulsch(rnti, eNB_PHY, eNB_MAC->UE_free_ctrl[ue_num].raFlag ? SEARCH_EXIST_RA : SEARCH_EXIST);
 
-        if (id>=0) clean_eNb_ulsch(eNB_PHY->ulsch[id]);
+      if (id >= 0)
+        clean_eNb_ulsch(eNB_PHY->ulsch[id]);
 
         // clean DLSCH entries for rnti
-        id = find_dlsch(rnti,eNB_PHY,eNB_MAC->UE_free_ctrl[ue_num].raFlag ? SEARCH_EXIST_RA : SEARCH_EXIST);
+      id = find_dlsch(rnti, eNB_PHY, eNB_MAC->UE_free_ctrl[ue_num].raFlag ? SEARCH_EXIST_RA : SEARCH_EXIST);
 
-        if (id>=0) clean_eNb_dlsch(eNB_PHY->dlsch[id][0]);
+      if (id >= 0)
+        clean_eNb_dlsch(eNB_PHY->dlsch[id][0]);
 
         // clean UCI entries for rnti
-        for (int i=0; i<NUMBER_OF_UCI_MAX; i++) {
-          if(eNB_PHY->uci_vars[i].rnti == rnti) {
-            LOG_I(MAC, "clean eNb uci_vars[%d] UE %x \n",i, rnti);
-            memset(&eNB_PHY->uci_vars[i],0,sizeof(LTE_eNB_UCI));
+      for (int i = 0; i < NUMBER_OF_UCI_MAX; i++) {
+        if (eNB_PHY->uci_vars[i].rnti == rnti) {
+          LOG_I(MAC, "clean eNb uci_vars[%d] UE %x \n", i, rnti);
+          memset(&eNB_PHY->uci_vars[i], 0, sizeof(LTE_eNB_UCI));
           }
         }
 
         for(int j = 0; j < 10; j++) {
           nfapi_ul_config_request_body_t *ul_req_tmp  = &eNB_MAC->UL_req_tmp[CC_id][j].ul_config_request_body;
 
-          if(ul_req_tmp) {
+        if (ul_req_tmp) {
             int pdu_number = ul_req_tmp->number_of_pdus;
 
-            for(int pdu_index = pdu_number-1; pdu_index >= 0; pdu_index--) {
-              if((ul_req_tmp->ul_config_pdu_list[pdu_index].ulsch_pdu.ulsch_pdu_rel8.rnti == rnti) ||
-                  (ul_req_tmp->ul_config_pdu_list[pdu_index].uci_harq_pdu.ue_information.ue_information_rel8.rnti == rnti) ||
-                  (ul_req_tmp->ul_config_pdu_list[pdu_index].uci_cqi_pdu.ue_information.ue_information_rel8.rnti == rnti) ||
-                  (ul_req_tmp->ul_config_pdu_list[pdu_index].uci_sr_pdu.ue_information.ue_information_rel8.rnti == rnti) ||
-                  (ul_req_tmp->ul_config_pdu_list[pdu_index].srs_pdu.srs_pdu_rel8.rnti == rnti)) {
+          for (int pdu_index = pdu_number - 1; pdu_index >= 0; pdu_index--) {
+            if ((ul_req_tmp->ul_config_pdu_list[pdu_index].ulsch_pdu.ulsch_pdu_rel8.rnti == rnti)
+                || (ul_req_tmp->ul_config_pdu_list[pdu_index].uci_harq_pdu.ue_information.ue_information_rel8.rnti == rnti)
+                || (ul_req_tmp->ul_config_pdu_list[pdu_index].uci_cqi_pdu.ue_information.ue_information_rel8.rnti == rnti)
+                || (ul_req_tmp->ul_config_pdu_list[pdu_index].uci_sr_pdu.ue_information.ue_information_rel8.rnti == rnti)
+                || (ul_req_tmp->ul_config_pdu_list[pdu_index].srs_pdu.srs_pdu_rel8.rnti == rnti)) {
                 LOG_I(RRC, "remove UE %x from ul_config_pdu_list %d/%d\n", rnti, pdu_index, pdu_number);
 
-                if(pdu_index < pdu_number -1) {
-                  memcpy(&ul_req_tmp->ul_config_pdu_list[pdu_index], &ul_req_tmp->ul_config_pdu_list[pdu_index+1], (pdu_number-1-pdu_index) * sizeof(nfapi_ul_config_request_pdu_t));
+              if (pdu_index < pdu_number - 1) {
+                memcpy(&ul_req_tmp->ul_config_pdu_list[pdu_index], &ul_req_tmp->ul_config_pdu_list[pdu_index + 1], (pdu_number - 1 - pdu_index) * sizeof(nfapi_ul_config_request_pdu_t));
                 }
 
                 ul_req_tmp->number_of_pdus--;
@@ -1049,7 +1051,6 @@ void release_UE_in_freeList(module_id_t mod_id) {
       LOG_I(RRC, "[release_UE_in_freeList] remove UE %x from freeList ra context: %d\n", rnti, eNB_MAC->UE_free_ctrl[ue_num].raFlag);
       eNB_MAC->UE_free_ctrl[ue_num].rnti = 0;
     }
-  }
   pthread_mutex_unlock(&lock_ue_freelist);
 }
 
@@ -2658,7 +2659,6 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t
   uint8_t   buffer[RRC_BUF_SIZE];
   uint16_t  size;
   int       i;
-  MessageDef *message_p = NULL;
   /* Configure SRB1/SRB2, PhysicalConfigDedicated, LTE_MAC_MainConfig for UE */
   eNB_RRC_INST                           *rrc_inst = RC.rrc[ctxt_pP->module_id];
   struct LTE_PhysicalConfigDedicated    **physicalConfigDedicated = &ue_context_pP->ue_context.physicalConfigDedicated;
@@ -2854,10 +2854,8 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t
       LOG_W(RRC, "drx_Configuration parameter is NULL, cannot configure local UE parameters or CDRX is deactivated\n");
     } else {
       /* Send DRX configuration to MAC task to configure timers of local UE context */
-      message_p = itti_alloc_new_message(TASK_RRC_ENB, 0, RRC_MAC_DRX_CONFIG_REQ);
-      RRC_MAC_DRX_CONFIG_REQ(message_p).rnti = rnti;
-      RRC_MAC_DRX_CONFIG_REQ(message_p).drx_Configuration = mac_MainConfig->drx_Config;
-      itti_send_msg_to_task(TASK_MAC_ENB, module_id, message_p);
+      rrc_mac_drx_config_req_t req = {.rnti = rnti, .drx_Configuration = mac_MainConfig->drx_Config};
+      eNB_Config_Local_DRX(module_id, &req);
       LOG_D(RRC, "DRX configured in MAC Main Configuration for RRC Connection Reconfiguration\n");
     }
   }
@@ -5952,7 +5950,7 @@ rrc_eNB_decode_ccch(
           }
 
           c_rnti = BIT_STRING_to_uint16(&rrcConnectionReestablishmentRequest->ue_Identity.c_RNTI);
-          LOG_D(RRC, "c_rnti is %x\n", c_rnti);
+          LOG_I(RRC, "reestablishment, previous c_rnti is %x (new is %x)\n", c_rnti, ctxt_pP->rnti);
           ue_context_p = rrc_eNB_get_ue_context(RC.rrc[ctxt_pP->module_id], c_rnti);
 
           if (ue_context_p == NULL) {
@@ -6008,7 +6006,7 @@ rrc_eNB_decode_ccch(
             if((RC.mac[ctxt_pP->module_id]->UE_info.UE_sched_ctrl[UE_id].ue_reestablishment_reject_timer > 0) &&
                 (RC.mac[ctxt_pP->module_id]->UE_info.UE_sched_ctrl[UE_id].ue_reestablishment_reject_timer_thres > 20)) {
               LOG_E(RRC,
-                    PROTOCOL_RRC_CTXT_UE_FMT" RCConnectionReestablishmentComplete(Previous) don't receive, delete the Previous UE\n",
+                    PROTOCOL_RRC_CTXT_UE_FMT " RCConnectionReestablishmentComplete not received, but we get a new RRCConnectionReestablishmentRequest, we delete the Previous UE\n",
                     PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
               RC.mac[ctxt_pP->module_id]->UE_info.UE_sched_ctrl[UE_id].ue_reestablishment_reject_timer = 1000;
               rrc_eNB_previous_SRB2(ue_context_p);
@@ -6027,10 +6025,9 @@ rrc_eNB_decode_ccch(
 
           if(ue_context_p->ue_context.ue_reestablishment_timer > 0) {
             LOG_E(RRC,
-                  PROTOCOL_RRC_CTXT_UE_FMT" RRRCConnectionReconfigurationComplete(Previous) don't receive, delete the Previous UE,\nprevious Status %d, new Status RRC_RECONFIGURED\n",
+                  PROTOCOL_RRC_CTXT_UE_FMT " RRRCConnectionReconfigurationComplete not received, delete the Previous UE,\nprevious Status %d, new Status RRC_RECONFIGURED\n",
                   PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
-                  ue_context_p->ue_context.StatusRrc
-                 );
+                  ue_context_p->ue_context.StatusRrc);
             ue_context_p->ue_context.StatusRrc = RRC_RECONFIGURED;
             protocol_ctxt_t  ctxt_old_p;
             PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt_old_p,
@@ -8082,13 +8079,14 @@ void *rrc_enb_process_itti_msg(void *notUsed) {
   protocol_ctxt_t                     ctxt;
   memset(&ctxt, 0, sizeof(ctxt));
   // Wait for a message
-  itti_receive_msg(TASK_RRC_ENB, &msg_p);
+  itti_poll_msg(TASK_RRC_ENB, &msg_p);
+  while (msg_p) {
   msg_name_p = ITTI_MSG_NAME(msg_p);
   instance = ITTI_MSG_DESTINATION_INSTANCE(msg_p);
 
   /* RRC_SUBFRAME_PROCESS is sent every subframe, do not log it */
   if (ITTI_MSG_ID(msg_p) != RRC_SUBFRAME_PROCESS)
-    LOG_D(RRC,"Received message %s\n",msg_name_p);
+      LOG_D(RRC, "Received message %s\n", msg_name_p);
 
   switch (ITTI_MSG_ID(msg_p)) {
     case TERMINATE_MESSAGE:
@@ -8102,51 +8100,28 @@ void *rrc_enb_process_itti_msg(void *notUsed) {
 
     /* Messages from MAC */
     case RRC_MAC_CCCH_DATA_IND:
-      PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt,
-                                    RRC_MAC_CCCH_DATA_IND(msg_p).enb_index,
-                                    ENB_FLAG_YES,
-                                    RRC_MAC_CCCH_DATA_IND(msg_p).rnti,
-                                    msg_p->ittiMsgHeader.lte_time.frame,
-                                    msg_p->ittiMsgHeader.lte_time.slot);
-      LOG_I(RRC,"Decoding CCCH : inst %ld, CC_id %d, ctxt %p, sib_info_p->Rx_buffer.payload_size %d\n",
-            instance,
-            RRC_MAC_CCCH_DATA_IND(msg_p).CC_id,
-            &ctxt,
-            RRC_MAC_CCCH_DATA_IND(msg_p).sdu_size);
+        PROTOCOL_CTXT_SET_BY_INSTANCE(
+            &ctxt, RRC_MAC_CCCH_DATA_IND(msg_p).enb_index, ENB_FLAG_YES, RRC_MAC_CCCH_DATA_IND(msg_p).rnti, msg_p->ittiMsgHeader.lte_time.frame, msg_p->ittiMsgHeader.lte_time.slot);
+        LOG_I(RRC, "Decoding CCCH : inst %ld, CC_id %d, ctxt %p, sib_info_p->Rx_buffer.payload_size %d\n", instance, RRC_MAC_CCCH_DATA_IND(msg_p).CC_id, &ctxt, RRC_MAC_CCCH_DATA_IND(msg_p).sdu_size);
 
       if (RRC_MAC_CCCH_DATA_IND(msg_p).sdu_size >= CCCH_SDU_SIZE) {
-        LOG_I(RRC, "CCCH message has size %d > %d\n",
-              RRC_MAC_CCCH_DATA_IND(msg_p).sdu_size,CCCH_SDU_SIZE);
+          LOG_I(RRC, "CCCH message has size %d > %d\n", RRC_MAC_CCCH_DATA_IND(msg_p).sdu_size, CCCH_SDU_SIZE);
         break;
       }
 
-      rrc_eNB_decode_ccch(&ctxt,
-                          (uint8_t *)RRC_MAC_CCCH_DATA_IND(msg_p).sdu,
-                          RRC_MAC_CCCH_DATA_IND(msg_p).sdu_size,
-                          RRC_MAC_CCCH_DATA_IND(msg_p).CC_id);
+        rrc_eNB_decode_ccch(&ctxt, (uint8_t *)RRC_MAC_CCCH_DATA_IND(msg_p).sdu, RRC_MAC_CCCH_DATA_IND(msg_p).sdu_size, RRC_MAC_CCCH_DATA_IND(msg_p).CC_id);
       break;
 
     /* Messages from PDCP */
     case RRC_DCCH_DATA_IND:
-      PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt,
-                                    instance,
-                                    ENB_FLAG_YES,
-                                    RRC_DCCH_DATA_IND(msg_p).rnti,
-                                    msg_p->ittiMsgHeader.lte_time.frame,
-                                    msg_p->ittiMsgHeader.lte_time.slot);
-      LOG_D(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Received on DCCH %d %s\n",
-            PROTOCOL_RRC_CTXT_UE_ARGS(&ctxt),
-            RRC_DCCH_DATA_IND(msg_p).dcch_index,
-            msg_name_p);
-      rrc_eNB_decode_dcch(&ctxt,
-                          RRC_DCCH_DATA_IND(msg_p).dcch_index,
-                          RRC_DCCH_DATA_IND(msg_p).sdu_p,
-                          RRC_DCCH_DATA_IND(msg_p).sdu_size);
+        PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, ENB_FLAG_YES, RRC_DCCH_DATA_IND(msg_p).rnti, msg_p->ittiMsgHeader.lte_time.frame, msg_p->ittiMsgHeader.lte_time.slot);
+        LOG_D(RRC, PROTOCOL_RRC_CTXT_UE_FMT " Received on DCCH %d %s\n", PROTOCOL_RRC_CTXT_UE_ARGS(&ctxt), RRC_DCCH_DATA_IND(msg_p).dcch_index, msg_name_p);
+        rrc_eNB_decode_dcch(&ctxt, RRC_DCCH_DATA_IND(msg_p).dcch_index, RRC_DCCH_DATA_IND(msg_p).sdu_p, RRC_DCCH_DATA_IND(msg_p).sdu_size);
       // Message buffer has been processed, free it now.
       result = itti_free(ITTI_MSG_ORIGIN_ID(msg_p), RRC_DCCH_DATA_IND(msg_p).sdu_p);
 
       if (result != EXIT_SUCCESS) {
-        LOG_I(RRC, "Failed to free memory (%d)!\n",result);
+          LOG_I(RRC, "Failed to free memory (%d)!\n", result);
         break;
       }
 
@@ -8218,15 +8193,15 @@ void *rrc_enb_process_itti_msg(void *notUsed) {
 
       if (ue_context_p == NULL) {
         /* is it possible? */
-        LOG_E(RRC, "could not find UE (rnti %x) while processing X2AP_HANDOVER_REQ_ACK\n",
-              X2AP_HANDOVER_REQ_ACK(msg_p).rnti);
+          LOG_E(RRC, "could not find UE (rnti %x) while processing X2AP_HANDOVER_REQ_ACK\n", X2AP_HANDOVER_REQ_ACK(msg_p).rnti);
         exit(1);
       }
 
       LOG_I(RRC, "[eNB %ld] source eNB receives the X2 HO ACK %s\n", instance, msg_name_p);
       DevAssert(ue_context_p != NULL);
 
-      if (ue_context_p->ue_context.handover_info->state != HO_REQUEST) abort();
+        if (ue_context_p->ue_context.handover_info->state != HO_REQUEST)
+          abort();
 
       hash_rc = hashtable_get(RC.gtpv1u_data_g->ue_mapping, ue_context_p->ue_context.rnti, (void **)&gtpv1u_ue_data_p);
 
@@ -8242,26 +8217,22 @@ void *rrc_enb_process_itti_msg(void *notUsed) {
         nb_e_rabs_tobesetup = x2ap_handover_req_ack->nb_e_rabs_tobesetup;
         ue_context_p->ue_context.nb_x2u_e_rabs = nb_e_rabs_tobesetup;
 
-        for(int i=0; i< nb_e_rabs_tobesetup; i++) {
+          for (int i = 0; i < nb_e_rabs_tobesetup; i++) {
           ip_offset               = 0;
           eps_bearer_id = x2ap_handover_req_ack->e_rabs_tobesetup[i].e_rab_id;
           ue_context_p->ue_context.enb_gtp_x2u_ebi[i] = eps_bearer_id;
           ue_context_p->ue_context.enb_gtp_x2u_teid[i] = x2ap_handover_req_ack->e_rabs_tobesetup[i].gtp_teid;
           gtpv1u_ue_data_p->bearers[eps_bearer_id - GTPV1U_BEARER_OFFSET].teid_teNB = x2ap_handover_req_ack->e_rabs_tobesetup[i].gtp_teid;
 
-          if ((x2ap_handover_req_ack->e_rabs_tobesetup[i].eNB_addr.length == 4) ||
-              (x2ap_handover_req_ack->e_rabs_tobesetup[i].eNB_addr.length == 20)) {
+            if ((x2ap_handover_req_ack->e_rabs_tobesetup[i].eNB_addr.length == 4) || (x2ap_handover_req_ack->e_rabs_tobesetup[i].eNB_addr.length == 20)) {
             in_addr = *((in_addr_t *)x2ap_handover_req_ack->e_rabs_tobesetup[i].eNB_addr.buffer);
             ip_offset = 4;
             gtpv1u_ue_data_p->bearers[eps_bearer_id - GTPV1U_BEARER_OFFSET].tenb_ip_addr = in_addr;
             ue_context_p->ue_context.enb_gtp_x2u_addrs[i] = x2ap_handover_req_ack->e_rabs_tobesetup[i].eNB_addr;
           }
 
-          if ((x2ap_handover_req_ack->e_rabs_tobesetup[i].eNB_addr.length == 16) ||
-              (x2ap_handover_req_ack->e_rabs_tobesetup[i].eNB_addr.length == 20)) {
-            memcpy(gtpv1u_ue_data_p->bearers[eps_bearer_id - GTPV1U_BEARER_OFFSET].tenb_ip6_addr.s6_addr,
-                   &x2ap_handover_req_ack->e_rabs_tobesetup[i].eNB_addr.buffer[ip_offset],
-                   16);
+            if ((x2ap_handover_req_ack->e_rabs_tobesetup[i].eNB_addr.length == 16) || (x2ap_handover_req_ack->e_rabs_tobesetup[i].eNB_addr.length == 20)) {
+              memcpy(gtpv1u_ue_data_p->bearers[eps_bearer_id - GTPV1U_BEARER_OFFSET].tenb_ip6_addr.s6_addr, &x2ap_handover_req_ack->e_rabs_tobesetup[i].eNB_addr.buffer[ip_offset], 16);
           }
         }
       }
@@ -8277,7 +8248,8 @@ void *rrc_enb_process_itti_msg(void *notUsed) {
       LOG_I(RRC, "[eNB %ld] source eNB receives the X2 UE CONTEXT RELEASE %s\n", instance, msg_name_p);
       DevAssert(ue_context_p != NULL);
 
-      if (ue_context_p->ue_context.handover_info->state != HO_COMPLETE) abort();
+        if (ue_context_p->ue_context.handover_info->state != HO_COMPLETE)
+          abort();
 
       ue_context_p->ue_context.handover_info->state = HO_RELEASE;
       break;
@@ -8303,13 +8275,8 @@ void *rrc_enb_process_itti_msg(void *notUsed) {
 
       ue_context_p = rrc_eNB_get_ue_context(RC.rrc[instance], X2AP_HANDOVER_CANCEL(msg_p).rnti);
 
-      if (ue_context_p != NULL &&
-          ue_context_p->ue_context.handover_info != NULL) {
-        LOG_I(RRC, "[eNB %ld] eNB receives X2 HANDOVER CANCEL for rnti %x, cause %s [%s]\n",
-              instance,
-              X2AP_HANDOVER_CANCEL(msg_p).rnti,
-              cause,
-              msg_name_p);
+        if (ue_context_p != NULL && ue_context_p->ue_context.handover_info != NULL) {
+          LOG_I(RRC, "[eNB %ld] eNB receives X2 HANDOVER CANCEL for rnti %x, cause %s [%s]\n", instance, X2AP_HANDOVER_CANCEL(msg_p).rnti, cause, msg_name_p);
 
         if (X2AP_HANDOVER_CANCEL(msg_p).cause == X2AP_T_RELOC_PREP_TIMEOUT) {
           /* for prep timeout, simply return to normal state */
@@ -8330,8 +8297,7 @@ void *rrc_enb_process_itti_msg(void *notUsed) {
         else
           failure_cause = "UE not in handover";
 
-        LOG_W(RRC, "[eNB %ld] cannot process (%s) X2 HANDOVER CANCEL for rnti %x, cause %s, ignoring\n",
-              instance, failure_cause, X2AP_HANDOVER_CANCEL(msg_p).rnti, cause);
+          LOG_W(RRC, "[eNB %ld] cannot process (%s) X2 HANDOVER CANCEL for rnti %x, cause %s, ignoring\n", instance, failure_cause, X2AP_HANDOVER_CANCEL(msg_p).rnti, cause);
       }
 
       break;
@@ -8364,9 +8330,8 @@ void *rrc_enb_process_itti_msg(void *notUsed) {
 
     /* Messages from F1AP task */
     case F1AP_SETUP_REQ:
-      AssertFatal(NODE_IS_CU(RC.rrc[instance]->node_type),
-                  "should not receive F1AP_SETUP_REQUEST, need call by CU!\n");
-      LOG_I(RRC,"[eNB %ld] Received %s : %p\n", instance, msg_name_p, &F1AP_SETUP_REQ(msg_p));
+        AssertFatal(NODE_IS_CU(RC.rrc[instance]->node_type), "should not receive F1AP_SETUP_REQUEST, need call by CU!\n");
+        LOG_I(RRC, "[eNB %ld] Received %s : %p\n", instance, msg_name_p, &F1AP_SETUP_REQ(msg_p));
       handle_f1_setup_req(&F1AP_SETUP_REQ(msg_p));
       break;
 
@@ -8375,47 +8340,43 @@ void *rrc_enb_process_itti_msg(void *notUsed) {
       break;
 
     case M2AP_SETUP_RESP:
-      rrc_eNB_process_M2AP_SETUP_RESP(&ctxt,0/*CC_id*/,ENB_INSTANCE_TO_MODULE_ID(instance),&M2AP_SETUP_RESP(msg_p));
+        rrc_eNB_process_M2AP_SETUP_RESP(&ctxt, 0 /*CC_id*/, ENB_INSTANCE_TO_MODULE_ID(instance), &M2AP_SETUP_RESP(msg_p));
       break;
 
     case M2AP_MBMS_SCHEDULING_INFORMATION:
-      rrc_eNB_process_M2AP_MBMS_SCHEDULING_INFORMATION(&ctxt,0/*CC_id*/,ENB_INSTANCE_TO_MODULE_ID(instance),&M2AP_MBMS_SCHEDULING_INFORMATION(msg_p));
+        rrc_eNB_process_M2AP_MBMS_SCHEDULING_INFORMATION(&ctxt, 0 /*CC_id*/, ENB_INSTANCE_TO_MODULE_ID(instance), &M2AP_MBMS_SCHEDULING_INFORMATION(msg_p));
       break;
 
     case M2AP_MBMS_SESSION_START_REQ:
-      rrc_eNB_process_M2AP_MBMS_SESSION_START_REQ(&ctxt,0/*CC_id*/,ENB_INSTANCE_TO_MODULE_ID(instance),&M2AP_MBMS_SESSION_START_REQ(msg_p));
+        rrc_eNB_process_M2AP_MBMS_SESSION_START_REQ(&ctxt, 0 /*CC_id*/, ENB_INSTANCE_TO_MODULE_ID(instance), &M2AP_MBMS_SESSION_START_REQ(msg_p));
       break;
 
     case M2AP_MBMS_SESSION_STOP_REQ:
-      rrc_eNB_process_M2AP_MBMS_SESSION_STOP_REQ(&ctxt,&M2AP_MBMS_SESSION_STOP_REQ(msg_p));
+        rrc_eNB_process_M2AP_MBMS_SESSION_STOP_REQ(&ctxt, &M2AP_MBMS_SESSION_STOP_REQ(msg_p));
       break;
 
     case M2AP_RESET:
-      rrc_eNB_process_M2AP_RESET(&ctxt,&M2AP_RESET(msg_p));
+        rrc_eNB_process_M2AP_RESET(&ctxt, &M2AP_RESET(msg_p));
       break;
 
     case M2AP_ENB_CONFIGURATION_UPDATE_ACK:
-      rrc_eNB_process_M2AP_ENB_CONFIGURATION_UPDATE_ACK(&ctxt,&M2AP_ENB_CONFIGURATION_UPDATE_ACK(msg_p));
+        rrc_eNB_process_M2AP_ENB_CONFIGURATION_UPDATE_ACK(&ctxt, &M2AP_ENB_CONFIGURATION_UPDATE_ACK(msg_p));
       break;
 
     case M2AP_ERROR_INDICATION:
-      rrc_eNB_process_M2AP_ERROR_INDICATION(&ctxt,&M2AP_ERROR_INDICATION(msg_p));
+        rrc_eNB_process_M2AP_ERROR_INDICATION(&ctxt, &M2AP_ERROR_INDICATION(msg_p));
       break;
 
     case M2AP_MBMS_SERVICE_COUNTING_REQ:
-      rrc_eNB_process_M2AP_MBMS_SERVICE_COUNTING_REQ(&ctxt,&M2AP_MBMS_SERVICE_COUNTING_REQ(msg_p));
+        rrc_eNB_process_M2AP_MBMS_SERVICE_COUNTING_REQ(&ctxt, &M2AP_MBMS_SERVICE_COUNTING_REQ(msg_p));
       break;
 
     case M2AP_MCE_CONFIGURATION_UPDATE:
-      rrc_eNB_process_M2AP_MCE_CONFIGURATION_UPDATE(&ctxt,&M2AP_MCE_CONFIGURATION_UPDATE(msg_p));
+        rrc_eNB_process_M2AP_MCE_CONFIGURATION_UPDATE(&ctxt, &M2AP_MCE_CONFIGURATION_UPDATE(msg_p));
       break;
 
     case RLC_SDU_INDICATION:
-      process_rlc_sdu_indication(instance,
-                                 RLC_SDU_INDICATION(msg_p).rnti,
-                                 RLC_SDU_INDICATION(msg_p).is_successful,
-                                 RLC_SDU_INDICATION(msg_p).srb_id,
-                                 RLC_SDU_INDICATION(msg_p).message_id);
+        process_rlc_sdu_indication(instance, RLC_SDU_INDICATION(msg_p).rnti, RLC_SDU_INDICATION(msg_p).is_successful, RLC_SDU_INDICATION(msg_p).srb_id, RLC_SDU_INDICATION(msg_p).message_id);
       break;
 
     default:
@@ -8426,32 +8387,11 @@ void *rrc_enb_process_itti_msg(void *notUsed) {
   result = itti_free(ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
 
   if (result != EXIT_SUCCESS) {
-    LOG_I(RRC, "Failed to free memory (%d)!\n",result);
-  }
-
-  msg_p = NULL;
-  return NULL;
-}
-
-//-----------------------------------------------------------------------------
-void *
-rrc_enb_task(
-  void *args_p
-)
-//-----------------------------------------------------------------------------
-{
-  rrc_enb_init();
-  itti_mark_task_ready(TASK_RRC_ENB);
-  LOG_I(RRC,"Entering main loop of RRC message task\n");
-
-  while (1) {
-    (void) rrc_enb_process_itti_msg(NULL);
-    {
-      //extern volatile int go_nr;
-      void rrc_go_nr(void);
-      //if (go_nr) rrc_go_nr();
+      LOG_I(RRC, "Failed to free memory (%d)!\n", result);
     }
+    itti_poll_msg(TASK_RRC_ENB, &msg_p);
   }
+  return NULL;
 }
 
 /*------------------------------------------------------------------------------*/
@@ -8799,5 +8739,6 @@ rrc_rx_tx(
   RRC_SUBFRAME_PROCESS(message_p).ctxt  = *ctxt_pP;
   RRC_SUBFRAME_PROCESS(message_p).CC_id = CC_id;
   itti_send_msg_to_task(TASK_RRC_ENB, ctxt_pP->module_id, message_p);
+  rrc_enb_process_itti_msg(NULL);
   return RRC_OK;
 }
-- 
GitLab