From e179ab0e9248157fa1ec1601400d7c40ab0ea350 Mon Sep 17 00:00:00 2001
From: Lionel Gauthier <lionel.gauthier@eurecom.fr>
Date: Wed, 6 May 2015 09:06:25 +0000
Subject: [PATCH] Old rev code

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7378 818b1a75-f10b-46b9-bf7c-635c3b92a50f
---
 openair2/RRC/CELLULAR/Makefile                |   64 -
 openair2/RRC/CELLULAR/Makefile.inc            |   41 -
 openair2/RRC/CELLULAR/Readme.txt              |    6 -
 openair2/RRC/CELLULAR/as_configuration.h      |   31 -
 openair2/RRC/CELLULAR/esterel_header.txt      |   23 -
 openair2/RRC/CELLULAR/rrc_L2_proto.h          |   59 -
 openair2/RRC/CELLULAR/rrc_bch_constant.h      |  142 --
 openair2/RRC/CELLULAR/rrc_bch_ies.c           | 1252 ----------
 openair2/RRC/CELLULAR/rrc_bch_ies.h           |  279 ---
 openair2/RRC/CELLULAR/rrc_bch_mib.c           |  693 ------
 openair2/RRC/CELLULAR/rrc_bch_mib.h           |  140 --
 openair2/RRC/CELLULAR/rrc_bch_per_basic.c     |  493 ----
 openair2/RRC/CELLULAR/rrc_bch_per_basic.h     |   26 -
 openair2/RRC/CELLULAR/rrc_constant.h          |  274 ---
 openair2/RRC/CELLULAR/rrc_mbms_constant.h     |  141 --
 openair2/RRC/CELLULAR/rrc_mbms_ies.h          |  179 --
 openair2/RRC/CELLULAR/rrc_mbms_pdus.c         |  660 -----
 openair2/RRC/CELLULAR/rrc_mbms_pdus.h         |   91 -
 openair2/RRC/CELLULAR/rrc_messages.h          |   97 -
 openair2/RRC/CELLULAR/rrc_msg_class.h         |  192 --
 openair2/RRC/CELLULAR/rrc_msg_constant.h      |  159 --
 openair2/RRC/CELLULAR/rrc_msg_ies.h           |  834 -------
 openair2/RRC/CELLULAR/rrc_msg_pdus.c          | 1779 --------------
 openair2/RRC/CELLULAR/rrc_msg_pdus.h          |  316 ---
 openair2/RRC/CELLULAR/rrc_nas_primitives.h    |  365 ---
 openair2/RRC/CELLULAR/rrc_nas_sap.h           |   95 -
 openair2/RRC/CELLULAR/rrc_platform_types.h    |   24 -
 openair2/RRC/CELLULAR/rrc_proto_bch.h         |  177 --
 openair2/RRC/CELLULAR/rrc_proto_fsm.h         |  182 --
 openair2/RRC/CELLULAR/rrc_proto_int.h         |   99 -
 openair2/RRC/CELLULAR/rrc_proto_intf.h        |  185 --
 openair2/RRC/CELLULAR/rrc_proto_mbms.h        |  151 --
 openair2/RRC/CELLULAR/rrc_proto_msg.h         |  132 -
 openair2/RRC/CELLULAR/rrc_proto_rrm.h         |   33 -
 openair2/RRC/CELLULAR/rrc_qos_classes.h       |   39 -
 openair2/RRC/CELLULAR/rrc_qos_definitions.h   |   68 -
 openair2/RRC/CELLULAR/rrc_rb_ue.c             | 1049 --------
 openair2/RRC/CELLULAR/rrc_rb_ue.h             |   46 -
 openair2/RRC/CELLULAR/rrc_rb_ue_data.c        |  164 --
 openair2/RRC/CELLULAR/rrc_rb_ue_debug.c       | 1092 ---------
 openair2/RRC/CELLULAR/rrc_rg.c                | 2143 -----------------
 openair2/RRC/CELLULAR/rrc_rg.h                |   36 -
 openair2/RRC/CELLULAR/rrc_rg_L2_frontend.c    |  883 -------
 openair2/RRC/CELLULAR/rrc_rg_L2_interface.c   |  429 ----
 .../RRC/CELLULAR/rrc_rg_L2_intf_variables.h   |   65 -
 openair2/RRC/CELLULAR/rrc_rg_bch_init.c       |  542 -----
 openair2/RRC/CELLULAR/rrc_rg_bch_variables.h  |   69 -
 openair2/RRC/CELLULAR/rrc_rg_bch_write.c      |  445 ----
 openair2/RRC/CELLULAR/rrc_rg_control.c        |  342 ---
 openair2/RRC/CELLULAR/rrc_rg_data.c           |  455 ----
 openair2/RRC/CELLULAR/rrc_rg_dummies.c        |  118 -
 openair2/RRC/CELLULAR/rrc_rg_entity.h         |  115 -
 openair2/RRC/CELLULAR/rrc_rg_esterfsm.c       |  165 --
 openair2/RRC/CELLULAR/rrc_rg_init.c           |  141 --
 openair2/RRC/CELLULAR/rrc_rg_main.c           |  169 --
 openair2/RRC/CELLULAR/rrc_rg_mbms_encode.c    |  375 ---
 openair2/RRC/CELLULAR/rrc_rg_mbms_nas_if.c    |  161 --
 openair2/RRC/CELLULAR/rrc_rg_mbms_outputs.c   |  278 ---
 openair2/RRC/CELLULAR/rrc_rg_mbms_process.c   |  793 ------
 openair2/RRC/CELLULAR/rrc_rg_mbms_variables.h |  149 --
 openair2/RRC/CELLULAR/rrc_rg_msg_decode.c     |  693 ------
 openair2/RRC/CELLULAR/rrc_rg_msg_peer.c       |  631 -----
 openair2/RRC/CELLULAR/rrc_rg_nas_intf.c       |  406 ----
 openair2/RRC/CELLULAR/rrc_rg_outputs.c        |  441 ----
 openair2/RRC/CELLULAR/rrc_rg_process.c        |  362 ---
 openair2/RRC/CELLULAR/rrc_rg_rrm_decode.c     |  526 ----
 openair2/RRC/CELLULAR/rrc_rg_rrm_outputs.c    |  560 -----
 openair2/RRC/CELLULAR/rrc_rg_rrm_process.c    |  152 --
 openair2/RRC/CELLULAR/rrc_rg_rrm_variables.h  |   37 -
 openair2/RRC/CELLULAR/rrc_rg_srb_bch.c        |  162 --
 openair2/RRC/CELLULAR/rrc_rg_variables.h      |  184 --
 openair2/RRC/CELLULAR/rrc_rg_vars.h           |   33 -
 openair2/RRC/CELLULAR/rrc_rg_vars_extern.h    |   22 -
 openair2/RRC/CELLULAR/rrc_rrm_primitives.h    |  361 ---
 openair2/RRC/CELLULAR/rrc_rrm_sap.h           |   26 -
 openair2/RRC/CELLULAR/rrc_ue.c                | 1475 ------------
 openair2/RRC/CELLULAR/rrc_ue.h                |   38 -
 openair2/RRC/CELLULAR/rrc_ue_L2_frontend.c    |  753 ------
 openair2/RRC/CELLULAR/rrc_ue_L2_interface.c   |  390 ---
 .../RRC/CELLULAR/rrc_ue_L2_intf_variables.h   |   65 -
 openair2/RRC/CELLULAR/rrc_ue_bch_process.c    |  319 ---
 openair2/RRC/CELLULAR/rrc_ue_bch_read.c       |  390 ---
 openair2/RRC/CELLULAR/rrc_ue_bch_variables.h  |   74 -
 openair2/RRC/CELLULAR/rrc_ue_control.c        |  379 ---
 openair2/RRC/CELLULAR/rrc_ue_data.c           |  240 --
 openair2/RRC/CELLULAR/rrc_ue_dummies.c        |   33 -
 openair2/RRC/CELLULAR/rrc_ue_entity.h         |  134 --
 openair2/RRC/CELLULAR/rrc_ue_esterfsm.c       |  130 -
 openair2/RRC/CELLULAR/rrc_ue_init.c           |  182 --
 openair2/RRC/CELLULAR/rrc_ue_main.c           |  144 --
 openair2/RRC/CELLULAR/rrc_ue_mbms_decode.c    |  344 ---
 openair2/RRC/CELLULAR/rrc_ue_mbms_fsm.c       |  316 ---
 openair2/RRC/CELLULAR/rrc_ue_mbms_outputs.c   |  534 ----
 openair2/RRC/CELLULAR/rrc_ue_mbms_process.c   |  208 --
 openair2/RRC/CELLULAR/rrc_ue_mbms_variables.h |  113 -
 openair2/RRC/CELLULAR/rrc_ue_msg_decode.c     |  339 ---
 openair2/RRC/CELLULAR/rrc_ue_msg_peer.c       |  687 ------
 openair2/RRC/CELLULAR/rrc_ue_nas_intf.c       |  326 ---
 openair2/RRC/CELLULAR/rrc_ue_outputs.c        |  665 -----
 openair2/RRC/CELLULAR/rrc_ue_process.c        |  283 ---
 openair2/RRC/CELLULAR/rrc_ue_srb_bch.c        |  202 --
 openair2/RRC/CELLULAR/rrc_ue_variables.h      |  107 -
 openair2/RRC/CELLULAR/rrc_ue_vars.h           |   36 -
 openair2/RRC/CELLULAR/rrc_ue_vars_extern.h    |   23 -
 openair2/RRC/CELLULAR/rrc_util_config.c       |  487 ----
 openair2/RRC/CELLULAR/rrc_utilities.c         |  457 ----
 106 files changed, 34214 deletions(-)
 delete mode 100755 openair2/RRC/CELLULAR/Makefile
 delete mode 100644 openair2/RRC/CELLULAR/Makefile.inc
 delete mode 100644 openair2/RRC/CELLULAR/Readme.txt
 delete mode 100755 openair2/RRC/CELLULAR/as_configuration.h
 delete mode 100755 openair2/RRC/CELLULAR/esterel_header.txt
 delete mode 100755 openair2/RRC/CELLULAR/rrc_L2_proto.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_bch_constant.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_bch_ies.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_bch_ies.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_bch_mib.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_bch_mib.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_bch_per_basic.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_bch_per_basic.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_constant.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_mbms_constant.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_mbms_ies.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_mbms_pdus.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_mbms_pdus.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_messages.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_msg_class.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_msg_constant.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_msg_ies.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_msg_pdus.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_msg_pdus.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_nas_primitives.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_nas_sap.h
 delete mode 100644 openair2/RRC/CELLULAR/rrc_platform_types.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_proto_bch.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_proto_fsm.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_proto_int.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_proto_intf.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_proto_mbms.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_proto_msg.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_proto_rrm.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_qos_classes.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_qos_definitions.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rb_ue.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rb_ue.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rb_ue_data.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rb_ue_debug.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rg.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rg.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rg_L2_frontend.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rg_L2_interface.c
 delete mode 100644 openair2/RRC/CELLULAR/rrc_rg_L2_intf_variables.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rg_bch_init.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rg_bch_variables.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rg_bch_write.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rg_control.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rg_data.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rg_dummies.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rg_entity.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rg_esterfsm.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rg_init.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rg_main.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rg_mbms_encode.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rg_mbms_nas_if.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rg_mbms_outputs.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rg_mbms_process.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rg_mbms_variables.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rg_msg_decode.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rg_msg_peer.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rg_nas_intf.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rg_outputs.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rg_process.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rg_rrm_decode.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rg_rrm_outputs.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rg_rrm_process.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rg_rrm_variables.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rg_srb_bch.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rg_variables.h
 delete mode 100644 openair2/RRC/CELLULAR/rrc_rg_vars.h
 delete mode 100644 openair2/RRC/CELLULAR/rrc_rg_vars_extern.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rrm_primitives.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_rrm_sap.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_ue.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_ue.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_ue_L2_frontend.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_ue_L2_interface.c
 delete mode 100644 openair2/RRC/CELLULAR/rrc_ue_L2_intf_variables.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_ue_bch_process.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_ue_bch_read.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_ue_bch_variables.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_ue_control.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_ue_data.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_ue_dummies.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_ue_entity.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_ue_esterfsm.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_ue_init.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_ue_main.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_ue_mbms_decode.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_ue_mbms_fsm.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_ue_mbms_outputs.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_ue_mbms_process.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_ue_mbms_variables.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_ue_msg_decode.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_ue_msg_peer.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_ue_nas_intf.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_ue_outputs.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_ue_process.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_ue_srb_bch.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_ue_variables.h
 delete mode 100644 openair2/RRC/CELLULAR/rrc_ue_vars.h
 delete mode 100644 openair2/RRC/CELLULAR/rrc_ue_vars_extern.h
 delete mode 100755 openair2/RRC/CELLULAR/rrc_util_config.c
 delete mode 100755 openair2/RRC/CELLULAR/rrc_utilities.c

diff --git a/openair2/RRC/CELLULAR/Makefile b/openair2/RRC/CELLULAR/Makefile
deleted file mode 100755
index 7639953c08..0000000000
--- a/openair2/RRC/CELLULAR/Makefile
+++ /dev/null
@@ -1,64 +0,0 @@
-include $(OPENAIR_DIR)/common/utils/Makefile.inc
-
-KERNEL_MAIN_TYPE=$(shell echo `uname -r | cut -d. -f-2  | tr "." "_"`)
-export KERNEL_MAIN_TYPE
-
-
-ifdef RTAI
-# Get the RTAI variables
-CCC = $(shell rtai-config --cc)
-RTAI_SUBVERSION=$(shell rtai-config --version | sed -e 's/^..\(.\).*$$/\1/')
-IS_RTAI_SUBVERSION_LESS_THAN_FIVE=$(shell if [ $(RTAI_SUBVERSION) -lt 5 ] ; then echo true ; fi)
-CFLAGS += $(shell rtai-config --module-cflags) -DRTAI_ENABLED -DPC_TARGET -D__KERNEL__ -DMODULE -D_LOOSE_KERNEL_NAMES -I$(KERNEL_DIR)/build/include -I$(KERNEL_DIR)/build/include/asm/mach-default  $(if $(IS_RTAI_SUBVERSION_LESS_THAN_FIVE),-DRTAI_ISNT_POSIX,)
-endif
-CCC=gcc
-#--------------------------------------------------------
-AS_RLC_UM_DIR                 =../rlc/um_v6.1.0_lite
-AS_RLC_AM_DIR                 =../rlc/am
-AS_RLC_TM_DIR                 =../rlc/tm
-AS_RLC_DIR                    =../rlc
-AS_PDCP_DIR                   =../pdcp
-AS_MPLS_DIR                   =../mpls
-AS_MEM_DIR                    =../util/mem
-AS_LIST_DIR                   =../util/lists
-AS_MATH_DIR                   =../util/math
-AS_TIMER_DIR                  =../util/timer
-AS_RRM_CONFIG_DIR             =../rrm_config
-
-export AS_RLC_UM_DIR
-export AS_RLC_AM_DIR
-export AS_RLC_TM_DIR
-export AS_RLC_DIR
-export AS_PDCP_DIR
-export AS_MPLS_DIR
-export AS_MEM_DIR
-export AS_LIST_DIR
-export AS_MATH_DIR
-export AS_TIMER_DIR
-export AS_RRM_CONFIG_DIR
-
-ifdef MASTER
-CFLAGS += -DNODE_RG
-else
-CFLAGS += -DNODE_MT
-endif
-
-EXTRA_CFLAGS +=   -DKERNEL$(KERNEL_MAIN_TYPE)  -DCELLULAR -DMAX_MODULES=1 -DBIGPHYSAREA -DNB_ANTENNAS=2 
-
-EXTRA_CFLAGS += -Wall -Wstrict-prototypes -fno-common -fno-strict-aliasing -pipe -freg-struct-return -ffreestanding -maccumulate-outgoing-args -funroll-loops -march=i686 -mmmx -msse -msse2 -fomit-frame-pointer -nostdinc -DMODULE  -D_LOOSE_KERNEL_NAMES -O2
-
-CFLAGS += -I$(obj)/$(AS_RRM_CONFIG_DIR) -I$(obj)/$(AS_TIMER_DIR) -I$(obj)/$(AS_MATH_DIR) -I$(obj)/$(AS_LIST_DIR) -I$(obj)/$(AS_MEM_DIR) -I$(obj)/$(AS_RLC_DIR) -I$(obj)/$(AS_RLC_UM_DIR) -I$(obj)/$(AS_RLC_TM_DIR) -I$(obj)/$(AS_RLC_AM_DIR) -I$(obj)/$(AS_PDCP_DIR) -I$(obj)/$(AS_MPLS_DIR) -I $(M)/include  -I$(M)/../include -I$(M)/../../../include -I$(M)/../../../phy/ofdm_phy/phy_coding -I$(M)/../../../phy/ofdm_phy -I $(M)/../../../phy/ofdm_phy/phy_init -I $(M)/../../../mac -I $(M)/../../../phy/phy_mac_interface -I $(M)/../../../sched   -I$(obj)/../../../arch/common -I$(obj)/../../../util/misc -I$(obj)/../../../arch/openair_CardBus_MIMO1/device_driver -I$(obj)/../../../arch/openair_CardBus_MIMO1/LEON3/hostpc -I$(obj)/../opeanir_rrc_L2_interface
-
-obj-m += openair_rrc.o
-
-openair_rrc-objs += ../openair_rrc_L2_interface/openair_rrc_L2_interface.o 
-
-
-
-
-
-
-
-
-
-
diff --git a/openair2/RRC/CELLULAR/Makefile.inc b/openair2/RRC/CELLULAR/Makefile.inc
deleted file mode 100644
index 6ffbf2c1db..0000000000
--- a/openair2/RRC/CELLULAR/Makefile.inc
+++ /dev/null
@@ -1,41 +0,0 @@
-ifdef eNB_flag
-EXTRA_CFLAGS += -DNODE_RG -DCELLULAR
-endif
-
-ifdef UE_flag
-EXTRA_CFLAGS += -DNODE_MT -DCELLULAR
-endif
-
-
-RRC_CELLULAR_OBJS = $(RRC_CELL_DIR)/rrc_utilities.o 
-RRC_CELLULAR_OBJS += $(RRC_CELL_DIR)/rrc_bch_per_basic.o $(RRC_CELL_DIR)/rrc_bch_ies.o $(RRC_CELL_DIR)/rrc_bch_mib.o
-RRC_CELLULAR_OBJS += $(RRC_CELL_DIR)/rrc_msg_pdus.o $(RRC_CELL_DIR)/rrc_mbms_pdus.o
-
-ifdef eNB_flag
-RRC_CELLULAR_OBJS += $(RRC_CELL_DIR)/rrc_rg_init.o  $(RRC_CELL_DIR)/rrc_rg_main.o $(RRC_CELL_DIR)/rrc_rg_srb_bch.o
-RRC_CELLULAR_OBJS += $(RRC_CELL_DIR)/rrc_rg_dummies.o $(RRC_CELL_DIR)/rrc_rg_L2_interface.o $(RRC_CELL_DIR)/rrc_rg_L2_frontend.o
-RRC_CELLULAR_OBJS += $(RRC_CELL_DIR)/rrc_rg_bch_init.o $(RRC_CELL_DIR)/rrc_rg_bch_write.o
-RRC_CELLULAR_OBJS += $(RRC_CELL_DIR)/rrc_rg_nas_intf.o $(RRC_CELL_DIR)/rrc_rg_msg_decode.o $(RRC_CELL_DIR)/rrc_rg_outputs.o
-RRC_CELLULAR_OBJS += $(RRC_CELL_DIR)/rrc_rg.o $(RRC_CELL_DIR)/rrc_rg_esterfsm.o $(RRC_CELL_DIR)/rrc_rg_data.o
-RRC_CELLULAR_OBJS += $(RRC_CELL_DIR)/rrc_rg_process.o $(RRC_CELL_DIR)/rrc_rg_control.o $(RRC_CELL_DIR)/rrc_rg_msg_peer.o
-RRC_CELLULAR_OBJS += $(RRC_CELL_DIR)/rrc_rg_mbms_encode.o $(RRC_CELL_DIR)/rrc_rg_mbms_nas_if.o 
-RRC_CELLULAR_OBJS += $(RRC_CELL_DIR)/rrc_rg_mbms_outputs.o $(RRC_CELL_DIR)/rrc_rg_mbms_process.o 
-RRC_CELLULAR_OBJS += $(RRC_CELL_DIR)/rrc_rg_rrm_process.o $(RRC_CELL_DIR)/rrc_rg_rrm_decode.o $(RRC_CELL_DIR)/rrc_rg_rrm_outputs.o
-endif
-
-ifdef UE_flag
-RRC_CELLULAR_OBJS += $(RRC_CELL_DIR)/rrc_ue_init.o  $(RRC_CELL_DIR)/rrc_ue_main.o $(RRC_CELL_DIR)/rrc_ue_srb_bch.o
-RRC_CELLULAR_OBJS += $(RRC_CELL_DIR)/rrc_ue_dummies.o $(RRC_CELL_DIR)/rrc_ue_L2_interface.o $(RRC_CELL_DIR)/rrc_ue_L2_frontend.o
-RRC_CELLULAR_OBJS += $(RRC_CELL_DIR)/rrc_ue_bch_read.o $(RRC_CELL_DIR)/rrc_ue_bch_process.o
-RRC_CELLULAR_OBJS += $(RRC_CELL_DIR)/rrc_ue_nas_intf.o $(RRC_CELL_DIR)/rrc_ue_msg_decode.o $(RRC_CELL_DIR)/rrc_ue_outputs.o
-RRC_CELLULAR_OBJS += $(RRC_CELL_DIR)/rrc_rb_ue.o $(RRC_CELL_DIR)/rrc_rb_ue_data.o
-RRC_CELLULAR_OBJS += $(RRC_CELL_DIR)/rrc_ue.o  $(RRC_CELL_DIR)/rrc_ue_data.o $(RRC_CELL_DIR)/rrc_ue_control.o
-RRC_CELLULAR_OBJS += $(RRC_CELL_DIR)/rrc_ue_esterfsm.o $(RRC_CELL_DIR)/rrc_ue_process.o  $(RRC_CELL_DIR)/rrc_ue_msg_peer.o
-RRC_CELLULAR_OBJS += $(RRC_CELL_DIR)/rrc_ue_mbms_decode.o $(RRC_CELL_DIR)/rrc_ue_mbms_fsm.o
-RRC_CELLULAR_OBJS += $(RRC_CELL_DIR)/rrc_ue_mbms_outputs.o $(RRC_CELL_DIR)/rrc_ue_mbms_process.o
-endif
-
-rrc_test:
-	@echo RRC makefile is in
-	@echo RRC cellular variable $(rrc_cellular)
-	@echo $(L2_incl)
\ No newline at end of file
diff --git a/openair2/RRC/CELLULAR/Readme.txt b/openair2/RRC/CELLULAR/Readme.txt
deleted file mode 100644
index c12a368e52..0000000000
--- a/openair2/RRC/CELLULAR/Readme.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Status of openair2 RRC CELLULAR
-
-updated April 18, 2013
-
-
-This Readme is empty. This is still work under progress
\ No newline at end of file
diff --git a/openair2/RRC/CELLULAR/as_configuration.h b/openair2/RRC/CELLULAR/as_configuration.h
deleted file mode 100755
index 8616306969..0000000000
--- a/openair2/RRC/CELLULAR/as_configuration.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/***************************************************************************
-                          as_configuration.h  -  description
-                             -------------------
-    copyright            : (C) 2003, 2010 by Eurecom
-    contact              : www.eurecom.fr
- **************************************************************************
-  Insert the User equipement IMEI
- ***************************************************************************/
-#ifndef __AS_CONFIG_H__
-#    define __AS_CONFIG_H__
-
-#    define IMEI_D0 3
-#    define IMEI_D1 5
-#    define IMEI_D2 6
-#    define IMEI_D3 0
-#    define IMEI_D4 0
-#    define IMEI_D5 0
-#    define IMEI_D6 8
-#    define IMEI_D7 0
-#    define IMEI_D8 1
-#    define IMEI_D9 4
-#    define IMEI_D10 9
-#    define IMEI_D11 1
-#    define IMEI_D12 5
-#    ifdef MOBILE0
-#        define IMEI_D13 0
-#    endif
-#    ifdef MOBILE1
-#        define IMEI_D13 1
-#    endif
-#endif
diff --git a/openair2/RRC/CELLULAR/esterel_header.txt b/openair2/RRC/CELLULAR/esterel_header.txt
deleted file mode 100755
index d5d2be1ca6..0000000000
--- a/openair2/RRC/CELLULAR/esterel_header.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-/***************************************************************************
-                            rrc_ue.c
-                           -------------------
-    begin                : Nov 10, 2001
-    copyright            : (C) 2001 by Eurecom
-    author               : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  This file contains the code generated by the Esterel engine
-
-  IT MUST NOT BE MODIFIED MANUALLY
- ***************************************************************************/
-#ifndef USER_MODE
-#define __NO_VERSION__
-#include <rtl.h>
-#include <time.h>
-#include <rtl_sched.h>
-#include <rtl_sync.h>
-#include <pthread.h>
-#include <rtl_debug.h>
-#include <rtl_core.h>
-#include <rtl_fifo.h>
-#else
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_L2_proto.h b/openair2/RRC/CELLULAR/rrc_L2_proto.h
deleted file mode 100755
index 5985919c7a..0000000000
--- a/openair2/RRC/CELLULAR/rrc_L2_proto.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/***************************************************************************
-                          rrc_L2_proto.h  -  description
-                             -------------------
-    begin                : Sept 9, 2008
-    copyright            : (C) 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Prototypes related to L2 interface functions
- ***************************************************************************/
-#ifndef __RRC_L2_PROTO_H__
-#define __RRC_L2_PROTO_H__
-
-// rrc_L2_interfaces.c
-s8 rrc_L2_data_req_rx (unsigned char Mod_id, unsigned short Srb_id, unsigned char Nb_tb,char *Buffer,u8 CH_index);
-//void rrc_L2_mac_data_ind_rx (void);
-// s8 mac_rrc_data_ind(u8 Mod_id, u32 frame, u16 Srb_id, s8 *Sdu,u16 Sdu_len,u8 eNB_flag, u8 eNB_index );
-s8 rrc_L2_mac_data_ind_rx (u8 Mod_id, u16 Srb_id, char *Sdu, u16 Sdu_len, u8 eNB_index);
-
-
-void rrc_L2_rlc_data_ind_rx (unsigned char Mod_id, unsigned int Srb_id, unsigned int Sdu_size, unsigned char *Buffer);
-void rrc_L2_mac_meas_ind_rx (void);
-void rrc_L2_def_meas_ind_rx (unsigned char Mod_id, unsigned char Idx2);
-void rrc_L2_sync_ind_rx (u8 Mod_id);
-void rrc_L2_out_sync_ind_rx (void);
-
-void rrc_init_mac_config(void);
-
-int rrc_L2_get_rrc_status(u8 Mod_id,u8 eNB_flag,u8 index);
-char rrc_L2_ue_init(u8 Mod_id, unsigned char eNB_index);
-char rrc_L2_eNB_init(u8 Mod_id);
-
-//void openair_rrc_lite_top_init(void);
-
-
-
-
-#ifdef NODE_MT
-//rrc_ue_init.c
-void rrc_ue_init (u8 Mod_id);
-char rrc_ue_rglite_init(u8 Mod_id, unsigned char eNB_index);
-
-//rrc_ue_main.c
-//void rrc_ue_main_scheduler (u8 Mod_id);
-int rrc_ue_main_scheduler(u8 Mod_id,u32 frame, u8 eNB_flag,u8 index);
-#endif
-
-
-#ifdef NODE_RG
-//rrc_rg_init.c
-void rrc_rg_init (u8 Mod_id);
-char rrc_rg_uelite_init(u8 Mod_id, unsigned char eNB_index);
-
-//rrc_rg_main.c
-//void rrc_rg_main_scheduler (u8 Mod_id);
-int rrc_rg_main_scheduler(u8 Mod_id,u32 frame, u8 eNB_flag,u8 index);
-#endif
-
-#endif
-
diff --git a/openair2/RRC/CELLULAR/rrc_bch_constant.h b/openair2/RRC/CELLULAR/rrc_bch_constant.h
deleted file mode 100755
index 8c619c6d46..0000000000
--- a/openair2/RRC/CELLULAR/rrc_bch_constant.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/***************************************************************************
-                          rrc_bch_constant.h  -  description
-                             -------------------
-    copyright            : (C) 2002, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Define structures for Broadcast MIB and SIBs
- ***************************************************************************/
-#ifndef __RRC_BCH_CONSTANT_H__
-#define __RRC_BCH_CONSTANT_H__
-
-#include "rrc_bch_per_basic.h"
-
-#define maxBlock 210
-typedef char    ENCODEDBLOCK[maxBlock];
-#define maxSI 30            // (262-16)bits/8 = 30.75
-typedef char    ENCODEDSI[maxSI];
-#define LSIBfixed 24        //= 30-4-2 * spec=28 when PER unaligned
-#define LSIBcompl 25        //= 30-4-1 * spec=29 when PER unaligned
-
-#define supportedSIBs 6     //with value_tags [SIBs 1,2,5,11,18] - 14 is time-out
-
-#define maxSIB1NAS 200      // max num of bytes for NAS data in SIB 1
-#define maxSIBNAS 110       // max num of bytes for NAS data in SIB 18
-
-
-typedef struct {                /* PER control block         */
-  ENCODEDBLOCK   *buffer;       /* start of data buffer               */
-  int             buff_index;   /* index for next data                */
-  int             buff_size;    /* size of data in the encoded buffer */
-  int             bitoffset;    /* for PER unaligned - FFS            */
-  ENCODEDBLOCK   *data;         /* start of encoded data              */
-  int             data_size;    /* size of encoded data               */
-  int             data_offset;  /* in bytes - PER unaligned is FFS    */
-  int             errInfo;      /* error info                         */
-} PERParms;
-
-#define NO_BLOCK  0xFF
-
-// Default broadcast scheduling
-/*
-  Rules : Repetition must be a constant as defined below
-          0 <= position <= 2 pow sib_rep -1
-  eg : sib_rep = 4096, position<= 2047
-  Current definition  MIB: Rep32, pos 0
-  Long SIBs (>5segments) Rep128, pos 7 [9 segments available]: SIB1, SIB5, SIB18
-  Short SIBs (<=5 segments) Rep64, pos 3 [5 segments available]: SIB2, SIB11?, SIB14?
-*/
-#define LONG_SIB_POS 7
-#define SHORT_SIB_POS 2
-
-#define MIB_REP  SchedulingInformation_scheduling_rep32
-#define MIB_POS  0
-#define SIB1_REP  SchedulingInformation_scheduling_rep64    //128
-#define SIB1_POS  LONG_SIB_POS
-//#define SIB2_REP  SchedulingInformation_scheduling_rep64
-//#define SIB2_POS  SHORT_SIB_POS
-#define SIB2_REP  SchedulingInformation_scheduling_norep
-#define SIB2_POS  0
-#define SIB5_REP  SchedulingInformation_scheduling_rep64    //128
-#define SIB5_POS  LONG_SIB_POS + 16 //=(64/2)/2 +7
-#define SIB11_REP  SchedulingInformation_scheduling_norep
-#define SIB11_POS  0
-#define SIB14_REP  SchedulingInformation_scheduling_rep64
-#define SIB14_POS  SHORT_SIB_POS + 2
-#define SIB14_TFACTOR 7
-#define SIB18_REP  SchedulingInformation_scheduling_rep64
-#define SIB18_POS  SHORT_SIB_POS + 16
-
-
-//Temp
-#define maxSIBperMsg 16
-//#define P_SUCCESS       0
-//#define P_MISCLERROR    1
-//#define P_OUTOFBOUNDS   2
-//#define P_INVDIGIT      3
-
-/* Segment Combination Types */
-#define  BCH_noSegment 1
-#define  BCH_firstSegment 2
-#define  BCH_subsequentSegment 3
-#define  BCH_lastSegmentShort 4
-#define  BCH_lastAndFirst 5
-#define  BCH_lastAndComplete 6
-#define  BCH_lastAndCompleteAndFirst 7
-#define  BCH_completeSIB_List 8
-#define  BCH_completeAndFirst 9
-#define  BCH_completeSIB 10
-#define  BCH_lastSegment 11
-
-/*  PLMN_Type    */
-#define PLMN_gsm_MAP             1
-#define PLMN_ansi_41             2
-#define PLMN_gsm_MAP_and_ANSI_41 3
-#define PLMN_MobyDick            4
-
-/* SIBSb tag constants */
-#define SIBSb_sysInfoType1 1
-#define SIBSb_sysInfoType2 2
-#define SIBSb_sysInfoType3 3
-#define SIBSb_sysInfoType4 4
-#define SIBSb_sysInfoType5 5
-#define SIBSb_sysInfoType6 6
-#define SIBSb_sysInfoType7 7
-#define SIBSb_sysInfoType8 8
-#define SIBSb_sysInfoType9 9
-#define SIBSb_sysInfoType10 10
-#define SIBSb_sysInfoType11 11
-#define SIBSb_sysInfoType12 12
-#define SIBSb_sysInfoType13 13
-#define SIBSb_sysInfoType13_1 14
-#define SIBSb_sysInfoType13_2 15
-#define SIBSb_sysInfoType13_3 16
-#define SIBSb_sysInfoType13_4 17
-#define SIBSb_sysInfoType14 18
-#define SIBSb_sysInfoType15 19
-#define SIBSb_sysInfoType16 20
-#define SIBSb_sysInfoType17 21
-#define SIBSb_sysInfoTypeSB1 22
-#define SIBSb_sysInfoTypeSB2 23
-#define SIBSb_sysInfoType15_1 24
-#define SIBSb_sysInfoType15_2 25
-#define SIBSb_sysInfoType15_3 26
-#define SIBSb_sysInfoType15_4 27
-#define SIBSb_sysInfoType18 28
-#define SIBSb_sysInfoType15_5 29
-
-/*  SchedulingInformation   Sib_Pos  */
-#define SchedulingInformation_scheduling_norep    0
-#define SchedulingInformation_scheduling_rep4     1
-#define SchedulingInformation_scheduling_rep8     2
-#define SchedulingInformation_scheduling_rep16    3
-#define SchedulingInformation_scheduling_rep32    4
-#define SchedulingInformation_scheduling_rep64    5
-#define SchedulingInformation_scheduling_rep128   6
-#define SchedulingInformation_scheduling_rep256   7
-#define SchedulingInformation_scheduling_rep512   8
-#define SchedulingInformation_scheduling_rep1024  9
-#define SchedulingInformation_scheduling_rep2048 10
-#define SchedulingInformation_scheduling_rep4096 11
-
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_bch_ies.c b/openair2/RRC/CELLULAR/rrc_bch_ies.c
deleted file mode 100755
index 95a962a241..0000000000
--- a/openair2/RRC/CELLULAR/rrc_bch_ies.c
+++ /dev/null
@@ -1,1252 +0,0 @@
-/***************************************************************************
-                          rrc_bch_ies.c  -  description
-                             -------------------
-    copyright            : (C) 2002, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Procedures to perform encoding/decoding of information elements used for broadcast
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#ifdef NODE_MT
-#include "rrc_ue_vars.h"
-#endif
-#ifdef NODE_RG
-#include "rrc_rg_vars.h"
-#endif
-#include "rrc_bch_mib.h"
-//#include "rrc_rg_bch_variables.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_bch.h"
-
-/**************************************************************/
-/*  MIB_ValueTag                                              */
-/**************************************************************/
-#ifdef NODE_RG
-int rrc_PEREnc_MIB_ValueTag (PERParms * pParms, MIB_ValueTag value)
-{
-  int status = P_SUCCESS;
-  status = rrc_PEREnc_ConstrInteger (pParms, value, 0, 7);
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-  //msg("[RRC_PER]encode MIB_ValueTag status %d \n",status);
-#endif
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int rrc_PERDec_MIB_ValueTag (PERParms * pParms, MIB_ValueTag * pvalue)
-{
-  int status = P_SUCCESS;
-  status = rrc_PERDec_ConstrInteger (pParms, pvalue, 0, 7);
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-  //msg("[RRC_PER]decode MIB_ValueTag status %d \n",status);
-#endif
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  SIB_Type                                                  */
-/**************************************************************/
-#ifdef NODE_RG
-int rrc_PEREnc_SIB_Type (PERParms * pParms, SIB_Type value)
-{
-  int status = P_SUCCESS;
-
-  status = rrc_PEREnc_ConsUnsigned (pParms, (unsigned int) value, 0, 31);
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int rrc_PERDec_SIB_Type (PERParms * pParms, SIB_Type * pvalue)
-{
-  int status = P_SUCCESS;
-  status = rrc_PERDec_ConsUnsigned (pParms, (unsigned int *) pvalue, 0, 31);
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  SegCount                                                  */
-/**************************************************************/
-#ifdef NODE_RG
-int rrc_PEREnc_SegCount (PERParms * pParms, SegCount value)
-{
-  int status = P_SUCCESS;
-
-  status = rrc_PEREnc_ConstrInteger (pParms, value, 1, 16);
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int rrc_PERDec_SegCount (PERParms * pParms, SegCount * pvalue)
-{
-  int status = P_SUCCESS;
-
-  status = rrc_PERDec_ConstrInteger (pParms, pvalue, 1, 16);
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  SegmentIndex                                              */
-/**************************************************************/
-#ifdef NODE_RG
-int rrc_PEREnc_SegmentIndex (PERParms * pParms, SegmentIndex value)
-{
-  int status = P_SUCCESS;
-
-  status = rrc_PEREnc_ConstrInteger (pParms, value, 1, 15);
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int rrc_PERDec_SegmentIndex (PERParms * pParms, SegmentIndex * pvalue)
-{
-  int status = P_SUCCESS;
-
-  status = rrc_PERDec_ConstrInteger (pParms, pvalue, 1, 15);
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  SIB_Data_fixed                                            */
-/**************************************************************/
-// size constraint lower= 222 upper= 222
-#ifdef NODE_RG
-int rrc_PEREnc_SIB_Data_fixed (PERParms * pParms, SIB_Data_fixed value)
-{
-  int status = P_SUCCESS;
-
-  // 1st step, encode with octets
-  int  length;
-
-  length = (pParms->data_size - pParms->data_offset >= LSIBfixed) ? LSIBfixed : pParms->data_size - pParms->data_offset;
-  status = rrc_PEREnc_OctetString (pParms, length, (char *) pParms->data);
-  //status = rrc_PEREnc_BitString (pParms, value.numbits, value.data);
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int rrc_PERDec_SIB_Data_fixed (PERParms * pParms, SIB_Data_fixed * pvalue)
-{
-  int status = P_SUCCESS;
-
-  //   status = rrc_PERDec_BitString (pParms,
-  //                        &pvalue->numbits,
-  //                        pvalue->data,
-  //                        sizeof(pvalue->data));
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  CompleteSIB_sib_Data_fixed                                */
-/**************************************************************/
-// size constraint lower= 226 upper= 226  -- 24*8=224
-#ifdef NODE_RG
-int rrc_PEREnc_CompleteSIB_sib_Data_fixed (PERParms * pParms, CompleteSIB_sib_Data_fixed value)
-{
-  // size constraint lower= 226 upper= 226  -- 24*8=224
-  int status = P_SUCCESS;
-  int  max = LSIBcompl;      //cf structure definition
-  int  length;
-  //
-  status = rrc_PEREnc_BitString (pParms, value.numbits, value.data);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  // add padding bits - 1st step = maxsize - length of segment.
-
-  length = max - rrc_get_per_length (pParms->data);
-  status = rrc_PEREnc_padding (pParms, length);
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int rrc_PERDec_CompleteSIB_sib_Data_fixed (PERParms * pParms, CompleteSIB_sib_Data_fixed * pvalue)
-{
-  int status = P_SUCCESS;
-
-  //   status = rrc_PERDec_BitString (pParms, &pvalue->numbits, pvalue->data, sizeof(pvalue->data));
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  SFN_Prime                                                 */
-/**************************************************************/
-#ifdef NODE_RG
-int rrc_PEREnc_SFN_Prime (PERParms * pParms, SFN_Prime value)
-{
-  int status = P_SUCCESS;
-
-  status = rrc_PEREnc_ConstrInteger (pParms, value, 0, 2047);
-  //if (status != P_SUCCESS) return status;
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int rrc_PERDec_SFN_Prime (PERParms * pParms, SFN_Prime * pvalue)
-{
-  int status = P_SUCCESS;
-  status = rrc_PERDec_ConstrInteger (pParms, pvalue, 0, 2047);
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  MCC                                                       */
-/**************************************************************/
-#ifdef NODE_RG
-int rrc_PEREnc_MCC (PERParms * pParms, RCELL_MCC * pvalue)
-{
-  //size constraints =  3, 3
-  int status = P_SUCCESS;
-  int  i;
-  /* encode length determinant */
-  status = rrc_PEREnc_Length (pParms, pvalue->numDigits);
-
-  if (status < 0)
-    return status;
-
-  /* encode elements */
-  for (i = 0; i < pvalue->numDigits; i++) {
-    status = rrc_PEREnc_Digit (pParms, pvalue->elem[i]);
-
-    if (status != P_SUCCESS)
-      return status;
-  }
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int rrc_PERDec_MCC (PERParms * pParms, RCELL_MCC * pvalue)
-{
-  //size constraints =  3, 3
-  int status = P_SUCCESS;
-  int  i;
-
-  /* decode length determinant */
-  status = rrc_PERDec_Length (pParms, &pvalue->numDigits);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* decode elements */
-  for (i = 0; i < pvalue->numDigits; i++) {
-    status = rrc_PERDec_Digit (pParms, &pvalue->elem[i]);
-
-    if (status != P_SUCCESS)
-      return status;
-  }
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  MNC                                                       */
-/**************************************************************/
-#ifdef NODE_RG
-int rrc_PEREnc_MNC (PERParms * pParms, MNC * pvalue)
-{
-  int status = P_SUCCESS;
-
-  status = rrc_PEREnc_ConsUnsigned (pParms, *pvalue, 1, 65000);
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int rrc_PERDec_MNC (PERParms * pParms, MNC * pvalue)
-{
-  int status = P_SUCCESS;
-
-  status = rrc_PERDec_ConsUnsigned (pParms, pvalue, 1, 65000);
-
-  return status;
-}
-#endif
-
-
-/**************************************************************/
-/*  PLMN_Identity                                             */
-/**************************************************************/
-#ifdef NODE_RG
-int rrc_PEREnc_PLMN_Identity (PERParms * pParms, RCELL_PLMN_Identity * pvalue)
-{
-  int status = P_SUCCESS;
-
-  /* encode mcc */
-  status = rrc_PEREnc_MCC (pParms, &pvalue->mcc);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* encode mnc */
-  status = rrc_PEREnc_MNC (pParms, &pvalue->mnc);
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int rrc_PERDec_PLMN_Identity (PERParms * pParms, RCELL_PLMN_Identity * pvalue)
-{
-  int status = P_SUCCESS;
-
-  /* decode mcc */
-  status = rrc_PERDec_MCC (pParms, &pvalue->mcc);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* decode mnc */
-  status = rrc_PERDec_MNC (pParms, &pvalue->mnc);
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  PLMN_ValueTag                                             */
-/**************************************************************/
-#ifdef NODE_RG
-int rrc_PEREnc_PLMN_ValueTag (PERParms * pParms, PLMN_ValueTag value)
-{
-  int status = P_SUCCESS;
-  status = rrc_PEREnc_ConstrInteger (pParms, value, 0, 255);
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int rrc_PERDec_PLMN_ValueTag (PERParms * pParms, PLMN_ValueTag * pvalue)
-{
-  int status = P_SUCCESS;
-  status = rrc_PERDec_ConstrInteger (pParms, pvalue, 0, 255);
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  CellValueTag                                              */
-/**************************************************************/
-#ifdef NODE_RG
-int rrc_PEREnc_CellValueTag (PERParms * pParms, CellValueTag value)
-{
-  int status = P_SUCCESS;
-  status = rrc_PEREnc_ConstrInteger (pParms, value, 0, 3);
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int rrc_PERDec_CellValueTag (PERParms * pParms, CellValueTag * pvalue)
-{
-  int status = P_SUCCESS;
-  status = rrc_PERDec_ConstrInteger (pParms, pvalue, 0, 3);
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  SIBSb_TypeAndTag                                          */
-/**************************************************************/
-#ifdef NODE_RG
-int rrc_PEREnc_SIBSb_TypeAndTag (PERParms * pParms, SIBSb_TypeAndTag * pvalue)
-{
-  int status = P_SUCCESS;
-
-  /* Encode choice index value */
-  status = rrc_PEREnc_ConsUnsigned (pParms, pvalue->type - 1, 0, 31);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* Encode root element data value */
-  switch (pvalue->type) {
-    /* sysInfoType1 */
-  case 1:
-    status = rrc_PEREnc_PLMN_ValueTag (pParms, pvalue->type_tag.sysInfoType1);
-
-    if (status != P_SUCCESS)
-      return status;
-
-    break;
-
-    /* sysInfoType2 */
-  case 2:
-    status = rrc_PEREnc_CellValueTag (pParms, pvalue->type_tag.sysInfoType2);
-
-    if (status != P_SUCCESS)
-      return status;
-
-    break;
-
-    /* sysInfoType5 */
-  case 5:
-    status = rrc_PEREnc_CellValueTag (pParms, pvalue->type_tag.sysInfoType5);
-
-    if (status != P_SUCCESS)
-      return status;
-
-    break;
-
-    /* sysInfoType11 */
-  case 11:
-    status = rrc_PEREnc_CellValueTag (pParms, pvalue->type_tag.sysInfoType11);
-
-    if (status != P_SUCCESS)
-      return status;
-
-    break;
-
-    /* sysInfoType14 */
-  case 18:
-    /* NULL */
-    break;
-
-    /* sysInfoType18 */
-  case 28:
-    status = rrc_PEREnc_CellValueTag (pParms, pvalue->type_tag.sysInfoType18);
-
-    if (status != P_SUCCESS)
-      return status;
-
-    break;
-
-  default:
-    return P_INVVALUE;
-  }
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int rrc_PERDec_SIBSb_TypeAndTag (PERParms * pParms, SIBSb_TypeAndTag * pvalue)
-{
-  int status = P_SUCCESS;
-  unsigned int    sib_type;
-
-  status = rrc_PERDec_ConsUnsigned (pParms, &sib_type, 0, 31);
-  //if (status != P_SUCCESS) return status;
-  //else
-  pvalue->type = sib_type + 1;
-
-  switch (sib_type) {
-    /* sysInfoType1 */
-  case 0:
-    status = rrc_PERDec_PLMN_ValueTag (pParms, &pvalue->type_tag.sysInfoType1);
-
-    if (status != P_SUCCESS)
-      return status;
-
-    break;
-
-    /* sysInfoType2 */
-  case 1:
-    status = rrc_PERDec_CellValueTag (pParms, &pvalue->type_tag.sysInfoType2);
-
-    if (status != P_SUCCESS)
-      return status;
-
-    break;
-
-    /* sysInfoType5 */
-  case 4:
-    status = rrc_PERDec_CellValueTag (pParms, &pvalue->type_tag.sysInfoType5);
-
-    if (status != P_SUCCESS)
-      return status;
-
-    break;
-
-    /* sysInfoType11 */
-  case 10:
-    status = rrc_PERDec_CellValueTag (pParms, &pvalue->type_tag.sysInfoType11);
-
-    if (status != P_SUCCESS)
-      return status;
-
-    break;
-
-    /* sysInfoType14 */
-  case 17:
-    /* NULL */
-    break;
-
-    /* sysInfoType18 */
-  case 27:
-    status = rrc_PERDec_CellValueTag (pParms, &pvalue->type_tag.sysInfoType18);
-
-    if (status != P_SUCCESS)
-      return status;
-
-    break;
-
-  default:
-    return P_INVVALUE;
-  }
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  Scheduling_sib_Pos                                        */
-/**************************************************************/
-#ifdef NODE_RG
-int rrc_PEREnc_Scheduling_sib_Pos (PERParms * pParms, Scheduling_sib_Pos * pvalue)
-{
-  int status = P_SUCCESS;
-  int  max_position; //3->4095
-
-  /* encode repetition period */
-  status = rrc_PEREnc_ConsUnsigned (pParms, pvalue->sib_Rep, 0, 11);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* encode position */
-  max_position = (2 << (pvalue->sib_Rep - 1)) - 1;
-  status = rrc_PEREnc_ConsUnsigned (pParms, pvalue->sib_Pos, 0, max_position);
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int rrc_PERDec_Scheduling_sib_Pos (PERParms * pParms, Scheduling_sib_Pos * pvalue)
-{
-  int status = P_SUCCESS;
-  int  max_position;
-
-  /* decode repetition period */
-  status = rrc_PERDec_ConsUnsigned (pParms, &pvalue->sib_Rep, 0, 11);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* decode position */
-  max_position = (2 << (pvalue->sib_Rep - 1)) - 1;
-  status = rrc_PERDec_ConsUnsigned (pParms, &pvalue->sib_Pos, 0, max_position);
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  SchedulingInformation                                     */
-/**************************************************************/
-#ifdef NODE_RG
-int rrc_PEREnc_SchedulingInformation (PERParms * pParms, SchedulingInformation * pvalue)
-{
-  int status = P_SUCCESS;
-
-  /* encode segCount */
-  status = rrc_PEREnc_SegCount (pParms, pvalue->segCount);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* encode sib_Pos */
-  status = rrc_PEREnc_Scheduling_sib_Pos (pParms, &pvalue->scheduling_sib_rep);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  //   /* encode sib_PosOffsetInfo */
-  //      status = rrc_PEREnc_SibOFF_List (pParms, &pvalue->sib_PosOffsetInfo);
-  //      if (status != P_SUCCESS) return status;
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int rrc_PERDec_SchedulingInformation (PERParms * pParms, SchedulingInformation * pvalue)
-{
-  int status = P_SUCCESS;
-
-  /* decode segCount */
-  status = rrc_PERDec_SegCount (pParms, &pvalue->segCount);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* decode sib_Pos */
-  status = rrc_PERDec_Scheduling_sib_Pos (pParms, &pvalue->scheduling_sib_rep);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  //   /* decode sib_PosOffsetInfo */
-  //      status = rrc_PERDec_SibOFF_List (pParms, &pvalue->sib_PosOffsetInfo);
-  //      if (status != P_SUCCESS) return status;
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  SchedulingInformationSIBSb                                */
-/**************************************************************/
-#ifdef NODE_RG
-int rrc_PEREnc_SchedulingInformationSIBSb (PERParms * pParms, SchedulingInformationSIBSb * pvalue)
-{
-  int status = P_SUCCESS;
-
-  /* encode sibSb_Type */
-  status = rrc_PEREnc_SIBSb_TypeAndTag (pParms, &pvalue->sibSb_Type);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* encode scheduling */
-  status = rrc_PEREnc_SchedulingInformation (pParms, &pvalue->scheduling);
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int rrc_PERDec_SchedulingInformationSIBSb (PERParms * pParms, SchedulingInformationSIBSb * pvalue)
-{
-  int status = P_SUCCESS;
-
-  /* decode sibSb_Type */
-  status = rrc_PERDec_SIBSb_TypeAndTag (pParms, &pvalue->sibSb_Type);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* decode scheduling */
-  status = rrc_PERDec_SchedulingInformation (pParms, &pvalue->scheduling);
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  SIBSb_ReferenceList                                       */
-/**************************************************************/
-//size constraints =  1, 32  --supportedSIBs
-#ifdef NODE_RG
-int
-rrc_PEREnc_SIBSb_ReferenceList (PERParms * pParms, SIBSb_ReferenceList * pvalue)
-{
-  int status = P_SUCCESS;
-  int  i;
-
-  /* encode length determinant */
-  status = rrc_PEREnc_Length (pParms, pvalue->numSIB);
-
-  if (status < 0)
-    return status;
-
-  /* encode elements */
-  for (i = 0; i < pvalue->numSIB; i++) {
-    if (protocol_bs->rrc.rg_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[i].scheduling.segCount > 0)
-      status = rrc_PEREnc_SchedulingInformationSIBSb (pParms, &pvalue->sib_ref[i]);
-
-    if (status != P_SUCCESS)
-      return status;
-  }
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int
-rrc_PERDec_SIBSb_ReferenceList (PERParms * pParms, SIBSb_ReferenceList * pvalue)
-{
-  int status = P_SUCCESS;
-  int  i;
-  int  sib_t;
-
-  /* decode length determinant */
-  status = rrc_PERDec_Length (pParms, &pvalue->numSIB);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* decode elements */
-  for (i = 0; i < pvalue->numSIB; i++) {
-    if (pParms->buff_size == 0)
-      break;                    // No more SIBs
-
-    sib_t = (int) *(((char *) pParms->buffer) + pParms->buff_index) + 1;
-
-    if (protocol_ms->rrc.ue_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[i].sibSb_Type.type == sib_t)
-      status = rrc_PERDec_SchedulingInformationSIBSb (pParms, &pvalue->sib_ref[i]);
-
-    if (status != P_SUCCESS)
-      return status;
-  }
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  NAS_SystemInformation                                     */
-/**************************************************************/
-//size constraints =  1, 8 -- maxSIB1NAS -- (200 04/2003)
-#ifdef NODE_RG
-int
-rrc_PEREnc_NAS_SystemInformation (PERParms * pParms, NAS_SystemInformation value)
-{
-  int status = P_SUCCESS;
-
-  if (value.numocts >= 0 && value.numocts <= maxSIB1NAS) {
-    status = rrc_PEREnc_VarOctetString (pParms, value.numocts, value.data);
-
-    if (status != P_SUCCESS)
-      return status;
-  } else {
-    status = P_OUTOFBOUNDS;
-  }
-
-  return status;
-}
-#endif
-
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int
-rrc_PERDec_NAS_SystemInformation (PERParms * pParms, NAS_SystemInformation * pvalue)
-{
-  int status = P_SUCCESS;
-
-  status = rrc_PERDec_VarOctetString (pParms, &pvalue->numocts, pvalue->data);
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  UE_TimersAndConstants                                     */
-/**************************************************************/
-//size constraints =  1, 5 --8
-#ifdef NODE_RG
-int
-rrc_PEREnc_UE_TimersAndConstants (PERParms * pParms, RCELL_UE_TimersAndConstants value)
-{
-  int status = P_SUCCESS;
-
-  if (value.numocts >= 0 && value.numocts <= 8) {
-    status = rrc_PEREnc_VarOctetString (pParms, value.numocts, value.data);
-
-    if (status != P_SUCCESS)
-      return status;
-  } else {
-    status = P_OUTOFBOUNDS;
-  }
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int
-rrc_PERDec_UE_TimersAndConstants (PERParms * pParms, RCELL_UE_TimersAndConstants * pvalue)
-{
-  int status = P_SUCCESS;
-
-  status = rrc_PERDec_VarOctetString (pParms, &pvalue->numocts, pvalue->data);
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  IP_Address                                             */
-/**************************************************************/
-//size = 16 octets
-#ifdef NODE_RG
-int
-rrc_PEREnc_IP_Address (PERParms * pParms, IP_Address * pvalue)
-{
-  int status = P_SUCCESS;
-
-  //status = rrc_PEREnc_BitString (pParms, value.numbits, value.data);
-  status = rrc_PEREnc_OctetString (pParms, 16, (char *) pvalue);
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int
-rrc_PERDec_IP_Address (PERParms * pParms, IP_Address * pvalue)
-{
-  int status = P_SUCCESS;
-  unsigned int    numBytes;
-
-  //status = rrc_PERDec_BitString (pParms,&pvalue->numbits,pvalue->data, sizeof(pvalue->data));
-  status = rrc_PERDec_OctetString (pParms, &numBytes, (char *) pvalue, 16);
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  PRACH_SCCPCH_SIList                                     */
-/**************************************************************/
-//size constraints =  1, 5 --100
-#ifdef NODE_RG
-int
-rrc_PEREnc_PRACH_SCCPCH_SIList (PERParms * pParms, PRACH_SCCPCH_SIList value)
-{
-  int status = P_SUCCESS;
-
-  if (value.numocts >= 0 && value.numocts <= (maxBlock - 8)) {
-    status = rrc_PEREnc_VarOctetString (pParms, value.numocts, value.data);
-
-    if (status != P_SUCCESS)
-      return status;
-  } else {
-    status = P_OUTOFBOUNDS;
-  }
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int
-rrc_PERDec_PRACH_SCCPCH_SIList (PERParms * pParms, PRACH_SCCPCH_SIList * pvalue)
-{
-  int status = P_SUCCESS;
-
-  status = rrc_PERDec_VarOctetString (pParms, &pvalue->numocts, pvalue->data);
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  PrimaryCCPCH_TX_Power                                     */
-/**************************************************************/
-#ifdef NODE_RG
-int
-rrc_PEREnc_PrimaryCCPCH_TX_Power (PERParms * pParms, PrimaryCCPCH_TX_Power value)
-{
-  int status = P_SUCCESS;
-
-  //  status = rrc_PEREnc_ConstrInteger(pParms, value, 6, 43); specs, but modified for indoor MW, DN april 05
-  status = rrc_PEREnc_ConstrInteger (pParms, value, 6, 43);
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int
-rrc_PERDec_PrimaryCCPCH_TX_Power (PERParms * pParms, PrimaryCCPCH_TX_Power * pvalue)
-{
-  int status = P_SUCCESS;
-
-  //status = rrc_PERDec_ConstrInteger(pParms, pvalue, 6, 43);  specs, but modified for indoor MW, DN april 05
-  status = rrc_PERDec_ConstrInteger (pParms, pvalue, 6, 43);
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  Alpha                                                     */
-/**************************************************************/
-#ifdef NODE_RG
-int
-rrc_PEREnc_Alpha (PERParms * pParms, Alpha value)
-{
-  int status = P_SUCCESS;
-
-  status = rrc_PEREnc_ConstrInteger (pParms, value, 0, 8);
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int
-rrc_PERDec_Alpha (PERParms * pParms, Alpha * pvalue)
-{
-  int status = P_SUCCESS;
-
-  status = rrc_PERDec_ConstrInteger (pParms, pvalue, 0, 8);
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  ConstantValueTdd                                          */
-/**************************************************************/
-#ifdef NODE_RG
-int
-rrc_PEREnc_ConstantValueTdd (PERParms * pParms, ConstantValueTdd value)
-{
-  int status = P_SUCCESS;
-
-  status = rrc_PEREnc_ConstrInteger (pParms, value, -35, 10);
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int
-rrc_PERDec_ConstantValueTdd (PERParms * pParms, ConstantValueTdd * pvalue)
-{
-  int status = P_SUCCESS;
-
-  status = rrc_PERDec_ConstrInteger (pParms, pvalue, -35, 10);
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  OpenLoopPowerControl_TDD                                  */
-/**************************************************************/
-#ifdef NODE_RG
-int
-rrc_PEREnc_OpenLoopPowerControl_TDD (PERParms * pParms, OpenLoopPowerControl_TDD * pvalue)
-{
-  int status = P_SUCCESS;
-
-  /* encode primaryCCPCH_TX_Power */
-  status = rrc_PEREnc_PrimaryCCPCH_TX_Power (pParms, pvalue->primaryCCPCH_TX_Power);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* encode alpha */
-  status = rrc_PEREnc_Alpha (pParms, pvalue->alpha);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* encode prach_ConstantValue */
-  status = rrc_PEREnc_ConstantValueTdd (pParms, pvalue->prach_ConstantValue);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* encode dpch_ConstantValue */
-  status = rrc_PEREnc_ConstantValueTdd (pParms, pvalue->dpch_ConstantValue);
-  //   if (status != P_SUCCESS) return status;
-  //
-  //   /* encode pusch_ConstantValue */
-  //   status = rrc_PEREnc_ConstantValueTdd (pParms, pvalue->pusch_ConstantValue);
-  //   if (status != P_SUCCESS) return status;
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int
-rrc_PERDec_OpenLoopPowerControl_TDD (PERParms * pParms, OpenLoopPowerControl_TDD * pvalue)
-{
-  int status = P_SUCCESS;
-
-  /* decode primaryCCPCH_TX_Power */
-  status = rrc_PERDec_PrimaryCCPCH_TX_Power (pParms, &pvalue->primaryCCPCH_TX_Power);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* decode alpha */
-  status = rrc_PERDec_Alpha (pParms, &pvalue->alpha);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* decode prach_ConstantValue */
-  status = rrc_PERDec_ConstantValueTdd (pParms, &pvalue->prach_ConstantValue);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* decode dpch_ConstantValue */
-  status = rrc_PERDec_ConstantValueTdd (pParms, &pvalue->dpch_ConstantValue);
-  //   if (status != P_SUCCESS) return status;
-  //
-  //   /* decode pusch_ConstantValue */
-  //   status = rrc_PERDec_ConstantValueTdd (pParms, &pvalue->pusch_ConstantValue);
-  //   if (status != P_SUCCESS) return status;
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  TimeslotNumber                                            */
-/**************************************************************/
-////  value >= 0 && value <= 14
-#ifdef NODE_RG
-int
-rrc_PEREnc_TimeslotNumber (PERParms * pParms, TimeslotNumber value)
-{
-  int status = P_SUCCESS;
-
-  status = rrc_PEREnc_ConsUnsigned (pParms, value, 0, 14);
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int
-rrc_PERDec_TimeslotNumber (PERParms * pParms, TimeslotNumber * pvalue)
-{
-  int status = P_SUCCESS;
-
-  status = rrc_PERDec_ConsUnsigned (pParms, (int *) pvalue, 0, 14);
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  TDD_UL_Interference                                       */
-/**************************************************************/
-//  value >= -110 && value <= -52
-#ifdef NODE_RG
-int
-rrc_PEREnc_TDD_UL_Interference (PERParms * pParms, TDD_UL_Interference value)
-{
-  int status = P_SUCCESS;
-
-  status = rrc_PEREnc_ConstrInteger (pParms, value, -110, -52);
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int
-rrc_PERDec_TDD_UL_Interference (PERParms * pParms, TDD_UL_Interference * pvalue)
-{
-  int status = P_SUCCESS;
-
-  status = rrc_PERDec_ConstrInteger (pParms, (int *) pvalue, -110, -52);
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  IndividualTS_Interference                                 */
-/**************************************************************/
-#ifdef NODE_RG
-int
-rrc_PEREnc_IndividualTS_Interference (PERParms * pParms, IndividualTS_Interference * pvalue)
-{
-  int status = P_SUCCESS;
-
-  /* encode timeslot */
-  status = rrc_PEREnc_TimeslotNumber (pParms, pvalue->timeslot);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* encode ul_TimeslotInterference */
-  status = rrc_PEREnc_TDD_UL_Interference (pParms, pvalue->ul_TimeslotInterference);
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int
-rrc_PERDec_IndividualTS_Interference (PERParms * pParms, IndividualTS_Interference * pvalue)
-{
-  int status = P_SUCCESS;
-
-  /* decode timeslot */
-  status = rrc_PERDec_TimeslotNumber (pParms, &pvalue->timeslot);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* decode ul_TimeslotInterference */
-  status = rrc_PERDec_TDD_UL_Interference (pParms, &pvalue->ul_TimeslotInterference);
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  IndividualTS_InterferenceList                             */
-/**************************************************************/
-#ifdef NODE_RG
-int
-rrc_PEREnc_IndividualTS_InterferenceList (PERParms * pParms, IndividualTS_InterferenceList * pvalue)
-{
-  // size constraint =  1, 15
-  int status = P_SUCCESS;
-  int  i;
-
-  /* encode length determinant */
-  status = rrc_PEREnc_Length (pParms, pvalue->numSlots);
-
-  if (status < 0)
-    return status;
-
-  /* encode valued data */
-  for (i = 0; i < pvalue->numSlots; i++) {
-    status = rrc_PEREnc_IndividualTS_Interference (pParms, &pvalue->data[i]);
-
-    if (status != P_SUCCESS)
-      return status;
-  }
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int
-rrc_PERDec_IndividualTS_InterferenceList (PERParms * pParms, IndividualTS_InterferenceList * pvalue)
-{
-  // size constraint =  1, 15
-  int status = P_SUCCESS;
-  int  i;
-
-  /* decode length determinant */
-  status = rrc_PERDec_Length (pParms, (int *) &pvalue->numSlots);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* decode valued data */
-  for (i = 0; i < pvalue->numSlots; i++) {
-    status = rrc_PERDec_IndividualTS_Interference (pParms, &pvalue->data[i]);
-
-    if (status != P_SUCCESS)
-      return status;
-  }
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  ExpirationTimeFactor                                      */
-/**************************************************************/
-#ifdef NODE_RG
-int
-rrc_PEREnc_ExpirationTimeFactor (PERParms * pParms, ExpirationTimeFactor value)
-{
-  int status = P_SUCCESS;
-
-  status = rrc_PEREnc_ConsUnsigned (pParms, value, 1, 8);
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int
-rrc_PERDec_ExpirationTimeFactor (PERParms * pParms, ExpirationTimeFactor * pvalue)
-{
-  int status = P_SUCCESS;
-
-  status = rrc_PERDec_ConsUnsigned (pParms, pvalue, 1, 8);
-
-  return status;
-}
-#endif
-
-
-/**************************************************************/
-/*  IdentitiesOfNeighbourCells                                */
-/**************************************************************/
-//size constraints =  1, 8 -- maxSIBNAS --
-#ifdef NODE_RG
-int
-rrc_PEREnc_IdentitiesOfNeighbourCells (PERParms * pParms, IdentitiesOfNeighbourCells value)
-{
-  int status = P_SUCCESS;
-
-  if (value.numocts >= 0 && value.numocts <= maxSIBNAS) {
-    status = rrc_PEREnc_VarOctetString (pParms, value.numocts, value.data);
-
-    if (status != P_SUCCESS)
-      return status;
-  } else {
-    status = P_OUTOFBOUNDS;
-  }
-
-  return status;
-}
-#endif
-
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int
-rrc_PERDec_IdentitiesOfNeighbourCells (PERParms * pParms, IdentitiesOfNeighbourCells * pvalue)
-{
-  int status = P_SUCCESS;
-
-  status = rrc_PERDec_VarOctetString (pParms, &pvalue->numocts, pvalue->data);
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  CodeGroupsOfNeighbourCells                                */
-/**************************************************************/
-//size = (maxCells) octets
-#ifdef NODE_RG
-int
-rrc_PEREnc_CodeGroupsOfNeighbourCells (PERParms * pParms, CodeGroupsOfNeighbourCells * pvalue)
-{
-  int status = P_SUCCESS;
-
-  //status = rrc_PEREnc_BitString (pParms, value.numbits, value.data);
-  status = rrc_PEREnc_OctetString (pParms, maxCells, (char *) pvalue);
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int
-rrc_PERDec_CodeGroupsOfNeighbourCells (PERParms * pParms, CodeGroupsOfNeighbourCells * pvalue)
-{
-  int status = P_SUCCESS;
-  unsigned int    numBytes;
-
-  //status = rrc_PERDec_BitString (pParms,&pvalue->numbits,pvalue->data, sizeof(pvalue->data));
-  status = rrc_PERDec_OctetString (pParms, &numBytes, (char *) pvalue, maxCells);
-  return status;
-}
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_bch_ies.h b/openair2/RRC/CELLULAR/rrc_bch_ies.h
deleted file mode 100755
index 06662a28b0..0000000000
--- a/openair2/RRC/CELLULAR/rrc_bch_ies.h
+++ /dev/null
@@ -1,279 +0,0 @@
-/***************************************************************************
-                          rrc_bch_ies.h  -  description
-                             -------------------
-    begin                : Aug 30, 2002
-    copyright            : (C) 2002, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Define structures for Broadcast MIB and SIBs
- ***************************************************************************/
-#ifndef __RRC_BCH_IES_H__
-#define __RRC_BCH_IES_H__
-
-#include "rrc_bch_constant.h"
-
-/*********************************************************************
- System Information for BCH - Information Elements
-*********************************************************************/
-//  SegCount
-typedef int     SegCount;
-
-//  SegmentIndex
-typedef int     SegmentIndex;
-
-//  SFN_Prime
-typedef int     SFN_Prime;
-
-//  SIB_Type
-typedef enum {
-  masterInformationBlock = 0,
-  systemInformationBlockType1 = 1,
-  systemInformationBlockType2 = 2,
-  systemInformationBlockType3 = 3,
-  systemInformationBlockType4 = 4,
-  systemInformationBlockType5 = 5,
-  systemInformationBlockType6 = 6,
-  systemInformationBlockType7 = 7,
-  systemInformationBlockType8 = 8,
-  systemInformationBlockType9 = 9,
-  systemInformationBlockType10 = 10,
-  systemInformationBlockType11 = 11,
-  systemInformationBlockType12 = 12,
-  systemInformationBlockType13 = 13,
-  systemInformationBlockType13_1 = 14,
-  systemInformationBlockType13_2 = 15,
-  systemInformationBlockType13_3 = 16,
-  systemInformationBlockType13_4 = 17,
-  systemInformationBlockType14 = 18,
-  systemInformationBlockType15 = 19,
-  systemInformationBlockType15_1 = 20,
-  systemInformationBlockType15_2 = 21,
-  systemInformationBlockType15_3 = 22,
-  systemInformationBlockType16 = 23,
-  systemInformationBlockType17 = 24,
-  systemInformationBlockType15_4 = 25,
-  systemInformationBlockType18 = 26,
-  schedulingBlock1 = 27,
-  schedulingBlock2 = 28,
-  systemInformationBlockType15_5 = 29
-} SIB_Type;
-
-//   SIB_Data_fixed
-typedef struct SIB_Data_fixed {
-  unsigned int    numbits;
-  unsigned char   data[LSIBfixed];
-} SIB_Data_fixed;
-
-//   SIB_Data_variable
-typedef struct SIB_Data_variable {
-  unsigned int    numbits;
-  unsigned char   data[27];
-} SIB_Data_variable;
-
-//   CompleteSIB_sib_Data_fixed
-typedef struct CompleteSIB_sib_Data_fixed {
-  unsigned int    numbits;
-  unsigned char   data[LSIBcompl];
-} CompleteSIB_sib_Data_fixed;
-
-/**************************************************************/
-/*  MasterInformationBlock   Information elements             */
-/**************************************************************/
-//   MIB_ValueTag
-typedef int     MIB_ValueTag;
-
-/**************************************************************/
-//   PLMN_Type
-/*  Digit   */
-//typedef int  Digit;  already defined
-
-/*  MCC   */
-typedef struct RCELL_MCC {
-  unsigned int    numDigits;
-  Digit           elem[3];
-} RCELL_MCC;
-
-/*  MNC  */
-//typedef struct MNC {
-//   unsigned int numDigits;
-//   Digit elem[3];
-//} MNC;
-typedef unsigned int MNC;
-
-/*  PLMN_Identity */
-typedef struct RCELL_PLMN_Identity {
-  RCELL_MCC       mcc;
-  MNC             mnc;
-} RCELL_PLMN_Identity;
-
-/**************************************************************/
-/*  PLMN_ValueTag     */
-typedef int     PLMN_ValueTag;
-
-/*  CellValueTag     */
-typedef int     CellValueTag;
-
-/*  SIBSb_TypeAndTag */
-typedef struct SIBSb_TypeAndTag {
-  int             type;
-  union {
-    /* t = 1 */
-    PLMN_ValueTag   sysInfoType1;
-    /* t = 2 */
-    CellValueTag    sysInfoType2;
-    /* t = 5 */
-    CellValueTag    sysInfoType5;
-    /* t = 11 */
-    CellValueTag    sysInfoType11;
-    /* t = 28 */
-    CellValueTag    sysInfoType18;
-  } type_tag;
-} SIBSb_TypeAndTag;
-
-/**************************************************************/
-/*  SegCount      */
-//typedef int  SegCount;  already defined
-
-/*  scheduling_sib_Pos  */
-typedef struct Scheduling_sib_Pos {
-  unsigned int    sib_Rep;
-  unsigned int    sib_Pos;
-} Scheduling_sib_Pos;
-
-/*  SibOFF  */
-typedef enum {
-  so2 = 0,
-  so4 = 1,
-  so6 = 2,
-  so8 = 3,
-  so10 = 4,
-  so12 = 5,
-  so14 = 6,
-  so16 = 7,
-  so18 = 8,
-  so20 = 9,
-  so22 = 10,
-  so24 = 11,
-  so26 = 12,
-  so28 = 13,
-  so30 = 14,
-  so32 = 15
-} SibOFF;
-
-/*  SibOFF_List  */
-typedef struct SibOFF_List {
-  unsigned int    num;
-  SibOFF          data[15];
-} SibOFF_List;
-
-/*  SchedulingInformation    */
-typedef struct SchedulingInformation {
-  SegCount        segCount;
-  Scheduling_sib_Pos scheduling_sib_rep;
-  SibOFF_List     sib_PosOffsetInfo;
-} SchedulingInformation;
-
-/**************************************************************/
-/*  SchedulingInformationSIBSb  */
-typedef struct SchedulingInformationSIBSb {
-  SIBSb_TypeAndTag sibSb_Type;
-  SchedulingInformation scheduling;
-} SchedulingInformationSIBSb;
-
-/*  SIBSb_ReferenceList  */
-typedef struct SIBSb_ReferenceList {
-  unsigned int    numSIB;
-  SchedulingInformationSIBSb sib_ref[supportedSIBs];
-} SIBSb_ReferenceList;
-
-/**************************************************************/
-/*  SysInfoType1  Information elements                        */
-/**************************************************************/
-/*  NAS_SystemInformation */
-typedef struct NAS_SystemInformation {
-  unsigned int    numocts;
-  unsigned char   data[maxSIB1NAS];
-} NAS_SystemInformation;
-
-/*  UE_TimersAndConstants */
-typedef struct RCELL_UE_TimersAndConstants {
-  unsigned int    numocts;
-  unsigned char   data[8];
-} RCELL_UE_TimersAndConstants;
-
-/**************************************************************/
-/*  SysInfoType2  Information elements                        */
-/**************************************************************/
-/*  IP_Address   */
-//typedef struct SRNC_Identity {
-typedef struct IP_Address {
-  unsigned char   data[16];
-} IP_Address;
-
-/**************************************************************/
-/*  SysInfoType5  Information elements                        */
-/**************************************************************/
-/*  PRACH_SCCPCH_SIList   */
-typedef struct PRACH_SCCPCH_SIList {
-  unsigned int    numocts;
-  unsigned char   data[maxBlock - 8];
-} PRACH_SCCPCH_SIList;
-
-/*  PrimaryCCPCH_TX_Power  */
-typedef int     PrimaryCCPCH_TX_Power;
-/*  Alpha  */
-typedef int     Alpha;
-/*  ConstantValueTdd   */
-typedef int     ConstantValueTdd;
-
-/*  OpenLoopPowerControl_TDD  */
-typedef struct OpenLoopPowerControl_TDD {
-  PrimaryCCPCH_TX_Power primaryCCPCH_TX_Power;
-  Alpha           alpha;
-  ConstantValueTdd prach_ConstantValue;
-  ConstantValueTdd dpch_ConstantValue;
-  //   ConstantValueTdd  pusch_ConstantValue;
-} OpenLoopPowerControl_TDD;
-
-/**************************************************************/
-/*  SysInfoType14  Information elements                        */
-/**************************************************************/
-/*  TimeslotNumber  */
-//  value >= 0 && value <= 14
-typedef unsigned int TimeslotNumber;
-
-/*  TDD_UL_Interference  */
-//  value >= -110 && value <= -52
-typedef int     TDD_UL_Interference;
-
-/*  IndividualTS_Interference  */
-typedef struct IndividualTS_Interference {
-  TimeslotNumber  timeslot;
-  TDD_UL_Interference ul_TimeslotInterference;
-} IndividualTS_Interference;
-
-/*  IndividualTS_InterferenceList */
-typedef struct IndividualTS_InterferenceList {
-  unsigned int    numSlots;
-  IndividualTS_Interference data[15];
-} IndividualTS_InterferenceList;
-
-/*  ExpirationTimeFactor   */
-//  value >= 1 && value <= 8 --> 2^(value)
-typedef unsigned int ExpirationTimeFactor;
-
-/**************************************************************/
-/*  SysInfoType18  Information elements                       */
-/**************************************************************/
-/*  IdentitiesOfNeighbourCells */
-typedef struct IdentitiesOfNeighbourCells {
-  unsigned int    numocts;
-  unsigned char   data[maxSIBNAS];
-} IdentitiesOfNeighbourCells;
-
-/*  CodeGroupsOfNeighbourCells */
-typedef struct CodeGroupsOfNeighbourCells {
-  unsigned char   data[maxCells];
-} CodeGroupsOfNeighbourCells;
-
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_bch_mib.c b/openair2/RRC/CELLULAR/rrc_bch_mib.c
deleted file mode 100755
index 17df99a0f4..0000000000
--- a/openair2/RRC/CELLULAR/rrc_bch_mib.c
+++ /dev/null
@@ -1,693 +0,0 @@
-/***************************************************************************
-                          rrc_bch_mib.c  -  description
-                             -------------------
-    begin                : Aug 30, 2002
-    copyright            : (C) 2002, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Procedures to perform encoding of MIB and SIBs CCC
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#ifdef NODE_MT
-#include "rrc_ue_vars.h"
-#endif
-#ifdef NODE_RG
-#include "rrc_rg_vars.h"
-#endif
-#include "rrc_bch_mib.h"
-
-#include "rrc_proto_bch.h"
-
-/**************************************************************/
-/*  SystemInformation_BCH                                     */
-/**************************************************************/
-#ifdef NODE_RG
-//-----------------------------------------------------------------------------
-int rrc_PEREnc_SI_BCH (PERParms * pParms, SystemInformation_BCH * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  /* encode sfn_Prime */
-  status = rrc_PEREnc_SFN_Prime (pParms, pvalue->sfn_Prime);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* encode payload */
-  status = rrc_PEREnc_SI_BCH_payload (pParms, &pvalue->payload);
-
-  return status;
-}
-#endif
-#ifdef NODE_MT
-//-----------------------------------------------------------------------------
-int rrc_PERDec_SI_BCH (PERParms * pParms, SystemInformation_BCH * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  //   /* decode sfn_Prime */
-  // Done in rrc_ue_get_SIBCH_info()
-  //   /* decode payload */
-  //   status = rrc_PERDec_SI_BCH_payload (pParms, &pvalue->payload);
-  ////   if (status != P_SUCCESS) return status;
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  FirstSegment - Segment Type = 2                           */
-/**************************************************************/
-#ifdef NODE_RG
-//-----------------------------------------------------------------------------
-int rrc_PEREnc_FirstSegment (PERParms * pParms, FirstSegment * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  /* encode sib_Type */
-  status = rrc_PEREnc_SIB_Type (pParms, pvalue->sib_Type);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* encode seg_Count */
-  status = rrc_PEREnc_SegCount (pParms, pvalue->seg_Count);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* encode sib_Data_fixed */
-  status = rrc_PEREnc_SIB_Data_fixed (pParms, pvalue->sib_Data_fixed);
-
-  return status;
-}
-#endif
-#ifdef NODE_MT
-//-----------------------------------------------------------------------------
-int rrc_PERDec_FirstSegment (PERParms * pParms, FirstSegment * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  /* decode sib_Type */
-  // done in rrc_ue_read_Seg2();
-
-  /* decode seg_Count */
-  //done in rrc_ue_read_Seg2();
-  //
-  //   /* decode sib_Data_fixed */
-  //   status = rrc_PERDec_SIB_Data_fixed (pParms, &pvalue->sib_Data_fixed);
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  SubsequentSegment - Segment Type = 3                      */
-/**************************************************************/
-#ifdef NODE_RG
-//-----------------------------------------------------------------------------
-int rrc_PEREnc_SubsequentSegment (PERParms * pParms, SubsequentSegment * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  /* encode sib_Type */
-  status = rrc_PEREnc_SIB_Type (pParms, pvalue->sib_Type);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* encode segmentIndex */
-  status = rrc_PEREnc_SegmentIndex (pParms, pvalue->segmentIndex);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* encode sib_Data_fixed */
-  status = rrc_PEREnc_SIB_Data_fixed (pParms, pvalue->sib_Data_fixed);
-
-  return status;
-}
-#endif
-#ifdef NODE_MT
-//-----------------------------------------------------------------------------
-int rrc_PERDec_SubsequentSegment (PERParms * pParms, SubsequentSegment * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  /* decode sib_Type */
-  // done in rrc_ue_read_Seg3();
-  //
-  //   /* decode segmentIndex */
-  //   status = rrc_PERDec_SegmentIndex (pParms, &pvalue->segmentIndex);
-  //   //if (status != P_SUCCESS) return status;
-  //
-  //   /* decode sib_Data_fixed */
-  //   status = rrc_PERDec_SIB_Data_fixed (pParms, &pvalue->sib_Data_fixed);
-  //   //if (status != P_SUCCESS) return status;
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  CompleteSIB - Segment Type = 10                           */
-/**************************************************************/
-#ifdef NODE_RG
-//-----------------------------------------------------------------------------
-int rrc_PEREnc_CompleteSIB (PERParms * pParms, CompleteSIB * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  /* encode sib_Type */
-  status = rrc_PEREnc_SIB_Type (pParms, pvalue->sib_Type);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* encode sib_Data_fixed */
-  status = rrc_PEREnc_CompleteSIB_sib_Data_fixed (pParms, pvalue->sib_Data_fixed);
-
-  return status;
-}
-#endif
-#ifdef NODE_MT
-//-----------------------------------------------------------------------------
-int rrc_PERDec_CompleteSIB (PERParms * pParms, CompleteSIB * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  /* decode sib_Type */
-  // done in rrc_ue_read_Seg10();
-
-  /* decode sib_Data_fixed */
-  //   status = rrc_PERDec_CompleteSIB_sib_Data_fixed (ctxt_p, &pvalue->sib_Data_fixed);
-  //if (status != P_SUCCESS) return status;
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  LastSegment - Segment Type = 11                           */
-/**************************************************************/
-#ifdef NODE_RG
-//-----------------------------------------------------------------------------
-int rrc_PEREnc_LastSegment (PERParms * pParms, LastSegment * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  /* encode sib_Type */
-  status = rrc_PEREnc_SIB_Type (pParms, pvalue->sib_Type);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* encode segmentIndex */
-  status = rrc_PEREnc_SegmentIndex (pParms, pvalue->segmentIndex);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* encode sib_Data_fixed */
-  status = rrc_PEREnc_SIB_Data_fixed (pParms, pvalue->sib_Data_fixed);
-
-  return status;
-}
-#endif
-#ifdef NODE_MT
-//-----------------------------------------------------------------------------
-int rrc_PERDec_LastSegment (PERParms * pParms, LastSegment * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  /* decode sib_Type */
-  // done in rrc_ue_read_Seg11();
-
-  /* decode segmentIndex */
-  // done in rrc_ue_read_Seg11();
-
-  //   /* decode sib_Data_fixed */
-  //   status = rrc_PERDec_SIB_Data_fixed (pParms, &pvalue->sib_Data_fixed);
-  //   //if (status != P_SUCCESS) return status;
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  SystemInformation_BCH_payload                             */
-/**************************************************************/
-#ifdef NODE_RG
-//-----------------------------------------------------------------------------
-int rrc_PEREnc_SI_BCH_payload (PERParms * pParms, SystemInformation_BCH_payload * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  /* Encode choice index value */
-  status = rrc_PEREnc_ConsUnsigned (pParms, pvalue->type - 1, 0, 15);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* Encode root element data value */
-  switch (pvalue->type) {
-    /* noSegment */
-  case 1:
-    /* NULL */
-    break;
-
-    /* firstSegment */
-  case 2:
-    status = rrc_PEREnc_FirstSegment (pParms, pvalue->segment.firstSegment);
-
-    if (status != P_SUCCESS)
-      return status;
-
-    break;
-
-    /* subsequentSegment */
-  case 3:
-    status = rrc_PEREnc_SubsequentSegment (pParms, pvalue->segment.subsequentSegment);
-
-    if (status != P_SUCCESS)
-      return status;
-
-    break;
-
-    //      /* lastSegmentShort */
-    //      case 4:
-    //         status = rrc_PEREnc_LastSegmentShort (pParms, pvalue->segment.lastSegmentShort);
-    //         if (status != P_SUCCESS) return status;
-    //         break;
-    //      /* completeSIB_List */
-    //      case 8:
-    //         status = rrc_PEREnc_CompleteSIB_List (pParms, pvalue->segment.completeSIB_List);
-    //         if (status != P_SUCCESS) return status;
-    //         break;
-    /* completeSIB */
-  case 10:
-    status = rrc_PEREnc_CompleteSIB (pParms, pvalue->segment.completeSIB);
-
-    if (status != P_SUCCESS)
-      return status;
-
-    break;
-
-    /* lastSegment */
-  case 11:
-    status = rrc_PEREnc_LastSegment (pParms, pvalue->segment.lastSegment);
-
-    if (status != P_SUCCESS)
-      return status;
-
-    break;
-
-  default:
-    return P_INVVALUE;
-  }
-
-  return status;
-}
-#endif
-#ifdef NODE_MT
-//-----------------------------------------------------------------------------
-int rrc_PERDec_SI_BCH_payload (PERParms * pParms, SystemInformation_BCH_payload * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_INVPROC;
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  MasterInformationBlock                                    */
-/**************************************************************/
-#ifdef NODE_RG
-//-----------------------------------------------------------------------------
-int rrc_PEREnc_MasterInformationBlock (PERParms * pParms, MasterInformationBlock * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  /* encode mib_ValueTag */
-  status = rrc_PEREnc_MIB_ValueTag (pParms, pvalue->mib_ValueTag);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* encode plmn_Type */
-  status = rrc_PEREnc_PLMN_Identity (pParms, &pvalue->plmn_Identity);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* encode sibSb_ReferenceList */
-  status = rrc_PEREnc_SIBSb_ReferenceList (pParms, &pvalue->sibSb_ReferenceList);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  // Add length
-  rrc_set_per_length (pParms);
-
-  return status;
-}
-#endif
-#ifdef NODE_MT
-//-----------------------------------------------------------------------------
-int rrc_PERDec_MasterInformationBlock (PERParms * pParms, MasterInformationBlock * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  char *pBuffer;
-  int message_length;
-  int status = P_SUCCESS;
-
-  //   /* read block length - this value is unused in 1st step */
-  //   pBuffer = ((char *) pParms->buffer ) + pParms->buff_index;
-  //   message_length = rrc_get_per_length ((ENCODEDBLOCK*)pBuffer);
-  //   pParms->buff_size = message_length - 1;  // idem
-  //   pParms->buff_index +=1;
-
-  /* read block length - this value is unused in 1st step */
-  pBuffer = (char *) &(protocol_ms->rrc.ue_bch_blocks.encoded_currMIB);
-  message_length = rrc_get_per_length ((ENCODEDBLOCK *) pBuffer);
-
-  pParms->buffer = (ENCODEDBLOCK *) pBuffer;
-  pParms->buff_size = message_length - 1;       // idem
-  pParms->buff_index = 1;
-
-
-  /* decode mib_ValueTag */
-  status = rrc_PERDec_MIB_ValueTag (pParms, &pvalue->mib_ValueTag);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* decode plmn_Type */
-  status = rrc_PERDec_PLMN_Identity (pParms, &pvalue->plmn_Identity);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* decode sibSb_ReferenceList */
-  status = rrc_PERDec_SIBSb_ReferenceList (pParms, &pvalue->sibSb_ReferenceList);
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  SysInfoType1                                              */
-/**************************************************************/
-#ifdef NODE_RG
-//-----------------------------------------------------------------------------
-int rrc_PEREnc_SysInfoType1 (PERParms * pParms, SysInfoType1 * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  /* encode subnet_NAS_SysInfo */
-  status = rrc_PEREnc_NAS_SystemInformation (pParms, pvalue->subnet_NAS_SysInfo);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* encode ue_TimersAndConstants */
-  status = rrc_PEREnc_UE_TimersAndConstants (pParms, pvalue->ue_TimersAndConstants);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  // Add length
-  rrc_set_per_length (pParms);
-
-  return status;
-}
-#endif
-#ifdef NODE_MT
-//-----------------------------------------------------------------------------
-int rrc_PERDec_SysInfoType1 (PERParms * pParms, SysInfoType1 * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  char *pBuffer;
-  int message_length;
-
-  /* read block length - this value is unused in 1st step */
-  pBuffer = (char *) &(protocol_ms->rrc.ue_bch_blocks.encoded_currSIB1);
-  message_length = rrc_get_per_length ((ENCODEDBLOCK *) pBuffer);
-
-  pParms->buffer = (ENCODEDBLOCK *) pBuffer;
-  pParms->buff_size = message_length - 1;       // idem
-  pParms->buff_index = 1;
-
-  /* decode NAS_SystemInformation */
-  status = rrc_PERDec_NAS_SystemInformation (pParms, &pvalue->subnet_NAS_SysInfo);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* decode ue_TimersAndConstants */
-  status = rrc_PERDec_UE_TimersAndConstants (pParms, &pvalue->ue_TimersAndConstants);
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  SysInfoType2                                              */
-/**************************************************************/
-#ifdef NODE_RG
-//-----------------------------------------------------------------------------
-int rrc_PEREnc_SysInfoType2 (PERParms * pParms, SysInfoType2 * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  /* encode IP_Address */
-  status = rrc_PEREnc_IP_Address (pParms, &pvalue->net_IP_addr);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  // Add length
-  rrc_set_per_length (pParms);
-
-  return status;
-}
-#endif
-#ifdef NODE_MT
-//-----------------------------------------------------------------------------
-int rrc_PERDec_SysInfoType2 (PERParms * pParms, SysInfoType2 * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  char *pBuffer;
-  int message_length;
-
-  /* read block length - this value is unused in 1st step */
-  pBuffer = (char *) &(protocol_ms->rrc.ue_bch_blocks.encoded_currSIB2);
-  message_length = rrc_get_per_length ((ENCODEDBLOCK *) pBuffer);
-
-  pParms->buffer = (ENCODEDBLOCK *) pBuffer;
-  pParms->buff_size = message_length - 1;       // idem
-  pParms->buff_index = 1;
-
-  /* decode IP_Address */
-  status = rrc_PERDec_IP_Address (pParms, &pvalue->net_IP_addr);
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  SysInfoType5                                              */
-/**************************************************************/
-#ifdef NODE_RG
-//-----------------------------------------------------------------------------
-int rrc_PEREnc_SysInfoType5 (PERParms * pParms, SysInfoType5 * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  /* encode PRACH_SCCPCH_SIList */
-  status = rrc_PEREnc_PRACH_SCCPCH_SIList (pParms, pvalue->prach_sCCPCH_SIList);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* encode OpenLoopPowerControl_TDD */
-  status = rrc_PEREnc_OpenLoopPowerControl_TDD (pParms, &pvalue->openLoopPowerControl_TDD);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  // Add length
-  rrc_set_per_length (pParms);
-
-  return status;
-}
-#endif
-#ifdef NODE_MT
-//-----------------------------------------------------------------------------
-int rrc_PERDec_SysInfoType5 (PERParms * pParms, SysInfoType5 * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  char *pBuffer = NULL;
-  int message_length = 0;
-
-  /* read block length - this value is unused in 1st step */
-  pBuffer = (char *) &(protocol_ms->rrc.ue_bch_blocks.encoded_currSIB5);
-  message_length = rrc_get_per_length ((ENCODEDBLOCK *) pBuffer);
-
-  pParms->buffer = (ENCODEDBLOCK *) pBuffer;
-  pParms->buff_size = message_length - 1;       // idem
-  pParms->buff_index = 1;
-
-  /* decode PRACH_SCCPCH_SIList */
-  status = rrc_PERDec_PRACH_SCCPCH_SIList (pParms, &pvalue->prach_sCCPCH_SIList);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* decode OpenLoopPowerControl_TDD */
-  status = rrc_PERDec_OpenLoopPowerControl_TDD (pParms, &pvalue->openLoopPowerControl_TDD);
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  SysInfoType14                                              */
-/**************************************************************/
-#ifdef NODE_RG
-//-----------------------------------------------------------------------------
-int rrc_PEREnc_SysInfoType14 (PERParms * pParms, SysInfoType14 * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  /* encode individualTS_InterferenceList */
-  status = rrc_PEREnc_IndividualTS_InterferenceList (pParms, &pvalue->individualTS_InterferenceList);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* encode expirationTimeFactor */
-  status = rrc_PEREnc_ExpirationTimeFactor (pParms, pvalue->expirationTimeFactor);
-
-  // Add length
-  rrc_set_per_length (pParms);
-
-  return status;
-}
-#endif
-#ifdef NODE_MT
-//-----------------------------------------------------------------------------
-int rrc_PERDec_SysInfoType14 (PERParms * pParms, SysInfoType14 * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  char *pBuffer = NULL;
-  int message_length = 0;
-
-  /* read block length - this value is unused in 1st step */
-  pBuffer = (char *) &(protocol_ms->rrc.ue_bch_blocks.encoded_currSIB14);
-  message_length = rrc_get_per_length ((ENCODEDBLOCK *) pBuffer);
-
-  pParms->buffer = (ENCODEDBLOCK *) pBuffer;
-  pParms->buff_size = message_length - 1;       // idem
-  pParms->buff_index = 1;
-
-  /* decode individualTS_InterferenceList */
-  status = rrc_PERDec_IndividualTS_InterferenceList (pParms, &pvalue->individualTS_InterferenceList);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* decode expirationTimeFactor */
-  status = rrc_PERDec_ExpirationTimeFactor (pParms, &pvalue->expirationTimeFactor);
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  SysInfoType18                                              */
-/**************************************************************/
-#ifdef NODE_RG
-//-----------------------------------------------------------------------------
-int rrc_PEREnc_SysInfoType18 (PERParms * pParms, SysInfoType18 * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  /* encode IdentitiesOfNeighbourCells */
-  status = rrc_PEREnc_IdentitiesOfNeighbourCells (pParms, pvalue->cellIdentities);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* encode CodeGroupsOfNeighbourCells */
-  status = rrc_PEREnc_CodeGroupsOfNeighbourCells (pParms, &pvalue->cellCodegroups);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  // Add length
-  rrc_set_per_length (pParms);
-
-  return status;
-}
-#endif
-#ifdef NODE_MT
-//-----------------------------------------------------------------------------
-int rrc_PERDec_SysInfoType18 (PERParms * pParms, SysInfoType18 * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  char *pBuffer;
-  int message_length;
-
-  /* read block length - this value is unused in 1st step */
-  pBuffer = (char *) &(protocol_ms->rrc.ue_bch_blocks.encoded_currSIB18);
-  message_length = rrc_get_per_length ((ENCODEDBLOCK *) pBuffer);
-
-  pParms->buffer = (ENCODEDBLOCK *) pBuffer;
-  pParms->buff_size = message_length - 1;       // idem
-  pParms->buff_index = 1;
-
-  /* decode IdentitiesOfNeighbourCells */
-  status = rrc_PERDec_IdentitiesOfNeighbourCells (pParms, &pvalue->cellIdentities);
-
-  if (status != P_SUCCESS)
-    return status;
-
-  /* decode CodeGroupsOfNeighbourCells */
-  status = rrc_PERDec_CodeGroupsOfNeighbourCells (pParms, &pvalue->cellCodegroups);
-
-  return status;
-}
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_bch_mib.h b/openair2/RRC/CELLULAR/rrc_bch_mib.h
deleted file mode 100755
index b1270b0cd4..0000000000
--- a/openair2/RRC/CELLULAR/rrc_bch_mib.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/***************************************************************************
-                          rrc_bch_mib.h  -  description
-                             -------------------
-    begin                : Aug 30, 2002
-    copyright            : (C) 2002, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Define structures for Broadcast MIB and SIBs
- ***************************************************************************/
-#ifndef __RRC_BCH_MIB_H__
-#define __RRC_BCH_MIB_H__
-
-#include "rrc_bch_ies.h"
-#include "rrc_bch_constant.h"
-
-/*********************************************************************
- System Information for BCH
-*********************************************************************/
-typedef struct FirstSegment {
-  SIB_Type        sib_Type;
-  SegCount        seg_Count;
-  SIB_Data_fixed  sib_Data_fixed;
-} FirstSegment;
-
-typedef struct SubsequentSegment {
-  SIB_Type        sib_Type;
-  SegmentIndex    segmentIndex;
-  SIB_Data_fixed  sib_Data_fixed;
-} SubsequentSegment;
-
-typedef struct LastSegmentShort {
-  SIB_Type        sib_Type;
-  SegmentIndex    segmentIndex;
-  SIB_Data_variable sib_Data_variable;
-} LastSegmentShort;
-
-typedef struct CompleteSIBshort {
-  SIB_Type        sib_Type;
-  SIB_Data_variable sib_Data_variable;
-} CompleteSIBshort;
-
-typedef struct CompleteSIB_List {
-  unsigned int    numSIB;
-  CompleteSIBshort elem[maxSIBperMsg];
-} CompleteSIB_List;
-
-typedef struct CompleteSIB {
-  SIB_Type        sib_Type;
-  CompleteSIB_sib_Data_fixed sib_Data_fixed;
-} CompleteSIB;
-
-typedef struct LastSegment {
-  SIB_Type        sib_Type;
-  SegmentIndex    segmentIndex;
-  SIB_Data_fixed  sib_Data_fixed;
-} LastSegment;
-
-typedef struct SystemInformation_BCH_payload {
-  int             type;
-  union {
-    /* type = 1 */
-    // noSegment
-    /* type = 2 */
-    FirstSegment   *firstSegment;
-    /* type = 3 */
-    SubsequentSegment *subsequentSegment;
-    /* type = 4 */
-    LastSegmentShort *lastSegmentShort;
-    /* type = 8 */
-    CompleteSIB_List *completeSIB_List;
-    /* type = 10 */
-    CompleteSIB    *completeSIB;
-    /* type = 11 */
-    LastSegment    *lastSegment;
-  } segment;
-} SystemInformation_BCH_payload;
-
-typedef struct SystemInformation_BCH {
-  SFN_Prime       sfn_Prime;
-  SystemInformation_BCH_payload payload;
-} SystemInformation_BCH;
-
-/**************************************************************/
-/*  MasterInformationBlock                                    */
-/**************************************************************/
-
-typedef struct MasterInformationBlock {
-  MIB_ValueTag    mib_ValueTag;
-  RCELL_PLMN_Identity   plmn_Identity;
-  SIBSb_ReferenceList sibSb_ReferenceList;
-} MasterInformationBlock;
-
-/**************************************************************/
-/*  SysInfoType1                                              */
-/**************************************************************/
-typedef struct SysInfoType1 {
-  NAS_SystemInformation subnet_NAS_SysInfo;
-  RCELL_UE_TimersAndConstants ue_TimersAndConstants;
-} SysInfoType1;
-
-/**************************************************************/
-/*  SysInfoType2                                              */
-/**************************************************************/
-typedef struct SysInfoType2 {
-  IP_Address      net_IP_addr;
-} SysInfoType2;
-
-/**************************************************************/
-/*  SysInfoType5                                              */
-/**************************************************************/
-typedef struct SysInfoType5 {
-  PRACH_SCCPCH_SIList prach_sCCPCH_SIList;
-  OpenLoopPowerControl_TDD openLoopPowerControl_TDD;
-} SysInfoType5;
-
-/**************************************************************/
-/*  SysInfoType11                                             */
-/**************************************************************/
-//typedef struct SysInfoType11 {
-//   FACH_MeasurementOccasionInfo  fach_MeasurementOccasionInfo;
-//   MeasurementControlSysInfo  measurementControlSysInfo;
-//} SysInfoType11;
-
-/**************************************************************/
-/*  SysInfoType14                                             */
-/**************************************************************/
-typedef struct SysInfoType14 {
-  IndividualTS_InterferenceList individualTS_InterferenceList;
-  ExpirationTimeFactor expirationTimeFactor;
-} SysInfoType14;
-
-/**************************************************************/
-/*  SysInfoType18                                             */
-/**************************************************************/
-typedef struct SysInfoType18 {
-  IdentitiesOfNeighbourCells cellIdentities;
-  CodeGroupsOfNeighbourCells cellCodegroups;
-} SysInfoType18;
-
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_bch_per_basic.c b/openair2/RRC/CELLULAR/rrc_bch_per_basic.c
deleted file mode 100755
index f764a11b1f..0000000000
--- a/openair2/RRC/CELLULAR/rrc_bch_per_basic.c
+++ /dev/null
@@ -1,493 +0,0 @@
-/***************************************************************************
-                          rrc_bch_per_basic.c  -  description
-                             -------------------
-    copyright            : (C) 2002, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Procedures to perform PER encoding/decoding of basic entities
-  Currently, following entities are supported:
-  - constrained integer
-  - bit string
-  - constrained unsigned integer
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-//#include "UTIL/MEM/mem_block.h"
-
-#ifdef NODE_RG
-#include "rrc_rg_vars_extern.h"
-#endif
-#ifdef NODE_MT
-#include "rrc_ue_vars_extern.h"
-#endif
-
-/********************
-// RRC definitions
- ********************/
-//#include "rrc_constant.h"
-//#include "rrc_bch_mib.h"
-//-----------------------------------------------------------------------------
-//#include "rrc_proto_int.h"
-void rrc_print_buffer (char *buffer, int length);
-
-
-//-----------------------------------------------------------------------------
-void rrc_new_per_parms (PERParms * pParms, ENCODEDBLOCK * pBuffer)
-{
-  //-----------------------------------------------------------------------------
-  pParms->buffer = pBuffer;
-  pParms->buff_index = 1;       //start +1 = placeholder for buffer total length
-  pParms->buff_size = 1;        // idem
-  pParms->bitoffset = 0;
-  pParms->errInfo = P_SUCCESS;
-}
-
-//-----------------------------------------------------------------------------
-void rrc_set_per_length (PERParms * pParms)
-{
-  //-----------------------------------------------------------------------------
-  char *pwrite;
-
-  pwrite = ((char *) pParms->buffer);
-  *pwrite = pParms->buff_size;
-}
-
-//-----------------------------------------------------------------------------
-int rrc_get_per_length (ENCODEDBLOCK * pBlock)
-{
-  //-----------------------------------------------------------------------------
-  u8 length;
-
-  length = *((char *) pBlock);
-  return length;
-}
-
-//-----------------------------------------------------------------------------
-void rrc_print_per_parms (PERParms * pParms)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_BROADCAST
-  msg ("[RRC_BCH] PER Control block values \t- index : %d\t- size : %d\t- error info : %d", pParms->buff_index, pParms->buff_size, pParms->errInfo);
-  rrc_print_buffer ((char *) pParms->buffer, pParms->buff_size);
-#endif
-}
-
-//-----------------------------------------------------------------------------
-int rrc_PEREnc_padding (PERParms * pParms, int length)
-{
-  //-----------------------------------------------------------------------------
-  int  status = P_SUCCESS;
-  char *pwrite;
-  int  i;
-
-  pwrite = ((char *) pParms->buffer) + pParms->buff_index;
-
-  for (i = 0; i < length; i++) {
-    *pwrite = 0;
-    pwrite++;
-  }
-
-  pParms->buff_index += length;
-  pParms->buff_size += length;
-  return status;
-}
-
-/**************************************************************/
-/*  Constrained Integer                                       */
-/**************************************************************/
-//-----------------------------------------------------------------------------
-int rrc_PEREnc_ConstrInteger (PERParms * pParms, int pvalue, int lower, int upper)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  unsigned char *pwrite = NULL;
-  unsigned short int *pshort = NULL;
-
-  pwrite = ((unsigned char *) pParms->buffer) + pParms->buff_index;
-
-  if (pvalue >= lower && pvalue <= upper) {
-    if ((lower >= -128) && (upper <= 127)) {
-      //                *pwrite = (unsigned char)pvalue;
-      *pwrite = (char) pvalue;
-      pParms->buff_index += 1;
-      pParms->buff_size += 1;
-    } else {
-      if ((lower >= -32768) && (upper <= 32767)) {
-        //          pshort = (unsigned short int *)pwrite;
-        //                *pshort = (unsigned short int)pvalue;
-        pshort = (unsigned short int *) pwrite;
-        *pshort = (short int) pvalue;
-        pParms->buff_index += 2;
-        pParms->buff_size += 2;
-      } else {
-#ifdef DEBUG_RRC_BROADCAST
-        msg ("[RRC_BCH] Error, Value larger than 2 bytes, Code to be written : %d\n", pvalue);
-#endif
-        status = P_MISCLERROR;
-      }
-    }
-  } else {
-    status = P_OUTOFBOUNDS;
-  }
-
-  return status;
-}
-
-//-----------------------------------------------------------------------------
-int rrc_PERDec_ConstrInteger (PERParms * pParms, int *pvalue, int lower, int upper)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  //   unsigned char * pRead;
-  //   unsigned short int * pshort;
-  char *pRead = NULL;
-  short int *pshort = NULL;
-
-  char value_read_1 = 0;
-  short int value_read_2 = 0;
-
-  pRead = ((char *) pParms->buffer) + pParms->buff_index;
-
-  if ((lower >= -128) && (upper <= 127)) {
-    value_read_1 = *(pRead);
-
-    if (value_read_1 >= lower && value_read_1 <= upper) {
-      *pvalue = value_read_1;
-      pParms->buff_index += 1;
-      pParms->buff_size -= 1;
-    } else {
-      status = P_OUTOFBOUNDS;
-    }
-  } else {
-    if ((lower >= -32768) && (upper <= 32767)) {
-      pshort = (short int *) pRead;
-      //       pshort = (unsigned short int *)pRead;
-      value_read_2 = *(pshort);
-
-      if (value_read_2 >= lower && value_read_2 <= upper) {
-        *pvalue = value_read_2;
-        pParms->buff_index += 2;
-        pParms->buff_size -= 2;
-      } else {
-        status = P_OUTOFBOUNDS;
-      }
-    } else {
-#ifdef DEBUG_RRC_BROADCAST
-      msg ("[RRC_BCH] Error, Value>65535, Code to be written : %d\n", *pRead);
-#endif
-      status = P_MISCLERROR;
-    }
-
-#ifdef DEBUG_RRC_BROADCAST
-    //      msg("[RRC_BCH] Value read : %d\n", *pvalue);
-#endif
-
-  }
-
-  return status;
-}
-
-/**************************************************************/
-/*  Constrained Unsigned Integer                              */
-/**************************************************************/
-//-----------------------------------------------------------------------------
-int rrc_PEREnc_ConsUnsigned (PERParms * pParms, unsigned int pvalue, unsigned int lower, unsigned int upper)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  unsigned char  *pwrite;
-  unsigned short int *pshort;
-
-  pwrite = ((unsigned char *) pParms->buffer) + pParms->buff_index;
-
-  if (pvalue >= lower && pvalue <= upper) {
-    if (upper <= 255) {
-      *pwrite = (unsigned char) pvalue;
-      pParms->buff_index += 1;
-      pParms->buff_size += 1;
-    } else {
-      if (upper <= 65535) {
-        pshort = (unsigned short int *) pwrite;
-        *pshort = (unsigned short int) pvalue;
-        pParms->buff_index += 2;
-        pParms->buff_size += 2;
-      } else {
-#ifdef DEBUG_RRC_BROADCAST
-        msg ("[RRC_BCH] Error, Value>65535, Code to be written : %d\n", pvalue);
-#endif
-        status = P_MISCLERROR;
-      }
-    }
-  } else {
-    status = P_OUTOFBOUNDS;
-  }
-
-  return status;
-}
-
-//-----------------------------------------------------------------------------
-int rrc_PERDec_ConsUnsigned (PERParms * pParms, unsigned int *pvalue, unsigned int lower, unsigned int upper)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  unsigned char  *pRead;
-  unsigned short int *pshort;
-
-  unsigned char value_read_1 = 0;
-  short int value_read_2 = 0;
-
-  pRead = ((unsigned char *) pParms->buffer) + pParms->buff_index;
-
-  if (upper <= 255) {
-    value_read_1 = *(pRead);
-
-    if (value_read_1 >= lower && value_read_1 <= upper) {
-      *pvalue = value_read_1;
-      pParms->buff_index += 1;
-      pParms->buff_size -= 1;
-    } else {
-      status = P_OUTOFBOUNDS;
-    }
-  } else {
-    if (upper <= 65535) {
-      pshort = (unsigned short int *) pRead;
-      value_read_2 = *(pshort);
-
-      if (value_read_2 >= lower && value_read_2 <= upper) {
-        *pvalue = value_read_2;
-        pParms->buff_index += 2;
-        pParms->buff_size -= 2;
-      } else {
-        status = P_OUTOFBOUNDS;
-      }
-    } else {
-#ifdef DEBUG_RRC_BROADCAST
-      msg ("[RRC_BCH] Error, Value>65535, Code to be written : %d\n", *pRead);
-#endif
-      status = P_MISCLERROR;
-    }
-  }
-
-  return status;
-}
-
-/**************************************************************/
-/*  Bit String                                                */
-/**************************************************************/
-// working on octets in 1st step - 3rd parameter not used , FFS
-//-----------------------------------------------------------------------------
-int rrc_PEREnc_BitString (PERParms * pParms, unsigned int numbits, unsigned char *data)
-{
-  //-----------------------------------------------------------------------------
-  int             status = P_SUCCESS;
-  unsigned int    length;
-  int             i;
-  char           *pwrite;
-  char           *psource;
-
-  if (numbits == 0) {           //data buffer empty. Get encoded values from pParms
-    length = rrc_get_per_length (pParms->data);
-    pwrite = ((char *) pParms->buffer) + pParms->buff_index;
-    psource = (char *) pParms->data;
-
-    for (i = 0; i < length; i++) {
-      *pwrite = *psource;
-      pwrite++;
-      psource++;
-    }
-
-    pParms->buff_index += length;
-    pParms->buff_size += length;
-  } else {
-#ifdef DEBUG_RRC_BROADCAST
-    msg ("[RRC_BCH] Error, numbits>0, Code to be written \n");
-#endif
-    status = P_MISCLERROR;
-    pParms->errInfo = P_MISCLERROR;
-  }
-
-  return status;
-}
-
-//-----------------------------------------------------------------------------
-int rrc_PERDec_BitString (PERParms * pParms, unsigned int *numbits_p, char *buffer, unsigned int bufsiz)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  return status;
-}
-
-/**************************************************************/
-/*  Octet string                                                */
-/**************************************************************/
-//-----------------------------------------------------------------------------
-int rrc_PEREnc_OctetString (PERParms * pParms, unsigned int numocts, char *data)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  char *pwrite;
-
-  pwrite = ((char *) pParms->buffer) + pParms->buff_index;
-  memcpy (pwrite, data, numocts);
-
-  pParms->buff_index += numocts;
-  pParms->buff_size += numocts;
-
-  return status;
-}
-
-//-----------------------------------------------------------------------------
-int rrc_PERDec_OctetString (PERParms * pParms, unsigned int *numocts_p, char *data, unsigned int bufsize)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  //int i;
-  char *pwrite;
-  char *psource;
-  unsigned int numocts;
-
-  psource = ((char *) pParms->buffer) + pParms->buff_index;
-  pwrite = data;
-
-  numocts = *psource;
-  *numocts_p = bufsize;
-
-  memcpy (data, psource, bufsize);
-  pParms->buff_index += numocts + 1;
-  pParms->buff_size -= (numocts + 1);
-
-
-  return status;
-}
-
-/**************************************************************/
-/*  Var Octet String - same as string, but with length        */
-/**************************************************************/
-//-----------------------------------------------------------------------------
-int rrc_PEREnc_VarOctetString (PERParms * pParms, unsigned int numocts, unsigned char *data)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  char *pwrite;
-
-  pwrite = ((char *) pParms->buffer) + pParms->buff_index;
-
-  *pwrite = numocts;
-  pwrite += 1;
-
-  memcpy (pwrite, data, numocts);
-  pParms->buff_index += numocts + 1;
-  pParms->buff_size += numocts + 1;
-
-  return status;
-}
-
-//-----------------------------------------------------------------------------
-int rrc_PERDec_VarOctetString (PERParms * pParms, unsigned int *numocts_p, unsigned char *data)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  char *psource;
-  unsigned int numocts;
-  u8 read_value;
-
-  psource = ((char *) pParms->buffer) + pParms->buff_index;
-
-  read_value = *psource;
-  numocts = (unsigned int)read_value;
-  //  (u8) numocts = *((u8 *)psource);
-  *numocts_p = numocts;
-  psource += 1;
-
-  memcpy (data, psource, numocts);
-  pParms->buff_index += numocts + 1;
-  pParms->buff_size -= (numocts + 1);
-
-  return status;
-}
-
-/**************************************************************/
-/*  Digit                                                     */
-/**************************************************************/
-//-----------------------------------------------------------------------------
-int rrc_PEREnc_Digit (PERParms * pParms, Digit value)
-{
-  //-----------------------------------------------------------------------------
-  int  status = P_SUCCESS;
-  // status = rrc_PEREnc_ConstrInteger (pParms, value, 0, 9);
-  char *pwrite;
-
-  if (value >= 0 && value <= 9) {
-    pwrite = ((char *) pParms->buffer) + pParms->buff_index;
-    *pwrite = (char) value;
-    pParms->buff_index += 1;
-    pParms->buff_size += 1;
-  } else {
-    status = P_INVDIGIT;
-  }
-
-  return (status);
-}
-
-//-----------------------------------------------------------------------------
-int rrc_PERDec_Digit (PERParms * pParms, Digit * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  //status = rrc_PERDec_ConstrInteger (pParms, pvalue, 0, 9);
-  char  *pRead;
-  unsigned char value_read;
-
-  pRead = ((char *) pParms->buffer) + pParms->buff_index;
-  value_read = *(pRead);
-  //   if (value_read>=0 && value_read<=9){
-  *pvalue = value_read;
-  pParms->buff_index += 1;
-  pParms->buff_size -= 1;
-  //   }else{
-  //   status = P_INVDIGIT;
-  //   }
-  return (status);
-}
-
-/**************************************************************/
-/*  Length                                                    */
-/**************************************************************/
-//-----------------------------------------------------------------------------
-int rrc_PEREnc_Length (PERParms * pParms, unsigned int value)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  char *pwrite;
-
-  if (value <= 255) {
-    pwrite = ((char *) pParms->buffer) + pParms->buff_index;
-    *pwrite = (char) value;
-    pParms->buff_index += 1;
-    pParms->buff_size += 1;
-  } else {
-#ifdef DEBUG_RRC_BROADCAST
-    msg ("[RRC_BCH] Error, length>255, value : %d\n", value);
-#endif
-    status = P_OUTOFBOUNDS;
-  }
-
-  return status;
-}
-
-//-----------------------------------------------------------------------------
-int rrc_PERDec_Length (PERParms * pParms, unsigned int *pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  char *pRead;
-
-  pRead = ((char *) pParms->buffer) + pParms->buff_index;
-  *pvalue = *pRead;
-  pParms->buff_index += 1;
-  pParms->buff_size -= 1;
-
-  return status;
-}
diff --git a/openair2/RRC/CELLULAR/rrc_bch_per_basic.h b/openair2/RRC/CELLULAR/rrc_bch_per_basic.h
deleted file mode 100755
index 85c1c790ec..0000000000
--- a/openair2/RRC/CELLULAR/rrc_bch_per_basic.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/***************************************************************************
-                          rrc_bch_per_basic.h  -  description
-                             -------------------
-    copyright            : (C) 2003, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Define basic types for RRC peer-to-peer messages and broadcast
- ***************************************************************************/
-#ifndef __RRC_BCH_PER_BASIC_H__
-#define __RRC_BCH_PER_BASIC_H__
-
-#include "rrc_platform_types.h"
-typedef int     Digit;
-
-//Return codes
-#define P_SUCCESS       0
-#define P_MISCLERROR    1
-#define P_OUTOFBOUNDS   2
-#define P_INVDIGIT      3
-#define P_INVMSGTYPE    4
-#define P_NOMSG         5
-#define P_INVVALUE      6
-#define P_INVINTEGRITY  7
-#define P_INVPROC       8
-
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_constant.h b/openair2/RRC/CELLULAR/rrc_constant.h
deleted file mode 100755
index 42c000359e..0000000000
--- a/openair2/RRC/CELLULAR/rrc_constant.h
+++ /dev/null
@@ -1,274 +0,0 @@
-/***************************************************************************
-                          rrc_constant.h  -  description
-                             -------------------
-    begin             : Someday 2001
-    copyright         : (C) 2001, 2010 by Eurecom
-    created by        : Lionel.Gauthier@eurecom.fr
-    modified by       : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  RRC protocol constants
- ***************************************************************************/
-#ifndef __RRC_CONSTANT_H__
-#define __RRC_CONSTANT_H__
-
-/* ***Debug flags*** */
-#define DEBUG_RRC_STATE
-//#define DEBUG_RRC_DETAILS
-//#define DEBUG_RRC_DETAILS_2
-#define RRC_DEBUG_DUMMIES
-
-//#define DEBUG_RRC_BROADCAST_NAS
-//#ifndef DEBUG_RRC_BROADCAST
-//#define DEBUG_RRC_BROADCAST
-//#define DEBUG_RRC_BROADCAST_DETAILS
-//#endif
-#define DEBUG_RRC_RRM_INTF
-
-//#define DEBUG_RRC_TEMP_OPENAIR
-
-#define DEBUG_NAS_CONTROL_SIMU
-//#define DEBUG_NAS_MEAS_SIMU
-
-// Measurement Control Message
-#define DEBUG_RRC_MEASURE_CONTROL
-// Measurement Report Message
-#define DEBUG_RRC_MEASURE_REPORT_MAIN
-// #ifdef NODE_RG
-// #define DEBUG_RRC_MEASURE_REPORT
-// #define DEBUG_RRC_FORWARD_MT_MEASURE_REPORT
-// #endif
-
-/* **** */
-/* ** FLAG DEFINED FOR HANDLING of 2UEs in EMULATION MODE ** */
-/* **** */
-#define RRC_OAI_EMU
-/* **** */
-/* ** FLAG DEFINED FOR HANDLING of ENb Measures ** */
-/* **** */
-//#define RRC_ENABLE_REAL_ENB_MESURES
-
-/* **** */
-/* ** FLAGS DEFINED FOR HANDLING of NAS_INTERFACE ** */
-/* **** */
-// Case 1 : simulation = USER_MODE defined + RRC_NETLINK commented
-// Case 2 : netlink sockets = USER_MODE defined +
-#define RRC_NETLINK PDCP_USE_NETLINK
-// (TEMP: should be placed in Makefile, but currently, PDCP_USE_NETLINK is default in USER_MODE)
-// Case 3 : RT_FIFOS = USER_MODE undefined
-
-/* **** */
-/* ** FLAGS DEFINED FOR MBMS DEFINITION ** */
-/* **** */
-// !!Activate or deactivate the MBMS Protocol!!
-//#define ALLOW_MBMS_PROTOCOL
-
-//#define MBMS_TEST_MODE  //Used in stand-alone mode (MBMS standalone simulator)
-#define MBMS_INTEGRATION_MODE //Used in platform mode - simulation or realtime mode
-
-//#define ALLOW_MBMS_ACCESS_INFO
-
-/* *** Debug flags for MBMS *** */
-#define DEBUG_RRC_MBMS_BASIC      //basic level of trace for MBMS operation
-//#define DEBUG_RRC_MBMS            //1st level of trace for MBMS operation
-//#define DEBUG_RRC_MBMS_DETAIL   //2nd level of trace for MBMS operation
-#define DEBUG_UE_MBMS_FSM       //traces for UE FSM internals
-#define DEBUG_UE_MBMS_FSM_TEST  //full traces of MBMS FSM
-#define DEBUG_RRC_MBMS_MSG_CONTENT  // content for received/sent message buffer
-#define DEBUG_RRC_MBMS_SFN  // MBMS frame counter
-#define DEBUG_RRC_MBMS_STATUS  // current status of services in UE
-
-#ifdef MBMS_INTEGRATION_MODE
-#undef MBMS_TEST_MODE
-#endif
-/* ***End MBMS Debug flags*** */
-
-/* **** */
-/* ** RRC INTERNAL VALUES ** */
-/* **** */
-// will be a variable when virtualisation
-#define RRC_MODULE_INST_ID 0
-
-//max number of UE per BS
-// Warning : This must be coordinated with the number of FIFOs in the RG (rrc_sap.h)
-#define maxUsers 3
-// max number of cells or RGs
-// to be coordinated with NAS list of RGs
-#define maxCells 2
-
-#define RRC_NAS_MAX_SIZE 4096
-
-//Values to be used in UE for quality measurement - to be adjusted
-//Formula : NAS_measure = (RSSI0 / RATIO_RSSI0) + SHIFT_RSSI0
-//Result must be a positive integer [0-90]
-#define RATIO_RSSI0 100
-#define SHIFT_RSSI0 110
-//#define NB_ANTENNAS 2   // A Revoir
-// NB_ANTENNAS is set in the Makefile
-#define numANTENNAS   NB_ANTENNAS_RX
-
-#ifdef NODE_RG
-#define RRC_RG_MAX_RB   maxRB*maxUsers
-// RG_CONN_TIMEOUT will clean the MT resources from the RG if it failed
-// between CONN_SETUP and CONN_SETUP_COMPLETE - 3000 ==> 30s.
-#define RG_CONN_TIMEOUT 3000
-#endif
-
-/* CONSTANTS for ESTEREL */
-#define SUCCESS 0
-#define FAILURE 1
-#define ALREADY_C 2
-//
-#define FALSE 0
-#ifndef TRUE
-#define TRUE 1
-#endif
-
-// Actions for computing the configuration
-#define E_ADD_MT 1
-#define E_REL_MT 3
-#define E_ADD_RB 5
-#define E_REL_RB 7
-
-// UE States
-#define RRC_CELL_IDLE  RRC_UE_IDLE           //0x01
-#define CONNECTED RRC_UE_CONNECTED           //0x02
-#define CELL_FACH RRC_UE_CONNECTED_CELL_FACH //0x06
-#define CELL_DCH  RRC_UE_CONNECTED_CELL_DCH  //0x0A
-#define CELL_PCH  16+CONNECTED
-// RG States
-#define Conn_Received        0x10
-#define CELL_FACH_Connecting 0x14
-#define CELL_DCH_Connecting  0x18
-#define CELL_FACH_Connected  RRC_RG_CONNECTED_CELL_FACH  //0x06
-#define CELL_DCH_Connected   RRC_RG_CONNECTED_CELL_DCH   //0x0A
-#define CELL_FACH_Releasing  0x24
-#define CELL_DCH_Releasing   0x28
-
-// RRC Messages Types (sent by)-- ESTEREL values
-#define RRC_CONN_REQ            11 //UE
-#define RRC_CONN_SETUP          12 //RG
-#define RRC_CONN_SETUP_COMPLETE 13 //UE
-#define RRC_CONN_REJECT         14 //RG
-#define RRC_CONN_RELEASE        15 //RG - UE
-#define RRC_CONN_REL_COMPLETE   16 //UE
-#define RB_SETUP                17 //RG
-#define RB_SETUP_COMPLETE       18 //UE
-#define RB_SETUP_FAILURE        19 //UE
-#define RB_RELEASE              21 //RG
-#define RB_RELEASE_COMPLETE     22 //UE
-#define RB_RELEASE_FAILURE      23 //UE
-#define CELL_UPDATE             25 //UE
-#define CELL_UPDATE_CONFIRM     26 //RG
-#define UE_CAPABILITY_INFO      27 //UE
-#define UE_CAPABILITY_INFO_CONF 28 //RG
-
-//
-#define REL_COUNT 3         // Nb RESEND RRC_CONNECTION_RELEASE by RG
-//#define N300 5000  // NB RETRY RRC_CONNECTION_REQUEST
-#define N300 500000         // L1 TEST
-#define N308 2              // NB RETRY RRC_CONNECTION_RELEASE_REQUEST
-
-
-#define T300_DURATION 2000  //in millisec
-
-// Timers ID
-#define RRC_T300 1
-
-// protocol state
-#define  RRC_UE_IDLE                   0x01
-#define  RRC_UE_CONNECTED              0x02
-#define  RRC_UE_CONNECTED_CELL_FACH    0x04 + RRC_UE_CONNECTED
-#define  RRC_UE_CONNECTED_CELL_DCH     0x08 + RRC_UE_CONNECTED
-#define  RRC_UE_REQUESTING             0x10
-
-#define  RRC_RG_IDLE                   0x01
-#define  RRC_RG_CONNECTED              0x02
-#define  RRC_RG_CONNECTED_CELL_FACH    0x04 + RRC_RG_CONNECTED
-#define  RRC_RG_CONNECTED_CELL_DCH     0x08 + RRC_RG_CONNECTED
-
-// protocol events
-#define  RRC_CONNECTION_REQUEST_EVENT           0x01
-#define  RRC_CONNECTION_REQUEST_TIME_OUT_EVENT  0x02
-#define  RRC_CONNECTION_SETUP_EVENT             0x04
-#define  RRC_CONNECTION_RELEASE_EVENT           0x08
-#define  RRC_CONNECTION_LOSS_EVENT              0x10
-
-// SIGNALLING RADIO BEARERS - OPENAIR
-#ifdef NODE_RG
-#define RRC_SRB_OFFSET 8
-#endif
-#ifdef NODE_MT
-#define RRC_SRB_OFFSET 0
-#endif
-
-//MW 19/9/2013 - Hard coded value of DRB_ID for rrc_ue_outputs.c
-#define RRC_OAI_DRB0_ID 3
-
-#define RRC_LTE_DCCH_ID  2+RRC_SRB_OFFSET  // for openair scheduling
-#define RRC_LCHAN_SRB0_ID  4+RRC_SRB_OFFSET  // traffic on CCCH
-#define RRC_LCHAN_SRB1_ID  5+RRC_SRB_OFFSET  // any traffic on DCCH using RLC-UM
-#define RRC_LCHAN_SRB2_ID  6+RRC_SRB_OFFSET  // AS traffic using RLC-AM
-#define RRC_LCHAN_SRB3_ID  7+RRC_SRB_OFFSET  // high priority NAS traffic using RLC-AM
-#define RRC_LCHAN_SRB4_ID  8+RRC_SRB_OFFSET  // low  priority NAS traffic using RLC-AM
-
-#define RRC_BCCH_ID 64  // Broadcast
-#define RRC_SRB0_ID  0  // traffic on CCCH
-#define RRC_SRB1_ID  1  // any traffic on DCCH using RLC-UM
-#define RRC_SRB2_ID  2  // AS traffic using RLC-AM
-#define RRC_SRB3_ID  3  // high priority NAS traffic using RLC-AM
-#define RRC_SRB4_ID  4  // low  priority NAS traffic using RLC-AM
-#define RRC_MCCH_ID  5  // MBMS Control
-
-
-// RB ESTABLISHMENT
-#define RB_STARTED  1
-#define RB_STOPPED  0
-//For PDCP
-#define RRC_RB_NO_USE_PDCP           0
-#define RRC_RB_USE_PDCP              1
-
-//Interface with RLC- Request or not confirmation
-// (cf rlc.h)
-#define RRC_RLC_CONFIRM_YES 1
-#define RRC_RLC_CONFIRM_NO  0
-
-// PROTOCOL ALLOC
-#define RRC_PROTOCOL_ENTITY_FREE         0x00
-#define RRC_PROTOCOL_ENTITY_ALLOCATED    0xAA
-
-// RB Release Error cause
-#define  RB_FAIL_IDLE_MOBILE         1
-#define  RB_FAIL_INVALID_QOS_VALUE   2
-#define  RB_FAIL_INVALID_CONFIG      3
-#define  RB_FAIL_RLC_FAILURE         4
-#define  RB_FAIL_PHY_CHANNEL_FAILURE 5
-#define  RB_FAIL_UE_SETUP_FAILURE    6
-
-
-// extension to 25.331
-#define maxCCTrCH_rg                32
-#define maxRB                       32
-#define maxTS                       15
-
-
-//The real value is defined in rrc_msg_constant.h
-#define ACCESS_STRATUM_RELEASE_INDICATOR_DEFAULT  ACCESS_STRATUM_RELEASE_INDICATOR_REL_6
-#define EURECOM_KERNEL_RELEASE_INDICATOR_DEFAULT  EURECOM_KERNEL_RELEASE_INDICATOR_REL_26
-
-////25.331
-#define maxCCTrCH                    8
-
-// Values from RHODOS26 - Temp to be removed
-#define JRRM_SLOTS_PER_FRAME 15L
-#define RRC_FRAME_DURATION 320*64/(6.5*1000)  // in ms - from Florian
-
-//Other RRM interface values
-#define RRC_CONNECTED_TO_RRM 0xCC
-
-#ifdef USER_MODE
-#define RPC_CONNECTION_REQUEST_TIME_OUT  2000   // in  ms
-#else
-#define RPC_CONNECTION_REQUEST_TIME_OUT  5000   // in ms
-#endif
-
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_mbms_constant.h b/openair2/RRC/CELLULAR/rrc_mbms_constant.h
deleted file mode 100755
index b1df168c4b..0000000000
--- a/openair2/RRC/CELLULAR/rrc_mbms_constant.h
+++ /dev/null
@@ -1,141 +0,0 @@
-/***************************************************************************
-                           rrc_mbms_constant.h
-                          -------------------
-   begin                : May 4, 2005
-   copyright            : (C) 2002, 2010 by Eurecom
-   author               : Michelle.Wetterwald@eurecom.fr, Huu-Nghia.Nguyen@eurecom.fr
-   goal                 : This file contains all the constants concerned with MBMS
-**************************************************************************/
-#ifndef _RRC_MBMS_CONSTANT_H_
-#define _RRC_MBMS_CONSTANT_H_
-#include "rrc_platform_types.h"
-
-#if defined(FALSE) && (FALSE != 0)
-#error FALSE was defined elsewhere with a none zero value  !!!
-#endif
-
-/********************************/
-/*  MBMS impl. specific types   */
-typedef int o3;  /* OctetString(3) */
-typedef  u8 mbms_bool; /* mbms_bool used in RRC MBMS */
-
-
-/********************************/
-/*  MBMS impl. constants        */
-//Data size
-#define MBMS_MAX_BUFFER_SIZE 512
-//#define MBMS_SERVICE_IDENTITY_SIZE  3
-#define MBMS_MIN_TRANSACTION_ID 3
-#define MBMS_DEFAULT_CGID 1 // default Cell Group Identity
-
-//Channels for the test
-#define MCCH_ID 0
-#define DCCH_ID 1
-#define MSCH_ID 2
-
-//States for FSM
-#define ACQUI_START  0
-#define ACQUI_I_ACQUISITION 1
-#define ACQUI_WAIT_MBMS_MSG 2
-
-//MBMS Message header + length
-#define MCCH_MSG_HEAD_LGTH           4 //type only, no integrity check
-#define MSCH_MSG_HEAD_LGTH           4 //type only, no integrity check
-#define MBMS_MAX_NEIGBOURING_COUNT   4 // Temp
-#define MBMS_L12_CONFIGURATION_SIZE  200
-#define NEIGHBOUR_CONFIGURATION_SIZE 200 //Size of neighbouring cell's configuration
-#define MTCH_CONFIGURATION_SIZE      400
-//Default value for Scheduling
-#define ACCESS_PERIOD_COEF_DEFAULT    2  //[0..3] HGN 2
-#define REPETITION_PERIOD_COEF_DEFAULT 1  //[0..3] HGN 3
-#define MODIF_PERIOD_COEF_DEFAULT       7  //[7..10] HGN 7
-#define SCHED_PERIOD_COEF_DEFAULT       3
-
-//SHOULD BE IDENTICAL WITH MAX_MBMS_SERVICES in rrc_nas_primitives.h
-#define maxMBMSServices  4
-
-//Service Type defined in MBMS Activated Services List
-//FFS
-#define MBMS_MULTICAST  5
-#define MBMS_BROADCAST  8
-
-/********************************/
-/*  Defined in TS 25.331        */
-
-//Values of T_318, use  these constants instead of enumeration in standard T25.331
-#define ms250   250
-#define ms500   500
-#define ms750   750
-#define ms1000  1000
-#define ms1250  1250
-#define ms1500  1500
-#define ms1750  1750
-#define ms2000  2000
-#define ms3000  3000
-#define ms4000  4000
-#define ms6000  6000
-#define ms8000  8000
-#define ms10000 10000
-#define ms12000 12000
-#define ms16000 16000
-
-//Values of Access Probability Factor. use these constants instead of enumertion in TS25.331
-#define apf0 0
-#define apf32 32
-#define apf64 64
-#define apf96 96
-#define apf128 128
-#define apf160 160
-#define apf192 192
-#define apf224 224
-#define apf256 256
-#define apf288 288
-#define apf320 320
-#define apf352 352
-#define apf384 384
-#define apf416 416
-#define apf448 448
-#define apf480 480
-#define apf512 512
-#define apf544 544
-#define apf576 576
-#define apf608 608
-#define apf640 640
-#define apf672 672
-#define apf704 704
-#define apf736 736
-#define apf768 768
-#define apf800 800
-#define apf832 832
-#define apf864 864
-#define apf896 896
-#define apf928 928
-#define apf960 960
-#define apf1000 1000
-
-//Values of MBMS_RequiredUEAction_Mod, use these constants instead of enum in TS25.331
-#define Mod_none                   0
-#define Mod_acquireCountingInfo    1 //not on DCCH
-#define Mod_acquirePTM_RBInfo      2
-#define Mod_establishPMMConnection 3 //not used
-#define Mod_releasePTM_RB          4
-
-//Values of MBMS_RequiredUEAction_UMod. use these constants instead of enum in TS25.331
-#define UMod_none                   0
-#define UMod_acquirePTM_RBInfo      1
-#define UMod_establishPMMConnection 2
-#define UMod_releasePTM_RB          3
-
-//#define maxMBMS_CommonCCTrCh  32
-//#define maxMBMS_CommonPhyCh   32
-//#define maxMBMS_CommonRB      32
-//#define maxMBMS_CommonTrCh    32
-#define maxMBMSservCount    4  // spec v6.a.0 = 8
-//#define maxMBMSservDedic    4 // spec v6.a.0 removed
-#define maxMBMSservModif    4  // spec v6.a.0 = 32
-#define maxMBMSservUnmodif  4  // spec v6.a.0 = 64
-#define maxMBMSservSched    4  // spec v6.a.0 = 16
-
-#define maxMBMSTransmis     4
-
-#endif //_RRC_MBMS_CONSTANT_H_
diff --git a/openair2/RRC/CELLULAR/rrc_mbms_ies.h b/openair2/RRC/CELLULAR/rrc_mbms_ies.h
deleted file mode 100755
index ac603ea3a9..0000000000
--- a/openair2/RRC/CELLULAR/rrc_mbms_ies.h
+++ /dev/null
@@ -1,179 +0,0 @@
-/***************************************************************************
-                          rrc_mbms_ies.h - description
-                          -------------------
-    begin               : May 9, 2005
-    copyright           : (C) 2005, 2010 by Eurecom
-    created by          : Huu-Nghia.Nguyen@eurecom.fr
-    modified by         : Michelle.Wetterwald@eurecom.fr
-    goal    : This file contains definitions of IEs for MBMS messages
- **************************************************************************/
-
-#ifndef _RRC_MBMS_IES_H_
-#define _RRC_MBMS_IES_H_
-
-#include "rrc_platform_types.h"
-#include "rrc_mbms_constant.h"
-
-/**************************************************************/
-/*  MBMSAccessInformation                                     */
-/**************************************************************/
-/* MBMS-ShortTransmissionID */
-typedef u16 MBMS_ShortTransmissionID; /* 1..32 */
-
-/* MBMS_AccessProbabilityFactor */
-typedef u16 MBMS_AccessProbabilityFactor;
-
-/* MBMS_ServiceAccessInfo-r6 */
-typedef struct MBMS_ServiceAccessInfo {
-  MBMS_ShortTransmissionID      shortTransmissionID;
-  MBMS_AccessProbabilityFactor  accessprobabilityFactor_Idle;
-  //MBMS_AccessProbabilityFactor  accessprobabilityFactor_UraPCH /* OPTIONAL */;
-} MBMS_ServiceAccessInfo;
-
-/* MBMS_ServiceAccessInfoList */
-typedef struct MBMS_ServiceAccessInfoList {
-  u8 numAccessInfo; //0..maxMBMSservCount (=4)
-  MBMS_ServiceAccessInfo accessInfo[maxMBMSservCount];
-} MBMS_ServiceAccessInfoList;
-
-/**************************************************************/
-/* MBMSGeneralInformation                                     */
-/**************************************************************/
-typedef u16 T_318;
-
-/* MBMS_TimersAndCounters */
-typedef struct MBMS_TimersAndCounters {
-  T_318   t_318  /* DEFAULT 3 <-- ms1000 */;
-} MBMS_TimersAndCounters;
-
-/* MBMS_CellGroupIdentity */
-typedef  u16  MBMS_CellGroupIdentity; /** Bit string (12) coded in u16 */
-
-/**************************************************************/
-/* MBMSCommonPTMRBInformation                                 */
-/**************************************************************/
-
-/* L1L2Configuration */
-//HGN typedef u8 MBMS_L12Configuration[MBMS_L12_CONFIGURATION_SIZE];
-typedef struct MTCH_Configuration {
-  u16 numoctets;
-  u8 data[MTCH_CONFIGURATION_SIZE];
-} MTCH_Configuration;
-
-/**************************************************************/
-/* MBMSCurrentCellPTMRBInformation                            */
-/**************************************************************/
-/* L1L2Configuration cf. MBMSCommonPTMRBInformation*/
-
-/**************************************************************/
-/* MBMSNeighbouringCellPTMRBInformation                       */
-/**************************************************************/
-/*  NeighbourCellIdentity  */
-typedef u8 NeighbourCellIdentity;
-
-/* NeighbouringCellConfiguration */
-//typedef u8 MBMS_NeighbouringCellConfiguration[MBMS_NEIGHBOURING_CONFIGURATION_SIZE];
-typedef struct NeighbouringCellConfiguration {
-  u16 numoctets;
-  u8 data[NEIGHBOUR_CONFIGURATION_SIZE];
-} NeighbouringCellConfiguration;
-
-/**************************************************************/
-/* MBMSModifiedServicesInformation                            */
-/**************************************************************/
-/* MBMS-ServiceIdentity */
-typedef struct MBMS_ServiceIdentity {
-  u8  serviceIdentity[3];
-  // PLMN_Identity plmn_Identity; //Not needed, assumed that this is the same value in BCH
-} MBMS_ServiceIdentity;
-
-/* MBMS_SessionIdentity */
-typedef u8 MBMS_SessionIdentity;
-
-/* MBMS-TransmissionIdentity */
-typedef struct MBMS_TransmissionIdentity {
-  MBMS_ServiceIdentity mbms_ServiceIdentity;
-  MBMS_SessionIdentity mbms_SessionIdentity;
-} MBMS_TransmissionIdentity;
-
-/* MBMS_RequiredUEAction_Mod */
-/*  values defined in rrc_mbms_constant.h */
-typedef u16 MBMS_RequiredUEAction_Mod;
-
-/* MBMS-ModifiedService-r6 */
-typedef struct MBMS_ModifiedService {
-  MBMS_TransmissionIdentity  mbms_TransmissionIdentity;
-  MBMS_RequiredUEAction_Mod  mbms_RequiredUEAction;
-  mbms_bool                  continueMCCHReading;
-} MBMS_ModifiedService;
-
-/* MBMS_ModifiedServiceList */
-typedef struct MBMS_ModifiedServiceList {
-  u16 numService; //0..maxMBMSservModif
-  MBMS_ModifiedService mbms_modifiedServices[maxMBMSservModif];
-} MBMS_ModifiedServiceList;
-/****/
-// mbms_ReacquireMCCH;   //ENUMERATED { true }
-// mbms_AllUnmodifiedPTMServices   //ENUMERATED { true }
-// are defined directly in the PDU, same as done in ASN1
-
-/* MBMS-NumberOfNeighbourCells */
-// INTEGER (0..32)
-typedef u16 MBMS_NumberOfNeighbourCells;
-
-/* MBMS-PTMActivationTime */
-// INTEGER (0..2047)
-typedef u16 MBMS_PTMActivationTime;
-
-
-/**************************************************************/
-/* MBMSUnmodifiedServicesInformation                          */
-/**************************************************************/
-/* MBMS-TransmissionIdentity cf. MBMSModifiedServicesInformation*/
-
-/* MBMS_RequiredUEAction_UMod */
-/*  values defined in rrc_mbms_constant.h */
-typedef u16 MBMS_RequiredUEAction_UMod;
-
-/* MBMS_UnmodifiedService */
-typedef struct MBMS_UnmodifiedService {
-  MBMS_TransmissionIdentity  mbms_TransmissionIdentity;
-  MBMS_RequiredUEAction_UMod mbms_RequiredUEAction;
-} MBMS_UnmodifiedService;
-
-/* MBMS_UnmodifiedServiceList  */
-typedef struct MBMS_UnmodifiedServiceList {
-  u16 numService;   //0..maxMBMSservUnmodif
-  MBMS_UnmodifiedService unmodifiedServices[maxMBMSservUnmodif];
-} MBMS_UnmodifiedServiceList;
-
-
-/**************************************************************/
-/* MBMSSchedulingInformation                                  */
-/**************************************************************/
-/* MBMS-ServiceTransmInfo */
-// Spec : Actual values (start, duration) = IE values * 4
-typedef struct MBMS_ServiceTransmInfo {
-  u16  start;     //0..1020 by step of 4
-  u16  duration;  //4..1024
-} MBMS_ServiceTransmInfo;
-
-/* MBMS_ServiceTransmInfoList */
-typedef struct MBMS_ServiceTransmInfoList  {
-  u16 numInfo; //0..maxMBMSTransmis  ( = 4)
-  MBMS_ServiceTransmInfo serviceTransmissionInfo[maxMBMSTransmis];
-} MBMS_ServiceTransmInfoList;
-
-/* MBMS_ServiceSchedulingInfo */
-typedef struct MBMS_ServiceSchedulingInfo {
-  MBMS_TransmissionIdentity  mbms_TransmissionIdentity;
-  MBMS_ServiceTransmInfoList mbms_TransmissionInfoList;
-  u16  nextSchedulingPeriod;  //0..31
-} MBMS_ServiceSchedulingInfo;
-
-typedef struct MBMS_ServiceSchedulingInfoList {
-  u16 numInfo;   //0..maxMBMSservSched ( = 16)
-  MBMS_ServiceSchedulingInfo schedulingInfo[maxMBMSservSched];
-} MBMS_ServiceSchedulingInfoList;
-
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_mbms_pdus.c b/openair2/RRC/CELLULAR/rrc_mbms_pdus.c
deleted file mode 100755
index bb8f772c2d..0000000000
--- a/openair2/RRC/CELLULAR/rrc_mbms_pdus.c
+++ /dev/null
@@ -1,660 +0,0 @@
-/***************************************************************************
-                          rrc_mbms_pdus.c - description
-                          -------------------
-    begin               : May 9, 2005
-    copyright           : (C) 2005, 2010 by Eurecom
-    created by          : Michelle.Wetterwald@eurecom.fr, Huu-Nghia.Nguyen@eurecom.fr
-    modified by         :
- **************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#ifdef NODE_MT
-#include "rrc_ue_vars.h"
-#endif
-#ifdef NODE_RG
-#include "rrc_rg_vars.h"
-#endif
-#include "rrc_mbms_pdus.h"
-// #include "rrc_msg_class.h"
-// #include "rrc_rg_mbms_variables.h"
-// #include "rrc_ue_mbms_variables.h"
-//-----------------------------------------------------------------------------
-//#include "rrc_proto_mbms.h"
-
-
-/**
- * @brief Test if x is in range of (low .. high)
- * @param x: value to be tested
- * @param low: the lower bound
- * @param high: the upper bound
- * @return P_SUCCESS if ok, else P_INVVALUE if not ok.
- */
-int checkRange(int x, int low, int high)
-{
-  return (x < low || x > high) ? P_INVVALUE: P_SUCCESS;
-}
-
-//////////////////////////////////////////////////////////////////////////////////////////////////
-//MBMSAccessInformation
-#ifdef NODE_RG
-//-----------------------------------------------------------------------------
-int rrc_PEREnc_MBMSAccessInformation (MBMSAccessInformation * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  int i;
-
-  status =  checkRange(protocol_bs->rrc.mbms.acc_numAccessInfo, 0, maxMBMSservCount);
-
-  if (status == P_SUCCESS) {
-    pvalue->mbms_ServiceAccessInfoList.numAccessInfo = protocol_bs->rrc.mbms.acc_numAccessInfo;
-
-    for (i = 0; i<protocol_bs->rrc.mbms.acc_numAccessInfo; i++) {
-      pvalue->mbms_ServiceAccessInfoList.accessInfo[i].shortTransmissionID = protocol_bs->rrc.mbms.acc_shortTransmissionID[i];
-      pvalue->mbms_ServiceAccessInfoList.accessInfo[i].accessprobabilityFactor_Idle = protocol_bs->rrc.mbms.acc_accessprobabilityFactor_Idle[i];
-    }
-  }
-
-#ifdef DEBUG_RRC_MBMS
-  msg("[RRC-RG][MBMS] Encode MBMSAccessInformation, status %d\n", status);
-#endif
-  return status;
-}
-#endif
-#ifdef NODE_MT
-//-----------------------------------------------------------------------------
-int rrc_PERDec_MBMSAccessInformation (MBMSAccessInformation * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  int i;
-
-  status =  checkRange(pvalue->mbms_ServiceAccessInfoList.numAccessInfo, 0, maxMBMSservCount);
-
-  if (status == P_SUCCESS) {
-    protocol_ms->rrc.mbms.acc_numAccessInfo = pvalue->mbms_ServiceAccessInfoList.numAccessInfo;
-
-    for (i = 0; i<protocol_ms->rrc.mbms.acc_numAccessInfo; i++) {
-      protocol_ms->rrc.mbms.acc_shortTransmissionID[i] = pvalue->mbms_ServiceAccessInfoList.accessInfo[i].shortTransmissionID;
-      protocol_ms->rrc.mbms.acc_accessprobabilityFactor_Idle[i] = pvalue->mbms_ServiceAccessInfoList.accessInfo[i].accessprobabilityFactor_Idle;
-    }
-  }
-
-#ifdef DEBUG_RRC_MBMS
-  msg("[RRC-UE][MBMS] Decode MBMSAccessInformation, status %d\n", status);
-#endif
-  return status;
-}
-#endif
-
-//////////////////////////////////////////////////////////////////////////////////////////////////
-//MBMSGeneralInformation
-#ifdef NODE_RG
-//-----------------------------------------------------------------------------
-int rrc_PEREnc_MBMSGeneralInformation (MBMSGeneralInformation * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  status = checkRange(protocol_bs->rrc.mbms.gen_t_318, ms250, ms16000)
-           || checkRange(protocol_bs->rrc.mbms.gen_cellGroupIdentity, 0, 0xFFF);
-
-  if (status == P_SUCCESS) {
-    //Timers and Counters
-    pvalue->mbms_TimersAndCounters.t_318 = protocol_bs->rrc.mbms.gen_t_318;
-
-    //Cell group identity
-    pvalue->cellGroupIdentity = protocol_bs->rrc.mbms.gen_cellGroupIdentity;
-  }
-
-#ifdef DEBUG_RRC_MBMS
-  msg("[RRC-RG][MBMS] Encode MBMS General Information, status %d\n", status);
-#endif
-  return status;
-}
-#endif
-#ifdef NODE_MT
-//-----------------------------------------------------------------------------
-int rrc_PERDec_MBMSGeneralInformation (MBMSGeneralInformation * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  status = checkRange(pvalue->mbms_TimersAndCounters.t_318, ms250, ms16000)
-           || checkRange(pvalue->cellGroupIdentity, 0, 0xFFF);
-
-  if (status == P_SUCCESS) {
-    //Timers and Counters
-    protocol_ms->rrc.mbms.gen_t_318 = pvalue->mbms_TimersAndCounters.t_318;
-
-    //Cell group identity
-    protocol_ms->rrc.mbms.gen_cellGroupIdentity = pvalue->cellGroupIdentity;
-  }
-
-#ifdef DEBUG_RRC_MBMS
-  msg("[RRC-UE][MBMS] Decode MBMS General Information, status %d\n", status);
-#endif
-
-  return status;
-}
-#endif
-
-
-//////////////////////////////////////////////////////////////////////////////////////////////////
-//MBMSCommonPTMRBInformation
-#ifdef NODE_RG
-//-----------------------------------------------------------------------------
-int rrc_PEREnc_MBMSCommonPTMRBInformation (MBMSCommonPTMRBInformation * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  int buff_length;
-  char * pwrite;
-
-  //L1-L2 Configuration
-  // HGN memcpy(pvalue->l12Configuration, protocol_bs->rrc.mbms.comm_l12Configuration, MBMS_L12_CONFIGURATION_SIZE);
-  //
-  /* encode mbms_common_configuration */
-  //rrc_compress_buffer(new_conf,90, new_conf, &buff_length);
-  buff_length = protocol_bs->rrc.mbms.comm_l12Config_lgth; //Temp
-
-  pwrite = (char *)  &(pvalue->l12Configuration.numoctets);
-  protocol_bs->rrc.mbms.curr_Message.msg_length = pwrite - (char *)pvalue + MSG_HEAD_LGTH;
-
-  *(u16*)pwrite = buff_length ;
-  pwrite +=2;
-  memcpy(pwrite,&(protocol_bs->rrc.mbms.comm_l12Config_data), buff_length);
-#ifdef DEBUG_RRC_MBMS
-  //   msg("\n[RRC_MSG] Buffer length - 1 : %d\n",
-  //                protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-#endif
-  protocol_bs->rrc.mbms.curr_Message.msg_length += buff_length + 2;
-#ifdef DEBUG_RRC_MBMS
-  //   msg("\n[RRC_MSG] Buffer length - 2 : %d\n",
-  //                protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-#endif
-
-  //
-#ifdef DEBUG_RRC_MBMS
-  msg("[RRC-RG][MBMS] Encode MBMS Common PTM RB Information, status %d\n", status);
-#endif
-
-  return status;
-}
-#endif
-#ifdef NODE_MT
-//-----------------------------------------------------------------------------
-int rrc_PERDec_MBMSCommonPTMRBInformation (MBMSCommonPTMRBInformation * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int buff_length;
-  char * buff_ptr;
-  int status = P_SUCCESS;
-
-  //L1-L2 Configuration
-  // HGN memcpy(protocol_ms->rrc.mbms.comm_l12Configuration, pvalue->l12Configuration, MBMS_L12_CONFIGURATION_SIZE);
-
-  /* decode mbms_common_configuration */
-  buff_ptr = (char *)(&(pvalue->l12Configuration.numoctets));
-  buff_ptr += 2;
-  //TEMP
-  buff_length = pvalue->l12Configuration.numoctets;
-  //rrc_uncompress_buffer(buff_ptr,(u16)pvalue->ue_Configuration.numoctets, buff_ptr, &buff_length);
-  memcpy(&(protocol_ms->rrc.mbms.comm_l12Config_data), buff_ptr , buff_length);
-  protocol_ms->rrc.mbms.comm_l12Config_lgth = buff_length;
-
-#ifdef DEBUG_RRC_MBMS_DETAIL
-  msg("\n[RRC_MSG] Received MBMS Configuration : \n");
-  rrc_print_buffer(buff_ptr, buff_length);
-#endif
-
-#ifdef DEBUG_RRC_MBMS
-  msg("[RRC-UE][MBMS] Decode MBMS Common PTM RB Information, status %d\n", status);
-#endif
-  return status;
-}
-#endif
-
-
-//////////////////////////////////////////////////////////////////////////////////////////////////
-//MBMSCurrentCellPTMRBInformation
-#ifdef NODE_RG
-//-----------------------------------------------------------------------------
-int rrc_PEREnc_MBMSCurrentCellPTMRBInformation (MBMSCurrentCellPTMRBInformation * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  char * pwrite;
-  int buff_length;
-  int status = P_SUCCESS;
-
-  /* encode mbms_current_configuration */
-  pwrite = (char *)  &(pvalue->l12Configuration.numoctets);
-  protocol_bs->rrc.mbms.curr_Message.msg_length = pwrite - (char *)pvalue + MSG_HEAD_LGTH;
-
-  buff_length = protocol_bs->rrc.mbms.curr_l12Config_lgth;
-
-  if (buff_length <= MTCH_CONFIGURATION_SIZE) {
-    *(u16*)pwrite = buff_length ;
-    pwrite +=2;
-    memcpy(pwrite,&(protocol_bs->rrc.mbms.curr_l12Config_data), buff_length);
-    protocol_bs->rrc.mbms.curr_Message.msg_length += buff_length + 2;
-  } else {
-    msg("\n\n[RRC_RG][MBMS] ERROR Encode MBMS Current Cell PTM RB Information , too large: %d\n\n\n", buff_length);
-  }
-
-#ifdef DEBUG_RRC_MBMS_DETAIL
-  msg("[RRC_RG][MBMS] Sent Current Cell PTM RB Information\n");
-  rrc_print_buffer(pwrite, buff_length);
-#endif
-#ifdef DEBUG_RRC_MBMS
-  //   msg("\n[RRC_RG][MBMS] Buffer length  : %d\n",
-  //                protocol_bs->rrc.mbms.curr_Message.msg_length);
-  msg("[RRC_RG][MBMS] Encode MBMS Current Cell PTM RB Information , status %d\n", status);
-#endif
-  return status;
-}
-#endif
-
-#ifdef NODE_MT
-//-----------------------------------------------------------------------------
-int rrc_PERDec_MBMSCurrentCellPTMRBInformation (MBMSCurrentCellPTMRBInformation * pvalue)
-{
-  //-----------------------------------------------------------------------------
-
-  int buff_length;
-  char * buff_ptr;
-  int status = P_SUCCESS;
-
-  /* decode mbms_current_configuration */
-  buff_ptr = (char *)(&(pvalue->l12Configuration.numoctets));
-  buff_ptr += 2;
-  buff_length = pvalue->l12Configuration.numoctets;
-  memcpy(&(protocol_ms->rrc.mbms.curr_l12Config_data), buff_ptr , buff_length);
-  protocol_ms->rrc.mbms.curr_l12Config_lgth = buff_length;
-#ifdef DEBUG_RRC_MBMS_DETAIL
-  msg("\n[RRC_MSG] Received MBMS Configuration : \n");
-  rrc_print_buffer(buff_ptr, pvalue->l12Configuration.numoctets);
-#endif
-
-#ifdef DEBUG_RRC_MBMS
-  msg("[RRC-UE][MBMS] Decode MBMS Current Cell PTM RB Information , status %d\n", status);
-#endif
-  return status;
-}
-#endif
-
-//////////////////////////////////////////////////////////////////////////////////////////////////
-//MBMSNeighbouringCellPTMRBInformation
-#ifdef NODE_RG
-//-----------------------------------------------------------------------------
-int rrc_PEREnc_MBMSNeighbouringCellPTMRBInformation (int cellIndex, MBMSNeighbouringCellPTMRBInformation * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  if (cellIndex >= protocol_bs->rrc.mbms.neighb_cellCount || cellIndex < 0)
-    status = P_OUTOFBOUNDS;
-  else {
-    //Validate the cellID: must be >= 1
-    if (protocol_bs->rrc.mbms.neighb_cellIDList[cellIndex] < 1)
-      status = P_INVVALUE;
-    else {
-      //neighbouring Cell identity
-      pvalue->neighbouringCellIdentity = protocol_bs->rrc.mbms.neighb_cellIDList[cellIndex]; //neighbCellID;
-#ifdef DEBUG_RRC_MBMS
-      msg("[RRC][MBMS] encode neighbouringCellIdentity = %d\n", (u32) pvalue->neighbouringCellIdentity);
-#endif
-      //Neighbouring Cell Config
-      pvalue->neighbouringCellConfig.numoctets = protocol_bs->rrc.mbms.neighb_cellConf_lgth[cellIndex];
-      memcpy(pvalue->neighbouringCellConfig.data, protocol_bs->rrc.mbms.neighb_cellConf_data[cellIndex], NEIGHBOUR_CONFIGURATION_SIZE);
-    }
-  }
-
-#ifdef DEBUG_RRC_MBMS
-  msg("[RRC-RG][MBMS] Encode MBMS Neigbouring Cell PTM Information, status %d\n", status);
-#endif
-  return status;
-}
-#endif
-#ifdef NODE_MT
-//-----------------------------------------------------------------------------
-int rrc_PERDec_MBMSNeighbouringCellPTMRBInformation (int *pCellIndex, MBMSNeighbouringCellPTMRBInformation * pvalue)
-{
-  //-----------------------------------------------------------------------------
-
-  int status = P_SUCCESS;
-  int index ;
-
-  if (pvalue->neighbouringCellIdentity < 1)
-    status = P_INVVALUE;
-  else {
-    for (index = 0; index < protocol_ms->rrc.mbms.neighb_cellCount; index ++)
-      if (protocol_ms->rrc.mbms.neighb_cellIDList[index] == pvalue->neighbouringCellIdentity)
-        break;
-
-    //index will be the position to be written:
-    //overwrite if found / insert into the array if not found.
-
-    if (index >= MBMS_MAX_NEIGBOURING_COUNT)
-      status = P_OUTOFBOUNDS;
-    else {
-      //neighbouring Cell identity
-      protocol_ms->rrc.mbms.neighb_cellIDList[index] = pvalue->neighbouringCellIdentity;
-
-      //Neighbouring Cell Config
-      protocol_ms->rrc.mbms.neighb_cellConf_lgth[index]= pvalue->neighbouringCellConfig.numoctets;
-      memcpy(protocol_ms->rrc.mbms.neighb_cellConf_data[index], pvalue->neighbouringCellConfig.data, NEIGHBOUR_CONFIGURATION_SIZE);
-
-      if (index >= protocol_ms->rrc.mbms.neighb_cellCount)
-        protocol_ms->rrc.mbms.neighb_cellCount++;
-      else msg("[RRC-UE][MBMS] Neigbouring Cell exist, overwritten!\n");
-    }
-  }
-
-#ifdef DEBUG_RRC_MBMS
-  msg("[RRC-UE][MBMS] Decode MBMS Neigbouring Cell PTM Information %dth, status %d\n", *pCellIndex, status);
-#endif
-  return status;
-}
-#endif
-
-//////////////////////////////////////////////////////////////////////////////////////////////////
-//MBMSModifiedServicesInformation
-// To DO (MW) - Separate encoding and decoding according to MCCH and DCCH
-#ifdef NODE_RG
-//-----------------------------------------------------------------------------
-int rrc_PEREnc_MBMSModifiedServicesInformation (MBMSModifiedServicesInformation * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  int i;
-
-  //Invalidate
-  status = checkRange(protocol_bs->rrc.mbms.mod_numService, 0, maxMBMSservModif)
-           || checkRange(protocol_bs->rrc.mbms.mod_numberOfNeighbourCells, 0, 32)
-           || checkRange(protocol_bs->rrc.mbms.mod_ptm_activationTime, 0, 2047);
-
-  //      || checkRange(protocol_bs->rrc.mbms.mod_endOfModifiedMCCHInformation, 1, 15);
-  if (status == P_SUCCESS) {
-    //Modified service list
-    pvalue->modifiedServiceList.numService = protocol_bs->rrc.mbms.mod_numService;
-
-    for (i = 0; i<protocol_bs->rrc.mbms.mod_numService; i++) {
-      //Transmission Identity
-      memcpy(pvalue->modifiedServiceList.mbms_modifiedServices[i].mbms_TransmissionIdentity.mbms_ServiceIdentity.serviceIdentity,
-             &protocol_bs->rrc.mbms.mod_serviceIdentity[i], 3);
-      pvalue->modifiedServiceList.mbms_modifiedServices[i].mbms_TransmissionIdentity.mbms_SessionIdentity =
-        protocol_bs->rrc.mbms.mod_sessionIdentity[i];
-      //Required UE action
-      pvalue->modifiedServiceList.mbms_modifiedServices[i].mbms_RequiredUEAction = protocol_bs->rrc.mbms.mod_requiredUEAction[i];
-    }
-
-    //MBMS reaquire MCCH
-    pvalue->mbms_ReacquireMCCH = protocol_bs->rrc.mbms.mod_reacquireMCCH;
-
-    //End of modified MCCH information
-    //pvalue->endOfModifiedMCCHInformation = protocol_bs->rrc.mbms.mod_endOfModifiedMCCHInformation;
-
-    //MBMS_NumberOfNeighbourCells
-    pvalue->mbmsNumberOfNeighbourCells = protocol_bs->rrc.mbms.mod_numberOfNeighbourCells;
-    //MBMS_PTMActivationTime
-    pvalue->mbms_PTMActivationTime = protocol_bs->rrc.mbms.mod_ptm_activationTime;
-  }
-
-#ifdef DEBUG_RRC_MBMS
-  msg("[RRC-RG][MBMS] Encode MBMS Modified Service Information, status %d\n", status);
-#endif
-  return status;
-}
-#endif
-#ifdef NODE_MT
-//-----------------------------------------------------------------------------
-int rrc_PERDec_MBMSModifiedServicesInformation (MBMSModifiedServicesInformation * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  int i;
-
-  status = checkRange(pvalue->modifiedServiceList.numService, 0, maxMBMSservModif)
-           || checkRange(pvalue->mbmsNumberOfNeighbourCells, 0, 32)
-           || checkRange(pvalue->mbms_PTMActivationTime, 0, 2047);
-  //      || checkRange(pvalue->endOfModifiedMCCHInformation, 1, 15);
-
-  if (status == P_SUCCESS) {
-
-    //Modified service list
-    protocol_ms->rrc.mbms.mod_numService = pvalue->modifiedServiceList.numService;
-
-    for (i = 0; i<protocol_ms->rrc.mbms.mod_numService; i++) {
-      //Transmission Identity
-      protocol_ms->rrc.mbms.mod_serviceIdentity[i] = 0;
-      memcpy(&protocol_ms->rrc.mbms.mod_serviceIdentity[i],
-             pvalue->modifiedServiceList.mbms_modifiedServices[i].mbms_TransmissionIdentity.mbms_ServiceIdentity.serviceIdentity,
-             3);
-      protocol_ms->rrc.mbms.mod_sessionIdentity[i]=
-        pvalue->modifiedServiceList.mbms_modifiedServices[i].mbms_TransmissionIdentity.mbms_SessionIdentity;
-      //Required UE action
-      protocol_ms->rrc.mbms.mod_requiredUEAction[i] =
-        pvalue->modifiedServiceList.mbms_modifiedServices[i].mbms_RequiredUEAction;
-    }
-
-    //MBMS reaquire MCCH
-    protocol_ms->rrc.mbms.mod_reacquireMCCH = pvalue->mbms_ReacquireMCCH;
-    //End of modified MCCH information
-    //protocol_ms->rrc.mbms.mod_endOfModifiedMCCHInformation = pvalue->endOfModifiedMCCHInformation;
-    //MBMS_NumberOfNeighbourCells
-    protocol_ms->rrc.mbms.mod_numberOfNeighbourCells = pvalue->mbmsNumberOfNeighbourCells;
-    //MBMS_PTMActivationTime
-    protocol_ms->rrc.mbms.mod_ptm_activationTime = pvalue->mbms_PTMActivationTime;
-  }
-
-#ifdef DEBUG_RRC_MBMS
-  msg("[RRC-UE][MBMS] Decode MBMS Modified Services Information, status %d\n", status);
-#endif
-  return status;
-}
-#endif
-
-//////////////////////////////////////////////////////////////////////////////////////////////////
-//MBMSUnmodifiedServicesInformation
-#ifdef NODE_RG
-//-----------------------------------------------------------------------------
-int rrc_PEREnc_MBMSUnmodifiedServicesInformation (MBMSUnmodifiedServicesInformation * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  int i;
-
-  status = checkRange(protocol_bs->rrc.mbms.umod_numService, 0, maxMBMSservUnmodif);
-
-  if (status == P_SUCCESS) {
-    //UnModified service list
-    pvalue->unmodifiedServiceList.numService = protocol_bs->rrc.mbms.umod_numService;
-
-    for (i = 0; i<protocol_bs->rrc.mbms.umod_numService; i++) {
-      //Transmission Identity
-      memcpy(
-        pvalue->unmodifiedServiceList.unmodifiedServices[i].mbms_TransmissionIdentity.mbms_ServiceIdentity.serviceIdentity,
-        &protocol_bs->rrc.mbms.umod_serviceIdentity[i],
-        3); //Octetstring (3)
-
-      //Required UE action
-      pvalue->unmodifiedServiceList.unmodifiedServices[i].mbms_RequiredUEAction = protocol_bs->rrc.mbms.umod_requiredUEAction[i];
-    }
-  }
-
-#ifdef DEBUG_RRC_MBMS
-  msg("[RRC-RG][MBMS] Encode MBMS Unmodified Services Information, status %d\n", status);
-#endif
-  return status;
-}
-#endif
-#ifdef NODE_MT
-//-----------------------------------------------------------------------------
-int rrc_PERDec_MBMSUnmodifiedServicesInformation (MBMSUnmodifiedServicesInformation * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  int i;
-  status = checkRange(pvalue->unmodifiedServiceList.numService, 0, maxMBMSservUnmodif);
-
-  if (status == P_SUCCESS) {
-    //UnModified service list
-    protocol_ms->rrc.mbms.umod_numService = pvalue->unmodifiedServiceList.numService;
-
-    for (i = 0; i<protocol_ms->rrc.mbms.umod_numService; i++) {
-      //Transmission Identity
-      protocol_ms->rrc.mbms.umod_serviceIdentity[i] = 0;
-      memcpy(&protocol_ms->rrc.mbms.umod_serviceIdentity[i],
-             pvalue->unmodifiedServiceList.unmodifiedServices[i].mbms_TransmissionIdentity.mbms_ServiceIdentity.serviceIdentity,
-             3); //Octetstring (3)
-
-      //      memcpy(&
-      //        &pvalue->unmodifiedServiceList.unmodifiedServices[i].mbms_TransmissionIdentity.mbms_ServiceIdentity.plmn_Identity,
-      //        sizeof(PLMN_Identity));
-
-      //Required UE action
-      protocol_ms->rrc.mbms.umod_requiredUEAction[i] = pvalue->unmodifiedServiceList.unmodifiedServices[i].mbms_RequiredUEAction;
-      //      msg("[RRC][UE] ue->umod_requiredUEAction[%d] = %d\n", i, protocol_ms->rrc.mbms.umod_requiredUEAction[i]);
-    }
-  }
-
-#ifdef DEBUG_RRC_MBMS
-  msg("[RRC-UE][MBMS] Decode MBMS Unmodified Services Information, status %d\n", status);
-#endif
-  return status;
-}
-#endif
-
-//////////////////////////////////////////////////////////////////////////////////////////////////
-//MBMSSchedulingInformation
-#ifdef NODE_RG
-//-----------------------------------------------------------------------------
-int rrc_PEREnc_MBMSSchedulingInformation (MBMSSchedulingInformation * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  int i, j;
-  //pointer to the ith MBMS Service Scheduling Info in the list
-  MBMS_ServiceSchedulingInfo * pschedInfo;
-  //pointer to the Transmission Info in a MBMS Service Scheduling Info
-  MBMS_ServiceTransmInfo * ptransInfo;
-
-  //Invalidate
-  status = checkRange(protocol_bs->rrc.mbms.sched_numInfo, 0, maxMBMSservSched);
-
-  if (status == P_SUCCESS) {
-    //List of scheduling info
-    pvalue->serviceSchedulingInfoList.numInfo =  protocol_bs->rrc.mbms.sched_numInfo;
-
-    for (i = 0; i<protocol_bs->rrc.mbms.sched_numInfo && status == P_SUCCESS; i++) {
-      //invalidation for the number of transmission of each service
-      if ((status = checkRange(protocol_bs->rrc.mbms.sched_trans_numTransmis[i], 0, maxMBMSTransmis)) != P_SUCCESS) break;
-
-      pschedInfo = &pvalue->serviceSchedulingInfoList.schedulingInfo[i];
-
-      //MBMS Transmission identity
-      memcpy(
-        pschedInfo->mbms_TransmissionIdentity.mbms_ServiceIdentity.serviceIdentity,
-        &protocol_bs->rrc.mbms.sched_serviceIdentity[i],
-        3);
-      //MBMS Service transmission info list
-      pschedInfo->mbms_TransmissionInfoList.numInfo = protocol_bs->rrc.mbms.sched_trans_numTransmis[i];
-
-      for (j = 0; j<protocol_bs->rrc.mbms.sched_trans_numTransmis[i]; j++) {
-        //invalidation for start and duration
-        if ((status = checkRange(protocol_bs->rrc.mbms.sched_trans_start[i][j], 0, 1024)) != P_SUCCESS) break;
-
-        if (protocol_bs->rrc.mbms.sched_trans_start[i][j] % 4 != 0) {
-          status = P_INVVALUE;
-          break;
-        }
-
-        if ((status = checkRange(protocol_bs->rrc.mbms.sched_trans_duration[i][j], 4, 1024)) != P_SUCCESS) break;
-
-        //copy to the pdu
-        ptransInfo = &pschedInfo->mbms_TransmissionInfoList.serviceTransmissionInfo[j];
-        ptransInfo->start = protocol_bs->rrc.mbms.sched_trans_start[i][j];
-        ptransInfo->duration = protocol_bs->rrc.mbms.sched_trans_duration[i][j];
-      }
-
-      //Next scheduling period
-      pschedInfo->nextSchedulingPeriod = protocol_bs->rrc.mbms.sched_nextSchedPeriod[i];
-    }
-  }
-
-#ifdef DEBUG_RRC_MBMS
-  msg("[RRC-RG][MBMS] Encode MBMS Scheduling Information, status %d\n", status);
-#endif
-  return status;
-}
-#endif
-#ifdef NODE_MT
-//-----------------------------------------------------------------------------
-int rrc_PERDec_MBMSSchedulingInformation (MBMSSchedulingInformation * pvalue)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  int i, j;
-  MBMS_ServiceSchedulingInfo * pschedInfo; //point to the MBMS Service Scheduling Info ith in the list
-  MBMS_ServiceTransmInfo * ptransInfo; //point to the Transmission Info in a MBMS Service Scheduling Info
-
-  //Invalidate
-  status = checkRange(pvalue->serviceSchedulingInfoList.numInfo, 0, maxMBMSservSched);
-
-  if (status == P_SUCCESS) {
-    //List of scheduling info
-    protocol_ms->rrc.mbms.sched_numInfo = pvalue->serviceSchedulingInfoList.numInfo;
-
-    for (i = 0; i<protocol_ms->rrc.mbms.sched_numInfo && status == P_SUCCESS; i++) {
-      //invalidation for the number of transmission of each service
-      pschedInfo = &pvalue->serviceSchedulingInfoList.schedulingInfo[i];
-
-      if ((status = checkRange(pschedInfo->mbms_TransmissionInfoList.numInfo, 0, maxMBMSTransmis)) != P_SUCCESS) break;
-
-      //MBMS Transmission identity
-      protocol_ms->rrc.mbms.sched_serviceIdentity[i] = 0;
-      memcpy( &protocol_ms->rrc.mbms.sched_serviceIdentity[i],
-              pschedInfo->mbms_TransmissionIdentity.mbms_ServiceIdentity.serviceIdentity, 3);
-      //MBMS Service transmission info list
-      protocol_ms->rrc.mbms.sched_trans_numTransmis[i] = pschedInfo->mbms_TransmissionInfoList.numInfo;
-
-      for (j = 0; j<protocol_ms->rrc.mbms.sched_trans_numTransmis[i] && status == P_SUCCESS; j++) {
-        ptransInfo = &pschedInfo->mbms_TransmissionInfoList.serviceTransmissionInfo[j];
-
-        //invalidation for start and duration
-        if ((status = checkRange(ptransInfo->start, 0, 1024)) != P_SUCCESS)
-          break;
-
-        if (ptransInfo->start % 4 != 0) {
-          status = P_INVVALUE;
-          break;
-        }
-
-        if ((status = checkRange(ptransInfo->duration, 4, 1024)) != P_SUCCESS)
-          break;
-
-        //copy to the pdu
-        protocol_ms->rrc.mbms.sched_trans_start[i][j] = ptransInfo->start;
-        protocol_ms->rrc.mbms.sched_trans_duration[i][j] = ptransInfo->duration;
-      }
-
-      //Next scheduling period
-      protocol_ms->rrc.mbms.sched_nextSchedPeriod[i] = pschedInfo->nextSchedulingPeriod;
-    }
-  }
-
-#ifdef DEBUG_RRC_MBMS
-  msg("[RRC-UE][MBMS] Decode MBMS Scheduling Information, status %d\n", status);
-#endif
-  return status;
-}
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_mbms_pdus.h b/openair2/RRC/CELLULAR/rrc_mbms_pdus.h
deleted file mode 100755
index bd394541b6..0000000000
--- a/openair2/RRC/CELLULAR/rrc_mbms_pdus.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/***************************************************************************
-                          rrc_mbms_pdus.h - description
-                          -------------------
-    begin               : May 9, 2005
-    copyright           : (C) 2001, 2010 by Eurecom
-    created by          : Michelle.Wetterwald@eurecom.fr, Huu-Nghia.Nguyen@eurecom.fr
-    modified by         : This file contains definitions of PDUs concerned with MBMS
- **************************************************************************/
-#ifndef _RRC_MBMS_PDUS_H_
-#define _RRC_MBMS_PDUS_H_
-
-#include "rrc_mbms_ies.h"
-
-/**************************************************************/
-/*  MBMSAccessInformation                                     */
-/**************************************************************/
-typedef struct MBMSAccessInformation {
-  MBMS_ServiceAccessInfoList  mbms_ServiceAccessInfoList;
-} MBMSAccessInformation;
-
-/**************************************************************/
-/* MBMSGeneralInformation                                     */
-/**************************************************************/
-typedef struct MBMSGeneralInformation {
-  MBMS_TimersAndCounters  mbms_TimersAndCounters;
-  // MBMS_MICHConfigurationInfo     michConfigurationInfo;
-  MBMS_CellGroupIdentity  cellGroupIdentity;
-  // MBMS_MSCHConfigurationInfo mschDefaultConfigurationInfo;
-} MBMSGeneralInformation;
-
-/**************************************************************/
-/* MBMSCommonPTMRBInformation                                 */
-/**************************************************************/
-typedef struct MBMSCommonPTMRBInformation {
-  MTCH_Configuration l12Configuration;
-
-  //       The followings are specified in TS 25.331
-  // MBMS_CommonRBInformationList   mbms_CommonRBInformationList;
-  // MBMS_TranspChInfoForEachTrCh   mbms_TranspChInfoForEachTrCh;
-  // MBMS_TranspChInfoForEachCCTrCh mbms_TranspChInfoForEachCCTrCh;
-  // MBMS_PhyChInformationList      mbms_PhyChInformationList;
-} MBMSCommonPTMRBInformation;
-
-/**************************************************************/
-/* MBMSCurrentCellPTMRBInformation                            */
-/**************************************************************/
-typedef struct MBMSCurrentCellPTMRBInformation {
-  MTCH_Configuration l12Configuration;
-  // MBMS_CurrentCell_SCCPCHList  mbms_CurrentCell_SCCPCHList;
-  // MBMS_SIBType5_SCCPCHList mbms_SIBType5_SCCPCHList;
-} MBMSCurrentCellPTMRBInformation;
-
-/**************************************************************/
-/* MBMSNeighbouringCellPTMRBInformation                       */
-/**************************************************************/
-typedef struct MBMSNeighbouringCellPTMRBInformation {
-  /** in the range 1..X where X is undefined */
-  NeighbourCellIdentity    neighbouringCellIdentity;
-  NeighbouringCellConfiguration  neighbouringCellConfig;
-} MBMSNeighbouringCellPTMRBInformation;
-
-/**************************************************************/
-/* MBMSModifiedServicesInformation                            */
-/**************************************************************/
-typedef struct MBMSModifiedServicesInformation {
-  MBMS_ModifiedServiceList  modifiedServiceList;
-  mbms_bool                 mbms_ReacquireMCCH;
-  // DynamicPersistenceLevel   mbms_DynamicPersistenceLevel;
-  //   u16           endOfModifiedMCCHInformation;  //[1..16]
-  MBMS_NumberOfNeighbourCells  mbmsNumberOfNeighbourCells;
-  //   mbms_bool                 mbms_AllUnmodifiedPTMServices;
-  MBMS_PTMActivationTime    mbms_PTMActivationTime;
-} MBMSModifiedServicesInformation;
-
-/**************************************************************/
-/* MBMSUnmodifiedServicesInformation                          */
-/**************************************************************/
-typedef struct MBMSUnmodifiedServicesInformation {
-  MBMS_UnmodifiedServiceList unmodifiedServiceList;
-} MBMSUnmodifiedServicesInformation;
-
-/**************************************************************/
-/* MBMSSchedulingInformation                                  */
-/**************************************************************/
-typedef struct MBMSSchedulingInformation {
-  MBMS_ServiceSchedulingInfoList serviceSchedulingInfoList;
-  //   u8                             nextSchedulingPeriod;
-} MBMSSchedulingInformation;
-
-#endif
-
diff --git a/openair2/RRC/CELLULAR/rrc_messages.h b/openair2/RRC/CELLULAR/rrc_messages.h
deleted file mode 100755
index bb3f53693e..0000000000
--- a/openair2/RRC/CELLULAR/rrc_messages.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/***************************************************************************
-                          rrc_messages.h  -  description
-                             -------------------
-    begin                : Jan 11, 2002
-    copyright            : (C) 2001, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Define external interface primitive messages
- ***************************************************************************/
-#ifndef __RRC_MESSAGES_H__
-#define __RRC_MESSAGES_H__
-
-
-#include "rrc_constant.h"
-#include "rrc_nas_primitives.h"
-
-/*****
- * RRC interface
- *****/
-// Internal definitions, to work with the Esterel UE FSM
-#define NAS_CONN_REQ       1
-#define RRC_CONNECT_SETUP  3
-#define RRC_CONNECT_REJECT 5
-#define UE_RB_SETUP        7
-#define UE_RB_RELEASE      9
-#define CELLU_CNF          11
-#define T300_TO            15
-#define WAIT_TO            17
-#define RRC_RLC_SUCCESS    19
-#define RRC_RLC_FAILURE    21
-#define NAS_REL_REQ        23
-#define UE_CRLC_STATUS     25
-#define UE_PHY_SETUP       27
-#define UE_PHY_FAIL        29
-#define UE_CONN_LOSS       31
-#define UE_CAP_INFO_CNF    33
-
-// Internal definitions, to work with the Esterel RG FSM
-#define RRC_CONNECT_REQ     2
-#define RRC_CONNECT_LOSS    4
-#define RRC_CONN_SETUP_COMP 6
-#define RRC_CONNECT_RELUL   8
-#define UE_RB_SU_CMP        10
-#define UE_RB_SU_FAIL       12
-#define UE_RB_REL_CMP       14
-#define UE_RB_REL_FAIL      16
-#define UE_CELLU            18
-#define RG_RLC_SUCCESS      20
-#define RG_RLC_FAILURE      22
-#define NAS_CONN_CNF        24
-#define NAS_RB_ESTAB        26
-#define NAS_RB_RELEASE      28
-#define RG_CRLC_STATUS      30
-#define RRM_CFG             32
-#define RG_PHY_SETUP        34
-#define RG_PHY_FAIL         36
-#define UE_PHY_OUTSYNCH     38
-#define UE_PHY_SYNCH        40
-#define UE_CAP_INFO         42
-#define RRM_FAILURE         44
-
-
-/*****
- * NAS interface
- *****/
-#define NAS_SIB1  1
-#define NAS_SIB18 18
-
-#ifdef NODE_MT
-struct nas_ue_if_element {
-  u16 prim_length;
-  int xmit_fifo;
-  mem_block_t  *next;         // to chain before Xmit
-  union {
-    struct nas_ue_gc_element gc_sap_prim;
-    struct nas_ue_dc_element dc_sap_prim;
-    struct nas_ue_nt_element nt_sap_prim;
-  } nasUePrimitive;
-  u8  nasData[NAS_DATA_MAX_LENGTH];
-};
-#endif
-
-#ifdef NODE_RG
-struct nas_rg_if_element {
-  u16 prim_length;
-  int xmit_fifo;
-  mem_block_t *next;         // to chain before Xmit
-  union {
-    struct nas_rg_gc_element gc_sap_prim;
-    struct nas_rg_dc_element dc_sap_prim;
-    struct nas_rg_nt_element nt_sap_prim;
-  } nasRgPrimitive;
-  u8  nasData[NAS_DATA_MAX_LENGTH];
-};
-#endif
-
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_msg_class.h b/openair2/RRC/CELLULAR/rrc_msg_class.h
deleted file mode 100755
index 5048e9366e..0000000000
--- a/openair2/RRC/CELLULAR/rrc_msg_class.h
+++ /dev/null
@@ -1,192 +0,0 @@
-/***************************************************************************
-                          rrc_msg_class.h  -  description
-                             -------------------
-    begin                : Jan 6, 2003
-    copyright            : (C) 2003, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Define structures for RRC peer-to-peer messages
- ***************************************************************************/
-#ifndef __RRC_MSG_CLASS_H__
-#define __RRC_MSG_CLASS_H__
-#include "rrc_msg_pdus.h"
-#include "rrc_mbms_pdus.h"
-
-/**************************************************************/
-/*  DL_DCCH_MessageType                                       */
-/**************************************************************/
-typedef struct DL_DCCH_MessageType {
-  unsigned char  type;
-  union {
-    /* type = 4 */
-    //      CellUpdateConfirm *cellUpdateConfirm;
-    /* type = 6 */
-    DownlinkDirectTransfer *downlinkDirectTransfer;
-    /* type = 9 */
-    MeasurementControl *measurementControl;
-    /* type = 10 */
-    PagingType2 *pagingType2;
-    /* type = 14 */
-    RadioBearerRelease *radioBearerRelease;
-    /* type = 15 */
-    RadioBearerSetup *radioBearerSetup;
-    /* type = 16 */
-    //      RRCConnectionRelease *rrcConnectionRelease;
-    /* type = 22 */
-    UECapabilityInformationConfirm *ueCapabilityInformationConfirm;
-    /* type = 23 */
-    //ULPCHControl *ulPchControl;
-    /* type = 27 */
-    MBMSModifiedServicesInformation *mbmsModifiedServicesInformation;
-  } content;
-} DL_DCCH_MessageType;
-
-
-/**************************************************************/
-/*  DL DCCH Message                                           */
-/**************************************************************/
-typedef struct DL_DCCH_Message {
-  IntegrityCheckInfo integrityCheckInfo;
-  DL_DCCH_MessageType message;
-} DL_DCCH_Message;
-
-
-/**************************************************************/
-/*  UL_DCCH_MessageType                                       */
-/**************************************************************/
-typedef struct UL_DCCH_MessageType {
-  unsigned char  type;
-  union {
-    /* type = 6 */
-    InitialDirectTransfer *initialDirectTransfer;
-    /* type = 9 */
-    MeasurementReport *measurementReport;
-    /* type = 14 */
-    RadioBearerReleaseComplete *radioBearerReleaseComplete;
-    /* type = 15 */
-    RadioBearerReleaseFailure *radioBearerReleaseFailure;
-    /* type = 16 */
-    RadioBearerSetupComplete *radioBearerSetupComplete;
-    /* type = 17 */
-    RadioBearerSetupFailure *radioBearerSetupFailure;
-    /* type = 18 */
-    //      RRCConnectionReleaseComplete *rrcConnectionReleaseComplete;
-    /* type = 19 */
-    RRCConnectionSetupComplete *rrcConnectionSetupComplete;
-    /*type = 27 */
-    UECapabilityInformation  *ueCapabilityInformation;
-    /* type = 28 */
-    UplinkDirectTransfer *uplinkDirectTransfer;
-    /* type = 31 */
-    RRCConnectionRelease_UL *rrcConnectionRelease_UL;
-  } content;
-} UL_DCCH_MessageType;
-
-/**************************************************************/
-/*  UL DCCH Message                                           */
-/**************************************************************/
-typedef struct UL_DCCH_Message {
-  IntegrityCheckInfo integrityCheckInfo;
-  UL_DCCH_MessageType message;
-} UL_DCCH_Message;
-
-
-/**************************************************************/
-/*  DL_CCCH_MessageType                                       */
-/**************************************************************/
-typedef struct DL_CCCH_MessageType {
-  unsigned char  type;
-  union {
-    /* type = 1 */
-    CellUpdateConfirm_CCCH *cellUpdateConfirm;
-    /* type = 2 */
-    RRCConnectionReject *rrcConnectionReject;
-    /* type = 3 */
-    //      RRCConnectionRelease_CCCH *rrcConnectionRelease;
-    /* type = 4 */
-    RRCConnectionSetup *rrcConnectionSetup;
-  } content;
-} DL_CCCH_MessageType;
-
-/**************************************************************/
-/*  DL CCCH Message                                           */
-/**************************************************************/
-typedef struct DL_CCCH_Message {
-  IntegrityCheckInfo integrityCheckInfo;
-  DL_CCCH_MessageType message;
-} DL_CCCH_Message;
-
-
-/**************************************************************/
-/*  UL CCCH MessageType                                       */
-/**************************************************************/
-typedef struct UL_CCCH_MessageType {
-  unsigned char  type;
-  union {
-    /* type = 1 */
-    CellUpdate cellUpdate;
-    /* type = 2 */
-    RRCConnectionRequest rrcConnectionRequest;
-  } content;
-} UL_CCCH_MessageType;
-
-/**************************************************************/
-/*  UL CCCH Message                                           */
-/**************************************************************/
-typedef struct UL_CCCH_Message {
-  IntegrityCheckInfo integrityCheckInfo;
-  UL_CCCH_MessageType message;
-} UL_CCCH_Message;
-
-
-/**************************************************************/
-/*  DL MCCH MessageType                                       */
-/**************************************************************/
-typedef struct MCCH_MessageType {
-  unsigned char type;
-  union {
-    /* type = 1 */
-    MBMSAccessInformation   *mbmsAccessInformation;
-    /* type = 2 */
-    MBMSCommonPTMRBInformation  *mbmsCommonPTMRBInformation;
-    /* type = 3 */
-    MBMSCurrentCellPTMRBInformation  *mbmsCurrentCellPTMRBInformation;
-    /* type = 4 */
-    MBMSGeneralInformation  *mbmsGeneralInformation;
-    /* type = 5 */
-    MBMSModifiedServicesInformation  *mbmsModifiedServicesInformation;
-    /* type = 6 */
-    MBMSNeighbouringCellPTMRBInformation  *mbmsNeighbouringCellPTMRBInformation;
-    /* type = 7 */
-    MBMSUnmodifiedServicesInformation  *mbmsUnmodifiedServicesInformation;
-  } content;
-} MCCH_MessageType;
-
-/**************************************************************/
-/*  DL MCCH Message                                           */
-/**************************************************************/
-typedef struct MCCH_Message {
-  MCCH_MessageType  message;
-} MCCH_Message;
-
-
-/**************************************************************/
-/*  DL MSCH MessageType                                       */
-/**************************************************************/
-typedef struct MSCH_MessageType {
-  unsigned char type; //reserved for the future extension
-  union {
-    /* type = 1 */
-    MBMSSchedulingInformation *mbmsSchedulingInformation;
-  } content;
-} MSCH_MessageType;
-
-/**************************************************************/
-/*  DL MSCH Message                                           */
-/**************************************************************/
-typedef struct MSCH_Message {
-  IntegrityCheckInfo  integrityCheckInfo;
-  MSCH_MessageType  message;
-} MSCH_Message;
-
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_msg_constant.h b/openair2/RRC/CELLULAR/rrc_msg_constant.h
deleted file mode 100755
index ad18ee94a3..0000000000
--- a/openair2/RRC/CELLULAR/rrc_msg_constant.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/***************************************************************************
-                          rrc_msg_constant.h  -  description
-                             -------------------
-    begin                : Jan 6, 2003
-    copyright            : (C) 2003, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Define structures for RRC peer-to-peer messages
- ***************************************************************************/
-#ifndef __RRC_MSG_CONSTANT_H__
-#define __RRC_MSG_CONSTANT_H__
-
-/* Size of message Header = integrity + type */
-#define MSG_HEAD_LGTH 8
-#define MSG_PAGING_LGTH 1023
-#define MSG_NASDATA_LGTH 4095
-#define MSG_UECONFIG_LGTH 2048
-
-/* Message types for classes - from 25.331 ASN1 definitions */
-/* DL DCCH Message Type constants */
-#define DL_DCCH_cellUpdateConfirm             4
-#define DL_DCCH_downlinkDirectTransfer        6
-#define DL_DCCH_measurementControl            9
-#define DL_DCCH_pagingType2                  10
-#define DL_DCCH_radioBearerRelease           14
-#define DL_DCCH_radioBearerSetup             15
-#define DL_DCCH_rrcConnectionRelease         16
-#define DL_DCCH_ueCapabilityInformationConfirm 22
-#define DL_DCCH_uplinkPhysicalChannelControl 23
-//TEMP Valeur a verifier vs ASN1
-#define DL_DCCH_keepAlive                    25
-#define DL_DCCH_mbmsModifiedServicesInformation 27
-
-/* UL DCCH Message Type constants */
-#define UL_DCCH_initialDirectTransfer         6
-#define UL_DCCH_measurementReport             9
-#define UL_DCCH_radioBearerReleaseComplete   14
-#define UL_DCCH_radioBearerReleaseFailure    15
-#define UL_DCCH_radioBearerSetupComplete     16
-#define UL_DCCH_radioBearerSetupFailure      17
-#define UL_DCCH_rrcConnectionReleaseComplete 18
-#define UL_DCCH_rrcConnectionSetupComplete   19
-#define UL_DCCH_ueCapabilityInformation      27
-#define UL_DCCH_uplinkDirectTransfer         28
-#define UL_DCCH_rrcConnectionReleaseUL       31  // was spare value
-
-/* DL CCCH Message Type constants */
-#define DL_CCCH_cellUpdateConfirm    1
-#define DL_CCCH_rrcConnectionReject  2
-#define DL_CCCH_rrcConnectionRelease 3
-#define DL_CCCH_rrcConnectionSetup   4
-
-/* UL CCCH Message Type constants */
-#define UL_CCCH_cellUpdate           1
-#define UL_CCCH_rrcConnectionRequest 2
-
-/* MCCH Message Type constants */
-#define MCCH_mbmsAccessInformation            1
-#define MCCH_mbmsCommonPTMRBInformation       2
-#define MCCH_mbmsCurrentCellPTMRBInformation  3
-#define MCCH_mbmsGeneralInformation           4
-#define MCCH_mbmsModifiedServicesInformation  5
-#define MCCH_mbmsNeighbouringCellPTMRBInformation 6
-#define MCCH_mbmsUnmodifiedServicesInformation 7
-
-/* MSCH Message Type constants */
-#define MSCH_mbmsSchedulingInformation 1
-
-/********************************/
-
-/* Max number of transactions */
-#define MAXTRANS 3
-#define MAXURAB  27  //must be identical to MAX_RABS in rrc_nas_primitives.h
-//#define MAXRBSETUP maxRABsetup  For further step
-#define MAXRBSETUP 4
-
-/*  FailureCauseWithProtErr  */
-#define FCWPE_configurationUnsupported 1
-#define FCWPE_physicalChannelFailure 2
-#define FCWPE_incompatibleSimultaneousReconfiguration 3
-#define FCWPE_compressedModeRuntimeError 4
-#define FCWPE_protocolError 5
-#define FCWPE_cellUpdateOccurred 6
-#define FCWPE_invalidConfiguration 7
-#define FCWPE_configurationIncomplete 8
-#define FCWPE_unsupportedMeasurement 9
-
-
-/* Measurement parameters */
-#define MAXMEASTYPES 4
-// indexes of measurement types for UE
-#define IX_ifM  0
-#define IX_tvM  1
-#define IX_qM   2
-#define IX_iueM 3
-
-// indexes of measurement types for BS
-#define IX_ibsM  0
-#define IX_tvbM  1
-#define IX_qbM   2
-
-
-// max number of measured objects
-#define MAXMEASCELLS  2
-#define MAXMEASRBS    8
-#define MAXMEASTRCH   16
-#define MAXMEASTFCS   8
-#define MAXCH         16   //cf L1
-#define NUMSPARE      1    // number of additional measures in BS
-
-/*  MeasurementCommand_r4  */
-#define MC_setup   1
-#define MC_modify  2
-#define MC_release 3
-
-/*  MeasurementType  */
-#define MT_intraFrequencyMeasurement 1
-#define MT_interFrequencyMeasurement 2
-#define MT_trafficVolumeMeasurement  5
-#define MT_qualityMeasurement        6
-#define MT_ue_InternalMeasurement    7
-
-/*  ReportCriteria  */
-#define RC_ThresholdReportingCriteria  1
-#define RC_PeriodicalReportingCriteria 2
-#define RC_NoReporting                 3
-
-/*  UL_TrCH_Identity   */
-#define  UL_TrCH_Id_dch   1
-#define  UL_TrCH_Id_rach  2
-#define  UL_TrCH_Id_usch  3
-
-/*  TrafficVolumeMeasQuantity  */
-#define TV_rlc_BufferPayload           1
-#define TV_averageRLC_BufferPayload    2
-#define TV_varianceOfRLC_BufferPayload 3
-
-/*  MeasuredResults  */
-#define MR_intraFreqMeasuredResultsList 1
-#define MR_interFreqMeasuredResultsList 2
-#define MR_trafficVolumeMeasuredResultsList 4
-#define MR_qualityMeasuredResults 5
-#define MR_ue_InternalMeasuredResults 6
-
-/* Access Stratum Release Indicator  */
-#define ACCESS_STRATUM_RELEASE_INDICATOR_REL_4 0
-#define ACCESS_STRATUM_RELEASE_INDICATOR_REL_5 1
-#define ACCESS_STRATUM_RELEASE_INDICATOR_REL_6 2
-
-/* Eurecom Kernel Release Indicator */
-#define EURECOM_KERNEL_RELEASE_INDICATOR_REL_24 24
-#define EURECOM_KERNEL_RELEASE_INDICATOR_REL_26 26
-
-/* Present ie of the message UECapabilityInformationConfirm */
-#define UE_CAPABILITY_INFORMATION_CONFIRM_PR_NOTHING 0
-#define UE_CAPABILITY_INFORMATION_CONFIRM_PR_R3 1
-#define UE_CAPABILITY_INFORMATION_CONFIRM_PR_LATER_THAN_R3 2
-
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_msg_ies.h b/openair2/RRC/CELLULAR/rrc_msg_ies.h
deleted file mode 100755
index 503cbdd438..0000000000
--- a/openair2/RRC/CELLULAR/rrc_msg_ies.h
+++ /dev/null
@@ -1,834 +0,0 @@
-/***************************************************************************
-                      rrc_msg_ies.h  -  description
-                         -------------------
-begin                : Jan 6, 2003
-copyright            : (C) 2003, 2010 by Eurecom
-email                : Michelle.Wetterwald@eurecom.fr
-**************************************************************************
-Define structures for RRC peer-to-peer messages
-***************************************************************************/
-#ifndef __RRC_MSG_IES_H__
-#define __RRC_MSG_IES_H__
-
-#include "rrc_platform_types.h"
-#include "rrc_msg_constant.h"
-#include "rrc_bch_per_basic.h"
-
-/**************************************************************/
-/*  For all Messages                                          */
-/**************************************************************/
-/*  IntegrityCheckInfo  */
-typedef u32     IntegrityCheckInfo;
-
-/**************************************************************/
-/*  RRCConnectionRequest                                      */
-/**************************************************************/
-/*  IMEI_Digit   */
-typedef u8      IMEI_Digit;
-
-/*  IMEI         */
-typedef struct IMEI {
-  u8              numDigits;
-  IMEI_Digit      digit[15];
-} IMEI;
-
-/*  EstablishmentCause  -  Full 25.331 list */
-typedef enum {
-  originatingConversationalCall = 0,
-  originatingStreamingCall = 1,
-  originatingInteractiveCall = 2,
-  originatingBackgroundCall = 3,
-  originatingSubscribedTrafficCall = 4,
-  terminatingConversationalCall = 5,
-  terminatingStreamingCall = 6,
-  terminatingInteractiveCall = 7,
-  terminatingBackgroundCall = 8,
-  emergencyCall = 9,
-  interRAT_CellReselection = 10,
-  interRAT_CellChangeOrder = 11,
-  registration = 12,
-  detach = 13,
-  originatingHighPrioritySignalling = 14,
-  originatingLowPrioritySignalling = 15,
-  callRe_establishment = 16,
-  terminatingHighPrioritySignalling = 17,
-  terminatingLowPrioritySignalling = 18,
-  terminatingCauseUnknown = 19,
-} EstablishmentCause;
-
-/*  ProtocolErrorIndicator */
-typedef enum {
-  noError = 0,
-  errorOccurred = 1
-} ProtocolErrorIndicator;
-
-/**************************************************************/
-/*  RRCConnectionSetup                                        */
-/**************************************************************/
-/*  IMEI -- cf  RRCConnectionRequest       */
-
-/*  RRC_TransactionIdentifier   */
-// value >= 0 && value <= 3
-typedef u8      RRC_TransactionIdentifier;
-
-/*  ActivationTime    */
-// value >= 0 && value <= 255
-typedef u16     ActivationTime;
-
-/*  U_RNTI            */
-//typedef struct U_RNTI {
-//   SRNC_Identity  srnc_Identity;
-//   S_RNTI  s_RNTI;
-//} U_RNTI;
-typedef u16     U_RNTI;
-
-/*  RRC_StateIndicator */
-typedef enum {
-  cell_DCH = 0,
-  cell_FACH = 1,
-  cell_PCH = 2,
-  ura_PCH = 3
-} RRC_StateIndicator;
-
-/*  NAS QOS Info - Moby Dick */
-//typedef u8  IP_DSCP_Codes[MAXURAB];
-//typedef u8  QOS_Classes[MAXURAB];
-
-/*  UE_Configuration   */
-typedef struct UE_Configuration {
-  u16             numoctets;
-  u8              data[MSG_UECONFIG_LGTH];
-} UE_Configuration;
-
-/**************************************************************/
-/*  RRCConnectionSetupComplete                                */
-/**************************************************************/
-// RRC_TransactionIdentifier
-
-/*  UE_RadioAccessCapability  */
-typedef enum {
-  rel_4 = 0,
-  eurecom_rrc = 7               // values != 0 are spare values
-} UE_RadioAccessCapability;
-
-/**************************************************************/
-/*  RRCConnectionReject                                       */
-/**************************************************************/
-// IMEI
-// RRC_TransactionIdentifier
-
-/*  WaitTime   */
-// value >= 0 && value <= 15
-typedef u8      WaitTime;
-
-/**************************************************************/
-/*  RRCConnectionRelease                                      */
-/**************************************************************/
-// U_RNTI
-
-/*  ReleaseCause  */
-typedef enum {
-  normalEvent = 0,
-  unspecified = 1,
-  pre_emptiveRelease = 2,
-  congestion = 3,
-  re_establishmentReject = 4,
-  directedsignallingconnectionre_establishment = 5,
-  userInactivity = 6,
-} ReleaseCause;
-
-/**************************************************************/
-/*  InitialDirectTransfer                                     */
-/**************************************************************/
-/*  NAS_Message  */
-typedef struct NAS_Message {
-  u16             numoctets;
-  u8              data[MSG_NASDATA_LGTH];
-} NAS_Message;
-
-/**************************************************************/
-/*  RadioBearerSetup                                          */
-/**************************************************************/
-/*  RB_Identity        */
-// value >= 1 && value <= 32
-typedef u16     RB_Identity;
-
-/*  NAS QOS Info - Moby Dick */
-typedef u16     QOS_Class;
-typedef u16     IP_DSCP_Code;
-typedef u16     SAP_Id;
-
-/*  RB_InformationSetup  */
-typedef struct RB_InformationSetup {
-  RB_Identity     rb_identity;
-  //   PDCP_Info  pdcp_Info;
-  //   RLC_InfoChoice  rlc_InfoChoice;
-  //   RB_MappingInfo  rb_MappingInfo;
-  QOS_Class       qos_class;
-  IP_DSCP_Code    ip_dscp_code;
-  SAP_Id          sap_id;
-} RB_InformationSetup;
-
-/*  RAB_InformationSetupList  */
-typedef struct RAB_InformationSetupList {
-  u16             numrabs;
-  RB_InformationSetup rbinfo[MAXRBSETUP];
-} RAB_InformationSetupList;
-
-/**************************************************************/
-/*  RadioBearerRelease                                        */
-/**************************************************************/
-/*  RB_InformationReleaseList  */
-typedef struct RB_InformationReleaseList {
-  u16             numrabs;
-  RB_Identity     rbid[MAXRBSETUP];
-} RB_InformationReleaseList;
-
-/**************************************************************/
-/*  RadioBearerSetupFailure                                   */
-/**************************************************************/
-// RRC_TransactionIdentifier  rrc_TransactionIdentifier;
-/*  ProtocolErrorCause    */
-typedef enum {
-  asn1_ViolationOrEncodingError = 0,
-  messageTypeNonexistent = 1,
-  messageNotCompatibleWithReceiverState = 2,
-  ie_ValueNotComprehended = 3,
-  informationElementMissing = 4,
-  messageExtensionNotComprehended = 5,
-} ProtocolErrorCause;
-
-/*  FailureCauseWithProtErr  */
-typedef struct FailureCauseWithProtErr {
-  u8              type;
-  ProtocolErrorCause protocolError;
-} FailureCauseWithProtErr;
-
-/**************************************************************/
-/*  CellUpdate                                                */
-/**************************************************************/
-// U_RNTI
-
-/*  CellUpdateCause  */
-typedef enum {
-  cellReselection = 0,
-  periodicalCellUpdate = 1,
-  uplinkDataTransmission = 2,
-  utran_pagingResponse = 3,
-  re_enteredServiceArea = 4,
-  radiolinkFailure = 5,
-  rlc_unrecoverableError = 6,
-} CellUpdateCause;
-
-/*  FailureCauseWithProtErrTrId   */
-typedef struct FailureCauseWithProtErrTrId {
-  RRC_TransactionIdentifier rrc_TransactionIdentifier;
-  FailureCauseWithProtErr failureCause;
-} FailureCauseWithProtErrTrId;
-
-/**************************************************************/
-/*  PagingType2                                               */
-/**************************************************************/
-// RRC_TransactionIdentifier
-// IMEI
-
-/*  PAGING_Message  */
-typedef struct PAGING_Message {
-  u16             numoctets;
-  u8              data[MSG_PAGING_LGTH];
-} PAGING_Message;
-
-/**************************************************************/
-/*  MeasurementControl                                        */
-/**************************************************************/
-//   RRC_TransactionIdentifier
-
-/*  MeasurementIdentity  */
-// value >= 1 && value <= 16
-typedef u16     MeasurementIdentity;
-
-/*  ReportingIntervalLong  */
-typedef enum {
-  int250 = 250,
-  int500 = 500,
-  int1000 = 1000,
-  int2000 = 2000,
-  int3000 = 3000,
-  int4000 = 4000,
-  int6000 = 6000,
-  int8000 = 8000,
-  int12000 = 12000,
-  int16000 = 16000,
-  int20000 = 20000,
-  int24000 = 24000,
-  int28000 = 28000,
-  int32000 = 32000,
-  int64000 = 64000,
-} ReportingIntervalLong;
-/*  ReportingAmount */
-typedef enum {
-  amount1 = 1,
-  amount2 = 2,
-  amount4 = 4,
-  amount8 = 8,
-  amount16 = 16,
-  amount32 = 32,
-  amount64 = 64,
-  amount_inf = 0
-} ReportingAmount;
-/*  PeriodicalReportingCriteria  */
-typedef struct PeriodicalReportingCriteria {
-  ReportingAmount reportingAmount;
-  ReportingIntervalLong reportingInterval;
-} PeriodicalReportingCriteria;
-
-/*  FilterCoefficient */
-typedef enum {
-  coeff0 = 0,                   //default value
-  coeff1 = 1,
-  coeff2 = 2,
-  coeff3 = 3,
-  coeff4 = 4,
-  coeff5 = 5,
-  coeff6 = 6,
-  coeff7 = 7,
-  coeff8 = 8,
-  coeff9 = 9,
-  coeff11 = 11,
-  coeff13 = 13,
-  coeff15 = 15,
-  coeff17 = 17,
-  coeff19 = 19,
-} FilterCoefficient;
-
-/**************************************************************/
-/*  IntraFreqMeasQuantityList */
-typedef enum {
-  primaryCCPCH_RSCP = 0,
-  pathloss = 1,
-  timeslotISCP = 2,
-} IntraFreqMeasQuantityList;
-/*  IntraFreqMeasQuantity  */
-typedef struct IntraFreqMeasQuantity {
-  FilterCoefficient filterCoefficient;
-  //   IntraFreqMeasQuantityList measureList[4]; //4 defined in 25.331 - not used
-} IntraFreqMeasQuantity;
-
-/*  CellReportingQuantities */
-typedef struct CellReportingQuantities {
-  u8              cellIdentity_reportingIndicator;
-  u8              timeslotISCP_reportingIndicator;
-  u8              primaryCCPCH_RSCP_reportingIndicator;
-  u8              pathloss_reportingIndicator;
-} CellReportingQuantities;
-
-/*  MV_ue_State  */
-typedef enum {
-  mv_cell_DCH = 0,
-  mv_all_But_Cell_DCH = 1,
-  mv_all_States = 2
-                  //} MV_ue_State;
-                  ///*  MeasurementValidity */
-                  //typedef struct  MeasurementValidity {
-                  //   MV_ue_State  ue_State;
-} MeasurementValidity;
-
-/*  IntraFreqReportingCriteria_r4  */
-typedef struct IntraFreqReportingCriteria_r4 {
-  int             value;        //FFS
-} IntraFreqReportingCriteria_r4;
-/*  IntraFreqReportCriteria_r4 */
-typedef struct IntraFreqReportCriteria_r4 {
-  u16             criteriaType;
-  union {
-    /* criteriaType = 1 */
-    IntraFreqReportingCriteria_r4 intraFreqReportingCriteria;
-    /* criteriaType = 2 */
-    PeriodicalReportingCriteria periodicalReportingCriteria;
-    /* criteriaType = 3 */
-    //ReportingCellStatusOpt *noReporting;
-  } criteriaDef;
-} IntraFreqReportCriteria_r4;
-
-/*  IntraFrequencyMeasurement_r4  */
-typedef struct IntraFrequencyMeasurement_r4 {
-  IntraFreqMeasQuantity intraFreqMeasQuantity;
-  CellReportingQuantities intraFreqReportingQuantity;
-  MeasurementValidity measurementValidity;
-  IntraFreqReportCriteria_r4 reportCriteria;
-} IntraFrequencyMeasurement_r4;
-
-/**************************************************************/
-/*  TransportChannelIdentity
-    (value >= 1 && value <= 32)  */
-typedef u8      TransportChannelIdentity;
-/*  UL_TrCH_Identity  */
-typedef struct UL_TrCH_Identity {
-  u8              ch_type;
-  TransportChannelIdentity ch_id;
-} UL_TrCH_Identity;
-/*  TrafficVolumeMeasurementObjectList  */
-typedef struct TrafficVolumeMeasurementObjectList {
-  u8              numChannels;
-  UL_TrCH_Identity channel[MAXMEASTRCH];        // should be 32
-} TrafficVolumeMeasurementObjectList;
-
-/*  TimeInterval
-    (value >= 1 && value <= 13)  */
-typedef u8      TimeInterval;
-/*  TrafficVolumeMeasQuantity   */
-typedef struct TrafficVolumeMeasQuantity {
-  u8              tf_type;
-  union {
-    /* tf_type = 1 */
-    /* tf_type = 2 */
-    TimeInterval    averageRLC_BufferPayload;
-    /* tf_type = 3 */
-    TimeInterval    varianceOfRLC_BufferPayload;
-  } timeinterval;
-} TrafficVolumeMeasQuantity;
-
-/*  TrafficVolumeReportingQuantity */
-typedef struct TrafficVolumeReportingQuantity {
-  u8              rlc_RB_BufferPayload;
-  u8              rlc_RB_BufferPayloadAverage;
-  u8              rlc_RB_BufferPayloadVariance;
-} TrafficVolumeReportingQuantity;
-
-//   MeasurementValidity
-
-/*  TrafficVolumeReportingCriteria  */
-typedef struct TrafficVolumeReportingCriteria {
-  u16             value;        //Temp
-} TrafficVolumeReportingCriteria;
-// PeriodicalReportingCriteria
-/*  TrafficVolumeReportCriteria  */
-typedef struct TrafficVolumeReportCriteria {
-  u16             criteriaType;
-  union {
-    /* criteriaType = 1 */
-    TrafficVolumeReportingCriteria trafficVolumeReportingCriteria;
-    /* criteriaType = 2 */
-    PeriodicalReportingCriteria periodicalReportingCriteria;
-    /* criteriaType = 3 */
-  } criteriaDef;
-} TrafficVolumeReportCriteria;
-
-/*  TrafficVolumeMeasurement  */
-typedef struct TrafficVolumeMeasurement {
-  //   TrafficVolumeMeasurementObjectList  trafficVolumeMeasurementObjectList;  FFS
-  //   TrafficVolumeMeasQuantity  trafficVolumeMeasQuantity;   Ignored anyway
-  TrafficVolumeReportingQuantity trafficVolumeReportingQuantity;
-  MeasurementValidity measurementValidity;
-  TrafficVolumeReportCriteria reportCriteria;
-} TrafficVolumeMeasurement;
-
-/**************************************************************/
-/*  BLER_TransChIdList  */
-typedef struct BLER_TransChIdList {
-  u8              numTrCH;
-  TransportChannelIdentity ch_id[MAXMEASTRCH];  //should be 32
-} BLER_TransChIdList;
-
-/*  TFCS_IdentityPlain
-    (value >= 1 && value <= 8)  */
-typedef u8      TFCS_IdentityPlain;
-/*  SIR_TFCS  */
-typedef TFCS_IdentityPlain SIR_TFCS;
-/*  SIR_TFCS_List  */
-typedef struct SIR_TFCS_List {
-  u8              numTFCS;
-  SIR_TFCS        tfcs[MAXMEASTFCS];
-} SIR_TFCS_List;
-
-/*  QualityReportingQuantity */
-typedef struct QualityReportingQuantity {
-  u8              dl_TransChBLER;
-  //   BLER_TransChIdList  bler_dl_TransChIdList;FFS
-  SIR_TFCS_List   sir_TFCS_List;
-} QualityReportingQuantity;
-
-/*  QualityReportingCriteria  */
-typedef struct QualityReportingCriteria {
-  u16             value;        //Temp
-} QualityReportingCriteria;
-// PeriodicalReportingCriteria
-/*  QualityReportCriteria  */
-typedef struct QualityReportCriteria {
-  u16             criteriaType;
-  union {
-    /* criteriaType = 1 */
-    QualityReportingCriteria qualityReportingCriteria;
-    /* criteriaType = 2 */
-    PeriodicalReportingCriteria periodicalReportingCriteria;
-    /* criteriaType = 3 */
-  } criteriaDef;
-} QualityReportCriteria;
-/*  QualityMeasurement  */
-typedef struct QualityMeasurement {
-  QualityReportingQuantity qualityReportingQuantity;
-  QualityReportCriteria reportCriteria;
-} QualityMeasurement;
-
-/**************************************************************/
-/*  UE_MeasurementQuantity  */
-typedef enum {
-  ue_TransmittedPower = 0,
-  utra_Carrier_RSSI = 1,
-} UE_MeasurementQuantity;
-
-/*  UE_InternalMeasQuantity  */
-typedef struct UE_InternalMeasQuantity {
-  UE_MeasurementQuantity measurementQuantity;
-  FilterCoefficient filterCoefficient;
-} UE_InternalMeasQuantity;
-
-/*  UE_InternalReportingQuantity_r4  */
-typedef struct UE_InternalReportingQuantity_r4 {
-  u8              ue_TransmittedPower;
-  u8              appliedTA;    //modeSpecificInfo
-} UE_InternalReportingQuantity_r4;
-
-/*  UE_InternalReportingCriteria  */
-typedef struct UE_InternalReportingCriteria {
-  u16             value;        //Temp
-} UE_InternalReportingCriteria;
-// PeriodicalReportingCriteria
-
-/*  UE_InternalReportCriteria  */
-typedef struct UE_InternalReportCriteria {
-  u16             criteriaType;
-  union {
-    /* criteriaType = 1 */
-    UE_InternalReportingCriteria ue_InternalReportingCriteria;
-    /* criteriaType = 2 */
-    PeriodicalReportingCriteria periodicalReportingCriteria;
-    /* criteriaType = 3 */
-  } criteriaDef;
-} UE_InternalReportCriteria;
-
-/*  UE_InternalMeasurement */
-typedef struct UE_InternalMeasurement_r4 {
-  UE_InternalMeasQuantity ue_InternalMeasQuantity;
-  UE_InternalReportingQuantity_r4 ue_InternalReportingQuantity;
-  UE_InternalReportCriteria reportCriteria;
-} UE_InternalMeasurement_r4;
-
-//****************************************************************
-/*  MeasurementType  */
-typedef struct MeasurementType {
-  u16             measType;
-  union {
-    /* measType = 1 */
-    IntraFrequencyMeasurement_r4 intraFrequencyMeasurement;
-    /* measType = 2 */
-    //InterFrequencyMeasurement_r4  interFrequencyMeasurement;
-    /* measType = 5 */
-    TrafficVolumeMeasurement trafficVolumeMeasurement;
-    /* measType = 6 */
-    QualityMeasurement qualityMeasurement;
-    /* measType = 7 */
-    UE_InternalMeasurement_r4 ue_InternalMeasurement;
-  } type;
-} MeasurementType;
-
-/*  MeasurementCommand_r4  */
-typedef struct MeasurementCommand_r4 {
-  u16             cmdType;
-  union {
-    /* cmdType = 1 */
-    MeasurementType setup;
-    /* cmdType = 2 */
-    MeasurementType modify;
-    /* cmdType = 3 */
-  } command;
-} MeasurementCommand_r4;
-
-/*  PeriodicalOrEventTrigger */
-typedef enum {
-  periodical = 0,
-  eventTrigger = 1
-} PeriodicalOrEventTrigger;
-/*  TransferMode  */
-typedef enum {
-  acknowledgedModeRLC = 0,
-  unacknowledgedModeRLC = 1
-} TransferMode;
-/*  MeasurementReportingMode */
-typedef struct MeasurementReportingMode {
-  TransferMode    measurementReportTransferMode;
-  PeriodicalOrEventTrigger periodicalOrEventTrigger;
-} MeasurementReportingMode;
-
-
-/**************************************************************/
-/*  MeasurementReport                                         */
-/**************************************************************/
-
-//   MeasurementIdentity
-
-/**************************************************************/
-/*  CellIdentity                                              */
-typedef u8      CellIdentity;
-/*  SFN_SFN_ObsTimeDifference
-    value >= 0 && value <= 16777215  */
-typedef int     SFN_SFN_ObsTimeDifference;
-
-/*  CellParametersID
-    value >= 0 && value <= 127  */
-typedef u8      CellParametersID;
-/*  PrimaryCCPCH_RSCP
-    value >= 0 && value <= 127  */
-typedef u8      PrimaryCCPCH_RSCP;
-/*  Pathloss
-    value >= 46 && value <= 173 */
-typedef u16     Pathloss;
-/*  TimeslotISCP
-    value >= 0 && value <= 127  */
-typedef u8      TimeslotISCP;
-/*  TimeslotISCP_List */
-typedef struct TimeslotISCP_List {
-  u8              numSlots;
-  TimeslotISCP    iscp[JRRM_SLOTS_PER_FRAME];
-} TimeslotISCP_List;
-
-/*  CellMeasuredResults_modeSpecificInfo_tdd  */
-typedef struct CellMeasuredResults_modeSpecificInfo_tdd {
-  CellParametersID cellParametersID;
-  //TGSN  proposedTGSN;
-  PrimaryCCPCH_RSCP primaryCCPCH_RSCP;
-  Pathloss        pathloss;
-  TimeslotISCP_List timeslotISCP_List;
-} CellMeasuredResults_modeSpecificInfo_tdd;
-
-/*  CellMeasuredResults  */
-typedef struct CellMeasuredResults {
-  CellIdentity    cellIdentity;
-  //SFN_SFN_ObsTimeDifference  sfn_SFN_ObsTimeDifference;
-  //CellSynchronisationInfo  cellSynchronisationInfo;
-  CellMeasuredResults_modeSpecificInfo_tdd modeSpecificInfo;
-} CellMeasuredResults;
-
-/*  IntraFreqMeasuredResultsList */
-typedef struct IntraFreqMeasuredResultsList {
-  u8              numCells;
-  CellMeasuredResults cellMeas[MAXMEASCELLS];
-} IntraFreqMeasuredResultsList;
-
-/**************************************************************/
-
-/*  RLC_BuffersPayload  */
-typedef enum {
-  pl0 = 0,
-  pl4 = 1,
-  pl8 = 2,
-  pl16 = 3,
-  pl32 = 4,
-  pl64 = 5,
-  pl128 = 6,
-  pl256 = 7,
-  pl512 = 8,
-  pl1024 = 9,
-  pl2k = 10,
-  pl4k = 11,
-  pl8k = 12,
-  pl16k = 13,
-  pl32k = 14,
-  pl64k = 15,
-  pl128k = 16,
-  pl256k = 17,
-  pl512k = 18,
-  pl1024k = 19,
-} RLC_BuffersPayload;
-/*  AverageRLC_BufferPayload  */
-typedef enum {
-  pla0 = 0,
-  pla4 = 1,
-  pla8 = 2,
-  pla16 = 3,
-  pla32 = 4,
-  pla64 = 5,
-  pla128 = 6,
-  pla256 = 7,
-  pla512 = 8,
-  pla1024 = 9,
-  pla2k = 10,
-  pla4k = 11,
-  pla8k = 12,
-  pla16k = 13,
-  pla32k = 14,
-  pla64k = 15,
-  pla128k = 16,
-  pla256k = 17,
-  pla512k = 18,
-  pla1024k = 19,
-} AverageRLC_BufferPayload;
-/*  VarianceOfRLC_BufferPayload  */
-typedef enum {
-  plv0 = 0,
-  plv4 = 1,
-  plv8 = 2,
-  plv16 = 3,
-  plv32 = 4,
-  plv64 = 5,
-  plv128 = 6,
-  plv256 = 7,
-  plv512 = 8,
-  plv1024 = 9,
-  plv2k = 10,
-  plv4k = 11,
-  plv8k = 12,
-  plv16k = 13,
-} VarianceOfRLC_BufferPayload;
-/*  TrafficVolumeMeasuredResults  */
-typedef struct TrafficVolumeMeasuredResults {
-  RB_Identity     rb_Identity;
-  RLC_BuffersPayload rlc_BuffersPayload;
-  AverageRLC_BufferPayload averageRLC_BufferPayload;
-  VarianceOfRLC_BufferPayload varianceOfRLC_BufferPayload;
-} TrafficVolumeMeasuredResults;
-
-/*  TrafficVolumeMeasuredResultsList  */
-typedef struct TrafficVolumeMeasuredResultsList {
-  u8              numRB;
-  TrafficVolumeMeasuredResults RBMeas[MAXMEASRBS];      // should be 32
-} TrafficVolumeMeasuredResultsList;
-
-/**************************************************************/
-
-/*  DL_TransportChannelBLER
-    (value >= 0 && value <= 63)  */
-typedef u8      DL_TransportChannelBLER;
-/*  BLER_MeasurementResults  */
-typedef struct BLER_MeasurementResults {
-  TransportChannelIdentity transportChannelIdentity;
-  DL_TransportChannelBLER dl_TransportChannelBLER;
-} BLER_MeasurementResults;
-/*  BLER_MeasurementResultsList  */
-typedef struct BLER_MeasurementResultsList {
-  u8              numTrCH;
-  BLER_MeasurementResults measTrCH[MAXMEASTRCH];        // should be 32
-} BLER_MeasurementResultsList;
-
-
-//  TFCS_IdentityPlain
-/*  SIR
-    (value >= 0 && value <= 63)  */
-typedef u8      SIR;
-
-/*  SIR_TimeslotList  */
-typedef struct SIR_TimeslotList {
-  u8              numSIR;
-  SIR             sir[JRRM_SLOTS_PER_FRAME];
-} SIR_TimeslotList;
-/*  SIR_MeasurementResults  */
-typedef struct SIR_MeasurementResults {
-  TFCS_IdentityPlain tfcs_ID;
-  SIR_TimeslotList sir_TimeslotList;
-} SIR_MeasurementResults;
-/*  SIR_MeasurementList  */
-typedef struct SIR_MeasurementList {
-  u8              numTFCS;
-  SIR_MeasurementResults sirMeas[MAXMEASTFCS];
-} SIR_MeasurementList;
-
-
-/*  QualityMeasuredResults  */
-typedef struct QualityMeasuredResults {
-  BLER_MeasurementResultsList blerMeasurementResultsList;
-  SIR_MeasurementList sir_MeasurementList;
-} QualityMeasuredResults;
-
-/**************************************************************/
-
-/*  UE_TransmittedPower
-    value >= 0 && value <= 104  */
-typedef u8      UE_TransmittedPower;
-/*  UE_TransmittedPowerTDD_List  */
-typedef struct UE_TransmittedPowerTDD_List {
-  u8              numSlots;
-  UE_TransmittedPower xmitPower[JRRM_SLOTS_PER_FRAME];
-} UE_TransmittedPowerTDD_List;
-
-/*  UL_TimingAdvance
-    value >= 0 && value <= 63  */
-typedef u8      UL_TimingAdvance;
-
-/*  UE_InternalMeasuredResults_tdd  */
-typedef struct UE_InternalMeasuredResults_modeSpecificInfo_tdd {
-  UE_TransmittedPowerTDD_List ue_TransmittedPowerTDD_List;
-  UL_TimingAdvance appliedTA;
-} UE_InternalMeasuredResults_tdd;
-
-/**************************************************************/
-/*  MeasuredResults  */
-typedef struct MeasuredResults {
-  u8              measResult;
-  union {
-    /* measResult = 1 */
-    IntraFreqMeasuredResultsList intraFreqMeasuredResultsList;
-    /* measResult = 2 */
-    //InterFreqMeasuredResultsList interFreqMeasuredResultsList;
-    /* measResult = 4 */
-    TrafficVolumeMeasuredResultsList trafficVolumeMeasuredResultsList;
-    /* measResult = 5 */
-    QualityMeasuredResults qualityMeasuredResults;
-    /* measResult = 6 */
-    UE_InternalMeasuredResults_tdd ue_InternalMeasuredResults;
-  } result;
-} MeasuredResults;
-
-
-// /**************************************************************/
-// /*  OpenLoopPowerControl_IPDL_TDD_r4                          */
-// /**************************************************************/
-// typedef struct OpenLoopPowerControl {
-//   s16 alpha __attribute__ ((packed));
-//   u16 maxPowerIncrease __attribute__ ((packed));
-// } OpenLoopPowerControl;
-//
-// /**************************************************************/
-// /*  UL_DPCH_PowerControlInfo_tdd                              */
-// /**************************************************************/
-// typedef struct UplinkPhysicalChannelControl {
-//   s16 timingAdvance __attribute__ ((packed));
-//   u16 alpha __attribute__ ((packed));
-//   s16 prach_ConstantValue __attribute__ ((packed));
-//   s16 pusch_ConstantValue __attribute__ ((packed));
-//   s16 dpch_ConstantValue __attribute__ ((packed));
-//   OpenLoopPowerControl openLoopPowerControl __attribute__ ((packed));
-// } UplinkPhysicalChannelControl;
-//
-// /**************************************************************/
-// /*  UL_DPCH_PowerControlInfo_tdd                              */
-// /**************************************************************/
-// typedef struct UL_DPCH_PowerControlInfo {
-//   s16 ul_TargetSIR __attribute__ ((packed));
-//   //   UL_DPCH_PowerControlInfo_tdd_ul_OL_PC_Signalling  ul_OL_PC_Signalling;
-// } UL_DPCH_PowerControlInfo;
-// /**************************************************************/
-// /*  CCTrCH_PowerControlInfo_r4                                */
-// /**************************************************************/
-// typedef struct CCTrCH_PowerControlInfo {
-//   u16 tfcs_Identity __attribute__ ((packed));   // CCTrCH Index
-//   UL_DPCH_PowerControlInfo ul_DPCH_PowerControlInfo __attribute__ ((packed));
-// } CCTrCH_PowerControlInfo;
-// /**************************************************************/
-// /*  UplinkPhysicalChannelControl_r4_IEs                       */
-// /**************************************************************/
-// typedef struct UplinkPhysicalChannelControl_IE {
-//   u16 ue_id __attribute__ ((packed));
-//   CCTrCH_PowerControlInfo ccTrCH_PowerControlInfo __attribute__ ((packed));     //CCTrCH UL Power Control
-//   UplinkPhysicalChannelControl uplinkPhysicalChannelControl __attribute__ ((packed));   //PRACH/PUSCH Parameters
-// } UplinkPhysicalChannelControl_IE;
-
-//**************************************************************/
-/*  UE Capability Information                                 */
-/**************************************************************/
-/* AccessStratumReleaseIndicator */
-typedef u8 AccessStratumReleaseIndicator;
-/* EurecomKernelReleaseIndicator */
-typedef u8 EurecomKernelReleaseIndicator;
-
-
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_msg_pdus.c b/openair2/RRC/CELLULAR/rrc_msg_pdus.c
deleted file mode 100755
index d0d5a1a801..0000000000
--- a/openair2/RRC/CELLULAR/rrc_msg_pdus.c
+++ /dev/null
@@ -1,1779 +0,0 @@
-/***************************************************************************
-                        rrc_msg_pdus.c  -  description
-                        -------------------
-  begin                : Jan 6, 2003
-  copyright            : (C) 2003, 2010 by Eurecom
-  email                : Michelle.Wetterwald@eurecom.fr
-  **************************************************************************
-  Procedures to perform encoding of RRC peer-to-peer messages
-  ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#ifdef NODE_MT
-#include "rrc_ue_vars.h"
-#endif
-#ifdef NODE_RG
-#include "rrc_rg_vars.h"
-#endif
-#include "rrc_msg_class.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_msg.h"
-#include "rrc_proto_int.h"
-//-----------------------------------------------------------------------------
-
-//Temp
-u8 new_conf[] = "666666666677777777770000000000888888888899999999991212121212121212121234343434343434343434";
-
-/**************************************************************/
-/*  RRCConnectionRequest                                      */
-/**************************************************************/
-#ifdef NODE_MT
-int rrc_PEREnc_RRCConnectionRequest (RRCConnectionRequest * pvalue)
-{
-  int status = P_SUCCESS;
-  int i;
-
-  /* encode initialUE_Identity = IMEI */
-  pvalue->imei.numDigits = 14;  // limited version of IMEI is used
-
-  for (i = 0; i < pvalue->imei.numDigits; i++)
-    pvalue->imei.digit[i] = protocol_ms->rrc.IMEI[i];
-
-  /* encode establishmentCause */
-  pvalue->establishmentCause = protocol_ms->rrc.establishment_cause;
-
-  /* encode protocolErrorIndicator */
-  pvalue->protocolErrorIndicator = protocol_ms->rrc.prot_error_indicator;
-
-  /* encode measuredResultsOnRACH */
-  // status = rrc_PEREnc_MeasuredResultsOnRACH (&pvalue->measuredResultsOnRACH);
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_RG
-int rrc_PERDec_RRCConnectionRequest (int UE_Id, RRCConnectionRequest * pvalue)
-{
-  int status = P_SUCCESS;
-
-  /* decode initial UE_Identity = IMEI */
-  if (pvalue->imei.numDigits > 15)
-    return P_OUTOFBOUNDS;
-
-  memcpy (protocol_bs->rrc.Mobile_List[UE_Id].IMEI, pvalue->imei.digit, 14);
-
-  /* decode establishmentCause */
-  protocol_bs->rrc.Mobile_List[UE_Id].establishment_cause = pvalue->establishmentCause;
-  //    #ifdef DEBUG_RRC_STATE
-  //    msg("\n[RRC_RG] Establishment Cause %d \n", pvalue->establishmentCause );
-  //    #endif
-
-  /* decode protocolErrorIndicator */
-  protocol_bs->rrc.Mobile_List[UE_Id].prot_error_indicator = pvalue->protocolErrorIndicator;
-
-  /* decode measuredResultsOnRACH */
-  //  status = rrc_PERDec_MeasuredResultsOnRACH (&pvalue->measuredResultsOnRACH);
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  RRCConnectionSetup                                        */
-/**************************************************************/
-#ifdef NODE_RG
-int rrc_PEREnc_RRCConnectionSetup (int UE_Id, RRCConnectionSetup * pvalue)
-{
-  int status = P_SUCCESS;
-  int i;
-  char *pwrite;
-  int buff_length;
-  //   char xor_result[sizeof(MT_CONFIG)];
-  //   char compression_result[sizeof(MT_CONFIG)];
-
-  /* encode initialUE_Identity = IMEI */
-  pvalue->imei.numDigits = 14;  // limited version of IMEI is used
-
-  for (i = 0; i < pvalue->imei.numDigits; i++)
-    pvalue->imei.digit[i] = protocol_bs->rrc.Mobile_List[UE_Id].IMEI[i];
-
-  /* encode rrc_TransactionIdentifier */
-  pvalue->rrc_TransactionIdentifier = protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id;
-
-  /* encode activationTime */
-  pvalue->activationTime = 0;   //default value : now = absence
-
-  /* encode new_U_RNTI */
-  pvalue->new_U_RNTI = UE_Id;
-  /* encode new_c_RNTI -- FFS */
-
-  /* encode rrc_stateIndicator */
-  pvalue->rrc_StateIndicator = cell_DCH;        // Temp hard coded
-
-  /* encode qos class and dscp code */
-  //   memcpy(pvalue->qos_Classes, protocol_bs->rrc.Mobile_List[UE_Id].qos_classes,MAXURAB) ;
-  //   memcpy(pvalue->ip_dscp_Codes, protocol_bs->rrc.Mobile_List[UE_Id].dscp_codes,MAXURAB) ;
-
-  // TODO: Remplacer buffers par config
-  /* encode ue_Configuration */
-  //   rrc_compress_buffer(new_conf,90, new_conf, &buff_length);
-  //   rrc_xor_config((char*)&(rrm_config->mt_config[UE_Id]),
-  //                  (char*)&(protocol_bs->rrc.saved_configuration.mt_config[UE_Id]), xor_result);
-  //   rrc_compress_buffer(xor_result,sizeof(MT_CONFIG), compression_result, &buff_length);
-
-  pwrite = (char *) &(pvalue->ue_Configuration.numoctets);
-  rrc_compress_config ((MT_CONFIG *) &(rrm_config->mt_config[UE_Id]), &pwrite[2], &buff_length);
-
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length = pwrite - (char *) pvalue + MSG_HEAD_LGTH;
-
-  *(u16 *) pwrite = buff_length;
-  pwrite += 2;
-  //   memcpy(pwrite,new_conf, buff_length);
-  //   memcpy(pwrite,compression_result, buff_length);
-
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC_MSG] rrc_PEREnc_RRCConnectionSetup - Buffer length # 1 : %d\n", protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-#endif
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length += buff_length + 2;
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC_MSG] rrc_PEREnc_RRCConnectionSetup - Buffer length # 2 : %d\n", protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-#endif
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int rrc_PERDec_RRCConnectionSetup (RRCConnectionSetup * pvalue)
-{
-  int status = P_SUCCESS;
-  int buff_length;
-  char *buff_ptr;
-  //   char compression_result[sizeof(MT_CONFIG)];
-
-  /* decode initial UE_Identity = IMEI */
-  if (pvalue->imei.numDigits > 15)
-    return P_OUTOFBOUNDS;
-
-  //   if (status = (strncmp((char *)protocol_ms->rrc.IMEI, (char *)pvalue->imei.digit,14)))
-  status = memcmp ((char *) protocol_ms->rrc.IMEI, (char *) pvalue->imei.digit, 14);
-
-  if (status) {
-    msg ("\n[RRC_MSG] IMEI : --%s--, Received : --%s--, status %d\n", (char *) protocol_ms->rrc.IMEI, (char *) pvalue->imei.digit, status);
-    return P_INVVALUE;          // ignore message
-  }
-
-  /* decode rrc_TransactionIdentifier */
-  protocol_ms->rrc.rcved_trans.msg_type = DL_CCCH_rrcConnectionSetup;
-  protocol_ms->rrc.rcved_trans.transaction_Id = pvalue->rrc_TransactionIdentifier;
-  //Temp - Hard coded
-  protocol_ms->rrc.accepted_trans[0].transaction_Id = pvalue->rrc_TransactionIdentifier;
-
-  /* decode activationTime */
-  protocol_ms->rrc.nextActivationTime = pvalue->activationTime;
-
-  /* decode new_U_RNTI */
-  protocol_ms->rrc.u_rnti = pvalue->new_U_RNTI;
-  /* decode new_c_RNTI -- FFS */
-  protocol_ms->rrc.c_rnti = pvalue->new_U_RNTI;
-
-  /* decode rrc_stateIndicator */
-  switch (pvalue->rrc_StateIndicator) {
-  case cell_DCH:
-    protocol_ms->rrc.next_state = CELL_DCH;
-    break;
-
-  case cell_FACH:
-    protocol_ms->rrc.next_state = CELL_FACH;
-    break;
-
-  case cell_PCH:
-    protocol_ms->rrc.next_state = CELL_PCH;
-    break;
-
-  default:                 //ura_PCH not supported
-    return P_INVVALUE;
-  }
-
-  /* decode qos class and dscp code */
-  //   memcpy( protocol_ms->rrc.qos_classes,pvalue->qos_Classes,MAXURAB) ;
-  //   memcpy( protocol_ms->rrc.dscp_codes,pvalue->ip_dscp_Codes,MAXURAB) ;
-  //#ifdef DEBUG_RRC_STATE
-  //   msg("\n[RRC_MSG] QOS Classes and DSCP codes : \n");
-  //   rrc_print_buffer((char*)&(protocol_ms->rrc.qos_classes), MAXURAB);
-  //   rrc_print_buffer((char*)&(protocol_ms->rrc.dscp_codes), MAXURAB);
-  //#endif
-
-  /* decode ue_Configuration */
-  buff_length = (u16) pvalue->ue_Configuration.numoctets;
-  buff_ptr = (char *) (&(pvalue->ue_Configuration.numoctets));
-  buff_ptr += 2;
-  //   rrc_uncompress_buffer(buff_ptr,(u16)pvalue->ue_Configuration.numoctets, buff_ptr, &buff_length);
-  //#ifdef DEBUG_RRC_STATE
-  //   msg("\n[RRC_MSG] New Configuration : \n");
-  //   rrc_print_buffer(buff_ptr, buff_length);
-  //#endif
-
-  //   rrc_uncompress_buffer(buff_ptr,(u16)pvalue->ue_Configuration.numoctets, compression_result, &buff_length);
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC_MSG] Starting the uncompression of the configuration.- Conn Setup\n");
-#endif
-  rrc_uncompress_config ((MT_CONFIG *) &(rrm_config->mt_config), buff_ptr);
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC_MSG] Length of New Configuration : %d \n", buff_length);
-#endif
-
-  //   rrc_xor_config(compression_result,(char*) &(protocol_ms->rrc.saved_configuration.mt_config),
-  //                    (char*)&(rrm_config->mt_config));
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  RRCConnectionSetupComplete                                */
-/**************************************************************/
-#ifdef NODE_MT
-int rrc_PEREnc_RRCConnectionSetupComplete (RRCConnectionSetupComplete * pvalue)
-{
-  int status = P_SUCCESS;
-
-  /* encode rrc_TransactionIdentifier */
-  pvalue->rrc_TransactionIdentifier = protocol_ms->rrc.accepted_trans[0].transaction_Id;
-
-  /* encode ue_RadioAccessCapability */
-  pvalue->ue_RadioAccessCapability = eurecom_rrc;
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_RG
-int rrc_PERDec_RRCConnectionSetupComplete (int UE_Id, RRCConnectionSetupComplete * pvalue)
-{
-  int status = P_SUCCESS;
-
-  /* decode rrc_TransactionIdentifier */
-  if (pvalue->rrc_TransactionIdentifier != protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id) {
-    //      return P_INVVALUE;
-    msg ("\n[RRC_MSG] Transaction Id : --%d--, Received : --%d--, status %d\n", protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id, pvalue->rrc_TransactionIdentifier, status);
-    return P_INVVALUE;          // ignore message
-  }
-
-  /* decode ue_RadioAccessCapability */
-  if (pvalue->ue_RadioAccessCapability != eurecom_rrc) {
-    //      return P_INVVALUE;
-    msg ("\n[RRC_MSG] Capability : --%d--, Received : --%d--, status %d\n", eurecom_rrc, pvalue->ue_RadioAccessCapability, status);
-    return P_INVVALUE;          // ignore message
-  }
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  RRCConnectionReject                                       */
-/**************************************************************/
-#ifdef NODE_RG
-int rrc_PEREnc_RRCConnectionReject (int UE_Id, RRCConnectionReject * pvalue)
-{
-  int status = P_SUCCESS;
-  int i;
-
-  /* encode initialUE_Identity = IMEI */
-  pvalue->imei.numDigits = 14;  // limited version of IMEI is used
-
-  for (i = 0; i < pvalue->imei.numDigits; i++)
-    pvalue->imei.digit[i] = protocol_bs->rrc.Mobile_List[UE_Id].IMEI[i];
-
-  /* encode rrc_TransactionIdentifier */
-  pvalue->rrc_TransactionIdentifier = protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id;
-
-  /* encode waitTime */
-  pvalue->waitTime = 0;         //Temp- Timer to be implemented
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int rrc_PERDec_RRCConnectionReject (RRCConnectionReject * pvalue)
-{
-  int status = P_SUCCESS;
-
-  /* decode initial UE_Identity = IMEI */
-  if (pvalue->imei.numDigits > 15)
-    return P_OUTOFBOUNDS;
-
-  //   if (status = (strncmp((char *)protocol_ms->rrc.IMEI, (char *)pvalue->imei.digit,14)))
-  status = memcmp ((char *) protocol_ms->rrc.IMEI, (char *) pvalue->imei.digit, 14);
-
-  if (status) {
-    msg ("\n[RRC_MSG] IMEI : --%s--, Received : --%s--, status %d\n", (char *) protocol_ms->rrc.IMEI, (char *) pvalue->imei.digit, status);
-    return P_INVVALUE;          // ignore message
-  }
-
-  /* decode rrc_TransactionIdentifier */
-  protocol_ms->rrc.rcved_trans.msg_type = DL_CCCH_rrcConnectionReject;
-  protocol_ms->rrc.rcved_trans.transaction_Id = pvalue->rrc_TransactionIdentifier;
-
-  /* decode wait Time */
-  protocol_ms->rrc.rejectWaitTime = pvalue->waitTime;
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  RRCConnectionRelease_UL                                   */
-/**************************************************************/
-#ifdef NODE_MT
-int rrc_PEREnc_RRCConnectionRelease_UL (RRCConnectionRelease_UL * pvalue)
-{
-  int   status = P_SUCCESS;
-
-  /* encode u_RNTI */
-  pvalue->u_RNTI = protocol_ms->rrc.u_rnti;
-
-  /* encode releaseCause */// Temp hard coded
-  pvalue->releaseCause = userInactivity;
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_RG
-int rrc_PERDec_RRCConnectionRelease_UL (int UE_Id, RRCConnectionRelease_UL * pvalue)
-{
-  int   status = P_SUCCESS;
-
-
-
-  /* decode and check u-RNTI */
-  if (pvalue->u_RNTI != protocol_bs->rrc.Mobile_List[UE_Id].u_rnti) {
-    msg ("\n[RRC_MSG] u-RNTI : --%d--, Received : --%d--, status: Invalid u-rnti \n", protocol_bs->rrc.Mobile_List[UE_Id].u_rnti, pvalue->u_RNTI);
-    return P_INVVALUE;          // ignore message
-  }
-
-  /* decode releaseCause */
-  protocol_bs->rrc.Mobile_List[UE_Id].release_cause = pvalue->releaseCause;
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  InitialDirectTransfer                                     */
-/**************************************************************/
-#ifdef NODE_MT
-int rrc_PEREnc_InitialDirectTransfer (InitialDirectTransfer * pvalue)
-{
-  int status = P_SUCCESS;
-  char *pwrite;
-  int data_length;
-
-  /* encode nas_Message */
-  pwrite = (char *) &(pvalue->nas_Message.numoctets);
-  protocol_ms->rrc.ue_msg_infos.msg_length = pwrite - (char *) pvalue + MSG_HEAD_LGTH;
-  //data_length = strlen(ul_data);
-  data_length = protocol_ms->rrc.ul_nas_message_lgth;
-  *(u16 *) pwrite = data_length;
-  pwrite += 2;
-  //memcpy(pwrite,ul_data, data_length);
-  memcpy (pwrite, (protocol_ms->rrc.ul_nas_message_ptr)->data, data_length);
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC_MSG] Buffer length #1 : %d\n", protocol_ms->rrc.ue_msg_infos.msg_length);
-#endif
-  protocol_ms->rrc.ue_msg_infos.msg_length += (data_length + 2);
-
-  /* encode measuredResultsOnRACH */
-  // status = rrc_PEREnc_MeasuredResultsOnRACH (&pvalue->measuredResultsOnRACH);
-
-  return status;
-
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_RG
-int rrc_PERDec_InitialDirectTransfer (int UE_Id, InitialDirectTransfer * pvalue)
-{
-  int status = P_SUCCESS;
-  //  char *buff_ptr;
-  u8 *buff_ptr;
-
-  // TODO: Remplacer buffers par nas_Message
-  /* decode nas_Message */
-  buff_ptr = (u8*) &(pvalue->nas_Message.numoctets);
-  buff_ptr += 2;
-  protocol_bs->rrc.Mobile_List[UE_Id].ul_nas_message_ptr = buff_ptr;
-
-  protocol_bs->rrc.Mobile_List[UE_Id].ul_nas_message_lgth = (u16) pvalue->nas_Message.numoctets;
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC_MSG] Initial Direct Transfer Received : \n");
-  rrc_print_buffer ((char *)protocol_bs->rrc.Mobile_List[UE_Id].ul_nas_message_ptr, protocol_bs->rrc.Mobile_List[UE_Id].ul_nas_message_lgth);
-  msg ("\n[RRC_MSG] Data content --%s-- \n", protocol_bs->rrc.Mobile_List[UE_Id].ul_nas_message_ptr);
-#endif
-
-  /* decode measuredResultsOnRACH */
-  //  status = rrc_PERDec_MeasuredResultsOnRACH (&pvalue->measuredResultsOnRACH);
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  UplinkDirectTransfer                                      */
-/**************************************************************/
-#ifdef NODE_MT
-int rrc_PEREnc_UplinkDirectTransfer (UplinkDirectTransfer * pvalue)
-{
-  int status = P_SUCCESS;
-  char *pwrite;
-  int data_length;
-
-  /* encode nas_Message */
-  pwrite = (char *) &(pvalue->nas_Message.numoctets);
-
-  protocol_ms->rrc.ue_msg_infos.msg_length = pwrite - (char *) pvalue + MSG_HEAD_LGTH;
-  //data_length = strlen(ul_data);
-  data_length = protocol_ms->rrc.ul_nas_message_lgth;
-  *(u16 *) pwrite = data_length;
-  pwrite += 2;
-  //memcpy(pwrite,ul_data, data_length);
-  memcpy (pwrite, (protocol_ms->rrc.ul_nas_message_ptr)->data, data_length);
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC_MSG] Buffer length - 1 : %d\n", protocol_ms->rrc.ue_msg_infos.msg_length);
-#endif
-  protocol_ms->rrc.ue_msg_infos.msg_length += (data_length + 2);
-
-  /* encode measuredResultsOnRACH */
-  // status = rrc_PEREnc_MeasuredResultsOnRACH (&pvalue->measuredResultsOnRACH);
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_RG
-
-int rrc_PERDec_UplinkDirectTransfer (int UE_Id, UplinkDirectTransfer * pvalue)
-{
-  int status = P_SUCCESS;
-  u8 *buff_ptr;
-
-  // TODO: Remplacer buffers par nas_Message
-  /* decode nas_Message */
-  buff_ptr = (u8 *) (&(pvalue->nas_Message.numoctets));
-  buff_ptr += 2;
-  protocol_bs->rrc.Mobile_List[UE_Id].ul_nas_message_ptr = buff_ptr;
-  protocol_bs->rrc.Mobile_List[UE_Id].ul_nas_message_lgth = (u16) pvalue->nas_Message.numoctets;
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC_MSG] New Uplink Direct Transfer Received: \n");
-  rrc_print_buffer ((char *)protocol_bs->rrc.Mobile_List[UE_Id].ul_nas_message_ptr, protocol_bs->rrc.Mobile_List[UE_Id].ul_nas_message_lgth);
-  msg ("\n[RRC_MSG] Data content --%s-- \n", protocol_bs->rrc.Mobile_List[UE_Id].ul_nas_message_ptr);
-#endif
-
-  /* decode measuredResultsOnRACH */
-  //  status = rrc_PERDec_MeasuredResultsOnRACH (&pvalue->measuredResultsOnRACH);
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  DownlinkDirectTransfer                                    */
-/**************************************************************/
-#ifdef NODE_RG
-int rrc_PEREnc_DownlinkDirectTransfer (int UE_Id, DownlinkDirectTransfer * pvalue)
-{
-  int status = P_SUCCESS;
-  char *pwrite;
-  int data_length;
-
-  /* encode rrc_TransactionIdentifier */
-  pvalue->rrc_TransactionIdentifier = protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id;
-
-  /* encode nas_Message */
-  pwrite = (char *) &(pvalue->nas_Message.numoctets);
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length = pwrite - (char *) pvalue + MSG_HEAD_LGTH;
-  //data_length = strlen(dl_data);
-  data_length = protocol_bs->rrc.Mobile_List[UE_Id].dl_nas_message_lgth;
-  *(u16 *) pwrite = data_length;
-
-  pwrite += 2;
-  //memcpy(pwrite,dl_data, data_length);
-  memcpy (pwrite, (protocol_bs->rrc.Mobile_List[UE_Id].dl_nas_message_ptr)->data, data_length);
-
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC_MSG] Buffer length - 1 : %d\n", protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-#endif
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length += (data_length + 2);
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int rrc_PERDec_DownlinkDirectTransfer (DownlinkDirectTransfer * pvalue)
-{
-  int status = P_SUCCESS;
-  char *buff_ptr;
-
-  /* decode rrc_TransactionIdentifier */
-  protocol_ms->rrc.rcved_trans.msg_type = DL_DCCH_downlinkDirectTransfer;
-  protocol_ms->rrc.rcved_trans.transaction_Id = pvalue->rrc_TransactionIdentifier;
-
-  // TODO: Remplacer buffers par nas_Message
-  /* decode nas_Message */
-  buff_ptr = (char *) (&(pvalue->nas_Message.numoctets));
-  buff_ptr += 2;
-
-  protocol_ms->rrc.dl_nas_message_ptr = buff_ptr;
-  protocol_ms->rrc.dl_nas_message_lgth = (u16) pvalue->nas_Message.numoctets;
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC_MSG] New Downlink Direct Transfer : \n");
-  rrc_print_buffer (protocol_ms->rrc.dl_nas_message_ptr, protocol_ms->rrc.dl_nas_message_lgth);
-  msg ("\n[RRC_MSG] Data content --%s-- \n", protocol_ms->rrc.dl_nas_message_ptr);
-#endif
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  RadioBearerSetup                                          */
-/**************************************************************/
-#ifdef NODE_RG
-int rrc_PEREnc_RadioBearerSetup (int UE_Id, RadioBearerSetup * pvalue)
-{
-  int status = P_SUCCESS;
-  char *pwrite;
-  int buff_length;
-
-  /* encode rrc_TransactionIdentifier */
-  pvalue->rrc_TransactionIdentifier = protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id;
-
-  /* encode activationTime */
-  pvalue->activationTime = 0;   //default value : now = absence
-
-  /* encode new_U_RNTI */
-  pvalue->new_U_RNTI = UE_Id;
-  /* encode new_c_RNTI -- FFS */
-
-  /* encode rrc_stateIndicator */
-  pvalue->rrc_StateIndicator = cell_DCH;        // Temp hard coded
-
-  /* encode RB information */
-  pvalue->rab_InformationSetupList.numrabs = 1; // Temp hard coded
-  pvalue->rab_InformationSetupList.rbinfo[0].rb_identity = protocol_bs->rrc.Mobile_List[UE_Id].requested_MTrbId;
-  pvalue->rab_InformationSetupList.rbinfo[0].qos_class = protocol_bs->rrc.Mobile_List[UE_Id].requested_QoSclass;
-  pvalue->rab_InformationSetupList.rbinfo[0].ip_dscp_code = protocol_bs->rrc.Mobile_List[UE_Id].requested_dscp;
-  pvalue->rab_InformationSetupList.rbinfo[0].sap_id = protocol_bs->rrc.Mobile_List[UE_Id].requested_sapid;
-
-  /* encode ue_Configuration */
-  //   rrc_compress_buffer(new_conf,90, new_conf, &buff_length);
-  //
-  //   buff_length=strlen(new_conf);
-  //   *(u16*)pwrite = buff_length ;
-  //   pwrite +=2;
-  //   memcpy(pwrite,new_conf, buff_length);
-  pwrite = (char *) &(pvalue->ue_Configuration.numoctets);
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC_MSG] Starting the compression of the configuration.- RB Setup\n");
-#endif
-  rrc_compress_config ((MT_CONFIG *) &(rrm_config->mt_config[UE_Id]), &pwrite[2], &buff_length);
-
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length = pwrite - (char *) pvalue + MSG_HEAD_LGTH;
-
-  *(u16 *) pwrite = buff_length;
-  pwrite += 2;
-
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC_MSG] Buffer length # 1 : %d\n", protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-#endif
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length += buff_length + 2;
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC_MSG] Buffer length # 2 : %d\n", protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-#endif
-
-  return status;
-}
-
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int  rrc_PERDec_RadioBearerSetup (RadioBearerSetup * pvalue)
-{
-  int status = P_SUCCESS;
-  int buff_length;
-  int rb_id = 0;
-  char *buff_ptr;
-
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC_MSG] Radio Bearer Setup: ");
-  rrc_print_buffer ((char *) pvalue, 510);
-#endif
-
-  /* decode rrc_TransactionIdentifier */
-  protocol_ms->rrc.rcved_trans.msg_type = DL_DCCH_radioBearerSetup;
-  protocol_ms->rrc.rcved_trans.transaction_Id = pvalue->rrc_TransactionIdentifier;
-  //Temp - Hard coded
-  protocol_ms->rrc.accepted_trans[0].transaction_Id = pvalue->rrc_TransactionIdentifier;
-
-  /* decode activationTime */
-  protocol_ms->rrc.nextActivationTime = pvalue->activationTime;
-
-  /* decode new_U_RNTI */
-  protocol_ms->rrc.u_rnti = pvalue->new_U_RNTI;
-
-  /* decode new_c_RNTI -- FFS */
-  protocol_ms->rrc.c_rnti = pvalue->new_U_RNTI;
-
-  /* decode rrc_stateIndicator */
-  switch (pvalue->rrc_StateIndicator) {
-  case cell_DCH:
-    protocol_ms->rrc.next_state = CELL_DCH;
-    break;
-
-  case cell_FACH:
-    protocol_ms->rrc.next_state = CELL_FACH;
-    break;
-
-  case cell_PCH:
-    protocol_ms->rrc.next_state = CELL_PCH;
-    break;
-
-  default:                 //ura_PCH not supported
-    return P_INVVALUE;
-  }
-
-  /* decode qos class and dscp code */
-  if (pvalue->rab_InformationSetupList.numrabs > 1)
-    msg ("\n[RRC_MSG] Number of rabs to setup not supported\n");
-
-  protocol_ms->rrc.requested_rbId = pvalue->rab_InformationSetupList.rbinfo[0].rb_identity;
-  protocol_ms->rrc.requested_QoSclass = pvalue->rab_InformationSetupList.rbinfo[0].qos_class;
-  protocol_ms->rrc.requested_dscp = pvalue->rab_InformationSetupList.rbinfo[0].ip_dscp_code;
-  protocol_ms->rrc.requested_sapid = pvalue->rab_InformationSetupList.rbinfo[0].sap_id;
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC_MSG] Number of Radio Bearers : %d \n", pvalue->rab_InformationSetupList.numrabs);
-#endif
-  rb_id = protocol_ms->rrc.requested_rbId;
-
-  protocol_ms->rrc.ue_established_rbs[rb_id].rb_identity = protocol_ms->rrc.requested_rbId;
-  protocol_ms->rrc.ue_established_rbs[rb_id].qos_class = protocol_ms->rrc.requested_QoSclass;
-  protocol_ms->rrc.ue_established_rbs[rb_id].dscp_code = protocol_ms->rrc.requested_dscp;
-  protocol_ms->rrc.ue_established_rbs[rb_id].sap_id = protocol_ms->rrc.requested_sapid;
-  protocol_ms->rrc.ue_established_rbs[rb_id].rb_started = RB_STOPPED;
-
-  /* decode ue_Configuration */
-  //
-  buff_length = (u16) pvalue->ue_Configuration.numoctets;
-  buff_ptr = (char *) (&(pvalue->ue_Configuration.numoctets));
-  buff_ptr += 2;
-  //#ifdef DEBUG_RRC_STATE
-  //   msg("\n[RRC_MSG] New Configuration , length %d : \n", buff_length);
-  //   rrc_print_buffer(buff_ptr, buff_length);
-  //#endif
-
-  rrc_uncompress_config ((MT_CONFIG *) &(rrm_config->mt_config), buff_ptr);
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC_MSG] Length of New Configuration : %d \n", buff_length);
-#endif
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  RadioBearerRelease                                        */
-/**************************************************************/
-#ifdef NODE_RG
-int rrc_PEREnc_RadioBearerRelease (int UE_Id, RadioBearerRelease * pvalue)
-{
-  int status = P_SUCCESS;
-
-  char *pwrite;
-  int buff_length;
-
-  /* encode rrc_TransactionIdentifier */
-  pvalue->rrc_TransactionIdentifier = protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id;
-
-  /* encode activationTime */
-  pvalue->activationTime = 0;   //default value : now = absence
-
-  /* encode new_U_RNTI */
-  pvalue->new_U_RNTI = UE_Id;
-  /* encode new_c_RNTI -- FFS */
-
-  /* encode rrc_stateIndicator */
-  pvalue->rrc_StateIndicator = cell_DCH;        // Temp hard coded
-
-  /* encode rb_InformationReleaseList  */
-  pvalue->rb_InformationReleaseList.numrabs = 1;
-  pvalue->rb_InformationReleaseList.rbid[0] = protocol_bs->rrc.Mobile_List[UE_Id].requested_MTrbId;
-
-  /* encode ue_Configuration */
-  //   rrc_compress_buffer(new_conf,90, new_conf, &buff_length);
-  //
-  //   pwrite = (char *)  &(pvalue->ue_Configuration.numoctets);
-  //   protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length = pwrite - (char *)pvalue + MSG_HEAD_LGTH;
-  //
-  //   *(u16*)pwrite = buff_length ;
-  //   pwrite +=2;
-  //   memcpy(pwrite,new_conf, buff_length);
-  //
-  pwrite = (char *) &(pvalue->ue_Configuration.numoctets);
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC_MSG] Starting the compression of the configuration.- RB Release\n");
-#endif
-  rrc_compress_config ((MT_CONFIG *) &(rrm_config->mt_config[UE_Id]), &pwrite[2], &buff_length);
-
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length = pwrite - (char *) pvalue + MSG_HEAD_LGTH;
-
-  *(u16 *) pwrite = buff_length;
-  pwrite += 2;
-
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC_MSG] Buffer length # 1 : %d\n", protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-#endif
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length += buff_length + 2;
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC_MSG] Buffer length # 2 : %d\n", protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-#endif
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int rrc_PERDec_RadioBearerRelease (RadioBearerRelease * pvalue)
-{
-  int status = P_SUCCESS;
-  int buff_length;
-  char *buff_ptr;
-
-  /* decode rrc_TransactionIdentifier */
-  protocol_ms->rrc.rcved_trans.msg_type = DL_DCCH_radioBearerRelease;
-  protocol_ms->rrc.rcved_trans.transaction_Id = pvalue->rrc_TransactionIdentifier;
-  //Temp - Hard coded
-  protocol_ms->rrc.accepted_trans[0].transaction_Id = pvalue->rrc_TransactionIdentifier;
-
-  /* decode activationTime */
-  //   protocol_ms->rrc.nextActivationTime = pvalue->activationTime;
-  protocol_ms->rrc.nextActivationTime = 0;
-  //temp: contains RB_ID
-  protocol_ms->rrc.requested_rbId = pvalue->activationTime;
-
-  /* decode new_U_RNTI */
-  protocol_ms->rrc.u_rnti = pvalue->new_U_RNTI;
-  /* decode new_c_RNTI -- FFS */
-  protocol_ms->rrc.c_rnti = pvalue->new_U_RNTI;
-
-  /* decode rrc_stateIndicator */
-  switch (pvalue->rrc_StateIndicator) {
-  case cell_DCH:
-    protocol_ms->rrc.next_state = CELL_DCH;
-    break;
-
-  case cell_FACH:
-    protocol_ms->rrc.next_state = CELL_FACH;
-    break;
-
-  case cell_PCH:
-    protocol_ms->rrc.next_state = CELL_PCH;
-    break;
-
-  default:                 //ura_PCH not supported
-    return P_INVVALUE;
-  }
-
-  /* decode rb_InformationReleaseList  */
-  if (pvalue->rb_InformationReleaseList.numrabs > 1)
-    msg ("\n[RRC_MSG] Number of rabs to release not supported.\n");
-
-  protocol_ms->rrc.requested_rbId = pvalue->rb_InformationReleaseList.rbid[0];
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC_MSG] Number of Radio Bearers : %d \n", pvalue->rb_InformationReleaseList.numrabs);
-#endif
-
-  /* decode ue_Configuration */
-  //
-  buff_length = (u16) pvalue->ue_Configuration.numoctets;
-  buff_ptr = (char *) (&(pvalue->ue_Configuration.numoctets));
-  buff_ptr += 2;
-  //   rrc_uncompress_buffer(buff_ptr,(u16)pvalue->ue_Configuration.numoctets, buff_ptr, &buff_length);
-  //#ifdef DEBUG_RRC_STATE
-  //   msg("\n[RRC_MSG] New Configuration , length %d : \n", buff_length);
-  //   rrc_print_buffer(buff_ptr, buff_length);
-  //#endif
-
-  rrc_uncompress_config ((MT_CONFIG *) &(rrm_config->mt_config), buff_ptr);
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC_MSG] Length of New Configuration : %d \n", buff_length);
-#endif
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  RadioBearerSetupComplete                                  */
-/**************************************************************/
-
-#ifdef NODE_MT
-int rrc_PEREnc_RadioBearerSetupComplete (RadioBearerSetupComplete * pvalue)
-{
-  int status = P_SUCCESS;
-
-  /* encode rrc_TransactionIdentifier */
-  pvalue->rrc_TransactionIdentifier = protocol_ms->rrc.accepted_trans[0].transaction_Id;
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_RG
-int rrc_PERDec_RadioBearerSetupComplete (int UE_Id, RadioBearerSetupComplete * pvalue)
-{
-  int status = P_SUCCESS;
-
-  /* decode rrc_TransactionIdentifier */
-  if (pvalue->rrc_TransactionIdentifier != protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id)
-    //      return P_INVVALUE;
-  {
-    msg ("\n[RRC_MSG] Transaction Id : --%d--, Received : --%d--, status %d\n", protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id, pvalue->rrc_TransactionIdentifier, status);
-    //return P_INVVALUE; // TEMP ignore error until transactions completely implemented
-  }
-
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  RadioBearerSetupFailure                                   */
-/**************************************************************/
-#ifdef NODE_MT
-int rrc_PEREnc_RadioBearerSetupFailure (RadioBearerSetupFailure * pvalue)
-{
-  int status = P_SUCCESS;
-
-  /* encode rrc_TransactionIdentifier */
-  pvalue->rrc_TransactionIdentifier = protocol_ms->rrc.accepted_trans[0].transaction_Id;
-
-  /* encode failureCause */// Temp hard coded
-  pvalue->failureCause.type = FCWPE_protocolError;
-  pvalue->failureCause.protocolError = ie_ValueNotComprehended;
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_RG
-int  rrc_PERDec_RadioBearerSetupFailure (int UE_Id, RadioBearerSetupFailure * pvalue)
-{
-  int status = P_SUCCESS;
-
-  /* decode rrc_TransactionIdentifier */
-  if (pvalue->rrc_TransactionIdentifier != protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id)
-    return P_INVVALUE;
-
-  //     {
-  //       msg("\n[RRC_MSG] Transaction Id : --%d--, Received : --%d--, status %d\n",
-
-  //                 protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id,
-  //                 pvalue->rrc_TransactionIdentifier,status);
-  //       return P_INVVALUE; // ignore message
-  //     }
-
-  /* decode failureCause */
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC_MSG] RB Setup Failure cause: type %d, protocol error %d\n", pvalue->failureCause.type, pvalue->failureCause.protocolError);
-#endif
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  RadioBearerReleaseComplete                                */
-/**************************************************************/
-#ifdef NODE_MT
-int rrc_PEREnc_RadioBearerReleaseComplete (RadioBearerReleaseComplete * pvalue)
-{
-  int status = P_SUCCESS;
-
-  /* encode rrc_TransactionIdentifier */
-  pvalue->rrc_TransactionIdentifier = protocol_ms->rrc.accepted_trans[0].transaction_Id;
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_RG
-int rrc_PERDec_RadioBearerReleaseComplete (int UE_Id, RadioBearerReleaseComplete * pvalue)
-{
-  int status = P_SUCCESS;
-
-  /* decode rrc_TransactionIdentifier */
-  if (pvalue->rrc_TransactionIdentifier != protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id)
-    return P_INVVALUE;
-
-  //     {
-  //       msg("\n[RRC_MSG] Transaction Id : --%d--, Received : --%d--, status %d\n",
-  //                 protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id,
-
-  //                 pvalue->rrc_TransactionIdentifier,status);
-  //       return P_INVVALUE; // ignore message
-  //     }
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  RadioBearerReleaseFailure                                 */
-/**************************************************************/
-#ifdef NODE_MT
-int rrc_PEREnc_RadioBearerReleaseFailure (RadioBearerReleaseFailure * pvalue)
-{
-  int status = P_SUCCESS;
-
-  /* encode rrc_TransactionIdentifier */
-  pvalue->rrc_TransactionIdentifier = protocol_ms->rrc.accepted_trans[0].transaction_Id;
-
-  /* encode failureCause */// Temp hard coded
-  pvalue->failureCause.type = FCWPE_protocolError;
-  pvalue->failureCause.protocolError = ie_ValueNotComprehended;
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_RG
-int rrc_PERDec_RadioBearerReleaseFailure (int UE_Id, RadioBearerReleaseFailure * pvalue)
-{
-  int status = P_SUCCESS;
-
-  /* decode rrc_TransactionIdentifier */
-  if (pvalue->rrc_TransactionIdentifier != protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id)
-    return P_INVVALUE;
-
-  //     {
-  //       msg("\n[RRC_MSG] Transaction Id : --%d--, Received : --%d--, status %d\n",
-  //                 protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id,
-  //                 pvalue->rrc_TransactionIdentifier,status);
-  //       return P_INVVALUE; // ignore message
-  //     }
-
-  /* decode failureCause */
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC_MSG] RB Setup Failure cause: type %d, protocol error %d\n", pvalue->failureCause.type, pvalue->failureCause.protocolError);
-#endif
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  CellUpdate                                                */
-/**************************************************************/
-#ifdef NODE_MT
-int rrc_PEREnc_CellUpdate (CellUpdate * pvalue)
-{
-  int status = P_SUCCESS;
-
-
-  /* encode u_RNTI */
-  pvalue->u_RNTI = protocol_ms->rrc.u_rnti;
-
-  /* encode am_RLC_ErrorIndicationRb2_3or4 */
-  pvalue->am_RLC_ErrorIndicationRb2_3or4 = protocol_ms->rrc.am_RLC_ErrorIndicationRb2_3or4;
-  /* encode am_RLC_ErrorIndicationRb5orAbove */
-  pvalue->am_RLC_ErrorIndicationRb5orAbove = protocol_ms->rrc.am_RLC_ErrorIndicationRb5orAbove;
-  /* encode cellUpdateCause */
-  pvalue->cellUpdateCause = protocol_ms->rrc.cellUpdateCause;
-  /* encode failureCause */
-  // FFS - In case of invalid message  received
-  //pvalue->failureCause = protocol_ms->rrc.establishment_cause;
-
-
-  /* encode measuredResultsOnRACH */
-  // status = rrc_PEREnc_MeasuredResultsOnRACH (pvalue->measuredResultsOnRACH);
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_RG
-int rrc_PERDec_CellUpdate (int *pUE_Id, CellUpdate * pvalue)
-{
-  int status = P_SUCCESS;
-  int i, UE_Id;
-
-  /* decode u_RNTI and get UE_Id */
-  i = 0;
-
-  while ((i < maxUsers) && (pvalue->u_RNTI != protocol_bs->rrc.Mobile_List[i].mt_id))
-    i++;
-
-  if (i >= maxUsers) {
-    *pUE_Id = 999;
-    return P_OUTOFBOUNDS;
-  } else {
-    *pUE_Id = i;
-    UE_Id = *pUE_Id;
-  }
-
-  /* decode am_RLC_ErrorIndicationRb2_3or4 */
-  protocol_bs->rrc.Mobile_List[UE_Id].am_RLC_ErrorIndicationRb2_3or4 = pvalue->am_RLC_ErrorIndicationRb2_3or4;
-  /* decode am_RLC_ErrorIndicationRb5orAbove */
-  protocol_bs->rrc.Mobile_List[UE_Id].am_RLC_ErrorIndicationRb5orAbove = pvalue->am_RLC_ErrorIndicationRb5orAbove;
-
-  /* decode cellUpdateCause */
-  protocol_bs->rrc.Mobile_List[UE_Id].cellUpdateCause = pvalue->cellUpdateCause;
-  /* decode failureCause */
-  // FFS - In case of invalid message  received
-  // protocol_bs->rrc.Mobile_List[UE_Id].failureCause = pvalue->failureCause = protocol_ms->rrc.establishment_cause;
-
-  //    #ifdef DEBUG_RRC_STATE
-  //    msg("\n[RRC_RG] Establishment Cause %d \n", pvalue->establishmentCause );
-  //    #endif
-
-  /* decode measuredResultsOnRACH */
-  //  status = rrc_PERDec_MeasuredResultsOnRACH (&pvalue->measuredResultsOnRACH);
-
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  CellUpdateConfirm_CCCH                                    */
-/**************************************************************/
-#ifdef NODE_RG
-int rrc_PEREnc_CellUpdateConfirm_CCCH (int UE_Id, CellUpdateConfirm_CCCH * pvalue)
-{
-  int status = P_SUCCESS;
-
-  char *pwrite;
-  int buff_length;
-
-  /* encode u_RNTI */
-  pvalue->u_RNTI = protocol_bs->rrc.Mobile_List[UE_Id].mt_id;
-
-  /* encode rrc_TransactionIdentifier */
-  pvalue->rrc_TransactionIdentifier = protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id;
-
-  /* encode activationTime */
-  pvalue->activationTime = 0;   //default value : now = absence
-
-  /* encode new_U_RNTI */
-  pvalue->new_U_RNTI = UE_Id;
-
-  /* encode new_c_RNTI -- FFS */
-
-  /* encode rrc_stateIndicator */
-  pvalue->rrc_StateIndicator = cell_DCH;        // Temp hard coded
-
-  /* encode rlc_Re_establishIndicatorRb2_3or4 */
-  pvalue->rlc_Re_establishIndicatorRb2_3or4 = protocol_bs->rrc.Mobile_List[UE_Id].am_RLC_ErrorIndicationRb2_3or4;
-  /* encode rlc_Re_establishIndicatorRb5orAbove */
-  pvalue->rlc_Re_establishIndicatorRb5orAbove = protocol_bs->rrc.Mobile_List[UE_Id].am_RLC_ErrorIndicationRb5orAbove;
-
-  // TODO: Remplacer buffers par config
-  /* encode ue_Configuration */
-  //   rrc_compress_buffer(new_conf,90, new_conf, &buff_length);
-  //  pwrite = (char *) &(pvalue->ue_Configuration.numoctets);
-  //  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length = pwrite - (char *) pvalue + MSG_HEAD_LGTH;
-  //
-  //  *(u16 *) pwrite = buff_length;
-  //  pwrite += 2;
-  //  memcpy (pwrite, new_conf, buff_length);
-
-  pwrite = (char *) &(pvalue->ue_Configuration.numoctets);
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC_MSG] Starting the compression of the configuration.- RB Release\n");
-#endif
-  rrc_compress_config ((MT_CONFIG *) &(rrm_config->mt_config[UE_Id]), &pwrite[2], &buff_length);
-
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length = pwrite - (char *) pvalue + MSG_HEAD_LGTH;
-
-  *(u16 *) pwrite = buff_length;
-  pwrite += 2;
-
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC_MSG] Buffer length - 1 : %d\n", protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-#endif
-
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length += buff_length + 2;
-
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC_MSG] Buffer length - 2 : %d\n", protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-#endif
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int rrc_PERDec_CellUpdateConfirm_CCCH (CellUpdateConfirm_CCCH * pvalue)
-{
-  int status = P_SUCCESS;
-  int buff_length;
-  char *buff_ptr;
-
-  /* decode and check u-RNTI */
-  if (pvalue->u_RNTI != protocol_ms->rrc.u_rnti) {
-    msg ("\n[RRC_MSG] u-RNTI : --%d--, Received : --%d--, status: Invalid u-rnti \n", protocol_ms->rrc.u_rnti, pvalue->u_RNTI);
-    return P_INVVALUE;          // ignore message
-  }
-
-  /* decode rrc_TransactionIdentifier */
-  protocol_ms->rrc.rcved_trans.msg_type = DL_CCCH_cellUpdateConfirm;
-  protocol_ms->rrc.rcved_trans.transaction_Id = pvalue->rrc_TransactionIdentifier;
-
-  /* decode activationTime */
-  protocol_ms->rrc.nextActivationTime = pvalue->activationTime;
-
-  /* decode new_U_RNTI */
-  protocol_ms->rrc.u_rnti = pvalue->new_U_RNTI;
-  /* decode new_c_RNTI -- FFS */
-  protocol_ms->rrc.c_rnti = pvalue->new_U_RNTI;
-
-  /* decode rrc_stateIndicator */
-  switch (pvalue->rrc_StateIndicator) {
-  case cell_DCH:
-    protocol_ms->rrc.next_state = CELL_DCH;
-    break;
-
-  case cell_FACH:
-
-    protocol_ms->rrc.next_state = CELL_FACH;
-    break;
-
-  case cell_PCH:
-    protocol_ms->rrc.next_state = CELL_PCH;
-    break;
-
-  default:                 //ura_PCH not supported
-    return P_INVVALUE;
-  }
-
-  /* decode rlc_Re_establishIndicatorRb2_3or4 */
-  protocol_ms->rrc.rlc_Re_establishIndicatorRb2_3or4 = pvalue->rlc_Re_establishIndicatorRb2_3or4;
-  /* decode rlc_Re_establishIndicatorRb5orAbove */
-  protocol_ms->rrc.rlc_Re_establishIndicatorRb5orAbove = pvalue->rlc_Re_establishIndicatorRb5orAbove;
-
-  //  /* decode ue_Configuration */
-  //  buff_ptr = (char *) (&(pvalue->ue_Configuration.numoctets));
-  //
-  //  buff_ptr += 2;
-  //  //   rrc_uncompress_buffer(buff_ptr,(u16)pvalue->ue_Configuration.numoctets, buff_ptr, &buff_length);
-  //#ifdef DEBUG_RRC_STATE
-  //  msg ("\n[RRC_MSG] New Configuration : \n");
-  //  rrc_print_buffer (buff_ptr, buff_length);
-  //#endif
-
-  /* decode ue_Configuration */
-  //
-  buff_length = (u16) pvalue->ue_Configuration.numoctets;
-  buff_ptr = (char *) (&(pvalue->ue_Configuration.numoctets));
-  buff_ptr += 2;
-  //#ifdef DEBUG_RRC_STATE
-  //   msg("\n[RRC_MSG] New Configuration , length %d : \n", buff_length);
-  //   rrc_print_buffer(buff_ptr, buff_length);
-  //#endif
-
-  rrc_uncompress_config ((MT_CONFIG *) &(rrm_config->mt_config), buff_ptr);
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC_MSG] Length of New Configuration : %d \n", buff_length);
-#endif
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  PagingType2                                               */
-/**************************************************************/
-#ifdef NODE_RG
-int rrc_PEREnc_PagingType2 (int UE_Id, PagingType2 * pvalue)
-{
-  int status = P_SUCCESS;
-  char *pwrite;
-  int i;
-  int data_length;
-
-  /* encode rrc_TransactionIdentifier */
-  pvalue->rrc_TransactionIdentifier = protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id;
-
-  /* encode IMEI */
-  pvalue->imei.numDigits = 14;  // limited version of IMEI is used
-
-  for (i = 0; i < pvalue->imei.numDigits; i++)
-    pvalue->imei.digit[i] = protocol_bs->rrc.Mobile_List[UE_Id].IMEI[i];
-
-  /* encode paging_Message */
-  pwrite = (char *) &(pvalue->paging_Message.numoctets);
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length = pwrite - (char *) pvalue + MSG_HEAD_LGTH;
-  //data_length = strlen(paging_data);
-  data_length = protocol_bs->rrc.Mobile_List[UE_Id].paging_message_lgth;
-  *(u16 *) pwrite = data_length;
-  pwrite += 2;
-  //memcpy(pwrite,paging_data, data_length);
-  memcpy (pwrite, (protocol_bs->rrc.Mobile_List[UE_Id].paging_message_ptr)->data, data_length);
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC_MSG] Buffer length - 1 : %d\n", protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-#endif
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length += (data_length + 2);
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int rrc_PERDec_PagingType2 (PagingType2 * pvalue)
-{
-  int status = P_SUCCESS;
-  char *buff_ptr;
-
-  /* decode rrc_TransactionIdentifier */
-  protocol_ms->rrc.rcved_trans.msg_type = DL_DCCH_pagingType2;
-  protocol_ms->rrc.rcved_trans.transaction_Id = pvalue->rrc_TransactionIdentifier;
-
-
-  /* decode IMEI */
-  if (pvalue->imei.numDigits > 15)
-    return P_OUTOFBOUNDS;
-
-  //   if (status = (strncmp((char *)protocol_ms->rrc.IMEI, (char *)pvalue->imei.digit,14)))
-  status = memcmp ((char *) protocol_ms->rrc.IMEI, (char *) pvalue->imei.digit, 14);
-
-  if (status) {
-    msg ("\n[RRC_MSG] IMEI : --%s--, Received : --%s--, status %d\n", (char *) protocol_ms->rrc.IMEI, (char *) pvalue->imei.digit, status);
-    return P_INVVALUE;          // ignore message
-  }
-
-  // TODO: Remplacer buffers par paging_Message + verifier qu'ils sont vides
-  /* decode paging_Message */
-  buff_ptr = (char *) (&(pvalue->paging_Message.numoctets));
-  buff_ptr += 2;
-  protocol_ms->rrc.paging_message_ptr = buff_ptr;
-  protocol_ms->rrc.paging_message_lgth = (u16) pvalue->paging_Message.numoctets;
-#ifdef DEBUG_RRC_STATE
-
-  msg ("\n[RRC_MSG] New Paging Type 2 : \n");
-  rrc_print_buffer (protocol_ms->rrc.paging_message_ptr, protocol_ms->rrc.paging_message_lgth);
-  msg ("\n[RRC_MSG] Data content --%s-- \n", protocol_ms->rrc.paging_message_ptr);
-#endif
-
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  MeasurementControl                                        */
-/**************************************************************/
-#ifdef NODE_RG
-int rrc_PEREnc_MeasurementControl (int UE_Id, MeasurementControl * pvalue)
-{
-  int status = P_SUCCESS;
-  MeasurementType *pCommand = NULL;
-  char *pwrite;
-  int i;
-
-  /* encode rrc_TransactionIdentifier */
-  pvalue->rrc_TransactionIdentifier = protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id;
-
-  /* encode  measurementIdentity */
-  pvalue->measurementIdentity = protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.identity;
-
-  /* encode  measurementCommand */
-  pvalue->measurementCommand.cmdType = protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.command;
-
-  switch (pvalue->measurementCommand.cmdType) {
-  case MC_setup:
-    pCommand = &(pvalue->measurementCommand.command.setup);
-    break;
-
-  case MC_modify:
-    pCommand = &(pvalue->measurementCommand.command.modify);
-    break;
-
-  default:
-    // MC_delete : nothing to encode
-    pCommand = NULL;
-  }
-
-  if (pCommand != NULL) {
-    pCommand->measType = protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.type;
-
-    switch (pCommand->measType) {
-    case MT_intraFrequencyMeasurement:
-      pCommand->type.intraFrequencyMeasurement.intraFreqMeasQuantity.filterCoefficient = protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.if_coeff;
-      pCommand->type.intraFrequencyMeasurement.intraFreqReportingQuantity.cellIdentity_reportingIndicator = protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.if_cellIdentity_ri;
-      pCommand->type.intraFrequencyMeasurement.intraFreqReportingQuantity.timeslotISCP_reportingIndicator = protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.if_timeslotISCP_ri;
-      pCommand->type.intraFrequencyMeasurement.intraFreqReportingQuantity.primaryCCPCH_RSCP_reportingIndicator = protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.if_BCH_RSCP_ri;
-      pCommand->type.intraFrequencyMeasurement.intraFreqReportingQuantity.pathloss_reportingIndicator = protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.if_pathloss_ri;
-      pCommand->type.intraFrequencyMeasurement.measurementValidity = protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.if_validity;
-      pCommand->type.intraFrequencyMeasurement.reportCriteria.criteriaType =        // must be periodical
-        protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.criteria_type;
-      pCommand->type.intraFrequencyMeasurement.reportCriteria.criteriaDef.periodicalReportingCriteria.reportingAmount = protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.rep_amount;
-      pCommand->type.intraFrequencyMeasurement.reportCriteria.criteriaDef.periodicalReportingCriteria.reportingInterval = protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.rep_interval;
-      break;
-
-    case MT_trafficVolumeMeasurement:
-      pCommand->type.trafficVolumeMeasurement.trafficVolumeReportingQuantity.rlc_RB_BufferPayload = protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.tv_payload_ri;
-      pCommand->type.trafficVolumeMeasurement.trafficVolumeReportingQuantity.rlc_RB_BufferPayloadAverage = protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.tv_average_ri;
-      pCommand->type.trafficVolumeMeasurement.trafficVolumeReportingQuantity.rlc_RB_BufferPayloadVariance = protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.tv_variance_ri;
-      pCommand->type.trafficVolumeMeasurement.measurementValidity = protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.tv_validity;
-      pCommand->type.trafficVolumeMeasurement.reportCriteria.criteriaType = // must be periodical
-        protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.criteria_type;
-      pCommand->type.trafficVolumeMeasurement.reportCriteria.criteriaDef.periodicalReportingCriteria.reportingAmount = protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.rep_amount;
-      pCommand->type.trafficVolumeMeasurement.reportCriteria.criteriaDef.periodicalReportingCriteria.reportingInterval = protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.rep_interval;
-      break;
-
-    case MT_qualityMeasurement:
-      pCommand->type.qualityMeasurement.qualityReportingQuantity.dl_TransChBLER = protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.q_dl_trch_bler_ri;
-
-      for (i = 0; i < MAXMEASTFCS; i++)
-        pCommand->type.qualityMeasurement.qualityReportingQuantity.sir_TFCS_List.tfcs[i] = protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.q_sir_TFCSid[i];
-
-      pCommand->type.qualityMeasurement.reportCriteria.criteriaType =       // must be periodical
-        protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.criteria_type;
-      pCommand->type.qualityMeasurement.reportCriteria.criteriaDef.periodicalReportingCriteria.reportingAmount = protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.rep_amount;
-      pCommand->type.qualityMeasurement.reportCriteria.criteriaDef.periodicalReportingCriteria.reportingInterval = protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.rep_interval;
-      break;
-
-    case MT_ue_InternalMeasurement:
-      pCommand->type.ue_InternalMeasurement.ue_InternalMeasQuantity.measurementQuantity = protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.int_quantity;
-      pCommand->type.ue_InternalMeasurement.ue_InternalMeasQuantity.filterCoefficient = protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.int_coeff;
-      pCommand->type.ue_InternalMeasurement.ue_InternalReportingQuantity.ue_TransmittedPower = protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.int_rep_ue_TransmittedPower;
-      pCommand->type.ue_InternalMeasurement.ue_InternalReportingQuantity.appliedTA = protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.int_rep_appliedTA;
-      pCommand->type.ue_InternalMeasurement.reportCriteria.criteriaType = protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.criteria_type;
-      pCommand->type.ue_InternalMeasurement.reportCriteria.criteriaDef.periodicalReportingCriteria.reportingAmount = protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.rep_amount;
-      pCommand->type.ue_InternalMeasurement.reportCriteria.criteriaDef.periodicalReportingCriteria.reportingInterval = protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.rep_interval;
-      break;
-
-    default:
-      msg ("\n[RRC_MSG] invalid Measure Command Type selected\n");
-    }
-  }                             //endif
-
-
-  /* encode measurementReportingMode */
-  pvalue->measurementReportingMode.measurementReportTransferMode = protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.xfer_mode;
-  pvalue->measurementReportingMode.periodicalOrEventTrigger = protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.trigger;
-
-  /* determine the exact length of the message (compiler error) */
-  pwrite = (char *) &(pvalue->measurementReportingMode.periodicalOrEventTrigger);
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length = pwrite - (char *) pvalue + MSG_HEAD_LGTH + 4;
-  msg ("\n[RRC_MSG] Measurement Control message length %d\n", protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int rrc_PERDec_MeasurementControl (MeasurementControl * pvalue)
-{
-  int status = P_SUCCESS;
-  int m_id, i;
-  MeasurementType *pCommand = NULL;
-
-  /* decode rrc_TransactionIdentifier */
-  protocol_ms->rrc.rcved_trans.msg_type = DL_DCCH_measurementControl;
-  protocol_ms->rrc.rcved_trans.transaction_Id = pvalue->rrc_TransactionIdentifier;
-
-  /* decode  measurementIdentity */
-  m_id = pvalue->measurementIdentity;
-  protocol_ms->rrc.ue_meas_cmd[m_id].identity = pvalue->measurementIdentity;
-  protocol_ms->rrc.rrc_ue_meas_to_activate = m_id;
-  /* decode  measurementCommand */
-  protocol_ms->rrc.ue_meas_cmd[m_id].command = pvalue->measurementCommand.cmdType;
-
-  switch (pvalue->measurementCommand.cmdType) {
-  case MC_setup:
-    pCommand = &(pvalue->measurementCommand.command.setup);
-    break;
-
-  case MC_modify:
-    pCommand = &(pvalue->measurementCommand.command.modify);
-    break;
-
-  default:
-    // MC_release : nothing to encode
-    pCommand = NULL;
-  }
-
-  if (pCommand != NULL) {
-    protocol_ms->rrc.ue_meas_cmd[m_id].type = pCommand->measType;
-
-    switch (pCommand->measType) {
-    case MT_intraFrequencyMeasurement:
-      protocol_ms->rrc.ue_meas_cmd[m_id].if_coeff = pCommand->type.intraFrequencyMeasurement.intraFreqMeasQuantity.filterCoefficient;
-      protocol_ms->rrc.ue_meas_cmd[m_id].if_cellIdentity_ri = pCommand->type.intraFrequencyMeasurement.intraFreqReportingQuantity.cellIdentity_reportingIndicator;
-      protocol_ms->rrc.ue_meas_cmd[m_id].if_timeslotISCP_ri = pCommand->type.intraFrequencyMeasurement.intraFreqReportingQuantity.timeslotISCP_reportingIndicator;
-      protocol_ms->rrc.ue_meas_cmd[m_id].if_BCH_RSCP_ri = pCommand->type.intraFrequencyMeasurement.intraFreqReportingQuantity.primaryCCPCH_RSCP_reportingIndicator;
-      protocol_ms->rrc.ue_meas_cmd[m_id].if_pathloss_ri = pCommand->type.intraFrequencyMeasurement.intraFreqReportingQuantity.pathloss_reportingIndicator;
-      protocol_ms->rrc.ue_meas_cmd[m_id].if_validity = pCommand->type.intraFrequencyMeasurement.measurementValidity;
-      protocol_ms->rrc.ue_meas_cmd[m_id].criteria_type = pCommand->type.intraFrequencyMeasurement.reportCriteria.criteriaType;      // must be periodical
-      protocol_ms->rrc.ue_meas_cmd[m_id].rep_amount = pCommand->type.intraFrequencyMeasurement.reportCriteria.criteriaDef.periodicalReportingCriteria.reportingAmount;
-      protocol_ms->rrc.ue_meas_cmd[m_id].rep_interval = pCommand->type.intraFrequencyMeasurement.reportCriteria.criteriaDef.periodicalReportingCriteria.reportingInterval;
-      break;
-
-    case MT_trafficVolumeMeasurement:
-      protocol_ms->rrc.ue_meas_cmd[m_id].tv_payload_ri = pCommand->type.trafficVolumeMeasurement.trafficVolumeReportingQuantity.rlc_RB_BufferPayload;
-      protocol_ms->rrc.ue_meas_cmd[m_id].tv_average_ri = pCommand->type.trafficVolumeMeasurement.trafficVolumeReportingQuantity.rlc_RB_BufferPayloadAverage;
-      protocol_ms->rrc.ue_meas_cmd[m_id].tv_variance_ri = pCommand->type.trafficVolumeMeasurement.trafficVolumeReportingQuantity.rlc_RB_BufferPayloadVariance;
-      protocol_ms->rrc.ue_meas_cmd[m_id].tv_validity = pCommand->type.trafficVolumeMeasurement.measurementValidity;
-      protocol_ms->rrc.ue_meas_cmd[m_id].criteria_type = pCommand->type.trafficVolumeMeasurement.reportCriteria.criteriaType;       // must be periodical
-      protocol_ms->rrc.ue_meas_cmd[m_id].rep_amount = pCommand->type.trafficVolumeMeasurement.reportCriteria.criteriaDef.periodicalReportingCriteria.reportingAmount;
-      protocol_ms->rrc.ue_meas_cmd[m_id].rep_interval = pCommand->type.trafficVolumeMeasurement.reportCriteria.criteriaDef.periodicalReportingCriteria.reportingInterval;
-      break;
-
-    case MT_qualityMeasurement:
-      protocol_ms->rrc.ue_meas_cmd[m_id].q_dl_trch_bler_ri = pCommand->type.qualityMeasurement.qualityReportingQuantity.dl_TransChBLER;
-
-      for (i = 0; i < MAXMEASTFCS; i++)
-        protocol_ms->rrc.ue_meas_cmd[m_id].q_sir_TFCSid[i] = pCommand->type.qualityMeasurement.qualityReportingQuantity.sir_TFCS_List.tfcs[i];
-
-      protocol_ms->rrc.ue_meas_cmd[m_id].criteria_type = pCommand->type.qualityMeasurement.reportCriteria.criteriaType;     // must be periodical
-      protocol_ms->rrc.ue_meas_cmd[m_id].rep_amount = pCommand->type.qualityMeasurement.reportCriteria.criteriaDef.periodicalReportingCriteria.reportingAmount;
-      protocol_ms->rrc.ue_meas_cmd[m_id].rep_interval = pCommand->type.qualityMeasurement.reportCriteria.criteriaDef.periodicalReportingCriteria.reportingInterval;
-      break;
-
-    case MT_ue_InternalMeasurement:
-      protocol_ms->rrc.ue_meas_cmd[m_id].int_quantity = pCommand->type.ue_InternalMeasurement.ue_InternalMeasQuantity.measurementQuantity;
-      protocol_ms->rrc.ue_meas_cmd[m_id].int_coeff = pCommand->type.ue_InternalMeasurement.ue_InternalMeasQuantity.filterCoefficient;
-      protocol_ms->rrc.ue_meas_cmd[m_id].int_rep_ue_TransmittedPower = pCommand->type.ue_InternalMeasurement.ue_InternalReportingQuantity.ue_TransmittedPower;
-      protocol_ms->rrc.ue_meas_cmd[m_id].int_rep_appliedTA = pCommand->type.ue_InternalMeasurement.ue_InternalReportingQuantity.appliedTA;
-      protocol_ms->rrc.ue_meas_cmd[m_id].criteria_type = pCommand->type.ue_InternalMeasurement.reportCriteria.criteriaType;
-      protocol_ms->rrc.ue_meas_cmd[m_id].rep_amount = pCommand->type.ue_InternalMeasurement.reportCriteria.criteriaDef.periodicalReportingCriteria.reportingAmount;
-      protocol_ms->rrc.ue_meas_cmd[m_id].rep_interval = pCommand->type.ue_InternalMeasurement.reportCriteria.criteriaDef.periodicalReportingCriteria.reportingInterval;
-      break;
-
-    default:
-      msg ("\n[RRC_MSG] invalid Measure Command Type selected : %d\n", pCommand->measType);
-    }
-  }                             //endif
-
-  /* decode measurementReportingMode */
-  protocol_ms->rrc.ue_meas_cmd[m_id].xfer_mode = pvalue->measurementReportingMode.measurementReportTransferMode;
-  protocol_ms->rrc.ue_meas_cmd[m_id].trigger = pvalue->measurementReportingMode.periodicalOrEventTrigger;
-
-  return status;
-}
-#endif
-
-/**************************************************************/
-/*  MeasurementReport                                         */
-/**************************************************************/
-#ifdef NODE_MT
-int rrc_PEREnc_MeasurementReport (MeasurementReport * pvalue)
-{
-  int status = P_SUCCESS;
-  int i, j, nCells = 0;
-  int m_id;
-
-  /* encode measurementIdentity */
-  m_id = protocol_ms->rrc.rrc_ue_last_measurement;
-  pvalue->measurementIdentity = protocol_ms->rrc.ue_meas_rep[m_id].identity;
-
-  /* encode measuredResults */
-  pvalue->measuredResults.measResult = protocol_ms->rrc.ue_meas_rep[m_id].meas_results_type;
-
-  switch (pvalue->measuredResults.measResult) {
-  case MR_intraFreqMeasuredResultsList:
-    pvalue->measuredResults.result.intraFreqMeasuredResultsList.numCells = protocol_ms->rrc.ue_meas_rep[m_id].if_num_cells;
-    nCells = protocol_ms->rrc.ue_meas_rep[m_id].if_num_cells;
-
-    for (i = 0; i < nCells; i++) {
-      pvalue->measuredResults.result.intraFreqMeasuredResultsList.cellMeas[i].cellIdentity = protocol_ms->rrc.ue_meas_rep[m_id].if_cell_id[i];
-      pvalue->measuredResults.result.intraFreqMeasuredResultsList.cellMeas[i].modeSpecificInfo.cellParametersID = protocol_ms->rrc.ue_meas_rep[m_id].if_cell_parms_id[i];
-      pvalue->measuredResults.result.intraFreqMeasuredResultsList.cellMeas[i].modeSpecificInfo.primaryCCPCH_RSCP = protocol_ms->rrc.ue_meas_rep[m_id].if_BCH_RSCP[i];
-      pvalue->measuredResults.result.intraFreqMeasuredResultsList.cellMeas[i].modeSpecificInfo.pathloss = protocol_ms->rrc.ue_meas_rep[m_id].if_pathloss[i];
-      pvalue->measuredResults.result.intraFreqMeasuredResultsList.cellMeas[i].modeSpecificInfo.timeslotISCP_List.numSlots = 14;
-
-      for (j = 0; j < 14; j++) {
-        pvalue->measuredResults.result.intraFreqMeasuredResultsList.cellMeas[i].modeSpecificInfo.timeslotISCP_List.iscp[j] = protocol_ms->rrc.ue_meas_rep[m_id].if_slot_iscp[i][j];
-      }
-    }
-
-    break;
-
-  case MR_trafficVolumeMeasuredResultsList:
-    pvalue->measuredResults.result.trafficVolumeMeasuredResultsList.numRB = protocol_ms->rrc.ue_meas_rep[m_id].tv_num_rbs;
-
-    for (i = 0; i < protocol_ms->rrc.ue_meas_rep[m_id].tv_num_rbs; i++) {
-      pvalue->measuredResults.result.trafficVolumeMeasuredResultsList.RBMeas[i].rb_Identity = protocol_ms->rrc.ue_meas_rep[m_id].tv_rbid[i];
-      pvalue->measuredResults.result.trafficVolumeMeasuredResultsList.RBMeas[i].rlc_BuffersPayload = protocol_ms->rrc.ue_meas_rep[m_id].tv_rb_payload[i];
-      pvalue->measuredResults.result.trafficVolumeMeasuredResultsList.RBMeas[i].averageRLC_BufferPayload = protocol_ms->rrc.ue_meas_rep[m_id].tv_rb_average[i];
-      pvalue->measuredResults.result.trafficVolumeMeasuredResultsList.RBMeas[i].varianceOfRLC_BufferPayload = protocol_ms->rrc.ue_meas_rep[m_id].tv_rb_variance[i];
-    }
-
-    break;
-
-  case MR_qualityMeasuredResults:
-    pvalue->measuredResults.result.qualityMeasuredResults.blerMeasurementResultsList.numTrCH = protocol_ms->rrc.ue_meas_rep[m_id].q_num_TrCH;
-
-    for (i = 0; i < protocol_ms->rrc.ue_meas_rep[m_id].q_num_TrCH; i++) {
-      pvalue->measuredResults.result.qualityMeasuredResults.blerMeasurementResultsList.measTrCH[i].transportChannelIdentity = protocol_ms->rrc.ue_meas_rep[m_id].q_dl_TrCH_id[i];
-      pvalue->measuredResults.result.qualityMeasuredResults.blerMeasurementResultsList.measTrCH[i].dl_TransportChannelBLER = protocol_ms->rrc.ue_meas_rep[m_id].q_dl_TrCH_BLER[i];
-    }
-
-    pvalue->measuredResults.result.qualityMeasuredResults.sir_MeasurementList.numTFCS = protocol_ms->rrc.ue_meas_rep[m_id].q_num_tfcs;
-
-    for (i = 0; i < protocol_ms->rrc.ue_meas_rep[m_id].q_num_tfcs; i++) {
-      pvalue->measuredResults.result.qualityMeasuredResults.sir_MeasurementList.sirMeas[i].tfcs_ID = protocol_ms->rrc.ue_meas_rep[m_id].q_tfcs_id[i];
-      pvalue->measuredResults.result.qualityMeasuredResults.sir_MeasurementList.sirMeas[i].sir_TimeslotList.numSIR = 14;
-
-      for (j = 0; j < 14; j++) {
-        pvalue->measuredResults.result.qualityMeasuredResults.sir_MeasurementList.sirMeas[i].sir_TimeslotList.sir[j] = protocol_ms->rrc.ue_meas_rep[m_id].q_sir[i][j];
-      }
-    }
-
-    break;
-
-  case MR_ue_InternalMeasuredResults:
-    pvalue->measuredResults.result.ue_InternalMeasuredResults.ue_TransmittedPowerTDD_List.numSlots = 14;
-
-    for (j = 0; j < 14; j++) {
-      pvalue->measuredResults.result.ue_InternalMeasuredResults.ue_TransmittedPowerTDD_List.xmitPower[j] = protocol_ms->rrc.ue_meas_rep[m_id].int_xmit_power[j];
-    }
-
-    pvalue->measuredResults.result.ue_InternalMeasuredResults.appliedTA = protocol_ms->rrc.ue_meas_rep[m_id].int_timing_advance;
-    break;
-
-  default:
-    msg ("\n[RRC_MSG] invalid Measure Report Type selected %d\n", pvalue->measuredResults.measResult);
-  }
-
-
-  return status;
-}
-
-#endif
-
-
-//-----------------------------------------------------------------------------
-#ifdef NODE_RG
-int rrc_PERDec_MeasurementReport (int UE_Id, MeasurementReport * pvalue)
-{
-  int status = P_SUCCESS;
-  int i, j, nCells = 0;
-  int m_id;
-
-  /* decode measurementIdentity */
-  m_id = pvalue->measurementIdentity;
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_rep[m_id].identity = pvalue->measurementIdentity;
-  protocol_bs->rrc.Mobile_List[UE_Id].rrc_rg_last_measurement = m_id;
-
-  /* decode measuredResults */
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_rep[m_id].meas_results_type = pvalue->measuredResults.measResult;
-
-  switch (pvalue->measuredResults.measResult) {
-  case MR_intraFreqMeasuredResultsList:
-    protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_rep[m_id].if_num_cells = pvalue->measuredResults.result.intraFreqMeasuredResultsList.numCells;
-    nCells = pvalue->measuredResults.result.intraFreqMeasuredResultsList.numCells;
-
-    for (i = 0; i < nCells; i++) {
-      protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_rep[m_id].if_cell_id[i] = pvalue->measuredResults.result.intraFreqMeasuredResultsList.cellMeas[i].cellIdentity;
-      protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_rep[m_id].if_cell_parms_id[i] = pvalue->measuredResults.result.intraFreqMeasuredResultsList.cellMeas[i].modeSpecificInfo.cellParametersID;
-      protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_rep[m_id].if_BCH_RSCP[i] = pvalue->measuredResults.result.intraFreqMeasuredResultsList.cellMeas[i].modeSpecificInfo.primaryCCPCH_RSCP;
-      protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_rep[m_id].if_pathloss[i] = pvalue->measuredResults.result.intraFreqMeasuredResultsList.cellMeas[i].modeSpecificInfo.pathloss;
-
-      for (j = 0; j < 14; j++) {
-        protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_rep[m_id].if_slot_iscp[i][j] =
-          pvalue->measuredResults.result.intraFreqMeasuredResultsList.cellMeas[i].modeSpecificInfo.timeslotISCP_List.iscp[j];
-      }
-    }
-
-    break;
-
-  case MR_trafficVolumeMeasuredResultsList:
-    protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_rep[m_id].tv_num_rbs = pvalue->measuredResults.result.trafficVolumeMeasuredResultsList.numRB;
-
-    for (i = 0; i < protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_rep[m_id].tv_num_rbs; i++) {
-      protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_rep[m_id].tv_rbid[i] = pvalue->measuredResults.result.trafficVolumeMeasuredResultsList.RBMeas[i].rb_Identity;
-      protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_rep[m_id].tv_rb_payload[i] = pvalue->measuredResults.result.trafficVolumeMeasuredResultsList.RBMeas[i].rlc_BuffersPayload;
-      protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_rep[m_id].tv_rb_average[i] = pvalue->measuredResults.result.trafficVolumeMeasuredResultsList.RBMeas[i].averageRLC_BufferPayload;
-      protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_rep[m_id].tv_rb_variance[i] = pvalue->measuredResults.result.trafficVolumeMeasuredResultsList.RBMeas[i].varianceOfRLC_BufferPayload;
-    }
-
-    break;
-
-  case MR_qualityMeasuredResults:
-    protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_rep[m_id].q_num_TrCH = pvalue->measuredResults.result.qualityMeasuredResults.blerMeasurementResultsList.numTrCH;
-
-    for (i = 0; i < protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_rep[m_id].q_num_TrCH; i++) {
-      protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_rep[m_id].q_dl_TrCH_id[i] = pvalue->measuredResults.result.qualityMeasuredResults.blerMeasurementResultsList.measTrCH[i].transportChannelIdentity;
-      protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_rep[m_id].q_dl_TrCH_BLER[i] =
-        pvalue->measuredResults.result.qualityMeasuredResults.blerMeasurementResultsList.measTrCH[i].dl_TransportChannelBLER;
-    }
-
-    protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_rep[m_id].q_num_tfcs = pvalue->measuredResults.result.qualityMeasuredResults.sir_MeasurementList.numTFCS;
-
-    for (i = 0; i < protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_rep[m_id].q_num_tfcs; i++) {
-      protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_rep[m_id].q_tfcs_id[i] = pvalue->measuredResults.result.qualityMeasuredResults.sir_MeasurementList.sirMeas[i].tfcs_ID;
-
-      for (j = 0; j < 14; j++) {
-        protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_rep[m_id].q_sir[i][j] = pvalue->measuredResults.result.qualityMeasuredResults.sir_MeasurementList.sirMeas[i].sir_TimeslotList.sir[j];
-      }
-    }
-
-    break;
-
-  case MR_ue_InternalMeasuredResults:
-    for (j = 0; j < 14; j++) {
-      protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_rep[m_id].int_xmit_power[j] = pvalue->measuredResults.result.ue_InternalMeasuredResults.ue_TransmittedPowerTDD_List.xmitPower[j];
-    }
-
-    protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_rep[m_id].int_timing_advance = pvalue->measuredResults.result.ue_InternalMeasuredResults.appliedTA;
-    break;
-
-  default:
-    msg ("\n[RRC_MSG] invalid Measure Report Type selected\n");
-  }
-
-
-  return status;
-}
-#endif
-
-// /**************************************************************/
-// /*  ULPCHControl                                              */
-// /**************************************************************/
-// #ifdef NODE_RG
-// int rrc_PEREnc_ULPCHControl (int UE_Id, ULPCHControl * pvalue){
-//   int status = P_SUCCESS;
-//   pvalue->rrc_TransactionIdentifier = protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id;
-//   pvalue->uplinkPhysicalChannelControl_IE.uplinkPhysicalChannelControl.timingAdvance = 0;
-//   pvalue->uplinkPhysicalChannelControl_IE.uplinkPhysicalChannelControl.alpha = 1;
-//   pvalue->uplinkPhysicalChannelControl_IE.uplinkPhysicalChannelControl.prach_ConstantValue = 6;
-//   pvalue->uplinkPhysicalChannelControl_IE.uplinkPhysicalChannelControl.pusch_ConstantValue = 0;
-//   pvalue->uplinkPhysicalChannelControl_IE.ccTrCH_PowerControlInfo.ul_DPCH_PowerControlInfo.ul_TargetSIR = 10;
-//
-//   ////#ifdef DEBUG_RRC_STATE
-//   msg ("\n\n\n\n\n\n\n\n\n\n[RRC_MSG] Creating ULPCH Outer-Loop Power Control Information  frame = %d\n", frame);
-//   msg ("[RRC_MSG] timingAdvance=%d,alpha=%d,prach_Cnst=%d,pusch_cnst=%d\n",
-//        pvalue->uplinkPhysicalChannelControl_IE.uplinkPhysicalChannelControl.timingAdvance,
-//        pvalue->uplinkPhysicalChannelControl_IE.uplinkPhysicalChannelControl.alpha,
-//        pvalue->uplinkPhysicalChannelControl_IE.uplinkPhysicalChannelControl.prach_ConstantValue, pvalue->uplinkPhysicalChannelControl_IE.uplinkPhysicalChannelControl.pusch_ConstantValue);
-//   msg ("[RRC_MSG] CCTrCH Power Control Info\n");
-//   msg ("[RRC_MSG] TFCS Identity (CCTrCH index) = %d, Target SIR = %d\n",
-//        pvalue->uplinkPhysicalChannelControl_IE.ccTrCH_PowerControlInfo.tfcs_Identity, pvalue->uplinkPhysicalChannelControl_IE.ccTrCH_PowerControlInfo.ul_DPCH_PowerControlInfo.ul_TargetSIR);
-//   // #endif DEBUG_RRC_STATE
-//
-//   return status;
-// }
-// #endif
-// //-----------------------------------------------------------------------------
-// #ifdef NODE_MT
-// int rrc_PERDec_ULPCHControl (ULPCHControl * pvalue){
-//   int status = P_SUCCESS;
-//
-// #ifdef DEBUG_RRC_STATE
-//   msg ("[RRC_MSG] Received ULPCH Outer-Loop Power Control Information\n");
-//   msg ("[RRC_MSG] timingAdvance=%d,alpha=%d,prach_Cnst=%d,pusch_cnst=%d    dpch_ConstantValue =%d \n",
-//        pvalue->uplinkPhysicalChannelControl_IE.uplinkPhysicalChannelControl.timingAdvance,
-//        pvalue->uplinkPhysicalChannelControl_IE.uplinkPhysicalChannelControl.alpha,
-//        pvalue->uplinkPhysicalChannelControl_IE.uplinkPhysicalChannelControl.prach_ConstantValue,
-//        pvalue->uplinkPhysicalChannelControl_IE.uplinkPhysicalChannelControl.pusch_ConstantValue, pvalue->uplinkPhysicalChannelControl_IE.uplinkPhysicalChannelControl.dpch_ConstantValue);
-//   msg ("[RRC_MSG] CCTrCH Power Control Info\n");
-//   msg ("[RRC_MSG] TFCS Identity (CCTrCH index) = %d, Target SIR = %d\n",
-//        pvalue->uplinkPhysicalChannelControl_IE.ccTrCH_PowerControlInfo.tfcs_Identity, pvalue->uplinkPhysicalChannelControl_IE.ccTrCH_PowerControlInfo.ul_DPCH_PowerControlInfo.ul_TargetSIR);
-// #endif
-//   /* DEBUG_RRC_STATE */
-//   // rrm_config->outer_loop_vars.= pvalue->uplinkPhysicalChannelControl_IE.uplinkPhysicalChannelControl.timingAdvance;
-//
-//   rrm_config->outer_loop_vars.alpha = pvalue->uplinkPhysicalChannelControl_IE.uplinkPhysicalChannelControl.alpha;
-//   rrm_config->outer_loop_vars.PRACH_CNST = pvalue->uplinkPhysicalChannelControl_IE.uplinkPhysicalChannelControl.prach_ConstantValue;
-//
-//   rrm_config->outer_loop_vars.DPCH_CNST = pvalue->uplinkPhysicalChannelControl_IE.uplinkPhysicalChannelControl.dpch_ConstantValue;
-//   rrm_config->outer_loop_vars.SIR_Target[0] = pvalue->uplinkPhysicalChannelControl_IE.ccTrCH_PowerControlInfo.ul_DPCH_PowerControlInfo.ul_TargetSIR;
-//   rrc_ue_tick = 0;
-//   rrm_config->power_control_ul_received = 1;
-//   // Write to RRM Power Control Structures
-//   return status;
-// }
-// #endif
-
-/**************************************************************/
-/* UECapabilityInformation                                    */
-/**************************************************************/
-#ifdef NODE_MT
-int rrc_PEREnc_UECapabilityInformation (UECapabilityInformation* pvalue)
-{
-  int status = P_SUCCESS;
-  /* encode rrc_TransactionIdentifier */
-  pvalue->rrc_TransactionIdentifier = protocol_ms->rrc.accepted_trans[0].transaction_Id;
-
-  /* encode Access Stratum Release Indicator */
-  pvalue->accessStratumReleaseIndicator = ACCESS_STRATUM_RELEASE_INDICATOR_DEFAULT;
-
-  /* encode Eurecom Kernel Release Indicator */
-  pvalue->eurecomKernelReleaseIndicator = EURECOM_KERNEL_RELEASE_INDICATOR_DEFAULT;
-  return status;
-}
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_RG
-int rrc_PERDec_UECapabilityInformation (int UE_Id, UECapabilityInformation* pvalue)
-{
-  int status = P_SUCCESS;
-
-  /* decode rrc_TransactionIdentifier */
-  //In fact, this check is not needed in certain cases because the rrc_TransactionIdentifier IE is OPTIONAL
-  if (pvalue->rrc_TransactionIdentifier != protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id) {
-    msg("\n[RRC_MSG] Transaction Id : --%d--, Received : --%d--, status %d\n",
-        protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id,
-        pvalue->rrc_TransactionIdentifier,status);
-    //return P_INVVALUE; // TEMP ignore error until transactions completely implemented
-  }
-
-  protocol_bs->rrc.Mobile_List[UE_Id].ind_accessStratumRelease = pvalue->accessStratumReleaseIndicator;
-  protocol_bs->rrc.Mobile_List[UE_Id].ind_eurecomKernelRelease = pvalue->eurecomKernelReleaseIndicator;
-  return status;
-}
-#endif
-
-/**************************************************************/
-/* UECapabilityInformationConfirm                             */
-/**************************************************************/
-#ifdef NODE_RG
-int rrc_PEREnc_UECapabilityInformationConfirm(int UE_Id, UECapabilityInformationConfirm * pvalue)
-{
-  int status = P_SUCCESS;
-  /* encode rrc_TransactionIdentifier */
-  pvalue->rrc_TransactionIdentifier = protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id;
-  /* encode the message */
-  /* Nothing */
-  return status;
-}
-#endif
-
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int rrc_PERDec_UECapabilityInformationConfirm(UECapabilityInformationConfirm* pvalue)
-{
-  int status = P_SUCCESS;
-  /* decode rrc_TransactionIdentifier */
-  protocol_ms->rrc.rcved_trans.msg_type= DL_DCCH_ueCapabilityInformationConfirm;
-  protocol_ms->rrc.rcved_trans.transaction_Id= pvalue->rrc_TransactionIdentifier;
-  /* decode the message */
-  /* Nothing */
-  return status;
-}
-#endif
-
diff --git a/openair2/RRC/CELLULAR/rrc_msg_pdus.h b/openair2/RRC/CELLULAR/rrc_msg_pdus.h
deleted file mode 100755
index 7f2d2417d1..0000000000
--- a/openair2/RRC/CELLULAR/rrc_msg_pdus.h
+++ /dev/null
@@ -1,316 +0,0 @@
-/***************************************************************************
-                          rrc_msg_pdus.h  -  description
-                             -------------------
-    begin                : Jan 6, 2003
-    copyright            : (C) 2003, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Define structures for RRC peer-to-peer messages
- ***************************************************************************/
-#ifndef __RRC_MSG_PDUS_H__
-#define __RRC_MSG_PDUS_H__
-
-#include "rrc_msg_ies.h"
-
-/**************************************************************/
-/*  RRCConnectionRequest                                      */
-/**************************************************************/
-typedef struct RRCConnectionRequest {
-  IMEI            imei;
-  EstablishmentCause establishmentCause;
-  ProtocolErrorIndicator protocolErrorIndicator;
-  //MeasuredResultsOnRACH  measuredResultsOnRACH;
-} RRCConnectionRequest;
-
-/**************************************************************/
-/*  RRCConnectionSetup                                        */
-/**************************************************************/
-typedef struct RRCConnectionSetup {
-  // InitialUE_Identity  initialUE_Identity;
-  IMEI            imei;
-  RRC_TransactionIdentifier rrc_TransactionIdentifier;
-  ActivationTime  activationTime;
-  U_RNTI          new_U_RNTI;
-  // C_RNTI  new_c_RNTI;
-  RRC_StateIndicator rrc_StateIndicator;
-  // UTRAN_DRX_CycleLengthCoefficient  utran_DRX_CycleLengthCoeff;
-  // CapabilityUpdateRequirement_r4  capabilityUpdateRequirement;
-  // SRB_InformationSetupList2  srb_InformationSetupList;
-  // UL_CommonTransChInfo  ul_CommonTransChInfo;
-  // UL_AddReconfTransChInfoList  ul_AddReconfTransChInfoList;
-  // DL_CommonTransChInfo_r4  dl_CommonTransChInfo;
-  // DL_AddReconfTransChInfoList  dl_AddReconfTransChInfoList;
-  // FrequencyInfo  frequencyInfo;
-  // MaxAllowedUL_TX_Power  maxAllowedUL_TX_Power;
-  // UL_ChannelRequirement_r4  ul_ChannelRequirement;
-  // DL_CommonInformation_r4  dl_CommonInformation;
-  // DL_InformationPerRL_List_r4  dl_InformationPerRL_List;
-  //   QOS_Classes  qos_Classes;
-  //   IP_DSCP_Codes  ip_dscp_Codes;
-  UE_Configuration ue_Configuration;
-} RRCConnectionSetup;
-
-/**************************************************************/
-/*  RRCConnectionSetupComplete                                */
-/**************************************************************/
-typedef struct RRCConnectionSetupComplete {
-  RRC_TransactionIdentifier rrc_TransactionIdentifier;
-  UE_RadioAccessCapability ue_RadioAccessCapability;
-} RRCConnectionSetupComplete;
-
-/**************************************************************/
-/*  RRCConnectionReject                                       */
-/**************************************************************/
-typedef struct RRCConnectionReject {
-  //   InitialUE_Identity  initialUE_Identity;
-  IMEI            imei;
-  RRC_TransactionIdentifier rrc_TransactionIdentifier;
-  WaitTime        waitTime;
-} RRCConnectionReject;
-
-/**************************************************************/
-/*  RRCConnectionReleaseMD                                      */
-/**************************************************************/
-typedef struct RRCConnectionRelease_UL {
-  U_RNTI          u_RNTI;
-  ReleaseCause    releaseCause;
-} RRCConnectionRelease_UL;
-
-/**************************************************************/
-/*  InitialDirectTransfer                                     */
-/**************************************************************/
-typedef struct InitialDirectTransfer {
-  NAS_Message     nas_Message;
-  //MeasuredResultsOnRACH  measuredResultsOnRACH;
-} InitialDirectTransfer;
-
-/**************************************************************/
-/*  UplinkDirectTransfer                                      */
-/**************************************************************/
-typedef struct UplinkDirectTransfer {
-  NAS_Message     nas_Message;
-  //MeasuredResultsOnRACH  measuredResultsOnRACH;
-} UplinkDirectTransfer;
-
-/**************************************************************/
-/*  DownlinkDirectTransfer                                    */
-/**************************************************************/
-typedef struct DownlinkDirectTransfer {
-  RRC_TransactionIdentifier rrc_TransactionIdentifier;
-  NAS_Message     nas_Message;
-} DownlinkDirectTransfer;
-
-/**************************************************************/
-/*  RadioBearerSetup                                          */
-/**************************************************************/
-typedef struct RadioBearerSetup {
-  RRC_TransactionIdentifier rrc_TransactionIdentifier;
-  //IntegrityProtectionModeInfo  integrityProtectionModeInfo;
-  //CipheringModeInfo  cipheringModeInfo;
-  ActivationTime  activationTime;
-  U_RNTI          new_U_RNTI;
-  //   C_RNTI  new_C_RNTI;
-  RRC_StateIndicator rrc_StateIndicator;
-  //   CN_InformationInfo  cn_InformationInfo;
-  //   SRB_InformationSetupList  srb_InformationSetupList;
-  RAB_InformationSetupList rab_InformationSetupList;
-  //   RB_InformationAffectedList  rb_InformationAffectedList;
-  //   DL_CounterSynchronisationInfo  dl_CounterSynchronisationInfo;
-  //   UL_CommonTransChInfo  ul_CommonTransChInfo;
-  //   UL_DeletedTransChInfoList  ul_deletedTransChInfoList;
-  //   UL_AddReconfTransChInfoList  ul_AddReconfTransChInfoList;
-  //   DL_CommonTransChInfo  dl_CommonTransChInfo;
-  //   DL_DeletedTransChInfoList  dl_DeletedTransChInfoList;
-  //   DL_AddReconfTransChInfoList  dl_AddReconfTransChInfoList;
-  //   FrequencyInfo  frequencyInfo;
-  //   MaxAllowedUL_TX_Power  maxAllowedUL_TX_Power;
-  //   UL_ChannelRequirement  ul_ChannelRequirement;
-  //   DL_CommonInformation  dl_CommonInformation;
-  //   DL_InformationPerRL_List  dl_InformationPerRL_List;
-  //   QOS_Classes  qos_Classes;
-  //   IP_DSCP_Codes  ip_dscp_Codes;
-  UE_Configuration ue_Configuration;
-} RadioBearerSetup;
-
-/**************************************************************/
-/*  RadioBearerRelease                                        */
-/**************************************************************/
-typedef struct RadioBearerRelease {
-  RRC_TransactionIdentifier rrc_TransactionIdentifier;
-  //IntegrityProtectionModeInfo  integrityProtectionModeInfo;
-  //CipheringModeInfo  cipheringModeInfo;
-  ActivationTime  activationTime;
-  U_RNTI          new_U_RNTI;
-  //   C_RNTI  new_C_RNTI;
-  RRC_StateIndicator rrc_StateIndicator;
-  //   CN_InformationInfo  cn_InformationInfo;
-  //   CN_DomainIdentity  signallingConnectionRelIndication;
-  //   RAB_InformationReconfigList  rab_InformationReconfigList;
-  RB_InformationReleaseList rb_InformationReleaseList;
-  //   RB_InformationAffectedList  rb_InformationAffectedList;
-  //   DL_CounterSynchronisationInfo  dl_CounterSynchronisationInfo;
-  //   UL_CommonTransChInfo  ul_CommonTransChInfo;
-  //   UL_DeletedTransChInfoList  ul_deletedTransChInfoList;
-  //   UL_AddReconfTransChInfoList  ul_AddReconfTransChInfoList;
-  //   DL_CommonTransChInfo  dl_CommonTransChInfo;
-  //   DL_DeletedTransChInfoList  dl_DeletedTransChInfoList;
-  //   DL_AddReconfTransChInfo2List  dl_AddReconfTransChInfoList;
-  //   FrequencyInfo  frequencyInfo;
-  //   MaxAllowedUL_TX_Power  maxAllowedUL_TX_Power;
-  //   UL_ChannelRequirement  ul_ChannelRequirement;
-  //   DL_CommonInformation  dl_CommonInformation;
-  //   DL_InformationPerRL_List  dl_InformationPerRL_List;
-  UE_Configuration ue_Configuration;
-} RadioBearerRelease;
-
-/**************************************************************/
-/*  RadioBearerSetupComplete                                  */
-/**************************************************************/
-typedef struct RadioBearerSetupComplete {
-  RRC_TransactionIdentifier rrc_TransactionIdentifier;
-  //IntegrityProtActivationInfo  ul_IntegProtActivationInfo;
-  //UL_TimingAdvance  ul_TimingAdvance;
-  //RB_ActivationTimeInfoList  rb_UL_CiphActivationTimeInfo;
-  //UL_CounterSynchronisationInfo  ul_CounterSynchronisationInfo;
-} RadioBearerSetupComplete;
-
-/**************************************************************/
-/*  RadioBearerSetupFailure                                   */
-/**************************************************************/
-typedef struct RadioBearerSetupFailure {
-  RRC_TransactionIdentifier rrc_TransactionIdentifier;
-  FailureCauseWithProtErr failureCause;
-  //RB_IdentityList  potentiallySuccesfulBearerList;
-} RadioBearerSetupFailure;
-
-/**************************************************************/
-/*  RadioBearerReleaseComplete                                */
-/**************************************************************/
-typedef struct RadioBearerReleaseComplete {
-  RRC_TransactionIdentifier rrc_TransactionIdentifier;
-  //IntegrityProtActivationInfo  ul_IntegProtActivationInfo;
-  //UL_TimingAdvance  ul_TimingAdvance;
-  //RB_ActivationTimeInfoList  rb_UL_CiphActivationTimeInfo;
-  //UL_CounterSynchronisationInfo  ul_CounterSynchronisationInfo;
-} RadioBearerReleaseComplete;
-
-/**************************************************************/
-/*  RadioBearerReleaseFailure                                 */
-/**************************************************************/
-typedef struct RadioBearerReleaseFailure {
-  RRC_TransactionIdentifier rrc_TransactionIdentifier;
-  FailureCauseWithProtErr failureCause;
-  //RB_IdentityList  potentiallySuccesfulBearerList;
-} RadioBearerReleaseFailure;
-
-/**************************************************************/
-/*  CellUpdate                                                */
-/**************************************************************/
-typedef struct CellUpdate {
-  U_RNTI          u_RNTI;
-  //STARTList  startList;
-  u8              am_RLC_ErrorIndicationRb2_3or4;
-  u8              am_RLC_ErrorIndicationRb5orAbove;
-  CellUpdateCause cellUpdateCause;
-  FailureCauseWithProtErrTrId failureCause;
-  //Rb_timer_indicator  rb_timer_indicator;
-  //MeasuredResultsOnRACH  measuredResultsOnRACH;
-} CellUpdate;
-
-/**************************************************************/
-/*  CellUpdateConfirm_CCCH                                    */
-/**************************************************************/
-typedef struct CellUpdateConfirm_CCCH {
-  U_RNTI          u_RNTI;
-  RRC_TransactionIdentifier rrc_TransactionIdentifier;
-  //IntegrityProtectionModeInfo  integrityProtectionModeInfo;
-  //CipheringModeInfo  cipheringModeInfo;
-  ActivationTime  activationTime;
-  U_RNTI          new_U_RNTI;
-  //   C_RNTI  new_C_RNTI;
-  RRC_StateIndicator rrc_StateIndicator;
-  u8              rlc_Re_establishIndicatorRb2_3or4;
-  u8              rlc_Re_establishIndicatorRb5orAbove;
-  //   CN_InformationInfo  cn_InformationInfo;
-  //   RB_InformationReleaseList  rb_InformationReleaseList;
-  //   RB_InformationReconfigList  rb_InformationReconfigList;
-  //   RB_InformationAffectedList  rb_InformationAffectedList;
-  //   DL_CounterSynchronisationInfo  dl_CounterSynchronisationInfo;
-  //   UL_CommonTransChInfo  ul_CommonTransChInfo;
-  //   UL_DeletedTransChInfoList  ul_deletedTransChInfoList;
-  //   UL_AddReconfTransChInfoList  ul_AddReconfTransChInfoList;
-  //   DL_CommonTransChInfo  dl_CommonTransChInfo;
-  //   DL_DeletedTransChInfoList  dl_DeletedTransChInfoList;
-  //   DL_AddReconfTransChInfoList  dl_AddReconfTransChInfoList;
-  //   FrequencyInfo  frequencyInfo;
-  //   MaxAllowedUL_TX_Power  maxAllowedUL_TX_Power;
-  //   UL_ChannelRequirement  ul_ChannelRequirement;
-  //   DL_CommonInformation  dl_CommonInformation;
-  //   DL_InformationPerRL_List  dl_InformationPerRL_List;
-  UE_Configuration ue_Configuration;
-} CellUpdateConfirm_CCCH;
-
-/**************************************************************/
-/*  PagingType2                                               */
-/**************************************************************/
-typedef struct PagingType2 {
-  RRC_TransactionIdentifier rrc_TransactionIdentifier;
-  //PagingCause  pagingCause;
-  IMEI            imei;
-  //   NAS_Message  nas_Message;  EXAMPLE
-  PAGING_Message  paging_Message;
-} PagingType2;
-
-/**************************************************************/
-/*  MeasurementControl                                        */
-/**************************************************************/
-typedef struct MeasurementControl {
-  RRC_TransactionIdentifier rrc_TransactionIdentifier;
-  MeasurementIdentity measurementIdentity;
-  MeasurementCommand_r4 measurementCommand;
-  MeasurementReportingMode measurementReportingMode;
-  //AdditionalMeasurementID_List  additionalMeasurementList; FFS
-} MeasurementControl;
-
-/**************************************************************/
-/*  MeasurementReport                                         */
-/**************************************************************/
-typedef struct MeasurementReport {
-  MeasurementIdentity measurementIdentity;
-  MeasuredResults measuredResults;
-  //   MeasuredResultsOnRACH  measuredResultsOnRACH;  FFS
-  //   MeasuredResultsList  additionalMeasuredResults; FFS
-  //   EventResults  eventResults; FFS
-} MeasurementReport;
-
-// /**************************************************************/
-// /*  ULPCHControl + KeepAlive                                  */
-// /**************************************************************/
-// typedef struct ULPCHControl {
-//   RRC_TransactionIdentifier rrc_TransactionIdentifier;
-//   UplinkPhysicalChannelControl_IE uplinkPhysicalChannelControl_IE;
-// } ULPCHControl;
-//
-// typedef struct KeepAlive {
-//   int             dummy;
-// } KeepAlive;
-
-/**************************************************************/
-/* UECapabilityInformation                                    */
-/**************************************************************/
-typedef struct UECapabilityInformation {
-  RRC_TransactionIdentifier      rrc_TransactionIdentifier;
-  AccessStratumReleaseIndicator  accessStratumReleaseIndicator;
-  //An adaptation for Eurecom TD-CDMA
-  EurecomKernelReleaseIndicator  eurecomKernelReleaseIndicator;
-} UECapabilityInformation;
-
-/**************************************************************/
-/* UECapabilityInformationConfirm                             */
-/**************************************************************/
-typedef struct UECapabilityInformationConfirm {
-  u8  present;
-  RRC_TransactionIdentifier  rrc_TransactionIdentifier;
-} UECapabilityInformationConfirm;
-
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_nas_primitives.h b/openair2/RRC/CELLULAR/rrc_nas_primitives.h
deleted file mode 100755
index 07abfb5c9d..0000000000
--- a/openair2/RRC/CELLULAR/rrc_nas_primitives.h
+++ /dev/null
@@ -1,365 +0,0 @@
-/*********************************************************************
-                         rrc_nas_primitives.h  -  description
-                            -------------------
-   begin                : Jan 11, 2002
-   copyright            : (C) 2001, 2010 by Eurecom
-   email                : Michelle.Wetterwald@eurecom.fr
- *********************************************************************
- Define RRC external interface primitives
- ********************************************************************/
-#ifndef __RRC_NASPRIM_H__
-#define __RRC_NASPRIM_H__
-
-//----------------------------------------------------------
-// Primitives
-//----------------------------------------------------------
-#define INFO_BROADCAST_REQ  1
-#define INFO_BROADCAST_IND  2
-#define CONN_ESTABLISH_REQ  3
-#define CONN_ESTABLISH_IND  4
-#define CONN_ESTABLISH_RESP 5
-#define CONN_ESTABLISH_CNF  6
-#define CONN_RELEASE_REQ    7
-#define CONN_RELEASE_IND    8
-#define DATA_TRANSFER_REQ   9
-#define DATA_TRANSFER_IND   10
-#define RB_ESTABLISH_REQ    11
-#define RB_ESTABLISH_IND    12
-#define RB_ESTABLISH_CNF    14
-#define RB_RELEASE_REQ      15
-#define RB_RELEASE_IND      16
-#define MEASUREMENT_IND     17
-#define CONN_LOSS_IND       18
-#define PAGING_REQ          19
-#define NOTIFICATION_IND    20
-#define MBMS_BEARER_ESTABLISH_REQ 21
-#define MBMS_BEARER_ESTABLISH_CNF 22
-#define MBMS_BEARER_RELEASE_REQ   23
-#define MBMS_UE_NOTIFY_REQ        24
-#define MBMS_UE_NOTIFY_IND        25
-#define MBMS_UE_NOTIFY_CNF        26
-//Added for Medieval demo 3 - MW
-#define ENB_MEASUREMENT_REQ 27
-#define ENB_MEASUREMENT_IND 29
-
-//----------------------------------------------------------
-// Constants
-//----------------------------------------------------------
-// Define max length authorized (to be updated later)
-#define NAS_MAX_LENGTH 180  // maximum length of a NAS primitive
-#define NAS_TL_SIZE     4  // size of the Type+Length fields of the primitive
-#define NAS_DATA_MAX_LENGTH NAS_MAX_LENGTH - NAS_TL_SIZE //remaining bytes for the message
-#define MAX_RABS 27   // = MAXURAB
-#define MAX_MEASURE_NB  5
-#define MAX_MBMS_SERVICES 4 //spec 128
-#define MAX_MEASURE_UE  3 // if applicable, should be identical with maxUsers value
-
-//Connection Establishment status
-// UE
-#define TERMINATED         0
-#define ABORTED             1
-#define ALREADY_CONNECTED  2
-// RG + RB Establishment Confirm
-#define ACCEPTED   0
-#define FAILURE     1
-//----------------------------------------------------------
-// Parameter types
-//----------------------------------------------------------
-typedef u32 nasPeriod_t; // Broadcast repetition period
-typedef u16  nasBroadcastCategory_t; // identifies the type of data to broadcast (IP signalling/ List of neighbors)
-typedef u8  nasIMEI_t[14]; // 14 digits of IMEI
-typedef u16 nasDataLength_t; // Length of the data in the primitive
-typedef u16 nasCellID_t; // ID of the cell for connection
-typedef u32 nasLocalConnectionRef_t; // local identifier
-typedef u16  nasConnectionStatus_t; // connection establishment status
-typedef u16  nasReleaseCause_t; // connection release cause
-typedef u16  nasSignalingPriority_t; // priority to use srb3 or srb4
-typedef u16 nasRadioBearerId_t;
-typedef u16 nasQoSTrafficClass_t; //QoS traffic class requested
-typedef u16  nasIPdscp_t; // DSCP code transported to service NAS
-typedef struct nasRBDef {
-  nasRadioBearerId_t rbId;
-  nasQoSTrafficClass_t QoSclass;
-  nasIPdscp_t dscp;
-} nasrbParms_t;
-typedef u32 nasSapId_t; // Id of the QoS SAP to use
-typedef u16  nasRBEstablishStatus_t; // radio bearer establishment status
-typedef u16  nasNumRBsInList_t; // number of RBs defined in the list
-typedef nasrbParms_t nasRBList_t[MAX_RABS]; // List of Rbs for handover
-typedef u16  nasNumRGsMeas_t; // number of RGs that could be measured
-typedef u32 nasPagingUEId_t; // Cell_Id of the mobile, = Local Conn Ref
-typedef u32 nasSigLevel_t; // Signal level measured
-typedef struct nasMeasures {
-  nasCellID_t cell_id;
-  nasSigLevel_t level;
-} nasMeasures_t;
-typedef u32 nasMBMSServiceId_t; //3 bytes - to be completed by PLMN-Id
-typedef u16 nasMBMSSessionId_t; //1 byte
-typedef struct nasMBMSService {
-  nasMBMSServiceId_t   mbms_serviceId;
-} nasMBMSService_t;
-typedef u32 nasMBMSDuration_t; //3 bytes
-typedef u16 nasMBMSStatus_t;   // UE notification status
-//Added for Medieval demo 3 - MW
-typedef u16 nasNumConnUEs_t; // number of UEs that are connected
-typedef u32 nasENbMeasure_t; // type definition to hold measures
-typedef struct nasENbMeasures {
-  nasENbMeasure_t rlcBufferOccupancy;
-  nasENbMeasure_t scheduledPRB;
-  nasENbMeasure_t totalDataVolume;
-} nasENbMeasures_t;
-
-
-//----------------------------------------------------------
-// Primitive definitions
-//----------------------------------------------------------
-// -- SAP-GC
-struct NASInfoBroadcastReq {
-  nasPeriod_t period;  // 0 = one-shot, otherwise in  x 10 ms
-  nasBroadcastCategory_t category;
-  nasDataLength_t nasDataLength;
-};
-
-struct NASMBMSBearerEstablishReq {
-  nasMBMSServiceId_t   mbms_serviceId;
-  nasMBMSSessionId_t   mbms_sessionId ;
-  nasQoSTrafficClass_t mbms_QoSclass;
-  nasSapId_t           mbms_sapId;
-  nasRadioBearerId_t   mbms_rbId;
-  nasMBMSDuration_t    mbms_duration;
-};
-
-struct NASMBMSBearerReleaseReq {
-  nasMBMSServiceId_t   mbms_serviceId;
-  nasMBMSSessionId_t   mbms_sessionId ;
-  nasRadioBearerId_t   mbms_rbId;
-};
-
-
-struct NASInfoBroadcastInd {
-  nasDataLength_t nasDataLength;
-};
-
-struct nas_ue_gc_element {
-  u16  type;
-  u16 length;
-  union {
-    struct NASInfoBroadcastInd broadcast_ind;
-  } nasUEGCPrimitive;
-};
-
-struct nas_rg_gc_element {
-  u16  type;
-  u16 length;
-  union {
-    struct NASInfoBroadcastReq        broadcast_req;
-    struct NASMBMSBearerEstablishReq  mbms_establish_req;
-    struct NASMBMSBearerReleaseReq    mbms_release_req;
-  } nasRGGCPrimitive;
-};
-
-// -- SAP-DC
-struct NASConnEstablishReq {
-  nasLocalConnectionRef_t  localConnectionRef;   //provided by NAS
-  nasCellID_t cellId;
-};
-
-struct NASConnEstablishInd {
-  nasLocalConnectionRef_t  localConnectionRef;
-  nasIMEI_t InterfaceIMEI;
-};
-
-struct NASConnEstablishConf {
-  nasLocalConnectionRef_t localConnectionRef;
-  nasConnectionStatus_t    status;     // can be : Accepted, Failure
-  nasNumRBsInList_t num_RBs;        // actual number of RBs in the list
-  nasRBList_t RB_List;
-};
-
-struct NASConnEstablishResp {
-  nasLocalConnectionRef_t  localConnectionRef;
-  nasIMEI_t InterfaceIMEI;
-  nasConnectionStatus_t    status;     // can be : Terminated, Aborted , Already_Connected
-};
-
-struct NASConnReleaseReq {
-  nasLocalConnectionRef_t  localConnectionRef;
-  nasReleaseCause_t releaseCause;
-};
-
-struct NASConnReleaseInd {
-  nasLocalConnectionRef_t  localConnectionRef;
-  nasReleaseCause_t releaseCause;
-};
-
-struct NASConnLossInd {
-  nasLocalConnectionRef_t  localConnectionRef;
-};
-
-struct NASDataReq {
-  nasLocalConnectionRef_t  localConnectionRef;
-  nasSignalingPriority_t priority;
-  nasDataLength_t nasDataLength;
-};
-
-struct NASDataInd {
-  nasLocalConnectionRef_t  localConnectionRef;
-  nasSignalingPriority_t priority;
-  nasDataLength_t nasDataLength;
-};
-
-struct NASrbEstablishReq {
-  nasLocalConnectionRef_t  localConnectionRef;
-  nasRadioBearerId_t rbId;
-  nasQoSTrafficClass_t  QoSclass;
-  nasIPdscp_t dscp;
-};
-
-struct NASrbEstablishInd {
-  nasLocalConnectionRef_t  localConnectionRef;
-  nasRadioBearerId_t rbId;
-  nasQoSTrafficClass_t  QoSclass;
-  nasIPdscp_t dscp;
-  nasSapId_t  sapId;
-};
-
-struct NASrbEstablishConf {
-  nasLocalConnectionRef_t  localConnectionRef;
-  nasRadioBearerId_t  rbId;
-  nasSapId_t  sapId;
-  nasRBEstablishStatus_t status;     // can be : Accepted, Failure
-  nasRBEstablishStatus_t fail_code;  // gives more details on failure cause
-};
-
-struct NASrbReleaseReq {
-  nasLocalConnectionRef_t  localConnectionRef;
-  nasRadioBearerId_t rbId;
-};
-
-struct NASrbReleaseInd {
-  nasLocalConnectionRef_t  localConnectionRef;
-  nasRadioBearerId_t rbId;
-};
-
-struct NASMeasureReq {
-  nasLocalConnectionRef_t  localConnectionRef;
-};
-
-struct NASMeasureInd {
-  nasLocalConnectionRef_t  localConnectionRef;
-  nasNumRGsMeas_t nb_rg;
-  nasMeasures_t measures[MAX_MEASURE_NB];
-};
-
-struct NASMBMSUENotifyReq {
-  nasLocalConnectionRef_t  localConnectionRef;
-  nasMBMSService_t joined_services[MAX_MBMS_SERVICES];
-  nasMBMSService_t left_services[MAX_MBMS_SERVICES];
-};
-
-struct NASMBMSUENotifyInd {
-  nasLocalConnectionRef_t  localConnectionRef;
-  nasMBMSService_t joined_services[MAX_MBMS_SERVICES];
-  nasMBMSService_t left_services[MAX_MBMS_SERVICES];
-};
-
-struct NASMBMSUENotifyCnf {
-  nasLocalConnectionRef_t  localConnectionRef;
-  nasMBMSStatus_t mbmsStatus;
-};
-
-
-// Temp - In the DC-SAP as there is no upwards GC-SAP in the RG (to be added)
-struct NASMBMSBearerEstablishConf {
-  nasRadioBearerId_t  rbId;
-  nasSapId_t  sapId;
-  nasRBEstablishStatus_t status;     // can be : Accepted, Failure
-};
-
-//Added for Medieval demo 3 - MW
-
-struct NASENbMeasureReq {
-  nasCellID_t cell_id;
-};
-
-struct NASEnbMeasureInd {
-  nasCellID_t cell_id;
-  nasNumConnUEs_t num_UEs;
-  nasENbMeasures_t measures[MAX_MEASURE_UE];
-  nasENbMeasure_t totalNumPRBs;
-};
-
-/*****
- * UE Primitives
- *****/
-struct nas_ue_dc_element {
-  u16  type;
-  u16 length;
-  union {
-    struct NASConnEstablishReq conn_establish_req;
-    struct NASConnEstablishResp conn_establish_resp;
-    //    struct NASConnReleaseInd conn_release_ind;
-    struct NASConnReleaseReq conn_release_req;
-    struct NASConnLossInd conn_loss_ind;
-    struct NASDataReq data_transfer_req;
-    struct NASDataInd data_transfer_ind;
-    struct NASrbEstablishInd rb_establish_ind;
-    struct NASrbReleaseInd rb_release_ind;
-    struct NASMeasureInd measurement_ind;
-    struct NASMeasureReq measurement_req;
-    struct NASMBMSUENotifyInd mbms_ue_notify_ind;
-  } nasUEDCPrimitive;
-};
-
-/*****
- * RG Primitives
- *****/
-struct nas_rg_dc_element {
-  u16  type;
-  u16 length;
-  union {
-    struct NASConnEstablishInd conn_establish_ind;
-    struct NASConnEstablishConf conn_establish_conf;
-    struct NASConnReleaseInd conn_release_ind;
-    //    struct NASConnReleaseReq conn_release_req;
-    struct NASConnLossInd conn_loss_ind;
-    struct NASDataReq data_transfer_req;
-    struct NASDataInd data_transfer_ind;
-    struct NASrbEstablishReq rb_establish_req;
-    struct NASrbEstablishConf rb_establish_conf;
-    struct NASrbReleaseReq rb_release_req;
-    struct NASMBMSUENotifyReq mbms_ue_notify_req;
-    struct NASMBMSUENotifyCnf mbms_ue_notify_cnf;
-    struct NASMBMSBearerEstablishConf mbms_establish_cnf;  //TEMP - should be in GC-SAP upwards
-    struct NASENbMeasureReq eNBmeasurement_req;
-    struct NASEnbMeasureInd eNBmeasurement_ind;
-  } nasRGDCPrimitive;
-};
-
-// -- SAP-NT
-struct NASPagingReq {
-  nasPagingUEId_t UeId;
-  nasDataLength_t nasDataLength;
-};
-
-struct NASNotificationInd {
-  nasDataLength_t nasDataLength;
-};
-
-struct nas_ue_nt_element {
-  u16  type;
-  u16 length;
-  union {
-    struct NASNotificationInd notification_ind;
-  } nasUENTPrimitive;
-};
-
-struct nas_rg_nt_element {
-  u16  type;
-  u16 length;
-  union {
-    struct NASPagingReq paging_req;
-  } nasRGNTPrimitive;
-};
-
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_nas_sap.h b/openair2/RRC/CELLULAR/rrc_nas_sap.h
deleted file mode 100755
index df3bb6e902..0000000000
--- a/openair2/RRC/CELLULAR/rrc_nas_sap.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/***************************************************************************
-                          rrc_nas_sap.h  -
-                          -------------------
-    copyright            : (C) 2001, 2010 by Eurecom
-    created by           : Lionel.Gauthier@eurecom.fr
-    modified by          : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Definition of RRC FIFOs and SAPs to interface NAS
- **************************************************************************
-  FIFOs Operational mode
-        FIFO      RRC         NAS
-  UE    GC        Write       Read
-        Nt        Write       Read
-        DC_IN     Read        Write
-        DC_OUT    Write       Read
-  RG    GC        Read        Write
-        Nt        Read        Write
-        DC_IN     Read        Write
-        DC_OUT    Write       Read
- ***************************************************************************/
-#ifndef __RRC_SAP_H__
-#define __RRC_SAP_H__
-
-// #define RRC_BASE_STATION       0    // just for test of protocol on a single node (loopback on MAC)
-// #define RRC_MOBILE_STATION     1    // just for test of protocol on a single node (loopback on MAC)
-
-#define RRC_DEVICE_UE_GCSAP     "/dev/rtf40"
-#define RRC_DEVICE_UE_NTSAP     "/dev/rtf41"
-#define RRC_DEVICE_UE_DCSAP_IN  "/dev/rtf42"
-#define RRC_DEVICE_UE_DCSAP_OUT "/dev/rtf43"
-#define RRC_DEVICE_RG_GCSAP     "/dev/rtf44"
-#define RRC_DEVICE_RG_NTSAP     "/dev/rtf45"
-#define RRC_DEVICE_RG_DCSAP0_IN  "/dev/rtf46"
-#define RRC_DEVICE_RG_DCSAP0_OUT "/dev/rtf47"
-#define RRC_DEVICE_RG_DCSAP1_IN  "/dev/rtf48"
-#define RRC_DEVICE_RG_DCSAP1_OUT "/dev/rtf49"
-#define RRC_DEVICE_RG_DCSAP2_IN  "/dev/rtf50"
-#define RRC_DEVICE_RG_DCSAP2_OUT "/dev/rtf51"
-
-#ifndef USER_MODE
-
-#define RRC_SAPI_UE_GCSAP           40
-#define RRC_SAPI_UE_NTSAP           41
-#define RRC_SAPI_UE_DCSAP_IN        42
-#define RRC_SAPI_UE_DCSAP_OUT       43
-#define RRC_SAPI_RG_GCSAP           44
-#define RRC_SAPI_RG_NTSAP           45
-#define RRC_SAPI_RG_DCSAP0_IN       46
-#define RRC_SAPI_RG_DCSAP0_OUT      47
-#define RRC_SAPI_RG_DCSAP1_IN       48
-#define RRC_SAPI_RG_DCSAP1_OUT      49
-#define RRC_SAPI_RG_DCSAP2_IN       50
-#define RRC_SAPI_RG_DCSAP2_OUT      51
-
-#else  //USER_MODE
-
-#ifdef NODE_MT
-#define RRC_SAPI_UE_GCSAP      "./RUE_GC"
-#define RRC_SAPI_UE_NTSAP      "./RUE_NT"
-#define RRC_SAPI_UE_DCSAP_IN   "./RUE_DCIN"
-#define RRC_SAPI_UE_DCSAP_OUT  "./RUE_DCOUT"
-#endif //NODE_MT
-#ifdef NODE_RG
-#define RRC_SAPI_RG_GCSAP       "./RRG_GC"
-#define RRC_SAPI_RG_NTSAP       "./RRG_NT"
-#define RRC_SAPI_RG_DCSAP0_IN   "./RRG_DCIN0"
-#define RRC_SAPI_RG_DCSAP0_OUT  "./RRG_DCOUT0"
-#define RRC_SAPI_RG_DCSAP1_IN   "./RRG_DCIN1"
-#define RRC_SAPI_RG_DCSAP1_OUT  "./RRG_DCOUT1"
-#define RRC_SAPI_RG_DCSAP2_IN   "./RRG_DCIN2"
-#define RRC_SAPI_RG_DCSAP2_OUT  "./RRG_DCOUT2"
-#endif  //NODE_RG
-#endif  //USER_MODE
-
-//#ifdef PDCP_USE_NETLINK
-// For netlink, all SAPs are on the same socket
-// GC-NT - OUT=UE, IN=RG
-// DCx   - OUT/IN = UE + RG
-#define RRC_NAS_GC_IN   0
-#define RRC_NAS_GC_OUT  1
-#define RRC_NAS_NT_IN   2
-#define RRC_NAS_NT_OUT  3
-#define RRC_NAS_DC0_IN  4
-#define RRC_NAS_DC0_OUT 5
-#define RRC_NAS_DC1_IN  6
-#define RRC_NAS_DC1_OUT 7
-#define RRC_NAS_DC2_IN  8
-#define RRC_NAS_DC2_OUT 9
-// ToDo : continue with parameterization of the value (up to 250 MTs for 1 short int)
-//#endif //PDCP_USE_NETLINK
-
-#define NAS_RRCNL_ID 30
-#define NL_DEST_RRC_PID 1
-
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_platform_types.h b/openair2/RRC/CELLULAR/rrc_platform_types.h
deleted file mode 100644
index 844c72fd35..0000000000
--- a/openair2/RRC/CELLULAR/rrc_platform_types.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*********************************************************************
-                          rrc_platform_types.h  -  description
-                             -------------------
-    copyright            : (C) 2005, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- *********************************************************************
-  Define parameters types common to RRC_UE and RRC_RG
-
-  TEMP : these will later be changed to the OpenAir types.
- ********************************************************************/
-#ifndef __RRC_PLATFORM_TYPES_H__
-#define __RRC_PLATFORM_TYPES_H__
-
-#include "platform_types.h"
-
-//typedef s8_t  s8;
-//typedef u8_t  u8;
-//typedef s16_t s16;
-//typedef u16_t u16;
-//typedef s32_t s32;
-//typedef u32_t u32;
-
-
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_proto_bch.h b/openair2/RRC/CELLULAR/rrc_proto_bch.h
deleted file mode 100755
index 458afe299f..0000000000
--- a/openair2/RRC/CELLULAR/rrc_proto_bch.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/***************************************************************************
-                          rrc_proto_bch.h  -  description
-                             -------------------
-    begin                : Aug 30 2002
-    copyright            : (C) 2002, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- ***************************************************************************/
-#ifndef __RRC_PROTO_BCH_H__
-#define __RRC_PROTO_BCH_H__
-
-/**************************************************************/
-void rrc_new_per_parms (PERParms * pParms, char *pBuffer);
-void rrc_set_per_length (PERParms * pParms);
-int  rrc_get_per_length (ENCODEDBLOCK * pBlock);
-void rrc_print_per_parms (PERParms * pParms);
-
-int  rrc_PEREnc_padding (PERParms * pParms, int length);
-// Constrained integer
-int  rrc_PEREnc_ConstrInteger (PERParms * per_p, int pvalue, int lower, int upper);
-int  rrc_PERDec_ConstrInteger (PERParms * per_p, int *value, int lower, int upper);
-//  Constrained Unsigned Integer
-int  rrc_PEREnc_ConsUnsigned (PERParms * pParms, unsigned int value, unsigned int lower, unsigned int upper);
-int  rrc_PERDec_ConsUnsigned (PERParms * pParms, unsigned int *pvalue, unsigned int lower, unsigned int upper);
-//  Bit String
-int  rrc_PEREnc_BitString (PERParms * pParms, unsigned int numbits, unsigned char *data);
-int  rrc_PERDec_BitString (PERParms * pParms, unsigned int *numbits_p, char *buffer, unsigned int bufsiz);
-//  Octet string
-int  rrc_PEREnc_OctetString (PERParms * pParms, unsigned int numocts, char *data);
-int  rrc_PERDec_OctetString (PERParms * pParms, unsigned int *numocts_p, char *buffer, unsigned int bufsiz);
-//  Variable Octet string with length
-int  rrc_PEREnc_VarOctetString (PERParms * pParms, unsigned int numocts, unsigned char *data);
-int  rrc_PERDec_VarOctetString (PERParms * pParms, unsigned int *numocts_p, unsigned char *data);
-//  Digit
-int  rrc_PEREnc_Digit (PERParms * pParms, Digit value);
-int  rrc_PERDec_Digit (PERParms * pParms, Digit * pvalue);
-//  Length
-int  rrc_PEREnc_Length (PERParms * pParms, unsigned int value);
-int  rrc_PERDec_Length (PERParms * pParms, unsigned int *pvalue);
-/**************************************************************/
-
-#ifdef NODE_RG
-void rrc_rg_prepare_next_segment (void);
-void rrc_rg_init_bch (void);
-void rrc_init_blocks (void);
-void rrc_init_mib (void);
-void rrc_init_sib1 (void);
-void rrc_update_SIB1_period (int period);
-void rrc_init_sib2 (void);
-void rrc_init_sib5 (void);
-void rrc_init_sib11 (void);
-void rrc_fill_sib14 (void);
-void rrc_init_sib14 (void);
-void rrc_init_sib18 (void);
-void rrc_update_SIB18_period (int period);
-#endif
-#ifdef NODE_MT
-void rrc_ue_bch_init (void);
-void rrc_ue_read_next_segment (void);
-void rrc_ue_bch_process_MIB (PERParms * pParms);
-void rrc_ue_bch_process_SIB1 (PERParms * pParms);
-void rrc_ue_bch_process_SIB2 (PERParms * pParms);
-void rrc_ue_bch_process_SIB5 (PERParms * pParms);
-void rrc_ue_bch_process_SIB11 (PERParms * pParms);
-void rrc_ue_bch_process_SIB14 (PERParms * pParms);
-void rrc_ue_bch_process_SIB18 (PERParms * pParms);
-#endif
-
-int  rrc_PEREnc_SI_BCH (PERParms * pParms, SystemInformation_BCH * pvalue);
-int  rrc_PERDec_SI_BCH (PERParms * pParms, SystemInformation_BCH * pvalue);
-
-int  rrc_PEREnc_SI_BCH_payload (PERParms * pParms, SystemInformation_BCH_payload * pvalue);
-int  rrc_PERDec_SI_BCH_payload (PERParms * pParms, SystemInformation_BCH_payload * pvalue);
-/**************************************************************/
-
-int  rrc_PEREnc_FirstSegment (PERParms * pParms, FirstSegment * pvalue);
-int  rrc_PERDec_FirstSegment (PERParms * pParms, FirstSegment * pvalue);
-
-int  rrc_PEREnc_SubsequentSegment (PERParms * pParms, SubsequentSegment * pvalue);
-int  rrc_PERDec_SubsequentSegment (PERParms * pParms, SubsequentSegment * pvalue);
-
-int  rrc_PEREnc_CompleteSIB (PERParms * pParms, CompleteSIB * pvalue);
-int  rrc_PERDec_CompleteSIB (PERParms * pParms, CompleteSIB * pvalue);
-
-int  rrc_PEREnc_LastSegment (PERParms * pParms, LastSegment * pvalue);
-int  rrc_PERDec_LastSegment (PERParms * pParms, LastSegment * pvalue);
-
-/**************************************************************/
-int  rrc_PEREnc_SIB_Type (PERParms * pParms, SIB_Type value);
-int  rrc_PERDec_SIB_Type (PERParms * pParms, SIB_Type * pvalue);
-
-int  rrc_PEREnc_SegCount (PERParms * pParms, SegCount value);
-int  rrc_PERDec_SegCount (PERParms * pParms, SegCount * pvalue);
-int  rrc_PEREnc_SegmentIndex (PERParms * pParms, SegmentIndex value);
-int  rrc_PERDec_SegmentIndex (PERParms * pParms, SegmentIndex * pvalue);
-
-int  rrc_PEREnc_SIB_Data_fixed (PERParms * pParms, SIB_Data_fixed value);
-int  rrc_PERDec_SIB_Data_fixed (PERParms * pParms, SIB_Data_fixed * pvalue);
-int  rrc_PEREnc_CompleteSIB_sib_Data_fixed (PERParms * pParms, CompleteSIB_sib_Data_fixed value);
-int  rrc_PERDec_CompleteSIB_sib_Data_fixed (PERParms * pParms, CompleteSIB_sib_Data_fixed * pvalue);
-
-int  rrc_PEREnc_SFN_Prime (PERParms * pParms, SFN_Prime value);
-int  rrc_PERDec_SFN_Prime (PERParms * pParms, SFN_Prime * pvalue);
-
-/**************************************************************/
-int  rrc_PEREnc_MasterInformationBlock (PERParms * pParms, MasterInformationBlock * pvalue);
-int  rrc_PERDec_MasterInformationBlock (PERParms * pParms, MasterInformationBlock * pvalue);
-
-int  rrc_PEREnc_MIB_ValueTag (PERParms * pParms, MIB_ValueTag value);
-int  rrc_PERDec_MIB_ValueTag (PERParms * pParms, MIB_ValueTag * pvalue);
-
-int  rrc_PEREnc_PLMN_Identity (PERParms * pParms, RCELL_PLMN_Identity * pvalue);
-int  rrc_PERDec_PLMN_Identity (PERParms * pParms, RCELL_PLMN_Identity * pvalue);
-
-int  rrc_PEREnc_SIBSb_ReferenceList (PERParms * pParms, SIBSb_ReferenceList * pvalue);
-int  rrc_PERDec_SIBSb_ReferenceList (PERParms * pParms, SIBSb_ReferenceList * pvalue);
-
-/**************************************************************/
-int  rrc_PEREnc_SysInfoType1 (PERParms * pParms, SysInfoType1 * pvalue);
-int  rrc_PERDec_SysInfoType1 (PERParms * pParms, SysInfoType1 * pvalue);
-
-int  rrc_PEREnc_NAS_SystemInformation (PERParms * pParms, NAS_SystemInformation value);
-int  rrc_PERDec_NAS_SystemInformation (PERParms * pParms, NAS_SystemInformation * pvalue);
-
-int  rrc_PEREnc_UE_TimersAndConstants (PERParms * pParms, RCELL_UE_TimersAndConstants value);
-int  rrc_PERDec_UE_TimersAndConstants (PERParms * pParms, RCELL_UE_TimersAndConstants * pvalue);
-
-/**************************************************************/
-int  rrc_PEREnc_SysInfoType2 (PERParms * pParms, SysInfoType2 * pvalue);
-int  rrc_PERDec_SysInfoType2 (PERParms * pParms, SysInfoType2 * pvalue);
-
-int  rrc_PEREnc_IP_Address (PERParms * pParms, IP_Address * pvalue);
-int  rrc_PERDec_IP_Address (PERParms * pParms, IP_Address * pvalue);
-
-/**************************************************************/
-int  rrc_PEREnc_SysInfoType5 (PERParms * pParms, SysInfoType5 * pvalue);
-int  rrc_PERDec_SysInfoType5 (PERParms * pParms, SysInfoType5 * pvalue);
-
-int  rrc_PEREnc_PRACH_SCCPCH_SIList (PERParms * pParms, PRACH_SCCPCH_SIList value);
-int  rrc_PERDec_PRACH_SCCPCH_SIList (PERParms * pParms, PRACH_SCCPCH_SIList * pvalue);
-
-int  rrc_PEREnc_OpenLoopPowerControl_TDD (PERParms * pParms, OpenLoopPowerControl_TDD * pvalue);
-int  rrc_PERDec_OpenLoopPowerControl_TDD (PERParms * pParms, OpenLoopPowerControl_TDD * pvalue);
-
-/**************************************************************/
-int  rrc_PEREnc_SysInfoType14 (PERParms * pParms, SysInfoType14 * pvalue);
-int  rrc_PERDec_SysInfoType14 (PERParms * pParms, SysInfoType14 * pvalue);
-
-int  rrc_PEREnc_IndividualTS_InterferenceList (PERParms * pParms, IndividualTS_InterferenceList * pvalue);
-int  rrc_PERDec_IndividualTS_InterferenceList (PERParms * pParms, IndividualTS_InterferenceList * pvalue);
-
-int  rrc_PEREnc_ExpirationTimeFactor (PERParms * pParms, ExpirationTimeFactor value);
-int  rrc_PERDec_ExpirationTimeFactor (PERParms * pParms, ExpirationTimeFactor * pvalue);
-
-/**************************************************************/
-int  rrc_PEREnc_SysInfoType18 (PERParms * pParms, SysInfoType18 * pvalue);
-int  rrc_PERDec_SysInfoType18 (PERParms * pParms, SysInfoType18 * pvalue);
-
-int  rrc_PEREnc_IdentitiesOfNeighbourCells (PERParms * pParms, IdentitiesOfNeighbourCells value);
-int  rrc_PERDec_IdentitiesOfNeighbourCells (PERParms * pParms, IdentitiesOfNeighbourCells * pvalue);
-
-int  rrc_PEREnc_CodeGroupsOfNeighbourCells (PERParms * pParms, CodeGroupsOfNeighbourCells * pvalue);
-int  rrc_PERDec_CodeGroupsOfNeighbourCells (PERParms * pParms, CodeGroupsOfNeighbourCells * pvalue);
-
-/**************************************************************/
-#ifdef NODE_RG
-//extern void rrc_broadcast_tx (void);
-extern int rrc_broadcast_tx (char *buffer);
-extern void rrc_init_blocks (void);
-#endif
-#ifdef NODE_MT
-// #include "mem_block.h"
-//extern void rrc_broadcast_rx (void *protP, mem_block_t *sduP);
-void rrc_broadcast_rx (char *Sdu);
-//extern void rrc_init_tags (void);
-# endif
-
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_proto_fsm.h b/openair2/RRC/CELLULAR/rrc_proto_fsm.h
deleted file mode 100755
index 18eea322c6..0000000000
--- a/openair2/RRC/CELLULAR/rrc_proto_fsm.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/***************************************************************************
-                          rrc_proto_fsm.h  -
-                          -------------------
-    copyright            : (C) 2001, 2010 by Eurecom
-    created by           : Lionel.Gauthier@eurecom.fr
-    modified by          : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  prototypes for RRC FSM
- ***************************************************************************/
-
-#ifndef __RRC_PROTO_FSM_H__
-#define __RRC_PROTO_FSM_H__
-
-// #include "rrc_constant.h"
-// #include "rrc_msg_ies.h"
-
-#ifdef NODE_RG
-void rrc_rg_fsm_control (int UE_Id, int rrc_event);
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-//int rrc_ue_fsm_control (int eventP);
-void rrc_ue_fsm_control (int rrc_event);
-#endif
-
-/***************************************************************************/
-#ifdef NODE_RG
-
-void  rrc_mt_list_print (int UE_Id);
-void  rrc_mt_list_init (void);
-int   get_new_UE_Id (IMEI *pIMEI);
-
-/* Input Functions prototypes*/
-
-extern void RRC_RG_I_I_RRC_CONNECTION_REQUEST (int UE_Id);
-extern void RRC_RG_I_I_RRC_CONN_SETUP_COMPLETE (int UE_Id);
-extern void RRC_RG_I_I_RRC_CONNECTION_RELEASE (int UE_Id);
-extern void RRC_RG_I_I_RRC_CONN_REL_COMPLETE (int UE_Id);
-extern void RRC_RG_I_I_RB_SETUP_COMPLETE (int UE_Id);
-extern void RRC_RG_I_I_RB_SETUP_FAILURE (int UE_Id);
-extern void RRC_RG_I_I_RB_REL_COMPLETE (int UE_Id);
-extern void RRC_RG_I_I_RB_REL_FAILURE (int UE_Id);
-extern void RRC_RG_I_I_CELL_UPDATE (int UE_Id);
-extern void RRC_RG_I_I_NAS_CONN_ESTAB_CNF (int UE_Id);
-extern void RRC_RG_I_I_NAS_CONN_RELEASE_REQ (int UE_Id);
-extern void RRC_RG_I_I_NAS_RB_ESTAB_REQ (int UE_Id);
-extern void RRC_RG_I_I_NAS_RB_RELEASE_REQ (int UE_Id);
-extern void RRC_RG_I_I_CPHY_SYNCH_IND (int UE_Id);
-extern void RRC_RG_I_I_CPHY_SYNCH_Failure (int UE_Id);
-extern void RRC_RG_I_I_CPHY_OUT_OF_SYNCH (int UE_Id);
-extern void RRC_RG_I_I_CPHY_CONNECTION_LOSS (int UE_Id);
-extern void RRC_RG_I_I_CPHY_RL_SETUP_Cnf (int UE_Id);
-extern void RRC_RG_I_I_CPHY_RL_MODIFY_Cnf (int UE_Id);
-extern void RRC_RG_I_I_CRLC_STATUS (int UE_Id);
-extern void RRC_RG_I_I_RLC_Success (int UE_Id);
-extern void RRC_RG_I_I_RLC_Failure (int UE_Id);
-extern void RRC_RG_I_I_Status (int UE_Id);
-extern void RRC_RG_I_I_RB_List (int UE_Id);
-extern void RRC_RG_I_I_Last_RB (void);
-extern void RRC_RG_I_I_Configuration_Indication (void);
-extern void RRC_RG_I_I_Configuration_Failure(void);
-extern int  RRC_RG_reset (void);
-extern int  RRC_RG (void);
-
-/* Input trigger functions - Defined in rrc_rg_data.c
- */
-void rrc_rg_fsm_init (void);
-
-void rrc_NAS_Conn_Cnf_Rx (int UE_Id, int status);
-void rrc_NAS_Conn_Cnf_RB_Rx (int UE_Id, int status, int RB_List);
-void rrc_NAS_Conn_Rel_Req_Rx (int UE_Id);
-void rrc_NAS_RB_Estab_Rx (int UE_Id, int RB_List);
-void rrc_NAS_RB_Rel_Rx (int UE_Id, int RB_List);
-
-void rrc_UE_RRC_Conn_Req_rx (int UE_Id);
-void rrc_UE_RRC_Conn_Setup_Compl_rx (int UE_Id);
-void rrc_UE_RRC_Conn_Release_rx (int UE_Id);
-void rrc_UE_RRC_Conn_Rel_Complete_rx (int UE_Id);
-void rrc_UE_RB_Setup_Complete_rx (int UE_Id);
-void rrc_UE_RB_Setup_Failure_rx (int UE_Id);
-void rrc_UE_RB_Release_Complete_rx (int UE_Id);
-void rrc_UE_Last_RB_Release_Complete_rx (int UE_Id);
-void rrc_UE_RB_Release_Failure_rx (int UE_Id);
-void rrc_UE_Cell_Update_rx (int UE_Id);
-
-void rrc_RG_PHY_Synch_rx (int UE_Id);
-void rrc_RG_PHY_Synch_Failure_rx (int UE_Id);
-void rrc_RG_PHY_Out_Synch_rx (int UE_Id);
-void rrc_RG_PHY_Connection_Loss_rx (int UE_Id);
-void rrc_RG_PHY_Setup_rx (int UE_Id);
-void rrc_RG_PHY_Modify_rx (int UE_Id);
-void rrc_RG_RLC_Status_rx (int UE_Id);
-void rrc_RG_RLC_Data_Confirm_rx (int UE_Id);
-void rrc_RG_RLC_Data_failure_rx (int UE_Id);
-void rrc_RG_Configuration_rx (void);
-void rrc_RG_Config_failure_rx (void);
-#endif
-
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-int rrc_ue_get_initial_id (void);
-void RRC_UE_O_O_SEND_DCCH_AM (int msgId);
-void RRC_UE_O_O_SEND_DCCH_UM (int msgId);
-
-/* External FUNCTIONS Definition*/
-// For Connection Model
-extern void     RRC_UE_I_I_WaitTimerExpired (void);
-extern void     RRC_UE_I_I_T308_TimeOut (void);
-extern void     RRC_UE_I_I_T300_TimeOut (void);
-extern void     RRC_UE_I_I_Go_CELL_FACH (void);
-extern void     RRC_UE_I_I_Go_CELL_DCH (void);
-extern void     RRC_UE_I_I_NAS_CONN_ESTABLISHMENT_REQ (void);
-extern void     RRC_UE_I_I_NAS_CONN_RELEASE_REQ (void);
-extern void     RRC_UE_I_I_RRC_CONNECTION_RELEASE (void);
-extern void     RRC_UE_I_I_RRC_CONNECTION_REJECT (void);
-extern void     RRC_UE_I_I_RRC_CONNECTION_SETUP (void);
-extern void     RRC_UE_I_I_RLC_Success (void);
-extern void     RRC_UE_I_I_RLC_Failure (void);
-extern void     RRC_UE_I_I_CPHY_SYNCH_IND (void);
-extern void     RRC_UE_I_I_CPHY_SYNCH_Failure (void);
-extern void     RRC_UE_I_I_CPHY_CONNECTION_LOSS (void);
-extern void     RRC_UE_I_I_rcved_on_CCCH (void);
-extern void     RRC_UE_I_I_rcved_on_DCCH (void);
-extern void     RRC_UE_I_I_Wait_Time (int);
-extern void     RRC_UE_I_I_IE_Freq_Info (void);
-extern void     RRC_UE_I_I_IE_RRC_State (int);
-extern void     RRC_UE_I_UE_ID_INIT (int);
-extern void     RRC_UE_I_UE_ID_MSG (int);
-extern void     RRC_UE_reset (void);
-extern void     RRC_UE (void);
-
-// For RB Control Model
-extern void     RRC_RB_UE_I_I_RADIO_BEARER_SETUP (void);
-extern void     RRC_RB_UE_I_I_RADIO_BEARER_RELEASE (void);
-extern void     RRC_RB_UE_I_I_CELL_UPDATE_CONFIRM (void);
-extern void     RRC_RB_UE_I_I_Prot_Error (int error);
-extern void     RRC_RB_UE_I_I_CPHY_SYNCH_IND (void);
-extern void     RRC_RB_UE_I_I_CPHY_SYNCH_Failure (void);
-extern void     RRC_RB_UE_I_I_CPHY_OUT_OF_SYNCH (void);
-extern void     RRC_RB_UE_I_I_CRLC_STATUS (void);
-extern void     RRC_RB_UE_I_I_RLC_Success (void);
-extern void     RRC_RB_UE_I_I_Go_Idle (void);
-extern void     RRC_RB_UE_I_I_Go_CELL_DCH (void);
-extern void     RRC_RB_UE_I_I_Go_CELL_FACH (void);
-extern void     RRC_RB_UE_I_I_Go_CELL_PCH (void);
-extern void     RRC_RB_UE_I_I_Radio_Bearer_ID (int rb_id);
-extern void     RRC_RB_UE_I_I_IE_RRC_State (int next_state);
-extern void     RRC_RB_UE_reset (void);
-extern void     RRC_RB_UE (void);
-
-/* Input trigger functions - Defined in rrc_ue_data.c */
-void  rrc_ue_fsm_init (int Id);
-void  rrc_NAS_Conn_Est_Req_Rx (void);
-void  rrc_NAS_Conn_Release_Req_Rx (void);
-void  rrc_RRC_Conn_Setup_rx (int Id, int State);
-void  rrc_RRC_Conn_Reject_rx (int Id, int WaitTime);
-void  rrc_RRC_Conn_Reject_Freq_rx (int Id, int WaitTime);
-void  rrc_RRC_Conn_Release_DCCH_rx (void);
-void  rrc_RRC_Conn_Release_CCCH_rx (void);
-void  PHY_Setup_rx (void);
-void  PHY_Synch_Failure_rx (void);
-void  PHY_Connection_Loss_rx (void);
-void  RLC_Data_Confirm_rx (void);
-void  RLC_failure_rx (void);
-void  TIMER_T300_Timeout (void);
-void  TIMER_T308_Timeout (void);
-void  Wait_Timer_Timeout (void);
-
-/* Input trigger functions - Defined in rrc_rb_ue_data.c */
-void  rrc_rb_ue_init (void);
-void  rrc_rb_ue_new_state (int newState);
-void  rrc_rb_ue_RB_Setup_rx (int rb_id, int next_state, int prot_error);
-void  rrc_rb_ue_RB_Release_rx (int rb_id, int next_state, int prot_error);
-void  rrc_rb_ue_Cell_Update_cnf_rx (void);
-void  rrc_rb_ue_PHY_Setup_rx (void);
-void  rrc_rb_ue_CPHY_Synch_Failure_rx (void);
-void  rrc_rb_ue_CPHY_Out_of_Synch_rx (void);
-void  rrc_rb_ue_CRLC_Status_rx (void);
-void  rrc_rb_ue_RLC_Data_Confirm_rx (void);
-#endif
-
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_proto_int.h b/openair2/RRC/CELLULAR/rrc_proto_int.h
deleted file mode 100755
index 51b8f7b657..0000000000
--- a/openair2/RRC/CELLULAR/rrc_proto_int.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/***************************************************************************
-                          rrc_proto_int.h  -  description
-                             -------------------
-    begin                : Wed Aug 1 2001
-    copyright            : (C) 2001, 2010 by Eurecom
-    email                : Lionel.Gauthier@eurecom.fr
- ***************************************************************************/
-#ifndef __RRC_PROTO_INT_H__
-#define __RRC_PROTO_INT_H__
-
-/**************************************************************/
-#ifdef NODE_RG
-// #include "protocol_pool_bs.h"
-// extern void protocol_pool_bs_init (struct protocol_pool_bs *protP);
-// extern void *rrc_init_bs (void *arg);
-extern void rrc_rg_rxtx (void);
-extern void rrc_rg_nas_xmit_enqueue (mem_block_t * p);
-extern int  rrc_rg_read_DCin_FIFO (int UE_Id, u8 *buffer, int count);
-extern int  rrc_rg_read_GC_FIFO (u8 *buffer, int count);
-extern int  rrc_rg_read_NT_FIFO (u8 *buffer, int count);
-//extern void rrc_rg_srb0_decode (mem_block_t * sduP, int length);
-extern void rrc_rg_srb0_decode (char * sduP, int length);
-extern void rrc_rg_srb1_decode (int UE_Id, char * sduP, int length);
-extern void rrc_rg_srb2_decode (int UE_Id, char * sduP, int length);
-extern void rrc_rg_srb3_decode (int UE_Id, char * sduP, int length);
-extern void RRC_RG_O_NAS_DATA_IND (int UE_Id);
-void RRC_RG_O_O_SEND_DCCH_AM (int msgId);
-extern void RRC_RG_SEND_AM_SRB3 (int msgId);
-int rrc_rg_send_to_srb_rlc (int UE_id, int rb_id, char * data_buffer, int data_length);
-extern void rrc_rg_L1_check (void);
-// extern int  rrc_rg_compute_configuration (int UE_Id, u8 action);
-extern void rrc_process_sib18 (void);
-// void rrc_rg_print_meas_bs_control (struct rrc_rg_bs_meas_cmd *p);
-void rrc_rg_print_meas_report (struct rrc_rg_mt_meas_rep *p);
-void rrc_rg_print_bs_meas_report (struct rrc_rg_bs_meas_rep *p);
-void rrc_rg_send_bs_meas_report (int index);
-void rrc_rg_sync_measures (int time);
-void rrc_rg_fwd_meas_report (int UE_Id);
-void rrc_rg_temp_checkConnection(int UE_Id);
-
-// rrc_rg_nas_intf.c
-void rrc_rg_write_FIFO (mem_block_t *p);
-void rrc_rg_sap_init (void);
-#endif
-/**************************************************************/
-#ifdef NODE_MT
-// #include "protocol_pool_ms.h"
-// #include "rrm_config_structs.h"
-// extern void protocol_pool_ms_init (struct protocol_pool_ms *protP);
-// extern void *rrc_init_ms (void *arg);
-// void rrc_ue_write_FIFO (mem_block_t * p);
-extern void rrc_ue_rxtx (void);
-extern void rrc_ue_nas_xmit_enqueue (mem_block_t * p);
-extern void rrc_ue_broadcast_encode_nas_sib1 (void);
-extern void rrc_ue_broadcast_encode_nas_sib18 (void);
-extern void rrc_ue_read_neighboring_cells_info (void);
-//extern int  rrc_ue_read_DCin_FIFO (void);
-extern void rrc_ue_read_DCin_FIFO (struct nas_ue_dc_element *p, int count);
-extern void rrc_ue_t300_timeout (void);
-//extern void rrc_ue_srb0_decode (u8 * dataP, u16 length);
-//       void rrc_ue_srb0_decode (mem_block_t * sduP, int length);
-extern void rrc_ue_srb0_decode (char * sduP, int length);
-extern void rrc_ue_srb1_decode (char * sduP, int length);
-extern void rrc_ue_srb2_decode (char * sduP, int length);
-extern void rrc_ue_srb3_decode (char * sduP, int length);
-extern void RRC_UE_O_NAS_NOTIFICATION_IND (void);
-extern void RRC_UE_O_NAS_DATA_IND (void);
-extern void RRC_UE_O_NAS_MEASUREMENT_IND (void);
-extern void RRC_UE_SEND_AM_SRB3 (int msgId);
-
-// L2 Frontend
-int rrc_ue_send_to_srb_rlc (int rb_id, char * data_buffer, int data_length);
-
-//rrc_ue_control.c
-void rrc_ue_L1_check (void);
-void rrc_ue_print_meas_control (struct rrc_ue_meas_cmd *p);
-void rrc_ue_sync_measures (int time, int *message_id);
-void rrc_ue_trigger_measure (void);
-
-// rrc_ue_nas_intf.c
-void rrc_ue_write_FIFO (mem_block_t *p);
-#ifdef RRC_NETLINK
-#else
-void rrc_ue_sap_init (void);
-#endif
-
-#endif
-/**************************************************************/
-
-// all nodes
-void rrc_create_fifo (char *rrc_fifo);
-
-void rrc_print_buffer (char *buffer, int length);
-void rrc_compress_buffer (char *src_buffer, int src_length, char *dest_buffer, int *dest_length);
-void rrc_uncompress_buffer (char *src_buffer, int src_length, char *dest_buffer, int *dest_length);
-void rrc_compress_config (MT_CONFIG * config, char *dest_buffer, int *dest_length);
-void rrc_uncompress_config (MT_CONFIG * config, char *source_buffer);
-
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_proto_intf.h b/openair2/RRC/CELLULAR/rrc_proto_intf.h
deleted file mode 100755
index b4472e03be..0000000000
--- a/openair2/RRC/CELLULAR/rrc_proto_intf.h
+++ /dev/null
@@ -1,185 +0,0 @@
-/***************************************************************************
-                          rrc_proto_intf.h  -  description
-                             -------------------
-    begin                : Jan 17, 2002
-    copyright            : (C) 2001, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Prototypes for functions related to interfaces
- ***************************************************************************/
-#ifndef __RRC_PROTO_INTF_H__
-#define __RRC_PROTO_INTF_H__
-
-//PHY
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-// functions in L1C/L1C_rrc_control.c
-int  rrc_ue_DL_CPHY_TrCH_config_req (int ccTrCh, int activationTime);
-int  rrc_ue_UL_CPHY_TrCH_config_req (int ccTrCh, int activationTime);
-
-int  rrc_ue_CPHY_TrCH_release_req (int configId);
-int  rrc_ue_CPHY_OutOfSync_Config_req (int configId);        // ???
-void rrc_ue_CPHY_Measurement_req (int power_threshold, int meas_type);
-// functions in AS/L3/RRC/rrc_L1_control.c
-void rrc_ue_CPHY_Synch_rx (int CCTrCH);
-void rrc_ue_CPHY_Out_Synch_rx (int CCTrCH);
-// removed 25/11 MW
-// void rrc_ue_CPHY_Measurement_rx (struct Measurements results);
-void rrc_ue_CPHY_Measurement_rx (void);
-#endif
-#ifdef NODE_RG
-// functions in L1C/L1C_rrc_control.c
-int  rrc_rg_CPHY_TrCH_config_req (int configId, int activationTime);
-int  rrc_rg_CPHY_TrCH_release_req (int configId);
-int  rrc_rg_CPHY_OutOfSync_Config_req (int configId);        // ???
-void rrc_rg_CPHY_Measurement_req (int power_threshold, int meas_type);
-// functions in AS/L3/RRC/rrc_L1_control.c
-void rrc_rg_CPHY_Synch_rx (int CCTrCH);
-void rrc_rg_CPHY_Out_Synch_rx (int CCTrCH);
-// removed 25/11 MW
-// void rrc_rg_CPHY_Measurement_rx (struct Measurements results);
-void rrc_rg_CPHY_Measurement_rx (void);
-#endif
-
-//MAC
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-void rrc_ue_connection_mac_setup (void);
-void rrc_ue_connection_mac_release (void);
-void mac_remove_all (void);
-void cmac_fach_rach_setup (void);
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_RG
-void rrc_rg_connection_mac_setup (void);
-void rrc_rg_connection_mac_release (int userP);
-#endif
-
-//RB
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-void rrc_ue_connection_srb_setup (void);
-void rrc_ue_connection_srb_release (void);
-void rrc_ue_connection_rb_setup (void);
-void rrc_ue_connection_rb_release (void);
-void rb_remove_all (void);
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_RG
-void rrc_rg_connection_srb_setup (void);
-void rrc_rg_connection_srb_release (int userP);
-void rrc_rg_connection_rb_setup (void);
-void rrc_rg_connection_rb_release (int userP);
-#endif
-
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-void CPHY_release_UE_resources (void);
-void CPHY_config_fach_rach (void);
-#endif
-
-//OAI - rrc__L2_frontend.c
-//-----------------------------------------------------------------------------
-#ifdef NODE_MT
-void rrc_ue_L2_setupFachRach(void);
-void rrc_ue_config_common_channels (void);
-void rrc_ue_xmit_ccch (void);
-void rrc_ue_config_LTE_srb1 (void);
-void rrc_ue_config_LTE_srb2 (void);
-void rrc_ue_config_common_channels_SIB2 (void);
-void rrc_ue_config_LTE_default_drb (unsigned char Mod_id);
-#endif
-//-----------------------------------------------------------------------------
-#ifdef NODE_RG
-void rrc_rg_get_common_config_SIB (int *config_length, char**config_ptr);
-void rrc_rg_init_mac (unsigned char Mod_id);
-void rrc_rg_config_LTE_srb1 (unsigned char Mod_id);
-void rrc_rg_rcve_ccch(u8 Mod_id, char *Sdu, u16 Sdu_len);
-void rrc_rg_config_LTE_srb2 (unsigned char Mod_id);
-void rrc_rg_config_LTE_default_drb (unsigned char Mod_id);
-int rrc_rg_ENbMeas_get_rlcBufferOccupancy(int UE_id);
-int rrc_rg_ENbMeas_get_scheduledPRB(int UE_id);
-int rrc_rg_ENbMeas_get_totalDataVolume(int UE_id);
-int rrc_rg_ENbMeas_get_totalNumPRBs(void);
-
-#endif
-//-----------------------------------------------------------------------------
-void wcdma_handle_error (int errorP);
-
-//CONFIG
-void crb_config_req (int activation_timeP);
-void cmac_config_req (int userP, int activation_timeP);
-void CPHY_config_req (void *config, int activation_time, int userP);
-
-//SRB
-//-----------------------------------------------------------------------------
-#ifdef NODE_RG
-extern void *rrc_rg_srb0_rx (void *unusedP, mem_block_t * sduP);
-extern void  rrc_rg_mcch_tx (u8 * dataP, u16 lengthP);
-extern int rrc_rg_srb_rx (char* sduP, int srb_id,  int UE_Id);
-#endif
-
-#ifdef NODE_MT
-extern void *rrc_ue_ccch_rx_idle_mode (void *unusedP, struct mac_data_ind data_indicationP);
-extern void *rrc_mt_ccch_rx_idle_mode (void *unusedP, mem_block_t * data_indicationP, int rb_idP);
-//extern void *rrc_mt_mcch_rx  (void *unusedP, mem_block_t * data_indicationP, int rb_idP);
-
-#endif
-extern void *rrc_srb_rx (void *unusedP, mem_block_t * sduP, u8 rb_idP);
-extern void *rrc_srb_confirm (u32 muiP, u8 rb_idP, u8 statusP);
-
-//RRM
-//-----------------------------------------------------------------------------
-#ifdef NODE_RG
-// function  in AS/L3/RRM
-//void rrm_config_change_request (struct rrc_rrm_request config_request);
-
-// function  in AS/L3/RRC
-void rrc_config_indication (int transaction_Id, int return_code);
-
-// function  in AS/L3/RRM
-// void rrc_rrm_measure_request (struct rrc_rrm_measure_ctl rrm_control);
-
-// Measure report
-// from Mobile Terminal
-// void rrm_meas_report_mt_if (struct rrc_rrm_meas_report_mt_if *pmeas);
-// void rrm_meas_report_mt_tv (struct rrc_rrm_meas_report_mt_tv *pmeas);
-// void rrm_meas_report_mt_q (struct rrc_rrm_meas_report_mt_q *pmeas);
-// void rrm_meas_report_mt_int (struct rrc_rrm_meas_report_mt_int *pmeas);
-
-// from Base station
-// void rrm_meas_report_bs_tv (struct rrc_rrm_meas_report_bs_tv *pmeas);
-// void rrm_meas_report_bs_q (struct rrc_rrm_meas_report_bs_q *pmeas);
-// void rrm_meas_report_bs_int (struct rrc_rrm_meas_report_bs_int *pmeas);
-
-// in rrc rrm intf
-void rrm_add_user_confirm (int ue_idP);
-void rrm_add_radio_access_bearer_confirm (int ue_idP, int rb_idP);
-int  rrm_get_ue_cctrch_index_ul (int mobileIdP, int rabP);
-
-void RRC_RG_O_O_NAS_RB_Failure (int UE_Id);
-
-#endif
-
-//ASN1 messages
-/*uint8_t do_RRCConnectionSetup(uint8_t *buffer,
-            uint8_t transmission_mode,
-            uint8_t UE_id,
-            uint8_t Transaction_id,
-            LTE_DL_FRAME_PARMS *frame_parms,
-            struct SRB_ToAddMod **SRB1_config,
-            struct SRB_ToAddMod **SRB2_config,
-            struct PhysicalConfigDedicated  **physicalConfigDedicated);*/
-//uint8_t do_SIB2_cell(uint8_t Mod_id, uint8_t *buffer, SystemInformation_t *systemInformation, SystemInformationBlockType2_t **sib2);
-uint8_t do_SIB2_cell(uint8_t Mod_id, LTE_DL_FRAME_PARMS *frame_parms, uint8_t *buffer,
-                     BCCH_DL_SCH_Message_t *bcch_message, SystemInformationBlockType2_t **sib2);
-
-uint8_t do_SIB1_TDD_config_cell (LTE_DL_FRAME_PARMS *frame_parms,TDD_Config_t *tdd_Config);
-uint8_t do_RRCConnReconf_defaultCELL(uint8_t Mod_id, uint8_t *buffer, uint8_t UE_id, uint8_t Transaction_id,
-                                     struct SRB_ToAddMod **SRB2_config,
-                                     struct DRB_ToAddMod **DRB_config,
-                                     struct PhysicalConfigDedicated  **physicalConfigDedicated) ;
-//
-
-#endif
-
diff --git a/openair2/RRC/CELLULAR/rrc_proto_mbms.h b/openair2/RRC/CELLULAR/rrc_proto_mbms.h
deleted file mode 100755
index f35886a09b..0000000000
--- a/openair2/RRC/CELLULAR/rrc_proto_mbms.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/***************************************************************************
-                          rrc_proto_mbms.h - description
-                          -------------------
-    begin               : Jun 9, 2005
-    copyright           : (C) 2005, 2010 by Eurecom
-    created by          : Huu-Nghia.Nguyen@eurecom.fr
-    modified by         : Michelle.Wetterwald@eurecom.fr
-    description         : This file defines all the MBMS functions
-    which are accessible from outside
- **************************************************************************/
-#ifndef _RRC_PROTO_MBMS_H_
-#define _RRC_PROTO_MBMS_H_
-
-//rrc_mbms_pdus.c
-#ifdef NODE_RG
-int rrc_PEREnc_MBMSAccessInformation (MBMSAccessInformation * pvalue);
-int rrc_PEREnc_MBMSCommonPTMRBInformation (MBMSCommonPTMRBInformation * pvalue);
-int rrc_PEREnc_MBMSCurrentCellPTMRBInformation (MBMSCurrentCellPTMRBInformation * pvalue);
-int rrc_PEREnc_MBMSGeneralInformation (MBMSGeneralInformation * pvalue);
-int rrc_PEREnc_MBMSModifiedServicesInformation (MBMSModifiedServicesInformation * pvalue);
-int rrc_PEREnc_MBMSNeighbouringCellPTMRBInformation (int cellIndex, MBMSNeighbouringCellPTMRBInformation * pvalue);
-int rrc_PEREnc_MBMSSchedulingInformation (MBMSSchedulingInformation * pvalue);
-int rrc_PEREnc_MBMSUnmodifiedServicesInformation (MBMSUnmodifiedServicesInformation * pvalue);
-#endif
-#ifdef NODE_MT
-int rrc_PERDec_MBMSAccessInformation (MBMSAccessInformation * pvalue);
-int rrc_PERDec_MBMSCommonPTMRBInformation (MBMSCommonPTMRBInformation * pvalue);
-int rrc_PERDec_MBMSCurrentCellPTMRBInformation (MBMSCurrentCellPTMRBInformation * pvalue);
-int rrc_PERDec_MBMSGeneralInformation (MBMSGeneralInformation * pvalue);
-int rrc_PERDec_MBMSModifiedServicesInformation (MBMSModifiedServicesInformation * pvalue);
-int rrc_PERDec_MBMSNeighbouringCellPTMRBInformation (int *pCellIndex, MBMSNeighbouringCellPTMRBInformation * pvalue);
-int rrc_PERDec_MBMSSchedulingInformation (MBMSSchedulingInformation * pvalue);
-int rrc_PERDec_MBMSUnmodifiedServicesInformation (MBMSUnmodifiedServicesInformation * pvalue);
-#endif
-
-#ifdef NODE_MT
-//rrc_ue_mbms_decode.c
-//void rrc_ue_mcch_decode (mem_block_t * sduP, u16 length);
-void rrc_ue_mcch_decode (char * sduP, int offset);
-int rrc_ue_mbms_MCCH_decode(MCCH_Message *mcch_msg);
-int rrc_ue_mbms_DCCH_decode(DL_DCCH_Message *dl_dcch_msg);
-int rrc_ue_mbms_MSCH_decode(MSCH_Message *msch_msg);
-
-//rrc_ue_mbms_fsm.c
-void RRC_UE_MBMS_I_CONTROLING_CELL_CHANGED(void);
-void RRC_UE_MBMS_I_RETURN_FROM_LOSS_COVERAGE(void);
-void RRC_UE_MBMS_I_ACTIVATED_SERVICE_CHANGED(void);
-void RRC_UE_MBMS_I_SELECTING_CELL_MBMS(void);
-void RRC_UE_MBMS_I_MODIF_SERV_INFO(void);
-void RRC_UE_MBMS_I_MCCH_MODIF_SERV_INFO(void);
-void RRC_UE_MBMS_I_ALL_UNMODIF_PTM_SERVICES(void);
-void RRC_UE_MBMS_I_UNMODIF_SERV_INFO(void);
-void RRC_UE_MBMS_I_COMMON_CELL_RB_INFO(void);
-void RRC_UE_MBMS_I_CURRENT_CELL_RB_INFO(void);
-void RRC_UE_MBMS_I_NEIGHBOURING_CELL_RB_INFO(void);
-void RRC_UE_MBMS_I_MODIF_PERIOD_ENDED(void);
-void rrc_ue_mbms_fsm(void);
-void rrc_ue_mbms_fsm_reset(void);
-
-//rrc_ue_mbms_if.c
-extern rrc_ue_mbms_variables * volatile p_ue_mbms; //pointer refer to protocol_ms->rrc.mbms
-void rrc_ue_mbms_init(void);
-void rrc_ue_mbms_scheduling_check(void);
-
-//rrc_ue_mbms_outputs.c
-void RRC_UE_MBMS_O_NAS_MBMS_UE_NOTIFY_IND(void);
-void RRC_UE_MBMS_O_ANALYSE_UNMODIF(void);
-void RRC_UE_MBMS_O_CURRENT_CELL_RB_CONFIGURATION(void);
-void RRC_UE_MBMS_O_NEIGHBOURING_CELL_RB_CONFIGURATION(void);
-void RRC_UE_MBMS_O_MCCH_NOTIFICATION(void);
-void RRC_UE_MBMS_O_DCCH_NOTIFICATION(void);
-
-//rrc_ue_mbms_test_simu.c
-void rrc_ue_mbms_destroy(void);
-void rx_simulate(int chanelID);
-void rrc_ue_mbms_run(void);
-mbms_bool rrc_ue_mbms_MCCH_rx(void);
-mbms_bool rrc_ue_mbms_DCCH_rx(void);
-mbms_bool rrc_ue_mbms_MSCH_rx(void);
-
-#endif
-
-#ifdef NODE_RG
-//rrc_rg_mbms_encode.c
-void rrc_rg_mbms_MCCH_encode(int Message_Type);
-void rrc_rg_mbms_DCCH_encode(int Message_Type);
-void rrc_rg_mbms_MSCH_encode(int Message_Type);
-
-//rrc_rg_mbms_if.c
-extern rrc_rg_mbms_variables * volatile p_rg_mbms; // pointer refer to protocol_bs->rrc.mbms
-void rrc_rg_mbms_init(void);
-void rrc_rg_mbms_scheduling_check(void);
-void rrc_rg_mbms_end_modification_period_check(void);
-void rrc_rg_mbms_MCCH_tx(void);
-void rrc_rg_mbms_DCCH_tx(int ueID);
-void rrc_rg_mbms_MSCH_tx(void);
-void rrc_mbms_tx(void);
-
-//rrc_rg_mbms_nas_if.c
-mbms_bool rrc_rg_mbms_checkAcquireRBInfo(void);
-mbms_bool rrc_rg_mbms_addUnmodifService(int index, o3 serviceID, u8 umod_requiredAction);
-mbms_bool rrc_rg_mbms_deleteUnmodifService(int index);
-mbms_bool rrc_rg_mbms_addModifService(int index, o3 serviceID, u8 umod_requiredAction);
-mbms_bool rrc_rg_mbms_deleteModifService(int index);
-void rrc_rg_mbms_NAS_ServStart_rx(void);
-void rrc_rg_mbms_NAS_ServStop_rx(void);
-void rrc_rg_mbms_NAS_Notification_rx(void);
-
-//rrc_rg_mbms_outputs.c
-//void rrc_rg_mbms_config_indication (int transaction_Id, int return_code);
-void RRC_RG_MBMS_O_UE_NOTIFY_CNF(void);
-void RRC_RG_MBMS_O_GET_RB_INFORMATION(int action);
-void RRC_RG_MBMS_O_L12_CONFIGURE(void);
-void RRC_RG_MBMS_O_SEND_DCCH_UM(int ueID, char* pmsg, int msglen);
-void RRC_RG_MBMS_O_SEND_MCCH(char* pmsg, int msglen);
-void RRC_RG_MBMS_O_SEND_MSCH(char* pmsg, int msglen);
-void RRC_RG_O_O_NAS_MBMS_RB_ESTAB_CNF (void);
-
-//rrc_rg_mbms_test_simu.c
-void rrc_rg_mbms_destroy(void);
-void rrc_rg_mbms_run(void);
-void tx_simulate(int chanelID, char* pmsg, int msglen);
-void rrc_rg_mbms_scenario_check(void); //create the NAS scenario
-#endif
-
-//rrc_mbms_utilities.c
-#ifdef NODE_MT
-void rrc_ue_mbms_modif_services_print(void);
-void rrc_ue_mbms_status_services_print(void);
-#endif
-
-#ifdef NODE_RG
-void rrc_rg_mbms_modif_services_print(void);
-void rrc_rg_mbms_unmodif_services_print(void);
-void rrc_rg_mbms_message_update(rrc_rg_mbms_msg_buf * ptrMsgInfo);
-void rrc_rg_mbms_message_reset(rrc_rg_mbms_msg_buf * ptrMsgInfo);
-void rrc_rg_mbms_processJoinedServices(void);
-void rrc_rg_mbms_processLeftServices(void);
-#endif
-
-void rrc_mbms_mcch_message_name_print(int mcchMsgType);
-int  rrc_mbms_service_id_find(u8 numService, void * services, int serviceID);
-
-//rrc_mbms_test.c
-#ifdef MBMS_TEST_MODE
-extern u8 * chanel_data_tampon[3];
-extern int * chanel_data_length;
-//extern int frame;
-#endif
-
-#endif //_RRC_MBMS_PROTO_H_
diff --git a/openair2/RRC/CELLULAR/rrc_proto_msg.h b/openair2/RRC/CELLULAR/rrc_proto_msg.h
deleted file mode 100755
index 84ac78309b..0000000000
--- a/openair2/RRC/CELLULAR/rrc_proto_msg.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/***************************************************************************
-                          rrc_proto_msg.h  -  description
-                             -------------------
-    begin                : Jan 6, 2003
-    copyright            : (C) 2003, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- ***************************************************************************/
-#ifndef __RRC_PROTO_MSG_H__
-#define __RRC_PROTO_MSG_H__
-#ifdef NODE_MT
-// UL
-void  rrc_ue_msg_connreq (int *Message_Id);
-void  rrc_ue_msg_connsucompl (int *Message_Id);
-void  rrc_ue_msg_cellUpdate (int *Message_Id);
-void  rrc_ue_msg_connrelUL (int *Message_Id);
-void  rrc_ue_msg_initXfer (int *Message_Id);
-void  rrc_ue_msg_ulXfer (int *Message_Id);
-void  rrc_ue_msg_rbsetupcompl (int *Message_Id);
-void  rrc_ue_msg_rbsetupfail (int *Message_Id);
-void  rrc_ue_msg_rbreleasecompl (int *Message_Id);
-void  rrc_ue_msg_rbreleasefail (int *Message_Id);
-void  rrc_ue_msg_measrep (int *Message_Id);
-void  rrc_ue_msg_ueCapInfo(int *Message_Id);
-// DL
-int  rrc_ue_msg_connsetup (DL_CCCH_Message * dl_ccch_msg);
-int  rrc_ue_msg_connreject (DL_CCCH_Message * dl_ccch_msg);
-int  rrc_ue_msg_cellupdatecnfccch (DL_CCCH_Message * dl_ccch_msg);
-int  rrc_ue_msg_rbsetup (DL_DCCH_Message * dl_dcch_msg);
-int  rrc_ue_msg_rbrelease (DL_DCCH_Message * dl_dcch_msg);
-int  rrc_ue_msg_dlXfer (DL_DCCH_Message * dl_dcch_msg);
-int  rrc_ue_msg_pagingt2 (DL_DCCH_Message * dl_dcch_msg);
-int  rrc_ue_msg_measctl (DL_DCCH_Message * dl_dcch_msg);
-int  rrc_ue_msg_ULPCHctl (DL_DCCH_Message * dl_dcch_msg);
-int  rrc_ue_msg_ueCapInfoCnf(DL_DCCH_Message * dl_dcch_msg);
-#endif
-
-#ifdef NODE_RG
-// UL
-int  rrc_rg_msg_connreq (int *pUE, UL_CCCH_Message * ul_ccch_msg);
-int  rrc_rg_msg_cellUpdate (int *pUE, UL_CCCH_Message * ul_ccch_msg);
-int  rrc_rg_msg_connsucompl (int UE_Id, UL_DCCH_Message * ul_dcch_msg);
-int  rrc_rg_msg_connrelUL (int UE_Id, UL_DCCH_Message * ul_dcch_msg);
-int  rrc_rg_msg_initXfer (int UE_Id, UL_DCCH_Message * ul_dcch_msg);
-int  rrc_rg_msg_ulXfer (int UE_Id, UL_DCCH_Message * ul_dcch_msg);
-int  rrc_rg_msg_rbsetupcompl (int UE_Id, UL_DCCH_Message * ul_dcch_msg);
-int  rrc_rg_msg_rbsetupfail (int UE_Id, UL_DCCH_Message * ul_dcch_msg);
-int  rrc_rg_msg_rbreleasecompl (int UE_Id, UL_DCCH_Message * ul_dcch_msg);
-int  rrc_rg_msg_rbreleasefail (int UE_Id, UL_DCCH_Message * ul_dcch_msg);
-int  rrc_rg_msg_measrepr (int UE_Id, UL_DCCH_Message * ul_dcch_msg);
-int  rrc_rg_msg_ueCapInfo(int UE_Id ,UL_DCCH_Message * ul_dcch_msg);
-// DL
-void  rrc_rg_msg_connsetup (int UE_Id, int *Message_Id);
-void  rrc_rg_msg_connreject (int UE_Id, int *Message_Id);
-void  rrc_rg_msg_cellupdatecnfccch (int UE_Id, int *Message_Id);
-void  rrc_rg_msg_rbsetup (int UE_Id, int *Message_Id);
-void  rrc_rg_msg_rbrelease (int UE_Id, int *Message_Id);
-void  rrc_rg_msg_dlXfer (int UE_Id, int *Message_Id);
-void  rrc_rg_msg_pagingt2 (int UE_Id, int *Message_Id);
-void  rrc_rg_msg_measctl (int UE_Id, int *Message_Id);
-void  rrc_rg_msg_ULPCHctl (int UE_Id, int *Message_Id);
-void  rrc_rg_msg_ueCapInfoCnf(int UE_Id, int *Message_Id);
-#endif
-
-int  rrc_PEREnc_IntegrityCheckInfo (IntegrityCheckInfo value);
-int  rrc_PERDec_IntegrityCheckInfo (IntegrityCheckInfo * pvalue);
-
-/**************************************************************/
-int  rrc_PEREnc_RRCConnectionRequest (RRCConnectionRequest * pvalue);
-int  rrc_PERDec_RRCConnectionRequest (int UE_Id, RRCConnectionRequest * pvalue);
-
-int  rrc_PEREnc_RRCConnectionSetup (int UE_Id, RRCConnectionSetup * pvalue);
-int  rrc_PERDec_RRCConnectionSetup (RRCConnectionSetup * pvalue);
-
-int  rrc_PEREnc_RRCConnectionSetupComplete (RRCConnectionSetupComplete * pvalue);
-int  rrc_PERDec_RRCConnectionSetupComplete (int UE_Id, RRCConnectionSetupComplete * pvalue);
-
-int  rrc_PEREnc_RRCConnectionReject (int UE_Id, RRCConnectionReject * pvalue);
-int  rrc_PERDec_RRCConnectionReject (RRCConnectionReject * pvalue);
-
-int  rrc_PEREnc_RRCConnectionRelease_UL (RRCConnectionRelease_UL * pvalue);
-int  rrc_PERDec_RRCConnectionRelease_UL (int UE_Id, RRCConnectionRelease_UL * pvalue);
-
-int  rrc_PEREnc_InitialDirectTransfer (InitialDirectTransfer * pvalue);
-int  rrc_PERDec_InitialDirectTransfer (int UE_Id, InitialDirectTransfer * pvalue);
-
-int  rrc_PEREnc_UplinkDirectTransfer (UplinkDirectTransfer * pvalue);
-int  rrc_PERDec_UplinkDirectTransfer (int UE_Id, UplinkDirectTransfer * pvalue);
-
-int  rrc_PEREnc_DownlinkDirectTransfer (int UE_Id, DownlinkDirectTransfer * pvalue);
-int  rrc_PERDec_DownlinkDirectTransfer (DownlinkDirectTransfer * pvalue);
-
-int  rrc_PEREnc_RadioBearerSetup (int UE_Id, RadioBearerSetup * pvalue);
-int  rrc_PERDec_RadioBearerSetup (RadioBearerSetup * pvalue);
-
-int  rrc_PEREnc_RadioBearerRelease (int UE_Id, RadioBearerRelease * pvalue);
-int  rrc_PERDec_RadioBearerRelease (RadioBearerRelease * pvalue);
-
-int  rrc_PEREnc_RadioBearerSetupComplete (RadioBearerSetupComplete * pvalue);
-int  rrc_PERDec_RadioBearerSetupComplete (int UE_Id, RadioBearerSetupComplete * pvalue);
-
-int  rrc_PEREnc_RadioBearerSetupFailure (RadioBearerSetupFailure * pvalue);
-int  rrc_PERDec_RadioBearerSetupFailure (int UE_Id, RadioBearerSetupFailure * pvalue);
-
-int  rrc_PEREnc_RadioBearerReleaseComplete (RadioBearerReleaseComplete * pvalue);
-int  rrc_PERDec_RadioBearerReleaseComplete (int UE_Id, RadioBearerReleaseComplete * pvalue);
-
-int  rrc_PEREnc_RadioBearerReleaseFailure (RadioBearerReleaseFailure * pvalue);
-int  rrc_PERDec_RadioBearerReleaseFailure (int UE_Id, RadioBearerReleaseFailure * pvalue);
-
-int  rrc_PEREnc_CellUpdate (CellUpdate * pvalue);
-int  rrc_PERDec_CellUpdate (int *pUE_Id, CellUpdate * pvalue);
-
-int  rrc_PEREnc_CellUpdateConfirm_CCCH (int UE_Id, CellUpdateConfirm_CCCH * pvalue);
-int  rrc_PERDec_CellUpdateConfirm_CCCH (CellUpdateConfirm_CCCH * pvalue);
-
-int  rrc_PEREnc_PagingType2 (int UE_Id, PagingType2 * pvalue);
-int  rrc_PERDec_PagingType2 (PagingType2 * pvalue);
-
-int  rrc_PEREnc_MeasurementControl (int UE_Id, MeasurementControl * pvalue);
-int  rrc_PERDec_MeasurementControl (MeasurementControl * pvalue);
-
-int  rrc_PEREnc_MeasurementReport (MeasurementReport * pvalue);
-int  rrc_PERDec_MeasurementReport (int UE_Id, MeasurementReport * pvalue);
-
-int  rrc_PEREnc_UECapabilityInformation (UECapabilityInformation* pvalue);
-int  rrc_PERDec_UECapabilityInformation (int UE_Id, UECapabilityInformation* pvalue);
-
-int  rrc_PEREnc_UECapabilityInformationConfirm(int UE_Id, UECapabilityInformationConfirm * pvalue);
-int  rrc_PERDec_UECapabilityInformationConfirm(UECapabilityInformationConfirm* pvalue);
-
-
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_proto_rrm.h b/openair2/RRC/CELLULAR/rrc_proto_rrm.h
deleted file mode 100755
index 7d4b58f8e1..0000000000
--- a/openair2/RRC/CELLULAR/rrc_proto_rrm.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/***************************************************************************
-                          rrc_proto_rrm.h
-                          -------------------
-    copyright            : (C) 2010 by Eurecom
-    created by           : Lionel.Gauthier@eurecom.fr
-    modified by          : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  prototypes of RRM functions
- **************************************************************************/
-#ifndef __RRC_PROTO_RRM_H__
-#define __RRC_PROTO_RRM_H__
-
-extern int  rrc_rrm_main_proc (void);
-extern void rrc_rg_rrm_connected_init (void);
-
-void rrc_rg_init_check_qos_classes(void);
-//void init_rrc_handler (void);
-void rrc_rrm_rcve_config (u8 *serialized_configP, int lengthP);
-//void rrc_rx_decode_buffer (void);
-void rrc_rrm_decode_message (void);
-
-/*--------------------------------------------------------------------*/
-//void rrc_null (void *mP, int lengthP);
-void rrc_connection_response (void *mP, int lengthP);
-void rrc_add_user_response (void *mP, int lengthP);
-void rrc_remove_user_response (void *mP, int lengthP);
-void rrc_add_radio_access_bearer_response (void *mP, int lengthP);
-void rrc_remove_radio_access_bearer_response (void *mP, int lengthP);
-//void rrc_connection_close_ack (void *mP, int lengthP);
-void rrc_measurement_request (void *mP, int lengthP);
-
-
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_qos_classes.h b/openair2/RRC/CELLULAR/rrc_qos_classes.h
deleted file mode 100755
index f43edab28a..0000000000
--- a/openair2/RRC/CELLULAR/rrc_qos_classes.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*********************************************************************
-                          rrc_qos_classes.h  -  description
-                             -------------------
-    copyright            : (C) 2001, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- *********************************************************************
-  QoS classes supported in the system
- ********************************************************************/
-#ifndef __RRC_QOS_CLASSES_H__
-#define __RRC_QOS_CLASSES_H__
-
-#define RRC_QOS_CONV_32_32          1
-#define RRC_QOS_CONV_64_64          2
-#define RRC_QOS_CONV_128_128        3
-#define RRC_QOS_CONV_256_256        4
-#define RRC_QOS_CONV_320_320        5
-#define RRC_QOS_INTER_64_32         6
-#define RRC_QOS_INTER_128_32        7
-#define RRC_QOS_INTER_256_32        8
-#define RRC_QOS_INTER_384_32        9
-#define RRC_QOS_INTER_64_64         10
-#define RRC_QOS_INTER_128_64        11
-#define RRC_QOS_INTER_256_64        12
-#define RRC_QOS_INTER_384_64        13
-#define RRC_QOS_INTER_448_64        14
-#define RRC_QOS_INTER_128_128       15
-#define RRC_QOS_INTER_256_128       16
-#define RRC_QOS_INTER_384_128       17
-#define RRC_QOS_INTER_256_256       18
-#define RRC_QOS_INTER_320_320       19
-#define RRC_QOS_MBMS_STREAMING_128  20
-#define RRC_QOS_MBMS_STREAMING_256  21
-#define RRC_QOS_MBMS_STREAMING_384  22
-#define RRC_QOS_STREAMING_896_256   23
-
-#define RRC_QOS_LAST                23
-
-#endif
-
diff --git a/openair2/RRC/CELLULAR/rrc_qos_definitions.h b/openair2/RRC/CELLULAR/rrc_qos_definitions.h
deleted file mode 100755
index 3b329036a6..0000000000
--- a/openair2/RRC/CELLULAR/rrc_qos_definitions.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*********************************************************************
-                          rrc_qos_dfinitions.h  -  description
-                             -------------------
-    copyright            : (C) 2001, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- *********************************************************************
-  QoS classes supported in the system
- ********************************************************************/
-#ifndef __RRC_QOS_DEFS_CELL_H__
-#define __RRC_QOS_DEFS_CELL_H__
-#include "rrc_qos_classes.h"
-
-
-int rrc_qos_classes_definition [RRC_QOS_LAST][5] = {
-  //{traffic_class, guaranted_bit_rate_uplink, max_bit_rate_uplink, guaranted_bit_rate_downlink, max_bit_rate_downlink},
-  // 1 -RRC_QOS_CONV_32_32:
-  {CONVERSATIONAL,32,32,32,32},
-  // 2 -RRC_QOS_CONV_64_64:
-  {CONVERSATIONAL,64,64,64,64},
-  // 3 - RRC_QOS_CONV_128_128:
-  {CONVERSATIONAL,128,128,128,128},
-  // 4 -RRC_QOS_CONV_256_256:
-  {CONVERSATIONAL,256,256,256,256},
-  // 5 -RRC_QOS_CONV_320_320:
-  {CONVERSATIONAL,320,320,320,320},
-  // 6 -RRC_QOS_INTER_64_32:
-  {INTERACTIVE,32,32,64,64},
-  // 7 -RRC_QOS_INTER_128_32:
-  {INTERACTIVE,32,32,128,128},
-  // 8 -RRC_QOS_INTER_256_32:
-  {INTERACTIVE,32,32,256,256},
-  // 9 -RRC_QOS_INTER_384_32:
-  {INTERACTIVE,32,32,384,384},
-  //10 -RRC_QOS_INTER_64_64:
-  {INTERACTIVE,64,64,64,64},
-  //11 -RRC_QOS_INTER_128_64:
-  {INTERACTIVE,64,64,128,128},
-  //12 -RRC_QOS_INTER_256_64:
-  {INTERACTIVE,64,64,256,256},
-  //13 -RRC_QOS_INTER_384_64:
-  {INTERACTIVE,64,64,384,384},
-  //14 -RRC_QOS_INTER_448_64:
-  {INTERACTIVE,64,64,448,448},
-  //15 -RRC_QOS_INTER_128_128:
-  {INTERACTIVE,128,128,128,128},
-  //16 -RRC_QOS_INTER_256_128:
-  {INTERACTIVE,128,128,256,256},
-  //17 -RRC_QOS_INTER_384_128:
-  {INTERACTIVE,128,128,384,384},
-  //18 -RRC_QOS_INTER_256_256:
-  {INTERACTIVE,256,256,256,256},
-  //19 -RRC_QOS_INTER_320_320:
-  {INTERACTIVE,320,320,320,320},
-  //20 -RRC_QOS_MBMS_STREAMING_128:
-  {STREAMING,0,0,128,128},
-  //21 -RRC_QOS_MBMS_STREAMING_256:
-  {STREAMING,0,0,256,256},
-  //22 -RRC_QOS_MBMS_STREAMING_384:
-  {STREAMING,0,0,384,384},
-  //23 -RRC_QOS_STREAMING_896_256:
-  {STREAMING,256,256,896,896}
-};
-
-char *rrc_traffic_class_names[4] = {"CONVERSATIONAL","STREAMING","INTERACTIVE","BACKGROUND"};
-
-
-#endif
-
diff --git a/openair2/RRC/CELLULAR/rrc_rb_ue.c b/openair2/RRC/CELLULAR/rrc_rb_ue.c
deleted file mode 100755
index cf5bb4ea1b..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rb_ue.c
+++ /dev/null
@@ -1,1049 +0,0 @@
-/***************************************************************************
-                            rrc_rb_ue.c
-                           -------------------
-    begin                : Nov 10, 2001
-    copyright            : (C) 2001, 2010 by Eurecom
-    author               : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  This file contains the code generated by the Esterel engine for RB FSM
-
-  IT MUST NOT BE MODIFIED MANUALLY
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-//-----------------------------------------------------------------------------
-#include "rrc_ue_vars.h"
-//-----------------------------------------------------------------------------
-/* "SAXORT STRL Compiler version 3.1.6n compiled on Fri_Oct_18_15:50:53_CEST_2002" */
-
-/* automaton kernel code*/
-//#include <stdlib.h>
-//#include <stdio.h>
-//#include <string.h>
-#include "rrc_rb_ue.h"
-#define SIZEOFINT 32
-#define B_SET_VECTOR_MASK(i) ((unsigned int)1 << i)
-#define B_RES_VECTOR_MASK(i) (~((unsigned int)1 << i))
-#define BIT_SET(b_vector, bit_number) (b_vector)[(bit_number) / SIZEOFINT] |= B_SET_VECTOR_MASK((bit_number) % SIZEOFINT)
-#define BIT_RESET(b_vector, bit_number) (b_vector)[(bit_number) / SIZEOFINT] &= ~B_SET_VECTOR_MASK((bit_number) % SIZEOFINT)
-
-#define IS_ON(point) (_On[point / SIZEOFINT] & B_SET_VECTOR_MASK(point % SIZEOFINT))
-#define IS_PAUSE_ON(point) (_Pause[point / SIZEOFINT] & B_SET_VECTOR_MASK(point % SIZEOFINT))
-
-#define HALT_POINT_NUM 22
-#define HALT_POINT_VECTOR_SIZE ((HALT_POINT_NUM-1)/(int)SIZEOFINT)+1
-static unsigned int _On[HALT_POINT_VECTOR_SIZE];
-static unsigned int _Pause[HALT_POINT_VECTOR_SIZE];
-
-#define SIGNAL_NUM 33
-#define SIGNAL_VECTOR_SIZE 2
-#define SIGNAL_WITH_PRE_VECTOR_SIZE 1
-#define GLOBALMAXPRELEVEL 2
-static unsigned int _Sig[SIGNAL_VECTOR_SIZE];
-static unsigned int _SigPreTab[GLOBALMAXPRELEVEL][SIGNAL_WITH_PRE_VECTOR_SIZE];
-static unsigned int *_SigPre_0 = _SigPreTab[0];
-static unsigned int *_SigPre_1 = _SigPreTab[1];
-#define EMIT(vector, signal) (vector)[signal / SIZEOFINT] |= B_SET_VECTOR_MASK(signal % SIZEOFINT)
-#define CLEAR_SIGNAL(vector, signal) (vector)[signal / SIZEOFINT] &= B_RES_VECTOR_MASK(signal % SIZEOFINT)
-#define IS_SIGNAL(vector, signal) ((vector)[signal / SIZEOFINT] & B_SET_VECTOR_MASK(signal % SIZEOFINT))
-
-#define GUARD_NUM 13
-#define GUARD_VECTOR_SIZE ((GUARD_NUM-1)/(int)SIZEOFINT)+1
-static unsigned int _Guard[GUARD_VECTOR_SIZE];
-#define IS_GUARD(guard) (_Guard[guard / SIZEOFINT] & B_SET_VECTOR_MASK(guard % SIZEOFINT))
-#define SET_GUARD(guard) _Guard[guard / SIZEOFINT] |= B_SET_VECTOR_MASK(guard % SIZEOFINT)
-#define RESET_GUARD(guard) _Guard[guard / SIZEOFINT] &= B_RES_VECTOR_MASK(guard % SIZEOFINT)
-
-#ifndef _PREDEFINED_TYPES
-#    define _PREDEFINED_TYPES
-typedef int     boolean;
-typedef int     integer;
-#    ifndef STRLEN
-#        define STRLEN 81
-#    endif
-typedef char   *string;
-#    define _integer(x, y) (*x) = (y)
-#    define _boolean(x, y) (*x) = (y)
-#    define _float(x, y) (*x) = (y)
-#    define _double(x, y) (*x) = (y)
-#    define _string(x, y) strcpy((*x), (y))
-#    define _eq_integer(x, y) ((x) == (y))
-#    define _eq_boolean(x, y) ((x) == (y))
-#    define _eq_float(x, y) ((x) == (y))
-#    define _eq_double(x, y) ((x) == (y))
-#    define _eq_string(x, y) (!strcmp((x), (y)))
-#    define _ne_integer(x, y) ((x) != (y))
-#    define _ne_boolean(x, y) ((x) != (y))
-#    define _ne_float(x, y) ((x) != (y))
-#    define _ne_double(x, y) ((x) != (y))
-#    define _ne_string(x, y) (strcmp((x), (y)))
-#    define _cond_integer(x, y, z) ((x)?(y):(z))
-#    define _cond_boolean(x, y, z) ((x)?(y):(z))
-#    define _cond_float(x, y, z) ((x)?(y):(z))
-#    define _cond_double(x, y, z) ((x)?(y):(z))
-#    define _cond_string(x, y, z) ((x)?(y):(z))
-#    define _string_to_text(x) (x)
-#    define _text_to_string(x, y) (strcpy((*x), (y)))
-#    define _plus_(x, y) (x) + (y)
-#    define _minus_(x, y) (x) - (y)
-#    define _times_(x, y) (x) * (y)
-#    define _div_(x, y) (x) / (y)
-#    define _mod_(x, y) (x) % (y)
-#    define _not_(x) !(x)
-#    define _or_(x, y) (x) || (y)
-#    define _and_(x, y) (x) && (y)
-#    define _equal_(x, y) (x) == (y)
-#    define _diff_(x, y) (x) != (y)
-#    define _sup_(x, y) (x) > (y)
-#    define _supequal_(x, y) (x) >= (y)
-#    define _inf_(x, y) (x) < (y)
-#    define _infequal_(x, y) (x) <= (y)
-#endif
-#ifndef RB_SETUP
-extern integer  RB_SETUP;
-#endif
-#ifndef RB_RELEASE
-extern integer  RB_RELEASE;
-#endif
-#ifndef RB_SETUP_COMPLETE
-extern integer  RB_SETUP_COMPLETE;
-#endif
-#ifndef RB_SETUP_FAILURE
-extern integer  RB_SETUP_FAILURE;
-#endif
-#ifndef RB_RELEASE_COMPLETE
-extern integer  RB_RELEASE_COMPLETE;
-#endif
-#ifndef RB_RELEASE_FAILURE
-extern integer  RB_RELEASE_FAILURE;
-#endif
-#ifndef CELL_UPDATE
-extern integer  CELL_UPDATE;
-#endif
-#ifndef CELL_FACH
-extern integer  CELL_FACH;
-#endif
-static boolean  Var__ThisIsTheEnd__114;
-#define __Sig_sc_in_RB_Management_DOT_CELL_DCH_97 0
-static integer  Var_msg_113;
-#define __Sig_sc_go_45_RBSU_Failure_112 0
-static integer  Var_msg_111;
-#define __Sig_sc_go_36_CELL_DCH_109 1
-#define __Sig_sc_go_42_CELL_PCH_110 2
-static integer  Var_next_state_108;
-static integer  Var_msg_107;
-#define __Sig_Go_CELL_FACH_105 3
-#define __Sig_Go_CELL_DCH_104 4
-static boolean  Sig_INVALID_CONFIGURATION_103;
-static boolean  Sig_ORDERED_RECONFIGURATION_102;
-#define __Sig_RB_Establish_Success_98 5
-#define __Out_O_CELL_Update_Proc_96 6
-#define __Out_O_New_State_CELL_FACH_95 7
-#define __Out_O_New_State_CELL_DCH_94 8
-#define __Out_O_startT305_93 9
-#define __Out_O_SEND_CCCH_92 10
-static integer  Out_O_SEND_CCCH_92;
-#define __Out_O_SEND_DCCH_AM_91 11
-static integer  Out_O_SEND_DCCH_AM_91;
-#define __Out_O_CRLC_CONFIG_Req_90 12
-#define __Out_O_CMAC_CONFIG_Req_89 13
-#define __Out_O_CPHY_RL_RELEASE_Req_88 14
-#define __Out_O_CPHY_RL_SETUP_Req_87 15
-#define __Out_O_NAS_RB_RELEASE_Ind_86 16
-static integer  Out_O_NAS_RB_RELEASE_Ind_86;
-#define __Out_O_NAS_RB_ESTABLISH_Ind_85 17
-static integer  Out_O_NAS_RB_ESTABLISH_Ind_85;
-#define __In_I_Go_CELL_PCH_84 18
-#define __In_I_Go_CELL_FACH_83 19
-#define __In_I_Go_CELL_DCH_82 20
-#define __In_I_Go_Idle_81 21
-#define __In_I_IE_RRC_State_80 22
-static integer  In_I_IE_RRC_State_80;
-#define __In_I_Radio_Bearer_ID_79 23
-static integer  In_I_Radio_Bearer_ID_79;
-#define __In_I_RLC_Success_78 24
-#define __In_I_CRLC_STATUS_77 25
-#define __In_I_CPHY_OUT_OF_SYNCH_76 26
-#define __In_I_CPHY_SYNCH_Failure_75 27
-#define __In_I_CPHY_SYNCH_IND_74 28
-#define __In_I_Prot_Error_73 29
-static boolean  In_I_Prot_Error_73;
-#define __In_I_CELL_UPDATE_CONFIRM_72 30
-#define __In_I_RADIO_BEARER_RELEASE_71 31
-#define __In_I_RADIO_BEARER_SETUP_70 32
-#ifndef proc_IE_activ_Time
-extern void     proc_IE_activ_Time ();
-#endif
-#ifndef proc_IE_RNTIs
-extern void     proc_IE_RNTIs ();
-#endif
-#ifndef proc_IE_transaction
-extern void     proc_IE_transaction ();
-#endif
-#ifndef proc_IE_configuration
-extern void     proc_IE_configuration ();
-#endif
-#ifndef clear_C_RNTI
-extern void     clear_C_RNTI ();
-#endif
-#ifndef set_RRC_Transaction_ID
-extern void     set_RRC_Transaction_ID ();
-#endif
-#ifndef Select_Secondary_CCPCH
-extern void     Select_Secondary_CCPCH ();
-#endif
-#ifndef Select_PRACH
-extern void     Select_PRACH ();
-#endif
-#ifndef ue_clear_transaction
-extern void     ue_clear_transaction (integer);
-#endif
-#ifndef encode_message
-extern void     encode_message (integer *, integer);
-#endif
-#ifndef INTEGER_COMBINE
-extern integer  INTEGER_COMBINE (integer, integer);
-#endif
-#ifndef BOOLEAN_COMBINE
-extern boolean  BOOLEAN_COMBINE (boolean, boolean);
-#endif
-
-extern void     RRC_RB_UE_O_O_CELL_Update_Proc (void);
-extern void     RRC_RB_UE_O_O_New_State_CELL_FACH (void);
-extern void     RRC_RB_UE_O_O_New_State_CELL_DCH (void);
-extern void     RRC_RB_UE_O_O_startT305 (void);
-extern void     RRC_RB_UE_O_O_SEND_CCCH (integer);
-extern void     RRC_RB_UE_O_O_SEND_DCCH_AM (integer);
-extern void     RRC_RB_UE_O_O_CRLC_CONFIG_Req (void);
-extern void     RRC_RB_UE_O_O_CMAC_CONFIG_Req (void);
-extern void     RRC_RB_UE_O_O_CPHY_RL_RELEASE_Req (void);
-extern void     RRC_RB_UE_O_O_CPHY_RL_SETUP_Req (void);
-extern void     RRC_RB_UE_O_O_NAS_RB_RELEASE_Ind (integer);
-extern void     RRC_RB_UE_O_O_NAS_RB_ESTABLISH_Ind (integer);
-void
-RRC_RB_UE_I_I_Go_CELL_PCH (void)
-{
-  EMIT (_Sig, __In_I_Go_CELL_PCH_84);
-}
-
-void
-RRC_RB_UE_I_I_Go_CELL_FACH (void)
-{
-  EMIT (_Sig, __In_I_Go_CELL_FACH_83);
-}
-
-void
-RRC_RB_UE_I_I_Go_CELL_DCH (void)
-{
-  EMIT (_Sig, __In_I_Go_CELL_DCH_82);
-}
-
-void
-RRC_RB_UE_I_I_Go_Idle (void)
-{
-  EMIT (_Sig, __In_I_Go_Idle_81);
-}
-
-void
-RRC_RB_UE_I_I_IE_RRC_State (integer value)
-{
-  EMIT (_Sig, __In_I_IE_RRC_State_80);
-  _integer (&In_I_IE_RRC_State_80, value);
-}
-
-void
-RRC_RB_UE_I_I_Radio_Bearer_ID (integer value)
-{
-  EMIT (_Sig, __In_I_Radio_Bearer_ID_79);
-  _integer (&In_I_Radio_Bearer_ID_79, value);
-}
-
-void
-RRC_RB_UE_I_I_RLC_Success (void)
-{
-  EMIT (_Sig, __In_I_RLC_Success_78);
-}
-
-void
-RRC_RB_UE_I_I_CRLC_STATUS (void)
-{
-  EMIT (_Sig, __In_I_CRLC_STATUS_77);
-}
-
-void
-RRC_RB_UE_I_I_CPHY_OUT_OF_SYNCH (void)
-{
-  EMIT (_Sig, __In_I_CPHY_OUT_OF_SYNCH_76);
-}
-
-void
-RRC_RB_UE_I_I_CPHY_SYNCH_Failure (void)
-{
-  EMIT (_Sig, __In_I_CPHY_SYNCH_Failure_75);
-}
-
-void
-RRC_RB_UE_I_I_CPHY_SYNCH_IND (void)
-{
-  EMIT (_Sig, __In_I_CPHY_SYNCH_IND_74);
-}
-
-void
-RRC_RB_UE_I_I_Prot_Error (boolean value)
-{
-  EMIT (_Sig, __In_I_Prot_Error_73);
-  _boolean (&In_I_Prot_Error_73, value);
-}
-
-void
-RRC_RB_UE_I_I_CELL_UPDATE_CONFIRM (void)
-{
-  EMIT (_Sig, __In_I_CELL_UPDATE_CONFIRM_72);
-}
-
-void
-RRC_RB_UE_I_I_RADIO_BEARER_RELEASE (void)
-{
-  EMIT (_Sig, __In_I_RADIO_BEARER_RELEASE_71);
-}
-
-void
-RRC_RB_UE_I_I_RADIO_BEARER_SETUP (void)
-{
-  EMIT (_Sig, __In_I_RADIO_BEARER_SETUP_70);
-}
-
-static void
-Point_0 (void)
-{
-  /*#0 */
-  _boolean (&Var__ThisIsTheEnd__114, 1);
-  CLEAR_SIGNAL (_SigPre_0, __Sig_sc_in_RB_Management_DOT_CELL_DCH_97);
-  CLEAR_SIGNAL (_SigPre_1, __Sig_sc_in_RB_Management_DOT_CELL_DCH_97);
-  _boolean (&Sig_ORDERED_RECONFIGURATION_102, 0);
-  _boolean (&Sig_INVALID_CONFIGURATION_103, 0);
-  _On[0] |= 0x8;                /* On: #3 */
-}
-
-static void
-Point_1 (void)
-{
-  /*#1 AutoPauseOn */
-  if ((IS_SIGNAL (_Sig, __In_I_CPHY_OUT_OF_SYNCH_76) || IS_SIGNAL (_Sig, __In_I_CRLC_STATUS_77))) {
-    encode_message (&Var_msg_113, CELL_UPDATE);
-    EMIT (_Sig, __Out_O_SEND_CCCH_92);
-
-    if (!(IS_GUARD (7)))
-      _integer (&Out_O_SEND_CCCH_92, Var_msg_113);
-    else
-      _integer (&Out_O_SEND_CCCH_92, INTEGER_COMBINE (Out_O_SEND_CCCH_92, Var_msg_113));
-
-    SET_GUARD (7);
-    RRC_RB_UE_O_O_SEND_CCCH (Out_O_SEND_CCCH_92);
-    _On[0] &= ~0x2;             /* Off: #1 */
-    _Pause[0] |= 0x4;           /* PauseOn: #2 */
-  }
-}
-
-static void
-Point_2 (void)
-{
-  /*#2 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __In_I_CELL_UPDATE_CONFIRM_72)) {
-    EMIT (_Sig, __Out_O_CELL_Update_Proc_96);
-
-    if (!(IS_GUARD (3))) {
-      RRC_RB_UE_O_O_CELL_Update_Proc ();
-      SET_GUARD (3);
-    }
-
-    _On[0] &= ~0x4;             /* Off: #2 */
-    _Pause[0] |= 0x2;           /* PauseOn: #1 */
-  }
-}
-
-static void
-Point_3 (void)
-{
-  /*#3 AutoPauseOn */
-  if ((IS_SIGNAL (_Sig, __In_I_Go_CELL_DCH_82) || IS_SIGNAL (_Sig, __In_I_Go_CELL_FACH_83))) {
-    _integer (&Var_next_state_108, 1);
-    CLEAR_SIGNAL (_Sig, __Sig_sc_go_36_CELL_DCH_109);
-    _On[0] &= ~0x8;             /* Off: #3 */
-    _Pause[0] |= 0x200812;      /* PauseOn: #1 #4 #11 #21 */
-
-    if (IS_SIGNAL (_Sig, __In_I_Go_CELL_FACH_83)) {
-      SET_GUARD (0);
-    } else {
-      if (IS_SIGNAL (_Sig, __In_I_Go_CELL_DCH_82)) {
-        SET_GUARD (0);
-        EMIT (_Sig, __Sig_sc_go_36_CELL_DCH_109);
-      } else {
-        _Pause[0] |= 0x100000;  /* PauseOn: #20 */
-      }
-    }
-
-    if (IS_GUARD (0)) {
-      if (IS_SIGNAL (_Sig, __Sig_sc_go_36_CELL_DCH_109)) {
-        EMIT (_SigPre_0, __Sig_sc_in_RB_Management_DOT_CELL_DCH_97);
-        _Pause[0] |= 0x60000;   /* PauseOn: #17 #18 */
-      } else {
-        _Pause[0] |= 0x10000;   /* PauseOn: #16 */
-      }
-    }
-  }
-}
-
-static void
-Point_4 (void)
-{
-  /*#4 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __In_I_RADIO_BEARER_SETUP_70)) {
-    if (!(IS_GUARD (0)))
-      _boolean (&Sig_ORDERED_RECONFIGURATION_102, 1);
-    else
-      _boolean (&Sig_ORDERED_RECONFIGURATION_102, BOOLEAN_COMBINE (Sig_ORDERED_RECONFIGURATION_102, 1));
-
-    SET_GUARD (0);
-    _On[0] &= ~0x10;            /* Off: #4 */
-
-    if (_eq_boolean (In_I_Prot_Error_73, 0)) {
-      proc_IE_activ_Time ();
-      proc_IE_RNTIs ();
-      proc_IE_transaction ();
-      proc_IE_configuration ();
-      EMIT (_Sig, __Out_O_CPHY_RL_SETUP_Req_87);
-
-      if (!(IS_GUARD (12))) {
-        RRC_RB_UE_O_O_CPHY_RL_SETUP_Req ();
-        SET_GUARD (12);
-      }
-
-      EMIT (_Sig, __Out_O_CMAC_CONFIG_Req_89);
-
-      if (!(IS_GUARD (10))) {
-        RRC_RB_UE_O_O_CMAC_CONFIG_Req ();
-        SET_GUARD (10);
-      }
-
-      _Pause[0] |= 0x20;        /* PauseOn: #5 */
-    } else {
-      if (!(IS_GUARD (0)))
-        _boolean (&Sig_INVALID_CONFIGURATION_103, 1);
-      else
-        _boolean (&Sig_INVALID_CONFIGURATION_103, BOOLEAN_COMBINE (Sig_INVALID_CONFIGURATION_103, 1));
-
-      SET_GUARD (0);
-      EMIT (_Sig, __Sig_sc_go_45_RBSU_Failure_112);
-      _On[0] |= 0x100;          /* On: #8 */
-    }
-  }
-}
-
-static void
-Point_5 (void)
-{
-  /*#5 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __In_I_CPHY_SYNCH_IND_74)) {
-    _On[0] &= ~0x20;            /* Off: #5 */
-
-    if (IS_SIGNAL (_SigPre_1, __Sig_sc_in_RB_Management_DOT_CELL_DCH_97)) {
-      _Pause[0] |= 0x40;        /* PauseOn: #6 */
-    } else {
-      EMIT (_Sig, __Sig_Go_CELL_DCH_104);
-      clear_C_RNTI ();
-      _Pause[0] |= 0x40;        /* PauseOn: #6 */
-    }
-
-    EMIT (_Sig, __Out_O_CRLC_CONFIG_Req_90);
-
-    if (!(IS_GUARD (9))) {
-      RRC_RB_UE_O_O_CRLC_CONFIG_Req ();
-      SET_GUARD (9);
-    }
-
-    set_RRC_Transaction_ID ();
-    encode_message (&Var_msg_111, RB_SETUP_COMPLETE);
-    EMIT (_Sig, __Out_O_SEND_DCCH_AM_91);
-
-    if (!(IS_GUARD (8)))
-      _integer (&Out_O_SEND_DCCH_AM_91, Var_msg_111);
-    else
-      _integer (&Out_O_SEND_DCCH_AM_91, INTEGER_COMBINE (Out_O_SEND_DCCH_AM_91, Var_msg_111));
-
-    SET_GUARD (8);
-    _On[0] |= 0x4000;           /* On: #14 */
-  } else {
-    if (IS_SIGNAL (_Sig, __In_I_CPHY_SYNCH_Failure_75)) {
-      EMIT (_Sig, __Sig_sc_go_45_RBSU_Failure_112);
-      _On[0] |= 0x100;          /* On: #8 */
-      _On[0] &= ~0x20;          /* Off: #5 */
-    }
-  }
-}
-
-static void
-Point_6 (void)
-{
-  /*#6 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __In_I_RLC_Success_78)) {
-    ue_clear_transaction (RB_SETUP);
-    EMIT (_Sig, __Sig_RB_Establish_Success_98);
-    _On[0] |= 0x80;             /* On: #7 */
-    _On[0] &= ~0x40;            /* Off: #6 */
-  }
-}
-
-static void
-Point_7 (void)
-{
-  /*#7 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __Sig_RB_Establish_Success_98)) {
-    if (!(IS_GUARD (0)))
-      _boolean (&Sig_ORDERED_RECONFIGURATION_102, 0);
-    else
-      _boolean (&Sig_ORDERED_RECONFIGURATION_102, BOOLEAN_COMBINE (Sig_ORDERED_RECONFIGURATION_102, 0));
-
-    SET_GUARD (0);
-    EMIT (_Sig, __Out_O_NAS_RB_ESTABLISH_Ind_85);
-    _integer (&Out_O_NAS_RB_ESTABLISH_Ind_85, In_I_Radio_Bearer_ID_79);
-    RRC_RB_UE_O_O_NAS_RB_ESTABLISH_Ind (Out_O_NAS_RB_ESTABLISH_Ind_85);
-    _On[0] |= 0x100;            /* On: #8 */
-    _On[0] &= ~0x80;            /* Off: #7 */
-  }
-}
-
-static void
-Point_8 (void)
-{
-  /*#8 */
-  if (IS_SIGNAL (_Sig, __Sig_sc_go_45_RBSU_Failure_112)) {
-    set_RRC_Transaction_ID ();
-    encode_message (&Var_msg_111, RB_SETUP_FAILURE);
-    EMIT (_Sig, __Out_O_SEND_DCCH_AM_91);
-
-    if (!(IS_GUARD (8)))
-      _integer (&Out_O_SEND_DCCH_AM_91, Var_msg_111);
-    else
-      _integer (&Out_O_SEND_DCCH_AM_91, INTEGER_COMBINE (Out_O_SEND_DCCH_AM_91, Var_msg_111));
-
-    SET_GUARD (8);
-    _On[0] |= 0x4000;           /* On: #14 */
-    _Pause[0] |= 0x200;         /* PauseOn: #9 */
-  } else {
-    _Pause[0] |= 0x10;          /* PauseOn: #4 */
-  }
-}
-
-static void
-Point_9 (void)
-{
-  /*#9 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __In_I_RLC_Success_78)) {
-    if (!(IS_GUARD (0)))
-      _boolean (&Sig_INVALID_CONFIGURATION_103, 0);
-    else
-      _boolean (&Sig_INVALID_CONFIGURATION_103, BOOLEAN_COMBINE (Sig_INVALID_CONFIGURATION_103, 0));
-
-    SET_GUARD (0);
-
-    if (!(IS_GUARD (0)))
-      _boolean (&Sig_ORDERED_RECONFIGURATION_102, 0);
-    else
-      _boolean (&Sig_ORDERED_RECONFIGURATION_102, BOOLEAN_COMBINE (Sig_ORDERED_RECONFIGURATION_102, 0));
-
-    SET_GUARD (0);
-    _On[0] &= ~0x200;           /* Off: #9 */
-    _Pause[0] |= 0x10;          /* PauseOn: #4 */
-  }
-}
-
-static void
-Point_10 (void)
-{
-  /*#10 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __In_I_RLC_Success_78)) {
-    if (!(IS_GUARD (0)))
-      _boolean (&Sig_ORDERED_RECONFIGURATION_102, 0);
-    else
-      _boolean (&Sig_ORDERED_RECONFIGURATION_102, BOOLEAN_COMBINE (Sig_ORDERED_RECONFIGURATION_102, 0));
-
-    SET_GUARD (0);
-    ue_clear_transaction (RB_RELEASE);
-    _On[0] &= ~0x400;           /* Off: #10 */
-    _Pause[0] |= 0x800;         /* PauseOn: #11 */
-  }
-}
-
-static void
-Point_11 (void)
-{
-  /*#11 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __In_I_RADIO_BEARER_RELEASE_71)) {
-    if (!(IS_GUARD (0)))
-      _boolean (&Sig_ORDERED_RECONFIGURATION_102, 1);
-    else
-      _boolean (&Sig_ORDERED_RECONFIGURATION_102, BOOLEAN_COMBINE (Sig_ORDERED_RECONFIGURATION_102, 1));
-
-    SET_GUARD (0);
-    _On[0] &= ~0x800;           /* Off: #11 */
-
-    if (_eq_boolean (In_I_Prot_Error_73, 0)) {
-      _On[0] |= 0x1000;         /* On: #12 */
-    } else {
-      _On[0] |= 0x2000;         /* On: #13 */
-    }
-  }
-}
-
-static void
-Point_12 (void)
-{
-  /*#12 */
-  _integer (&Var_next_state_108, In_I_IE_RRC_State_80);
-  proc_IE_activ_Time ();
-  proc_IE_RNTIs ();
-  proc_IE_transaction ();
-  proc_IE_configuration ();
-  EMIT (_Sig, __Out_O_CRLC_CONFIG_Req_90);
-
-  if (!(IS_GUARD (9))) {
-    RRC_RB_UE_O_O_CRLC_CONFIG_Req ();
-    SET_GUARD (9);
-  }
-
-  EMIT (_Sig, __Out_O_CMAC_CONFIG_Req_89);
-
-  if (!(IS_GUARD (10))) {
-    RRC_RB_UE_O_O_CMAC_CONFIG_Req ();
-    SET_GUARD (10);
-  }
-
-  EMIT (_Sig, __Out_O_CPHY_RL_RELEASE_Req_88);
-
-  if (!(IS_GUARD (11))) {
-    RRC_RB_UE_O_O_CPHY_RL_RELEASE_Req ();
-    SET_GUARD (11);
-  }
-
-  if (_eq_integer (Var_next_state_108, CELL_FACH)) {
-    EMIT (_Sig, __Sig_Go_CELL_FACH_105);
-    Select_Secondary_CCPCH ();
-    Select_PRACH ();
-    EMIT (_Sig, __Out_O_startT305_93);
-
-    if (!(IS_GUARD (6))) {
-      RRC_RB_UE_O_O_startT305 ();
-      SET_GUARD (6);
-    }
-
-    _Pause[0] |= 0x400;         /* PauseOn: #10 */
-  } else {
-    _Pause[0] |= 0x400;         /* PauseOn: #10 */
-  }
-
-  EMIT (_Sig, __Out_O_NAS_RB_RELEASE_Ind_86);
-  _integer (&Out_O_NAS_RB_RELEASE_Ind_86, In_I_Radio_Bearer_ID_79);
-  set_RRC_Transaction_ID ();
-  encode_message (&Var_msg_107, RB_RELEASE_COMPLETE);
-  EMIT (_Sig, __Out_O_SEND_DCCH_AM_91);
-
-  if (!(IS_GUARD (8)))
-    _integer (&Out_O_SEND_DCCH_AM_91, Var_msg_107);
-  else
-    _integer (&Out_O_SEND_DCCH_AM_91, INTEGER_COMBINE (Out_O_SEND_DCCH_AM_91, Var_msg_107));
-
-  SET_GUARD (8);
-  RRC_RB_UE_O_O_NAS_RB_RELEASE_Ind (Out_O_NAS_RB_RELEASE_Ind_86);
-  _On[0] |= 0x4000;             /* On: #14 */
-}
-
-static void
-Point_13 (void)
-{
-  /*#13 */
-  if (!(IS_GUARD (0)))
-    _boolean (&Sig_INVALID_CONFIGURATION_103, 1);
-  else
-    _boolean (&Sig_INVALID_CONFIGURATION_103, BOOLEAN_COMBINE (Sig_INVALID_CONFIGURATION_103, 1));
-
-  SET_GUARD (0);
-  set_RRC_Transaction_ID ();
-  encode_message (&Var_msg_107, RB_RELEASE_FAILURE);
-  EMIT (_Sig, __Out_O_SEND_DCCH_AM_91);
-
-  if (!(IS_GUARD (8)))
-    _integer (&Out_O_SEND_DCCH_AM_91, Var_msg_107);
-  else
-    _integer (&Out_O_SEND_DCCH_AM_91, INTEGER_COMBINE (Out_O_SEND_DCCH_AM_91, Var_msg_107));
-
-  SET_GUARD (8);
-  _On[0] |= 0x4000;             /* On: #14 */
-  _Pause[0] |= 0x8000;          /* PauseOn: #15 */
-}
-
-static void
-Point_14 (void)
-{
-  /*#14 */
-  RRC_RB_UE_O_O_SEND_DCCH_AM (Out_O_SEND_DCCH_AM_91);
-}
-
-static void
-Point_15 (void)
-{
-  /*#15 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __In_I_RLC_Success_78)) {
-    if (!(IS_GUARD (0)))
-      _boolean (&Sig_INVALID_CONFIGURATION_103, 0);
-    else
-      _boolean (&Sig_INVALID_CONFIGURATION_103, BOOLEAN_COMBINE (Sig_INVALID_CONFIGURATION_103, 0));
-
-    SET_GUARD (0);
-
-    if (!(IS_GUARD (0)))
-      _boolean (&Sig_ORDERED_RECONFIGURATION_102, 0);
-    else
-      _boolean (&Sig_ORDERED_RECONFIGURATION_102, BOOLEAN_COMBINE (Sig_ORDERED_RECONFIGURATION_102, 0));
-
-    SET_GUARD (0);
-    _On[0] &= ~0x8000;          /* Off: #15 */
-    _Pause[0] |= 0x800;         /* PauseOn: #11 */
-  }
-}
-
-static void
-Point_16 (void)
-{
-  /*#16 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __Sig_Go_CELL_DCH_104)) {
-    EMIT (_Sig, __Out_O_New_State_CELL_DCH_94);
-
-    if (!(IS_GUARD (5))) {
-      RRC_RB_UE_O_O_New_State_CELL_DCH ();
-      SET_GUARD (5);
-    }
-
-    EMIT (_Sig, __Sig_sc_go_36_CELL_DCH_109);
-    _On[0] |= 0x80000;          /* On: #19 */
-    _On[0] &= ~0x10000;         /* Off: #16 */
-  } else {
-    if (IS_SIGNAL (_Sig, __In_I_Go_CELL_DCH_82)) {
-      EMIT (_Sig, __Sig_sc_go_36_CELL_DCH_109);
-      _On[0] |= 0x80000;        /* On: #19 */
-      _On[0] &= ~0x10000;       /* Off: #16 */
-    } else {
-      if (IS_SIGNAL (_Sig, __In_I_Go_CELL_PCH_84)) {
-        EMIT (_Sig, __Sig_sc_go_42_CELL_PCH_110);
-        _On[0] |= 0x80000;      /* On: #19 */
-        _On[0] &= ~0x10000;     /* Off: #16 */
-      }
-    }
-  }
-}
-
-static void
-Point_17 (void)
-{
-  /*#17 AutoPauseOn */
-  EMIT (_SigPre_0, __Sig_sc_in_RB_Management_DOT_CELL_DCH_97);
-}
-
-static void
-Point_18 (void)
-{
-  /*#18 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __Sig_Go_CELL_FACH_105)) {
-    EMIT (_Sig, __Out_O_New_State_CELL_FACH_95);
-
-    if (!(IS_GUARD (4))) {
-      RRC_RB_UE_O_O_New_State_CELL_FACH ();
-      SET_GUARD (4);
-    }
-
-    _On[0] |= 0x80000;          /* On: #19 */
-    _On[0] &= ~0x40000;         /* Off: #18 */
-    _Pause[0] &= ~0x20000;
-    _On[0] &= ~0x20000;         /* PauseOff: #17 */
-  } else {
-    if (IS_SIGNAL (_Sig, __In_I_Go_CELL_FACH_83)) {
-      _On[0] |= 0x80000;        /* On: #19 */
-      _On[0] &= ~0x40000;       /* Off: #18 */
-      _Pause[0] &= ~0x20000;
-      _On[0] &= ~0x20000;       /* PauseOff: #17 */
-    } else {
-      if (IS_SIGNAL (_Sig, __In_I_Go_CELL_PCH_84)) {
-        EMIT (_Sig, __Sig_sc_go_42_CELL_PCH_110);
-        _On[0] |= 0x80000;      /* On: #19 */
-        _On[0] &= ~0x40000;     /* Off: #18 */
-        _Pause[0] &= ~0x20000;
-        _On[0] &= ~0x20000;     /* PauseOff: #17 */
-      }
-    }
-  }
-}
-
-static void
-Point_19 (void)
-{
-  /*#19 */
-  if (IS_SIGNAL (_Sig, __Sig_sc_go_42_CELL_PCH_110)) {
-  } else {
-    if (IS_SIGNAL (_Sig, __Sig_sc_go_36_CELL_DCH_109)) {
-      EMIT (_SigPre_0, __Sig_sc_in_RB_Management_DOT_CELL_DCH_97);
-      _Pause[0] |= 0x60000;     /* PauseOn: #17 #18 */
-    } else {
-      _Pause[0] |= 0x10000;     /* PauseOn: #16 */
-    }
-  }
-}
-
-static void
-Point_20 (void)
-{
-  /*#20 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __In_I_Go_CELL_FACH_83)) {
-    SET_GUARD (1);
-    _On[0] &= ~0x100000;        /* Off: #20 */
-  } else {
-    if (IS_SIGNAL (_Sig, __In_I_Go_CELL_DCH_82)) {
-      SET_GUARD (1);
-      EMIT (_Sig, __Sig_sc_go_36_CELL_DCH_109);
-      _On[0] &= ~0x100000;      /* Off: #20 */
-    }
-  }
-
-  if (IS_GUARD (1)) {
-    if (IS_SIGNAL (_Sig, __Sig_sc_go_36_CELL_DCH_109)) {
-      EMIT (_SigPre_0, __Sig_sc_in_RB_Management_DOT_CELL_DCH_97);
-      _Pause[0] |= 0x60000;     /* PauseOn: #17 #18 */
-    } else {
-      _Pause[0] |= 0x10000;     /* PauseOn: #16 */
-    }
-  }
-}
-
-static void
-Point_21 (void)
-{
-  /*#21 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __In_I_Go_Idle_81)) {
-    _On[0] &= ~0x200000;        /* Off: #21 */
-    _Pause[0] &= ~0x179ef6;
-    _On[0] &= ~0x178ef6;        /* PauseOff: #1 #2 #4 #5 #6 #7 #9 #10 #11 #12 #15 #16 #17 #18 #20 */
-
-    if ((IS_SIGNAL (_Sig, __In_I_Go_CELL_DCH_82) || IS_SIGNAL (_Sig, __In_I_Go_CELL_FACH_83))) {
-      _integer (&Var_next_state_108, 1);
-      CLEAR_SIGNAL (_Sig, __Sig_sc_go_36_CELL_DCH_109);
-      _Pause[0] |= 0x200812;    /* PauseOn: #1 #4 #11 #21 */
-
-      if (IS_SIGNAL (_Sig, __In_I_Go_CELL_FACH_83)) {
-        SET_GUARD (2);
-      } else {
-        if (IS_SIGNAL (_Sig, __In_I_Go_CELL_DCH_82)) {
-          SET_GUARD (2);
-          EMIT (_Sig, __Sig_sc_go_36_CELL_DCH_109);
-        } else {
-          _Pause[0] |= 0x100000;        /* PauseOn: #20 */
-        }
-      }
-
-      if (IS_GUARD (2)) {
-        if (IS_SIGNAL (_Sig, __Sig_sc_go_36_CELL_DCH_109)) {
-          EMIT (_SigPre_0, __Sig_sc_in_RB_Management_DOT_CELL_DCH_97);
-          _Pause[0] |= 0x60000; /* PauseOn: #17 #18 */
-        } else {
-          _Pause[0] |= 0x10000; /* PauseOn: #16 */
-        }
-      }
-    } else {
-      _Pause[0] |= 0x8;         /* PauseOn: #3 */
-    }
-  }
-}
-
-
-int
-RRC_RB_UE (void)
-{
-  unsigned int   *Points;
-
-  Points = _On;
-
-  if (*Points) {
-    if (*Points & 0x1) {
-      Point_0 ();
-    }
-
-    if (*Points & 0x2) {
-      Point_1 ();
-    }
-
-    if (*Points & 0x4) {
-      Point_2 ();
-    }
-
-    if (*Points & 0x8) {
-      Point_3 ();
-    }
-
-    if (*Points & 0x10) {
-      Point_4 ();
-    }
-
-    if (*Points & 0x20) {
-      Point_5 ();
-    }
-
-    if (*Points & 0x40) {
-      Point_6 ();
-    }
-
-    if (*Points & 0x80) {
-      Point_7 ();
-    }
-
-    if (*Points & 0x100) {
-      Point_8 ();
-    }
-
-    if (*Points & 0x200) {
-      Point_9 ();
-    }
-
-    if (*Points & 0x400) {
-      Point_10 ();
-    }
-
-    if (*Points & 0x800) {
-      Point_11 ();
-    }
-
-    if (*Points & 0x1000) {
-      Point_12 ();
-    }
-
-    if (*Points & 0x2000) {
-      Point_13 ();
-    }
-
-    if (*Points & 0x4000) {
-      Point_14 ();
-    }
-
-    if (*Points & 0x8000) {
-      Point_15 ();
-    }
-
-    if (*Points & 0x10000) {
-      Point_16 ();
-    }
-
-    if (*Points & 0x20000) {
-      Point_17 ();
-    }
-
-    if (*Points & 0x40000) {
-      Point_18 ();
-    }
-
-    if (*Points & 0x80000) {
-      Point_19 ();
-    }
-
-    if (*Points & 0x100000) {
-      Point_20 ();
-    }
-
-    if (*Points & 0x200000) {
-      Point_21 ();
-    }
-  }
-
-  Points++;
-  {
-    int             j;
-    unsigned int   *_tmp;
-
-    _tmp = _SigPre_1;
-    _SigPre_1 = _SigPre_0;
-    _SigPre_0 = _tmp;
-
-    for (j = 0; j < SIGNAL_WITH_PRE_VECTOR_SIZE; j++)
-      _SigPre_0[j] = 0;
-
-    for (j = 0; j < SIGNAL_VECTOR_SIZE; j++)
-      _Sig[j] = 0;
-
-    _On[0] = _Pause[0] | (_On[0] & 0x378efe);
-
-    /* AutoPauseOn: #1 #2 #3 #4 #5 #6 #7 #9 #10 #11 #15 #16 #17 #18 #20 #21 */
-    for (j = 0; j < HALT_POINT_VECTOR_SIZE; j++)
-      _Pause[j] = 0;
-
-    for (j = 0; j < GUARD_VECTOR_SIZE; j++)
-      _Guard[j] = 0;
-  }
-  return Var__ThisIsTheEnd__114;
-}
-
-int
-RRC_RB_UE_reset (void)
-{
-  int             i, j;
-
-  for (j = 0; j < SIGNAL_VECTOR_SIZE; j++)
-    _Sig[j] = 0;
-
-  for (i = 0; i < GLOBALMAXPRELEVEL; i++)
-    for (j = 0; j < SIGNAL_WITH_PRE_VECTOR_SIZE; j++)
-      _SigPreTab[i][j] = 0;
-
-  _boolean (&In_I_Prot_Error_73, 0);
-
-  for (i = 0; i < HALT_POINT_VECTOR_SIZE; i++)
-    _On[i] = 0;
-
-  for (i = 0; i < HALT_POINT_VECTOR_SIZE; i++)
-    _Pause[i] = 0;
-
-  for (i = 0; i < GUARD_VECTOR_SIZE; i++)
-    _Guard[i] = 0;
-
-  BIT_SET (_On, 0);
-  return 1;
-}
-
-typedef int     (*SimInitFunc_t) ();
-int
-RRC_RB_UE_init (char **pError, SimInitFunc_t pFunc)
-{
-  return 1;
-}
-typedef int     (*SimEndFunc_t) ();
-int
-RRC_RB_UE_end (SimEndFunc_t pFunc)
-{
-  return 1;
-}
-
-int
-RRC_RB_UE_run (void)
-{
-  return RRC_RB_UE ();
-}
-
-int
-RRC_RB_UE_getError (void)
-{
-  return 0;
-}
-
-char           *
-RRC_RB_UE_getErrorMessage (void)
-{
-  return (char *) 0;
-}
diff --git a/openair2/RRC/CELLULAR/rrc_rb_ue.h b/openair2/RRC/CELLULAR/rrc_rb_ue.h
deleted file mode 100755
index 9a4f4a3ab4..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rb_ue.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/***************************************************************************
-                          rrc_rb_ue.h  -  description
-                             -------------------
-    begin                : April 26, 2002
-    copyright            : (C) 2002, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Header associated with the rrc_rb_ue.c file generated by Esterel Studio
- ***************************************************************************/
-#include  "rrc_constant.h"
-
-
-/* Generic function to encode RRC messages */
-void  encode_message (int *Message_Id, int Message_Type);
-
-int   INTEGER_COMBINE (int Id1, int Id2);
-int   BOOLEAN_COMBINE (int Id1, int Id2);
-
-/* Selection of channels during RRC Connection SetUp
- */
-void  Select_PRACH (void);
-void  Select_Secondary_CCPCH (void);
-
-/* Record of current RRC state - to be stored in: protocol_ms->rrc.protocol_state
- */
-void  Set_State (int new_state);
-
-/* release resources in RLC, MAC, PHY (no reply)
- */
-void  release_radio_resources (void);
-
-/* clear RRC variables: TRANSACTIONS, ESTABLISHED_SIGNALLING_CONNECTIONS, ESTABLISHED_RBs...
- */
-void  clear_variables_rel (void);
-
-
-/* function prototypes for the RRC Radio Bearer Establishment and Release procedures, UE side */
-void  proc_IE_activ_Time (void);
-void  proc_IE_RNTIs (void);
-void  proc_IE_transaction (void);
-void  proc_IE_configuration (void);
-void  clear_C_RNTI (void);
-void  set_RRC_Transaction_ID (void);
-/* clear RRC TRANSACTIONS IDENTIFIER...
- */
-void  ue_clear_transaction (int Message_Type);
diff --git a/openair2/RRC/CELLULAR/rrc_rb_ue_data.c b/openair2/RRC/CELLULAR/rrc_rb_ue_data.c
deleted file mode 100755
index fb5092dc5d..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rb_ue_data.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/***************************************************************************
-                          rrc_rb_ue_data.c  -  description
-                             -------------------
-    begin                : April 30, 2002
-    copyright            : (C) 2002, 2010 by Eurecom
-    author               : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  This file contains the definition of the functions called by Esterel FSM
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_ue_vars.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_fsm.h"
-
-//-----------------------------------------------------------------------------
-
-/* Initialization
-  input parm: User Equipment Id*/
-void rrc_rb_ue_init (void)
-{
-  // execute reset
-  RRC_RB_UE_reset ();
-  RRC_RB_UE ();
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RB][FSM] FSM initialized\n");
-  msg ("[RRC_RB][FSM]\n States : IDLE = 1, CELL_FACH = 6, CELL_DCH = 10 \n");
-  msg ("[RRC_RB][FSM]\n Boolean : true = 1, false = 0\n");
-#endif
-  // First tick
-  RRC_RB_UE ();
-}
-
-/* Input trigger functions - to be called by RRC_RB_UE_fsm_control() only */
-
-void rrc_rb_ue_new_state (int newState)
-{
-  // force state transition in the RRC_RB_UE fsm
-  switch (newState) {
-  case CELL_FACH:
-    RRC_RB_UE_I_I_Go_CELL_FACH ();
-    break;
-
-  case CELL_DCH:
-    RRC_RB_UE_I_I_Go_CELL_DCH ();
-    break;
-
-  case RRC_CELL_IDLE:
-    RRC_RB_UE_I_I_Go_Idle ();
-    break;
-
-  default:
-#ifdef DEBUG_RRC_STATE
-    msg ("[RRC_RB][FSM] Invalid State for transition\n");
-#endif
-    break;
-  }
-
-  RRC_RB_UE ();
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RB][FSM] Transition to state %d\n", newState);
-#endif
-}
-
-void rrc_rb_ue_RB_Setup_rx (int rb_id, int next_state, int prot_error)
-{
-  // send input signal RRC_Conn_Setup
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RB][FSM-IN] RB Setup Received, rb_id %d , next_state %d ,  protocol error %d.\n", rb_id, next_state, prot_error);
-#endif
-  RRC_RB_UE_I_I_Radio_Bearer_ID (rb_id);
-  RRC_RB_UE_I_I_IE_RRC_State (next_state);
-  RRC_RB_UE_I_I_Prot_Error (prot_error);
-  RRC_RB_UE_I_I_RADIO_BEARER_SETUP ();
-  RRC_RB_UE ();
-}
-
-void rrc_rb_ue_RB_Release_rx (int rb_id, int next_state, int prot_error)
-{
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RB][FSM-IN] RB Release Received, rb_id %d , next_state %d , protocol error %d.\n", rb_id, next_state, prot_error);
-#endif
-  RRC_RB_UE_I_I_Radio_Bearer_ID (rb_id);
-  RRC_RB_UE_I_I_IE_RRC_State (next_state);
-  RRC_RB_UE_I_I_Prot_Error (prot_error);
-  RRC_RB_UE_I_I_RADIO_BEARER_RELEASE ();
-  RRC_RB_UE ();
-}
-
-void rrc_rb_ue_Cell_Update_cnf_rx (void)
-{
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RB][FSM-IN] Cell Update Confirm Received.\n");
-#endif
-  RRC_RB_UE_I_I_CELL_UPDATE_CONFIRM ();
-  RRC_RB_UE ();
-}
-
-void rrc_rb_ue_PHY_Setup_rx (void)
-{
-  // simulate PHY_Synch received (DCH established)
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RB][FSM-IN] PHY_Synch_Success Received \n");
-#endif
-  RRC_RB_UE_I_I_CPHY_SYNCH_IND ();
-  RRC_RB_UE ();
-}
-
-void rrc_rb_ue_CPHY_Synch_Failure_rx (void)
-{
-  // simulate PHY_Failure received (DCH failed to established)
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RB][FSM-IN] PHY_Synch_Failure Received \n");
-#endif
-  RRC_RB_UE_I_I_CPHY_SYNCH_Failure ();
-  RRC_RB_UE ();
-}
-
-void rrc_rb_ue_CPHY_Out_of_Synch_rx (void)
-{
-  // simulate Out of Synch received (DCH failure)
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RB][FSM-IN] PHY_Out_Of_Synch Received \n");
-#endif
-  RRC_RB_UE_I_I_CPHY_OUT_OF_SYNCH ();
-  RRC_RB_UE ();
-}
-
-void rrc_rb_ue_CRLC_Status_rx (void)
-{
-  // simulate RLC_Status_Ind received (unrecoverable errors on RLC)
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RB][FSM-IN] RLC_Status_Ind Received \n");
-#endif
-  RRC_RB_UE_I_I_CRLC_STATUS ();
-  RRC_RB_UE ();
-}
-
-void rrc_rb_ue_RLC_Data_Confirm_rx (void)
-{
-  // simulate (to be removed?) RLC_Data_Confirm received
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RB][FSM-IN] RLC_Data_Confirm Received\n");
-#endif
-  RRC_RB_UE_I_I_RLC_Success ();
-  RRC_RB_UE ();
-}
-
-/*void rrc_rb_ue_RLC_failure_rx (void)
-{
-     // simulate (to be removed?) RLC_Data_Confirm received
-#ifdef DEBUG_RRC_STATE
-     msg("[RRC_RB][FSM-IN] RLC_Data_Failure Received\n");
-#endif
-     RRC_RB_UE_I_I_RLC_Failure ();
-     RRC_RB_UE();
-}*/
diff --git a/openair2/RRC/CELLULAR/rrc_rb_ue_debug.c b/openair2/RRC/CELLULAR/rrc_rb_ue_debug.c
deleted file mode 100755
index 522b0fb299..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rb_ue_debug.c
+++ /dev/null
@@ -1,1092 +0,0 @@
-/***************************************************************************
-                            rrc_rb_ue.c
-                           -------------------
-    begin                : Nov 10, 2001
-    copyright            : (C) 2001, 2010 by Eurecom
-    author               : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  This file contains the code generated by the Esterel engine
-
-  IT MUST NOT BE MODIFIED MANUALLY
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-//-----------------------------------------------------------------------------
-#include "rrc_ue_vars.h"
-//-----------------------------------------------------------------------------
-/* "SAXORT STRL Compiler version 3.1.6n compiled on Fri_Oct_18_15:50:53_CEST_2002" */
-
-/* automaton kernel code*/
-//#include <stdlib.h>
-//#include <stdio.h>
-//#include <string.h>
-#include "rrc_rb_ue.h"
-#define SIZEOFINT 32
-#define B_SET_VECTOR_MASK(i) ((unsigned int)1 << i)
-#define B_RES_VECTOR_MASK(i) (~((unsigned int)1 << i))
-#define BIT_SET(b_vector, bit_number) (b_vector)[(bit_number) / SIZEOFINT] |= B_SET_VECTOR_MASK((bit_number) % SIZEOFINT)
-#define BIT_RESET(b_vector, bit_number) (b_vector)[(bit_number) / SIZEOFINT] &= ~B_SET_VECTOR_MASK((bit_number) % SIZEOFINT)
-
-#define IS_ON(point) (_On[point / SIZEOFINT] & B_SET_VECTOR_MASK(point % SIZEOFINT))
-#define IS_PAUSE_ON(point) (_Pause[point / SIZEOFINT] & B_SET_VECTOR_MASK(point % SIZEOFINT))
-
-#define HALT_POINT_NUM 22
-#define HALT_POINT_VECTOR_SIZE ((HALT_POINT_NUM-1)/(int)SIZEOFINT)+1
-static unsigned int _On[HALT_POINT_VECTOR_SIZE];
-static unsigned int _Pause[HALT_POINT_VECTOR_SIZE];
-
-#define SIGNAL_NUM 33
-#define SIGNAL_VECTOR_SIZE 2
-#define SIGNAL_WITH_PRE_VECTOR_SIZE 1
-#define GLOBALMAXPRELEVEL 2
-static unsigned int _Sig[SIGNAL_VECTOR_SIZE];
-static unsigned int _SigPreTab[GLOBALMAXPRELEVEL][SIGNAL_WITH_PRE_VECTOR_SIZE];
-static unsigned int *_SigPre_0 = _SigPreTab[0];
-static unsigned int *_SigPre_1 = _SigPreTab[1];
-#define EMIT(vector, signal) (vector)[signal / SIZEOFINT] |= B_SET_VECTOR_MASK(signal % SIZEOFINT)
-#define CLEAR_SIGNAL(vector, signal) (vector)[signal / SIZEOFINT] &= B_RES_VECTOR_MASK(signal % SIZEOFINT)
-#define IS_SIGNAL(vector, signal) ((vector)[signal / SIZEOFINT] & B_SET_VECTOR_MASK(signal % SIZEOFINT))
-
-#define GUARD_NUM 13
-#define GUARD_VECTOR_SIZE ((GUARD_NUM-1)/(int)SIZEOFINT)+1
-static unsigned int _Guard[GUARD_VECTOR_SIZE];
-#define IS_GUARD(guard) (_Guard[guard / SIZEOFINT] & B_SET_VECTOR_MASK(guard % SIZEOFINT))
-#define SET_GUARD(guard) _Guard[guard / SIZEOFINT] |= B_SET_VECTOR_MASK(guard % SIZEOFINT)
-#define RESET_GUARD(guard) _Guard[guard / SIZEOFINT] &= B_RES_VECTOR_MASK(guard % SIZEOFINT)
-
-#ifndef _PREDEFINED_TYPES
-#    define _PREDEFINED_TYPES
-typedef int     boolean;
-typedef int     integer;
-#    ifndef STRLEN
-#        define STRLEN 81
-#    endif
-typedef char   *string;
-#    define _integer(x, y) (*x) = (y)
-#    define _boolean(x, y) (*x) = (y)
-#    define _float(x, y) (*x) = (y)
-#    define _double(x, y) (*x) = (y)
-#    define _string(x, y) strcpy((*x), (y))
-#    define _eq_integer(x, y) ((x) == (y))
-#    define _eq_boolean(x, y) ((x) == (y))
-#    define _eq_float(x, y) ((x) == (y))
-#    define _eq_double(x, y) ((x) == (y))
-#    define _eq_string(x, y) (!strcmp((x), (y)))
-#    define _ne_integer(x, y) ((x) != (y))
-#    define _ne_boolean(x, y) ((x) != (y))
-#    define _ne_float(x, y) ((x) != (y))
-#    define _ne_double(x, y) ((x) != (y))
-#    define _ne_string(x, y) (strcmp((x), (y)))
-#    define _cond_integer(x, y, z) ((x)?(y):(z))
-#    define _cond_boolean(x, y, z) ((x)?(y):(z))
-#    define _cond_float(x, y, z) ((x)?(y):(z))
-#    define _cond_double(x, y, z) ((x)?(y):(z))
-#    define _cond_string(x, y, z) ((x)?(y):(z))
-#    define _string_to_text(x) (x)
-#    define _text_to_string(x, y) (strcpy((*x), (y)))
-#    define _plus_(x, y) (x) + (y)
-#    define _minus_(x, y) (x) - (y)
-#    define _times_(x, y) (x) * (y)
-#    define _div_(x, y) (x) / (y)
-#    define _mod_(x, y) (x) % (y)
-#    define _not_(x) !(x)
-#    define _or_(x, y) (x) || (y)
-#    define _and_(x, y) (x) && (y)
-#    define _equal_(x, y) (x) == (y)
-#    define _diff_(x, y) (x) != (y)
-#    define _sup_(x, y) (x) > (y)
-#    define _supequal_(x, y) (x) >= (y)
-#    define _inf_(x, y) (x) < (y)
-#    define _infequal_(x, y) (x) <= (y)
-#endif
-#ifndef RB_SETUP
-extern integer  RB_SETUP;
-#endif
-#ifndef RB_RELEASE
-extern integer  RB_RELEASE;
-#endif
-#ifndef RB_SETUP_COMPLETE
-extern integer  RB_SETUP_COMPLETE;
-#endif
-#ifndef RB_SETUP_FAILURE
-extern integer  RB_SETUP_FAILURE;
-#endif
-#ifndef RB_RELEASE_COMPLETE
-extern integer  RB_RELEASE_COMPLETE;
-#endif
-#ifndef RB_RELEASE_FAILURE
-extern integer  RB_RELEASE_FAILURE;
-#endif
-#ifndef CELL_UPDATE
-extern integer  CELL_UPDATE;
-#endif
-#ifndef CELL_FACH
-extern integer  CELL_FACH;
-#endif
-static boolean  Var__ThisIsTheEnd__114;
-#define __Sig_sc_in_RB_Management_DOT_CELL_DCH_97 0
-static integer  Var_msg_113;
-#define __Sig_sc_go_45_RBSU_Failure_112 0
-static integer  Var_msg_111;
-#define __Sig_sc_go_36_CELL_DCH_109 1
-#define __Sig_sc_go_42_CELL_PCH_110 2
-static integer  Var_next_state_108;
-static integer  Var_msg_107;
-#define __Sig_Go_CELL_FACH_105 3
-#define __Sig_Go_CELL_DCH_104 4
-static boolean  Sig_INVALID_CONFIGURATION_103;
-static boolean  Sig_ORDERED_RECONFIGURATION_102;
-#define __Sig_RB_Establish_Success_98 5
-#define __Out_O_CELL_Update_Proc_96 6
-#define __Out_O_New_State_CELL_FACH_95 7
-#define __Out_O_New_State_CELL_DCH_94 8
-#define __Out_O_startT305_93 9
-#define __Out_O_SEND_CCCH_92 10
-static integer  Out_O_SEND_CCCH_92;
-#define __Out_O_SEND_DCCH_AM_91 11
-static integer  Out_O_SEND_DCCH_AM_91;
-#define __Out_O_CRLC_CONFIG_Req_90 12
-#define __Out_O_CMAC_CONFIG_Req_89 13
-#define __Out_O_CPHY_RL_RELEASE_Req_88 14
-#define __Out_O_CPHY_RL_SETUP_Req_87 15
-#define __Out_O_NAS_RB_RELEASE_Ind_86 16
-static integer  Out_O_NAS_RB_RELEASE_Ind_86;
-#define __Out_O_NAS_RB_ESTABLISH_Ind_85 17
-static integer  Out_O_NAS_RB_ESTABLISH_Ind_85;
-#define __In_I_Go_CELL_PCH_84 18
-#define __In_I_Go_CELL_FACH_83 19
-#define __In_I_Go_CELL_DCH_82 20
-#define __In_I_Go_Idle_81 21
-#define __In_I_IE_RRC_State_80 22
-static integer  In_I_IE_RRC_State_80;
-#define __In_I_Radio_Bearer_ID_79 23
-static integer  In_I_Radio_Bearer_ID_79;
-#define __In_I_RLC_Success_78 24
-#define __In_I_CRLC_STATUS_77 25
-#define __In_I_CPHY_OUT_OF_SYNCH_76 26
-#define __In_I_CPHY_SYNCH_Failure_75 27
-#define __In_I_CPHY_SYNCH_IND_74 28
-#define __In_I_Prot_Error_73 29
-static boolean  In_I_Prot_Error_73;
-#define __In_I_CELL_UPDATE_CONFIRM_72 30
-#define __In_I_RADIO_BEARER_RELEASE_71 31
-#define __In_I_RADIO_BEARER_SETUP_70 32
-#ifndef proc_IE_activ_Time
-extern void     proc_IE_activ_Time ();
-#endif
-#ifndef proc_IE_RNTIs
-extern void     proc_IE_RNTIs ();
-#endif
-#ifndef proc_IE_transaction
-extern void     proc_IE_transaction ();
-#endif
-#ifndef proc_IE_configuration
-extern void     proc_IE_configuration ();
-#endif
-#ifndef clear_C_RNTI
-extern void     clear_C_RNTI ();
-#endif
-#ifndef set_RRC_Transaction_ID
-extern void     set_RRC_Transaction_ID ();
-#endif
-#ifndef Select_Secondary_CCPCH
-extern void     Select_Secondary_CCPCH ();
-#endif
-#ifndef Select_PRACH
-extern void     Select_PRACH ();
-#endif
-#ifndef ue_clear_transaction
-extern void     ue_clear_transaction (integer);
-#endif
-#ifndef encode_message
-extern void     encode_message (integer *, integer);
-#endif
-#ifndef INTEGER_COMBINE
-extern integer  INTEGER_COMBINE (integer, integer);
-#endif
-#ifndef BOOLEAN_COMBINE
-extern boolean  BOOLEAN_COMBINE (boolean, boolean);
-#endif
-
-extern void     RRC_RB_UE_O_O_CELL_Update_Proc (void);
-extern void     RRC_RB_UE_O_O_New_State_CELL_FACH (void);
-extern void     RRC_RB_UE_O_O_New_State_CELL_DCH (void);
-extern void     RRC_RB_UE_O_O_startT305 (void);
-extern void     RRC_RB_UE_O_O_SEND_CCCH (integer);
-extern void     RRC_RB_UE_O_O_SEND_DCCH_AM (integer);
-extern void     RRC_RB_UE_O_O_CRLC_CONFIG_Req (void);
-extern void     RRC_RB_UE_O_O_CMAC_CONFIG_Req (void);
-extern void     RRC_RB_UE_O_O_CPHY_RL_RELEASE_Req (void);
-extern void     RRC_RB_UE_O_O_CPHY_RL_SETUP_Req (void);
-extern void     RRC_RB_UE_O_O_NAS_RB_RELEASE_Ind (integer);
-extern void     RRC_RB_UE_O_O_NAS_RB_ESTABLISH_Ind (integer);
-void
-RRC_RB_UE_I_I_Go_CELL_PCH (void)
-{
-  EMIT (_Sig, __In_I_Go_CELL_PCH_84);
-}
-
-void
-RRC_RB_UE_I_I_Go_CELL_FACH (void)
-{
-  EMIT (_Sig, __In_I_Go_CELL_FACH_83);
-}
-
-void
-RRC_RB_UE_I_I_Go_CELL_DCH (void)
-{
-  EMIT (_Sig, __In_I_Go_CELL_DCH_82);
-}
-
-void
-RRC_RB_UE_I_I_Go_Idle (void)
-{
-  EMIT (_Sig, __In_I_Go_Idle_81);
-}
-
-void
-RRC_RB_UE_I_I_IE_RRC_State (integer value)
-{
-  EMIT (_Sig, __In_I_IE_RRC_State_80);
-  _integer (&In_I_IE_RRC_State_80, value);
-}
-
-void
-RRC_RB_UE_I_I_Radio_Bearer_ID (integer value)
-{
-  EMIT (_Sig, __In_I_Radio_Bearer_ID_79);
-  _integer (&In_I_Radio_Bearer_ID_79, value);
-}
-
-void
-RRC_RB_UE_I_I_RLC_Success (void)
-{
-  EMIT (_Sig, __In_I_RLC_Success_78);
-}
-
-void
-RRC_RB_UE_I_I_CRLC_STATUS (void)
-{
-  EMIT (_Sig, __In_I_CRLC_STATUS_77);
-}
-
-void
-RRC_RB_UE_I_I_CPHY_OUT_OF_SYNCH (void)
-{
-  EMIT (_Sig, __In_I_CPHY_OUT_OF_SYNCH_76);
-}
-
-void
-RRC_RB_UE_I_I_CPHY_SYNCH_Failure (void)
-{
-  EMIT (_Sig, __In_I_CPHY_SYNCH_Failure_75);
-}
-
-void
-RRC_RB_UE_I_I_CPHY_SYNCH_IND (void)
-{
-  EMIT (_Sig, __In_I_CPHY_SYNCH_IND_74);
-}
-
-void
-RRC_RB_UE_I_I_Prot_Error (boolean value)
-{
-  EMIT (_Sig, __In_I_Prot_Error_73);
-  _boolean (&In_I_Prot_Error_73, value);
-}
-
-void
-RRC_RB_UE_I_I_CELL_UPDATE_CONFIRM (void)
-{
-  EMIT (_Sig, __In_I_CELL_UPDATE_CONFIRM_72);
-}
-
-void
-RRC_RB_UE_I_I_RADIO_BEARER_RELEASE (void)
-{
-  EMIT (_Sig, __In_I_RADIO_BEARER_RELEASE_71);
-}
-
-void
-RRC_RB_UE_I_I_RADIO_BEARER_SETUP (void)
-{
-  printf("\n Inside Esterel FSM  RRC_RB_UE_I_I_RADIO_BEARER_SETUP \n\n");
-  EMIT (_Sig, __In_I_RADIO_BEARER_SETUP_70);
-}
-
-static void
-Point_0 (void)
-{
-  /*#0 */
-  printf("\n Inside Esterel FSM  Point_0 \n\n");
-  _boolean (&Var__ThisIsTheEnd__114, 1);
-  CLEAR_SIGNAL (_SigPre_0, __Sig_sc_in_RB_Management_DOT_CELL_DCH_97);
-  CLEAR_SIGNAL (_SigPre_1, __Sig_sc_in_RB_Management_DOT_CELL_DCH_97);
-  _boolean (&Sig_ORDERED_RECONFIGURATION_102, 0);
-  _boolean (&Sig_INVALID_CONFIGURATION_103, 0);
-  _On[0] |= 0x8;                /* On: #3 */
-}
-
-static void
-Point_1 (void)
-{
-  /*#1 AutoPauseOn */
-  printf("\n Inside Esterel FSM  Point_1 \n\n");
-
-  if ((IS_SIGNAL (_Sig, __In_I_CPHY_OUT_OF_SYNCH_76) || IS_SIGNAL (_Sig, __In_I_CRLC_STATUS_77))) {
-    encode_message (&Var_msg_113, CELL_UPDATE);
-    EMIT (_Sig, __Out_O_SEND_CCCH_92);
-
-    if (!(IS_GUARD (7)))
-      _integer (&Out_O_SEND_CCCH_92, Var_msg_113);
-    else
-      _integer (&Out_O_SEND_CCCH_92, INTEGER_COMBINE (Out_O_SEND_CCCH_92, Var_msg_113));
-
-    SET_GUARD (7);
-    RRC_RB_UE_O_O_SEND_CCCH (Out_O_SEND_CCCH_92);
-    _On[0] &= ~0x2;             /* Off: #1 */
-    _Pause[0] |= 0x4;           /* PauseOn: #2 */
-  }
-}
-
-static void
-Point_2 (void)
-{
-  /*#2 AutoPauseOn */
-  printf("\n Inside Esterel FSM  Point_2 \n\n");
-
-  if (IS_SIGNAL (_Sig, __In_I_CELL_UPDATE_CONFIRM_72)) {
-    EMIT (_Sig, __Out_O_CELL_Update_Proc_96);
-
-    if (!(IS_GUARD (3))) {
-      RRC_RB_UE_O_O_CELL_Update_Proc ();
-      SET_GUARD (3);
-    }
-
-    _On[0] &= ~0x4;             /* Off: #2 */
-    _Pause[0] |= 0x2;           /* PauseOn: #1 */
-  }
-}
-
-static void
-Point_3 (void)
-{
-  /*#3 AutoPauseOn */
-  printf("\n Inside Esterel FSM  Point_3 \n\n");
-
-  if ((IS_SIGNAL (_Sig, __In_I_Go_CELL_DCH_82) || IS_SIGNAL (_Sig, __In_I_Go_CELL_FACH_83))) {
-    _integer (&Var_next_state_108, 1);
-    CLEAR_SIGNAL (_Sig, __Sig_sc_go_36_CELL_DCH_109);
-    _On[0] &= ~0x8;             /* Off: #3 */
-    _Pause[0] |= 0x200812;      /* PauseOn: #1 #4 #11 #21 */
-
-    if (IS_SIGNAL (_Sig, __In_I_Go_CELL_FACH_83)) {
-      SET_GUARD (0);
-    } else {
-      if (IS_SIGNAL (_Sig, __In_I_Go_CELL_DCH_82)) {
-        SET_GUARD (0);
-        EMIT (_Sig, __Sig_sc_go_36_CELL_DCH_109);
-      } else {
-        _Pause[0] |= 0x100000;  /* PauseOn: #20 */
-      }
-    }
-
-    if (IS_GUARD (0)) {
-      if (IS_SIGNAL (_Sig, __Sig_sc_go_36_CELL_DCH_109)) {
-        EMIT (_SigPre_0, __Sig_sc_in_RB_Management_DOT_CELL_DCH_97);
-        _Pause[0] |= 0x60000;   /* PauseOn: #17 #18 */
-      } else {
-        _Pause[0] |= 0x10000;   /* PauseOn: #16 */
-      }
-    }
-  }
-}
-
-static void
-Point_4 (void)
-{
-  /*#4 AutoPauseOn */
-  printf("\n Inside Esterel FSM  Point_4 \n\n");
-
-  if (IS_SIGNAL (_Sig, __In_I_RADIO_BEARER_SETUP_70)) {
-    printf ("\n\n Inside ESTEREL 1 \n");
-
-    if (!(IS_GUARD (0)))
-      _boolean (&Sig_ORDERED_RECONFIGURATION_102, 1);
-    else
-      _boolean (&Sig_ORDERED_RECONFIGURATION_102, BOOLEAN_COMBINE (Sig_ORDERED_RECONFIGURATION_102, 1));
-
-    SET_GUARD (0);
-    _On[0] &= ~0x10;            /* Off: #4 */
-
-    if (_eq_boolean (In_I_Prot_Error_73, 0)) {
-      printf ("\n\n Inside ESTEREL 2 \n");
-      proc_IE_activ_Time ();
-      proc_IE_RNTIs ();
-      proc_IE_transaction ();
-      proc_IE_configuration ();
-      EMIT (_Sig, __Out_O_CPHY_RL_SETUP_Req_87);
-
-      if (!(IS_GUARD (12))) {
-        RRC_RB_UE_O_O_CPHY_RL_SETUP_Req ();
-        SET_GUARD (12);
-      }
-
-      EMIT (_Sig, __Out_O_CMAC_CONFIG_Req_89);
-
-      if (!(IS_GUARD (10))) {
-        RRC_RB_UE_O_O_CMAC_CONFIG_Req ();
-        SET_GUARD (10);
-      }
-
-      _Pause[0] |= 0x20;        /* PauseOn: #5 */
-    } else {
-      if (!(IS_GUARD (0)))
-        _boolean (&Sig_INVALID_CONFIGURATION_103, 1);
-      else
-        _boolean (&Sig_INVALID_CONFIGURATION_103, BOOLEAN_COMBINE (Sig_INVALID_CONFIGURATION_103, 1));
-
-      SET_GUARD (0);
-      EMIT (_Sig, __Sig_sc_go_45_RBSU_Failure_112);
-      _On[0] |= 0x100;          /* On: #8 */
-    }
-  }
-}
-
-static void
-Point_5 (void)
-{
-  printf("\n Inside Esterel FSM  Point_5 \n\n");
-
-  /*#5 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __In_I_CPHY_SYNCH_IND_74)) {
-    _On[0] &= ~0x20;            /* Off: #5 */
-
-    if (IS_SIGNAL (_SigPre_1, __Sig_sc_in_RB_Management_DOT_CELL_DCH_97)) {
-      _Pause[0] |= 0x40;        /* PauseOn: #6 */
-    } else {
-      EMIT (_Sig, __Sig_Go_CELL_DCH_104);
-      clear_C_RNTI ();
-      _Pause[0] |= 0x40;        /* PauseOn: #6 */
-    }
-
-    EMIT (_Sig, __Out_O_CRLC_CONFIG_Req_90);
-
-    if (!(IS_GUARD (9))) {
-      RRC_RB_UE_O_O_CRLC_CONFIG_Req ();
-      SET_GUARD (9);
-    }
-
-    set_RRC_Transaction_ID ();
-    encode_message (&Var_msg_111, RB_SETUP_COMPLETE);
-    EMIT (_Sig, __Out_O_SEND_DCCH_AM_91);
-
-    if (!(IS_GUARD (8)))
-      _integer (&Out_O_SEND_DCCH_AM_91, Var_msg_111);
-    else
-      _integer (&Out_O_SEND_DCCH_AM_91, INTEGER_COMBINE (Out_O_SEND_DCCH_AM_91, Var_msg_111));
-
-    SET_GUARD (8);
-    _On[0] |= 0x4000;           /* On: #14 */
-  } else {
-    if (IS_SIGNAL (_Sig, __In_I_CPHY_SYNCH_Failure_75)) {
-      EMIT (_Sig, __Sig_sc_go_45_RBSU_Failure_112);
-      _On[0] |= 0x100;          /* On: #8 */
-      _On[0] &= ~0x20;          /* Off: #5 */
-    }
-  }
-}
-
-static void
-Point_6 (void)
-{
-  printf("\n Inside Esterel FSM  Point_6 \n\n");
-
-  /*#6 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __In_I_RLC_Success_78)) {
-    ue_clear_transaction (RB_SETUP);
-    EMIT (_Sig, __Sig_RB_Establish_Success_98);
-    _On[0] |= 0x80;             /* On: #7 */
-    _On[0] &= ~0x40;            /* Off: #6 */
-  }
-}
-
-static void
-Point_7 (void)
-{
-  printf("\n Inside Esterel FSM  Point_7 \n\n");
-
-  /*#7 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __Sig_RB_Establish_Success_98)) {
-    if (!(IS_GUARD (0)))
-      _boolean (&Sig_ORDERED_RECONFIGURATION_102, 0);
-    else
-      _boolean (&Sig_ORDERED_RECONFIGURATION_102, BOOLEAN_COMBINE (Sig_ORDERED_RECONFIGURATION_102, 0));
-
-    SET_GUARD (0);
-    EMIT (_Sig, __Out_O_NAS_RB_ESTABLISH_Ind_85);
-    _integer (&Out_O_NAS_RB_ESTABLISH_Ind_85, In_I_Radio_Bearer_ID_79);
-    RRC_RB_UE_O_O_NAS_RB_ESTABLISH_Ind (Out_O_NAS_RB_ESTABLISH_Ind_85);
-    _On[0] |= 0x100;            /* On: #8 */
-    _On[0] &= ~0x80;            /* Off: #7 */
-  }
-}
-
-static void
-Point_8 (void)
-{
-  printf("\n Inside Esterel FSM  Point_8 \n\n");
-
-  /*#8 */
-  if (IS_SIGNAL (_Sig, __Sig_sc_go_45_RBSU_Failure_112)) {
-    set_RRC_Transaction_ID ();
-    encode_message (&Var_msg_111, RB_SETUP_FAILURE);
-    EMIT (_Sig, __Out_O_SEND_DCCH_AM_91);
-
-    if (!(IS_GUARD (8)))
-      _integer (&Out_O_SEND_DCCH_AM_91, Var_msg_111);
-    else
-      _integer (&Out_O_SEND_DCCH_AM_91, INTEGER_COMBINE (Out_O_SEND_DCCH_AM_91, Var_msg_111));
-
-    SET_GUARD (8);
-    _On[0] |= 0x4000;           /* On: #14 */
-    _Pause[0] |= 0x200;         /* PauseOn: #9 */
-  } else {
-    _Pause[0] |= 0x10;          /* PauseOn: #4 */
-  }
-}
-
-static void
-Point_9 (void)
-{
-  printf("\n Inside Esterel FSM  Point_9 \n\n");
-
-  /*#9 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __In_I_RLC_Success_78)) {
-    if (!(IS_GUARD (0)))
-      _boolean (&Sig_INVALID_CONFIGURATION_103, 0);
-    else
-      _boolean (&Sig_INVALID_CONFIGURATION_103, BOOLEAN_COMBINE (Sig_INVALID_CONFIGURATION_103, 0));
-
-    SET_GUARD (0);
-
-    if (!(IS_GUARD (0)))
-      _boolean (&Sig_ORDERED_RECONFIGURATION_102, 0);
-    else
-      _boolean (&Sig_ORDERED_RECONFIGURATION_102, BOOLEAN_COMBINE (Sig_ORDERED_RECONFIGURATION_102, 0));
-
-    SET_GUARD (0);
-    _On[0] &= ~0x200;           /* Off: #9 */
-    _Pause[0] |= 0x10;          /* PauseOn: #4 */
-  }
-}
-
-static void
-Point_10 (void)
-{
-  printf("\n Inside Esterel FSM  Point_10 \n\n");
-
-  /*#10 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __In_I_RLC_Success_78)) {
-    if (!(IS_GUARD (0)))
-      _boolean (&Sig_ORDERED_RECONFIGURATION_102, 0);
-    else
-      _boolean (&Sig_ORDERED_RECONFIGURATION_102, BOOLEAN_COMBINE (Sig_ORDERED_RECONFIGURATION_102, 0));
-
-    SET_GUARD (0);
-    ue_clear_transaction (RB_RELEASE);
-    _On[0] &= ~0x400;           /* Off: #10 */
-    _Pause[0] |= 0x800;         /* PauseOn: #11 */
-  }
-}
-
-static void
-Point_11 (void)
-{
-  printf("\n Inside Esterel FSM  Point_11 \n\n");
-
-  /*#11 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __In_I_RADIO_BEARER_RELEASE_71)) {
-    if (!(IS_GUARD (0)))
-      _boolean (&Sig_ORDERED_RECONFIGURATION_102, 1);
-    else
-      _boolean (&Sig_ORDERED_RECONFIGURATION_102, BOOLEAN_COMBINE (Sig_ORDERED_RECONFIGURATION_102, 1));
-
-    SET_GUARD (0);
-    _On[0] &= ~0x800;           /* Off: #11 */
-
-    if (_eq_boolean (In_I_Prot_Error_73, 0)) {
-      _On[0] |= 0x1000;         /* On: #12 */
-    } else {
-      _On[0] |= 0x2000;         /* On: #13 */
-    }
-  }
-}
-
-static void
-Point_12 (void)
-{
-  printf("\n Inside Esterel FSM  Point_12 \n\n");
-  /*#12 */
-  _integer (&Var_next_state_108, In_I_IE_RRC_State_80);
-  proc_IE_activ_Time ();
-  proc_IE_RNTIs ();
-  proc_IE_transaction ();
-  proc_IE_configuration ();
-  EMIT (_Sig, __Out_O_CRLC_CONFIG_Req_90);
-
-  if (!(IS_GUARD (9))) {
-    RRC_RB_UE_O_O_CRLC_CONFIG_Req ();
-    SET_GUARD (9);
-  }
-
-  EMIT (_Sig, __Out_O_CMAC_CONFIG_Req_89);
-
-  if (!(IS_GUARD (10))) {
-    RRC_RB_UE_O_O_CMAC_CONFIG_Req ();
-    SET_GUARD (10);
-  }
-
-  EMIT (_Sig, __Out_O_CPHY_RL_RELEASE_Req_88);
-
-  if (!(IS_GUARD (11))) {
-    RRC_RB_UE_O_O_CPHY_RL_RELEASE_Req ();
-    SET_GUARD (11);
-  }
-
-  if (_eq_integer (Var_next_state_108, CELL_FACH)) {
-    EMIT (_Sig, __Sig_Go_CELL_FACH_105);
-    Select_Secondary_CCPCH ();
-    Select_PRACH ();
-    EMIT (_Sig, __Out_O_startT305_93);
-
-    if (!(IS_GUARD (6))) {
-      RRC_RB_UE_O_O_startT305 ();
-      SET_GUARD (6);
-    }
-
-    _Pause[0] |= 0x400;         /* PauseOn: #10 */
-  } else {
-    _Pause[0] |= 0x400;         /* PauseOn: #10 */
-  }
-
-  EMIT (_Sig, __Out_O_NAS_RB_RELEASE_Ind_86);
-  _integer (&Out_O_NAS_RB_RELEASE_Ind_86, In_I_Radio_Bearer_ID_79);
-  set_RRC_Transaction_ID ();
-  encode_message (&Var_msg_107, RB_RELEASE_COMPLETE);
-  EMIT (_Sig, __Out_O_SEND_DCCH_AM_91);
-
-  if (!(IS_GUARD (8)))
-    _integer (&Out_O_SEND_DCCH_AM_91, Var_msg_107);
-  else
-    _integer (&Out_O_SEND_DCCH_AM_91, INTEGER_COMBINE (Out_O_SEND_DCCH_AM_91, Var_msg_107));
-
-  SET_GUARD (8);
-  RRC_RB_UE_O_O_NAS_RB_RELEASE_Ind (Out_O_NAS_RB_RELEASE_Ind_86);
-  _On[0] |= 0x4000;             /* On: #14 */
-}
-
-static void
-Point_13 (void)
-{
-  printf("\n Inside Esterel FSM  Point_13 \n\n");
-
-  /*#13 */
-  if (!(IS_GUARD (0)))
-    _boolean (&Sig_INVALID_CONFIGURATION_103, 1);
-  else
-    _boolean (&Sig_INVALID_CONFIGURATION_103, BOOLEAN_COMBINE (Sig_INVALID_CONFIGURATION_103, 1));
-
-  SET_GUARD (0);
-  set_RRC_Transaction_ID ();
-  encode_message (&Var_msg_107, RB_RELEASE_FAILURE);
-  EMIT (_Sig, __Out_O_SEND_DCCH_AM_91);
-
-  if (!(IS_GUARD (8)))
-    _integer (&Out_O_SEND_DCCH_AM_91, Var_msg_107);
-  else
-    _integer (&Out_O_SEND_DCCH_AM_91, INTEGER_COMBINE (Out_O_SEND_DCCH_AM_91, Var_msg_107));
-
-  SET_GUARD (8);
-  _On[0] |= 0x4000;             /* On: #14 */
-  _Pause[0] |= 0x8000;          /* PauseOn: #15 */
-}
-
-static void
-Point_14 (void)
-{
-  /*#14 */
-  RRC_RB_UE_O_O_SEND_DCCH_AM (Out_O_SEND_DCCH_AM_91);
-}
-
-static void
-Point_15 (void)
-{
-  printf("\n Inside Esterel FSM  Point_15 \n\n");
-
-  /*#15 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __In_I_RLC_Success_78)) {
-    if (!(IS_GUARD (0)))
-      _boolean (&Sig_INVALID_CONFIGURATION_103, 0);
-    else
-      _boolean (&Sig_INVALID_CONFIGURATION_103, BOOLEAN_COMBINE (Sig_INVALID_CONFIGURATION_103, 0));
-
-    SET_GUARD (0);
-
-    if (!(IS_GUARD (0)))
-      _boolean (&Sig_ORDERED_RECONFIGURATION_102, 0);
-    else
-      _boolean (&Sig_ORDERED_RECONFIGURATION_102, BOOLEAN_COMBINE (Sig_ORDERED_RECONFIGURATION_102, 0));
-
-    SET_GUARD (0);
-    _On[0] &= ~0x8000;          /* Off: #15 */
-    _Pause[0] |= 0x800;         /* PauseOn: #11 */
-  }
-}
-
-static void
-Point_16 (void)
-{
-  printf("\n Inside Esterel FSM  Point_16 \n\n");
-
-  /*#16 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __Sig_Go_CELL_DCH_104)) {
-    EMIT (_Sig, __Out_O_New_State_CELL_DCH_94);
-
-    if (!(IS_GUARD (5))) {
-      RRC_RB_UE_O_O_New_State_CELL_DCH ();
-      SET_GUARD (5);
-    }
-
-    EMIT (_Sig, __Sig_sc_go_36_CELL_DCH_109);
-    _On[0] |= 0x80000;          /* On: #19 */
-    _On[0] &= ~0x10000;         /* Off: #16 */
-  } else {
-    if (IS_SIGNAL (_Sig, __In_I_Go_CELL_DCH_82)) {
-      EMIT (_Sig, __Sig_sc_go_36_CELL_DCH_109);
-      _On[0] |= 0x80000;        /* On: #19 */
-      _On[0] &= ~0x10000;       /* Off: #16 */
-    } else {
-      if (IS_SIGNAL (_Sig, __In_I_Go_CELL_PCH_84)) {
-        EMIT (_Sig, __Sig_sc_go_42_CELL_PCH_110);
-        _On[0] |= 0x80000;      /* On: #19 */
-        _On[0] &= ~0x10000;     /* Off: #16 */
-      }
-    }
-  }
-}
-
-static void
-Point_17 (void)
-{
-  printf("\n Inside Esterel FSM  Point_17 \n\n");
-  /*#17 AutoPauseOn */
-  EMIT (_SigPre_0, __Sig_sc_in_RB_Management_DOT_CELL_DCH_97);
-}
-
-static void
-Point_18 (void)
-{
-  printf("\n Inside Esterel FSM  Point_18 \n\n");
-
-  /*#18 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __Sig_Go_CELL_FACH_105)) {
-    EMIT (_Sig, __Out_O_New_State_CELL_FACH_95);
-
-    if (!(IS_GUARD (4))) {
-      RRC_RB_UE_O_O_New_State_CELL_FACH ();
-      SET_GUARD (4);
-    }
-
-    _On[0] |= 0x80000;          /* On: #19 */
-    _On[0] &= ~0x40000;         /* Off: #18 */
-    _Pause[0] &= ~0x20000;
-    _On[0] &= ~0x20000;         /* PauseOff: #17 */
-  } else {
-    if (IS_SIGNAL (_Sig, __In_I_Go_CELL_FACH_83)) {
-      _On[0] |= 0x80000;        /* On: #19 */
-      _On[0] &= ~0x40000;       /* Off: #18 */
-      _Pause[0] &= ~0x20000;
-      _On[0] &= ~0x20000;       /* PauseOff: #17 */
-    } else {
-      if (IS_SIGNAL (_Sig, __In_I_Go_CELL_PCH_84)) {
-        EMIT (_Sig, __Sig_sc_go_42_CELL_PCH_110);
-        _On[0] |= 0x80000;      /* On: #19 */
-        _On[0] &= ~0x40000;     /* Off: #18 */
-        _Pause[0] &= ~0x20000;
-        _On[0] &= ~0x20000;     /* PauseOff: #17 */
-      }
-    }
-  }
-}
-
-static void
-Point_19 (void)
-{
-  printf("\n Inside Esterel FSM  Point_19 \n\n");
-
-  /*#19 */
-  if (IS_SIGNAL (_Sig, __Sig_sc_go_42_CELL_PCH_110)) {
-  } else {
-    if (IS_SIGNAL (_Sig, __Sig_sc_go_36_CELL_DCH_109)) {
-      EMIT (_SigPre_0, __Sig_sc_in_RB_Management_DOT_CELL_DCH_97);
-      _Pause[0] |= 0x60000;     /* PauseOn: #17 #18 */
-    } else {
-      _Pause[0] |= 0x10000;     /* PauseOn: #16 */
-    }
-  }
-}
-
-static void
-Point_20 (void)
-{
-  printf("\n Inside Esterel FSM  Point_20 \n\n");
-
-  /*#20 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __In_I_Go_CELL_FACH_83)) {
-    SET_GUARD (1);
-    _On[0] &= ~0x100000;        /* Off: #20 */
-  } else {
-    if (IS_SIGNAL (_Sig, __In_I_Go_CELL_DCH_82)) {
-      SET_GUARD (1);
-      EMIT (_Sig, __Sig_sc_go_36_CELL_DCH_109);
-      _On[0] &= ~0x100000;      /* Off: #20 */
-    }
-  }
-
-  if (IS_GUARD (1)) {
-    if (IS_SIGNAL (_Sig, __Sig_sc_go_36_CELL_DCH_109)) {
-      EMIT (_SigPre_0, __Sig_sc_in_RB_Management_DOT_CELL_DCH_97);
-      _Pause[0] |= 0x60000;     /* PauseOn: #17 #18 */
-    } else {
-      _Pause[0] |= 0x10000;     /* PauseOn: #16 */
-    }
-  }
-}
-
-static void
-Point_21 (void)
-{
-  printf("\n Inside Esterel FSM  Point_21 \n\n");
-
-  /*#21 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __In_I_Go_Idle_81)) {
-    _On[0] &= ~0x200000;        /* Off: #21 */
-    _Pause[0] &= ~0x179ef6;
-    _On[0] &= ~0x178ef6;        /* PauseOff: #1 #2 #4 #5 #6 #7 #9 #10 #11 #12 #15 #16 #17 #18 #20 */
-
-    if ((IS_SIGNAL (_Sig, __In_I_Go_CELL_DCH_82) || IS_SIGNAL (_Sig, __In_I_Go_CELL_FACH_83))) {
-      _integer (&Var_next_state_108, 1);
-      CLEAR_SIGNAL (_Sig, __Sig_sc_go_36_CELL_DCH_109);
-      _Pause[0] |= 0x200812;    /* PauseOn: #1 #4 #11 #21 */
-
-      if (IS_SIGNAL (_Sig, __In_I_Go_CELL_FACH_83)) {
-        SET_GUARD (2);
-      } else {
-        if (IS_SIGNAL (_Sig, __In_I_Go_CELL_DCH_82)) {
-          SET_GUARD (2);
-          EMIT (_Sig, __Sig_sc_go_36_CELL_DCH_109);
-        } else {
-          _Pause[0] |= 0x100000;        /* PauseOn: #20 */
-        }
-      }
-
-      if (IS_GUARD (2)) {
-        if (IS_SIGNAL (_Sig, __Sig_sc_go_36_CELL_DCH_109)) {
-          EMIT (_SigPre_0, __Sig_sc_in_RB_Management_DOT_CELL_DCH_97);
-          _Pause[0] |= 0x60000; /* PauseOn: #17 #18 */
-        } else {
-          _Pause[0] |= 0x10000; /* PauseOn: #16 */
-        }
-      }
-    } else {
-      _Pause[0] |= 0x8;         /* PauseOn: #3 */
-    }
-  }
-}
-
-
-int
-RRC_RB_UE (void)
-{
-  unsigned int   *Points;
-
-  Points = _On;
-
-  if (*Points) {
-    if (*Points & 0x1) {
-      Point_0 ();
-    }
-
-    if (*Points & 0x2) {
-      Point_1 ();
-    }
-
-    if (*Points & 0x4) {
-      Point_2 ();
-    }
-
-    if (*Points & 0x8) {
-      Point_3 ();
-    }
-
-    if (*Points & 0x10) {
-      Point_4 ();
-    }
-
-    if (*Points & 0x20) {
-      Point_5 ();
-    }
-
-    if (*Points & 0x40) {
-      Point_6 ();
-    }
-
-    if (*Points & 0x80) {
-      Point_7 ();
-    }
-
-    if (*Points & 0x100) {
-      Point_8 ();
-    }
-
-    if (*Points & 0x200) {
-      Point_9 ();
-    }
-
-    if (*Points & 0x400) {
-      Point_10 ();
-    }
-
-    if (*Points & 0x800) {
-      Point_11 ();
-    }
-
-    if (*Points & 0x1000) {
-      Point_12 ();
-    }
-
-    if (*Points & 0x2000) {
-      Point_13 ();
-    }
-
-    if (*Points & 0x4000) {
-      Point_14 ();
-    }
-
-    if (*Points & 0x8000) {
-      Point_15 ();
-    }
-
-    if (*Points & 0x10000) {
-      Point_16 ();
-    }
-
-    if (*Points & 0x20000) {
-      Point_17 ();
-    }
-
-    if (*Points & 0x40000) {
-      Point_18 ();
-    }
-
-    if (*Points & 0x80000) {
-      Point_19 ();
-    }
-
-    if (*Points & 0x100000) {
-      Point_20 ();
-    }
-
-    if (*Points & 0x200000) {
-      Point_21 ();
-    }
-  }
-
-  Points++;
-  {
-    int             j;
-    unsigned int   *_tmp;
-
-    _tmp = _SigPre_1;
-    _SigPre_1 = _SigPre_0;
-    _SigPre_0 = _tmp;
-
-    for (j = 0; j < SIGNAL_WITH_PRE_VECTOR_SIZE; j++)
-      _SigPre_0[j] = 0;
-
-    for (j = 0; j < SIGNAL_VECTOR_SIZE; j++)
-      _Sig[j] = 0;
-
-    _On[0] = _Pause[0] | (_On[0] & 0x378efe);
-
-    /* AutoPauseOn: #1 #2 #3 #4 #5 #6 #7 #9 #10 #11 #15 #16 #17 #18 #20 #21 */
-    for (j = 0; j < HALT_POINT_VECTOR_SIZE; j++)
-      _Pause[j] = 0;
-
-    for (j = 0; j < GUARD_VECTOR_SIZE; j++)
-      _Guard[j] = 0;
-  }
-  return Var__ThisIsTheEnd__114;
-}
-
-int
-RRC_RB_UE_reset (void)
-{
-  int             i, j;
-
-  for (j = 0; j < SIGNAL_VECTOR_SIZE; j++)
-    _Sig[j] = 0;
-
-  for (i = 0; i < GLOBALMAXPRELEVEL; i++)
-    for (j = 0; j < SIGNAL_WITH_PRE_VECTOR_SIZE; j++)
-      _SigPreTab[i][j] = 0;
-
-  _boolean (&In_I_Prot_Error_73, 0);
-
-  for (i = 0; i < HALT_POINT_VECTOR_SIZE; i++)
-    _On[i] = 0;
-
-  for (i = 0; i < HALT_POINT_VECTOR_SIZE; i++)
-    _Pause[i] = 0;
-
-  for (i = 0; i < GUARD_VECTOR_SIZE; i++)
-    _Guard[i] = 0;
-
-  BIT_SET (_On, 0);
-  return 1;
-}
-
-typedef int     (*SimInitFunc_t) ();
-int
-RRC_RB_UE_init (char **pError, SimInitFunc_t pFunc)
-{
-  return 1;
-}
-typedef int     (*SimEndFunc_t) ();
-int
-RRC_RB_UE_end (SimEndFunc_t pFunc)
-{
-  return 1;
-}
-
-int
-RRC_RB_UE_run (void)
-{
-  return RRC_RB_UE ();
-}
-
-int
-RRC_RB_UE_getError (void)
-{
-  return 0;
-}
-
-char           *
-RRC_RB_UE_getErrorMessage (void)
-{
-  return (char *) 0;
-}
diff --git a/openair2/RRC/CELLULAR/rrc_rg.c b/openair2/RRC/CELLULAR/rrc_rg.c
deleted file mode 100755
index 4eac501801..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg.c
+++ /dev/null
@@ -1,2143 +0,0 @@
-/***************************************************************************
-                            rrc_rg.c
-                           -------------------
-    begin                : May 31, 2002
-    copyright            : (C) 2002, 2010 by Eurecom
-    author               : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  This file contains the code generated by the Esterel engine
-
-  IT MUST NOT BE MODIFIED MANUALLY
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-//-----------------------------------------------------------------------------
-//#include "rrc_rg_vars.h"
-#include "rrc_rg.h"
-//-----------------------------------------------------------------------------
-/* "SAXORT STRL Compiler version 3.1.6n compiled on Fri_Oct_18_15:50:53_CEST_2002" */
-
-/* automaton kernel code*/
-//#include <stdlib.h>
-//#include <stdio.h>
-//#include <string.h>
-#define SIZEOFINT 32
-#define B_SET_VECTOR_MASK(i) ((unsigned int)1 << i)
-#define B_RES_VECTOR_MASK(i) (~((unsigned int)1 << i))
-#define BIT_SET(b_vector, bit_number) (b_vector)[(bit_number) / SIZEOFINT] |= B_SET_VECTOR_MASK((bit_number) % SIZEOFINT)
-#define BIT_RESET(b_vector, bit_number) (b_vector)[(bit_number) / SIZEOFINT] &= ~B_SET_VECTOR_MASK((bit_number) % SIZEOFINT)
-
-#define IS_ON(point) (_On[point / SIZEOFINT] & B_SET_VECTOR_MASK(point % SIZEOFINT))
-#define IS_PAUSE_ON(point) (_Pause[point / SIZEOFINT] & B_SET_VECTOR_MASK(point % SIZEOFINT))
-
-#define HALT_POINT_NUM 77
-#define HALT_POINT_VECTOR_SIZE ((HALT_POINT_NUM-1)/(int)SIZEOFINT)+1
-static unsigned int _On[HALT_POINT_VECTOR_SIZE];
-static unsigned int _Pause[HALT_POINT_VECTOR_SIZE];
-
-#define SIGNAL_NUM 63
-#define SIGNAL_VECTOR_SIZE 2
-#define SIGNAL_WITH_PRE_VECTOR_SIZE 1
-#define GLOBALMAXPRELEVEL 1
-static unsigned int _Sig[SIGNAL_VECTOR_SIZE];
-#define EMIT(vector, signal) (vector)[signal / SIZEOFINT] |= B_SET_VECTOR_MASK(signal % SIZEOFINT)
-#define CLEAR_SIGNAL(vector, signal) (vector)[signal / SIZEOFINT] &= B_RES_VECTOR_MASK(signal % SIZEOFINT)
-#define IS_SIGNAL(vector, signal) ((vector)[signal / SIZEOFINT] & B_SET_VECTOR_MASK(signal % SIZEOFINT))
-
-#define GUARD_NUM 20
-#define GUARD_VECTOR_SIZE ((GUARD_NUM-1)/(int)SIZEOFINT)+1
-static unsigned int _Guard[GUARD_VECTOR_SIZE];
-#define IS_GUARD(guard) (_Guard[guard / SIZEOFINT] & B_SET_VECTOR_MASK(guard % SIZEOFINT))
-#define SET_GUARD(guard) _Guard[guard / SIZEOFINT] |= B_SET_VECTOR_MASK(guard % SIZEOFINT)
-#define RESET_GUARD(guard) _Guard[guard / SIZEOFINT] &= B_RES_VECTOR_MASK(guard % SIZEOFINT)
-
-#ifndef _PREDEFINED_TYPES
-#define _PREDEFINED_TYPES
-typedef  int boolean;
-typedef  int integer;
-#ifndef STRLEN
-#define STRLEN 81
-#endif
-typedef char *string;
-#define _integer(x, y) (*x) = (y)
-#define _boolean(x, y) (*x) = (y)
-#define _float(x, y) (*x) = (y)
-#define _double(x, y) (*x) = (y)
-#define _string(x, y) strcpy((*x), (y))
-#define _eq_integer(x, y) ((x) == (y))
-#define _eq_boolean(x, y) ((x) == (y))
-#define _eq_float(x, y) ((x) == (y))
-#define _eq_double(x, y) ((x) == (y))
-#define _eq_string(x, y) (!strcmp((x), (y)))
-#define _ne_integer(x, y) ((x) != (y))
-#define _ne_boolean(x, y) ((x) != (y))
-#define _ne_float(x, y) ((x) != (y))
-#define _ne_double(x, y) ((x) != (y))
-#define _ne_string(x, y) (strcmp((x), (y)))
-#define _cond_integer(x, y, z) ((x)?(y):(z))
-#define _cond_boolean(x, y, z) ((x)?(y):(z))
-#define _cond_float(x, y, z) ((x)?(y):(z))
-#define _cond_double(x, y, z) ((x)?(y):(z))
-#define _cond_string(x, y, z) ((x)?(y):(z))
-#define _string_to_text(x) (x)
-#define _text_to_string(x, y) (strcpy((*x), (y)))
-#define _plus_(x, y) (x) + (y)
-#define _minus_(x, y) (x) - (y)
-#define _times_(x, y) (x) * (y)
-#define _div_(x, y) (x) / (y)
-#define _mod_(x, y) (x) % (y)
-#define _not_(x) !(x)
-#define _or_(x, y) (x) || (y)
-#define _and_(x, y) (x) && (y)
-#define _equal_(x, y) (x) == (y)
-#define _diff_(x, y) (x) != (y)
-#define _sup_(x, y) (x) > (y)
-#define _supequal_(x, y) (x) >= (y)
-#define _inf_(x, y) (x) < (y)
-#define _infequal_(x, y) (x) <= (y)
-#endif
-#ifndef SUCCESS
-extern integer SUCCESS;
-#endif
-#ifndef FAILURE
-extern integer FAILURE;
-#endif
-#ifndef RRC_CONN_SETUP
-extern integer RRC_CONN_SETUP;
-#endif
-#ifndef RRC_CONN_REJECT
-extern integer RRC_CONN_REJECT;
-#endif
-#ifndef RRC_CONN_RELEASE
-extern integer RRC_CONN_RELEASE;
-#endif
-#ifndef RB_SETUP
-extern integer RB_SETUP;
-#endif
-#ifndef RB_RELEASE
-extern integer RB_RELEASE;
-#endif
-#ifndef CELL_UPDATE_CONFIRM
-extern integer CELL_UPDATE_CONFIRM;
-#endif
-#ifndef Conn_Received
-extern integer Conn_Received;
-#endif
-#ifndef CELL_FACH_Connecting
-extern integer CELL_FACH_Connecting;
-#endif
-#ifndef CELL_DCH_Connecting
-extern integer CELL_DCH_Connecting;
-#endif
-#ifndef CELL_FACH_Connected
-extern integer CELL_FACH_Connected;
-#endif
-#ifndef CELL_DCH_Connected
-extern integer CELL_DCH_Connected;
-#endif
-#ifndef CELL_FACH_Releasing
-extern integer CELL_FACH_Releasing;
-#endif
-#ifndef CELL_DCH_Releasing
-extern integer CELL_DCH_Releasing;
-#endif
-#ifndef REL_COUNT
-extern integer REL_COUNT;
-#endif
-#ifndef E_ADD_MT
-extern integer E_ADD_MT;
-#endif
-#ifndef E_REL_MT
-extern integer E_REL_MT;
-#endif
-#ifndef E_ADD_RB
-extern integer E_ADD_RB;
-#endif
-#ifndef E_REL_RB
-extern integer E_REL_RB;
-#endif
-#ifndef RB_FAIL_IDLE_MOBILE
-extern integer RB_FAIL_IDLE_MOBILE;
-#endif
-#ifndef RB_FAIL_INVALID_CONFIG
-extern integer RB_FAIL_INVALID_CONFIG;
-#endif
-#ifndef RB_FAIL_RLC_FAILURE
-extern integer RB_FAIL_RLC_FAILURE;
-#endif
-#ifndef RB_FAIL_UE_SETUP_FAILURE
-extern integer RB_FAIL_UE_SETUP_FAILURE;
-#endif
-static boolean Var__ThisIsTheEnd__171 ;
-#define __Sig_Conn_Establish_complete_128 0
-static integer Sig_UE_Id_129 ;
-static integer Sig_Curr_State_130 ;
-static integer Var_msg_132 ;
-#define __Sig_sc_go_26_ConnEstab_REJECT_133 1
-static integer Var_msgReq_134 ;
-static  int Sig_Rel_repeat_135_Pre0 = 0;
-static  int Sig_Rel_repeat_135_Pre1 = 0;
-static integer Sig_Rel_repeat_135[2] ;
-static integer Var_msg_137 ;
-#define __Sig_sc_go_42_ConnRel_CFG_138 2
-#define __Sig_sc_go_30_ConnRel_Send_136 3
-static integer Var_msg_139 ;
-#define __Sig_sc_cond12_144 4
-#define __Sig_sc_cond14_147 5
-#define __Sig_sc_cond13_148 6
-#define __Sig_sc_cond16_151 7
-#define __Sig_sc_cond15_152 8
-#define __Sig_sc_go_34_RbEstab_Ack_142 9
-#define __Sig_sc_go_41_RbEstab_fail_141 10
-#define __Sig_sc_go_35_RbEstab_InitFailure_140 11
-static integer Var_msg_154 ;
-#define __Sig_sc_cond10_156 12
-#define __Sig_sc_go_6_RelComp_CFG_159 13
-#define __Sig_sc_go_14_RelComp_Proc_158 14
-#define __Sig_sc_go_40_RbComp_L2_160 15
-static integer Var_msg_161 ;
-#define __Sig_sc_cond2_165 16
-#define __Sig_sc_cond3_164 17
-#define __Sig_sc_go_54_CellU_fail_162 18
-#define __Sig_sc_cond8_168 19
-#define __Sig_sc_go_48_RbFail_Phy_170 20
-#define __Out_O_RB_failure_code_127 21
-static integer Out_O_RB_failure_code_127 ;
-#define __Out_O_Compute_Configuration_126 22
-static integer Out_O_Compute_Configuration_126 ;
-#define __Out_O_Action_125 23
-static integer Out_O_Action_125 ;
-#define __Out_O_CRLC_CONFIG_Req_124 24
-#define __Out_O_CMAC_CONFIG_Req_123 25
-#define __Out_O_CPHY_RL_RELEASE_Req_122 26
-#define __Out_O_CPHY_RL_SETUP_Req_121 27
-#define __Out_O_SEND_DCCH_AM_120 28
-static integer Out_O_SEND_DCCH_AM_120 ;
-#define __Out_O_SEND_DCCH_UM_119 29
-static integer Out_O_SEND_DCCH_UM_119 ;
-#define __Out_O_SEND_CCCH_118 30
-static integer Out_O_SEND_CCCH_118 ;
-#define __Out_O_NAS_CONN_LOSS_IND_117 31
-static integer Out_O_NAS_CONN_LOSS_IND_117 ;
-#define __Out_O_NAS_RB_Failure_116 32
-static integer Out_O_NAS_RB_Failure_116 ;
-#define __Out_O_NAS_RB_ESTAB_CNF_115 33
-static integer Out_O_NAS_RB_ESTAB_CNF_115 ;
-#define __Out_O_NAS_CONN_RELEASE_IND_114 34
-static integer Out_O_NAS_CONN_RELEASE_IND_114 ;
-#define __Out_O_NAS_CONN_ESTAB_IND_113 35
-static integer Out_O_NAS_CONN_ESTAB_IND_113 ;
-#define __In_I_Configuration_Failure_112 36
-#define __In_I_Configuration_Indication_111 37
-#define __In_I_Last_RB_110 38
-#define __In_I_RB_List_109 39
-static integer In_I_RB_List_109 ;
-#define __In_I_Status_108 40
-static integer In_I_Status_108 ;
-#define __In_I_RLC_Failure_107 41
-static integer In_I_RLC_Failure_107 ;
-#define __In_I_RLC_Success_106 42
-static integer In_I_RLC_Success_106 ;
-#define __In_I_CRLC_STATUS_105 43
-static integer In_I_CRLC_STATUS_105 ;
-#define __In_I_CPHY_RL_MODIFY_Cnf_104 44
-static integer In_I_CPHY_RL_MODIFY_Cnf_104 ;
-#define __In_I_CPHY_RL_SETUP_Cnf_103 45
-static integer In_I_CPHY_RL_SETUP_Cnf_103 ;
-#define __In_I_CPHY_CONNECTION_LOSS_102 46
-static integer In_I_CPHY_CONNECTION_LOSS_102 ;
-#define __In_I_CPHY_OUT_OF_SYNCH_101 47
-static integer In_I_CPHY_OUT_OF_SYNCH_101 ;
-#define __In_I_CPHY_SYNCH_Failure_100 48
-static integer In_I_CPHY_SYNCH_Failure_100 ;
-#define __In_I_CPHY_SYNCH_IND_99 49
-static integer In_I_CPHY_SYNCH_IND_99 ;
-#define __In_I_NAS_RB_RELEASE_REQ_98 50
-static integer In_I_NAS_RB_RELEASE_REQ_98 ;
-#define __In_I_NAS_RB_ESTAB_REQ_97 51
-static integer In_I_NAS_RB_ESTAB_REQ_97 ;
-#define __In_I_NAS_CONN_RELEASE_REQ_96 52
-static integer In_I_NAS_CONN_RELEASE_REQ_96 ;
-#define __In_I_NAS_CONN_ESTAB_CNF_95 53
-static integer In_I_NAS_CONN_ESTAB_CNF_95 ;
-#define __In_I_CELL_UPDATE_94 54
-static integer In_I_CELL_UPDATE_94 ;
-#define __In_I_RB_REL_FAILURE_93 55
-static integer In_I_RB_REL_FAILURE_93 ;
-#define __In_I_RB_REL_COMPLETE_92 56
-static integer In_I_RB_REL_COMPLETE_92 ;
-#define __In_I_RB_SETUP_FAILURE_91 57
-static integer In_I_RB_SETUP_FAILURE_91 ;
-#define __In_I_RB_SETUP_COMPLETE_90 58
-static integer In_I_RB_SETUP_COMPLETE_90 ;
-#define __In_I_RRC_CONN_REL_COMPLETE_89 59
-static integer In_I_RRC_CONN_REL_COMPLETE_89 ;
-#define __In_I_RRC_CONNECTION_RELEASE_88 60
-static integer In_I_RRC_CONNECTION_RELEASE_88 ;
-#define __In_I_RRC_CONN_SETUP_COMPLETE_87 61
-static integer In_I_RRC_CONN_SETUP_COMPLETE_87 ;
-#define __In_I_RRC_CONNECTION_REQUEST_86 62
-static integer In_I_RRC_CONNECTION_REQUEST_86 ;
-#ifndef create_Mobile
-extern void create_Mobile(integer);
-#endif
-#ifndef update_Mobile
-extern void update_Mobile(integer, integer);
-#endif
-#ifndef delete_Mobile
-extern void delete_Mobile(integer);
-#endif
-#ifndef release_DCH_Resources
-extern void release_DCH_Resources(integer);
-#endif
-#ifndef restore_former_config
-extern void restore_former_config(integer);
-#endif
-#ifndef encode_message
-extern void encode_message(integer*, integer, integer);
-#endif
-#ifndef proc_RB_List
-extern void proc_RB_List(integer*, integer, integer);
-#endif
-#ifndef rg_clear_transaction
-extern void rg_clear_transaction(integer, integer);
-#endif
-#ifndef clear_rbsetup_variables
-extern void clear_rbsetup_variables(integer);
-#endif
-#ifndef clear_rbrelease_variables
-extern void clear_rbrelease_variables(integer);
-#endif
-#ifndef rg_update_UE_numrb
-extern void rg_update_UE_numrb(integer, integer);
-#endif
-#ifndef Current_State
-extern integer Current_State(integer);
-#endif
-#ifndef INTEGER_COMBINE
-extern integer INTEGER_COMBINE(integer, integer);
-#endif
-
-extern void RRC_RG_O_O_RB_failure_code(integer);
-extern void RRC_RG_O_O_Compute_Configuration(integer);
-extern void RRC_RG_O_O_Action(integer);
-extern void RRC_RG_O_O_CRLC_CONFIG_Req(void);
-extern void RRC_RG_O_O_CMAC_CONFIG_Req(void);
-extern void RRC_RG_O_O_CPHY_RL_RELEASE_Req(void);
-extern void RRC_RG_O_O_CPHY_RL_SETUP_Req(void);
-extern void RRC_RG_O_O_SEND_DCCH_AM(integer);
-extern void RRC_RG_O_O_SEND_DCCH_UM(integer);
-extern void RRC_RG_O_O_SEND_CCCH(integer);
-extern void RRC_RG_O_O_NAS_CONN_LOSS_IND(integer);
-extern void RRC_RG_O_O_NAS_RB_Failure(integer);
-extern void RRC_RG_O_O_NAS_RB_ESTAB_CNF(integer);
-extern void RRC_RG_O_O_NAS_CONN_RELEASE_IND(integer);
-extern void RRC_RG_O_O_NAS_CONN_ESTAB_IND(integer);
-void RRC_RG_I_I_Configuration_Failure(void)
-{
-  EMIT(_Sig, __In_I_Configuration_Failure_112);
-}
-void RRC_RG_I_I_Configuration_Indication(void)
-{
-  EMIT(_Sig, __In_I_Configuration_Indication_111);
-}
-void RRC_RG_I_I_Last_RB(void)
-{
-  EMIT(_Sig, __In_I_Last_RB_110);
-}
-void RRC_RG_I_I_RB_List(integer value)
-{
-  EMIT(_Sig, __In_I_RB_List_109);
-  _integer(&In_I_RB_List_109, value);
-}
-void RRC_RG_I_I_Status(integer value)
-{
-  EMIT(_Sig, __In_I_Status_108);
-  _integer(&In_I_Status_108, value);
-}
-void RRC_RG_I_I_RLC_Failure(integer value)
-{
-  EMIT(_Sig, __In_I_RLC_Failure_107);
-  _integer(&In_I_RLC_Failure_107, value);
-}
-void RRC_RG_I_I_RLC_Success(integer value)
-{
-  EMIT(_Sig, __In_I_RLC_Success_106);
-  _integer(&In_I_RLC_Success_106, value);
-}
-void RRC_RG_I_I_CRLC_STATUS(integer value)
-{
-  EMIT(_Sig, __In_I_CRLC_STATUS_105);
-  _integer(&In_I_CRLC_STATUS_105, value);
-}
-void RRC_RG_I_I_CPHY_RL_MODIFY_Cnf(integer value)
-{
-  EMIT(_Sig, __In_I_CPHY_RL_MODIFY_Cnf_104);
-  _integer(&In_I_CPHY_RL_MODIFY_Cnf_104, value);
-}
-void RRC_RG_I_I_CPHY_RL_SETUP_Cnf(integer value)
-{
-  EMIT(_Sig, __In_I_CPHY_RL_SETUP_Cnf_103);
-  _integer(&In_I_CPHY_RL_SETUP_Cnf_103, value);
-}
-void RRC_RG_I_I_CPHY_CONNECTION_LOSS(integer value)
-{
-  EMIT(_Sig, __In_I_CPHY_CONNECTION_LOSS_102);
-  _integer(&In_I_CPHY_CONNECTION_LOSS_102, value);
-}
-void RRC_RG_I_I_CPHY_OUT_OF_SYNCH(integer value)
-{
-  EMIT(_Sig, __In_I_CPHY_OUT_OF_SYNCH_101);
-  _integer(&In_I_CPHY_OUT_OF_SYNCH_101, value);
-}
-void RRC_RG_I_I_CPHY_SYNCH_Failure(integer value)
-{
-  EMIT(_Sig, __In_I_CPHY_SYNCH_Failure_100);
-  _integer(&In_I_CPHY_SYNCH_Failure_100, value);
-}
-void RRC_RG_I_I_CPHY_SYNCH_IND(integer value)
-{
-  EMIT(_Sig, __In_I_CPHY_SYNCH_IND_99);
-  _integer(&In_I_CPHY_SYNCH_IND_99, value);
-}
-void RRC_RG_I_I_NAS_RB_RELEASE_REQ(integer value)
-{
-  EMIT(_Sig, __In_I_NAS_RB_RELEASE_REQ_98);
-  _integer(&In_I_NAS_RB_RELEASE_REQ_98, value);
-}
-void RRC_RG_I_I_NAS_RB_ESTAB_REQ(integer value)
-{
-  EMIT(_Sig, __In_I_NAS_RB_ESTAB_REQ_97);
-  _integer(&In_I_NAS_RB_ESTAB_REQ_97, value);
-}
-void RRC_RG_I_I_NAS_CONN_RELEASE_REQ(integer value)
-{
-  EMIT(_Sig, __In_I_NAS_CONN_RELEASE_REQ_96);
-  _integer(&In_I_NAS_CONN_RELEASE_REQ_96, value);
-}
-void RRC_RG_I_I_NAS_CONN_ESTAB_CNF(integer value)
-{
-  EMIT(_Sig, __In_I_NAS_CONN_ESTAB_CNF_95);
-  _integer(&In_I_NAS_CONN_ESTAB_CNF_95, value);
-}
-void RRC_RG_I_I_CELL_UPDATE(integer value)
-{
-  EMIT(_Sig, __In_I_CELL_UPDATE_94);
-  _integer(&In_I_CELL_UPDATE_94, value);
-}
-void RRC_RG_I_I_RB_REL_FAILURE(integer value)
-{
-  EMIT(_Sig, __In_I_RB_REL_FAILURE_93);
-  _integer(&In_I_RB_REL_FAILURE_93, value);
-}
-void RRC_RG_I_I_RB_REL_COMPLETE(integer value)
-{
-  EMIT(_Sig, __In_I_RB_REL_COMPLETE_92);
-  _integer(&In_I_RB_REL_COMPLETE_92, value);
-}
-void RRC_RG_I_I_RB_SETUP_FAILURE(integer value)
-{
-  EMIT(_Sig, __In_I_RB_SETUP_FAILURE_91);
-  _integer(&In_I_RB_SETUP_FAILURE_91, value);
-}
-void RRC_RG_I_I_RB_SETUP_COMPLETE(integer value)
-{
-  EMIT(_Sig, __In_I_RB_SETUP_COMPLETE_90);
-  _integer(&In_I_RB_SETUP_COMPLETE_90, value);
-}
-void RRC_RG_I_I_RRC_CONN_REL_COMPLETE(integer value)
-{
-  EMIT(_Sig, __In_I_RRC_CONN_REL_COMPLETE_89);
-  _integer(&In_I_RRC_CONN_REL_COMPLETE_89, value);
-}
-void RRC_RG_I_I_RRC_CONNECTION_RELEASE(integer value)
-{
-  EMIT(_Sig, __In_I_RRC_CONNECTION_RELEASE_88);
-  _integer(&In_I_RRC_CONNECTION_RELEASE_88, value);
-}
-void RRC_RG_I_I_RRC_CONN_SETUP_COMPLETE(integer value)
-{
-  EMIT(_Sig, __In_I_RRC_CONN_SETUP_COMPLETE_87);
-  _integer(&In_I_RRC_CONN_SETUP_COMPLETE_87, value);
-}
-void RRC_RG_I_I_RRC_CONNECTION_REQUEST(integer value)
-{
-  EMIT(_Sig, __In_I_RRC_CONNECTION_REQUEST_86);
-  _integer(&In_I_RRC_CONNECTION_REQUEST_86, value);
-}
-
-static void Point_0(void)
-{
-  /*#0 */
-  _boolean(&Var__ThisIsTheEnd__171, 1);
-  _Pause[0] |= 0xfb9c; /* PauseOn: #2 #3 #4 #7 #8 #9 #11 #12 #13 #14 #15 */
-}
-
-static void Point_1(void)
-{
-  /*#1 AutoPauseOn */
-  if (IS_SIGNAL(_Sig, __In_I_CPHY_SYNCH_IND_99)) {
-    EMIT(_Sig, __Sig_Conn_Establish_complete_128);
-    _On[2] |= 0x100; /* On: #72 */
-    _On[0] &= ~0x2; /* Off: #1 */
-  }
-}
-
-static void Point_2(void)
-{
-  /*#2 AutoPauseOn */
-  if (IS_SIGNAL(_Sig, __In_I_NAS_CONN_ESTAB_CNF_95)) {
-    if (!(IS_GUARD(0)))
-      _integer(&Sig_UE_Id_129, In_I_NAS_CONN_ESTAB_CNF_95);
-    else
-      _integer(&Sig_UE_Id_129, INTEGER_COMBINE(Sig_UE_Id_129, In_I_NAS_CONN_ESTAB_CNF_95));
-
-    SET_GUARD(0);
-    _On[2] |= 0x4; /* On: #66 */
-    _On[0] &= ~0x4; /* Off: #2 */
-  }
-}
-
-static void Point_3(void)
-{
-  /*#3 AutoPauseOn */
-  if (IS_SIGNAL(_Sig, __In_I_RRC_CONNECTION_REQUEST_86)) {
-    if (!(IS_GUARD(0)))
-      _integer(&Sig_UE_Id_129, In_I_RRC_CONNECTION_REQUEST_86);
-    else
-      _integer(&Sig_UE_Id_129, INTEGER_COMBINE(Sig_UE_Id_129, In_I_RRC_CONNECTION_REQUEST_86));
-
-    SET_GUARD(0);
-    _On[1] |= 0x40000000; /* On: #62 */
-    _On[0] &= ~0x8; /* Off: #3 */
-  }
-}
-
-static void Point_4(void)
-{
-  /*#4 AutoPauseOn */
-  if (IS_SIGNAL(_Sig, __In_I_RRC_CONN_SETUP_COMPLETE_87)) {
-    if (!(IS_GUARD(0)))
-      _integer(&Sig_UE_Id_129, In_I_RRC_CONN_SETUP_COMPLETE_87);
-    else
-      _integer(&Sig_UE_Id_129, INTEGER_COMBINE(Sig_UE_Id_129, In_I_RRC_CONN_SETUP_COMPLETE_87));
-
-    SET_GUARD(0);
-    _On[1] |= 0x4000000; /* On: #58 */
-    _On[0] &= ~0x10; /* Off: #4 */
-  }
-}
-
-static void Point_5(void)
-{
-  /*#5 AutoPauseOn */
-  if (IS_SIGNAL(_Sig, __In_I_Configuration_Indication_111)) {
-    EMIT(_Sig, __Sig_sc_go_30_ConnRel_Send_136);
-    _On[1] |= 0x2000000; /* On: #57 */
-    _On[0] &= ~0x20; /* Off: #5 */
-  } else {
-    if (IS_SIGNAL(_Sig, __In_I_Configuration_Failure_112)) {
-      _On[1] |= 0x2000000; /* On: #57 */
-      _On[0] &= ~0x20; /* Off: #5 */
-    }
-  }
-}
-
-static void Point_6(void)
-{
-  /*#6 */
-  if ((Sig_Rel_repeat_135[Sig_Rel_repeat_135_Pre1] > 1)) {
-    Sig_Rel_repeat_135_Pre0 = Sig_Rel_repeat_135_Pre1 ^ 1;
-    _integer(&Sig_Rel_repeat_135[Sig_Rel_repeat_135_Pre0], (Sig_Rel_repeat_135[Sig_Rel_repeat_135_Pre1] - 1));
-    EMIT(_Sig, __Sig_sc_go_30_ConnRel_Send_136);
-    _On[1] |= 0x2000000; /* On: #57 */
-  } else {
-    _On[1] |= 0x2000000; /* On: #57 */
-  }
-}
-
-static void Point_7(void)
-{
-  /*#7 AutoPauseOn */
-  if (IS_SIGNAL(_Sig, __In_I_NAS_CONN_RELEASE_REQ_96)) {
-    if (!(IS_GUARD(0)))
-      _integer(&Sig_UE_Id_129, In_I_NAS_CONN_RELEASE_REQ_96);
-    else
-      _integer(&Sig_UE_Id_129, INTEGER_COMBINE(Sig_UE_Id_129, In_I_NAS_CONN_RELEASE_REQ_96));
-
-    SET_GUARD(0);
-    Sig_Rel_repeat_135_Pre0 = Sig_Rel_repeat_135_Pre1 ^ 1;
-    _integer(&Sig_Rel_repeat_135[Sig_Rel_repeat_135_Pre0], REL_COUNT);
-    _On[1] |= 0x1000000; /* On: #56 */
-    _On[0] &= ~0x80; /* Off: #7 */
-  }
-}
-
-static void Point_8(void)
-{
-  /*#8 AutoPauseOn */
-  if (IS_SIGNAL(_Sig, __In_I_NAS_RB_ESTAB_REQ_97)) {
-    if (!(IS_GUARD(0)))
-      _integer(&Sig_UE_Id_129, In_I_NAS_RB_ESTAB_REQ_97);
-    else
-      _integer(&Sig_UE_Id_129, INTEGER_COMBINE(Sig_UE_Id_129, In_I_NAS_RB_ESTAB_REQ_97));
-
-    SET_GUARD(0);
-    _On[1] |= 0x400; /* On: #42 */
-    _On[0] &= ~0x100; /* Off: #8 */
-  }
-}
-
-static void Point_9(void)
-{
-  /*#9 AutoPauseOn */
-  if (IS_SIGNAL(_Sig, __In_I_NAS_RB_RELEASE_REQ_98)) {
-    if (!(IS_GUARD(0)))
-      _integer(&Sig_UE_Id_129, In_I_NAS_RB_RELEASE_REQ_98);
-    else
-      _integer(&Sig_UE_Id_129, INTEGER_COMBINE(Sig_UE_Id_129, In_I_NAS_RB_RELEASE_REQ_98));
-
-    SET_GUARD(0);
-    _On[1] |= 0x20; /* On: #37 */
-    _On[0] &= ~0x200; /* Off: #9 */
-  }
-}
-
-static void Point_10(void)
-{
-  /*#10 AutoPauseOn */
-  if ((IS_SIGNAL(_Sig, __In_I_Configuration_Indication_111) || IS_SIGNAL(_Sig, __In_I_Configuration_Failure_112))) {
-    EMIT(_Sig, __Sig_sc_go_14_RelComp_Proc_158);
-    _On[1] |= 0x8; /* On: #35 */
-    _On[0] &= ~0x400; /* Off: #10 */
-  }
-}
-
-static void Point_11(void)
-{
-  /*#11 AutoPauseOn */
-  if (IS_SIGNAL(_Sig, __In_I_RRC_CONNECTION_RELEASE_88)) {
-    if (!(IS_GUARD(0)))
-      _integer(&Sig_UE_Id_129, In_I_RRC_CONNECTION_RELEASE_88);
-    else
-      _integer(&Sig_UE_Id_129, INTEGER_COMBINE(Sig_UE_Id_129, In_I_RRC_CONNECTION_RELEASE_88));
-
-    SET_GUARD(0);
-    _On[1] |= 0x1; /* On: #32 */
-    _On[0] &= ~0x800; /* Off: #11 */
-  } else {
-    if (IS_SIGNAL(_Sig, __In_I_CPHY_CONNECTION_LOSS_102)) {
-      if (!(IS_GUARD(0)))
-        _integer(&Sig_UE_Id_129, In_I_CPHY_CONNECTION_LOSS_102);
-      else
-        _integer(&Sig_UE_Id_129, INTEGER_COMBINE(Sig_UE_Id_129, In_I_CPHY_CONNECTION_LOSS_102));
-
-      SET_GUARD(0);
-      EMIT(_Sig, __Out_O_NAS_CONN_LOSS_IND_117);
-      _On[0] |= 0x80000000; /* On: #31 */
-      _On[0] &= ~0x800; /* Off: #11 */
-    } else {
-      if (IS_SIGNAL(_Sig, __In_I_CPHY_OUT_OF_SYNCH_101)) {
-        if (!(IS_GUARD(0)))
-          _integer(&Sig_UE_Id_129, In_I_CPHY_OUT_OF_SYNCH_101);
-        else
-          _integer(&Sig_UE_Id_129, INTEGER_COMBINE(Sig_UE_Id_129, In_I_CPHY_OUT_OF_SYNCH_101));
-
-        SET_GUARD(0);
-        _On[0] |= 0x40000000; /* On: #30 */
-        _On[0] &= ~0x800; /* Off: #11 */
-      } else {
-        if (IS_SIGNAL(_Sig, __In_I_RRC_CONN_REL_COMPLETE_89)) {
-          if (!(IS_GUARD(0)))
-            _integer(&Sig_UE_Id_129, In_I_RRC_CONN_REL_COMPLETE_89);
-          else
-            _integer(&Sig_UE_Id_129, INTEGER_COMBINE(Sig_UE_Id_129, In_I_RRC_CONN_REL_COMPLETE_89));
-
-          SET_GUARD(0);
-          _On[0] |= 0x20000000; /* On: #29 */
-          _On[0] &= ~0x800; /* Off: #11 */
-        }
-      }
-    }
-  }
-}
-
-static void Point_12(void)
-{
-  /*#12 AutoPauseOn */
-  if (IS_SIGNAL(_Sig, __In_I_RB_SETUP_COMPLETE_90)) {
-    if (!(IS_GUARD(0)))
-      _integer(&Sig_UE_Id_129, In_I_RB_SETUP_COMPLETE_90);
-    else
-      _integer(&Sig_UE_Id_129, INTEGER_COMBINE(Sig_UE_Id_129, In_I_RB_SETUP_COMPLETE_90));
-
-    SET_GUARD(0);
-    _On[0] |= 0x4000000; /* On: #26 */
-    _On[0] &= ~0x1000; /* Off: #12 */
-  }
-}
-
-static void Point_13(void)
-{
-  /*#13 AutoPauseOn */
-  if (IS_SIGNAL(_Sig, __In_I_CRLC_STATUS_105)) {
-    if (!(IS_GUARD(0)))
-      _integer(&Sig_UE_Id_129, In_I_CRLC_STATUS_105);
-    else
-      _integer(&Sig_UE_Id_129, INTEGER_COMBINE(Sig_UE_Id_129, In_I_CRLC_STATUS_105));
-
-    SET_GUARD(0);
-    _On[0] |= 0x2000000; /* On: #25 */
-    _On[0] &= ~0x2000; /* Off: #13 */
-  } else {
-    if (IS_SIGNAL(_Sig, __In_I_CELL_UPDATE_94)) {
-      if (!(IS_GUARD(0)))
-        _integer(&Sig_UE_Id_129, In_I_CELL_UPDATE_94);
-      else
-        _integer(&Sig_UE_Id_129, INTEGER_COMBINE(Sig_UE_Id_129, In_I_CELL_UPDATE_94));
-
-      SET_GUARD(0);
-      _On[0] |= 0x2000000; /* On: #25 */
-      _On[0] &= ~0x2000; /* Off: #13 */
-    }
-  }
-}
-
-static void Point_14(void)
-{
-  /*#14 AutoPauseOn */
-  if (IS_SIGNAL(_Sig, __In_I_RB_REL_COMPLETE_92)) {
-    if (!(IS_GUARD(0)))
-      _integer(&Sig_UE_Id_129, In_I_RB_REL_COMPLETE_92);
-    else
-      _integer(&Sig_UE_Id_129, INTEGER_COMBINE(Sig_UE_Id_129, In_I_RB_REL_COMPLETE_92));
-
-    SET_GUARD(0);
-    _On[0] |= 0x20000; /* On: #17 */
-    _On[0] &= ~0x4000; /* Off: #14 */
-  }
-}
-
-static void Point_15(void)
-{
-  /*#15 AutoPauseOn */
-  if (IS_SIGNAL(_Sig, __In_I_RB_SETUP_FAILURE_91)) {
-    SET_GUARD(0);
-
-    if (!(IS_GUARD(0)))
-      _integer(&Sig_UE_Id_129, In_I_RB_SETUP_FAILURE_91);
-    else
-      _integer(&Sig_UE_Id_129, INTEGER_COMBINE(Sig_UE_Id_129, In_I_RB_SETUP_FAILURE_91));
-
-    SET_GUARD(0);
-    _On[0] &= ~0x8000; /* Off: #15 */
-
-    if ((_eq_integer(Current_State(Sig_UE_Id_129), CELL_FACH_Connected) || _eq_integer(Current_State(Sig_UE_Id_129), CELL_DCH_Connected))) {
-      EMIT(_Sig, __Sig_sc_go_48_RbFail_Phy_170);
-    }
-  } else {
-    if (IS_SIGNAL(_Sig, __In_I_RB_REL_FAILURE_93)) {
-      SET_GUARD(0);
-
-      if (!(IS_GUARD(0)))
-        _integer(&Sig_UE_Id_129, In_I_RB_REL_FAILURE_93);
-      else
-        _integer(&Sig_UE_Id_129, INTEGER_COMBINE(Sig_UE_Id_129, In_I_RB_REL_FAILURE_93));
-
-      SET_GUARD(0);
-      _On[0] &= ~0x8000; /* Off: #15 */
-
-      if (_eq_integer(Current_State(Sig_UE_Id_129), CELL_DCH_Connected)) {
-        EMIT(_Sig, __Sig_sc_go_48_RbFail_Phy_170);
-      }
-    }
-  }
-
-  if (IS_GUARD(0)) {
-    if (IS_SIGNAL(_Sig, __Sig_sc_go_48_RbFail_Phy_170)) {
-      restore_former_config(Sig_UE_Id_129);
-      EMIT(_Sig, __Out_O_RB_failure_code_127);
-
-      if (!(IS_GUARD(7)))
-        _integer(&Out_O_RB_failure_code_127, RB_FAIL_UE_SETUP_FAILURE);
-      else
-        _integer(&Out_O_RB_failure_code_127, INTEGER_COMBINE(Out_O_RB_failure_code_127, RB_FAIL_UE_SETUP_FAILURE));
-
-      SET_GUARD(7);
-      _On[0] |= 0x10000;
-      _On[1] |= 0x1000; /* On: #16 #44 */
-    } else {
-      _Pause[0] |= 0x8000; /* PauseOn: #15 */
-    }
-  }
-}
-
-static void Point_16(void)
-{
-  /*#16 */
-  EMIT(_Sig, __Out_O_NAS_RB_Failure_116);
-
-  if (!(IS_GUARD(18)))
-    _integer(&Out_O_NAS_RB_Failure_116, Sig_UE_Id_129);
-  else
-    _integer(&Out_O_NAS_RB_Failure_116, INTEGER_COMBINE(Out_O_NAS_RB_Failure_116, Sig_UE_Id_129));
-
-  SET_GUARD(18);
-  _On[1] |= 0x400000; /* On: #54 */
-  _Pause[0] |= 0x8000; /* PauseOn: #15 */
-}
-
-static void Point_17(void)
-{
-  /*#17 */
-  if (_eq_integer(Current_State(Sig_UE_Id_129), CELL_DCH_Connected)) {
-    if (IS_SIGNAL(_Sig, __In_I_Last_RB_110)) {
-      update_Mobile(Sig_UE_Id_129, CELL_FACH_Connected);
-      _On[0] |= 0x40000; /* On: #18 */
-    } else {
-      _On[0] |= 0x40000; /* On: #18 */
-    }
-
-    rg_update_UE_numrb(Sig_UE_Id_129, E_REL_RB);
-    EMIT(_Sig, __Out_O_CRLC_CONFIG_Req_124);
-
-    if (!(IS_GUARD(10))) {
-      RRC_RG_O_O_CRLC_CONFIG_Req();
-      SET_GUARD(10);
-    }
-  } else {
-    _On[0] |= 0x200000; /* On: #21 */
-  }
-}
-
-static void Point_18(void)
-{
-  /*#18 */
-  EMIT(_Sig, __Out_O_CMAC_CONFIG_Req_123);
-
-  if (!(IS_GUARD(11))) {
-    RRC_RG_O_O_CMAC_CONFIG_Req();
-    SET_GUARD(11);
-  }
-
-  EMIT(_Sig, __Out_O_CPHY_RL_RELEASE_Req_122);
-
-  if (!(IS_GUARD(12))) {
-    RRC_RG_O_O_CPHY_RL_RELEASE_Req();
-    SET_GUARD(12);
-  }
-
-  _Pause[0] |= 0x180000; /* PauseOn: #19 #20 */
-}
-
-static void Point_19(void)
-{
-  /*#19 AutoPauseOn */
-  if (IS_SIGNAL(_Sig, __In_I_CPHY_RL_MODIFY_Cnf_104)) {
-    if (_eq_integer(In_I_CPHY_RL_MODIFY_Cnf_104, Sig_UE_Id_129)) {
-      EMIT(_Sig, __Sig_sc_cond8_168);
-      _On[0] &= ~0x80000; /* Off: #19 */
-    }
-  }
-}
-
-static void Point_20(void)
-{
-  /*#20 AutoPauseOn */
-  if (IS_SIGNAL(_Sig, __Sig_sc_cond8_168)) {
-    clear_rbrelease_variables(Sig_UE_Id_129);
-    _On[0] |= 0x200000; /* On: #21 */
-    _On[0] &= ~0x100000; /* Off: #20 */
-    _Pause[0] &= ~0x80000;
-    _On[0] &= ~0x80000; /* PauseOff: #19 */
-  }
-}
-
-static void Point_21(void)
-{
-  /*#21 */
-  _Pause[0] |= 0x4000; /* PauseOn: #14 */
-}
-
-static void Point_22(void)
-{
-  /*#22 AutoPauseOn */
-  if (IS_SIGNAL(_Sig, __In_I_CPHY_SYNCH_IND_99)) {
-    if (_eq_integer(In_I_CPHY_SYNCH_IND_99, Sig_UE_Id_129)) {
-      EMIT(_Sig, __Sig_sc_cond2_165);
-      _On[0] &= ~0x400000; /* Off: #22 */
-    } else {
-      SET_GUARD(1);
-    }
-  } else {
-    SET_GUARD(1);
-  }
-
-  if (IS_GUARD(1)) {
-    if (IS_SIGNAL(_Sig, __In_I_CPHY_SYNCH_Failure_100)) {
-      if (_eq_integer(In_I_CPHY_SYNCH_Failure_100, Sig_UE_Id_129)) {
-        EMIT(_Sig, __Sig_sc_cond3_164);
-        _On[0] &= ~0x400000; /* Off: #22 */
-      }
-    }
-  }
-}
-
-static void Point_23(void)
-{
-  /*#23 AutoPauseOn */
-  if (IS_SIGNAL(_Sig, __Sig_sc_cond2_165)) {
-    SET_GUARD(2);
-    _On[0] &= ~0x800000; /* Off: #23 */
-  } else {
-    if (IS_SIGNAL(_Sig, __Sig_sc_cond3_164)) {
-      SET_GUARD(2);
-      EMIT(_Sig, __Sig_sc_go_54_CellU_fail_162);
-      _On[0] &= ~0x800000; /* Off: #23 */
-    }
-  }
-
-  if (IS_GUARD(2)) {
-    _Pause[0] &= ~0x400000;
-    _On[0] &= ~0x400000; /* PauseOff: #22 */
-
-    if (IS_SIGNAL(_Sig, __Sig_sc_go_54_CellU_fail_162)) {
-      encode_message(&Var_msg_161, Sig_UE_Id_129, RRC_CONN_RELEASE);
-      EMIT(_Sig, __Out_O_SEND_CCCH_118);
-
-      if (!(IS_GUARD(16)))
-        _integer(&Out_O_SEND_CCCH_118, Var_msg_161);
-      else
-        _integer(&Out_O_SEND_CCCH_118, INTEGER_COMBINE(Out_O_SEND_CCCH_118, Var_msg_161));
-
-      SET_GUARD(16);
-      EMIT(_Sig, __Out_O_NAS_CONN_LOSS_IND_117);
-
-      if (!(IS_GUARD(17)))
-        _integer(&Out_O_NAS_CONN_LOSS_IND_117, Sig_UE_Id_129);
-      else
-        _integer(&Out_O_NAS_CONN_LOSS_IND_117, INTEGER_COMBINE(Out_O_NAS_CONN_LOSS_IND_117, Sig_UE_Id_129));
-
-      SET_GUARD(17);
-      _On[0] |= 0x1000000;
-      _On[1] |= 0x4;
-      _On[2] |= 0x400; /* On: #24 #34 #74 */
-    } else {
-      _Pause[0] |= 0x2000; /* PauseOn: #13 */
-    }
-  }
-}
-
-static void Point_24(void)
-{
-  /*#24 */
-  if (_eq_integer(Current_State(Sig_UE_Id_129), CELL_DCH_Connected)) {
-    update_Mobile(Sig_UE_Id_129, CELL_DCH_Releasing);
-    _Pause[0] |= 0x2000; /* PauseOn: #13 */
-  } else {
-    update_Mobile(Sig_UE_Id_129, CELL_FACH_Releasing);
-    _Pause[0] |= 0x2000; /* PauseOn: #13 */
-  }
-}
-
-static void Point_25(void)
-{
-  /*#25 */
-  if ((_eq_integer(Current_State(Sig_UE_Id_129), CELL_FACH_Connected) || _eq_integer(Current_State(Sig_UE_Id_129), CELL_DCH_Connected))) {
-    encode_message(&Var_msg_161, Sig_UE_Id_129, CELL_UPDATE_CONFIRM);
-    EMIT(_Sig, __Out_O_SEND_CCCH_118);
-
-    if (!(IS_GUARD(16)))
-      _integer(&Out_O_SEND_CCCH_118, Var_msg_161);
-    else
-      _integer(&Out_O_SEND_CCCH_118, INTEGER_COMBINE(Out_O_SEND_CCCH_118, Var_msg_161));
-
-    SET_GUARD(16);
-    _On[2] |= 0x400; /* On: #74 */
-    _Pause[0] |= 0xc00000; /* PauseOn: #22 #23 */
-  } else {
-    _Pause[0] |= 0x2000; /* PauseOn: #13 */
-  }
-}
-
-static void Point_26(void)
-{
-  /*#26 */
-  if (_eq_integer(Current_State(Sig_UE_Id_129), CELL_DCH_Connected)) {
-    EMIT(_Sig, __Sig_sc_go_40_RbComp_L2_160);
-  } else {
-    if (_eq_integer(Current_State(Sig_UE_Id_129), CELL_FACH_Connected)) {
-      update_Mobile(Sig_UE_Id_129, CELL_DCH_Connected);
-      EMIT(_Sig, __Sig_sc_go_40_RbComp_L2_160);
-    }
-  }
-
-  if (IS_SIGNAL(_Sig, __Sig_sc_go_40_RbComp_L2_160)) {
-    _On[0] |= 0x8000000; /* On: #27 */
-  } else {
-    _Pause[0] |= 0x1000; /* PauseOn: #12 */
-  }
-}
-
-static void Point_27(void)
-{
-  /*#27 */
-  EMIT(_Sig, __Out_O_CRLC_CONFIG_Req_124);
-
-  if (!(IS_GUARD(10))) {
-    RRC_RG_O_O_CRLC_CONFIG_Req();
-    SET_GUARD(10);
-  }
-
-  EMIT(_Sig, __Out_O_CMAC_CONFIG_Req_123);
-
-  if (!(IS_GUARD(11))) {
-    RRC_RG_O_O_CMAC_CONFIG_Req();
-    SET_GUARD(11);
-  }
-
-  EMIT(_Sig, __Out_O_NAS_RB_ESTAB_CNF_115);
-  _integer(&Out_O_NAS_RB_ESTAB_CNF_115, Sig_UE_Id_129);
-  RRC_RG_O_O_NAS_RB_ESTAB_CNF(Out_O_NAS_RB_ESTAB_CNF_115);
-  _On[0] |= 0x10000000; /* On: #28 */
-}
-
-static void Point_28(void)
-{
-  /*#28 */
-  clear_rbsetup_variables(Sig_UE_Id_129);
-  _Pause[0] |= 0x1000; /* PauseOn: #12 */
-}
-
-static void Point_29(void)
-{
-  /*#29 */
-  if ((_eq_integer(Current_State(Sig_UE_Id_129), CELL_DCH_Releasing) || _eq_integer(Current_State(Sig_UE_Id_129), CELL_FACH_Releasing))) {
-    EMIT(_Sig, __Sig_sc_go_14_RelComp_Proc_158);
-    _On[1] |= 0x2; /* On: #33 */
-  } else {
-    _On[1] |= 0x2; /* On: #33 */
-  }
-}
-
-static void Point_30(void)
-{
-  /*#30 */
-  if (_eq_integer(Current_State(Sig_UE_Id_129), CELL_DCH_Releasing)) {
-    EMIT(_Sig, __Sig_sc_go_6_RelComp_CFG_159);
-    _On[1] |= 0x2; /* On: #33 */
-  } else {
-    _On[1] |= 0x2; /* On: #33 */
-  }
-}
-
-static void Point_31(void)
-{
-  /*#31 */
-  if (!(IS_GUARD(17)))
-    _integer(&Out_O_NAS_CONN_LOSS_IND_117, Sig_UE_Id_129);
-  else
-    _integer(&Out_O_NAS_CONN_LOSS_IND_117, INTEGER_COMBINE(Out_O_NAS_CONN_LOSS_IND_117, Sig_UE_Id_129));
-
-  SET_GUARD(17);
-  EMIT(_Sig, __Sig_sc_go_6_RelComp_CFG_159);
-  _On[1] |= 0x6; /* On: #33 #34 */
-}
-
-static void Point_32(void)
-{
-  /*#32 */
-  if ((_eq_integer(Current_State(Sig_UE_Id_129), CELL_DCH_Connected) || _eq_integer(Current_State(Sig_UE_Id_129), CELL_FACH_Connected))) {
-    EMIT(_Sig, __Out_O_NAS_CONN_RELEASE_IND_114);
-
-    if (!(IS_GUARD(19)))
-      _integer(&Out_O_NAS_CONN_RELEASE_IND_114, Sig_UE_Id_129);
-    else
-      _integer(&Out_O_NAS_CONN_RELEASE_IND_114, INTEGER_COMBINE(Out_O_NAS_CONN_RELEASE_IND_114, Sig_UE_Id_129));
-
-    SET_GUARD(19);
-    EMIT(_Sig, __Sig_sc_go_6_RelComp_CFG_159);
-    _On[1] |= 0x2;
-    _On[2] |= 0x80; /* On: #33 #71 */
-  } else {
-    _On[1] |= 0x2; /* On: #33 */
-  }
-}
-
-static void Point_33(void)
-{
-  /*#33 */
-  if (IS_SIGNAL(_Sig, __Sig_sc_go_6_RelComp_CFG_159)) {
-    EMIT(_Sig, __Out_O_Action_125);
-
-    if (!(IS_GUARD(9)))
-      _integer(&Out_O_Action_125, E_REL_MT);
-    else
-      _integer(&Out_O_Action_125, INTEGER_COMBINE(Out_O_Action_125, E_REL_MT));
-
-    SET_GUARD(9);
-    EMIT(_Sig, __Out_O_Compute_Configuration_126);
-
-    if (!(IS_GUARD(8)))
-      _integer(&Out_O_Compute_Configuration_126, Sig_UE_Id_129);
-    else
-      _integer(&Out_O_Compute_Configuration_126, INTEGER_COMBINE(Out_O_Compute_Configuration_126, Sig_UE_Id_129));
-
-    SET_GUARD(8);
-    _On[2] |= 0x1000; /* On: #76 */
-    _Pause[0] |= 0x400; /* PauseOn: #10 */
-  } else {
-    _On[1] |= 0x8; /* On: #35 */
-  }
-}
-
-static void Point_34(void)
-{
-  /*#34 */
-  RRC_RG_O_O_NAS_CONN_LOSS_IND(Out_O_NAS_CONN_LOSS_IND_117);
-}
-
-static void Point_35(void)
-{
-  /*#35 */
-  if (IS_SIGNAL(_Sig, __Sig_sc_go_14_RelComp_Proc_158)) {
-    release_DCH_Resources(Sig_UE_Id_129);
-    delete_Mobile(Sig_UE_Id_129);
-    _On[1] |= 0x10; /* On: #36 */
-  } else {
-    _On[1] |= 0x10; /* On: #36 */
-  }
-}
-
-static void Point_36(void)
-{
-  /*#36 */
-  _Pause[0] |= 0x800; /* PauseOn: #11 */
-}
-
-static void Point_37(void)
-{
-  /*#37 */
-  if (_eq_integer(Current_State(Sig_UE_Id_129), CELL_DCH_Connected)) {
-    proc_RB_List(&Var_msg_154, In_I_RB_List_109, Sig_UE_Id_129);
-    EMIT(_Sig, __Out_O_Action_125);
-
-    if (!(IS_GUARD(9)))
-      _integer(&Out_O_Action_125, E_REL_RB);
-    else
-      _integer(&Out_O_Action_125, INTEGER_COMBINE(Out_O_Action_125, E_REL_RB));
-
-    SET_GUARD(9);
-    EMIT(_Sig, __Out_O_Compute_Configuration_126);
-
-    if (!(IS_GUARD(8)))
-      _integer(&Out_O_Compute_Configuration_126, Sig_UE_Id_129);
-    else
-      _integer(&Out_O_Compute_Configuration_126, INTEGER_COMBINE(Out_O_Compute_Configuration_126, Sig_UE_Id_129));
-
-    SET_GUARD(8);
-    _On[2] |= 0x1000; /* On: #76 */
-    _Pause[1] |= 0x40; /* PauseOn: #38 */
-  } else {
-    _On[1] |= 0x200; /* On: #41 */
-  }
-}
-
-static void Point_38(void)
-{
-  /*#38 AutoPauseOn */
-  if (IS_SIGNAL(_Sig, __In_I_Configuration_Indication_111)) {
-    encode_message(&Var_msg_154, Sig_UE_Id_129, RB_RELEASE);
-    EMIT(_Sig, __Out_O_SEND_DCCH_AM_120);
-
-    if (!(IS_GUARD(14)))
-      _integer(&Out_O_SEND_DCCH_AM_120, Var_msg_154);
-    else
-      _integer(&Out_O_SEND_DCCH_AM_120, INTEGER_COMBINE(Out_O_SEND_DCCH_AM_120, Var_msg_154));
-
-    SET_GUARD(14);
-    _On[1] |= 0x10000; /* On: #48 */
-    _On[1] &= ~0x40; /* Off: #38 */
-    _Pause[1] |= 0x180; /* PauseOn: #39 #40 */
-  } else {
-    if (IS_SIGNAL(_Sig, __In_I_Configuration_Failure_112)) {
-      _On[1] |= 0x200; /* On: #41 */
-      _On[1] &= ~0x40; /* Off: #38 */
-    }
-  }
-}
-
-static void Point_39(void)
-{
-  /*#39 AutoPauseOn */
-  if (IS_SIGNAL(_Sig, __In_I_RLC_Success_106)) {
-    if (_eq_integer(In_I_RLC_Success_106, Sig_UE_Id_129)) {
-      EMIT(_Sig, __Sig_sc_cond10_156);
-      _On[1] &= ~0x80; /* Off: #39 */
-    }
-  }
-}
-
-static void Point_40(void)
-{
-  /*#40 AutoPauseOn */
-  if (IS_SIGNAL(_Sig, __Sig_sc_cond10_156)) {
-    _On[1] |= 0x200; /* On: #41 */
-    _On[1] &= ~0x100; /* Off: #40 */
-    _Pause[1] &= ~0x80;
-    _On[1] &= ~0x80; /* PauseOff: #39 */
-  }
-}
-
-static void Point_41(void)
-{
-  /*#41 */
-  _Pause[0] |= 0x200; /* PauseOn: #9 */
-}
-
-static void Point_42(void)
-{
-  /*#42 */
-  if ((_eq_integer(Current_State(Sig_UE_Id_129), CELL_FACH_Connected) || _eq_integer(Current_State(Sig_UE_Id_129), CELL_DCH_Connected))) {
-    proc_RB_List(&Var_msg_139, In_I_RB_List_109, Sig_UE_Id_129);
-    EMIT(_Sig, __Out_O_Action_125);
-
-    if (!(IS_GUARD(9)))
-      _integer(&Out_O_Action_125, E_ADD_RB);
-    else
-      _integer(&Out_O_Action_125, INTEGER_COMBINE(Out_O_Action_125, E_ADD_RB));
-
-    SET_GUARD(9);
-    EMIT(_Sig, __Out_O_Compute_Configuration_126);
-
-    if (!(IS_GUARD(8)))
-      _integer(&Out_O_Compute_Configuration_126, Sig_UE_Id_129);
-    else
-      _integer(&Out_O_Compute_Configuration_126, INTEGER_COMBINE(Out_O_Compute_Configuration_126, Sig_UE_Id_129));
-
-    SET_GUARD(8);
-    _On[2] |= 0x1000; /* On: #76 */
-    _Pause[1] |= 0x800; /* PauseOn: #43 */
-  } else {
-    EMIT(_Sig, __Out_O_RB_failure_code_127);
-
-    if (!(IS_GUARD(7)))
-      _integer(&Out_O_RB_failure_code_127, RB_FAIL_IDLE_MOBILE);
-    else
-      _integer(&Out_O_RB_failure_code_127, INTEGER_COMBINE(Out_O_RB_failure_code_127, RB_FAIL_IDLE_MOBILE));
-
-    SET_GUARD(7);
-    EMIT(_Sig, __Sig_sc_go_35_RbEstab_InitFailure_140);
-    _On[1] |= 0x201000; /* On: #44 #53 */
-  }
-}
-
-static void Point_43(void)
-{
-  /*#43 AutoPauseOn */
-  if (IS_SIGNAL(_Sig, __In_I_Configuration_Indication_111)) {
-    rg_update_UE_numrb(Sig_UE_Id_129, E_ADD_RB);
-    EMIT(_Sig, __Out_O_CPHY_RL_SETUP_Req_121);
-
-    if (!(IS_GUARD(13))) {
-      RRC_RG_O_O_CPHY_RL_SETUP_Req();
-      SET_GUARD(13);
-    }
-
-    _On[1] &= ~0x800; /* Off: #43 */
-    _Pause[1] |= 0xc000; /* PauseOn: #46 #47 */
-  } else {
-    if (IS_SIGNAL(_Sig, __In_I_Configuration_Failure_112)) {
-      EMIT(_Sig, __Out_O_RB_failure_code_127);
-
-      if (!(IS_GUARD(7)))
-        _integer(&Out_O_RB_failure_code_127, RB_FAIL_INVALID_CONFIG);
-      else
-        _integer(&Out_O_RB_failure_code_127, INTEGER_COMBINE(Out_O_RB_failure_code_127, RB_FAIL_INVALID_CONFIG));
-
-      SET_GUARD(7);
-      EMIT(_Sig, __Sig_sc_go_35_RbEstab_InitFailure_140);
-      _On[1] |= 0x201000; /* On: #44 #53 */
-      _On[1] &= ~0x800; /* Off: #43 */
-    }
-  }
-}
-
-static void Point_44(void)
-{
-  /*#44 */
-  RRC_RG_O_O_RB_failure_code(Out_O_RB_failure_code_127);
-}
-
-static void Point_45(void)
-{
-  /*#45 AutoPauseOn */
-  if (IS_SIGNAL(_Sig, __In_I_CPHY_SYNCH_IND_99)) {
-    if (_eq_integer(In_I_CPHY_SYNCH_IND_99, Sig_UE_Id_129)) {
-      EMIT(_Sig, __Sig_sc_cond15_152);
-      _On[1] &= ~0x2000; /* Off: #45 */
-    } else {
-      SET_GUARD(3);
-    }
-  } else {
-    SET_GUARD(3);
-  }
-
-  if (IS_GUARD(3)) {
-    if (IS_SIGNAL(_Sig, __In_I_CPHY_SYNCH_Failure_100)) {
-      if (_eq_integer(In_I_CPHY_SYNCH_Failure_100, Sig_UE_Id_129)) {
-        EMIT(_Sig, __Sig_sc_cond16_151);
-        _On[1] &= ~0x2000; /* Off: #45 */
-      }
-    }
-  }
-}
-
-static void Point_46(void)
-{
-  /*#46 AutoPauseOn */
-  if (IS_SIGNAL(_Sig, __In_I_CPHY_RL_SETUP_Cnf_103)) {
-    if (_eq_integer(In_I_CPHY_RL_SETUP_Cnf_103, Sig_UE_Id_129)) {
-      EMIT(_Sig, __Sig_sc_cond12_144);
-      _On[1] &= ~0x4000; /* Off: #46 */
-    }
-  }
-}
-
-static void Point_47(void)
-{
-  /*#47 AutoPauseOn */
-  if (IS_SIGNAL(_Sig, __Sig_sc_cond12_144)) {
-    encode_message(&Var_msg_139, Sig_UE_Id_129, RB_SETUP);
-    EMIT(_Sig, __Out_O_SEND_DCCH_AM_120);
-
-    if (!(IS_GUARD(14)))
-      _integer(&Out_O_SEND_DCCH_AM_120, Var_msg_139);
-    else
-      _integer(&Out_O_SEND_DCCH_AM_120, INTEGER_COMBINE(Out_O_SEND_DCCH_AM_120, Var_msg_139));
-
-    SET_GUARD(14);
-    _On[1] |= 0x10000; /* On: #48 */
-    _On[1] &= ~0x8000; /* Off: #47 */
-    _Pause[1] |= 0x60000; /* PauseOn: #49 #50 */
-    _Pause[1] &= ~0x4000;
-    _On[1] &= ~0x4000; /* PauseOff: #46 */
-  }
-}
-
-static void Point_48(void)
-{
-  /*#48 */
-  RRC_RG_O_O_SEND_DCCH_AM(Out_O_SEND_DCCH_AM_120);
-}
-
-static void Point_49(void)
-{
-  /*#49 AutoPauseOn */
-  if (IS_SIGNAL(_Sig, __In_I_RLC_Success_106)) {
-    if (_eq_integer(In_I_RLC_Success_106, Sig_UE_Id_129)) {
-      EMIT(_Sig, __Sig_sc_cond13_148);
-      _On[1] &= ~0x20000; /* Off: #49 */
-    } else {
-      SET_GUARD(4);
-    }
-  } else {
-    SET_GUARD(4);
-  }
-
-  if (IS_GUARD(4)) {
-    if (IS_SIGNAL(_Sig, __In_I_RLC_Failure_107)) {
-      if (_eq_integer(In_I_RLC_Failure_107, Sig_UE_Id_129)) {
-        EMIT(_Sig, __Sig_sc_cond14_147);
-        _On[1] &= ~0x20000; /* Off: #49 */
-      }
-    }
-  }
-}
-
-static void Point_50(void)
-{
-  /*#50 AutoPauseOn */
-  if (IS_SIGNAL(_Sig, __Sig_sc_cond13_148)) {
-    SET_GUARD(5);
-    EMIT(_Sig, __Sig_sc_go_34_RbEstab_Ack_142);
-    _On[1] &= ~0x40000; /* Off: #50 */
-  } else {
-    if (IS_SIGNAL(_Sig, __Sig_sc_cond14_147)) {
-      SET_GUARD(5);
-      EMIT(_Sig, __Sig_sc_go_41_RbEstab_fail_141);
-      _On[1] &= ~0x40000; /* Off: #50 */
-    }
-  }
-
-  if (IS_GUARD(5)) {
-    _Pause[1] &= ~0x20000;
-    _On[1] &= ~0x20000; /* PauseOff: #49 */
-
-    if (IS_SIGNAL(_Sig, __Sig_sc_go_34_RbEstab_Ack_142)) {
-      _Pause[1] |= 0x82000; /* PauseOn: #45 #51 */
-    } else {
-      _On[1] |= 0x100000; /* On: #52 */
-    }
-  }
-}
-
-static void Point_51(void)
-{
-  /*#51 AutoPauseOn */
-  if (IS_SIGNAL(_Sig, __Sig_sc_cond15_152)) {
-    SET_GUARD(6);
-    _On[1] &= ~0x80000; /* Off: #51 */
-  } else {
-    if (IS_SIGNAL(_Sig, __Sig_sc_cond16_151)) {
-      SET_GUARD(6);
-      EMIT(_Sig, __Sig_sc_go_41_RbEstab_fail_141);
-      _On[1] &= ~0x80000; /* Off: #51 */
-    }
-  }
-
-  if (IS_GUARD(6)) {
-    _On[1] |= 0x100000; /* On: #52 */
-    _Pause[1] &= ~0x2000;
-    _On[1] &= ~0x2000; /* PauseOff: #45 */
-  }
-}
-
-static void Point_52(void)
-{
-  /*#52 */
-  if (IS_SIGNAL(_Sig, __Sig_sc_go_41_RbEstab_fail_141)) {
-    restore_former_config(Sig_UE_Id_129);
-    EMIT(_Sig, __Out_O_NAS_RB_Failure_116);
-
-    if (!(IS_GUARD(18)))
-      _integer(&Out_O_NAS_RB_Failure_116, Sig_UE_Id_129);
-    else
-      _integer(&Out_O_NAS_RB_Failure_116, INTEGER_COMBINE(Out_O_NAS_RB_Failure_116, Sig_UE_Id_129));
-
-    SET_GUARD(18);
-    _On[1] |= 0x600000; /* On: #53 #54 */
-  } else {
-    _On[1] |= 0x200000; /* On: #53 */
-  }
-}
-
-static void Point_53(void)
-{
-  /*#53 */
-  if (IS_SIGNAL(_Sig, __Sig_sc_go_35_RbEstab_InitFailure_140)) {
-    EMIT(_Sig, __Out_O_NAS_RB_Failure_116);
-
-    if (!(IS_GUARD(18)))
-      _integer(&Out_O_NAS_RB_Failure_116, Sig_UE_Id_129);
-    else
-      _integer(&Out_O_NAS_RB_Failure_116, INTEGER_COMBINE(Out_O_NAS_RB_Failure_116, Sig_UE_Id_129));
-
-    SET_GUARD(18);
-    _On[1] |= 0xc00000; /* On: #54 #55 */
-  } else {
-    _On[1] |= 0x800000; /* On: #55 */
-  }
-}
-
-static void Point_54(void)
-{
-  /*#54 */
-  RRC_RG_O_O_NAS_RB_Failure(Out_O_NAS_RB_Failure_116);
-}
-
-static void Point_55(void)
-{
-  /*#55 */
-  _Pause[0] |= 0x100; /* PauseOn: #8 */
-}
-
-static void Point_56(void)
-{
-  /*#56 */
-  if (_eq_integer(Current_State(Sig_UE_Id_129), CELL_DCH_Connected)) {
-    update_Mobile(Sig_UE_Id_129, CELL_DCH_Releasing);
-    EMIT(_Sig, __Sig_sc_go_42_ConnRel_CFG_138);
-  } else {
-    if (_eq_integer(Current_State(Sig_UE_Id_129), CELL_FACH_Connected)) {
-      update_Mobile(Sig_UE_Id_129, CELL_FACH_Releasing);
-      EMIT(_Sig, __Sig_sc_go_42_ConnRel_CFG_138);
-    }
-  }
-
-  if (IS_SIGNAL(_Sig, __Sig_sc_go_42_ConnRel_CFG_138)) {
-    EMIT(_Sig, __Out_O_Action_125);
-
-    if (!(IS_GUARD(9)))
-      _integer(&Out_O_Action_125, E_REL_MT);
-    else
-      _integer(&Out_O_Action_125, INTEGER_COMBINE(Out_O_Action_125, E_REL_MT));
-
-    SET_GUARD(9);
-    EMIT(_Sig, __Out_O_Compute_Configuration_126);
-
-    if (!(IS_GUARD(8)))
-      _integer(&Out_O_Compute_Configuration_126, Sig_UE_Id_129);
-    else
-      _integer(&Out_O_Compute_Configuration_126, INTEGER_COMBINE(Out_O_Compute_Configuration_126, Sig_UE_Id_129));
-
-    SET_GUARD(8);
-    _On[2] |= 0x1000; /* On: #76 */
-    _Pause[0] |= 0x20; /* PauseOn: #5 */
-  } else {
-    _On[1] |= 0x2000000; /* On: #57 */
-  }
-}
-
-static void Point_57(void)
-{
-  /*#57 */
-  if (IS_SIGNAL(_Sig, __Sig_sc_go_30_ConnRel_Send_136)) {
-    encode_message(&Var_msg_137, Sig_UE_Id_129, RRC_CONN_RELEASE);
-    EMIT(_Sig, __Out_O_SEND_DCCH_UM_119);
-
-    if (!(IS_GUARD(15)))
-      _integer(&Out_O_SEND_DCCH_UM_119, Var_msg_137);
-    else
-      _integer(&Out_O_SEND_DCCH_UM_119, INTEGER_COMBINE(Out_O_SEND_DCCH_UM_119, Var_msg_137));
-
-    SET_GUARD(15);
-    RRC_RG_O_O_SEND_DCCH_UM(Out_O_SEND_DCCH_UM_119);
-    _Pause[0] |= 0x40; /* PauseOn: #6 */
-  } else {
-    _Pause[0] |= 0x80; /* PauseOn: #7 */
-  }
-}
-
-static void Point_58(void)
-{
-  /*#58 */
-  if (_eq_integer(Current_State(Sig_UE_Id_129), CELL_DCH_Connecting)) {
-    _On[1] |= 0x30000000; /* On: #60 #61 */
-  } else {
-    if (_eq_integer(Current_State(Sig_UE_Id_129), CELL_FACH_Connecting)) {
-      update_Mobile(Sig_UE_Id_129, CELL_FACH_Connected);
-      rg_clear_transaction(Sig_UE_Id_129, RRC_CONN_SETUP);
-      _On[1] |= 0x8000000; /* On: #59 */
-    } else {
-      _Pause[0] |= 0x10; /* PauseOn: #4 */
-    }
-  }
-}
-
-static void Point_59(void)
-{
-  /*#59 */
-  _Pause[0] |= 0x10; /* PauseOn: #4 */
-}
-
-static void Point_60(void)
-{
-  /*#60 */
-  update_Mobile(Sig_UE_Id_129, CELL_DCH_Connected);
-  rg_clear_transaction(Sig_UE_Id_129, RRC_CONN_SETUP);
-}
-
-static void Point_61(void)
-{
-  /*#61 */
-  _Pause[0] |= 0x10; /* PauseOn: #4 */
-}
-
-static void Point_62(void)
-{
-  /*#62 */
-  if (_eq_integer(Current_State(Sig_UE_Id_129), FAILURE)) {
-    EMIT(_Sig, __Out_O_NAS_CONN_ESTAB_IND_113);
-    _On[2] |= 0x3; /* On: #64 #65 */
-  } else {
-    if ((((_eq_integer(Current_State(Sig_UE_Id_129), CELL_DCH_Connected) || _eq_integer(Current_State(Sig_UE_Id_129), CELL_DCH_Connecting))
-          || _eq_integer(Current_State(Sig_UE_Id_129), CELL_FACH_Connected)) || _eq_integer(Current_State(Sig_UE_Id_129), CELL_FACH_Connecting))) {
-      encode_message(&Var_msgReq_134, Sig_UE_Id_129, RRC_CONN_SETUP);
-      EMIT(_Sig, __Out_O_SEND_CCCH_118);
-
-      if (!(IS_GUARD(16)))
-        _integer(&Out_O_SEND_CCCH_118, Var_msgReq_134);
-      else
-        _integer(&Out_O_SEND_CCCH_118, INTEGER_COMBINE(Out_O_SEND_CCCH_118, Var_msgReq_134));
-
-      SET_GUARD(16);
-      _On[1] |= 0x80000000;
-      _On[2] |= 0x400; /* On: #63 #74 */
-    } else {
-      _Pause[0] |= 0x8; /* PauseOn: #3 */
-    }
-  }
-}
-
-static void Point_63(void)
-{
-  /*#63 */
-  _Pause[0] |= 0x8; /* PauseOn: #3 */
-}
-
-static void Point_64(void)
-{
-  /*#64 */
-  _integer(&Out_O_NAS_CONN_ESTAB_IND_113, Sig_UE_Id_129);
-  create_Mobile(Sig_UE_Id_129);
-  RRC_RG_O_O_NAS_CONN_ESTAB_IND(Out_O_NAS_CONN_ESTAB_IND_113);
-}
-
-static void Point_65(void)
-{
-  /*#65 */
-  _Pause[0] |= 0x8; /* PauseOn: #3 */
-}
-
-static void Point_66(void)
-{
-  /*#66 */
-  if (_eq_integer(Current_State(Sig_UE_Id_129), Conn_Received)) {
-    if (_eq_integer(In_I_Status_108, SUCCESS)) {
-      if (IS_SIGNAL(_Sig, __In_I_RB_List_109)) {
-        proc_RB_List(&Var_msg_132, In_I_RB_List_109, Sig_UE_Id_129);
-        update_Mobile(Sig_UE_Id_129, CELL_DCH_Connecting);
-        _Pause[2] |= 0x8; /* PauseOn: #67 */
-      } else {
-        update_Mobile(Sig_UE_Id_129, CELL_FACH_Connecting);
-        _Pause[2] |= 0x8; /* PauseOn: #67 */
-      }
-
-      EMIT(_Sig, __Out_O_Action_125);
-
-      if (!(IS_GUARD(9)))
-        _integer(&Out_O_Action_125, E_ADD_MT);
-      else
-        _integer(&Out_O_Action_125, INTEGER_COMBINE(Out_O_Action_125, E_ADD_MT));
-
-      SET_GUARD(9);
-      EMIT(_Sig, __Out_O_Compute_Configuration_126);
-
-      if (!(IS_GUARD(8)))
-        _integer(&Out_O_Compute_Configuration_126, Sig_UE_Id_129);
-      else
-        _integer(&Out_O_Compute_Configuration_126, INTEGER_COMBINE(Out_O_Compute_Configuration_126, Sig_UE_Id_129));
-
-      SET_GUARD(8);
-      _On[2] |= 0x1000; /* On: #76 */
-    } else {
-      EMIT(_Sig, __Sig_sc_go_26_ConnEstab_REJECT_133);
-      _On[2] |= 0x100; /* On: #72 */
-    }
-  } else {
-    _Pause[0] |= 0x4; /* PauseOn: #2 */
-  }
-}
-
-static void Point_67(void)
-{
-  /*#67 AutoPauseOn */
-  if (IS_SIGNAL(_Sig, __In_I_Configuration_Indication_111)) {
-    EMIT(_Sig, __Out_O_CPHY_RL_SETUP_Req_121);
-
-    if (!(IS_GUARD(13))) {
-      RRC_RG_O_O_CPHY_RL_SETUP_Req();
-      SET_GUARD(13);
-    }
-
-    EMIT(_Sig, __Out_O_CRLC_CONFIG_Req_124);
-
-    if (!(IS_GUARD(10))) {
-      RRC_RG_O_O_CRLC_CONFIG_Req();
-      SET_GUARD(10);
-    }
-
-    _On[2] |= 0x10; /* On: #68 */
-    _On[2] &= ~0x8; /* Off: #67 */
-  } else {
-    if (IS_SIGNAL(_Sig, __In_I_Configuration_Failure_112)) {
-      EMIT(_Sig, __Out_O_NAS_CONN_RELEASE_IND_114);
-      _On[2] |= 0x20; /* On: #69 */
-      _On[2] &= ~0x8; /* Off: #67 */
-    }
-  }
-}
-
-static void Point_68(void)
-{
-  /*#68 */
-  EMIT(_Sig, __Out_O_CMAC_CONFIG_Req_123);
-
-  if (!(IS_GUARD(11))) {
-    RRC_RG_O_O_CMAC_CONFIG_Req();
-    SET_GUARD(11);
-  }
-
-  _On[2] |= 0x40; /* On: #70 */
-  _Pause[0] |= 0x2; /* PauseOn: #1 */
-}
-
-static void Point_69(void)
-{
-  /*#69 */
-  if (!(IS_GUARD(19)))
-    _integer(&Out_O_NAS_CONN_RELEASE_IND_114, Sig_UE_Id_129);
-  else
-    _integer(&Out_O_NAS_CONN_RELEASE_IND_114, INTEGER_COMBINE(Out_O_NAS_CONN_RELEASE_IND_114, Sig_UE_Id_129));
-
-  SET_GUARD(19);
-  EMIT(_Sig, __Sig_sc_go_26_ConnEstab_REJECT_133);
-  _On[2] |= 0x180; /* On: #71 #72 */
-}
-
-static void Point_70(void)
-{
-  /*#70 */
-  encode_message(&Var_msg_132, Sig_UE_Id_129, RRC_CONN_SETUP);
-  EMIT(_Sig, __Out_O_SEND_CCCH_118);
-
-  if (!(IS_GUARD(16)))
-    _integer(&Out_O_SEND_CCCH_118, Var_msg_132);
-  else
-    _integer(&Out_O_SEND_CCCH_118, INTEGER_COMBINE(Out_O_SEND_CCCH_118, Var_msg_132));
-
-  SET_GUARD(16);
-  _On[2] |= 0x400; /* On: #74 */
-}
-
-static void Point_71(void)
-{
-  /*#71 */
-  RRC_RG_O_O_NAS_CONN_RELEASE_IND(Out_O_NAS_CONN_RELEASE_IND_114);
-}
-
-static void Point_72(void)
-{
-  /*#72 */
-  if (IS_SIGNAL(_Sig, __Sig_sc_go_26_ConnEstab_REJECT_133)) {
-    _On[2] |= 0x200; /* On: #73 */
-  } else {
-    _Pause[0] |= 0x4; /* PauseOn: #2 */
-  }
-}
-
-static void Point_73(void)
-{
-  /*#73 */
-  encode_message(&Var_msg_132, Sig_UE_Id_129, RRC_CONN_REJECT);
-  EMIT(_Sig, __Out_O_SEND_CCCH_118);
-
-  if (!(IS_GUARD(16)))
-    _integer(&Out_O_SEND_CCCH_118, Var_msg_132);
-  else
-    _integer(&Out_O_SEND_CCCH_118, INTEGER_COMBINE(Out_O_SEND_CCCH_118, Var_msg_132));
-
-  SET_GUARD(16);
-  EMIT(_Sig, __Sig_Conn_Establish_complete_128);
-  _On[2] |= 0xc00; /* On: #74 #75 */
-}
-
-static void Point_74(void)
-{
-  /*#74 */
-  RRC_RG_O_O_SEND_CCCH(Out_O_SEND_CCCH_118);
-}
-
-static void Point_75(void)
-{
-  /*#75 AutoPauseOn */
-  if (IS_SIGNAL(_Sig, __Sig_Conn_Establish_complete_128)) {
-    delete_Mobile(Sig_UE_Id_129);
-    _On[2] &= ~0x800; /* Off: #75 */
-    _Pause[0] |= 0x4; /* PauseOn: #2 */
-  }
-}
-
-static void Point_76(void)
-{
-  /*#76 */
-  RRC_RG_O_O_Action(Out_O_Action_125);
-  RRC_RG_O_O_Compute_Configuration(Out_O_Compute_Configuration_126);
-}
-
-
-int RRC_RG(void)
-{
-  unsigned int *Points;
-
-  Points = _On;
-
-  if (*Points) {
-    if (*Points & 0x1) {
-      Point_0();
-    }
-
-    if (*Points & 0x2) {
-      Point_1();
-    }
-
-    if (*Points & 0x4) {
-      Point_2();
-    }
-
-    if (*Points & 0x8) {
-      Point_3();
-    }
-
-    if (*Points & 0x10) {
-      Point_4();
-    }
-
-    if (*Points & 0x20) {
-      Point_5();
-    }
-
-    if (*Points & 0x40) {
-      Point_6();
-    }
-
-    if (*Points & 0x80) {
-      Point_7();
-    }
-
-    if (*Points & 0x100) {
-      Point_8();
-    }
-
-    if (*Points & 0x200) {
-      Point_9();
-    }
-
-    if (*Points & 0x400) {
-      Point_10();
-    }
-
-    if (*Points & 0x800) {
-      Point_11();
-    }
-
-    if (*Points & 0x1000) {
-      Point_12();
-    }
-
-    if (*Points & 0x2000) {
-      Point_13();
-    }
-
-    if (*Points & 0x4000) {
-      Point_14();
-    }
-
-    if (*Points & 0x8000) {
-      Point_15();
-    }
-
-    if (*Points & 0x10000) {
-      Point_16();
-    }
-
-    if (*Points & 0x20000) {
-      Point_17();
-    }
-
-    if (*Points & 0x40000) {
-      Point_18();
-    }
-
-    if (*Points & 0x80000) {
-      Point_19();
-    }
-
-    if (*Points & 0x100000) {
-      Point_20();
-    }
-
-    if (*Points & 0x200000) {
-      Point_21();
-    }
-
-    if (*Points & 0x400000) {
-      Point_22();
-    }
-
-    if (*Points & 0x800000) {
-      Point_23();
-    }
-
-    if (*Points & 0x1000000) {
-      Point_24();
-    }
-
-    if (*Points & 0x2000000) {
-      Point_25();
-    }
-
-    if (*Points & 0x4000000) {
-      Point_26();
-    }
-
-    if (*Points & 0x8000000) {
-      Point_27();
-    }
-
-    if (*Points & 0x10000000) {
-      Point_28();
-    }
-
-    if (*Points & 0x20000000) {
-      Point_29();
-    }
-
-    if (*Points & 0x40000000) {
-      Point_30();
-    }
-
-    if (*Points & 0x80000000) {
-      Point_31();
-    }
-  }
-
-  Points++;
-
-  if (*Points) {
-    if (*Points & 0x1) {
-      Point_32();
-    }
-
-    if (*Points & 0x2) {
-      Point_33();
-    }
-
-    if (*Points & 0x4) {
-      Point_34();
-    }
-
-    if (*Points & 0x8) {
-      Point_35();
-    }
-
-    if (*Points & 0x10) {
-      Point_36();
-    }
-
-    if (*Points & 0x20) {
-      Point_37();
-    }
-
-    if (*Points & 0x40) {
-      Point_38();
-    }
-
-    if (*Points & 0x80) {
-      Point_39();
-    }
-
-    if (*Points & 0x100) {
-      Point_40();
-    }
-
-    if (*Points & 0x200) {
-      Point_41();
-    }
-
-    if (*Points & 0x400) {
-      Point_42();
-    }
-
-    if (*Points & 0x800) {
-      Point_43();
-    }
-
-    if (*Points & 0x1000) {
-      Point_44();
-    }
-
-    if (*Points & 0x2000) {
-      Point_45();
-    }
-
-    if (*Points & 0x4000) {
-      Point_46();
-    }
-
-    if (*Points & 0x8000) {
-      Point_47();
-    }
-
-    if (*Points & 0x10000) {
-      Point_48();
-    }
-
-    if (*Points & 0x20000) {
-      Point_49();
-    }
-
-    if (*Points & 0x40000) {
-      Point_50();
-    }
-
-    if (*Points & 0x80000) {
-      Point_51();
-    }
-
-    if (*Points & 0x100000) {
-      Point_52();
-    }
-
-    if (*Points & 0x200000) {
-      Point_53();
-    }
-
-    if (*Points & 0x400000) {
-      Point_54();
-    }
-
-    if (*Points & 0x800000) {
-      Point_55();
-    }
-
-    if (*Points & 0x1000000) {
-      Point_56();
-    }
-
-    if (*Points & 0x2000000) {
-      Point_57();
-    }
-
-    if (*Points & 0x4000000) {
-      Point_58();
-    }
-
-    if (*Points & 0x8000000) {
-      Point_59();
-    }
-
-    if (*Points & 0x10000000) {
-      Point_60();
-    }
-
-    if (*Points & 0x20000000) {
-      Point_61();
-    }
-
-    if (*Points & 0x40000000) {
-      Point_62();
-    }
-
-    if (*Points & 0x80000000) {
-      Point_63();
-    }
-  }
-
-  Points++;
-
-  if (*Points) {
-    if (*Points & 0x1) {
-      Point_64();
-    }
-
-    if (*Points & 0x2) {
-      Point_65();
-    }
-
-    if (*Points & 0x4) {
-      Point_66();
-    }
-
-    if (*Points & 0x8) {
-      Point_67();
-    }
-
-    if (*Points & 0x10) {
-      Point_68();
-    }
-
-    if (*Points & 0x20) {
-      Point_69();
-    }
-
-    if (*Points & 0x40) {
-      Point_70();
-    }
-
-    if (*Points & 0x80) {
-      Point_71();
-    }
-
-    if (*Points & 0x100) {
-      Point_72();
-    }
-
-    if (*Points & 0x200) {
-      Point_73();
-    }
-
-    if (*Points & 0x400) {
-      Point_74();
-    }
-
-    if (*Points & 0x800) {
-      Point_75();
-    }
-
-    if (*Points & 0x1000) {
-      Point_76();
-    }
-  }
-
-  Points++;
-  {
-    int j;
-
-    for (j = 0; j < SIGNAL_VECTOR_SIZE; j++) _Sig[j] = 0;
-
-    Sig_Rel_repeat_135_Pre1 = Sig_Rel_repeat_135_Pre0 ;
-    _On[0] = _Pause[0] | (_On[0] & 0xd8ffbe);
-    _On[1] = _Pause[1] | (_On[1] & 0xee9c0);
-    _On[2] = _Pause[2] | (_On[2] & 0x808);
-
-    /* AutoPauseOn: #1 #2 #3 #4 #5 #7 #8 #9 #10 #11 #12 #13 #14 #15 #19 #20 #22 #23 #38 #39 #40 #43 #45 #46 #47 #49 #50 #51 #67 #75 */
-    for (j = 0; j < HALT_POINT_VECTOR_SIZE; j++) _Pause[j] = 0;
-
-    for (j = 0; j < GUARD_VECTOR_SIZE; j++) _Guard[j] = 0;
-  }
-  return Var__ThisIsTheEnd__171;
-}
-
-int RRC_RG_reset(void)
-{
-  int i,j;
-
-  for (j = 0 ; j < SIGNAL_VECTOR_SIZE; j++) _Sig[j] = 0;
-
-  for (i = 0 ; i < HALT_POINT_VECTOR_SIZE; i++) _On[i] = 0;
-
-  for (i = 0 ; i < HALT_POINT_VECTOR_SIZE; i++) _Pause[i] = 0;
-
-  for (i = 0 ; i < GUARD_VECTOR_SIZE; i++) _Guard[i] = 0;
-
-  BIT_SET(_On, 0);
-  return 1;
-}
-
-typedef int (*SimInitFunc_t) ();
-int RRC_RG_init (char** pError, SimInitFunc_t pFunc)
-{
-  return 1;
-}
-typedef int (*SimEndFunc_t) ();
-int RRC_RG_end (SimEndFunc_t pFunc)
-{
-  return 1;
-}
-int RRC_RG_run(void)
-{
-  return RRC_RG();
-}
-int RRC_RG_getError(void)
-{
-  return 0;
-}
-char* RRC_RG_getErrorMessage(void)
-{
-  return (char*)0;
-}
diff --git a/openair2/RRC/CELLULAR/rrc_rg.h b/openair2/RRC/CELLULAR/rrc_rg.h
deleted file mode 100755
index a517777a92..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/***************************************************************************
-                          rrc_rg.h  -  description
-                             -------------------
-    begin                : May 22, 2002
-    copyright            : (C) 2002, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Header associated with the rrc_rg.c file generated by Esterel Studio
- ***************************************************************************/
-#include  "rrc_constant.h"
-
-/* Generic function to encode RRC messages
- */
-void encode_message (int *Message_Id, int UE_Id, int Message_Type);
-
-/* Utility functions
- */
-int Current_State (int UE_Id);
-int INTEGER_COMBINE (int Id1, int Id2);
-int BOOLEAN_COMBINE (int Id1, int Id2);
-
-/* Management of Mobile Nodes
- */
-void create_Mobile (int UE_Id);
-void update_Mobile (int UE_Id, int new_state);
-void delete_Mobile (int UE_Id);
-
-/* Other processes
- */
-void proc_RB_List(int *Message_Id, int RB_List, int UE_Id);
-void release_DCH_Resources(int UE_Id);
-void restore_former_config(int UE_Id);
-void rg_clear_transaction (int UE_Id, int Message_Type);
-void clear_rbsetup_variables(int UE_Id);
-void clear_rbrelease_variables(int UE_Id);
-void rg_update_UE_numrb(int UE_Id, int Action);
diff --git a/openair2/RRC/CELLULAR/rrc_rg_L2_frontend.c b/openair2/RRC/CELLULAR/rrc_rg_L2_frontend.c
deleted file mode 100755
index b8b54d912c..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg_L2_frontend.c
+++ /dev/null
@@ -1,883 +0,0 @@
-/***************************************************************************
-                          rrc_rg_L2_frontend.c - description
-                          -------------------
-    begin               : July 2010
-    copyright           : (C) 2010 by Eurecom
-    created by    : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-    This file contain front end functions to isolate L2 interface
- **************************************************************************/
-//#define RRC_DEBUG_DUMMIES
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_rg_vars.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_int.h"
-#include "rrc_proto_fsm.h"
-#include "rrc_proto_intf.h"
-#include "rrc_proto_bch.h"
-#include "rrc_proto_mbms.h"
-
-extern rlc_info_t Rlc_info_um, Rlc_info_am_config;
-extern eNB_MAC_INST *eNB_mac_inst;
-extern u32_t rlc_um_get_buffer_occupancy (rlc_um_entity_t *rlcP);
-
-//-----------------------------------------------------------------------------
-/*  global variables copied from RRC LITE for logical channels */
-long logicalChannelGroup0 = 0;
-long  logicalChannelSR_Mask_r9=0;
-
-struct LogicalChannelConfig__ul_SpecificParameters LCSRB1 =  {1,
-         LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_infinity,
-         0,
-         &logicalChannelGroup0
-};
-
-struct LogicalChannelConfig__ul_SpecificParameters LCSRB2 =  {3,
-         LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_infinity,
-         0,
-         &logicalChannelGroup0
-};
-
-// These are the default SRB configurations from 36.331 (Chapter 9, p. 176-179 in v8.6)
-
-LogicalChannelConfig_t  SRB1_logicalChannelConfig_defaultValue = {&LCSRB1
-#ifdef Rel10
-                                                                  , &logicalChannelSR_Mask_r9
-#endif
-                                                                 };
-
-LogicalChannelConfig_t SRB2_logicalChannelConfig_defaultValue = {&LCSRB2
-#ifdef Rel10
-                                                                 , &logicalChannelSR_Mask_r9
-#endif
-                                                                };
-/*  END - global variables copied from RRC LITE for logical channels */
-//-----------------------------------------------------------------------------
-
-// Configuration Functions for L1-L2 layers
-//-----------------------------------------------------------------------------
-void crb_config_req (int activation_timeP)
-{
-  //-----------------------------------------------------------------------------
-  //#ifdef RRC_DEBUG_DUMMIES
-  msg ("\n[RRC][RG-DUMMIES] DUMMY CALL to crb_config_req\n");
-  //#endif
-}
-//-----------------------------------------------------------------------------
-void cmac_config_req (int userP, int activation_timeP)
-{
-  //-----------------------------------------------------------------------------
-  //#ifdef RRC_DEBUG_DUMMIES
-  msg ("\n[RRC][RG-DUMMIES] DUMMY CALL to cmac_config_req\n");
-  //#endif
-}
-//-----------------------------------------------------------------------------
-void CPHY_config_req (void *config, int activation_time, int userP)
-{
-  //-----------------------------------------------------------------------------
-  //#ifdef RRC_DEBUG_DUMMIES
-  msg ("\n[RRC][RG-DUMMIES] DUMMY CALL to CPHY_config_req\n");
-  //#endif
-}
-
-// Measurement functions
-// TBD
-
-//-----------------------------------------------------------------------------
-void rrc_remove_UE(u8 Mod_id,u8 UE_id)
-{
-  //-----------------------------------------------------------------------------
-  msg ("\n[RRC-RG]call to rrc_remove_UE [empty - to be implemented in CELLULAR mode]\n");
-}
-
-
-// Unified function to send data
-//-----------------------------------------------------------------------------
-int rrc_rg_send_to_srb_rlc (int UE_id, int rb_id, char * data_buffer, int data_length)
-{
-  //-----------------------------------------------------------------------------
-  char tx_data[500];
-  //int stxtlen = 0;
-
-  int result =0;
-  int Mod_id =0;
-  int eNB_flag = 1; //1=eNB, 0=UE
-  //int srb1 =1;
-
-#ifdef RRC_DEBUG_DETAILS
-  msg ("\n[RRC-RG-FRONTEND] Send Data to RLC, srb %d\n",rb_id);
-#endif
-
-  // OpenAirInterface, as of 02/01/2013, requires passing all the RRC CELL srb through the DCCH
-  // Multiplexing is performed by adding the srb_id as first byte of data buffer
-  if (rb_id != RRC_BCCH_ID) {
-    if (rb_id != RRC_MCCH_ID) {
-#ifdef DEBUG_RRC_STATE
-      msg ("[RRC-RG-FRONTEND] Send Data to RLC, srb %d\n",rb_id);
-#endif
-    }
-
-    memset(tx_data,0,500);
-    tx_data[0] = rb_id;
-    memcpy ((char*)&tx_data[1],data_buffer, data_length);
-    data_length = data_length +1;
-  }
-
-  //rrc_print_buffer (tx_data, data_length);
-
-  switch (rb_id) {
-  case RRC_BCCH_ID: //BCCH
-    // send buffer on BCCH - As of 08/07/2010, this call is actually a NOP, since
-    // broadcast is actually retrieved through the rrc_L2_data_req_rx function
-    result = 1;
-    break;
-
-  case RRC_SRB0_ID: //CCCH
-  case RRC_SRB1_ID: //DCCH-UM
-
-    //result = rrc_rlc_data_req(Mod_id,protocol_bs->rrc.current_SFN, eNB_flag,(UE_id*NB_RB_MAX)+DCCH,protocol_bs->rrc.next_MUI++,RRC_RLC_CONFIRM_NO,data_length,tx_data);
-    if (pdcp_data_req(0, Mod_id,protocol_bs->rrc.current_SFN, eNB_flag,(UE_id*NB_RB_MAX)+DCCH,protocol_bs->rrc.next_MUI++,RRC_RLC_CONFIRM_NO,data_length,tx_data,PDCP_MODE_DATA_PDU))
-      result = 1;
-
-    break;
-
-  case RRC_SRB2_ID: //DCCH-AM
-    if (pdcp_data_req(0, Mod_id,protocol_bs->rrc.current_SFN, eNB_flag,(UE_id*NB_RB_MAX)+DCCH,protocol_bs->rrc.next_MUI++,RRC_RLC_CONFIRM_YES,data_length,tx_data,1))
-      result = 1;
-
-    break;
-
-  case RRC_SRB3_ID: //DCCH-AM - NAS
-
-    /*
-    if (protocol_bs->rrc.rg_rb_asn1.SRB2_active == 1){
-         if (pdcp_data_req(Mod_id,protocol_bs->rrc.current_SFN, eNB_flag,(UE_id*NB_RB_MAX)+DCCH+1,protocol_bs->rrc.next_MUI++,RRC_RLC_CONFIRM_NO,data_length,tx_data,1))
-           result = 1;
-     } else {
-         if (pdcp_data_req(Mod_id,protocol_bs->rrc.current_SFN, eNB_flag,(UE_id*NB_RB_MAX)+DCCH,protocol_bs->rrc.next_MUI++,RRC_RLC_CONFIRM_YES,data_length,tx_data,1))
-           result = 1;
-     }*/
-    if (pdcp_data_req(Mod_id,protocol_bs->rrc.current_SFN, eNB_flag,(UE_id*NB_RB_MAX)+DCCH,protocol_bs->rrc.next_MUI++,RRC_RLC_CONFIRM_YES,data_length,tx_data,1))
-      result = 1;
-
-    break;
-#ifdef ALLOW_MBMS_PROTOCOL
-
-  case RRC_MCCH_ID: //MCCH -- sent to srb2 (modified for UM in asn1_msg.c)
-
-    /*
-    if (pdcp_data_req(Mod_id,protocol_bs->rrc.current_SFN, eNB_flag,(UE_id*NB_RB_MAX)+DCCH,protocol_bs->rrc.next_MUI++,RRC_RLC_CONFIRM_NO,data_length,tx_data,1))
-      result = 1;*/
-    if (pdcp_data_req(Mod_id,protocol_bs->rrc.current_SFN, eNB_flag,(UE_id*NB_RB_MAX)+DCCH+1,protocol_bs->rrc.next_MUI++,RRC_RLC_CONFIRM_NO,data_length,tx_data,1))
-      result = 1;
-
-    break;
-#endif
-
-  default:
-    msg ("\n[RRC-RG-FRONTEND] ERROR - Unable to send data to PDCP/RLC, Channel srb %d not supported\n",rb_id);
-  }
-
-  if (result !=1)
-    msg ("\n[RRC-RG-FRONTEND] ERROR - RLC returned an error code %d\n", result);
-
-  return result;
-
-}
-
-//-----------------------------------------------------------------------------
-// Unified function to receive data
-int rrc_rg_receive_from_srb_rlc (char* sduP, u8 ch_idP, unsigned int Sdu_size)
-{
-  //-----------------------------------------------------------------------------
-  int srb_id, rb_id=0;
-  int UE_Id;
-  //int sdu_offset=0;
-
-#ifdef DEBUG_RRC_DETAILS
-  msg ("\n[RRC-RG-FRONTEND] CALL to rrc_rg_srb_rx, lchannel %d\n", ch_idP);
-  rrc_print_buffer ((char*)&sduP[0], Sdu_size);
-#endif
-
-  // get UE_Id
-  rb_id = ch_idP;
-  srb_id = rb_id % NB_RB_MAX;
-  UE_Id = (rb_id - srb_id) / NB_RB_MAX;
-  // get RRC_CELL srb_id
-  srb_id = sduP[0];
-
-  /*
-    //rb_id = ch_idP - 12;
-    rb_id = ch_idP;
-    srb_id = rb_id % maxRB;
-    UE_Id = (rb_id - srb_id) / maxRB;
-    //TEMP - if srb_id is SRB2, check if it is not SRB3
-    if (srb_id==RRC_SRB2_ID){
-      sdu_offset = 1;
-      if (sduP[0] == RRC_SRB2_ID)
-        srb_id=RRC_SRB2_ID;
-      if (sduP[0] == RRC_SRB3_ID)
-        srb_id=RRC_SRB3_ID;
-    }
-    #ifdef DEBUG_RRC_DETAILS
-    msg ("[RRC][SRB-RG] LCHAN%d RX in frame %d\n", ch_idP, protocol_bs->rrc.current_SFN);
-    #endif
-    if (ch_idP!=RRC_LTE_DCCH_ID){
-      #ifdef DEBUG_RRC_STATE
-      msg ("[RRC][SRB-RG] RB %d, SRB%d received, UE_Id %d\n", rb_id, srb_id, UE_Id);
-      //msg ("[RRC][SRB-RG] frame received: %s\n", (char*)&sduP[sdu_offset]);
-      #endif
-      rrc_rg_srb_rx (Buffer, rb_id, Sdu_size);
-    }
-  */
-
-  switch (srb_id) {
-  case RRC_SRB0_ID: //CCCH
-  case RRC_SRB1_ID: //DCCH-UM
-  case RRC_SRB2_ID: //DCCH-AM
-  case RRC_SRB3_ID: //DCCH-AM - NAS
-    rrc_rg_srb_rx ((char*)&sduP[1], srb_id, UE_Id);
-    break;
-
-  default:
-    msg ("\n[RRC-RG-FRONTEND] Invalid Channel srb  number %d\n",srb_id);
-  }
-
-  return 0;
-}
-
-/*****************************************
- Configuration Functions for L1-L2 layers
- *****************************************/
-// This function retrieves the common configuration for lower layers  to be broadcasted in SIB5 (or SIB2 for LTE)
-//-----------------------------------------------------------------------------
-void rrc_rg_get_common_config_SIB (int *config_length, char**config_ptr)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_DETAILS
-  msg ("\n\n[RRC-RG-FRONTEND] rrc_rg_get_common_config_SIB\n");
-#endif
-  // (RadioResourceConfigCommonSIB_t *)&eNB_rrc_inst[Mod_id].sib2->radioResourceConfigCommon,
-
-  //    protocol_bs->rrc.rg_bch_asn1.sizeof_SIB2 = sizeof(SystemInformationBlockType2_t);
-  //    *config_length = sizeof(SystemInformationBlockType2_t);
-  //    config_ptr = (char*)&protocol_bs->rrc.rg_bch_asn1.sib2;
-  //    *config_length = sizeof(RadioResourceConfigCommonSIB_t *);
-  //    config_ptr = (char*)&protocol_bs->rrc.rg_bch_asn1.sib2.radioResourceConfigCommon;
-  *config_length = protocol_bs->rrc.rg_bch_asn1.sizeof_SIB2;
-  *config_ptr = (char*)&protocol_bs->rrc.rg_bch_asn1.SIB23;
-#ifdef DEBUG_RRC_DETAILS
-  //msg ("\n[RRC-RG] rrc_rg_get_common_config_SIB config pointer  %p \n", *config_ptr);
-  rrc_print_buffer ((char *) &protocol_bs->rrc.rg_bch_asn1.SIB23, protocol_bs->rrc.rg_bch_asn1.sizeof_SIB2);
-#endif
-
-#ifdef DEBUG_RRC_DETAILS
-  msg ("[RRC-RG-FRONTEND] rrc_rg_get_common_config_SIB - END\n\n");
-#endif
-}
-
-//-----------------------------------------------------------------------------
-void rrc_rg_init_mac (unsigned char Mod_id)
-{
-  //-----------------------------------------------------------------------------
-  u8 result;
-  //int Mod_id =0;
-  int eNB_flag=1;
-  int UE_index=0;
-  int eNB_index=0;
-
-  u8 SIwindowsize=1;
-  u16 SIperiod=8;
-
-
-#ifdef DEBUG_RRC_DETAILS
-  msg ("\n[RRC-RG-FRONTEND] rrc_rg_init_mac %d\n", Mod_id);
-#endif
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC-RG-FRONTEND] do_SIB1_TDD_config_cell\n");
-#endif
-
-  // Initialize TDD_config parameters (TDD_Config_t tdd_Config;) calling asn1_msg.c
-  result = do_SIB1_TDD_config_cell (mac_xface->lte_frame_parms, (TDD_Config_t *)&protocol_bs->rrc.rg_bch_asn1.tdd_Config);
-
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC-RG-FRONTEND] Frame TDD config %d, protocol_bs value %d\n", mac_xface->lte_frame_parms->tdd_config, (int)protocol_bs->rrc.rg_bch_asn1.tdd_Config.subframeAssignment);
-  msg ("[RRC-RG-FRONTEND] do_SIB2_cell\n");
-#endif
-
-  //uint8_t do_SIB2_cell(uint8_t Mod_id, LTE_DL_FRAME_PARMS *frame_parms, uint8_t *buffer,
-  //                  BCCH_DL_SCH_Message_t *bcch_message, SystemInformationBlockType2_t **sib2) {
-  protocol_bs->rrc.rg_bch_asn1.sizeof_SIB2 = do_SIB2_cell(0, mac_xface->lte_frame_parms, &protocol_bs->rrc.rg_bch_asn1.SIB23,
-      &protocol_bs->rrc.rg_bch_asn1.systemInformation, &protocol_bs->rrc.rg_bch_asn1.sib2);
-
-#ifdef DEBUG_RRC_DETAILS
-  msg ("[RRC-RG] SystemInformation Encoded %d bytes\n", protocol_bs->rrc.rg_bch_asn1.sizeof_SIB2);
-  //LOG_D(RRC,"[eNB] SystemInformation Encoded %d bits (%d bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8);
-#endif
-
-  if (protocol_bs->rrc.rg_bch_asn1.sizeof_SIB2 == 255)
-    mac_xface->macphy_exit("rrc_sizeof_SIB2 = 255");
-  else {
-#ifdef DEBUG_RRC_STATE
-    msg ("[RRC-RG-FRONTEND] MAC_CONFIG_REQ  (SIB1-SIB2)--->][MAC_eNB]\n");
-    msg ("[RRC-RG-FRONTEND] Parameters : Mod_id %d, eNB_flag %d, UE_index %d, eNB_index %d \n",Mod_id, eNB_flag, UE_index, eNB_index);
-    //msg ("[RRC-RG-FRONTEND] Frame TDD config %d, protocol_bs value %d\n", mac_xface->lte_frame_parms->tdd_config, protocol_bs->rrc.rg_bch_asn1.tdd_Config.subframeAssignment);
-#endif
-
-    /*    rrc_mac_config_req(Mod_id,1,0,0,
-               (RadioResourceConfigCommonSIB_t *)&eNB_rrc_inst[Mod_id].sib2->radioResourceConfigCommon,
-               (struct PhysicalConfigDedicated *)NULL,
-               (MeasObjectToAddMod_t **)NULL,
-               (MAC_MainConfig_t *)NULL,
-               0,
-               (struct LogicalChannelConfig *)NULL,
-               (MeasGapConfig_t *)NULL,
-               eNB_rrc_inst[Mod_id].sib1->tdd_Config,
-               &SIwindowsize,
-               &SIperiod,
-               eNB_rrc_inst[Mod_id].sib2->freqInfo.ul_CarrierFreq,
-               eNB_rrc_inst[Mod_id].sib2->freqInfo.ul_Bandwidth,
-               &eNB_rrc_inst[Mod_id].sib2->freqInfo.additionalSpectrumEmission,
-               (MBSFN_SubframeConfigList_t *)eNB_rrc_inst[Mod_id].sib2->mbsfn_SubframeConfigList
-    #ifdef Rel10
-               ,
-               eNB_rrc_inst[Mod_id].MBMS_flag,
-               (MBSFN_AreaInfoList_r9_t *)&eNB_rrc_inst[Mod_id].sib13->mbsfn_AreaInfoList_r9,
-               (PMCH_InfoList_r9_t *)NULL
-    #endif
-               );
-    */
-
-    //  Apply configuration to local MAC
-    rrc_mac_config_req(Mod_id,eNB_flag,UE_index,eNB_index,
-                       (RadioResourceConfigCommonSIB_t *)&protocol_bs->rrc.rg_bch_asn1.sib2->radioResourceConfigCommon,
-                       (struct PhysicalConfigDedicated *)NULL,
-                       (MeasObjectToAddMod_t **)NULL,
-                       (MAC_MainConfig_t *)NULL,
-                       0, //logicalChannelIdentity
-                       (struct LogicalChannelConfig *)NULL,
-                       (MeasGapConfig_t *)NULL,
-                       (TDD_Config_t *)&protocol_bs->rrc.rg_bch_asn1.tdd_Config,
-                       &SIwindowsize,
-                       &SIperiod,
-                       protocol_bs->rrc.rg_bch_asn1.sib2->freqInfo.ul_CarrierFreq,
-                       protocol_bs->rrc.rg_bch_asn1.sib2->freqInfo.ul_Bandwidth,
-                       protocol_bs->rrc.rg_bch_asn1.sib2->freqInfo.additionalSpectrumEmission,
-                       (MBSFN_SubframeConfigList_t *)protocol_bs->rrc.rg_bch_asn1.sib2->mbsfn_SubframeConfigList
-#ifdef Rel10
-                       , 0, //eNB_rrc_inst[Mod_id].MBMS_flag,
-                       (MBSFN_AreaInfoList_r9_t *)NULL,
-                       (PMCH_InfoList_r9_t *)NULL
-#endif
-                      );
-  }
-
-#ifdef DEBUG_RRC_DETAILS
-  msg ("[RRC-RG-FRONTEND] rrc_rg_init_mac %d - END\n", Mod_id);
-#endif
-}
-
-
-//-----------------------------------------------------------------------------
-void rrc_rg_config_LTE_srb1 (unsigned char Mod_id)
-{
-  //-----------------------------------------------------------------------------
-  int UE_index = protocol_bs->rrc.ccch_current_UE_Id;
-  int eNB_index = 0;
-  int eNB_flag = 1; //1=eNB, 0=UE
-  int srb1 = 1;
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC-RG-FRONTEND] rrc_rg_config_LTE_srb1\n");
-  msg ("[RRC-RG-FRONTEND] Parameters : Mod_id %d, eNB_flag %d, UE_index %d, eNB_index %d \n",Mod_id, eNB_flag, UE_index, eNB_index);
-#endif
-
-  // get the parameters values SRB1_config, SRB2_config, physicalConfigDedicated
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC-RG-FRONTEND] do_RRCConnectionSetup\n");
-#endif
-
-  //protocol_ms->rrc.ccch_buffer_size = do_RRCConnectionRequest((u8 *)protocol_ms->rrc.ccch_buffer,rv);
-  //  SRB_ToAddModList_t **SRB_configList = &eNB_rrc_inst[Mod_id].SRB_configList[UE_index];
-
-  //     do_RRCConnectionSetup((u8 *)eNB_rrc_inst[Mod_id].Srb0.Tx_buffer.Payload,
-  //        mac_xface->get_transmission_mode(Mod_id,find_UE_RNTI(Mod_id,UE_index)),
-  //        UE_index,0,
-  //        mac_xface->lte_frame_parms,
-  //        SRB_configList,
-  //        &eNB_rrc_inst[Mod_id].physicalConfigDedicated[UE_index]);
-
-
-  protocol_bs->rrc.ccch_buffer_size = do_RRCConnectionSetup((u8 *)protocol_bs->rrc.ccch_buffer,
-                                      //mac_xface->get_transmission_mode(Mod_id,find_UE_RNTI(Mod_id,UE_index)),
-                                      1,  // TEMP - hardcoded in RG as well
-                                      UE_index,0,
-                                      mac_xface->lte_frame_parms,
-                                      /*        //&eNB_rrc_inst[Mod_id].SRB1_config[UE_index],
-                                              &protocol_bs->rrc.rg_rb_asn1.SRB1_config,
-                                              //&eNB_rrc_inst[Mod_id].SRB2_config[UE_index],
-                                              &protocol_bs->rrc.rg_rb_asn1.SRB2_config,*/
-                                      &protocol_bs->rrc.rg_rb_asn1.SRB_configList[UE_index],
-                                      //&eNB_rrc_inst[Mod_id].physicalConfigDedicated[UE_index]);
-                                      &protocol_bs->rrc.rg_rb_asn1.physicalConfigDedicated);
-
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC-RG-FRONTEND] SRB1_logicalChannelConfig\n");
-#endif
-  // get the parameters values SRB1_logicalChannelConfig SRB2_logicalChannelConfig
-  // Default value set as global variable
-  protocol_bs->rrc.rg_rb_asn1.SRB1_logicalChannelConfig = &SRB1_logicalChannelConfig_defaultValue;
-
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC-RG-FRONTEND] MAC_CONFIG_REQ  (SRB1 UE %d)--->][MAC_eNB]\n", UE_index);
-  msg ("[RRC-RG-FRONTEND] Parameters : Mod_id %d, eNB_flag %d, UE_index %d, eNB_index %d \n",Mod_id, eNB_flag, UE_index, eNB_index);
-#endif
-  //Apply configurations to MAC and RLC for SRB1 and SRB2
-  /*
-  rrc_mac_config_req(Mod_id,1,UE_index,0,
-      (RadioResourceConfigCommonSIB_t *)NULL,
-      eNB_rrc_inst[Mod_id].physicalConfigDedicated[UE_index],
-      (MeasObjectToAddMod_t **)NULL,
-      eNB_rrc_inst[Mod_id].mac_MainConfig[UE_index],
-      1,
-      SRB1_logicalChannelConfig,
-      eNB_rrc_inst[Mod_id].measGapConfig[UE_index],
-      (TDD_Config_t *)NULL,
-      (u8 *)NULL,
-      (u16 *)NULL,
-      NULL,
-      NULL,
-      NULL,
-      (MBSFN_SubframeConfigList_t *)NULL
-      #ifdef Rel10
-      , 0,
-      (MBSFN_AreaInfoList_r9_t *)NULL,
-      (PMCH_InfoList_r9_t *)NULL
-      #endif
-  );
-
-  */
-  rrc_mac_config_req(Mod_id,eNB_flag,UE_index,eNB_index,  //OK
-                     (RadioResourceConfigCommonSIB_t *)NULL,  //OK
-                     //(PhysicalConfigDedicated_t *)&protocol_bs->rrc.rg_rb_asn1.physicalConfigDedicated,  //OK
-                     protocol_bs->rrc.rg_rb_asn1.physicalConfigDedicated,  //OK
-                     (MeasObjectToAddMod_t **)NULL,
-                     protocol_bs->rrc.rg_rb_asn1.mac_MainConfig,  //OK = NULL
-                     srb1, //logicalChannelIdentity  //OK
-                     protocol_bs->rrc.rg_rb_asn1.SRB1_logicalChannelConfig,  //OK
-                     protocol_bs->rrc.rg_rb_asn1.measGapConfig, //OK = NULL
-                     (TDD_Config_t *)NULL, //OK
-                     (u8 *)NULL,  //OK
-                     (u16 *)NULL, //OK
-                     NULL,
-                     NULL,
-                     NULL,
-                     (MBSFN_SubframeConfigList_t *)NULL
-#ifdef Rel10
-                     , 0,
-                     (MBSFN_AreaInfoList_r9_t *)NULL,
-                     (PMCH_InfoList_r9_t *)NULL
-#endif
-                    );
-
-  msg("[eNB %d] CALLING PDCP + RLC CONFIG SRB1 (rbid %d) for UE %d\n", Mod_id,srb1,UE_index);
-  /*  rrc_pdcp_config_req (Mod_id, protocol_bs->rrc.current_SFN, eNB_flag, ACTION_ADD, srb1);
-    rrc_rlc_config_req(Mod_id,protocol_bs->rrc.current_SFN,eNB_flag,ACTION_ADD,srb1,SIGNALLING_RADIO_BEARER,Rlc_info_am_config);*/
-  rrc_pdcp_config_asn1_req(Mod_id,UE_index,protocol_bs->rrc.current_SFN,eNB_flag,
-                           protocol_bs->rrc.rg_rb_asn1.SRB_configList[UE_index],
-                           (DRB_ToAddModList_t*)NULL,
-                           (DRB_ToReleaseList_t*)NULL
-#ifdef Rel10
-                           ,(MBMS_SessionInfoList_r9_t *)NULL
-#endif
-                          );
-
-  rrc_rlc_config_asn1_req(Mod_id,protocol_bs->rrc.current_SFN,eNB_flag,UE_index,
-                          protocol_bs->rrc.rg_rb_asn1.SRB_configList[UE_index],
-                          (DRB_ToAddModList_t*)NULL,
-                          (DRB_ToReleaseList_t*)NULL
-#ifdef Rel10
-                          ,(MBMS_SessionInfoList_r9_t *)NULL
-#endif
-                         );
-}
-
-//-----------------------------------------------------------------------------
-void rrc_rg_rcve_ccch(u8 Mod_id, char *Sdu, u16 Sdu_len)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC-RG-FRONTEND] rrc_rg_rcve_ccch , ConnReq, length %d, Mod_id %d\n", Sdu_len, Mod_id);
-#endif
-  protocol_bs->rrc.ccch_current_UE_Id ++;
-  rrc_rg_config_LTE_srb1((unsigned char)Mod_id);
-}
-
-//-----------------------------------------------------------------------------
-void rrc_rg_config_LTE_srb2 (unsigned char Mod_id)
-{
-  //-----------------------------------------------------------------------------
-  int UE_index = protocol_bs->rrc.ccch_current_UE_Id;
-  int eNB_index = 0;
-  int eNB_flag = 1; //1=eNB, 0=UE
-  int srb2 = 2;
-
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC-RG-FRONTEND] rrc_rg_config_LTE_srb2 - SRB2_logicalChannelConfig\n");
-#endif
-  // get the parameters values SRB2_logicalChannelConfig
-  // Default value set as global variable
-  protocol_bs->rrc.rg_rb_asn1.SRB2_logicalChannelConfig = &SRB2_logicalChannelConfig_defaultValue;
-
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC-RG-FRONTEND] MAC_CONFIG_REQ  (SRB2 UE 0)--->][MAC_eNB]\n");
-  msg ("[RRC-RG-FRONTEND] Parameters : Mod_id %d, eNB_flag %d, UE_index %d, eNB_index %d \n",Mod_id, eNB_flag, UE_index, eNB_index);
-#endif
-  rrc_mac_config_req(Mod_id,eNB_flag,UE_index,eNB_index,  //OK
-                     (RadioResourceConfigCommonSIB_t *)NULL,  //OK
-                     protocol_bs->rrc.rg_rb_asn1.physicalConfigDedicated,  //OK
-                     (MeasObjectToAddMod_t **)NULL,
-                     //(MAC_MainConfig_t*)&protocol_bs->rrc.rg_rb_asn1.mac_MainConfig,  //OK = NULL
-                     (MAC_MainConfig_t*)NULL,
-                     srb2, //logicalChannelIdentity  //OK
-                     protocol_bs->rrc.rg_rb_asn1.SRB2_logicalChannelConfig,  //OK
-                     //(MeasGapConfig_t *)&protocol_bs->rrc.rg_rb_asn1.measGapConfig, //OK = NULL
-                     (MeasGapConfig_t *)NULL, //OK = NULL
-                     (TDD_Config_t *)NULL, //OK
-                     (u8 *)NULL,  //OK
-                     (u16 *)NULL, //OK
-                     NULL,
-                     NULL,
-                     NULL,
-                     (MBSFN_SubframeConfigList_t *)NULL
-#ifdef Rel10
-                     , 0,
-                     (MBSFN_AreaInfoList_r9_t *)NULL,
-                     (PMCH_InfoList_r9_t *)NULL
-#endif
-                    );
-
-
-  msg("[eNB %d] CALLING PDCP + RLC CONFIG SRB2 (rbid %d) for UE %d\n", Mod_id,srb2,UE_index);
-  /*  rrc_pdcp_config_req (Mod_id, protocol_bs->rrc.current_SFN, eNB_flag, ACTION_ADD, srb2);
-    rrc_rlc_config_req(Mod_id,protocol_bs->rrc.current_SFN,eNB_flag,ACTION_ADD,srb2,SIGNALLING_RADIO_BEARER,Rlc_info_am_config);*/
-  rrc_pdcp_config_asn1_req(Mod_id,UE_index,protocol_bs->rrc.current_SFN,eNB_flag,
-                           protocol_bs->rrc.rg_rb_asn1.SRB_configList[UE_index],
-                           (DRB_ToAddModList_t*)NULL,
-                           (DRB_ToReleaseList_t*)NULL
-#ifdef Rel10
-                           ,(MBMS_SessionInfoList_r9_t *)NULL
-#endif
-                          );
-
-  rrc_rlc_config_asn1_req(Mod_id,protocol_bs->rrc.current_SFN,eNB_flag,UE_index,
-                          protocol_bs->rrc.rg_rb_asn1.SRB_configList[UE_index],
-                          (DRB_ToAddModList_t*)NULL,
-                          (DRB_ToReleaseList_t*)NULL
-#ifdef Rel10
-                          ,(MBMS_SessionInfoList_r9_t *)NULL
-#endif
-                         );
-  protocol_bs->rrc.rg_rb_asn1.SRB2_active[UE_index] = 1;
-  // TEMP Next lines have been transferred from rrc_rg_rrm_connected_init
-  // because MCCH is using srb2
-  //Initialise MBMS
-  rrc_rg_mbms_init();
-
-}
-
-//-----------------------------------------------------------------------------
-void rrc_rg_config_LTE_default_drb (unsigned char Mod_id)
-{
-  //-----------------------------------------------------------------------------
-  int UE_index = protocol_bs->rrc.ccch_current_UE_Id;
-  int eNB_index = 0;
-  int eNB_flag = 1; //1=eNB, 0=UE
-  int drb_ix=0;  // default DRB
-  u8 buffer[100];
-  u8 size;
-  u8 DRB2LCHAN[8];
-
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC-RG-FRONTEND] rrc_rg_config_LTE_default_drb: begin for UE %d eNB mod id %d\n", UE_index, Mod_id);
-#endif
-  /*
-  uint8_t do_RRCConnectionReconfiguration(uint8_t  Mod_id,
-              uint8_t                          *buffer,
-              uint8_t                           UE_id,
-              uint8_t                           Transaction_id,
-              SRB_ToAddModList_t                *SRB_list,
-              DRB_ToAddModList_t                *DRB_list,
-              DRB_ToReleaseList_t               *DRB_list2,
-              struct SPS_Config                 *sps_Config,
-              struct PhysicalConfigDedicated    *physicalConfigDedicated,
-              MeasObjectToAddModList_t          *MeasObj_list,
-              ReportConfigToAddModList_t        *ReportConfig_list,
-              QuantityConfig_t                  *QuantityConfig,
-              MeasIdToAddModList_t              *MeasId_list,
-              MAC_MainConfig_t                  *mac_MainConfig,
-              MeasGapConfig_t                   *measGapConfig,
-              uint8_t                           *nas_pdu,
-              uint32_t                           nas_length
-              ) {
-  */
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC-RG-FRONTEND] do_RRCConnReconf_defaultCELL\n");
-#endif
-
-  //  size = do_RRCConnectionReconfiguration_cell(Mod_id, buffer, UE_index, 0,
-  size = do_RRCConnReconf_defaultCELL(Mod_id, buffer, UE_index, 0,
-                                      //&eNB_rrc_inst[Mod_id].SRB2_config[UE_index],
-                                      //&protocol_bs->rrc.rg_rb_asn1.SRB2_config,
-                                      &protocol_bs->rrc.rg_rb_asn1.SRB_configList[UE_index],
-                                      //&eNB_rrc_inst[Mod_id].DRB_config[UE_id][0],
-                                      &protocol_bs->rrc.rg_rb_asn1.DRB_configList[UE_index],
-                                      //&eNB_rrc_inst[Mod_id].physicalConfigDedicated[UE_index]);
-                                      &protocol_bs->rrc.rg_rb_asn1.physicalConfigDedicated);
-
-  if (protocol_bs->rrc.rg_rb_asn1.DRB_configList[UE_index]->list.array[0]) {
-    msg("[RRC-RG-FRONTEND] rrc_rg_config_LTE_default_drb: reconfiguring DRB %d/LCID %d\n",
-        (int)protocol_bs->rrc.rg_rb_asn1.DRB_configList[UE_index]->list.array[0]->drb_Identity,
-        (int)*protocol_bs->rrc.rg_rb_asn1.DRB_configList[UE_index]->list.array[0]->logicalChannelIdentity);
-
-    DRB2LCHAN[drb_ix] = (u8)*protocol_bs->rrc.rg_rb_asn1.DRB_configList[UE_index]->list.array[0]->logicalChannelIdentity;
-
-    if (protocol_bs->rrc.rg_rb_asn1.DRB1_active[UE_index] == 0) {
-      msg("[RRC-RG-FRONTEND] rrc_rg_config_LTE_default_drb: Frame %d: Establish PDCP + RLC UM Bidirectional, DRB %d Active\n",
-          protocol_bs->rrc.current_SFN, (int)protocol_bs->rrc.rg_rb_asn1.DRB_configList[UE_index]->list.array[0]->drb_Identity);
-
-      //     rrc_pdcp_config_req (Mod_id, protocol_bs->rrc.current_SFN, eNB_flag, ACTION_ADD,
-      //                           (UE_index * NB_RB_MAX) + (int)*protocol_bs->rrc.rg_rb_asn1.DRB1_config->logicalChannelIdentity);
-      //     rrc_rlc_config_req(Mod_id,protocol_bs->rrc.current_SFN,eNB_flag,ACTION_ADD,
-      //                         (UE_index * NB_RB_MAX) + (int)*protocol_bs->rrc.rg_rb_asn1.DRB1_config->logicalChannelIdentity,
-      //                         RADIO_ACCESS_BEARER,Rlc_info_um);
-
-      rrc_pdcp_config_asn1_req(Mod_id,UE_index,protocol_bs->rrc.current_SFN,eNB_flag,
-                               (SRB_ToAddModList_t*)NULL,
-                               protocol_bs->rrc.rg_rb_asn1.DRB_configList[UE_index],
-                               (DRB_ToReleaseList_t*)NULL
-#ifdef Rel10
-                               ,(MBMS_SessionInfoList_r9_t *)NULL
-#endif
-                              );
-      rrc_rlc_config_asn1_req(Mod_id,protocol_bs->rrc.current_SFN,eNB_flag,UE_index,
-                              (SRB_ToAddModList_t*)NULL,
-                              protocol_bs->rrc.rg_rb_asn1.DRB_configList[UE_index],
-                              (DRB_ToReleaseList_t*)NULL
-#ifdef Rel10
-                              ,(MBMS_SessionInfoList_r9_t *)NULL
-#endif
-                             );
-      protocol_bs->rrc.rg_rb_asn1.DRB1_active[UE_index] = 1;
-
-#ifdef DEBUG_RRC_STATE
-      msg("[RRC-RG-FRONTEND] rrc_rg_config_LTE_default_drb:[--- MAC_CONFIG_REQ  (DRB UE %d) --->][MAC_eNB]\n", UE_index);
-      msg ("[RRC-RG-FRONTEND] Parameters : Mod_id %d, eNB_flag %d, UE_index %d, eNB_index %d\n",Mod_id, eNB_flag, UE_index, eNB_index);
-#endif
-
-
-      /*  RRC Lite l 1357
-                rrc_mac_config_req(Mod_id,1,UE_index,0,
-                                  (RadioResourceConfigCommonSIB_t *)NULL,
-                                  eNB_rrc_inst[Mod_id].physicalConfigDedicated[UE_index],
-                                  (MeasObjectToAddMod_t **)NULL,
-                                  eNB_rrc_inst[Mod_id].mac_MainConfig[UE_index],
-                                  DRB2LCHAN[i],
-                                  DRB_configList->list.array[i]->logicalChannelConfig,
-                                  eNB_rrc_inst[Mod_id].measGapConfig[UE_index],
-                                  (TDD_Config_t *)NULL,
-                                  (u8 *)NULL,
-                                  (u16 *)NULL,
-                                  NULL,
-                                  NULL,
-                                  NULL,
-                                  (MBSFN_SubframeConfigList_t *)NULL
-                                  #ifdef Rel10
-                                  , 0,
-                                  (MBSFN_AreaInfoList_r9_t *)NULL,
-                                  (PMCH_InfoList_r9_t *)NULL
-                                    #endif
-                                  );
-      */
-
-      rrc_mac_config_req(Mod_id,eNB_flag,UE_index,eNB_index,
-                         (RadioResourceConfigCommonSIB_t *)NULL,
-                         protocol_bs->rrc.rg_rb_asn1.physicalConfigDedicated,
-                         (MeasObjectToAddMod_t **)NULL,
-                         (MAC_MainConfig_t*)&protocol_bs->rrc.rg_rb_asn1.mac_MainConfig,
-                         DRB2LCHAN[drb_ix],
-                         //protocol_bs->rrc.rg_rb_asn1.DRB1_config->logicalChannelConfig,
-                         protocol_bs->rrc.rg_rb_asn1.DRB_configList[UE_index]->list.array[0]->logicalChannelConfig,
-                         (MeasGapConfig_t *)&protocol_bs->rrc.rg_rb_asn1.measGapConfig,
-                         (TDD_Config_t *)NULL,
-                         (u8 *)NULL,
-                         (u16 *)NULL, //OK
-                         NULL,
-                         NULL,
-                         NULL,
-                         (MBSFN_SubframeConfigList_t *)NULL
-#ifdef Rel10
-                         , 0,
-                         (MBSFN_AreaInfoList_r9_t *)NULL,
-                         (PMCH_InfoList_r9_t *)NULL
-#endif
-                        );
-
-    } else { // remove LCHAN from MAC/PHY
-      // Initialized here because it is a local variable (global in RRC Lite)
-      //DRB2LCHAN[drb_ix] = (u8)*protocol_bs->rrc.rg_rb_asn1.DRB1_config->logicalChannelIdentity;
-      if (protocol_bs->rrc.rg_rb_asn1.DRB1_active[UE_index] ==1) {
-        // DRB has just been removed so remove RLC + PDCP for DRB
-        msg("[RRC-RG-FRONTEND] rrc_rg_config_LTE_default_drb: Frame %d: Remove PDCP + RLC UM Bidirectional, DRB 0 \n",
-            //            protocol_bs->rrc.current_SFN, (int)protocol_bs->rrc.rg_rb_asn1.DRB_configList[UE_index]->list.array[0]->drb_Identity);
-            protocol_bs->rrc.current_SFN);
-
-        /*        rrc_pdcp_config_req (Mod_id, protocol_bs->rrc.current_SFN, eNB_flag, ACTION_REMOVE,
-                                     (UE_index * NB_RB_MAX) + DRB2LCHAN[drb_ix]);*/
-        rrc_rlc_config_req(Mod_id,protocol_bs->rrc.current_SFN,eNB_flag,ACTION_REMOVE,
-                           (UE_index * NB_RB_MAX) + DRB2LCHAN[drb_ix],
-                           RADIO_ACCESS_BEARER,Rlc_info_um);
-
-      }
-
-      protocol_bs->rrc.rg_rb_asn1.DRB1_active[UE_index] = 0;
-#ifdef DEBUG_RRC_STATE
-      msg("[RRC-RG-FRONTEND] rrc_rg_config_LTE_default_drb:[--- MAC_CONFIG_REQ  (DRB UE %d) --->][MAC_eNB]\n", UE_index);
-      msg ("[RRC-RG-FRONTEND] Parameters : Mod_id %d, eNB_flag %d, UE_index %d, eNB_index %d \n",Mod_id, eNB_flag, UE_index, eNB_index);
-#endif
-      rrc_mac_config_req(Mod_id,eNB_flag,UE_index,eNB_index,
-                         (RadioResourceConfigCommonSIB_t *)NULL,
-                         protocol_bs->rrc.rg_rb_asn1.physicalConfigDedicated,
-                         (MeasObjectToAddMod_t **)NULL,
-                         (MAC_MainConfig_t*)&protocol_bs->rrc.rg_rb_asn1.mac_MainConfig,
-                         DRB2LCHAN[drb_ix],
-                         (LogicalChannelConfig_t *)NULL,
-                         (MeasGapConfig_t *)NULL,
-                         (TDD_Config_t *)NULL,
-                         (u8 *)NULL,
-                         (u16 *)NULL, //OK
-                         NULL,
-                         NULL,
-                         NULL,
-                         (MBSFN_SubframeConfigList_t *)NULL
-#ifdef Rel10
-                         , 0,
-                         (MBSFN_AreaInfoList_r9_t *)NULL,
-                         (PMCH_InfoList_r9_t *)NULL
-#endif
-                        );
-    }
-  }
-}
-
-/*****************************************
- Measurement retrieval functions for ENb measures
- *****************************************/
-/*  int conf_rlcBufferOccupancy[maxUsers];
-  int conf_scheduledPRB[maxUsers];
-  int conf_totalDataVolume[maxUsers];
-
-  int current_rlcBufferOccupancy[maxUsers];
-  int current_scheduledPRB[maxUsers];
-  int current_totalDataVolume[maxUsers];
-  int current_totalNumPRBs;
-
-  for (ix=0; ix<num_connected_UEs; ix++){
-    msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.eNBmeasurement_ind.measures[ix].rlcBufferOccupancy = rrc_rg_ENbMeas_get_rlcBufferOccupancy[ix];
-    msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.eNBmeasurement_ind.measures[ix].scheduledPRB = rrc_rg_ENbMeas_get_scheduledPRB[ix];
-    msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.eNBmeasurement_ind.measures[ix].totalDataVolume = rrc_rg_ENbMeas_get_totalDataVolume[ix];
-  }
-  msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.eNBmeasurement_ind.totalNumPRBs = rrc_rg_ENbMeas_get_totalNumPRBs();*/
-
-//-----------------------------------------------------------------------------
-int rrc_rg_ENbMeas_get_rlcBufferOccupancy(int UE_id)
-{
-  //-----------------------------------------------------------------------------
-#ifdef RRC_ENABLE_REAL_ENB_MESURES
-  int Mod_id = 0;
-#endif
-
-#ifdef DEBUG_RRC_DETAILS_2
-  msg ("\n[RRC-RG-FRONTEND] rrc_rg_ENbMeas_get_rlcBufferOccupancy , UE_id %d\n", UE_id);
-#endif
-#ifdef RRC_ENABLE_REAL_ENB_MESURES
-  // Occupancy in bytes
-  //protocol_bs->rrc.current_rlcBufferOccupancy[UE_id] = rlc_um_get_buffer_occupancy(&rlc[Mod_id].m_rlc_um_array[rlc[Mod_id].m_rlc_pointer[3].rlc_index]);
-  // Occupancy in % nb total buffers
-  protocol_bs->rrc.current_rlcBufferOccupancy[UE_id] = rlc[Mod_id].m_rlc_um_array[rlc[Mod_id].m_rlc_pointer[3].rlc_index].nb_sdu /
-      rlc[Mod_id].m_rlc_um_array[rlc[Mod_id].m_rlc_pointer[3].rlc_index].size_input_sdus_buffer;
-  return protocol_bs->rrc.current_rlcBufferOccupancy[UE_id];
-#else
-  return protocol_bs->rrc.conf_rlcBufferOccupancy[UE_id];
-#endif
-}
-
-//-----------------------------------------------------------------------------
-int rrc_rg_ENbMeas_get_scheduledPRB(int UE_id)
-{
-  //-----------------------------------------------------------------------------
-#ifdef RRC_ENABLE_REAL_ENB_MESURES
-  int Mod_id = 0;
-#endif
-
-#ifdef DEBUG_RRC_DETAILS_2
-  msg ("\n[RRC-RG-FRONTEND] rrc_rg_ENbMeas_get_scheduledPRB , UE_id %d\n", UE_id);
-#endif
-#ifdef RRC_ENABLE_REAL_ENB_MESURES
-  // total available number of PRBs for a new transmission
-  //uint16_t rbs_used;
-  protocol_bs->rrc.current_scheduledPRB[UE_id] = eNB_mac_inst[Mod_id].eNB_UE_stats[UE_id].rbs_used - protocol_bs->rrc.current_scheduledPRB[UE_id];
-  return protocol_bs->rrc.current_scheduledPRB[UE_id];
-#else
-  return protocol_bs->rrc.conf_scheduledPRB[UE_id];
-#endif
-}
-
-//-----------------------------------------------------------------------------
-int rrc_rg_ENbMeas_get_totalDataVolume(int UE_id)
-{
-  //-----------------------------------------------------------------------------
-#ifdef RRC_ENABLE_REAL_ENB_MESURES
-  int Mod_id = 0;
-#endif
-
-#ifdef DEBUG_RRC_DETAILS_2
-  msg ("\n[RRC-RG-FRONTEND] rrc_rg_ENbMeas_get_totalDataVolume , UE_id %d\n", UE_id);
-#endif
-#ifdef RRC_ENABLE_REAL_ENB_MESURES
-  protocol_bs->rrc.current_totalDataVolume[UE_id] = eNB_mac_inst[Mod_id].eNB_UE_stats[UE_id].num_bytes_tx[3] - protocol_bs->rrc.current_totalDataVolume[UE_id];
-  return protocol_bs->rrc.current_totalDataVolume[UE_id];
-#else
-  return protocol_bs->rrc.conf_totalDataVolume[UE_id];
-#endif
-}
-
-//-----------------------------------------------------------------------------
-int rrc_rg_ENbMeas_get_totalNumPRBs(void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef RRC_ENABLE_REAL_ENB_MESURES
-  int Mod_id = 0;
-#endif
-
-#ifdef DEBUG_RRC_DETAILS_2
-  msg ("\n[RRC-RG-FRONTEND] rrc_rg_ENbMeas_get_totalNumPRBs%d\n");
-#endif
-#ifdef RRC_ENABLE_REAL_ENB_MESURES
-  // total number of PRB available for the user plane
-  // uint32_t total_available_prbs;
-
-  protocol_bs->rrc.current_totalNumPRBs = eNB_mac_inst[Mod_id].eNB_stats.total_available_prbs - protocol_bs->rrc.current_totalNumPRBs;
-  return protocol_bs->rrc.current_totalNumPRBs;
-#else
-  return 1000;
-#endif
-}
-
diff --git a/openair2/RRC/CELLULAR/rrc_rg_L2_interface.c b/openair2/RRC/CELLULAR/rrc_rg_L2_interface.c
deleted file mode 100755
index 2d06900c1d..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg_L2_interface.c
+++ /dev/null
@@ -1,429 +0,0 @@
-/***************************************************************************
-                          rrc_rg_L2_interface.c  -
-                          -------------------
-    begin                : Sept 9, 2008
-    copyright            : (C) 2008, 2010 by Eurecom
-    created by           : michelle.wetterwald@eurecom.fr
-    description
- **************************************************************************
-    Entry point for L2 interfaces
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "COMMON/openair_defs.h"
-#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
-#include "LAYER2/RLC/rlc.h"
-#include "COMMON/mac_rrc_primitives.h"
-#include "UTIL/MEM/mem_block.h"
-
-//#include "SIMULATION/simulation_defs.h"
-//extern EMULATION_VARS *Emul_vars;
-//extern CH_MAC_INST *CH_mac_inst;
-//extern UE_MAC_INST *UE_mac_inst;
-/********************
-// RRC definitions
- ********************/
-#include "rrc_rg_vars.h"
-//-----------------------------------------------------------------------------
-#include "rrc_L2_proto.h"
-#include "rrc_proto_bch.h"
-//-----------------------------------------------------------------------------
-extern LCHAN_DESC BCCH_LCHAN_DESC,CCCH_LCHAN_DESC, DCCH_LCHAN_DESC, DTCH_DL_LCHAN_DESC,DTCH_UL_LCHAN_DESC;
-extern rlc_info_t Rlc_info_um, Rlc_info_am_config;
-//-----------------------------------------------------------------------------
-s8 rrc_L2_data_req_rx (unsigned char Mod_id, unsigned short Srb_id, unsigned char Nb_tb,char *Buffer,u8 CH_index)
-{
-  //-----------------------------------------------------------------------------
-  unsigned char br_size=0;
-
-  //#ifdef DEBUG_RRC_BROADCAST
-  if ( Mac_rlc_xface->Is_cluster_head[Mod_id]) {
-    if ((Srb_id & RAB_OFFSET) == BCCH) {
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-      msg ("\n[RRC CELL][L2_INTF] rrc_L2_data_req_rx - begin - Fill BCCH\n");
-      //msg ("Received parameters Mod_id %d, Srb_id %d, nb_tb %d, CH_index %d\n",Mod_id, Srb_id,Nb_tb,CH_index);
-#endif
-      br_size = rrc_broadcast_tx(Buffer);
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-      msg ("[RRC CELL][L2_INTF] rrc_L2_data_req_rx - end BCCH,  br_size %d\n",br_size);
-#endif
-      //return br_size;
-    } else if( ((Srb_id & RAB_OFFSET ) == CCCH)&& (protocol_bs->rrc.ccch_buffer_size > 0)) {
-      //if( protocol_ms->rrc.ccch_buffer_size > 0) {
-#ifdef DEBUG_RRC_STATE
-      msg ("\n[RRC CELL][L2_INTF] rrc_L2_data_req_rx - begin - Fill CCCH\n");
-      msg ("Received parameters Mod_id %d, Srb_id %d, nb_tb %d, CH_index %d\n",Mod_id, Srb_id,Nb_tb,CH_index);
-      msg ("CCCH buffer size %d\n",protocol_bs->rrc.ccch_buffer_size);
-#endif
-      memcpy(&Buffer[0],&protocol_bs->rrc.ccch_buffer[0],protocol_bs->rrc.ccch_buffer_size);
-      br_size = protocol_bs->rrc.ccch_buffer_size;
-      protocol_bs->rrc.ccch_buffer_size = 0;
-      //}
-    }
-  }
-
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-  msg ("\n[RRC CELL][L2_INTF] rrc_L2_data_req_rx - end\n");
-#endif
-  return br_size;
-}
-
-//-----------------------------------------------------------------------------
-s8 rrc_L2_mac_data_ind_rx (u8 Mod_id, u16 Srb_id, char *Sdu, u16 Sdu_len, u8 eNB_index)
-{
-  //-----------------------------------------------------------------------------
-  int rxStatus=0;
-
-  if((Srb_id & RAB_OFFSET) == BCCH) {
-#ifdef DEBUG_RRC_BROADCAST
-    msg ("\n[RRC CELL][L2_INTF] rrc_L2_mac_data_ind_rx - begin - BCCH RG => Xmit only in BCCH\n");
-    //msg ("Received parameters Mod_id %d, Srb_id %d, CH_index %d\n",Mod_id, Srb_id,CH_index);
-#endif
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-    msg ("\n[RRC CELL][L2_INTF] rrc_L2_mac_data_ind_rx - end\n");
-#endif
-  } else if( (Srb_id & RAB_OFFSET ) == CCCH) {
-#ifdef DEBUG_RRC_STATE
-    msg ("\n[RRC CELL][L2_INTF] rrc_L2_mac_data_ind_rx - begin - CCCH\n");
-    msg ("Received parameters Mod_id %d, eNB_index %d, SDU length %d\n", Mod_id, eNB_index, Sdu_len);
-#endif
-
-    if (Sdu_len >0) {
-      //rrc_rg_rcve_ccch(char *Sdu, u16 Sdu_len);
-      rrc_rg_rcve_ccch(Mod_id, Sdu, Sdu_len);
-    }
-  } else msg ("\n[RRC CELL][L2_INTF] rrc_L2_mac_data_ind_rx, Srb_id %d unexpected \n" , Srb_id);
-
-  return rxStatus;
-}
-
-
-//-----------------------------------------------------------------------------
-void rrc_L2_rlc_data_ind_rx (unsigned char Mod_id, unsigned int Srb_id, unsigned int Sdu_size, unsigned char *Buffer)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_DETAILS_2
-  msg ("\n[RRC][L2_INTF] rrc_L2_rlc_data_ind_rx - begin\n");
-#endif
-  //rrc_rg_test_rlc_intf_rcve (Buffer, Srb_id); // Dummy version
-  rrc_rg_receive_from_srb_rlc (Buffer, Srb_id, Sdu_size);
-}
-
-//-----------------------------------------------------------------------------
-void rrc_L2_rlc_confirm_ind_rx (unsigned char Mod_id, unsigned int Srb_id, unsigned int mui)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_DETAILS_2
-  msg ("\n[RRC][L2_INTF] rrc_L2_rlc_confirm_ind_rx - begin\n");
-#endif
-  //void* rrc_srb_confirm (u32 muiP, u8 rb_idP, u8 statusP);
-  rrc_rg_srb_confirm (mui, Srb_id, 0);
-}
-
-
-//-----------------------------------------------------------------------------
-void rrc_L2_mac_meas_ind_rx (void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_DETAILS
-  msg ("\n[RRC][L2_INTF] rrc_L2_mac_meas_ind_rx - begin\n");
-#endif
-}
-
-//-----------------------------------------------------------------------------
-void rrc_L2_def_meas_ind_rx (unsigned char Mod_id, unsigned char Idx2)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_DETAILS
-  msg ("\n[RRC][L2_INTF] rrc_L2_def_meas_ind_rx - begin\n");
-#endif
-}
-
-//-----------------------------------------------------------------------------
-void rrc_L2_sync_ind_rx (u8 Mod_id)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_DETAILS
-  msg ("\n[RRC][L2_INTF] rrc_L2_sync_ind_rx - begin\n");
-#endif
-}
-
-//-----------------------------------------------------------------------------
-void rrc_L2_out_sync_ind_rx (void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_DETAILS
-  msg ("\n[RRC][L2_INTF] rrrc_L2_out_sync_ind_rx - begin\n");
-#endif
-}
-
-//-----------------------------------------------------------------------------
-int rrc_L2_get_rrc_status(u8 Mod_id,u8 eNB_flag,u8 index)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_DETAILS_2
-  msg ("\n[RRC][L2_INTF] rrc_L2_get_rrc_status - begin\n");
-#endif
-  /*
-    if(eNB_flag == 1)
-      return(eNB_rrc_inst[Mod_id].Info.Status[index]);
-    else
-      return(UE_rrc_inst[Mod_id].Info[index].Status);
-  */
-  return 0;
-}
-
-//-----------------------------------------------------------------------------
-char rrc_L2_ue_init(u8 Mod_id, unsigned char eNB_index)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_DETAILS
-  msg ("\n[RRC][L2_INTF] rrc_L2_ue_init - begin\n");
-#endif
-  rrc_rg_uelite_init(Mod_id, eNB_index);
-  return 0;
-}
-
-
-//-----------------------------------------------------------------------------
-char rrc_L2_eNB_init(u8 Mod_id)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_DETAILS
-  msg ("\n[RRC][L2_INTF] rrc_L2_eNB_init - begin\n");
-#endif
-  rrc_rg_init (Mod_id);
-  return 0;
-}
-
-//-----------------------------------------------------------------------------
-// Out of openair_rrc_L2_interface.c
-void openair_rrc_lite_top_init(void)
-{
-  //-----------------------------------------------------------------------------
-  //#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC CELL] [L2_INTF] openair_rrc_lite_top_init - Empty function to keep compatibility with RRC LITE\n\n");
-  //#endif
-}
-
-//-----------------------------------------------------------------------------
-RRC_status_t rrc_rx_tx(u8 Mod_id,u32 frame, u8 eNB_flag,u8 index)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_DETAILS
-  //    msg ("\n[RRC][L2_INTF] rrc_rx_tx - begin %d \n", frame);
-#endif
-  // call RRC only if new frame number
-  if (frame > protocol_bs->rrc.current_SFN) {
-    protocol_bs->rrc.current_SFN = frame;
-    rrc_rg_main_scheduler(Mod_id, protocol_bs->rrc.current_SFN, 0, 0);
-  }
-
-  return 0;
-}
-
-/*------------------------------------------------------------------------------*/
-// Dummy function - to keep compatibility with RRC LITE
-char rrc_rg_uelite_init(u8 Mod_id, unsigned char eNB_index)
-{
-  /*------------------------------------------------------------------------------*/
-  //#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC CELL] Called rrc_rg_uelite_init - Dummy function - to keep compatibility with RRC LITE\n\n");
-  //#endif
-  return 0;
-}
-
-
-/*------------------------------------------------------------------------------*/
-// Send config to the MAC Layer
-void rrc_init_mac_config(void)
-{
-  /*------------------------------------------------------------------------------*/
-  //MAC_CONFIG_REQ Mac_config_req;
-  //int UE_index,Idx;
-
-  // The content of this function has been commented on 23/03/2012
-  // Rewritten on 29/01/2013
-  //printk("\n rrc_init_mac_config -- COMMENTED\n");
-
-  int Mod_id =0;
-
-  //#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC CELL] Called rrc_init_mac_config - Begin \n\n");
-  //#endif
-
-  rrc_rg_init_mac (Mod_id);
-  /*
-
-  UE_index=1;
-
-  // Configure BCCH
-  Mac_config_req.Lchan_type = BCCH;
-  memcpy(&Mac_config_req.Lchan_desc[0],(LCHAN_DESC*)&BCCH_LCHAN_DESC,LCHAN_DESC_SIZE); //0 rx, 1 tx
-  memcpy(&Mac_config_req.Lchan_desc[1],(LCHAN_DESC*)&BCCH_LCHAN_DESC,LCHAN_DESC_SIZE); //0 rx, 1 tx
-  Mac_config_req.UE_CH_index=0;
-  Mac_config_req.Lchan_id.Index=(0 << RAB_SHIFT2) + BCCH;
-  printk("Calling mac_config_req for BCCH\n");
-  Mac_rlc_xface->mac_config_req(0,ADD_LC,&Mac_config_req);
-
-  // Configure CCCH
-  Mac_config_req.Lchan_type = CCCH;
-  memcpy(&Mac_config_req.Lchan_desc[0],(LCHAN_DESC*)&CCCH_LCHAN_DESC,LCHAN_DESC_SIZE); //0 rx, 1 tx
-  memcpy(&Mac_config_req.Lchan_desc[1],(LCHAN_DESC*)&CCCH_LCHAN_DESC,LCHAN_DESC_SIZE); //0 rx, 1 tx
-  Mac_config_req.UE_CH_index=0;
-  Mac_config_req.Lchan_id.Index=(0 << RAB_SHIFT2) + CCCH;
-  printk("Calling mac_config_req for CCCH\n");
-  Mac_rlc_xface->mac_config_req(0,ADD_LC,&Mac_config_req);
-
-  // Configure DCCH (LTE ACCESS)
-  Mac_config_req.Lchan_type = DCCH;
-  Mac_config_req.UE_CH_index = UE_index;
-  memcpy(&Mac_config_req.Lchan_desc[0],(LCHAN_DESC*)&DCCH_LCHAN_DESC,LCHAN_DESC_SIZE); //0 rx, 1 tx
-  memcpy(&Mac_config_req.Lchan_desc[1],(LCHAN_DESC*)&DCCH_LCHAN_DESC,LCHAN_DESC_SIZE); //0 rx, 1 tx
-  Mac_config_req.Lchan_id.Index=(UE_index << RAB_SHIFT2) + DCCH;
-  Idx = Mac_rlc_xface->mac_config_req(0,ADD_LC,&Mac_config_req);
-  Mac_rlc_xface->rrc_rlc_config_req(0,ACTION_ADD,Idx,SIGNALLING_RADIO_BEARER,Rlc_info_um);
-
-  // Configure DTCH (SRB0)
-  Mac_config_req.Lchan_type = DTCH;
-  Mac_config_req.UE_CH_index = UE_index;
-  memcpy(&Mac_config_req.Lchan_desc[0],(LCHAN_DESC*)&DTCH_LCHAN_DESC,LCHAN_DESC_SIZE); //0 rx, 1 tx
-  memcpy(&Mac_config_req.Lchan_desc[1],(LCHAN_DESC*)&DTCH_LCHAN_DESC,LCHAN_DESC_SIZE); //0 rx, 1 tx
-  Mac_config_req.Lchan_id.Index=(UE_index << RAB_SHIFT2) + DTCH_BD + 1;
-  Idx = Mac_rlc_xface->mac_config_req(0,ADD_LC,&Mac_config_req);
-  Mac_rlc_xface->rrc_rlc_config_req(0,ACTION_ADD,Idx,SIGNALLING_RADIO_BEARER,Rlc_info_um);
-
-  // Configure DTCH (SRB1)
-  Mac_config_req.Lchan_type = DTCH;
-  Mac_config_req.UE_CH_index = UE_index;
-  memcpy(&Mac_config_req.Lchan_desc[0],(LCHAN_DESC*)&DTCH_LCHAN_DESC,LCHAN_DESC_SIZE); //0 rx, 1 tx
-  memcpy(&Mac_config_req.Lchan_desc[1],(LCHAN_DESC*)&DTCH_LCHAN_DESC,LCHAN_DESC_SIZE); //0 rx, 1 tx
-  Mac_config_req.Lchan_id.Index=(UE_index << RAB_SHIFT2) + DTCH_BD + 2;
-  Idx = Mac_rlc_xface->mac_config_req(0,ADD_LC,&Mac_config_req);
-  Mac_rlc_xface->rrc_rlc_config_req(0,ACTION_ADD,Idx,SIGNALLING_RADIO_BEARER,Rlc_info_um);
-
-  // Configure DTCH (SRB2)
-  Mac_config_req.Lchan_type = DTCH;
-  Mac_config_req.UE_CH_index = UE_index;
-  memcpy(&Mac_config_req.Lchan_desc[0],(LCHAN_DESC*)&DTCH_LCHAN_DESC,LCHAN_DESC_SIZE); //0 rx, 1 tx
-  memcpy(&Mac_config_req.Lchan_desc[1],(LCHAN_DESC*)&DTCH_LCHAN_DESC,LCHAN_DESC_SIZE); //0 rx, 1 tx
-  Mac_config_req.Lchan_id.Index=(UE_index << RAB_SHIFT2) + DTCH_BD + 3;
-  Idx = Mac_rlc_xface->mac_config_req(0,ADD_LC,&Mac_config_req);
-  Mac_rlc_xface->rrc_rlc_config_req(0,ACTION_ADD,Idx,SIGNALLING_RADIO_BEARER,Rlc_info_am);
-
-  // Configure DTCH (SRB3)
-  Mac_config_req.Lchan_type = DTCH;
-  Mac_config_req.UE_CH_index = UE_index;
-  memcpy(&Mac_config_req.Lchan_desc[0],(LCHAN_DESC*)&DTCH_LCHAN_DESC,LCHAN_DESC_SIZE); //0 rx, 1 tx
-  memcpy(&Mac_config_req.Lchan_desc[1],(LCHAN_DESC*)&DTCH_LCHAN_DESC,LCHAN_DESC_SIZE); //0 rx, 1 tx
-  Mac_config_req.Lchan_id.Index=(UE_index << RAB_SHIFT2) + DTCH_BD + 4;
-  Idx = Mac_rlc_xface->mac_config_req(0,ADD_LC,&Mac_config_req);
-  Mac_rlc_xface->rrc_rlc_config_req(0,ACTION_ADD,Idx,SIGNALLING_RADIO_BEARER,Rlc_info_am);
-
-  */
-
-}
-
-/*------------------------------------------------------------------------------*/
-// Send config to the MAC Layer
-void rrc_init_mac_default_param(void)
-{
-  /*------------------------------------------------------------------------------*/
-  // The following code has been commented on 23/03/2012
-  printk("\n rrc_init_mac_default_param -- WORK IN PROGRESS\n");
-
-  /*
-  BCCH_LCHAN_DESC.transport_block_size=BCCH_PAYLOAD_SIZE_MAX;
-  BCCH_LCHAN_DESC.max_transport_blocks=15;//MAX 16 (4bits for Seq_id)
-  CCCH_LCHAN_DESC.transport_block_size=CCCH_PAYLOAD_SIZE_MAX;
-  CCCH_LCHAN_DESC.max_transport_blocks=15;//MAX 16 (4bits for Seq_id)
-  //   BCCH_LCHAN_DESC.transport_block_size=30;//+CH_BCCH_HEADER_SIZE;
-  //   BCCH_LCHAN_DESC.max_transport_blocks=15;//MAX 16 (4bits for Seq_id)
-  //   CCCH_LCHAN_DESC.transport_block_size=30;//+CH_CCCH_HEADER_SIZE;
-  //   CCCH_LCHAN_DESC.max_transport_blocks=15;//MAX 16 (4bits for Seq_id)
-   DCCH_LCHAN_DESC.transport_block_size=40;//+CH_BCCH_HEADER_SIZE;
-   DCCH_LCHAN_DESC.max_transport_blocks=20;
-   DTCH_LCHAN_DESC.transport_block_size=40;//120;//200;//+CH_BCCH_HEADER_SIZE;
-   DTCH_LCHAN_DESC.max_transport_blocks=20;
-
-  */
-
-  // Test config on 02/04/2012
-  BCCH_LCHAN_DESC.transport_block_size=BCCH_PAYLOAD_SIZE_MAX;
-  BCCH_LCHAN_DESC.max_transport_blocks=15;//MAX 16 (4bits for Seq_id)
-
-  DCCH_LCHAN_DESC.transport_block_size=4;
-  DCCH_LCHAN_DESC.max_transport_blocks=16;
-  DCCH_LCHAN_DESC.Delay_class=1;
-  DTCH_DL_LCHAN_DESC.transport_block_size=52;
-  DTCH_DL_LCHAN_DESC.max_transport_blocks=20;
-  DTCH_DL_LCHAN_DESC.Delay_class=1;
-  DTCH_UL_LCHAN_DESC.transport_block_size=52;
-  DTCH_UL_LCHAN_DESC.max_transport_blocks=20;
-  DTCH_UL_LCHAN_DESC.Delay_class=1;
-
-  // Config copied from RRC LITE on 02/04/2012
-  Rlc_info_um.rlc_mode=RLC_UM;
-  Rlc_info_um.rlc.rlc_um_info.timer_reordering=0;
-  Rlc_info_um.rlc.rlc_um_info.sn_field_length=10;
-  Rlc_info_um.rlc.rlc_um_info.is_mXch=0;
-  //Rlc_info_um.rlc.rlc_um_info.sdu_discard_mode=16;
-
-  Rlc_info_am_config.rlc_mode=RLC_AM;
-  Rlc_info_am_config.rlc.rlc_am_info.max_retx_threshold = 255;
-  Rlc_info_am_config.rlc.rlc_am_info.poll_pdu           = 8;
-  Rlc_info_am_config.rlc.rlc_am_info.poll_byte          = 1000;
-  Rlc_info_am_config.rlc.rlc_am_info.t_poll_retransmit  = 15;
-  Rlc_info_am_config.rlc.rlc_am_info.t_reordering       = 5000;
-  Rlc_info_am_config.rlc.rlc_am_info.t_status_prohibit  = 10;
-}
-
-/*------------------------------------------------------------------------------*/
-//Entry function for RRC init - Copied from RRC MESH (MW 09/09/2008)
-int rrc_init_global_param(void)
-{
-  /*------------------------------------------------------------------------------*/
-  //  Nb_mod=0;
-  //#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC CELL] Called rrc_init_global_param - Begin \n\n");
-  //#endif
-
-  /*
-  #ifdef USER_MODE
-   Rrc_xface = (RRC_XFACE*)malloc16(sizeof(RRC_XFACE));
-  #endif
-   Rrc_xface->openair_rrc_top_init = rrc_rg_toplite_init;
-   Rrc_xface->openair_rrc_eNB_init = rrc_rg_init;
-   Rrc_xface->openair_rrc_UE_init = rrc_rg_uelite_init;
-   Rrc_xface->mac_rrc_data_ind = mac_rrc_data_ind;
-   Rrc_xface->mac_rrc_data_req = mac_rrc_data_req;
-   Rrc_xface->rrc_data_indP    = rlcrrc_data_ind;
-   Rrc_xface->rrc_rx_tx        = rrc_rg_main_scheduler;
-   Rrc_xface->mac_rrc_meas_ind = mac_rrc_meas_ind;
-   Rrc_xface->def_meas_ind     = rrc_L2_def_meas_ind_rx;
-   Mac_rlc_xface->mac_out_of_sync_ind = mac_out_of_sync_ind;
-   Rrc_xface->get_rrc_status= rrc_L2_get_rrc_status;
-   printk("[RRC]INIT_GLOBAL_PARAM: Mac_rlc_xface %p, rrc_rlc_register %p,rlcrrc_data_ind %p\n",Mac_rlc_xface,Mac_rlc_xface->rrc_rlc_register_rrc,rlcrrc_data_ind);
-   if (Mac_rlc_xface==NULL || Mac_rlc_xface->rrc_rlc_register_rrc==NULL||rlcrrc_data_ind==NULL)
-     return -1;
-   //register with rlc -1st function= data_ind/srb_rx, 2nd function = srb_confirm
-   Mac_rlc_xface->rrc_rlc_register_rrc(rlcrrc_data_ind , rrc_L2_rlc_confirm_ind_rx);
-   */
-
-  //register with rlc -1st function= data_ind/srb_rx, 2nd function = srb_confirm
-  printk("[RRC]INIT_GLOBAL_PARAM: rrc_rlc_register_rrc %p,rlcrrc_data_ind %p, rrc_L2_rlc_confirm_ind_rx %p\n", rrc_rlc_register_rrc, rlcrrc_data_ind, rrc_L2_rlc_confirm_ind_rx );
-
-  if( rrc_rlc_register_rrc==NULL||rlcrrc_data_ind==NULL|| rrc_L2_rlc_confirm_ind_rx==NULL)
-    return -1;
-
-  rrc_rlc_register_rrc(rlcrrc_data_ind , rrc_L2_rlc_confirm_ind_rx);
-
-  rrc_init_mac_default_param();
-
-  return 0;
-}
-
-
-
diff --git a/openair2/RRC/CELLULAR/rrc_rg_L2_intf_variables.h b/openair2/RRC/CELLULAR/rrc_rg_L2_intf_variables.h
deleted file mode 100644
index d32efc4375..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg_L2_intf_variables.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/***************************************************************************
-                          rrc_rg_L2_intf_variables.h  -  description
-                             -------------------
-    begin                : Aug 30, 2002
-    copyright            : (C) 2002, 2013 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Some additional definitions for RG L2 interface
- ***************************************************************************/
-#ifndef __RRC_RG_L2INTF_H__
-#define __RRC_RG_L2INTF_H__
-
-#include "SystemInformationBlockType2.h"
-#include "SystemInformation.h"
-#include "BCCH-DL-SCH-Message.h"
-#include "TDD-Config.h"
-
-// RRC LTE standard asn1 compliant block
-struct rrc_rg_bch_asn1 {
-  u8 sizeof_SIB2;
-  u8 SIB23[128];
-  //BCCH_DL_SCH_Message_t siblock1;
-  BCCH_DL_SCH_Message_t systemInformation;
-  //SystemInformationBlockType1_t *sib1;
-  SystemInformationBlockType2_t *sib2;
-  //SystemInformationBlockType3_t *sib3;
-  TDD_Config_t tdd_Config;
-};
-
-/* Version RRC LITE
-struct rrc_rg_srb_drb_asn1{
-  struct SRB_ToAddMod             *SRB1_config[NB_CNX_eNB];
-  struct SRB_ToAddMod             *SRB2_config[NB_CNX_eNB];
-  struct DRB_ToAddMod             *DRB_config[NB_CNX_eNB][8];
-  u8                               DRB_active[NB_CNX_eNB][8];
-  struct PhysicalConfigDedicated  *physicalConfigDedicated[NB_CNX_eNB];
-  struct SPS_Config               *sps_Config[NB_CNX_eNB];
-  MAC_MainConfig_t                *mac_MainConfig[NB_CNX_eNB];
-  MeasGapConfig_t                 *measGapConfig[NB_CNX_eNB];
-};
-*/
-
-struct rrc_srb_drb_asn1 {
-  /*  struct SRB_ToAddMod             *SRB1_config;
-    struct SRB_ToAddMod             *SRB2_config;
-    struct DRB_ToAddMod             *DRB1_config;
-    struct DRB_ToAddMod             *DRB2_config;*/
-  int SRB2_active[NUMBER_OF_UE_MAX];
-  int DRB1_active[NUMBER_OF_UE_MAX];
-  int DRB2_active[NUMBER_OF_UE_MAX];
-  SRB_ToAddModList_t   *SRB_configList[NUMBER_OF_UE_MAX];
-  DRB_ToAddModList_t   *DRB_configList[NUMBER_OF_UE_MAX];
-
-  struct PhysicalConfigDedicated  *physicalConfigDedicated;
-  //struct SPS_Config               *sps_Config[NB_CNX_eNB];
-  MAC_MainConfig_t                *mac_MainConfig;
-  MeasGapConfig_t                 *measGapConfig;
-  /* Logical channel config */
-  LogicalChannelConfig_t     *SRB1_logicalChannelConfig;
-  LogicalChannelConfig_t     *SRB2_logicalChannelConfig;
-};
-
-
-
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_rg_bch_init.c b/openair2/RRC/CELLULAR/rrc_rg_bch_init.c
deleted file mode 100755
index 76f20725c4..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg_bch_init.c
+++ /dev/null
@@ -1,542 +0,0 @@
-/***************************************************************************
-                          rrc_rg_bch_init.c  -  description
-                             -------------------
-    begin                : Aug 30, 2002
-    copyright            : (C) 2002, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Procedures to call initial encoding of SIBs
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_rg_vars.h"
-#include "rrc_bch_mib.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_int.h"
-#include "rrc_proto_intf.h"
-#include "rrc_proto_bch.h"
-
-//-----------------------------------------------------------------------------
-void rrc_rg_init_bch (void)
-{
-  //-----------------------------------------------------------------------------
-  protocol_bs->rrc.rg_bch_blocks.sib_list[0] = systemInformationBlockType1;
-  protocol_bs->rrc.rg_bch_blocks.sib_list[1] = systemInformationBlockType2;
-  protocol_bs->rrc.rg_bch_blocks.sib_list[2] = systemInformationBlockType5;
-  protocol_bs->rrc.rg_bch_blocks.sib_list[3] = systemInformationBlockType11;
-  protocol_bs->rrc.rg_bch_blocks.sib_list[4] = systemInformationBlockType14;
-  protocol_bs->rrc.rg_bch_blocks.sib_list[5] = systemInformationBlockType18;
-  protocol_bs->rrc.rg_bch_blocks.SIB1_oneTimeShot = FALSE;
-  protocol_bs->rrc.rg_bch_blocks.SIB14_timeout = (2 << SIB14_REP) * SIB14_TFACTOR;
-}
-
-//-----------------------------------------------------------------------------
-void rrc_fill_mib (void)
-{
-  //-----------------------------------------------------------------------------
-  MasterInformationBlock *pmib;
-
-  pmib = &(protocol_bs->rrc.rg_bch_blocks.currMIB);
-  pmib->mib_ValueTag = 0;
-
-  // hard coded in first step
-  pmib->plmn_Identity.mcc.numDigits = 3;
-  pmib->plmn_Identity.mcc.elem[0] = 1;
-  pmib->plmn_Identity.mcc.elem[1] = 4;
-  pmib->plmn_Identity.mcc.elem[2] = 9;
-  pmib->plmn_Identity.mnc = protocol_bs->rrc.rg_cell_id;
-  //  pmib->plmn_Identity.mnc.numDigits=2;
-  //  pmib->plmn_Identity.mnc.elem[0]=5;
-  //  pmib->plmn_Identity.mnc.elem[1]=8;
-
-  // initialize with default value
-  pmib->sibSb_ReferenceList.numSIB = supportedSIBs;     // number SIBs supported
-  pmib->sibSb_ReferenceList.sib_ref[0].sibSb_Type.type = SIBSb_sysInfoType1;
-  pmib->sibSb_ReferenceList.sib_ref[0].sibSb_Type.type_tag.sysInfoType1 = 0;
-  pmib->sibSb_ReferenceList.sib_ref[0].scheduling.scheduling_sib_rep.sib_Rep = SIB1_REP;
-  pmib->sibSb_ReferenceList.sib_ref[0].scheduling.scheduling_sib_rep.sib_Pos = SIB1_POS;
-  pmib->sibSb_ReferenceList.sib_ref[1].sibSb_Type.type = SIBSb_sysInfoType2;
-  pmib->sibSb_ReferenceList.sib_ref[1].sibSb_Type.type_tag.sysInfoType2 = 0;
-  pmib->sibSb_ReferenceList.sib_ref[1].scheduling.scheduling_sib_rep.sib_Rep = SIB2_REP;
-  pmib->sibSb_ReferenceList.sib_ref[1].scheduling.scheduling_sib_rep.sib_Pos = SIB2_POS;
-  pmib->sibSb_ReferenceList.sib_ref[2].sibSb_Type.type = SIBSb_sysInfoType5;
-  pmib->sibSb_ReferenceList.sib_ref[2].sibSb_Type.type_tag.sysInfoType5 = 0;
-  pmib->sibSb_ReferenceList.sib_ref[2].scheduling.scheduling_sib_rep.sib_Rep = SIB5_REP;
-  pmib->sibSb_ReferenceList.sib_ref[2].scheduling.scheduling_sib_rep.sib_Pos = SIB5_POS;
-  pmib->sibSb_ReferenceList.sib_ref[3].sibSb_Type.type = SIBSb_sysInfoType11;
-  pmib->sibSb_ReferenceList.sib_ref[3].sibSb_Type.type_tag.sysInfoType11 = 0;
-  pmib->sibSb_ReferenceList.sib_ref[3].scheduling.scheduling_sib_rep.sib_Rep = SIB11_REP;
-  pmib->sibSb_ReferenceList.sib_ref[3].scheduling.scheduling_sib_rep.sib_Pos = SIB11_POS;
-  pmib->sibSb_ReferenceList.sib_ref[4].sibSb_Type.type = SIBSb_sysInfoType14;
-  //no value_tag for SIB14
-  pmib->sibSb_ReferenceList.sib_ref[4].scheduling.scheduling_sib_rep.sib_Rep = SIB14_REP;
-  pmib->sibSb_ReferenceList.sib_ref[4].scheduling.scheduling_sib_rep.sib_Pos = SIB14_POS;
-  pmib->sibSb_ReferenceList.sib_ref[5].sibSb_Type.type = SIBSb_sysInfoType18;
-  pmib->sibSb_ReferenceList.sib_ref[5].sibSb_Type.type_tag.sysInfoType18 = 0;
-  pmib->sibSb_ReferenceList.sib_ref[5].scheduling.scheduling_sib_rep.sib_Rep = SIB18_REP;
-  pmib->sibSb_ReferenceList.sib_ref[5].scheduling.scheduling_sib_rep.sib_Pos = SIB18_POS;
-
-}
-
-//-----------------------------------------------------------------------------
-void rrc_init_mib (void)
-{
-  //-----------------------------------------------------------------------------
-  int value_tag;
-  // Prepare
-  int status = P_SUCCESS;
-  MasterInformationBlock *pMIB = &(protocol_bs->rrc.rg_bch_blocks.currMIB);
-  PERParms *pParms = &(protocol_bs->rrc.rg_bch_blocks.perParms);
-  char *pBuffer = (char *) &(protocol_bs->rrc.rg_bch_blocks.encoded_currMIB);
-
-  rrc_new_per_parms (pParms, pBuffer);
-  // Update value_tag
-  value_tag = protocol_bs->rrc.rg_bch_blocks.currMIB.mib_ValueTag;
-  value_tag = (++value_tag) % 8;
-  protocol_bs->rrc.rg_bch_blocks.currMIB.mib_ValueTag = value_tag;
-
-  // Encode MIB
-  status = rrc_PEREnc_MasterInformationBlock (pParms, pMIB);
-
-#ifdef DEBUG_RRC_BROADCAST
-  msg ("\n[RRC_BCH] Init MIB result - status : %d\n", status);
-  rrc_print_per_parms (pParms);
-#endif
-}
-
-//-----------------------------------------------------------------------------
-void rrc_fill_sib1 (void)
-{
-  //-----------------------------------------------------------------------------
-  // hard coded in first step
-  char            bufferNAS[] = "NoData in SIB1";
-  char            bufferTimer[] = "KLMNOPQR";
-
-  protocol_bs->rrc.rg_bch_blocks.currSIB1.subnet_NAS_SysInfo.numocts = strlen (bufferNAS);
-  memcpy (protocol_bs->rrc.rg_bch_blocks.currSIB1.subnet_NAS_SysInfo.data, bufferNAS, strlen (bufferNAS));
-  //     protocol_bs->rrc.rg_bch_blocks.currSIB1.subnet_NAS_SysInfo.data[1]= "a";
-
-  protocol_bs->rrc.rg_bch_blocks.currSIB1.ue_TimersAndConstants.numocts = 8;
-  memcpy (protocol_bs->rrc.rg_bch_blocks.currSIB1.ue_TimersAndConstants.data, bufferTimer, 8);
-}
-
-//-----------------------------------------------------------------------------
-void rrc_update_SIB1_period (int period)
-{
-  //-----------------------------------------------------------------------------
-  MasterInformationBlock *pmib = &(protocol_bs->rrc.rg_bch_blocks.currMIB);
-
-  if (period == 0) {
-    protocol_bs->rrc.rg_bch_blocks.SIB1_oneTimeShot = TRUE;
-  } else {
-    if (period < 192) {
-      pmib->sibSb_ReferenceList.sib_ref[0].scheduling.scheduling_sib_rep.sib_Rep = SchedulingInformation_scheduling_rep128;
-    } else {
-      if (period < 320) {
-        pmib->sibSb_ReferenceList.sib_ref[0].scheduling.scheduling_sib_rep.sib_Rep = SchedulingInformation_scheduling_rep256;
-      } else {
-        pmib->sibSb_ReferenceList.sib_ref[0].scheduling.scheduling_sib_rep.sib_Rep = SchedulingInformation_scheduling_rep512;
-      }
-    }
-  }
-}
-
-//-----------------------------------------------------------------------------
-void rrc_init_sib1 (void)
-{
-  //-----------------------------------------------------------------------------
-  int value_tag;
-  // Prepare
-  int status = P_SUCCESS;
-  SysInfoType1 *pSIB1 = &(protocol_bs->rrc.rg_bch_blocks.currSIB1);
-  PERParms *pParms = &(protocol_bs->rrc.rg_bch_blocks.perParms);
-  char *pBuffer = (char *) &(protocol_bs->rrc.rg_bch_blocks.encoded_currSIB1);
-
-  rrc_new_per_parms (pParms, pBuffer);
-  // Encode
-  status = rrc_PEREnc_SysInfoType1 (pParms, pSIB1);
-#ifdef DEBUG_RRC_BROADCAST
-  msg ("[RRC_BCH] Init SIB1 result - status : %d\n", status);
-  rrc_print_per_parms (pParms);
-#endif
-  // Update value_tag and MIB
-  value_tag = protocol_bs->rrc.rg_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[0].sibSb_Type.type_tag.sysInfoType1;
-  value_tag = (++value_tag) % 256;
-  protocol_bs->rrc.rg_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[0].sibSb_Type.type_tag.sysInfoType1 = value_tag;
-  protocol_bs->rrc.rg_bch_blocks.encodedSIB1_lgth = pParms->buff_size;
-
-  if ((protocol_bs->rrc.rg_bch_blocks.encodedSIB1_lgth % LSIBfixed) == 0)
-    protocol_bs->rrc.rg_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[0].scheduling.segCount = (protocol_bs->rrc.rg_bch_blocks.encodedSIB1_lgth / LSIBfixed);
-  else
-    protocol_bs->rrc.rg_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[0].scheduling.segCount = (protocol_bs->rrc.rg_bch_blocks.encodedSIB1_lgth / LSIBfixed) + 1;
-
-  rrc_init_mib ();
-}
-
-//-----------------------------------------------------------------------------
-void rrc_fill_sib2 (void)
-{
-  //-----------------------------------------------------------------------------
-  //  // hard coded in first step
-  //  int i;
-  //  char IPAddr[]  = "1234123412341234";
-  //  char a;
-  //
-  //  for (i=0;i<16;i++){
-  //     a= IPAddr[i];
-  //     protocol_bs->rrc.rg_bch_blocks.currSIB2.net_IP_addr.data[i]= a;
-  //  }
-}
-
-//-----------------------------------------------------------------------------
-void rrc_init_sib2 (void)
-{
-  //-----------------------------------------------------------------------------
-  // int value_tag;
-  //  // Prepare
-  int             status = P_SUCCESS;
-  // SysInfoType2* pSIB2 = &(protocol_bs->rrc.rg_bch_blocks.currSIB2);
-  // PERParms* pParms = &(protocol_bs->rrc.rg_bch_blocks.perParms);
-  // char * pBuffer = (char *) & (protocol_bs->rrc.rg_bch_blocks.encoded_currSIB2);
-  // rrc_new_per_parms (pParms,  pBuffer);
-  //  // Encode
-  // status = rrc_PEREnc_SysInfoType2 (pParms, pSIB2);
-  //
-#ifdef DEBUG_RRC_BROADCAST
-  msg ("[RRC_BCH] Init SIB2 result (removed) - status : %d\n\n", status);
-  // rrc_print_per_parms(pParms);
-#endif
-  //  // Update value_tag and MIB
-  // value_tag = protocol_bs->rrc.rg_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[1].sibSb_Type.type_tag.sysInfoType2;
-  // value_tag = (++ value_tag)%4;
-  // protocol_bs->rrc.rg_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[1].sibSb_Type.type_tag.sysInfoType2
-  //           = value_tag;
-  // protocol_bs->rrc.rg_bch_blocks.encodedSIB2_lgth = pParms->buff_size;
-  // if ((protocol_bs->rrc.rg_bch_blocks.encodedSIB2_lgth % LSIBfixed) ==0)
-  //    protocol_bs->rrc.rg_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[1].scheduling.segCount
-  //        =  (protocol_bs->rrc.rg_bch_blocks.encodedSIB2_lgth / LSIBfixed);
-  // else
-  //    protocol_bs->rrc.rg_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[1].scheduling.segCount
-  //        =  (protocol_bs->rrc.rg_bch_blocks.encodedSIB2_lgth / LSIBfixed) + 1;
-  // rrc_init_mib();
-}
-
-//-----------------------------------------------------------------------------
-void rrc_fill_sib5 (void)
-{
-  //-----------------------------------------------------------------------------
-  /*
-     u8 rachfach_conf[]="I'm not thinking about retiring at this point, so my focus is on coming back and figuring out how to get back here. \
-     I don't think anybody's going to question why I'm coming back next year.";
-     //size 195
-   */
-  //   u8 rachfach_conf[]="I'm not thinking about retiring at this point.";
-  //size 45 - TEMP : SIB5 content to be revised
-  int config_length;
-  char* config_ptr=NULL;
-  u8 error_message[] = "ERROR-SIB5";
-
-  // Fill SCCPCH-PRACH config
-  //protocol_bs->rrc.rg_bch_blocks.currSIB5.prach_sCCPCH_SIList.numocts=strlen(rachfach_conf);
-  //protocol_bs->rrc.rg_bch_blocks.currSIB5.prach_sCCPCH_SIList.numocts = sizeof (SCCPCH_SYSTEM_INFO) + sizeof (PRACH_SYSTEM_INFO);
-  rrc_rg_get_common_config_SIB(&config_length, &config_ptr);
-#ifdef DEBUG_RRC_DETAILS
-  //msg ("\n[RRC-RG] rrc_fill_sib5 config pointer  %p \n", config_ptr);
-#endif
-
-  protocol_bs->rrc.rg_bch_blocks.currSIB5.prach_sCCPCH_SIList.numocts = config_length;
-
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC] Fill SIB5 : config length = %d\n", protocol_bs->rrc.rg_bch_blocks.currSIB5.prach_sCCPCH_SIList.numocts);
-#endif
-
-  if (protocol_bs->rrc.rg_bch_blocks.currSIB5.prach_sCCPCH_SIList.numocts <= maxBlock - 8) {
-    // For test only
-    // memcpy(protocol_bs->rrc.rg_bch_blocks.currSIB5.prach_sCCPCH_SIList.data,rachfach_conf,
-    //           protocol_bs->rrc.rg_bch_blocks.currSIB5.prach_sCCPCH_SIList.numocts);
-    //memcpy (protocol_bs->rrc.rg_bch_blocks.currSIB5.prach_sCCPCH_SIList.data, (char *) &(rrm_config->sccpch), sizeof (SCCPCH_SYSTEM_INFO) + sizeof (PRACH_SYSTEM_INFO));
-    memcpy(protocol_bs->rrc.rg_bch_blocks.currSIB5.prach_sCCPCH_SIList.data, config_ptr, config_length);
-
-  } else {
-    msg ("[RRC] Fill SIB5 : config length too long \n\n");
-    protocol_bs->rrc.rg_bch_blocks.currSIB5.prach_sCCPCH_SIList.numocts = strlen (error_message);
-    memcpy (protocol_bs->rrc.rg_bch_blocks.currSIB5.prach_sCCPCH_SIList.data, error_message, protocol_bs->rrc.rg_bch_blocks.currSIB5.prach_sCCPCH_SIList.numocts);
-  }
-
-  // Fill OpenLoopPowerControl_TDD with initial values
-  protocol_bs->rrc.rg_bch_blocks.currSIB5.openLoopPowerControl_TDD.primaryCCPCH_TX_Power
-  // = rrm_config->outer_loop_vars.PCCPCH_POWER;
-    = 25;
-  protocol_bs->rrc.rg_bch_blocks.currSIB5.openLoopPowerControl_TDD.alpha
-  // = rrm_config->outer_loop_vars.alpha;
-    = 4;
-  protocol_bs->rrc.rg_bch_blocks.currSIB5.openLoopPowerControl_TDD.prach_ConstantValue
-  // = rrm_config->outer_loop_vars.PRACH_CNST;
-    = -13;
-  protocol_bs->rrc.rg_bch_blocks.currSIB5.openLoopPowerControl_TDD.dpch_ConstantValue
-  // = rrm_config->outer_loop_vars.DPCH_CNST;
-    = 5;
-}
-
-//-----------------------------------------------------------------------------
-void rrc_init_sib5 (void)
-{
-  //-----------------------------------------------------------------------------
-  int             value_tag;
-  // Prepare
-  int             status = P_SUCCESS;
-  SysInfoType5   *pSIB5 = &(protocol_bs->rrc.rg_bch_blocks.currSIB5);
-  PERParms       *pParms = &(protocol_bs->rrc.rg_bch_blocks.perParms);
-  char           *pBuffer = (char *) &(protocol_bs->rrc.rg_bch_blocks.encoded_currSIB5);
-  rrc_new_per_parms (pParms, pBuffer);
-  // Encode
-  status = rrc_PEREnc_SysInfoType5 (pParms, pSIB5);
-
-#ifdef DEBUG_RRC_BROADCAST
-  msg ("[RRC_BCH] Init SIB5 result - status : %d\n", status);
-  rrc_print_per_parms (pParms);
-#endif
-
-  if (status != 0) {
-    msg ("\n\n[RRC_BCH] Init SIB5 result - WCDMA_ERROR_RRC_NASTY_BCH_CONFIG : %d\n\n", status);
-    //wcdma_handle_error (WCDMA_ERROR_RRC_NASTY_BCH_CONFIG);
-  }
-
-  // Update value_tag and MIB
-  value_tag = protocol_bs->rrc.rg_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[2].sibSb_Type.type_tag.sysInfoType5;
-  value_tag = (++value_tag) % 4;
-  protocol_bs->rrc.rg_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[2].sibSb_Type.type_tag.sysInfoType5 = value_tag;
-  protocol_bs->rrc.rg_bch_blocks.encodedSIB5_lgth = pParms->buff_size;
-
-  if ((protocol_bs->rrc.rg_bch_blocks.encodedSIB5_lgth % LSIBfixed) == 0)
-    protocol_bs->rrc.rg_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[2].scheduling.segCount = (protocol_bs->rrc.rg_bch_blocks.encodedSIB5_lgth / LSIBfixed);
-  else
-    protocol_bs->rrc.rg_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[2].scheduling.segCount = (protocol_bs->rrc.rg_bch_blocks.encodedSIB5_lgth / LSIBfixed) + 1;
-
-  rrc_init_mib ();
-}
-
-//-----------------------------------------------------------------------------
-void rrc_fill_sib11 (void)
-{
-  //-----------------------------------------------------------------------------
-  //  // hard coded in first step
-  // u8 rachfach_conf[]= "6666666666777777777700000000008888888888999999999912121212121212121212343434343434343434345555555555";
-  //
-  //  protocol_bs->rrc.rg_bch_blocks.currSIB11.prach_sCCPCH_SIList.numocts=98;
-  ////  for (i=0;i<35;i++)
-  ////     protocol_bs->rrc.rg_bch_blocks.currSIB11.ue_TimersAndConstants.data[i]=bufferTimer[i];
-  //  memcpy(protocol_bs->rrc.rg_bch_blocks.currSIB11.prach_sCCPCH_SIList.data,rachfach_conf,
-  //           protocol_bs->rrc.rg_bch_blocks.currSIB11.prach_sCCPCH_SIList.numocts);
-}
-
-//-----------------------------------------------------------------------------
-void rrc_init_sib11 (void)
-{
-  //-----------------------------------------------------------------------------
-  // int value_tag;
-  // Prepare
-  int             status = P_SUCCESS;
-  // SysInfoType11* pSIB11 = &(protocol_bs->rrc.rg_bch_blocks.currSIB11);
-  // PERParms* pParms = &(protocol_bs->rrc.rg_bch_blocks.perParms);
-  // char * pBuffer = (char *) & (protocol_bs->rrc.rg_bch_blocks.encoded_currSIB11);
-  // rrc_new_per_parms (pParms,  pBuffer);
-  //  // Encode
-  // status = rrc_PEREnc_SysInfoType11 (pParms, pSIB11);
-
-#ifdef DEBUG_RRC_BROADCAST
-  msg ("[RRC_BCH] Init SIB11 result (not implemented yet)- status : %d\n\n", status);
-  //rrc_print_per_parms(pParms);
-#endif
-  // Update value_tag and MIB
-  // value_tag = protocol_bs->rrc.rg_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[3].sibSb_Type.type_tag.sysInfoType11;
-  // value_tag = (++ value_tag)%4;
-  // protocol_bs->rrc.rg_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[3].sibSb_Type.type_tag.sysInfoType11
-  //           = value_tag;
-  // protocol_bs->rrc.rg_bch_blocks.encodedSIB11_lgth = pParms->buff_size;
-  // if ((protocol_bs->rrc.rg_bch_blocks.encodedSIB11_lgth % LSIBfixed) ==0)
-  //    protocol_bs->rrc.rg_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[3].scheduling.segCount
-  //        =  (protocol_bs->rrc.rg_bch_blocks.encodedSIB11_lgth / LSIBfixed);
-  // else
-  //    protocol_bs->rrc.rg_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[3].scheduling.segCount
-  //        =  (protocol_bs->rrc.rg_bch_blocks.encodedSIB11_lgth / LSIBfixed) + 1;
-  // rrc_init_mib();
-}
-
-//-----------------------------------------------------------------------------
-void rrc_fill_sib14 (void)
-{
-  //-----------------------------------------------------------------------------
-  int             i = 0;
-  SysInfoType14  *psib14 = &(protocol_bs->rrc.rg_bch_blocks.currSIB14);
-
-  psib14->expirationTimeFactor = SIB14_TFACTOR;
-  psib14->individualTS_InterferenceList.numSlots = 15;
-
-  for (i = 0; i < psib14->individualTS_InterferenceList.numSlots; i++) {
-    psib14->individualTS_InterferenceList.data[i].timeslot = i;
-  }
-
-  /*  **** REMOVED FOR OPENAIR ****
-    for (i = 0; i < psib14->individualTS_InterferenceList.numSlots; i++) {
-  //    psib14->individualTS_InterferenceList.data[i].ul_TimeslotInterference = rrm_config->outer_loop_vars.IBTS[i];
-      psib14->individualTS_InterferenceList.data[i].ul_TimeslotInterference = (5*i)-110;
-    }
-  //msg(" *****Trace fill sib14 rrm_config->outer_loop_vars.IBTS[1]= %d; \n",rrm_config->outer_loop_vars.IBTS[1]);
-  */
-  //For test
-  psib14->individualTS_InterferenceList.data[0].ul_TimeslotInterference=-110;
-  psib14->individualTS_InterferenceList.data[1].ul_TimeslotInterference=-105;
-  psib14->individualTS_InterferenceList.data[2].ul_TimeslotInterference=-100;
-  psib14->individualTS_InterferenceList.data[3].ul_TimeslotInterference=-95;
-  psib14->individualTS_InterferenceList.data[4].ul_TimeslotInterference=-90;
-  psib14->individualTS_InterferenceList.data[5].ul_TimeslotInterference=-85;
-  psib14->individualTS_InterferenceList.data[6].ul_TimeslotInterference=-80;
-  psib14->individualTS_InterferenceList.data[7].ul_TimeslotInterference=-75;
-  psib14->individualTS_InterferenceList.data[8].ul_TimeslotInterference=-70;
-  psib14->individualTS_InterferenceList.data[9].ul_TimeslotInterference=-65;
-  psib14->individualTS_InterferenceList.data[10].ul_TimeslotInterference=-60;
-  psib14->individualTS_InterferenceList.data[11].ul_TimeslotInterference=-55;
-  psib14->individualTS_InterferenceList.data[12].ul_TimeslotInterference=-100;
-  psib14->individualTS_InterferenceList.data[13].ul_TimeslotInterference=-75;
-  psib14->individualTS_InterferenceList.data[14].ul_TimeslotInterference=-52;
-}
-
-//-----------------------------------------------------------------------------
-void rrc_init_sib14 (void)
-{
-  //-----------------------------------------------------------------------------
-  // Prepare
-  int             status = P_SUCCESS;
-  SysInfoType14  *pSIB14 = &(protocol_bs->rrc.rg_bch_blocks.currSIB14);
-  PERParms       *pParms = &(protocol_bs->rrc.rg_bch_blocks.perParms);
-  char           *pBuffer = (char *) &(protocol_bs->rrc.rg_bch_blocks.encoded_currSIB14);
-  rrc_new_per_parms (pParms, pBuffer);
-  // Encode
-  status = rrc_PEREnc_SysInfoType14 (pParms, pSIB14);
-
-#ifdef DEBUG_RRC_BROADCAST
-  msg ("[RRC_BCH] Init SIB14 result - status : %d\n", status);
-  rrc_print_per_parms (pParms);
-#endif
-  // value_tag not updated - controlled by time-out
-  protocol_bs->rrc.rg_bch_blocks.encodedSIB14_lgth = pParms->buff_size;
-
-  if ((protocol_bs->rrc.rg_bch_blocks.encodedSIB14_lgth % LSIBfixed) == 0)
-    protocol_bs->rrc.rg_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[4].scheduling.segCount = (protocol_bs->rrc.rg_bch_blocks.encodedSIB14_lgth / LSIBfixed);
-  else
-    protocol_bs->rrc.rg_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[4].scheduling.segCount = (protocol_bs->rrc.rg_bch_blocks.encodedSIB14_lgth / LSIBfixed) + 1;
-
-  rrc_init_mib ();
-}
-
-//-----------------------------------------------------------------------------
-void rrc_fill_sib18 (void)
-{
-  //-----------------------------------------------------------------------------
-  // warning SIB18 currently a short SIB ==> length < 110 bytes
-  /*
-     u8 cells_list[]="This is the initial setting of cell list = dummy.";
-     //size 48
-  */
-  u8              cells_list[] = "NoData in SIB18";
-  u8              error_message[] = "ERROR-SIB18";
-
-  protocol_bs->rrc.rg_bch_blocks.currSIB18.cellIdentities.numocts = strlen (cells_list);
-
-  if (protocol_bs->rrc.rg_bch_blocks.currSIB18.cellIdentities.numocts <= 110) {
-    memcpy (protocol_bs->rrc.rg_bch_blocks.currSIB18.cellIdentities.data, cells_list, protocol_bs->rrc.rg_bch_blocks.currSIB18.cellIdentities.numocts);
-  } else {
-    protocol_bs->rrc.rg_bch_blocks.currSIB18.cellIdentities.numocts = strlen (error_message);
-    memcpy (protocol_bs->rrc.rg_bch_blocks.currSIB18.cellIdentities.data, error_message, protocol_bs->rrc.rg_bch_blocks.currSIB18.cellIdentities.numocts);
-  }
-
-  //CodeGroups currently hard-coded for 2 cells
-  protocol_bs->rrc.rg_bch_blocks.currSIB18.cellCodegroups.data[0] = 0;
-  protocol_bs->rrc.rg_bch_blocks.currSIB18.cellCodegroups.data[1] = 14;
-
-}
-
-
-//-----------------------------------------------------------------------------
-void rrc_init_sib18 (void)
-{
-  //-----------------------------------------------------------------------------
-  int             value_tag;
-  // Prepare
-  int             status = P_SUCCESS;
-
-  SysInfoType18  *pSIB18 = &(protocol_bs->rrc.rg_bch_blocks.currSIB18);
-  PERParms       *pParms = &(protocol_bs->rrc.rg_bch_blocks.perParms);
-  char           *pBuffer = (char *) &(protocol_bs->rrc.rg_bch_blocks.encoded_currSIB18);
-  rrc_new_per_parms (pParms, pBuffer);
-  // Encode
-  status = rrc_PEREnc_SysInfoType18 (pParms, pSIB18);
-#ifdef DEBUG_RRC_BROADCAST
-  msg ("[RRC_BCH] Init SIB18 result - status : %d\n", status);
-  rrc_print_per_parms (pParms);
-#endif
-  // Update value_tag and MIB
-  value_tag = protocol_bs->rrc.rg_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[5].sibSb_Type.type_tag.sysInfoType18;
-  value_tag = (++value_tag) % 4;
-  protocol_bs->rrc.rg_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[5].sibSb_Type.type_tag.sysInfoType18 = value_tag;
-  protocol_bs->rrc.rg_bch_blocks.encodedSIB18_lgth = pParms->buff_size;
-
-  if ((protocol_bs->rrc.rg_bch_blocks.encodedSIB18_lgth % LSIBfixed) == 0)
-    protocol_bs->rrc.rg_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[5].scheduling.segCount = (protocol_bs->rrc.rg_bch_blocks.encodedSIB18_lgth / LSIBfixed);
-  else
-    protocol_bs->rrc.rg_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[5].scheduling.segCount = (protocol_bs->rrc.rg_bch_blocks.encodedSIB18_lgth / LSIBfixed) + 1;
-
-  rrc_init_mib ();
-}
-
-
-//-----------------------------------------------------------------------------
-void rrc_update_SIB18_period (int period)
-{
-  //-----------------------------------------------------------------------------
-  MasterInformationBlock *pmib = &(protocol_bs->rrc.rg_bch_blocks.currMIB);
-
-  if (period < 150) {
-    pmib->sibSb_ReferenceList.sib_ref[5].scheduling.scheduling_sib_rep.sib_Rep = SchedulingInformation_scheduling_rep128;
-  } else {
-    if (period < 320) {
-      pmib->sibSb_ReferenceList.sib_ref[5].scheduling.scheduling_sib_rep.sib_Rep = SchedulingInformation_scheduling_rep256;
-    } else {
-      pmib->sibSb_ReferenceList.sib_ref[5].scheduling.scheduling_sib_rep.sib_Rep = SchedulingInformation_scheduling_rep512;
-    }
-  }
-}
-
-
-//-----------------------------------------------------------------------------
-void rrc_init_blocks (void)
-{
-  //-----------------------------------------------------------------------------
-  // read configuration file and create MIB/SIBs data
-  rrc_fill_mib ();
-  rrc_fill_sib1 ();
-  rrc_fill_sib2 ();
-  rrc_fill_sib5 ();
-  rrc_fill_sib11 ();
-  rrc_fill_sib14 ();
-  rrc_fill_sib18 ();
-
-  // encode MIB/SIBs
-  rrc_init_sib1 ();
-  rrc_init_sib2 ();
-  rrc_init_sib5 ();
-  rrc_init_sib11 ();
-  rrc_init_sib14 ();
-  rrc_init_sib18 ();
-  //  rrc_init_mib();
-  protocol_bs->rrc.rg_bch_blocks.curr_block_type = NO_BLOCK;
-  protocol_bs->rrc.rg_bch_blocks.next_block_type = NO_BLOCK;
-}
diff --git a/openair2/RRC/CELLULAR/rrc_rg_bch_variables.h b/openair2/RRC/CELLULAR/rrc_rg_bch_variables.h
deleted file mode 100755
index 226e98604f..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg_bch_variables.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/***************************************************************************
-                          rrc_rg_bch_variables.h  -  description
-                             -------------------
-    begin                : Aug 30, 2002
-    copyright            : (C) 2002, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Some additional definitions for RG broadcast
- ***************************************************************************/
-#ifndef __RRC_RG_BCH_H__
-#define __RRC_RG_BCH_H__
-
-#include "mem_block.h"
-#include "rrc_bch_mib.h"
-
-//#include "SystemInformationBlockType2.h"
-//#include "SystemInformation.h"
-//#include "BCCH-DL-SCH-Message.h"
-//#include "TDD-Config.h"
-
-
-// RRC Cellular Block
-struct rrc_rg_bch_blocks {
-  mem_block_t     *tSegment;
-  PERParms        perParms;
-  int             next_block_type;
-  int             curr_block_type;
-  int             curr_block_index;
-  int             curr_block_length;
-  int             curr_segment_index;
-  SIB_Type        sib_list[supportedSIBs];
-  int             SIB1_oneTimeShot;
-  int             SIB14_timeout;
-  SystemInformation_BCH currSI_BCH;
-  ENCODEDSI       encoded_currSIBCH;
-  ENCODEDSI       encoded_prevSIBCH;
-  MasterInformationBlock currMIB;
-  int             encodedMIB_lgth;
-  ENCODEDBLOCK    encoded_currMIB;
-  ENCODEDBLOCK    encoded_prevMIB;
-  struct SysInfoType1 currSIB1;
-  int             encodedSIB1_lgth;
-  ENCODEDBLOCK    encoded_currSIB1;
-  ENCODEDBLOCK    encoded_prevSIB1;
-  struct SysInfoType2 currSIB2;
-  int             encodedSIB2_lgth;
-  ENCODEDBLOCK    encoded_currSIB2;
-  ENCODEDBLOCK    encoded_prevSIB2;
-  struct SysInfoType5 currSIB5;
-  int             encodedSIB5_lgth;
-  ENCODEDBLOCK    encoded_currSIB5;
-  ENCODEDBLOCK    encoded_prevSIB5;
-  //struct SysInfoType11 currSIB11;
-  int             encodedSIB11_lgth;
-  ENCODEDBLOCK    encoded_currSIB11;
-  ENCODEDBLOCK    encoded_prevSIB11;
-  struct SysInfoType14 currSIB14;
-  int             encodedSIB14_lgth;
-  ENCODEDBLOCK    encoded_currSIB14;
-  ENCODEDBLOCK    encoded_prevSIB14;
-  struct SysInfoType18 currSIB18;
-  int             encodedSIB18_lgth;
-  ENCODEDBLOCK    encoded_currSIB18;
-  ENCODEDBLOCK    encoded_prevSIB18;
-};
-
-
-
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_rg_bch_write.c b/openair2/RRC/CELLULAR/rrc_rg_bch_write.c
deleted file mode 100755
index 7c5907d3bb..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg_bch_write.c
+++ /dev/null
@@ -1,445 +0,0 @@
-/***************************************************************************
-                          rrc_rg_bch_write.c  -  description
-                             -------------------
-    begin                : Aug 30, 2002
-    copyright            : (C) 2002, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Procedures to perform encoding of SIBs
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_rg_vars.h"
-#include "rrc_bch_mib.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_bch.h"
-
-
-//-----------------------------------------------------------------------------
-void rrc_rg_schedule_bch (void)
-{
-  //-----------------------------------------------------------------------------
-  int i;
-  int sib_rep;
-
-  MasterInformationBlock *pmib = &(protocol_bs->rrc.rg_bch_blocks.currMIB);
-  //set frame number
-  protocol_bs->rrc.rg_bch_blocks.currSI_BCH.sfn_Prime = protocol_bs->rrc.current_SFN % 2048;   //a revoir
-
-  // clean encoded memory
-  for (i = 0; i < maxSI; i++) {
-    protocol_bs->rrc.rg_bch_blocks.encoded_currSIBCH[i] = 0;
-  }
-
-  // check which block is next
-  // MIB
-  //   msg("[RRC_DEBUG] current frame : %d, pos : %d\n", protocol_bs->rrc.current_SFN, (protocol_bs->rrc.current_SFN %(2<<MIB_REP))/2);
-  if ((protocol_bs->rrc.current_SFN % (2 << MIB_REP)) / 2 == MIB_POS) {
-    protocol_bs->rrc.rg_bch_blocks.next_block_type = masterInformationBlock;
-  } else {
-    if (((protocol_bs->rrc.current_SFN % (2 << MIB_REP)) / 2 == LONG_SIB_POS)
-        && (protocol_bs->rrc.rg_bch_blocks.SIB1_oneTimeShot == TRUE)) {
-      protocol_bs->rrc.rg_bch_blocks.next_block_type = systemInformationBlockType1;
-      protocol_bs->rrc.rg_bch_blocks.SIB1_oneTimeShot = FALSE;
-    } else {
-      for (i = 0; i < supportedSIBs; i++) {
-        // SIBs -- if SIB_REP>0 and frame%SIB_REP==SIP_POS
-        sib_rep = pmib->sibSb_ReferenceList.sib_ref[i].scheduling.scheduling_sib_rep.sib_Rep;
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-        //msg("[RRC_DEBUG] current frame : %d, SIB# %d, rep %d,  pos : %d\n", protocol_bs->rrc.current_SFN,i,sib_rep, (protocol_bs->rrc.current_SFN % (2<<sib_rep))/2);
-#endif
-
-        if ((sib_rep > 0) && ((protocol_bs->rrc.current_SFN % (2 << sib_rep)) / 2 == pmib->sibSb_ReferenceList.sib_ref[i].scheduling.scheduling_sib_rep.sib_Pos)) {
-          protocol_bs->rrc.rg_bch_blocks.next_block_type = protocol_bs->rrc.rg_bch_blocks.sib_list[i];
-          break;
-        }
-      }
-
-      if (i == supportedSIBs) {
-        protocol_bs->rrc.rg_bch_blocks.next_block_type = NO_BLOCK;
-      }
-    }
-  }
-
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-  msg ("[RRC_BCH] current frame : %d, SFN : %d\n", protocol_bs->rrc.current_SFN, protocol_bs->rrc.rg_bch_blocks.currSI_BCH.sfn_Prime);
-  msg ("[RRC_BCH-RG] next block : %d\n", protocol_bs->rrc.rg_bch_blocks.next_block_type);
-#endif
-}
-
-//-----------------------------------------------------------------------------
-void rrc_rg_segment_block (void)
-{
-  //-----------------------------------------------------------------------------
-  int block_length;
-
-  //check if there is no pending block
-  if (protocol_bs->rrc.rg_bch_blocks.curr_block_type == NO_BLOCK) {
-    //get next block scheduled and find its length
-    switch (protocol_bs->rrc.rg_bch_blocks.next_block_type) {
-    case NO_BLOCK:
-      block_length = 0;
-      break;
-
-    case masterInformationBlock:
-      block_length = rrc_get_per_length ((ENCODEDBLOCK *) protocol_bs->rrc.rg_bch_blocks.encoded_currMIB);
-      break;
-
-    case systemInformationBlockType1:
-      block_length = rrc_get_per_length ((ENCODEDBLOCK *) protocol_bs->rrc.rg_bch_blocks.encoded_currSIB1);
-      break;
-
-    case systemInformationBlockType2:
-      block_length = rrc_get_per_length ((ENCODEDBLOCK *) protocol_bs->rrc.rg_bch_blocks.encoded_currSIB2);
-      break;
-
-    case systemInformationBlockType5:
-      block_length = rrc_get_per_length ((ENCODEDBLOCK *) protocol_bs->rrc.rg_bch_blocks.encoded_currSIB5);
-      break;
-
-    case systemInformationBlockType14:
-      block_length = rrc_get_per_length ((ENCODEDBLOCK *) protocol_bs->rrc.rg_bch_blocks.encoded_currSIB14);
-      break;
-
-    case systemInformationBlockType18:
-      block_length = rrc_get_per_length ((ENCODEDBLOCK *) protocol_bs->rrc.rg_bch_blocks.encoded_currSIB18);
-      break;
-
-    default:
-      block_length = 10000; //value over max
-    }
-
-    protocol_bs->rrc.rg_bch_blocks.curr_block_length = block_length;
-
-    // check if segmentation is needed
-    if (block_length <= LSIBcompl) {    //complete segment
-      protocol_bs->rrc.rg_bch_blocks.currSI_BCH.payload.type = BCH_completeSIB;
-
-      if (block_length == 0)
-        protocol_bs->rrc.rg_bch_blocks.currSI_BCH.payload.type = BCH_noSegment;
-    } else {                    //first segment of block
-      protocol_bs->rrc.rg_bch_blocks.currSI_BCH.payload.type = BCH_firstSegment;
-    }
-
-    protocol_bs->rrc.rg_bch_blocks.curr_block_type = protocol_bs->rrc.rg_bch_blocks.next_block_type;
-    protocol_bs->rrc.rg_bch_blocks.next_block_type = NO_BLOCK;
-  } else {
-    // there is a pending block - check if continuing or final
-    if ((protocol_bs->rrc.rg_bch_blocks.curr_block_length - protocol_bs->rrc.rg_bch_blocks.curr_block_index) <= LSIBfixed)      //fixed segment size
-      protocol_bs->rrc.rg_bch_blocks.currSI_BCH.payload.type = BCH_lastSegment;
-    else
-      protocol_bs->rrc.rg_bch_blocks.currSI_BCH.payload.type = BCH_subsequentSegment;
-  }
-}
-
-//-----------------------------------------------------------------------------
-void rrc_rg_fill_Seg1 (void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-  msg ("[RRC_BCH-RG] Fill NoSegment SIB with requested info [None] \n");
-#endif
-}
-
-//-----------------------------------------------------------------------------
-void rrc_rg_fill_Seg10 (PERParms * pParms)
-{
-  //-----------------------------------------------------------------------------
-  CompleteSIB    *pSegment;
-
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-  msg ("[RRC_BCH-RG] Fill Complete SIB. \n");
-#endif
-  // Temp malloc for test
-  //pSegment = malloc(sizeof(CompleteSIB));
-  protocol_bs->rrc.rg_bch_blocks.tSegment = get_free_mem_block (sizeof (CompleteSIB));
-  pSegment = (CompleteSIB *) protocol_bs->rrc.rg_bch_blocks.tSegment->data;
-  //
-  protocol_bs->rrc.rg_bch_blocks.currSI_BCH.payload.segment.completeSIB = pSegment;
-  pSegment->sib_Type = protocol_bs->rrc.rg_bch_blocks.curr_block_type;
-  pSegment->sib_Data_fixed.numbits = 0;
-
-  switch (protocol_bs->rrc.rg_bch_blocks.curr_block_type) {
-  case masterInformationBlock:
-    pParms->data = (ENCODEDBLOCK *) & (protocol_bs->rrc.rg_bch_blocks.encoded_currMIB);
-    break;
-
-  case systemInformationBlockType1:
-    pParms->data = (ENCODEDBLOCK *) & (protocol_bs->rrc.rg_bch_blocks.encoded_currSIB1);
-    break;
-
-  case systemInformationBlockType2:
-    pParms->data = (ENCODEDBLOCK *) & (protocol_bs->rrc.rg_bch_blocks.encoded_currSIB2);
-    break;
-
-  case systemInformationBlockType5:
-    pParms->data = (ENCODEDBLOCK *) & (protocol_bs->rrc.rg_bch_blocks.encoded_currSIB5);
-    break;
-
-  case systemInformationBlockType14:
-    pParms->data = (ENCODEDBLOCK *) & (protocol_bs->rrc.rg_bch_blocks.encoded_currSIB14);
-    break;
-
-  case systemInformationBlockType18:
-    pParms->data = (ENCODEDBLOCK *) & (protocol_bs->rrc.rg_bch_blocks.encoded_currSIB18);
-    break;
-
-  default:
-    pParms->data = 0;
-    //log error message
-#ifdef DEBUG_RRC_BROADCAST
-    msg ("[RRC_BCH-RG] Error rrc_rg_fill_Seg10 - switch default \n");
-#endif
-  }
-
-  protocol_bs->rrc.rg_bch_blocks.curr_block_type = NO_BLOCK;
-}
-
-//-----------------------------------------------------------------------------
-void rrc_rg_fill_Seg2 (PERParms * pParms)
-{
-  //-----------------------------------------------------------------------------
-  FirstSegment   *pSegment;
-
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-  msg ("[RRC_BCH-RG] Fill First Segment. \n");
-#endif
-  // Temp malloc for test
-  //pSegment = malloc(sizeof(FirstSegment));
-  protocol_bs->rrc.rg_bch_blocks.tSegment = get_free_mem_block (sizeof (FirstSegment));
-  pSegment = (FirstSegment *) protocol_bs->rrc.rg_bch_blocks.tSegment->data;
-  //
-  protocol_bs->rrc.rg_bch_blocks.currSI_BCH.payload.segment.firstSegment = pSegment;
-  pSegment->sib_Type = protocol_bs->rrc.rg_bch_blocks.curr_block_type;
-
-  if ((protocol_bs->rrc.rg_bch_blocks.curr_block_length % LSIBfixed) == 0)
-    pSegment->seg_Count = (protocol_bs->rrc.rg_bch_blocks.curr_block_length / LSIBfixed);
-  else
-    pSegment->seg_Count = (protocol_bs->rrc.rg_bch_blocks.curr_block_length / LSIBfixed) + 1;
-
-  protocol_bs->rrc.rg_bch_blocks.curr_segment_index = 0;
-  pParms->data_size = protocol_bs->rrc.rg_bch_blocks.curr_block_length;
-  pParms->data_offset = 0;
-  pSegment->sib_Data_fixed.numbits = 0;
-
-  switch (protocol_bs->rrc.rg_bch_blocks.curr_block_type) {
-  case masterInformationBlock:
-    pParms->data = (ENCODEDBLOCK *) & (protocol_bs->rrc.rg_bch_blocks.encoded_currMIB);
-    break;
-
-  case systemInformationBlockType1:
-    pParms->data = (ENCODEDBLOCK *) & (protocol_bs->rrc.rg_bch_blocks.encoded_currSIB1);
-    break;
-
-    // SIB2 is never segmented
-  case systemInformationBlockType5:
-    pParms->data = (ENCODEDBLOCK *) & (protocol_bs->rrc.rg_bch_blocks.encoded_currSIB5);
-    break;
-
-  case systemInformationBlockType14:
-    pParms->data = (ENCODEDBLOCK *) & (protocol_bs->rrc.rg_bch_blocks.encoded_currSIB14);
-    break;
-
-  case systemInformationBlockType18:
-    pParms->data = (ENCODEDBLOCK *) & (protocol_bs->rrc.rg_bch_blocks.encoded_currSIB18);
-    break;
-
-  default:
-    pParms->data = 0;
-#ifdef DEBUG_RRC_BROADCAST
-    msg ("[RRC_BCH-RG] Error rrc_rg_fill_Seg2 - switch default \n");
-#endif
-  }
-
-  protocol_bs->rrc.rg_bch_blocks.curr_block_index += LSIBfixed;
-}
-
-//-----------------------------------------------------------------------------
-void rrc_rg_fill_Seg3 (PERParms * pParms)
-{
-  //-----------------------------------------------------------------------------
-  SubsequentSegment *pSegment;
-  char *pTemp = NULL;
-
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-  msg ("[RRC_BCH-RG] Fill Subsequent Segment. \n");
-#endif
-  // Temp malloc for test
-  //pSegment = malloc(sizeof(SubsequentSegment));
-  protocol_bs->rrc.rg_bch_blocks.tSegment = get_free_mem_block (sizeof (SubsequentSegment));
-  pSegment = (SubsequentSegment *) protocol_bs->rrc.rg_bch_blocks.tSegment->data;
-  //
-  protocol_bs->rrc.rg_bch_blocks.currSI_BCH.payload.segment.subsequentSegment = pSegment;
-  pSegment->sib_Type = protocol_bs->rrc.rg_bch_blocks.curr_block_type;
-  protocol_bs->rrc.rg_bch_blocks.curr_segment_index += 1;
-  pSegment->segmentIndex = protocol_bs->rrc.rg_bch_blocks.curr_segment_index;
-  pSegment->sib_Data_fixed.numbits = 0;
-  pParms->data_offset = protocol_bs->rrc.rg_bch_blocks.curr_block_index;
-
-  switch (protocol_bs->rrc.rg_bch_blocks.curr_block_type) {
-  case masterInformationBlock:
-    pTemp = (char *) (&(protocol_bs->rrc.rg_bch_blocks.encoded_currMIB)) + protocol_bs->rrc.rg_bch_blocks.curr_block_index;
-    break;
-
-  case systemInformationBlockType1:
-    pTemp = (char *) (&(protocol_bs->rrc.rg_bch_blocks.encoded_currSIB1)) + protocol_bs->rrc.rg_bch_blocks.curr_block_index;
-    break;
-
-    // SIB2 is never segmented
-  case systemInformationBlockType5:
-    pTemp = (char *) (&(protocol_bs->rrc.rg_bch_blocks.encoded_currSIB5)) + protocol_bs->rrc.rg_bch_blocks.curr_block_index;
-    break;
-
-  case systemInformationBlockType14:
-    pTemp = (char *) (&(protocol_bs->rrc.rg_bch_blocks.encoded_currSIB14)) + protocol_bs->rrc.rg_bch_blocks.curr_block_index;
-    break;
-
-  case systemInformationBlockType18:
-    pTemp = (char *) (&(protocol_bs->rrc.rg_bch_blocks.encoded_currSIB18)) + protocol_bs->rrc.rg_bch_blocks.curr_block_index;
-    break;
-
-  default:
-    pParms->data = 0;
-#ifdef DEBUG_RRC_BROADCAST
-    msg ("[RRC_BCH-RG] Error rrc_rg_fill_Seg3 - switch default \n");
-#endif
-  }
-
-  pParms->data = (ENCODEDBLOCK *) pTemp;
-
-  protocol_bs->rrc.rg_bch_blocks.curr_block_index += LSIBfixed;
-}
-
-//-----------------------------------------------------------------------------
-void rrc_rg_fill_Seg11 (PERParms * pParms)
-{
-  //-----------------------------------------------------------------------------
-  LastSegment    *pSegment;
-  char *pTemp = NULL;
-
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-  msg ("[RRC_BCH-RG] Fill Last Segment. \n");
-#endif
-  // Temp malloc for test
-  //pSegment = malloc(sizeof(LastSegment));
-  protocol_bs->rrc.rg_bch_blocks.tSegment = get_free_mem_block (sizeof (LastSegment));
-  pSegment = (LastSegment *) protocol_bs->rrc.rg_bch_blocks.tSegment->data;
-  //
-  protocol_bs->rrc.rg_bch_blocks.currSI_BCH.payload.segment.lastSegment = pSegment;
-  pSegment->sib_Type = protocol_bs->rrc.rg_bch_blocks.curr_block_type;
-  protocol_bs->rrc.rg_bch_blocks.curr_segment_index += 1;
-  pSegment->segmentIndex = protocol_bs->rrc.rg_bch_blocks.curr_segment_index;
-  pSegment->sib_Data_fixed.numbits = 0;
-  pParms->data_offset = protocol_bs->rrc.rg_bch_blocks.curr_block_index;
-
-  switch (protocol_bs->rrc.rg_bch_blocks.curr_block_type) {
-  case masterInformationBlock:
-    pTemp = (char *) (&(protocol_bs->rrc.rg_bch_blocks.encoded_currMIB)) + protocol_bs->rrc.rg_bch_blocks.curr_block_index;
-    break;
-
-  case systemInformationBlockType1:
-    pTemp = (char *) (&(protocol_bs->rrc.rg_bch_blocks.encoded_currSIB1)) + protocol_bs->rrc.rg_bch_blocks.curr_block_index;
-    break;
-
-    // SIB2 is never segmented
-  case systemInformationBlockType5:
-    pTemp = (char *) (&(protocol_bs->rrc.rg_bch_blocks.encoded_currSIB5)) + protocol_bs->rrc.rg_bch_blocks.curr_block_index;
-    break;
-
-  case systemInformationBlockType14:
-    pTemp = (char *) (&(protocol_bs->rrc.rg_bch_blocks.encoded_currSIB14)) + protocol_bs->rrc.rg_bch_blocks.curr_block_index;
-    break;
-
-  case systemInformationBlockType18:
-    pTemp = (char *) (&(protocol_bs->rrc.rg_bch_blocks.encoded_currSIB18)) + protocol_bs->rrc.rg_bch_blocks.curr_block_index;
-    break;
-
-  default:
-    pParms->data = 0;
-#ifdef DEBUG_RRC_BROADCAST
-    msg ("[RRC_BCH-RG] Error rrc_rg_fill_Seg11 - switch default \n");
-#endif
-  }
-
-  pParms->data = (ENCODEDBLOCK *) pTemp;
-  protocol_bs->rrc.rg_bch_blocks.curr_block_type = NO_BLOCK;
-  protocol_bs->rrc.rg_bch_blocks.curr_block_index = 0;
-}
-
-//-----------------------------------------------------------------------------
-void rrc_rg_fill_SIBCH (PERParms * pParms)
-{
-  //-----------------------------------------------------------------------------
-  char *pBuffer;
-
-#ifdef DEBUG_RRC_BROADCAST
-  //  msg("[RRC_BCH-RG] Fill blocks with requested info \n");
-#endif
-  pBuffer = (char *) &(protocol_bs->rrc.rg_bch_blocks.encoded_currSIBCH);
-  rrc_new_per_parms (pParms, pBuffer);
-
-  switch (protocol_bs->rrc.rg_bch_blocks.currSI_BCH.payload.type) {
-  case BCH_completeSIB:
-    rrc_rg_fill_Seg10 (pParms);
-    break;
-
-  case BCH_firstSegment:
-    rrc_rg_fill_Seg2 (pParms);
-    break;
-
-  case BCH_subsequentSegment:
-    rrc_rg_fill_Seg3 (pParms);
-    break;
-
-  case BCH_lastSegment:
-    rrc_rg_fill_Seg11 (pParms);
-    break;
-
-  case BCH_noSegment:
-    rrc_rg_fill_Seg1 ();
-    break;
-
-  default:
-    //log error message
-    msg ("[RRC_BCH-RG] Error rrc_rg_fill_SIBCH - switch default \n");
-  }
-}
-
-//-----------------------------------------------------------------------------
-void rrc_rg_prepare_next_segment (void)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  PERParms       *pParms = &(protocol_bs->rrc.rg_bch_blocks.perParms);
-
-  // schedule next block
-  rrc_rg_schedule_bch ();
-
-  // segment
-  rrc_rg_segment_block ();
-
-  // fill structures with valid parameters
-  rrc_rg_fill_SIBCH (pParms);
-#ifdef DEBUG_RRC_BROADCAST
-  //msg("[RRC_BCH-RG] Current block index %d \n", protocol_bs->rrc.rg_bch_blocks.curr_block_index);
-#endif
-
-  // Encode
-  status = rrc_PEREnc_SI_BCH (pParms, &(protocol_bs->rrc.rg_bch_blocks.currSI_BCH));
-  // Add length
-  rrc_set_per_length (pParms);
-
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-  // msg("\n[RRC_BCH-RG] Next Broadcast preparation - status : %d\n", status);
-  rrc_print_per_parms (pParms);
-  // msg("[RRC_BCH-RG] End of buffer \n\n");
-#endif
-
-}
diff --git a/openair2/RRC/CELLULAR/rrc_rg_control.c b/openair2/RRC/CELLULAR/rrc_rg_control.c
deleted file mode 100755
index 19011a8b39..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg_control.c
+++ /dev/null
@@ -1,342 +0,0 @@
-/***************************************************************************
-                          rrc_rg_control.c  -  description
-                             -------------------
-    begin                : November 25, 2002
-    copyright            : (C) 2002, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
-    email                : Lionel.gauthier@eurecom.fr
- **************************************************************************
-  Procedures associated with the control of the RG protocol stack
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-//#include "rlc.h"
-#include "rrc_rg_vars.h"
-#include "rrc_messages.h"
-//#include "rrm_as_sap.h"
-#include "rrc_qos_classes.h"
-//#include "rrc_rrm_primitives.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_intf.h"
-#include "rrc_proto_fsm.h"
-#include "rrc_proto_int.h"
-#include "rrc_proto_mbms.h"
-#include "rrc_proto_msg.h"
-
-//-----------------------------------------------------------------------------
-// These proto already in rrc_rg.c (ESTEREL file)
-//void RRC_RG_O_O_SEND_DCCH_AM (int msgId);
-
-//-----------------------------------------------------------------------------
-void rrc_rg_CRLC_Status_rx (int rb_id, int evcP)
-{
-  //-----------------------------------------------------------------------------
-  int             srb_id;
-  int             UE_Id;
-  srb_id = rb_id % maxRB;
-  UE_Id = (rb_id - srb_id) / maxRB;
-  msg ("[RRC-CRLC] Outsynch received from RLC for Rb %d , mobile %d\n", rb_id, UE_Id);
-
-  rrc_rg_fsm_control (UE_Id, RG_CRLC_STATUS);
-}
-
-// Indications from L1
-//-----------------------------------------------------------------------------
-void rrc_rg_CPHY_Synch_rx (int CCTrCH)
-{
-  //-----------------------------------------------------------------------------
-#    ifdef DEBUG_RRC_STATE
-  msg ("[RRC-CPHY] Insynch received from PHY for CCTrCH %d \n", CCTrCH);
-#    endif
-  protocol_bs->rrc.rrc_rg_synch_ind = TRUE;
-  protocol_bs->rrc.rrc_rg_cctrch_synch[CCTrCH] = TRUE;
-}
-
-//-----------------------------------------------------------------------------
-void rrc_rg_CPHY_Out_Synch_rx (int CCTrCH)
-{
-  //-----------------------------------------------------------------------------
-  msg ("[RRC-CPHY] Outsynch received from PHY for CCTrCH %d \n", CCTrCH);
-  protocol_bs->rrc.rrc_rg_outsynch_ind = TRUE;
-  protocol_bs->rrc.rrc_rg_cctrch_outsynch[CCTrCH] = TRUE;
-}
-
-/* Check if an event arrived from L1 */
-//-------------------------------------------------------------------
-void rrc_rg_L1_check (void)
-{
-  //-------------------------------------------------------------------
-  /**** Original version - A revoir - UE_ID is rrc_rg_pending_UE
-    int UE_Id=0;  // Temp - hard coded
-    int data_ccTrCh; // Temp - hard coded
-    // First step is to test InSynch conditions
-    if (protocol_bs->rrc.rrc_rg_synch_ind==TRUE){
-    //insynch detected- read it
-       protocol_bs->rrc.rrc_rg_synch_ind=FALSE;
-       for (data_ccTrCh=0; data_ccTrCh<maxCCTrCH_rg; data_ccTrCh++){
-          if (protocol_bs->rrc.rrc_rg_cctrch_synch[data_ccTrCh]==TRUE){
-     #ifdef DEBUG_RRC_STATE
-             msg("[RRC_RG][CPHY] In-Synch detected for mobile %d and CCTRCH %d \n",UE_Id, data_ccTrCh);
-     #endif
-             protocol_bs->rrc.rrc_rg_cctrch_synch[data_ccTrCh]=FALSE;
-             UE_Id = protocol_bs->rrc.rrc_rg_pending_UE;
-             protocol_bs->rrc.rrc_rg_cctrch_crnti[data_ccTrCh]= UE_Id;
-             //rrc_RG_PHY_Synch_rx(UE_Id);  Now in FSM
-             rrc_rg_fsm_control(UE_Id, UE_PHY_SYNCH);
-          }
-       }
-    }
-
-    // Next step is to test OutOfSynch conditions
-    if (protocol_bs->rrc.rrc_rg_outsynch_ind==TRUE){
-    //outsynch detected- read it
-       protocol_bs->rrc.rrc_rg_outsynch_ind=FALSE;
-       for (data_ccTrCh=0; data_ccTrCh<maxCCTrCH_rg; data_ccTrCh++){
-          if (protocol_bs->rrc.rrc_rg_cctrch_outsynch[data_ccTrCh]==TRUE){
-     #ifdef DEBUG_RRC_STATE
-             msg("[RRC_RG][CPHY] Out-Synch detected for mobile %d and CCTRCH %d \n",UE_Id, data_ccTrCh);
-     #endif
-             protocol_bs->rrc.rrc_rg_cctrch_outsynch[data_ccTrCh]=FALSE;
-             UE_Id = protocol_bs->rrc.rrc_rg_cctrch_crnti[data_ccTrCh];
-             //rrc_RG_PHY_Connection_Loss_rx(UE_Id); Now in FSM
-             rrc_rg_fsm_control(UE_Id, RRC_CONNECT_LOSS);
-          }
-       }
-    }
-  */
-
-
-  int UE_Id = 0;    // Temp - hard coded
-  int data_ccTrCh;  // Temp - hard coded
-  // First step is to test InSynch conditions
-
-  // for (UE_Id =0; UE_Id <maxUsers ; UE_Id ++){
-  //
-  /*
-  if (rrc_rg_tick[UE_Id] > 2000) {   // LG WAS 15000
-    rrc_rg_tick[UE_Id] = 0;
-    msg ("[RRC_RG][CPHY] Mobile %d OUT due to lack of mesures \n\n\n\n", UE_Id);
-    protocol_bs->rrc.rrc_rg_outsynch_ind = TRUE;
-    for (data_ccTrCh = 0; data_ccTrCh < maxCCTrCH_rg; data_ccTrCh++) {
-      if (UE_Id == protocol_bs->rrc.rrc_rg_cctrch_crnti[data_ccTrCh])
-        protocol_bs->rrc.rrc_rg_cctrch_outsynch[data_ccTrCh] = TRUE;
-    }
-  }
-  */
-  // if (rrc_rg_tick[UE_Id ]>1000){
-  //   rrc_rg_fsm_control (UE_Id, RRC_CONNECT_LOSS);
-  //   #ifdef DEBUG_RRC_STATE
-  //   msg ("[RRC_RG][CPHY] Mobile  %d \n\n\n \n", UE_Id);
-  //  #endif
-  // }
-  // }
-  if (protocol_bs->rrc.rrc_rg_synch_ind == TRUE) {
-    //insynch detected- read it
-    protocol_bs->rrc.rrc_rg_synch_ind = FALSE;
-
-    for (data_ccTrCh = 0; data_ccTrCh < maxCCTrCH_rg; data_ccTrCh++) {
-      if (protocol_bs->rrc.rrc_rg_cctrch_synch[data_ccTrCh] == TRUE) {
-#ifdef DEBUG_RRC_STATE
-        msg ("[RRC_RG][CPHY] In-Synch detected for mobile %d and CCTRCH %d \n", UE_Id, data_ccTrCh);
-#endif
-        protocol_bs->rrc.rrc_rg_cctrch_synch[data_ccTrCh] = FALSE;
-        UE_Id = protocol_bs->rrc.rrc_rg_pending_UE;
-        protocol_bs->rrc.rrc_rg_cctrch_crnti[data_ccTrCh] = UE_Id;
-        //rrc_RG_PHY_Synch_rx(UE_Id);  Now in FSM
-        rrc_rg_fsm_control (UE_Id, UE_PHY_SYNCH);
-      }
-    }
-  }
-
-  // Next step is to test OutOfSynch conditions
-  if (protocol_bs->rrc.rrc_rg_outsynch_ind == TRUE) {
-    //outsynch detected- read it
-    protocol_bs->rrc.rrc_rg_outsynch_ind = FALSE;
-
-    for (data_ccTrCh = 0; data_ccTrCh < maxCCTrCH_rg; data_ccTrCh++) {
-      if (protocol_bs->rrc.rrc_rg_cctrch_outsynch[data_ccTrCh] == TRUE) {
-#ifdef DEBUG_RRC_STATE
-        msg ("[RRC_RG][CPHY] Out-Synch detected for mobile %d and CCTRCH %d \n", UE_Id, data_ccTrCh);
-#endif
-        protocol_bs->rrc.rrc_rg_cctrch_outsynch[data_ccTrCh] = FALSE;
-        UE_Id = protocol_bs->rrc.rrc_rg_cctrch_crnti[data_ccTrCh];
-        //rrc_RG_PHY_Connection_Loss_rx(UE_Id); Now in FSM
-        rrc_rg_fsm_control (UE_Id, RRC_CONNECT_LOSS);
-      }
-    }
-  }
-}
-
-//-------------------------------------------------------------------
-void rrc_process_sib18 (void)
-{
-  //-------------------------------------------------------------------
-  struct rrc_rg_nas_neighbor_list *p;
-
-  p = (struct rrc_rg_nas_neighbor_list *)protocol_bs->rrc.rg_bch_blocks.currSIB18.cellIdentities.data;
-  //  (char *) p = protocol_bs->rrc.rg_bch_blocks.currSIB18.cellIdentities.data;
-  protocol_bs->rrc.num_cells = p->num_rg;
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RG][SIB18] Number of cells %d \n", protocol_bs->rrc.num_cells);
-
-  if (protocol_bs->rrc.num_cells < protocol_bs->rrc.rg_cell_id)
-    msg ("\n\n NETWORK CONFIGURATION - RG cell_id %d,  Number of cells %d\n\n", protocol_bs->rrc.rg_cell_id, protocol_bs->rrc.num_cells);
-
-#endif
-}
-
-// TEMP OPEMAIR : The 3 next functions provide some dummy values for L1 and L2 measurements.
-//                To be replaced when interface is set-up.
-
-//-------------------------------------------------------------------
-// Performs the BS Traffic Volume measurements in L1
-void rrc_rg_measure_tv (int meas_ix)
-{
-  //-------------------------------------------------------------------
-  int i, numRBs;
-
-  protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[meas_ix].identity = meas_ix;
-  protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[meas_ix].meas_results_type = IX_tvbM;
-
-  // Traffic Volume measurements - Temp dummy values
-  numRBs = MAXMEASRBS;
-  protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[meas_ix].tv_num_rbs = numRBs;
-
-  for (i = 0; i < numRBs; i++) {
-    protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[meas_ix].tv_rbid[i] = i;
-    protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[meas_ix].tv_rb_payload[i] = 2 * i;      //0-19
-    protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[meas_ix].tv_rb_average[i] = (2 * i) + 5;        //0-19
-    protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[meas_ix].tv_rb_variance[i] = i + 2;     //0-104
-  }
-}
-
-//-------------------------------------------------------------------
-// Performs the Quality measurements in L1
-void rrc_rg_measure_q (int meas_ix)
-{
-  //-------------------------------------------------------------------
-  //    u16 q_num_TrCH;
-  //    u16 q_dl_TrCH_id[MAXMEASTRCH];
-  //    u16 q_dl_TrCH_BLER[MAXMEASTRCH];
-  //    u16 q_num_tfcs;
-  //    u16 q_tfcs_id[MAXMEASTFCS];
-  //    u16 q_sir[MAXMEASTFCS][maxTS];
-  int i,j,numTrCH=MAXMEASTRCH,numTFCS=MAXMEASTFCS;
-
-  protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[meas_ix].identity =meas_ix;
-  protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[meas_ix].meas_results_type = IX_qbM;
-
-  // Quality measurements - Temp dummy values
-  numTrCH = MAXMEASTRCH;
-  protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[meas_ix].q_num_TrCH = numTrCH;
-
-  for (i=0; i<numTrCH; i++) {
-    protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[meas_ix].q_dl_TrCH_id[i]=i;
-    protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[meas_ix].q_dl_TrCH_BLER[i]=((i+1)*4)-1;  //0-63
-  }
-
-  numTFCS = MAXMEASTFCS;
-  protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[meas_ix].q_num_tfcs = numTFCS;
-
-  for (i=0; i<numTFCS; i++) {
-    protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[meas_ix].q_tfcs_id[i]=i;
-
-    for (j=0; j<14; j++)
-      protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[meas_ix].q_sir[i][j]=(5*(i+1))+j+10;    //0-63
-  }
-}
-
-//-------------------------------------------------------------------
-// Performs the Internal BS measurements in L1
-void rrc_rg_measure_int_bs (int meas_ix)
-{
-  //-------------------------------------------------------------------
-  //    u16 num_measurement_counter;
-  //    u16 identity;
-  //    u16 meas_results_type;
-  //    u16 int_xmit_power[numANTENNAS][maxTS];
-  //    u16 int_rscp[maxTS][MAXCH];
-  int i,j,numCH;
-
-  protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[meas_ix].identity =meas_ix;
-  protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[meas_ix].meas_results_type = IX_ibsM;
-
-  numCH=MAXCH;
-
-  // internal UE measurements - Temp dummy values
-  for (i=0; i<14; i++) {
-    for (j=0; j<numANTENNAS; j++)
-      protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[meas_ix].int_xmit_power[j][i]=25+(6*i)+(2*j);  //0-104
-
-    for (j=0; j<numCH; j++)
-      protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[meas_ix].int_rscp[i][j]=12+(3*i)+(2*j);  //range ??
-  }
-}
-
-//-------------------------------------------------------------------
-// Triggers the necessary measurements in L1
-void rrc_rg_sync_measures (int time)
-{
-  //-------------------------------------------------------------------
-  int i;
-
-  for (i = 0; i < 2 * maxUsers + 1; i++) {
-    //check if measure needed
-    if (protocol_bs->rrc.rg_meas_blocks.rrc_rg_bs_meas_next[i] == time) {
-      // perform the measurement
-      switch (protocol_bs->rrc.rg_meas_blocks.bs_meas_cmd[i].type) {
-      case IX_tvbM:
-        // Measurement Report - Traffic Volume
-#ifdef DEBUG_RRC_MEASURE_REPORT_MAIN
-        msg ("[RRC_MSG] RG prepares Measurement Report (Traffic Volume) at time : %d\n\n", time);
-#endif
-        rrc_rg_measure_tv (i);
-        break;
-
-      case IX_qbM:
-        // Measurement Report - Quality
-#ifdef DEBUG_RRC_MEASURE_REPORT_MAIN
-        msg ("[RRC_MSG] RG prepares Measurement Report (Quality) at time : %d\n\n", time);
-#endif
-        rrc_rg_measure_q (i);
-        break;
-
-      case IX_ibsM:
-        // Measurement Report - internal UE
-#ifdef DEBUG_RRC_MEASURE_REPORT_MAIN
-        msg ("[RRC_MSG] RG prepares Measurement Report (Int BS) at time : %d\n\n", time);
-#endif
-        rrc_rg_measure_int_bs (i);
-        break;
-      }
-
-      // Print measurements
-#ifdef DEBUG_RRC_MEASURE_REPORT_MAIN
-      rrc_rg_print_bs_meas_report (&(protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[i]));
-#endif
-
-      // Send Measurement to RRM
-      rrc_rg_send_bs_meas_report (i);
-
-      // Prepare next measurement if needed
-      if (--protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[i].meas_counter) {
-        //set next measure in table
-        protocol_bs->rrc.rg_meas_blocks.rrc_rg_bs_meas_next[i] = time + protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[i].meas_interval;
-      } else {
-        // clean up measurement control blocks
-        protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[i].meas_start = 0;
-        protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[i].meas_counter = 0;
-        protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[i].meas_interval = 0;
-        memset (&(protocol_bs->rrc.rg_meas_blocks.bs_meas_cmd[i]), 0, sizeof (struct rrc_rg_bs_meas_cmd));
-        protocol_bs->rrc.rg_meas_blocks.rrc_rg_bs_meas_next[i] = 0;
-      }
-    }
-  }
-}
diff --git a/openair2/RRC/CELLULAR/rrc_rg_data.c b/openair2/RRC/CELLULAR/rrc_rg_data.c
deleted file mode 100755
index d427221c5b..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg_data.c
+++ /dev/null
@@ -1,455 +0,0 @@
-/***************************************************************************
-                          rrc_rg_data.c  -  description
-                             -------------------
-    begin                : May 29, 2002
-    copyright            : (C) 2002, 2010 by Eurecom
-    author               : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  This file contains the definition of the functions triggering the Esterel FSM
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_rg_vars.h"
-#include "rrc_messages.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_fsm.h"
-#include "rrc_proto_int.h"
-#include "rrc_proto_intf.h"
-//-----------------------------------------------------------------------------
-// #include "mac_rg_proto_extern.h"
-// #ifndef USER_MODE
-// #ifndef BYPASS_L1
-// #include "daq.h"
-// #include "L1L_extern.h"
-// #endif
-// #endif
-
-//-----------------------------------------------------------------------------
-void rrc_mt_list_init(void)
-{
-  //-----------------------------------------------------------------------------
-  int i,j;
-
-  for (i=0; i<maxUsers ; i++) {
-    protocol_bs->rrc.Mobile_List[i].mt_id= 999;
-    protocol_bs->rrc.Mobile_List[i].state= RRC_CELL_IDLE;
-    strcpy (protocol_bs->rrc.Mobile_List[i].IMEI, "01231234564569");
-    protocol_bs->rrc.Mobile_List[i].establishment_cause = 0;
-    protocol_bs->rrc.Mobile_List[i].release_cause = 0;
-    protocol_bs->rrc.Mobile_List[i].prot_error_indicator = 0;
-
-    //    strcpy (protocol_bs->rrc.Mobile_List[i].qos_classes, "987987654654987654987654321");
-    //    strcpy (protocol_bs->rrc.Mobile_List[i].dscp_codes, "321321987987321321987987654");
-    for (j=4; j<maxRB; j++)
-      protocol_bs->rrc.Mobile_List[i].rg_established_rbs[j].rb_identity = 99;
-  }
-
-  // Initialize other stuff in control block
-  protocol_bs->rrc.rrc_currently_updating = FALSE;
-  // Test - Second MT
-  //  protocol_bs->rrc.Mobile_List[0].mt_id= 0;
-  //
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][FSM-IN] Mobile List initialized \n\n");
-#endif
-}
-
-
-//-----------------------------------------------------------------------------
-void rrc_mt_list_print(int UE_Id)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  int j;
-  msg("\n\n[RRC_RG][FSM-IN] Mobile List print for mobile %d at time %d\n", UE_Id, protocol_bs->rrc.current_SFN);
-  msg("[RRC_RG][FSM-IN] Id %d, \t State %d, \t IMEI ,\n", //\t IMEI %s,
-      protocol_bs->rrc.Mobile_List[UE_Id].mt_id,
-      protocol_bs->rrc.Mobile_List[UE_Id].state);
-  //        protocol_bs->rrc.Mobile_List[UE_Id].IMEI);
-  rrc_print_buffer(protocol_bs->rrc.Mobile_List[UE_Id].IMEI,14);
-  msg("[RRC_RG][FSM-IN] conn_ref %d ,\t est_cause %d,\t rel_cause %d,\t prot_error_indicator %d.\n",
-      protocol_bs->rrc.Mobile_List[UE_Id].local_connection_ref,
-      protocol_bs->rrc.Mobile_List[UE_Id].establishment_cause,
-      protocol_bs->rrc.Mobile_List[UE_Id].release_cause,
-      protocol_bs->rrc.Mobile_List[UE_Id].prot_error_indicator);
-  msg("[RRC_RG][FSM-IN] %d Established Radio Bearers, Ids: ",protocol_bs->rrc.Mobile_List[UE_Id].num_rb);
-
-  for (j=4; j<maxRB; j++) {
-    if (protocol_bs->rrc.Mobile_List[UE_Id].rg_established_rbs[j].rb_started == RB_STARTED)
-      msg(" %d ", j );
-  }
-
-  msg("\n");
-#endif
-}
-
-//-----------------------------------------------------------------------------
-int get_new_UE_Id(IMEI* pIMEI)
-{
-  //-----------------------------------------------------------------------------
-  // Must check IMEI as well
-  int UE_Id;
-  int i, found=FAILURE;
-  i=0;
-
-  //  while ((strcmp(pIMEI->digit,protocol_bs->rrc.Mobile_List[i].IMEI))&&(i<maxUsers))
-  while ((memcmp((char *)pIMEI->digit,(char *)protocol_bs->rrc.Mobile_List[i].IMEI,14))&&(i<maxUsers))
-    i++;
-
-  if (i>=maxUsers) {
-    i=0;
-
-    while ((protocol_bs->rrc.Mobile_List[i].mt_id!= 999)&&(found==FAILURE)&&(i<maxUsers))
-      i++;
-  }
-
-  if (i<maxUsers) {
-    UE_Id = i;
-    protocol_bs->rrc.Mobile_List[i].mt_id=i;
-    protocol_bs->rrc.Mobile_List[i].u_rnti=i;
-#ifdef DEBUG_RRC_STATE
-    msg("\n[RRC_RG] New mobile is accepted, with Id: %d \n",UE_Id);
-#endif
-  } else {
-    UE_Id = 999;
-#ifdef DEBUG_RRC_STATE
-    msg("\n[RRC_RG] Radio Gateway overload, no more mobile can be accepted. \n");
-#endif
-  }
-
-  // End test
-  return UE_Id;
-}
-
-
-/* Initialization
- */
-//-----------------------------------------------------------------------------
-void rrc_rg_fsm_init(void)
-{
-  //-----------------------------------------------------------------------------
-  // execute reset
-  RRC_RG_reset();
-  RRC_RG();
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][FSM-IN] Radio Gateway initialized \n\n");
-#endif
-}
-
-/* Input trigger functions - to be called by RRC_RG_fsm_control() only */
-//NAS Events
-//-----------------------------------------------------------------------------
-void rrc_NAS_Conn_Cnf_Rx (int UE_Id, int status)
-{
-  //-----------------------------------------------------------------------------
-  // input signal NAS_CONN_ESTABLISHMENT_CNF
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][FSM-IN] Conn_Confirm message from NAS for mobile %d, \n \t\t with status %d \n",
-      UE_Id, status);
-#endif
-  RRC_RG_I_I_NAS_CONN_ESTAB_CNF(UE_Id);
-  RRC_RG_I_I_Status (status);
-  RRC_RG();
-}
-//-----------------------------------------------------------------------------
-void rrc_NAS_Conn_Cnf_RB_Rx (int UE_Id, int status, int RB_List)
-{
-  //-----------------------------------------------------------------------------
-  // input signal NAS_CONN_CNF
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][FSM-IN] Conn_Confirm message from NAS for mobile %d, \n \t\t with status %d \t\t RB_list %d \n",
-      UE_Id, status, RB_List);
-#endif
-  RRC_RG_I_I_NAS_CONN_ESTAB_CNF(UE_Id);
-  RRC_RG_I_I_Status (status);
-  RRC_RG_I_I_RB_List (RB_List);
-  RRC_RG();
-}
-//-----------------------------------------------------------------------------
-void rrc_NAS_Conn_Rel_Req_Rx (int UE_Id)
-{
-  //-----------------------------------------------------------------------------
-  // input signal NAS_CONN_RELEASE_REQ
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][FSM-IN] Conn_Release message from NAS for mobile %d \n", UE_Id);
-#endif
-  RRC_RG_I_I_NAS_CONN_RELEASE_REQ(UE_Id);
-  RRC_RG();
-}
-//-----------------------------------------------------------------------------
-void rrc_NAS_RB_Estab_Rx (int UE_Id, int RB_List)
-{
-  //-----------------------------------------------------------------------------
-  // input signal NAS_RB_ESTABLISHMENT_REQ
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][FSM-IN] Rb_establishment message from NAS for mobile %d, \n \t\t RB_list %d \n",
-      UE_Id, RB_List);
-#endif
-  RRC_RG_I_I_NAS_RB_ESTAB_REQ (UE_Id);
-  RRC_RG_I_I_RB_List (RB_List);
-  RRC_RG();
-}
-//-----------------------------------------------------------------------------
-void rrc_NAS_RB_Rel_Rx (int UE_Id, int RB_List)
-{
-  //-----------------------------------------------------------------------------
-  // send input signal NAS_RB_RELEASE_REQ
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][FSM-IN] Rb_Release message from NAS for mobile %d, \n \t\t RB_list %d \n",
-      UE_Id, RB_List);
-#endif
-  RRC_RG_I_I_NAS_RB_RELEASE_REQ (UE_Id);
-  RRC_RG_I_I_RB_List (RB_List);
-  RRC_RG();
-}
-// Messages received from UE
-//-----------------------------------------------------------------------------
-void rrc_UE_RRC_Conn_Req_rx (int UE_Id)
-{
-  //-----------------------------------------------------------------------------
-  // input signal RRC_Conn_Request
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][FSM-IN] Connection Request Received from UE with Id %d.\n",UE_Id);
-#endif
-  RRC_RG_I_I_RRC_CONNECTION_REQUEST(UE_Id);
-  RRC_RG();
-}
-//-----------------------------------------------------------------------------
-void rrc_UE_RRC_Conn_Setup_Compl_rx (int UE_Id)
-{
-  //-----------------------------------------------------------------------------
-  // input signal RRC_Conn_Setup_Complete
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][FSM-IN] Connection Setup Complete Received from UE with Id %d.\n",UE_Id);
-#endif
-  RRC_RG_I_I_RRC_CONN_SETUP_COMPLETE (UE_Id);
-  RRC_RG();
-  rrm_add_user_confirm(UE_Id);
-}
-//-----------------------------------------------------------------------------
-void rrc_UE_RRC_Conn_Release_rx (int UE_Id)
-{
-  //-----------------------------------------------------------------------------
-  // input signal RRC_Conn_Release
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][FSM-IN] Connection Release Request Received from UE with Id %d.\n",UE_Id);
-#endif
-  RRC_RG_I_I_RRC_CONNECTION_RELEASE(UE_Id);
-  RRC_RG();
-}
-//-----------------------------------------------------------------------------
-void rrc_UE_RRC_Conn_Rel_Complete_rx (int UE_Id)
-{
-  //-----------------------------------------------------------------------------
-  // input signal RRC_Conn_Rel_Complete
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][FSM-IN] Connection Release Complete Received from UE with Id %d.\n",UE_Id);
-#endif
-  RRC_RG_I_I_RRC_CONN_REL_COMPLETE (UE_Id);
-  RRC_RG();
-}
-//-----------------------------------------------------------------------------
-void rrc_UE_RB_Setup_Complete_rx (int UE_Id)
-{
-  //-----------------------------------------------------------------------------
-  // input signal RB_SETUP_COMPLETE
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][FSM-IN] RB Setup Complete Received from UE with Id %d.\n",UE_Id);
-#endif
-  RRC_RG_I_I_RB_SETUP_COMPLETE (UE_Id);
-  RRC_RG();
-  //      rrm_add_radio_access_bearer_confirm(UE_Id);
-}
-//-----------------------------------------------------------------------------
-void rrc_UE_RB_Setup_Failure_rx (int UE_Id)
-{
-  //-----------------------------------------------------------------------------
-  // input signal RB_SETUP_FAILURE
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][FSM-IN] RB Setup Failure Received from UE with Id %d.\n",UE_Id);
-#endif
-  RRC_RG_I_I_RB_SETUP_FAILURE (UE_Id);
-  RRC_RG();
-}
-//-----------------------------------------------------------------------------
-void rrc_UE_RB_Release_Complete_rx (int UE_Id)
-{
-  //-----------------------------------------------------------------------------
-  // input signal RB_RELEASE_COMPLETE
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][FSM-IN] RB Release Complete Received from UE with Id %d.\n",UE_Id);
-#endif
-  RRC_RG_I_I_RB_REL_COMPLETE (UE_Id);
-  RRC_RG();
-}
-//-----------------------------------------------------------------------------
-void rrc_UE_Last_RB_Release_Complete_rx (int UE_Id)
-{
-  //-----------------------------------------------------------------------------
-  // input signal RB_RELEASE_COMPLETE
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][FSM-IN] RB Release Complete Received from UE with Id %d.\n",UE_Id);
-#endif
-  RRC_RG_I_I_RB_REL_COMPLETE (UE_Id);
-  RRC_RG_I_I_Last_RB();
-  RRC_RG();
-}
-//-----------------------------------------------------------------------------
-void rrc_UE_RB_Release_Failure_rx (int UE_Id)
-{
-  //-----------------------------------------------------------------------------
-  // input signal RB_RELEASE_FAILURE
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][FSM-IN] RB Release Failure Received from UE with Id %d.\n",UE_Id);
-#endif
-  RRC_RG_I_I_RB_REL_FAILURE (UE_Id);
-  RRC_RG();
-}
-//-----------------------------------------------------------------------------
-void rrc_UE_Cell_Update_rx (int UE_Id)
-{
-  //-----------------------------------------------------------------------------
-  // input signal CELL_UPDATE
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][FSM-IN] Cell Update Received from UE with Id %d.\n",UE_Id);
-#endif
-  RRC_RG_I_I_CELL_UPDATE (UE_Id);
-  RRC_RG();
-}
-
-
-//-----------------------------------------------------------------------------
-void rrc_RG_PHY_Synch_rx (int UE_Id)
-{
-  //-----------------------------------------------------------------------------
-  // simulate PHY_Synch received (DCH established)
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][FSM-IN] PHY_Synch_Success Received for UE with Id %d.\n",UE_Id);
-#endif
-  RRC_RG_I_I_CPHY_SYNCH_IND (UE_Id);
-  RRC_RG();
-}
-//-----------------------------------------------------------------------------
-void rrc_RG_PHY_Synch_Failure_rx (int UE_Id)
-{
-  //-----------------------------------------------------------------------------
-  // simulate PHY_Failure received (DCH failed to established)
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][FSM-IN] PHY_Synch_Failure Received for UE with Id %d.\n",UE_Id);
-#endif
-  RRC_RG_I_I_CPHY_SYNCH_Failure (UE_Id);
-  RRC_RG();
-}
-//-----------------------------------------------------------------------------
-void rrc_RG_PHY_Out_Synch_rx (int UE_Id)
-{
-  //-----------------------------------------------------------------------------
-  // simulate PHY_Synch_Failure received on a DCH
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][FSM-IN] PHY_Out_Synch Received for UE with Id %d.\n",UE_Id);
-#endif
-  RRC_RG_I_I_CPHY_OUT_OF_SYNCH (UE_Id);
-  RRC_RG();
-}
-//-----------------------------------------------------------------------------
-void rrc_RG_PHY_Connection_Loss_rx (int UE_Id)
-{
-  //-----------------------------------------------------------------------------
-  // simulate PHY_Connection_Loss received
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][FSM-IN] PHY_Connection_Loss Received for UE with Id %d.\n",UE_Id);
-#endif
-  RRC_RG_I_I_CPHY_CONNECTION_LOSS (UE_Id);
-  RRC_RG();
-}
-//-----------------------------------------------------------------------------
-void rrc_RG_PHY_Setup_rx (int UE_Id)
-{
-  //-----------------------------------------------------------------------------
-  // simulate PHY_Setup_cnf received
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][FSM-IN] PHY_Setup_cnf Received for UE with Id %d.\n",UE_Id);
-#endif
-  RRC_RG_I_I_CPHY_RL_SETUP_Cnf (UE_Id);
-  RRC_RG();
-}
-//-----------------------------------------------------------------------------
-void rrc_RG_PHY_Modify_rx (int UE_Id)
-{
-  //-----------------------------------------------------------------------------
-  // simulate PHY_Modify_cnf received
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][FSM-IN] PHY_Modify_cnf Received for UE with Id %d.\n",UE_Id);
-#endif
-  RRC_RG_I_I_CPHY_RL_MODIFY_Cnf (UE_Id);
-  RRC_RG();
-}
-//-----------------------------------------------------------------------------
-void rrc_RG_RLC_Status_rx (int UE_Id)
-{
-  //-----------------------------------------------------------------------------
-  // simulate CRLC_Status_ind received
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][FSM-IN] CRLC_Status_ind Received for UE with Id %d.\n",UE_Id);
-#endif
-  RRC_RG_I_I_CRLC_STATUS (UE_Id);
-  RRC_RG();
-}
-
-//-----------------------------------------------------------------------------
-void rrc_RG_RLC_Data_Confirm_rx (int UE_Id)
-{
-  //-----------------------------------------------------------------------------
-  // simulate RLC_Data_Confirm received
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][FSM-IN] RLC_Data_Confirm Received for UE with Id %d.\n",UE_Id);
-#endif
-  RRC_RG_I_I_RLC_Success (UE_Id);
-  RRC_RG();
-}
-//-----------------------------------------------------------------------------
-void rrc_RG_RLC_Data_failure_rx (int UE_Id)
-{
-  //-----------------------------------------------------------------------------
-  // simulate RLC_Data_Failure received
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][FSM-IN] RLC_Data_Failure Received for UE with Id %d.\n",UE_Id);
-#endif
-  RRC_RG_I_I_RLC_Failure (UE_Id);
-  RRC_RG();
-}
-
-//-----------------------------------------------------------------------------
-void rrc_RG_Configuration_rx (void)
-{
-  //-----------------------------------------------------------------------------
-  // Configuration Indication received
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][FSM-IN] Configuration Indication Received from RRM.\n");
-#endif
-  RRC_RG_I_I_Configuration_Indication();
-  RRC_RG();
-}
-
-//-----------------------------------------------------------------------------
-void rrc_RG_Config_failure_rx (void)
-{
-  //-----------------------------------------------------------------------------
-  // Configuration Failure received
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][FSM-IN] Configuration Failure Received from RRM.\n");
-#endif
-  RRC_RG_I_I_Configuration_Failure();
-  RRC_RG();
-}
-
-
-
-
diff --git a/openair2/RRC/CELLULAR/rrc_rg_dummies.c b/openair2/RRC/CELLULAR/rrc_rg_dummies.c
deleted file mode 100755
index 5d8d76beb0..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg_dummies.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/***************************************************************************
-                          rrc_rg_dummies.c - description
-                          -------------------
-    begin               : April 2009
-    copyright           : (C) 2010 by Eurecom
-    created by    : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-      TEMP - This file contains dummy functions to be removed
- **************************************************************************/
-//#define RRC_DEBUG_DUMMIES
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_rg_vars.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_int.h"
-#include "rrc_proto_fsm.h"
-#include "rrc_proto_intf.h"
-#include "rrc_proto_bch.h"
-#include "rrc_proto_mbms.h"
-
-
-//void rc_uncompress_config (char *serialized_configP, int lengthP){
-void rrc_rrm_rcve_config (u8 *serialized_configP, int lengthP)
-{
-#ifdef RRC_DEBUG_DUMMIES
-  msg ("\n[RRC][RG-DUMMIES] DUMMY CALL to rrc_rrm_rcve_config\n");
-#endif
-}
-
-
-//-----------------------------------------------------------------------------
-// Temp reduced version - Keeps only RLC parameters
-//-----------------------------------------------------------------------------
-void rrc_compress_config (MT_CONFIG * config, char *dest_buffer, int *dest_length)
-{
-  //-----------------------------------------------------------------------------
-  int  i, j, k, el;
-  char *outbuf = dest_buffer;
-
-  //#ifdef DEBUG_LOAD_CONFIG
-  msg ("[RRC][CONFIG][COMPRESS] config size = %d -> %p\n", sizeof (MT_CONFIG), dest_buffer);
-  //#endif
-  *outbuf++ = config->nb_commands;
-
-  memcpy (outbuf, &config->rrm_commands[0], config->nb_commands * sizeof (RRM_COMMAND_MT));
-
-  outbuf += config->nb_commands * sizeof (RRM_COMMAND_MT);
-
-  for (i = 0; i < JRRM_MAX_COMMANDS_PER_TRANSACTION; i++) {
-    el = config->rrm_commands[i].rrm_element_index;
-
-    switch (config->rrm_commands[i].rrm_action) {
-    case ACTION_ADD:
-    case ACTION_MODIFY:
-      //#ifdef DEBUG_LOAD_CONFIG
-      msg ("[RRC][CONFIG][COMPRESS] Command %d : action %d element %d index %d\n", i, config->rrm_commands[i].rrm_action, config->rrm_commands[i].rrm_element, el);
-
-      //#endif
-      switch (config->rrm_commands[i].rrm_element) {
-        //-------------------------------------------
-      case SIGNALLING_RADIO_BEARER:
-      case RADIO_ACCESS_BEARER:
-        //-------------------------------------------
-        //#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][COMPRESS]  RB (%d)\n", (int) outbuf - (int) dest_buffer);
-        //#endif
-        memcpy (outbuf, (void *) &config->bearer[el], sizeof (RADIOBEARER));
-        outbuf += sizeof (RADIOBEARER);
-
-        /*                memcpy (outbuf, (void *) &config->bearer_ul[el], sizeof (RADIOBEARER));
-                        outbuf += sizeof (RADIOBEARER);*/
-        break;
-
-      default:
-        break;
-      }
-
-      break;
-
-      //-------------------------------------------
-    default:
-      //-------------------------------------------
-      break;
-    }
-
-  }
-
-  *dest_length = (int) outbuf - (int) dest_buffer;
-  msg ("[RRC][CONFIG][COMPRESS] : Compressed config length = %d end @ %p\n", *dest_length, outbuf);
-}
-
-
-//-------------------------------------------------------------------
-void rrc_uncompress_config (MT_CONFIG * config, char *source_buffer)
-{
-  //-------------------------------------------------------------------
-  //#ifdef RRC_DEBUG_DUMMIES
-  msg ("\n[RRC][RG-DUMMIES] DUMMY CALL to rrc_uncompress_config\n");
-  //#endif
-}
-
-/*
-//-------------------------------------------------------------------
-int rb_tx_data_srb_rg (u8 rb_idP, u8 * dataP, u32 length_in_bitsP, u32 muiP, u8 data_confirmP){
-  #ifdef RRC_DEBUG_DUMMIES
-  msg ("\n[RRC][RG-DUMMIES] DUMMY CALL to rb_tx_data_srb_rg\n");
-  #endif
-  return 0;
-}
-*/
-
diff --git a/openair2/RRC/CELLULAR/rrc_rg_entity.h b/openair2/RRC/CELLULAR/rrc_rg_entity.h
deleted file mode 100755
index a1e7dbfb38..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg_entity.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/***************************************************************************
-                          rrc_rg_entity.h  -
-                          -------------------
-    begin                : Someday 2001
-    copyright            : (C) 2001, 2010 by Eurecom
-    created by           : Lionel.Gauthier@eurecom.fr
-    modified by          : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Data structure with RRC RG protocol parameters
- ***************************************************************************/
-
-#ifndef __RRC_RG_ENTITY_H__
-#define __RRC_RG_ENTITY_H__
-//-----------------------------------------------------------------------------
-#include "rrc_platform_types.h"
-#include "rrc_constant.h"
-#include "rrc_rg_bch_variables.h"
-#include "rrc_rg_variables.h"
-#include "rrc_rg_rrm_variables.h"
-#include "rrc_rg_mbms_variables.h"
-#include "rrc_rg_L2_intf_variables.h"
-//-----------------------------------------------------------------------------
-#include "rrm_config_structs.h"
-// #include "rrc_rg_data.h"
-// #include "rrc_rg_rrm_intf.h"
-
-/******************************************************************************
-*                        Protocol variables                                   *
-******************************************************************************/
-struct rrc_rg_entity {
-  //-----------------------------------------------------------------------------
-  int current_SFN;
-
-  u8  protocol_state[maxUsers];
-  // Table to be changed into a list??
-  struct Mobile_Node Mobile_List[maxUsers];
-  u8  establishment_cause;  // For NAS - A Revoir
-  //  u8  release_cause;
-  u32 next_MUI;     // for RLC AM
-
-  //External missing components simulation (debug)
-  int simulator;
-  int sim_counter;
-
-  // platform configuration
-  RRM_VARS  saved_configuration;
-  int curr_transaction_id;
-  //rrc_md_qos_table md_qos_table;
-
-  int rrc_currently_updating; // RRC is updating rb configuration
-  int rrc_UE_updating;
-  int rrc_multicast_bearer;
-  u8  curr_config_action;
-  int curr_rb_failure_code;
-
-  // link to L1
-  int rrc_rg_pending_UE;
-  u8  rrc_rg_synch_ind;
-  u8  rrc_rg_cctrch_synch[maxCCTrCH_rg];
-  u8  rrc_rg_outsynch_ind;
-  u8  rrc_rg_cctrch_outsynch[maxCCTrCH_rg];
-  int rrc_rg_cctrch_crnti[maxCCTrCH_rg];
-
-  /* ** OAI compatible part - begin **/
-  // Control block for Broadcast asn1-compliant
-  struct rrc_rg_bch_asn1 rg_bch_asn1;
-
-  // Control block for srb-drb asn1-compliant
-  struct rrc_srb_drb_asn1 rg_rb_asn1;
-  int mod_id;
-  int ccch_current_UE_Id; //incremented each time a new UE sends ConnReq through CCH
-  /* ** OAI compatible part - end **/
-
-  // Control block for Broadcast
-  struct rrc_rg_bch_blocks rg_bch_blocks;
-  int rg_broadcast_counter;
-
-  // pointer to next message to transmit to NAS
-  //   this is actually the start of a linked list
-  mem_block_t  *NASMessageToXmit;
-  int ip_rx_irq;
-  // RG configuration
-  u16 rg_cell_id;
-  int num_cells;
-  char ccch_buffer[100];
-  int ccch_buffer_size;
-
-  // RG measures
-  struct rrc_rg_meas_blocks rg_meas_blocks;
-
-  // Control block for MBMS
-  struct rrc_rg_mbms_variables mbms;
-
-  // RT-fifo descriptors
-  int rrc_rg_GC_fifo;
-  int rrc_rg_NT_fifo;
-  int rrc_rg_DCIn_fifo[maxUsers];
-  int rrc_rg_DCOut_fifo[maxUsers];
-
-  // Control Block RRM interface
-  struct rrc_rg_rrm_variables rc_rrm;
-  //Added for Medieval demo 3 - MW
-  int eNB_measures_flag;
-  // hard-coded values for testing demo3 (set in main)
-  int conf_rlcBufferOccupancy[maxUsers];
-  int conf_scheduledPRB[maxUsers];
-  int conf_totalDataVolume[maxUsers];
-  // storage of last values measured
-  int num_connected_UEs;
-  int current_rlcBufferOccupancy[maxUsers];
-  int current_scheduledPRB[maxUsers];
-  int current_totalDataVolume[maxUsers];
-  int current_totalNumPRBs;
-};
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_rg_esterfsm.c b/openair2/RRC/CELLULAR/rrc_rg_esterfsm.c
deleted file mode 100755
index 5bc8facf54..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg_esterfsm.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/***************************************************************************
-                          rrc_rg_esterfsm.c  -  description
-                             -------------------
-    begin                : June 17, 2002
-    copyright            : (C) 2002, 2010 by Eurecom
-    author               : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  This file contains the definition of the functions called by Esterel FSM
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_rg_vars.h"
-#include "rrc_messages.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_fsm.h"
-//-----------------------------------------------------------------------------
-// #include "mac_rg_proto_extern.h"
-// #ifndef USER_MODE
-// #ifndef BYPASS_L1
-// #include "daq.h"
-// #include "L1L_extern.h"
-// #endif
-// #endif
-
-/* This function prepares and controls the FSM  thru the functions defined above */
-//-----------------------------------------------------------------------------
-void rrc_rg_fsm_control(int UE_Id, int rrc_event)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][FSM] RX EVENT: %d\n",rrc_event);
-#endif
-  protocol_bs->rrc.rrc_UE_updating = UE_Id ;
-
-  switch (rrc_event) {
-  case RRC_CONNECT_REQ :
-    rrc_UE_RRC_Conn_Req_rx (UE_Id);
-    break;
-
-  case RRC_CONNECT_LOSS :
-    rrc_RG_PHY_Connection_Loss_rx (UE_Id);
-    break;
-
-  case UE_PHY_SYNCH :
-    //rrc_RG_PHY_Synch_rx(UE_Id);
-    break;
-
-  case RRC_CONN_SETUP_COMP :
-    rrc_UE_RRC_Conn_Setup_Compl_rx (UE_Id);
-    rrc_mt_list_print(UE_Id);
-    break;
-
-    // case NAS_REL_REQ :
-    //   rrc_NAS_Conn_Rel_Req_Rx (UE_Id);
-    //   rrc_UE_RRC_Conn_Rel_Complete_rx (UE_Id);
-    //   rrc_mt_list_print(UE_Id);
-    //   break;
-  case RRC_CONNECT_RELUL :
-    rrc_UE_RRC_Conn_Release_rx(UE_Id);
-    rrc_mt_list_print(UE_Id);
-    break;
-
-  case UE_RB_SU_CMP :
-    // ++protocol_bs->rrc.Mobile_List[UE_Id].num_rb; //Temp
-    rrc_RG_PHY_Synch_rx (UE_Id);  //Temp
-    rrc_UE_RB_Setup_Complete_rx(UE_Id);
-    rrc_mt_list_print(UE_Id);
-    break;
-
-  case UE_RB_SU_FAIL :
-    rrc_RG_PHY_Synch_rx (UE_Id);  //Temp
-    rrc_UE_RB_Setup_Failure_rx(UE_Id);
-    rrc_mt_list_print(UE_Id);
-    break;
-
-  case UE_RB_REL_CMP :
-    rrc_UE_RB_Release_Complete_rx(UE_Id);
-    // or FFS: rrc_UE_Last_RB_Release_Complete_rx (UE_Id);
-    // --protocol_bs->rrc.Mobile_List[UE_Id].num_rb; //Temp
-    rrc_RG_PHY_Modify_rx (UE_Id);   //Temp
-    rrc_mt_list_print(UE_Id);
-    break;
-
-  case UE_RB_REL_FAIL :
-    rrc_UE_RB_Release_Failure_rx(UE_Id);
-    rrc_mt_list_print(UE_Id);
-    break;
-
-  case UE_CELLU :
-    rrc_UE_Cell_Update_rx (UE_Id);
-    rrc_mt_list_print(UE_Id);
-    break;
-
-  case NAS_CONN_CNF :
-    //Temp - No RB list provided at connection -
-    rrc_NAS_Conn_Cnf_RB_Rx (UE_Id,(int)(protocol_bs->rrc.establishment_cause), 0);
-    break;
-
-  case NAS_RB_ESTAB :
-    rrc_NAS_RB_Estab_Rx (UE_Id, protocol_bs->rrc.Mobile_List[UE_Id].requested_rbId);
-    rrc_RG_PHY_Setup_rx (UE_Id);
-    // rrc_RG_RLC_Data_Confirm_rx (UE_Id); Not needed
-    // rrc_RG_PHY_Synch_rx (UE_Id);  associated with config
-    // rrc_UE_RB_Setup_Complete_rx (UE_Id);
-    break;
-
-  case NAS_RB_RELEASE :
-    rrc_NAS_RB_Rel_Rx (UE_Id, protocol_bs->rrc.Mobile_List[UE_Id].requested_rbId);
-    // rrc_RG_RLC_Data_Confirm_rx (UE_Id); Not needed
-    // rrc_UE_RB_Release_Complete_rx (UE_Id);
-    // rrc_RG_PHY_Modify_rx (UE_Id);   associated with previous one
-    break;
-
-  case RG_RLC_SUCCESS :
-    rrc_RG_RLC_Data_Confirm_rx (UE_Id);
-    rrc_RG_PHY_Synch_rx (UE_Id);  //associated with config
-    break;
-
-  case RG_RLC_FAILURE :
-    //rrc_RG_RLC_Status_rx (UE_Id); Temp
-    rrc_RG_PHY_Connection_Loss_rx (UE_Id);
-    break;
-
-  case RG_CRLC_STATUS :
-    //rrc_RG_RLC_Status_rx (UE_Id);
-    rrc_RG_PHY_Connection_Loss_rx (UE_Id);
-    break;
-
-  case RRM_CFG :
-    rrc_RG_Configuration_rx ();
-    rrc_RG_PHY_Synch_rx (UE_Id);
-    rrc_RG_PHY_Setup_rx (UE_Id);
-    break;
-
-  case RRM_FAILURE :
-    rrc_RG_Config_failure_rx();
-    break;
-
-  case UE_CAP_INFO:
-    rrc_RG_UE_Cap_Info_rx(UE_Id);
-    break;
-
-  default :
-    msg("[RRC][FSM] Invalid call to RRC FSM control\n");
-    break;
-  }
-}
-
-
-
-
-
-
-
-
-
-
-
diff --git a/openair2/RRC/CELLULAR/rrc_rg_init.c b/openair2/RRC/CELLULAR/rrc_rg_init.c
deleted file mode 100755
index 69ef179297..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg_init.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/***************************************************************************
-                          rrc_rg_init.c
-                          -------------------
-    begin                : Someday 2008
-    copyright            : (C) 2010 by Eurecom
-    created by           : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Initialization of RRC protocol entity for Radio Gateway
- ***************************************************************************/
-/********************
-// OpenAir includes
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "COMMON/openair_defs.h"
-#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
-#include "LAYER2/RLC/rlc.h"
-#include "COMMON/mac_rrc_primitives.h"
-
-//#include "SIMULATION/simulation_defs.h"
-//extern EMULATION_VARS *Emul_vars;
-//extern CH_MAC_INST *CH_mac_inst;
-//extern UE_MAC_INST *UE_mac_inst;
-
-/********************
-// RRC includes
- ********************/
-#include "rrc_rg_vars.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_rrm.h"
-#include "rrc_proto_int.h"
-#include "rrc_L2_proto.h"
-//-----------------------------------------------------------------------------
-int *pt_nas_rg_irq;
-u16 *pt_rg_own_cell_id;
-#ifndef  USER_MODE
-EXPORT_SYMBOL(pt_nas_rg_irq);
-EXPORT_SYMBOL(pt_rg_own_cell_id);
-#endif
-LCHAN_DESC BCCH_LCHAN_DESC,CCCH_LCHAN_DESC,DCCH_LCHAN_DESC,DTCH_DL_LCHAN_DESC,DTCH_UL_LCHAN_DESC;
-rlc_info_t Rlc_info_um;
-rlc_info_t Rlc_info_am_config;
-
-//-----------------------------------------------------------------------------
-void rrc_rg_init (u8 Mod_id)
-{
-  //-----------------------------------------------------------------------------
-  int user;
-  int ix;
-
-#ifdef DEBUG_RRC_STATE
-  printk("\n\n***********************************************\n");
-  printk("**************[RRC CELL][RG-INIT]**************\n");
-  printk("***********************************************\n");
-#endif
-  printk("[RRC CELL][RG-INIT] Init BS function start\n");
-
-  // Initialize the control block for variables
-  pool_buffer_init();
-  protocol_bs = &prot_pool_bs;
-  memset ((char *)protocol_bs, 0, sizeof (struct protocol_pool_bs));
-
-  rrm_config = &rrc_as_config;
-  memset ((char *)rrm_config, 0, sizeof (RRM_VARS));
-
-
-  for (user = 0; user < maxUsers; user++) {
-    protocol_bs->rrc.protocol_state[user] = RRC_RG_IDLE;
-  }
-
-#ifdef USER_MODE
-  protocol_bs->rrc.rg_cell_id = 1;
-#else
-  protocol_bs->rrc.rg_cell_id = 5;      // Temp
-#endif
-  protocol_bs->rrc.mod_id =0;
-  protocol_bs->rrc.ccch_current_UE_Id = -1;
-
-  // initialise NAS global variables
-  pt_nas_rg_irq = &(protocol_bs->rrc.ip_rx_irq);
-  pt_rg_own_cell_id = &(protocol_bs->rrc.rg_cell_id);
-
-  //rrc_rg_rrm_connected_init(); // Transferred to rrc_rg_rrm_process.c
-
-  // set hard-coded values for congestion measurement
-  for (ix=0; ix<maxUsers; ix++) {
-    protocol_bs->rrc.conf_rlcBufferOccupancy[ix] = 60 - (30*ix);
-    protocol_bs->rrc.conf_scheduledPRB[ix] = 500 - (200*ix);
-    protocol_bs->rrc.conf_totalDataVolume[ix] = 640000 + (160000*ix);
-  }
-
-  // Next is TEMP - Will be removed when RRM interface has dynamic MAC config
-  rrc_init_mac_config();
-
-#ifdef USER_MODE
-#ifdef RRC_NETLINK
-  rrc_rg_netlink_init ();  // init RRC netlink socket
-#else
-  rrc_rg_sap_init ();      // init FIFOs towards NAS
-#endif
-  rrc_rg_rrm_sap_init ();  // init FIFOs towards RRM
-#endif
-  // init function pointers for RRM interface
-  //init_rrc_handler();
-#ifdef DEBUG_RRC_DETAILS
-  //rrc_rg_init_check_qos_classes();
-#endif
-
-  printk("\n[RRC CELL][RG-INIT] cell_id %d\n",protocol_bs->rrc.rg_cell_id );
-  printk("[RRC CELL][RG-INIT] Init RG function completed\n");
-  printk("***********************************************\n\n\n");
-
-}
-
-//-----------------------------------------------------------------------------
-// This funstion sompletes the init once the RRC is connected to the RRM
-void rrc_rg_rrm_connected_init (void)
-{
-  //-----------------------------------------------------------------------------
-  //int  i;
-
-  //struct rrc_rrm_measure_ctl rrm_control;
-
-  msg ("\n[RRC-RRM-INTF] begin rrc_rg_rrm_connected_init\n");
-
-  rrc_rg_fsm_init ();
-  rrc_mt_list_init ();
-  rrc_rg_init_bch ();
-  rrc_init_blocks (); //prepares SIBs for broadcast
-
-  /* TEMP Next lines have been transferred to rrc_rg_config_LTE_srb2 in L2_frontend
-  // because MCCH is using srb2
-  //Initialise MBMS
-  rrc_rg_mbms_init();
-  */
-
-  //rrc_rg_init_mac (0);
-
-  /*  rrm_config_indication = 0; */
-}
-
-
diff --git a/openair2/RRC/CELLULAR/rrc_rg_main.c b/openair2/RRC/CELLULAR/rrc_rg_main.c
deleted file mode 100755
index 4a33cf301a..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg_main.c
+++ /dev/null
@@ -1,169 +0,0 @@
-/***************************************************************************
-                          rrc_rg_main.c  -
-                          -------------------
-    begin                : Tue Jan 15 2002
-    copyright            : (C) 2002, 2010 by Eurecom
-    created by           : michelle.wetterwald@eurecom.fr
- **************************************************************************
-  This file contains the main function of the RRC module
- ***************************************************************************/
-/********************
-// OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_rg_vars.h"
-
-//#include "rrc_sap.h"
-//#include "rrc_messages.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_int.h"
-//#include "rrc_proto_intf.h"
-#include "rrc_proto_bch.h"
-#include "rrc_proto_mbms.h"
-#include "rrc_proto_rrm.h"
-
-//#include "umts_timer_proto_extern.h"
-
-//-----------------------------------------------------------------------------
-// entry point for RRC-RG process
-//void rrc_rg_main_scheduler (u8 Mod_id){
-int rrc_rg_main_scheduler(u8 Mod_id,u32 frame, u8 eNB_flag,u8 index)
-{
-  //-----------------------------------------------------------------------------
-  mem_block_t *p;
-  int i;
-#ifdef TEST_MEDIEVAL_DEMO3
-  int ix;
-#endif
-
-  //protocol_bs->rrc.current_SFN = frame;
-  //  if (protocol_bs->rrc.current_SFN % 50 == 0) {
-#ifdef DEBUG_RRC_DETAILS
-
-  if (protocol_bs->rrc.current_SFN % 50 == 0) {
-    msg ("\n\n[RRC][MSG_TEST] System Time : %d\n", protocol_bs->rrc.current_SFN);
-  }
-
-#endif
-
-  // check RRM interface is connected - otherwise, wait for connection
-  if (rrc_rrm_main_proc() == RRC_CONNECTED_TO_RRM) {
-    /*  }else{
-      }
-     */     //msg ("\n\n[RRC][TIME_TEST] System Time : %d, RRC Time : %d\n", Mac_rlc_xface->frame, protocol_bs->rrc.current_SFN);
-
-#ifdef ALLOW_MBMS_PROTOCOL
-    //ATTENTION: This must be the first event of RRC process.
-#ifdef DEBUG_RRC_MBMS_SFN
-    //msg("[RRC][DEBUG_RRC_MBMS_SFN] 1 - ACTIVITY   frame %d\n",Mac_rlc_xface->frame);
-#endif
-    if (p_rg_mbms) // only if MBMS initialized
-      rrc_rg_mbms_scheduling_check();
-
-    //rrc_rg_mbms_scenario_check();
-#endif
-
-    // check L1
-    rrc_rg_L1_check ();
-
-    // check if there is some message to transmit to NAS and do it (one at a time)
-    if ((p = protocol_bs->rrc.NASMessageToXmit) != NULL) {
-      rrc_rg_write_FIFO (p);
-    } else {
-      if ((protocol_bs->rrc.eNB_measures_flag == 1) && (protocol_bs->rrc.rg_broadcast_counter % 500 == 2)) {
-        RRC_RG_O_NAS_ENB_MEASUREMENT_IND ();
-        rrc_rg_write_FIFO (protocol_bs->rrc.NASMessageToXmit);
-      }
-    }
-
-    //#define TEST_MEDIEVAL_DEMO3
-#ifdef TEST_MEDIEVAL_DEMO3
-
-    if (protocol_bs->rrc.current_SFN >= 16000) {
-      for (ix=0; ix<maxUsers; ix++) {
-        protocol_bs->rrc.conf_rlcBufferOccupancy[ix] = 60 - (30*ix);
-        protocol_bs->rrc.conf_scheduledPRB[ix] = 500 - (200*ix);
-        protocol_bs->rrc.conf_totalDataVolume[ix] = 640000 + (160000*ix);
-      }
-    } else if ((protocol_bs->rrc.current_SFN > 8000)&& (protocol_bs->rrc.current_SFN < 16000)) {
-      for (ix=0; ix<maxUsers; ix++) {
-        protocol_bs->rrc.conf_rlcBufferOccupancy[ix] = 100 - (30*ix);
-        protocol_bs->rrc.conf_scheduledPRB[ix] = 300 + (200*ix);
-        protocol_bs->rrc.conf_totalDataVolume[ix] = 480000 + (160000*ix);
-      }
-    }
-
-#endif
-
-    // Check time-out for SIB14
-    // Temp - 256 = Exp time factor (8) * SIB14_Rep (32)
-    if (protocol_bs->rrc.rg_broadcast_counter % (protocol_bs->rrc.rg_bch_blocks.SIB14_timeout) == 2) {
-      rrc_fill_sib14 ();
-      rrc_init_sib14 ();
-    }
-
-    // modulo to improve stability
-    protocol_bs->rrc.rg_broadcast_counter = (protocol_bs->rrc.rg_broadcast_counter++) % 1000000000;
-
-    // Read any message in FIFOs from NAS
-    rrc_rg_read_FIFO();
-
-    // Read any message in DC FIFO -- To be improved: read only used FIFOs
-    for (i = 0; i < maxUsers; i++) {
-      //rrc_rg_read_DCin_FIFO (i);
-      // Check Timeout on Conn_Setup_Complete
-      if (protocol_bs->rrc.Mobile_List[i].conn_complete_timer)
-        rrc_rg_temp_checkConnection(i);
-    }
-
-    // Read any message in GC FIFO
-    //rrc_rg_read_GC_FIFO ();
-    // Read any message in NT FIFO
-    //rrc_rg_read_NT_FIFO ();
-
-    // Measurements
-    //i = rrc_rg_meas_loop();  // for test only
-    //check if report of measure needed in RG
-    if (protocol_bs->rrc.current_SFN % 800 == 0) {
-#ifdef DEBUG_RRC_DETAILS
-      msg ("\n[RRC_MEAS] System Measurement Time : %d\n", protocol_bs->rrc.current_SFN);
-#endif
-    }
-
-    if (protocol_bs->rrc.current_SFN > 0)
-      rrc_rg_sync_measures (protocol_bs->rrc.current_SFN);
-
-    //
-#ifdef ALLOW_MBMS_PROTOCOL
-
-    if (p_rg_mbms) { // only if MBMS initialized
-      rrc_rg_mbms_MCCH_tx();
-      // ATTENTION: This must be the last line of RRC process
-      rrc_rg_mbms_end_modification_period_check();
-    }
-
-#endif
-
-    //TEST RLC communication
-    //rrc_rg_test_lchannels();
-
-    // TODO TO BE REMOVED TEMP -- stop the loop
-    //if (protocol_bs->rrc.current_SFN > 10000){
-    // msg ("\n\n[RRC][MSG_TEST] Stop at System Time : %d\n", protocol_bs->rrc.current_SFN);
-    //exit(1);
-    // }
-
-#ifdef USER_MODE
-    fflush(stdout);
-#endif
-
-  }
-
-  return 0;
-}
-
diff --git a/openair2/RRC/CELLULAR/rrc_rg_mbms_encode.c b/openair2/RRC/CELLULAR/rrc_rg_mbms_encode.c
deleted file mode 100755
index 54162691f4..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg_mbms_encode.c
+++ /dev/null
@@ -1,375 +0,0 @@
-/***************************************************************************
-                          rrc_rg_mbms_encode.c - description
-                          -------------------
-    begin               : May 30, 2005
-    copyright           : (C) 2005, 2010 by Eurecom
-    created by    : Huu-Nghia.Nguyen@eurecom.fr
-    modified by         : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-    Encodes messages to be sent on MBMS
- **************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_rg_vars.h"
-#include "rrc_mbms_pdus.h"
-#include "rrc_msg_class.h"
-#include "rrc_rg_mbms_variables.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_mbms.h"
-
-/**
- * @brief Prepare the buffer of p_rg_mbms->curr_Message for encoding,
- * the buffer's content is filled by zero
- * @return the pointer of the buffer's content.
- * @date Jun 28, 2005 11:14:16 AM
- */
-//-----------------------------------------------------------------------------
-char * rrc_rg_mbms_buffer_prepare(int msglen)
-{
-  //-----------------------------------------------------------------------------
-  p_rg_mbms->curr_Message.msg_length = msglen;
-  memset (p_rg_mbms->curr_Message.msg_ptr, 0, msglen);
-  return p_rg_mbms->curr_Message.msg_ptr;
-}
-
-/**
- * @brief Validate the encoded content.
- * @date Jun 28, 2005 11:46:42 AM
- */
-//-----------------------------------------------------------------------------
-mbms_bool rrc_rg_mbms_buffer_validate(int status)
-{
-  //-----------------------------------------------------------------------------
-  if (status != P_SUCCESS)
-    p_rg_mbms->curr_Message.msg_length = 0;
-
-  return (status == P_SUCCESS);
-}
-
-/**
- * @brief create a MCCH message containing a MBMSAccessInformation  pdu.
- * The result is stored in the p_rg_mbms->curr_Message
- * @date May 20, 2005 3:26:37 PM
- * @see rrc_PEREnc_MBMSAccessInformation()
- */
-//-----------------------------------------------------------------------------
-void rrc_rg_mbms_MCCH_accessInfo(void)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  int msglen = MCCH_MSG_HEAD_LGTH + sizeof(MBMSAccessInformation);
-  MCCH_Message * mcch_msg_ptr ;
-
-  //Initialisation & Encode
-  mcch_msg_ptr = (MCCH_Message*) rrc_rg_mbms_buffer_prepare(msglen);
-  mcch_msg_ptr->message.type = MCCH_mbmsAccessInformation;
-  status = rrc_PEREnc_MBMSAccessInformation((MBMSAccessInformation*) &mcch_msg_ptr->message.content);
-  rrc_rg_mbms_buffer_validate(status);
-}
-
-/**
- * @brief create a MCCH message containing a MBMSCommonPTMRBInformation pdu.
- * The result is stored in the p_rg_mbms->curr_Message
- * @date May 20, 2005
- */
-//-----------------------------------------------------------------------------
-void rrc_rg_mbms_MCCH_commonRBInfo(void)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  int msglen = MCCH_MSG_HEAD_LGTH + sizeof(MBMSCommonPTMRBInformation);
-  MCCH_Message * mcch_msg_ptr;
-
-  //Initialisation & Encode
-  mcch_msg_ptr = (MCCH_Message *) rrc_rg_mbms_buffer_prepare(msglen);
-  mcch_msg_ptr->message.type = MCCH_mbmsCommonPTMRBInformation;
-  status = rrc_PEREnc_MBMSCommonPTMRBInformation((MBMSCommonPTMRBInformation*) &mcch_msg_ptr->message.content);
-
-  //Validate the result
-  rrc_rg_mbms_buffer_validate(status);
-}
-
-/**
- * @brief create a MCCH message containing a MBMSCurrentCellPTMRBInformation pdu.
- * The result is stored in the p_rg_mbms->curr_Message
- * @date May 20, 2005
- */
-//-----------------------------------------------------------------------------
-void rrc_rg_mbms_MCCH_currentCellRBInfo(void)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  int msglen = MCCH_MSG_HEAD_LGTH + sizeof(MBMSCurrentCellPTMRBInformation);
-  MCCH_Message * mcch_msg_ptr;
-
-  //Initialisation & Encode
-  mcch_msg_ptr = (MCCH_Message*) rrc_rg_mbms_buffer_prepare(msglen);
-  mcch_msg_ptr->message.type = MCCH_mbmsCurrentCellPTMRBInformation;
-  status = rrc_PEREnc_MBMSCurrentCellPTMRBInformation((MBMSCurrentCellPTMRBInformation*) &mcch_msg_ptr->message.content);
-
-  //Validate the result
-  rrc_rg_mbms_buffer_validate(status);
-}
-
-/**
- * @brief create a MCCH message containing a MBMSModifiedServicesInformation pdu.
- * The result is stored in the p_rg_mbms->curr_Message
- * @date May 20, 2005
- */
-//-----------------------------------------------------------------------------
-void rrc_rg_mbms_MCCH_modifservInfo(void)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  int msglen = MCCH_MSG_HEAD_LGTH + sizeof(MBMSModifiedServicesInformation);
-  MCCH_Message * mcch_msg_ptr;
-
-  //Initialisation & Encode
-  mcch_msg_ptr = (MCCH_Message*) rrc_rg_mbms_buffer_prepare(msglen);
-  mcch_msg_ptr->message.type = MCCH_mbmsModifiedServicesInformation;
-  status = rrc_PEREnc_MBMSModifiedServicesInformation((MBMSModifiedServicesInformation*) &mcch_msg_ptr->message.content);
-
-  //Validate the result
-  rrc_rg_mbms_buffer_validate(status);
-}
-
-
-
-/**
- * @brief create a DCCH message containing a MBMSModifiedServicesInformation pdu.
- * The result is stored in the p_rg_mbms->curr_Message
- * @date May 20, 2005
- */
-//-----------------------------------------------------------------------------
-void rrc_rg_mbms_DCCH_modifservInfo(void)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  int msglen = MSG_HEAD_LGTH + sizeof(MBMSModifiedServicesInformation);
-  DL_DCCH_Message * dl_dcch_msg_ptr;
-
-  //Initialisation & Encode
-  dl_dcch_msg_ptr = (DL_DCCH_Message*) rrc_rg_mbms_buffer_prepare(msglen);
-  dl_dcch_msg_ptr->message.type = DL_DCCH_mbmsModifiedServicesInformation;
-  dl_dcch_msg_ptr->integrityCheckInfo = 123;
-  status = rrc_PEREnc_MBMSModifiedServicesInformation((MBMSModifiedServicesInformation*) &dl_dcch_msg_ptr->message.content);
-
-  //Validate the result
-  rrc_rg_mbms_buffer_validate(status);
-}
-
-
-/**
- * @brief create a MCCH message containing a MBMSGeneralInformation pdu.
- * The result is stored in the p_rg_mbms->curr_Message
- * @date May 20, 2005
- */
-//-----------------------------------------------------------------------------
-void rrc_rg_mbms_MCCH_generalInfo(void)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  int msglen = MSG_HEAD_LGTH + sizeof(MBMSGeneralInformation);
-  MCCH_Message * mcch_msg_ptr;
-
-  //Initialisation & Encode
-  mcch_msg_ptr = (MCCH_Message*) rrc_rg_mbms_buffer_prepare(msglen);
-  mcch_msg_ptr->message.type = MCCH_mbmsGeneralInformation;
-  status = rrc_PEREnc_MBMSGeneralInformation((MBMSGeneralInformation*) &mcch_msg_ptr->message.content);
-
-  //Validate the result
-  rrc_rg_mbms_buffer_validate(status);
-}
-
-
-/**
- * @brief create a MCCH message containing a MBMSNeighbouringCellPTMRBInformation pdu.
- * The result is stored in the p_rg_mbms->curr_Message
- * @date May 20, 2005
- */
-//-----------------------------------------------------------------------------
-void rrc_rg_mbms_MCCH_neighbouringCellRBInfo(int cellIndex)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  int msglen = MCCH_MSG_HEAD_LGTH + sizeof(MBMSNeighbouringCellPTMRBInformation);
-  MCCH_Message * mcch_msg_ptr;
-
-  //Initialisation & Encode
-  mcch_msg_ptr = (MCCH_Message*) rrc_rg_mbms_buffer_prepare(msglen);
-  mcch_msg_ptr->message.type = MCCH_mbmsNeighbouringCellPTMRBInformation;
-  status = rrc_PEREnc_MBMSNeighbouringCellPTMRBInformation(cellIndex, (MBMSNeighbouringCellPTMRBInformation*) &mcch_msg_ptr->message.content);
-
-  //Validate the result
-  rrc_rg_mbms_buffer_validate(status);
-}
-
-/**
- * @brief create a MSCH message containing a MBMSSchedulingInformation pdu.
- * The result is stored in the p_rg_mbms->curr_Message
- * @date May 20, 2005
- */
-//-----------------------------------------------------------------------------
-void rrc_rg_mbms_MSCH_schedulingInfo(void)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  int msglen = MSG_HEAD_LGTH + sizeof(MBMSSchedulingInformation);
-  MSCH_Message * msch_msg_ptr;
-
-  //Initialisation & Encode
-  msch_msg_ptr = (MSCH_Message*) rrc_rg_mbms_buffer_prepare(msglen);
-  msch_msg_ptr->message.type = MSCH_mbmsSchedulingInformation;
-  status = rrc_PEREnc_MBMSSchedulingInformation((MBMSSchedulingInformation*) &msch_msg_ptr->message.content);
-
-  //Validate the result
-  rrc_rg_mbms_buffer_validate(status);
-}
-
-/**
- * @brief create a MCCH message containing a MBMSUnmodifiedServicesInformation pdu.
- * The result is stored in the p_rg_mbms->curr_Message
- * @date May 20, 2005
- */
-//-----------------------------------------------------------------------------
-void rrc_rg_mbms_MCCH_unmodifServInfo(void)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  int msglen = MCCH_MSG_HEAD_LGTH + sizeof(MBMSUnmodifiedServicesInformation);
-  MCCH_Message * mcch_msg_ptr;
-
-  //Initialisation & Encode
-  mcch_msg_ptr = (MCCH_Message*) rrc_rg_mbms_buffer_prepare(msglen);
-  mcch_msg_ptr->message.type = MCCH_mbmsUnmodifiedServicesInformation;
-  status = rrc_PEREnc_MBMSUnmodifiedServicesInformation((MBMSUnmodifiedServicesInformation*) &mcch_msg_ptr->message.content);
-
-  //Validate the result
-  rrc_rg_mbms_buffer_validate(status);
-}
-
-/**
- * @brief used to create/encode the message MCCH whose type is specified.
- * Result is stored in protocol_bs->rrc.mbms.curr_Message
- * @date May 19, 2005 5:18:20 PM
- * @param msgtype: determine the type of MBMS MCCH Message = MCCH_mbmsAccessInformation, MCCH_mbmsCommonPTMRBInformation, ...
- */
-//-----------------------------------------------------------------------------
-void rrc_rg_mbms_MCCH_encode(int msgtype)
-{
-  //-----------------------------------------------------------------------------
-  switch (msgtype) {
-  case MCCH_mbmsAccessInformation:
-#ifdef DEBUG_RRC_MBMS
-    msg("[RRC-RG][MBMS] Procedure rrc_rg_mbms_MCCH_encode is now creating the message AccessInformation\n");
-#endif
-    rrc_rg_mbms_MCCH_accessInfo();
-    break;
-
-  case MCCH_mbmsCommonPTMRBInformation:
-#ifdef DEBUG_RRC_MBMS_BASIC
-    msg("[RRC-RG][MBMS] Procedure rrc_rg_mbms_MCCH_encode is now creating the message CommonPTMRBInformation\n");
-#endif
-    rrc_rg_mbms_MCCH_commonRBInfo();
-    break;
-
-  case MCCH_mbmsCurrentCellPTMRBInformation:
-#ifdef DEBUG_RRC_MBMS_BASIC
-    msg("[RRC-RG][MBMS] Procedure rrc_rg_mbms_MCCH_encode is now creating the message CurrentCellPTMRBInformation\n");
-#endif
-    rrc_rg_mbms_MCCH_currentCellRBInfo();
-    break;
-
-  case MCCH_mbmsGeneralInformation:
-#ifdef DEBUG_RRC_MBMS_BASIC
-    msg("[RRC-RG][MBMS] Procedure rrc_rg_mbms_MCCH_encode is now creating the message GeneralInformation\n");
-#endif
-    rrc_rg_mbms_MCCH_generalInfo();
-    break;
-
-  case MCCH_mbmsModifiedServicesInformation:
-#ifdef DEBUG_RRC_MBMS_BASIC
-    msg("[RRC-RG][MBMS] Procedure rrc_rg_mbms_MCCH_encode is now creating the message ModifiedServicesInformation\n");
-#endif
-    rrc_rg_mbms_MCCH_modifservInfo();
-    break;
-
-  case MCCH_mbmsNeighbouringCellPTMRBInformation:
-#ifdef DEBUG_RRC_MBMS
-    msg("[RRC-RG][MBMS] Procedure rrc_rg_mbms_MCCH_encode is now creating the message NeighbouringCellPTMRBInformation\n");
-#endif
-    rrc_rg_mbms_MCCH_neighbouringCellRBInfo(p_rg_mbms->neighb_index);
-    break;
-
-  case MCCH_mbmsUnmodifiedServicesInformation:
-#ifdef DEBUG_RRC_MBMS_BASIC
-    msg("[RRC-RG][MBMS] Procedure rrc_rg_mbms_MCCH_encode is now creating the message UnmodifiedServicesInformation\n");
-#endif
-    rrc_rg_mbms_MCCH_unmodifServInfo();
-    break;
-
-  default:
-    //nothing to do
-    msg("[RRC-RG][MBMS] rrc_rg_mbms_MCCH_encode : unrecognized message type \n");
-    break;
-  }
-}
-
-/**
- *
- * @brief This function is used to create/encode the message
- * MBMSModifiedServicesInformation on DCCH
- * @date May 30, 2005 12:00:14 AM
- * @param msgtype: the type must be  DL_DCCH_mbmsModifiedServicesInformation
- */
-//-----------------------------------------------------------------------------
-void rrc_rg_mbms_DCCH_encode(int msgtype)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_MBMS_BASIC
-  msg("[RRC-RG][MBMS] Procedure rrc_rg_mbms_DCCH_encode is now creating the message MBMSModifiedServicesInformation \n");
-#endif
-
-  switch (msgtype) {
-  case DL_DCCH_mbmsModifiedServicesInformation:
-    rrc_rg_mbms_DCCH_modifservInfo();
-    break;
-
-  default:
-    //nothing to do, should never happen
-    msg("[RRC-RG][MBMS] rrc_rg_mbms_DCCH_encode : unrecognized message type \n");
-    break;
-  }
-}
-
-/**
- * @brief This function is used to create/encode the messages on MSCH
- * @date May 30, 2005 3:47:33 PM
- */
-//-----------------------------------------------------------------------------
-void rrc_rg_mbms_MSCH_encode(int msgtype)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_MBMS
-  msg("[RRC-RG][MBMS] Procedure rrc_rg_mbms_MSCH_encode is now creating the message MBMSSchedulingInformation\n");
-#endif
-
-  switch (msgtype) {
-  case MSCH_mbmsSchedulingInformation:
-    rrc_rg_mbms_MSCH_schedulingInfo();
-    break;
-
-  default:
-    //nothing to do, should never happen
-    msg("[RRC-RG][MBMS] rrc_rg_mbms_MSCH_encode : unrecognized message type \n");
-    break;
-  }
-}
-
diff --git a/openair2/RRC/CELLULAR/rrc_rg_mbms_nas_if.c b/openair2/RRC/CELLULAR/rrc_rg_mbms_nas_if.c
deleted file mode 100755
index 25231eb8f8..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg_mbms_nas_if.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/***************************************************************************
-                          rrc_rg_mbms_nas_if.c - description
-                          -------------------
-    begin               : Jul 8, 2005
-    copyright           : (C) 2005, 2010 by Eurecom
-    created by    : Huu-Nghia.Nguyen@eurecom.fr
-    modified by         : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-      This file contains the MBMS functions used to interface the NAS
- **************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_rg_vars.h"
-#include "rrc_mbms_pdus.h"
-#include "rrc_msg_class.h"
-#include "rrc_rg_mbms_variables.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_mbms.h"
-
-/**
- * @brief Called to handle the NAS primitive MBMS_BEARER_ESTABLISH_REQ
- * @date Jul 8, 2005 10:27:33 AM
- */
-//-----------------------------------------------------------------------------
-void rrc_rg_mbms_NAS_ServStart_rx(void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef ALLOW_MBMS_PROTOCOL
-#ifdef DEBUG_RRC_STATE
-  msg("\033[0;31m[RRC-RG][MBMS][IF] Processing MBMS_BEARER_ESTABLISH_REQ (service id = %d, ....)  at frame %d \033[0m\n",
-      p_rg_mbms->nas_serviceId, protocol_bs->rrc.current_SFN);
-#endif
-
-  //We process this primitive if it doesn't started before
-  if (rrc_mbms_service_id_find(p_rg_mbms->buff_mod_numService, &p_rg_mbms->buff_mod_serviceIdentity, p_rg_mbms->nas_serviceId) < 0
-      && rrc_mbms_service_id_find(p_rg_mbms->umod_numService, &p_rg_mbms->umod_serviceIdentity, p_rg_mbms->nas_serviceId) < 0) {
-    // MW : in integration mode, it is done on positive answer from RRM
-#ifdef MBMS_TEST_MODE
-    msg("[RRC-RG][MBMS] Activate Service - MBMS_TEST_MODE\n");
-    //Update the content for Notification and Unmodif message, set the flags if having changes
-    p_rg_mbms->flags.modifiedServicesInformation |= rrc_rg_mbms_addModifService(-1, p_rg_mbms->nas_serviceId, Mod_acquirePTM_RBInfo);
-    // increment the number of active services in the RG (TEMP Max =1)
-    p_rg_mbms->mbms_num_active_service ++;
-#endif
-    //Get RB Information from RRM...
-    p_rg_mbms->ptm_requested_action = E_ADD_RB;
-    RRC_RG_MBMS_O_GET_RB_INFORMATION(E_ADD_RB);
-  }
-
-#endif
-}
-
-/**
- * @brief Called to handle the NAS primitive MBMS_BEARER_RELEASE_REQ
- * @date Jul 8, 2005 10:27:59 AM
- */
-//-----------------------------------------------------------------------------
-void rrc_rg_mbms_NAS_ServStop_rx(void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef ALLOW_MBMS_PROTOCOL
-  int index;
-
-#ifdef DEBUG_RRC_STATE
-  msg("\033[0;31m[RRC-RG][MBMS][IF] Processing MBMS_BEARER_RELEASE_REQ (service id = %d, ....) at frame %d \033[0m\n",
-      p_rg_mbms->nas_serviceId, protocol_bs->rrc.current_SFN);
-#endif
-
-  //Update the content for Notification and Unmodif message, set the flags if having changes
-  index = rrc_mbms_service_id_find(p_rg_mbms->buff_mod_numService, &p_rg_mbms->buff_mod_serviceIdentity, p_rg_mbms->nas_serviceId);
-#ifdef DEBUG_RRC_MBMS
-  msg("[RRC-RG][MBMS][IF] index returned %d for Modif services\n", index);
-#endif
-  p_rg_mbms->flags.modifiedServicesInformation |= rrc_rg_mbms_addModifService(index, p_rg_mbms->nas_serviceId, Mod_releasePTM_RB);
-
-  if (index < 0) { //If the service didn't exist in modif --> we may have to delete from unmodif services
-    index = rrc_mbms_service_id_find(p_rg_mbms->umod_numService, &p_rg_mbms->umod_serviceIdentity, p_rg_mbms->nas_serviceId);
-    msg("[RRC-RG][MBMS][IF] index returned %d for Unmodif services\n", index);
-
-    if (index >= 0) p_rg_mbms->flags.unmodifiedServicesInformation |= rrc_rg_mbms_deleteUnmodifService(index);
-  }
-
-  //If the message has been started before.
-  if (index >= 0) {
-    // decrement the number of active services in the RG (TEMP Max =1)
-    p_rg_mbms->mbms_num_active_service --;
-    //Get RB Information from RRM...
-    p_rg_mbms->ptm_requested_action = E_REL_RB;
-    RRC_RG_MBMS_O_GET_RB_INFORMATION(E_REL_RB);
-  }
-
-#endif
-}
-
-/**
- * @brief Called to handle the NAS primitive MBMS_UE_NOTIFY_REQ
- * @author nguyenhn
- * @date Jul 29, 2005 10:25:36 AM
- */
-//-----------------------------------------------------------------------------
-void rrc_rg_mbms_NAS_Notification_rx(void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef ALLOW_MBMS_PROTOCOL
-  int i;
-  int ueID;
-
-  ueID = p_rg_mbms->nas_ueID;
-  //DEBUG INFO
-#ifdef DEBUG_RRC_STATE
-  msg("\033[0;31m[RRC-RG][MBMS][IF] Processing MBMS_UE_NOTIFY_REQ: (UE_id = %d, ", ueID);
-  msg("joined services = {");
-
-  for (i = 0; i<maxMBMSServices && p_rg_mbms->nas_joinedServices[i] != -1; i++) {
-    if ( i != 0 )
-      msg(", %d", p_rg_mbms->nas_joinedServices[i]);
-    else
-      msg("%d", p_rg_mbms->nas_joinedServices[i]);
-  }
-
-  msg("}, left services = {");
-
-  for (i = 0; i<maxMBMSServices && p_rg_mbms->nas_leftServices[i] != -1; i++) {
-    if ( i != 0 )
-      msg(", %d", p_rg_mbms->nas_leftServices[i]);
-    else
-      msg("%d", p_rg_mbms->nas_leftServices[i]);
-  }
-
-  msg("} ) at frame %d \033[0m \n", protocol_bs->rrc.current_SFN);
-#endif
-
-  if (p_rg_mbms->nas_joinedServices[0] == -1 && p_rg_mbms->nas_leftServices[0] == -1) {
-    // No service was provided in the NAS primitive
-#ifdef DEBUG_RRC_MBMS
-    msg("[RRC-RG][MBMS][IF] DCCH Modified Service Information Message without services! Ignore\n");
-#endif
-  } else {
-    //Copy all params Joined/Left services to mod_xxx to create the message Notification
-    p_rg_mbms->mod_numService = 0;
-    rrc_rg_mbms_processJoinedServices();
-    rrc_rg_mbms_processLeftServices();
-
-    //Create and send the notification on DCCH if there is a service.
-    if (p_rg_mbms->mod_numService > 0)
-      rrc_rg_mbms_DCCH_tx(p_rg_mbms->nas_ueID);
-
-    //Send NAS a MBMS_UE_NOTIFY_CNF
-    RRC_RG_MBMS_O_UE_NOTIFY_CNF();
-  }
-
-#endif
-}
-
diff --git a/openair2/RRC/CELLULAR/rrc_rg_mbms_outputs.c b/openair2/RRC/CELLULAR/rrc_rg_mbms_outputs.c
deleted file mode 100755
index 519305cb22..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg_mbms_outputs.c
+++ /dev/null
@@ -1,278 +0,0 @@
-/***************************************************************************
-                          rrc_rg_mbms_outputs.c - description
-                          -------------------
-    begin            : Jul 28, 2005
-    copyright        : (C) 2001, 2010 by Eurecom
-    created by       : Huu-Nghia.Nguyen@eurecom.fr
-    modified by      : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-    This file implements the code for outputs to RG other layers
- **************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_rg_vars.h"
-#include "rrc_mbms_pdus.h"
-#include "rrc_msg_class.h"
-#include "rrc_rg_mbms_variables.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_mbms.h"
-//-----------------------------------------------------------------------------
-#ifdef MBMS_INTEGRATION_MODE
-#include "rrc_messages.h"
-#include "rrc_nas_primitives.h"
-//#include "rrc_rg.h"
-#include "rrc_proto_int.h"
-#include "rrc_proto_intf.h"
-//#include "rb_proto_extern.h"
-//#include "rrc_srb_proto_extern.h"
-#endif
-//-----------------------------------------------------------------------------
-
-/**
- * @brief Prepare RRM Request for MBMS RB configuration
- * @date Jul 28, 2005 10:59:05 AM
- */
-//-------------------------------------------------------------------
-void RRC_RG_MBMS_O_GET_RB_INFORMATION(int action)
-{
-  //-------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC-RG][MBMS][IF] Get RB Information from RRM...\n");
-#endif
-
-#ifdef MBMS_INTEGRATION_MODE
-
-  if (protocol_bs->rrc.rrc_currently_updating == FALSE) {
-    //No pending request to RRM
-    protocol_bs->rrc.rrc_multicast_bearer = TRUE;
-    //Temp - Multicast bearer is attributed to UE_Id 0
-    protocol_bs->rrc.Mobile_List[0].requested_rbId = p_rg_mbms->nas_rbId;    //List of RBs
-    /* QoS class must be one of the following
-         RRC_QOS_MBMS_STREAMING_128  20
-         RRC_QOS_MBMS_STREAMING_256  21
-         RRC_QOS_MBMS_STREAMING_384  22
-     */
-    protocol_bs->rrc.Mobile_List[0].requested_QoSclass = p_rg_mbms->nas_QoSclass;
-    rrc_rg_compute_configuration (0, action);
-  } else {
-    msg("\n[RRC-RG][MBMS] Will not contact RRM, there is already a pending request\n\n");
-  }
-
-#endif
-
-#ifdef MBMS_TEST_MODE
-  p_rg_mbms->l12ConfigurationChanged = TRUE;
-#endif
-}
-
-/**
-* @brief Request L12 to configure RBs
-* @date Aug 24, 2005 11:50:48 AM
-*/
-//-------------------------------------------------------------------
-void RRC_RG_MBMS_O_L12_CONFIGURE(void)
-{
-  //-------------------------------------------------------------------
-  int UE_Id=0; //default for MBMS
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC-RG][MBMS][IF] Request L12 to configure radio bearers\n");
-#endif
-  // Should call RRC_RG_O_O_CPHY_RL_SETUP_Req ,
-  // but not done here because FACH is used and PHY is not changed
-  RRC_RG_O_O_CRLC_CONFIG_Req();
-  RRC_RG_O_O_CMAC_CONFIG_Req();
-  // clean commands in configuration w/ UE_Id=0 , msg =0
-  rg_clear_transaction(UE_Id,0);
-  // Confirm to RRM
-  rrm_add_radio_access_bearer_confirm(UE_Id, 0); // 2nd parameter is RB_Id, to be included with real value
-}
-
-/**
- * @brief Send the message on the DCCH channel
- * @date Jun 27, 2005 9:26:16 AM
- * @param uegID used to locate the mobile terminal in the Mobile_List
- * @param pmsg pointer to MCCH message
- * @msglen length of the MCCH message
- */
-//-------------------------------------------------------------------
-void RRC_RG_MBMS_O_SEND_DCCH_UM(int ueID, char* pmsg, int msglen)
-{
-  //-------------------------------------------------------------------
-#ifdef MBMS_INTEGRATION_MODE
-  int retcode;
-
-  // send message
-  if (msglen > 0 && pmsg != NULL) {
-    if ((protocol_bs->rrc.Mobile_List[0].state == CELL_FACH_Connected)
-        || (protocol_bs->rrc.Mobile_List[0].state == CELL_DCH_Connected)) {
-      //retcode = rb_tx_data_srb_rg(RRC_SRB1_ID + (ueID*maxRB), pmsg, msglen * 8, 0, FALSE);
-      retcode = rrc_rg_send_to_srb_rlc (ueID, RRC_SRB1_ID, pmsg, msglen);
-#ifdef DEBUG_RRC_STATE
-      msg("\033[0;32m[RRC-RG][MBMS][TX] ModifiedServicesInformation, DCCH_UM, length %d\n\033[0m", msglen);
-#ifdef DEBUG_RRC_MBMS_MSG_CONTENT
-      msg("tx: ");
-      rrc_print_buffer((char*) pmsg, msglen);
-#endif
-#endif
-    }
-  }
-
-#endif
-
-#ifdef MBMS_TEST_MODE
-  tx_simulate(DCCH_ID, pmsg, msglen);
-#ifdef DEBUG_RRC_STATE
-
-  if (pmsg != NULL && msglen > 0) {
-    msg("\033[0;32m[RRC-RG][MBMS][TX] ModifiedServicesInformation, DCCH, length %d, frame %d \n\033[0m", msglen, protocol_bs->rrc.current_SFN);
-#ifdef DEBUG_RRC_MBMS_MSG_CONTENT
-    msg("tx: ");
-    rrc_print_buffer((char*) pmsg, msglen);
-#endif
-  }
-
-#endif
-#endif
-}
-
-/**
- * @brief Send the message on the MCCH channel
- * @date Jun 27, 2005 9:26:16 AM
- * @param pmsg pointer to MCCH message
- * @msglen length of the MCCH message
- */
-//-------------------------------------------------------------------
-void RRC_RG_MBMS_O_SEND_MCCH(char* pmsg, int msglen)
-{
-  //-------------------------------------------------------------------
-#ifdef MBMS_INTEGRATION_MODE
-  //send message
-  if (msglen > 0 && pmsg != NULL) {
-    rrc_rg_mcch_tx (pmsg, msglen);
-#ifdef DEBUG_RRC_MBMS
-    //#ifdef DEBUG_RRC_MBMS_BASIC
-    msg("\033[0;32m[RRC-RG][MBMS][TX] ");
-    rrc_mbms_mcch_message_name_print(((MCCH_Message*) pmsg)->message.type);
-    msg(", MCCH , length %d, frame %d \n\033[0m", msglen, protocol_bs->rrc.current_SFN);
-#ifdef DEBUG_RRC_MBMS_MSG_CONTENT
-    msg("tx: ");
-    rrc_print_buffer((char*) pmsg, msglen);
-#endif
-#endif
-  }
-
-#endif
-
-#ifdef MBMS_TEST_MODE
-  tx_simulate(MCCH_ID, pmsg, msglen);
-#ifdef DEBUG_RRC_MBMS
-
-  if (pmsg != NULL && msglen > 0) {
-    msg("\033[0;32m[RRC-RG][MBMS][TX] ");
-    rrc_mbms_mcch_message_name_print(((MCCH_Message*) pmsg)->message.type);
-    msg(", MCCH, length %d, frame %d \n\033[0m", msglen, protocol_bs->rrc.current_SFN);
-#ifdef DEBUG_RRC_MBMS_MSG_CONTENT
-    msg("tx: ");
-    rrc_print_buffer((char*) pmsg, msglen);
-#endif
-  }
-
-#endif
-#endif
-}
-
-/**
- * @brief Send the message on the MSCH channel
- * @date Jun 27, 2005 9:26:16 AM
- * @param pmsg pointer to MCCH message
- * @msglen length of the MCCH message
- */
-//-------------------------------------------------------------------
-void RRC_RG_MBMS_O_SEND_MSCH(char* pmsg, int msglen)
-{
-  //-------------------------------------------------------------------
-#ifdef MBMS_INTEGRATION_MODE
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC-RG][MBMS] MSCH Channel is not available, ignore the message\n");
-#endif
-#endif
-
-#ifdef MBMS_TEST_MODE
-  tx_simulate(MSCH_ID, pmsg, msglen);
-#ifdef DEBUG_RRC_MBMS
-
-  if (pmsg != NULL && msglen > 0) {
-    msg("\033[0;32m[RRC-RG][MBMS][TX] SchedulingInformation, MSCH, length %d, frame %d \n\033[0m", msglen, protocol_bs->rrc.current_SFN);
-#ifdef DEBUG_RRC_MBMS_MSG_CONTENT
-    msg("tx: ");
-    rrc_print_buffer((char*) pmsg, msglen);
-#endif
-  }
-
-#endif
-#endif
-}
-
-//-------------------------------------------------------------------
-void RRC_RG_MBMS_O_UE_NOTIFY_CNF(void)
-{
-  //-------------------------------------------------------------------
-#ifdef MBMS_INTEGRATION_MODE
-  struct nas_rg_if_element *msgToBuild;
-  mem_block_t *p = get_free_mem_block(sizeof (struct nas_rg_if_element));
-  protocol_bs->rrc.NASMessageToXmit = p;  // Temp - will later enqueue at bottom of list
-  //Set pointer to newly allocated structure and fills it
-  msgToBuild = (struct nas_rg_if_element *) p->data;
-  msgToBuild->prim_length = NAS_TL_SIZE + sizeof(struct NASMBMSUENotifyCnf);
-  msgToBuild->xmit_fifo = protocol_bs->rrc.rrc_rg_DCOut_fifo[p_rg_mbms->nas_ueID];
-  msgToBuild->nasRgPrimitive.dc_sap_prim.type = MBMS_UE_NOTIFY_CNF;
-  msgToBuild->nasRgPrimitive.dc_sap_prim.length = msgToBuild->prim_length;
-  msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.mbms_ue_notify_cnf.localConnectionRef = protocol_bs->rrc.Mobile_List[p_rg_mbms->nas_ueID].local_connection_ref;
-  msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.mbms_ue_notify_cnf.mbmsStatus = ACCEPTED; //Temp - hard coded
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC-RG][MBMS] MBMS_UE_NOTIFY_CNF primitive sent to NAS, length %d.\n", msgToBuild->prim_length);
-#endif
-
-#endif
-
-#ifdef MBMS_TEST_MODE
-  msg("[RRC-RG][MBMS] MBMS_UE_NOTIFY_CNF primitive sent to NAS.\n");
-#endif
-}
-
-//-------------------------------------------------------------------
-void RRC_RG_O_O_NAS_MBMS_RB_ESTAB_CNF (void)
-{
-  //-------------------------------------------------------------------
-#ifdef MBMS_INTEGRATION_MODE
-  //  int rb_id;
-  //  int qos_class;
-  // This is hard-coded to go in DC-SAP of MT 0, to avoid introducing an uplink GC-SAP in RG
-  int UE_Id = 0;
-  struct nas_rg_if_element *msgToBuild;
-
-  mem_block_t *p = get_free_mem_block (sizeof (struct nas_rg_if_element));
-  protocol_bs->rrc.NASMessageToXmit = p;        // Temp - will later enqueue at bottom of list
-  //Set pointer to newly allocated structure and fills it
-  msgToBuild = (struct nas_rg_if_element *) p->data;
-  msgToBuild->prim_length = NAS_TL_SIZE + sizeof (struct NASMBMSBearerEstablishConf);
-  msgToBuild->xmit_fifo = protocol_bs->rrc.rrc_rg_DCOut_fifo[UE_Id];
-  msgToBuild->nasRgPrimitive.dc_sap_prim.type = MBMS_BEARER_ESTABLISH_CNF;
-  msgToBuild->nasRgPrimitive.dc_sap_prim.length = msgToBuild->prim_length;
-  msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.mbms_establish_cnf.rbId = p_rg_mbms->nas_rbId;
-  msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.mbms_establish_cnf.sapId = p_rg_mbms->nas_sapId;
-  msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.mbms_establish_cnf.status = p_rg_mbms->nas_status;
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC-RG][MBMS][FSM-OUT] MBMS_BEARER_ESTABLISH_CNF primitive sent to NAS, for mobile %d.\n", UE_Id);
-#endif
-#endif
-}
-
-
diff --git a/openair2/RRC/CELLULAR/rrc_rg_mbms_process.c b/openair2/RRC/CELLULAR/rrc_rg_mbms_process.c
deleted file mode 100755
index 4c64cb39cd..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg_mbms_process.c
+++ /dev/null
@@ -1,793 +0,0 @@
-/***************************************************************************
-                          rrc_rg_mbms_process.c - description
-                          -------------------
-    begin               : May 30, 2005
-    copyright           : (C) 2005, 2010 by Eurecom
-    created by    : Huu-Nghia.Nguyen@eurecom.fr
-    modified by         : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-      This file contains the MBMS procedures for RG
- **************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_rg_vars.h"
-#include "rrc_mbms_pdus.h"
-#include "rrc_msg_class.h"
-#include "rrc_rg_mbms_variables.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_mbms.h"
-
-extern rrc_rg_mbms_variables * volatile p_rg_mbms; /** pointer reference to protocol_bs->rrc.mbms */
-
-/**
- * @brief Initialize the RG side mbms variables, fixed value in this phase
- * @date May 27, 2005 6:44:53 PM
- */
-//-----------------------------------------------------------------------------
-void rrc_rg_mbms_init(void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef ALLOW_MBMS_PROTOCOL
-  int i;
-
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC-RG][MBMS] START OF MBMS INITIALISATION.......................\n");
-#endif
-
-  //Reference:
-  p_rg_mbms = &protocol_bs->rrc.mbms;
-
-  //Empty all the control buffer
-  memset(p_rg_mbms, 0, sizeof(rrc_rg_mbms_variables));
-
-  //Init variables:
-  p_rg_mbms->ptm_config_transaction_id = MBMS_MIN_TRANSACTION_ID;
-
-  /***************************************/
-  //Init the configuration for MBMS
-  //Access Information message - None at initialization
-  p_rg_mbms->acc_numAccessInfo = 0;
-  //General Information message
-  p_rg_mbms->gen_t_318 = ms1000;  //default = 1000
-  //p_rg_mbms->gen_cellGroupIdentity =  1<<11; //should be 12 bits only
-  p_rg_mbms->gen_cellGroupIdentity = MBMS_DEFAULT_CGID;
-
-  //RB information - MW RAZ already done above
-#ifdef MBMS_TEST_MODE  // only for test mode
-  strcpy((char*)&(p_rg_mbms->comm_l12Config_data), "ZZZ - This is Common L1L2 PTM Configuration\0");
-  p_rg_mbms->comm_l12Config_lgth = sizeof ("ZZZ - This is Common L1L2 PTM Configuration\0");
-  strcpy((char*)&(p_rg_mbms->curr_l12Config_data), "AAA - This is Current L1L2 PTM Configuration\0");
-  p_rg_mbms->curr_l12Config_lgth = sizeof ("AAA - This is Current L1L2 PTM Configuration\0");
-#endif
-
-  //sched
-  p_rg_mbms->accessInfoPeriodCoef = ACCESS_PERIOD_COEF_DEFAULT;
-  p_rg_mbms->repetitionPeriodCoef = REPETITION_PERIOD_COEF_DEFAULT;
-  p_rg_mbms->modifPeriodCoef = MODIF_PERIOD_COEF_DEFAULT;
-  p_rg_mbms->schedPeriodCoef = SCHED_PERIOD_COEF_DEFAULT;
-
-  // MW : these variables are FFS in Modified Services message - temp initialisation here
-  p_rg_mbms->mod_reacquireMCCH = TRUE;
-  p_rg_mbms->mod_numberOfNeighbourCells = 0;
-  p_rg_mbms->mod_ptm_activationTime = 0;
-  // p_rg_mbms->mod_endOfModifiedMCCHInformation = 5;
-
-  // Currently, no neighbouring cell is supported
-  p_rg_mbms->neighb_cellCount = 0;
-
-  /*
-  memset(p_rg_mbms->neighb_cellConfList[0],0, MBMS_NEIGHBOURING_CONFIGURATION_SIZE);
-  strcpy(p_rg_mbms->neighb_cellConfList[0], "NeighbConf123456789012345678901\0");
-  p_rg_mbms->neighb_cellIDList[0] = 6;
-
-  memcpy(p_rg_mbms->neighb_cellConfList[1], data3, MBMS_NEIGHBOURING_CONFIGURATION_SIZE);
-  p_rg_mbms->neighb_cellIDList[1] = 5;
-
-  memcpy(p_rg_mbms->neighb_cellConfList[2], data3, MBMS_NEIGHBOURING_CONFIGURATION_SIZE);
-  p_rg_mbms->neighb_cellIDList[2] = 4;
-  */
-
-  rrc_rg_mbms_MCCH_encode(MCCH_mbmsModifiedServicesInformation);
-  rrc_rg_mbms_message_update(&p_rg_mbms->messageModif);
-
-  rrc_rg_mbms_MCCH_encode(MCCH_mbmsUnmodifiedServicesInformation);
-  rrc_rg_mbms_message_update(&p_rg_mbms->messageUnmodif);
-
-  rrc_rg_mbms_MCCH_encode(MCCH_mbmsGeneralInformation);
-  rrc_rg_mbms_message_update(&p_rg_mbms->messageGeneral);
-
-  /*
-  rrc_rg_mbms_MCCH_encode(MCCH_mbmsCommonPTMRBInformation);
-  rrc_rg_mbms_message_update(&p_rg_mbms->messageCommon);
-
-  rrc_rg_mbms_MCCH_encode(MCCH_mbmsCurrentCellPTMRBInformation);
-  rrc_rg_mbms_message_update(&p_rg_mbms->messageCurrent);
-  */
-
-  for (i = 0; i<p_rg_mbms->neighb_cellCount; i++) {
-    p_rg_mbms->neighb_index = i; //Create the message for the ith neighbour
-    rrc_rg_mbms_MCCH_encode(MCCH_mbmsNeighbouringCellPTMRBInformation);
-    rrc_rg_mbms_message_update(&p_rg_mbms->messageNeighbouring[i]);
-  }
-
-  p_rg_mbms->msgToSend_ptr = NULL;
-  p_rg_mbms->msgToSend_type = 0;
-
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC-RG][MBMS] END OF MBMS INITIALISATION\n\n");
-#endif
-#endif
-}
-
-/**
- * @brief Used to schedule the order of MBMS messages as specified in TS 25.331#8.7.1
- * @date May 20, 2005 11:32:58 AM
- * return the index of the message in the message info list
- */
-//-----------------------------------------------------------------------------
-int rrc_rg_mbms_MCCH_next_message(void)
-{
-  //-----------------------------------------------------------------------------
-  switch(p_rg_mbms->msgToSend_type) {
-  case 0:
-    p_rg_mbms->msgToSend_type = MCCH_mbmsModifiedServicesInformation;
-    p_rg_mbms->msgToSend_ptr = & p_rg_mbms->messageModif;
-    break;
-
-  case MCCH_mbmsModifiedServicesInformation:
-    p_rg_mbms->msgToSend_type = MCCH_mbmsUnmodifiedServicesInformation;
-    p_rg_mbms->msgToSend_ptr = & p_rg_mbms->messageUnmodif;
-    break;
-
-  case MCCH_mbmsUnmodifiedServicesInformation:
-    p_rg_mbms->msgToSend_type = MCCH_mbmsGeneralInformation;
-    p_rg_mbms->msgToSend_ptr = & p_rg_mbms->messageGeneral;
-    break;
-
-  case MCCH_mbmsGeneralInformation:
-    if (p_rg_mbms->allowCellRBInfo) {
-      p_rg_mbms->msgToSend_type = MCCH_mbmsCommonPTMRBInformation;
-      p_rg_mbms->msgToSend_ptr = & p_rg_mbms->messageCommon;
-      break;
-    }
-
-    //else, we ignore the common/current RB info, and send neigbouring cell RB Info. No break
-  case MCCH_mbmsCommonPTMRBInformation:
-    if (p_rg_mbms->allowCellRBInfo) {
-      p_rg_mbms->msgToSend_type = MCCH_mbmsCurrentCellPTMRBInformation;
-      p_rg_mbms->msgToSend_ptr = & p_rg_mbms->messageCurrent;
-      break;
-    }
-
-    //else, we ignore the current RB info, and send neigbouring cell RB Info. No break
-  case MCCH_mbmsCurrentCellPTMRBInformation:
-    p_rg_mbms->msgToSend_type = MCCH_mbmsNeighbouringCellPTMRBInformation;
-    p_rg_mbms->msgToSend_neigbIndex = 0;
-
-    //Don't break, we will transfer neighbouring cell info
-  case MCCH_mbmsNeighbouringCellPTMRBInformation:
-    if (p_rg_mbms->msgToSend_neigbIndex < p_rg_mbms->neighb_cellCount)
-      p_rg_mbms->msgToSend_ptr = & p_rg_mbms->messageNeighbouring[p_rg_mbms->msgToSend_neigbIndex++];
-    else {
-      p_rg_mbms->msgToSend_type = -1;
-      p_rg_mbms->msgToSend_ptr = NULL; //All messages have been sent
-    }
-
-    break;
-
-  default:
-    p_rg_mbms->msgToSend_type = -1;
-  }
-
-  return p_rg_mbms->msgToSend_type;
-}
-
-
-/**
- * @brief This function get the next mcch message, of which the order is specified
- * by TS 25.331, and send it on the MCCH. Temporary use of tx_simulate to send messages.
- * @warning In the future, must be coded for using MCCH chanel.
- * @date May 27, 2005 6:43:36 PM
- */
-//-----------------------------------------------------------------------------
-void rrc_rg_mbms_MCCH_tx(void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef ALLOW_MBMS_PROTOCOL
-  int msgType;
-
-  //Determine the message to transmit, Access info will be sent on its proper period
-  if (p_rg_mbms->messageAccess.msg_length > 0) {
-    //Temporary, we send the message on SRB3
-    RRC_RG_MBMS_O_SEND_MCCH(p_rg_mbms->messageAccess.msg_ptr, p_rg_mbms->messageAccess.msg_length);
-    rrc_rg_mbms_message_reset(&p_rg_mbms->messageAccess);
-  } else {
-    //not a MBMSAccessInformation message.
-    msgType = rrc_rg_mbms_MCCH_next_message();
-
-    if (msgType >= 0 && p_rg_mbms->msgToSend_ptr != NULL && p_rg_mbms->msgToSend_ptr->msg_length > 0) {
-      //transmission on MCCH - Temporary, we use SRB3
-      RRC_RG_MBMS_O_SEND_MCCH(p_rg_mbms->msgToSend_ptr->msg_ptr, p_rg_mbms->msgToSend_ptr->msg_length);
-    }
-  }
-
-#endif
-}
-
-/**
- * @brief Send the notification on DCCH if possible (having a notification message)
- * Temporary use tx_simulate, will use UM DCCH (sRB 1) to send message
- * @date May 31, 2005 9:28:14 AM
- */
-//-----------------------------------------------------------------------------
-void rrc_rg_mbms_DCCH_tx(int ueID)
-{
-  //-----------------------------------------------------------------------------
-#ifdef ALLOW_MBMS_PROTOCOL
-  rrc_rg_mbms_message_reset(&p_rg_mbms->messageNotification);
-  rrc_rg_mbms_DCCH_encode(DL_DCCH_mbmsModifiedServicesInformation);
-  rrc_rg_mbms_message_update(&p_rg_mbms->messageNotification);
-
-  if (p_rg_mbms->messageNotification.msg_length > 0) {
-    //Use DCCH-UM.
-    RRC_RG_MBMS_O_SEND_DCCH_UM(ueID, p_rg_mbms->messageNotification.msg_ptr, p_rg_mbms->messageNotification.msg_length);
-    p_rg_mbms->messageNotification.sent = TRUE;
-  }
-
-#endif
-}
-
-/**
- * @brief Send the scheduling info message if possible
- * @date May 31, 2005 9:28:47 AM
- */
-//-----------------------------------------------------------------------------
-void rrc_rg_mbms_MSCH_tx(void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef ALLOW_MBMS_PROTOCOL
-  if (!p_rg_mbms->messageScheduling.sent && p_rg_mbms->messageScheduling.msg_length > 0) {
-    RRC_RG_MBMS_O_SEND_MSCH(p_rg_mbms->messageScheduling.msg_ptr, p_rg_mbms->messageScheduling.msg_length);
-    p_rg_mbms->messageScheduling.sent = TRUE;
-  }
-
-#endif
-}
-
-//-----------------------------------------------------------------------------
-void rrc_rg_mbms_transfer_stable_services(void)
-{
-  //-----------------------------------------------------------------------------
-  int i;
-  u8 umod_requiredAction;
-  int count;
-
-  //Debug Information
-#ifdef DEBUG_RRC_MBMS
-  msg("[RRC-RG][MBMS] Transferring mbms services (in steady state) from ModifiedServiceInformation");
-  msg(" to UnmodifiedServiceInformation...\n");
-#endif
-
-  //Transfer code
-  count = 0;
-
-  for (i = 0; i<p_rg_mbms->buff_mod_numService; i++) {
-    //if stable: --> transfer to umod
-    //how is stable??? here, i means there is no more actions/changes on this service for a mdification period
-    if ( p_rg_mbms->buff_mod_changed[i] == FALSE ) { //i<p_rg_mbms->mod_numService && p_rg_mbms->buff_mod_requiredUEAction[i] == p_rg_mbms->mod_requiredUEAction[i])
-      //mapping the action: convert mod_requiredUEAction --> umod_requiredUEAction: We can use a map table for optimisation.
-      switch (p_rg_mbms->buff_mod_requiredUEAction[i]) {
-      case Mod_acquirePTM_RBInfo:
-        umod_requiredAction = UMod_acquirePTM_RBInfo;
-        //append Unmodified service, mark the flag to recreate the Unmodified message if neccessary
-        p_rg_mbms->flags.unmodifiedServicesInformation |= rrc_rg_mbms_addUnmodifService(-1, p_rg_mbms->buff_mod_serviceIdentity[i], umod_requiredAction);
-#ifdef DEBUG_RRC_MBMS_BASIC
-        msg("[RRC-RG][MBMS] Service %d was transferred from Modified service to Unmodified service\n", p_rg_mbms->buff_mod_serviceIdentity[i]);
-#endif
-        break;
-
-      case Mod_releasePTM_RB:
-#ifdef DEBUG_RRC_MBMS_BASIC
-        msg("[RRC-RG][MBMS] Service %d with action = 'release PTM RB' was removed from Modified service\n", p_rg_mbms->buff_mod_serviceIdentity[i]);
-#endif
-
-        //Do nothing == don't copy to mod_xxx <--> remove action
-      case Mod_none:
-      default:
-        //Do not store the service with action != acquire...
-        break;
-      }
-    } else { //not stable --> update to mod / will affect the Modified Service Information message.
-      p_rg_mbms->mod_requiredUEAction[count] = p_rg_mbms->buff_mod_requiredUEAction[i];
-      memcpy(&p_rg_mbms->mod_serviceIdentity[count ++ ], &p_rg_mbms->buff_mod_serviceIdentity[i], sizeof(o3));
-    }
-  }
-
-#ifdef DEBUG_RRC_MBMS
-
-  if (count == p_rg_mbms->buff_mod_numService)
-    msg("[RRC-RG][MBMS] There's no modified service in steady state, nothing is transferred\n");
-
-#endif
-
-  //Finalisation
-  p_rg_mbms->mod_numService = count;
-
-  if (count < p_rg_mbms->buff_mod_numService) { //<-- something was transferred
-    //Indentique the buffer and the current content:
-    p_rg_mbms->buff_mod_numService = count;
-    memcpy(&p_rg_mbms->buff_mod_requiredUEAction, &p_rg_mbms->mod_requiredUEAction, count * sizeof(u8));
-    memcpy(&p_rg_mbms->buff_mod_serviceIdentity, &p_rg_mbms->mod_serviceIdentity, count * sizeof(o3));
-    //Set the flag to recreate the Modified Service Info message.
-    p_rg_mbms->flags.modifiedServicesInformation = TRUE; //Added opn 21/08/2005
-  }
-
-  //All services in the list may be stable/transferred on the next modification period.
-  memset(p_rg_mbms->buff_mod_changed, 0, count * sizeof(mbms_bool));
-
-  //Debug information
-#ifdef DEBUG_RRC_MBMS
-  msg("[RRC-RG][MBMS] Transfer completed!\n");
-#endif
-}
-
-/**
- * @brief We must call this function before increasing the variable frame.
- * @date Aug 25, 2005 2:31:34 PM
- */
-//-----------------------------------------------------------------------------
-void rrc_rg_mbms_end_modification_period_check(void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef ALLOW_MBMS_PROTOCOL
-  if ((protocol_bs->rrc.current_SFN+1) % (1 << p_rg_mbms->modifPeriodCoef) == 0)  //End of modification period.
-    if (p_rg_mbms->l12ConfigurationChanged)
-      RRC_RG_MBMS_O_L12_CONFIGURE();
-
-#endif
-}
-
-/**
- * @brief Called by rrc_rg_mbms_advance_time whenever it determines a new modification period.
- * Used to create a list of messages for sending during this new modification period.
- * @date May 31, 2005 4:52:48 PM
- * @see rrc_rg_mbms_advance_time()
- */
-//-----------------------------------------------------------------------------
-void rrc_rg_mbms_activate_modification_period(void)
-{
-  //-----------------------------------------------------------------------------
-  int i;
-#ifdef DEBUG_RRC_MBMS
-  msg("\033[31m\n**************************************************\033[0m\n");
-  msg("[RRC-RG][MBMS] START A NEW MODIFICATION PERIOD\n");
-#endif
-
-  p_rg_mbms->msgToSend_type = 0;  //Restart the counter on MCCH
-  p_rg_mbms->msgToSend_ptr = NULL;
-  p_rg_mbms->msgToSend_neigbIndex = 0;
-  p_rg_mbms->messageNotification.sent = FALSE; //restart the flag to enable the notification
-  //Allow to recreate the MBMS PTM RB Information messages if the configuration has been changed.
-  p_rg_mbms->flags.commonPTMRBInformation = p_rg_mbms->l12ConfigurationChanged;
-  p_rg_mbms->flags.currentCellPTMRBInformation = p_rg_mbms->l12ConfigurationChanged;
-  p_rg_mbms->l12ConfigurationChanged = FALSE;
-
-  //1. Move last modified services --> unmodified services
-  rrc_rg_mbms_transfer_stable_services();
-#ifdef DEBUG_RRC_MBMS_DETAIL
-  msg("[RRC-RG][MBMS] Current Modified Services:\n");
-  rrc_rg_mbms_modif_services_print();
-  msg("[RRC-RG][MBMS] Current Unmodified Services:\n");
-  rrc_rg_mbms_unmodif_services_print();
-#endif
-
-  //Test if there is any service which needs to acquire RB information:
-  p_rg_mbms->allowCellRBInfo = (p_rg_mbms->mod_numService + p_rg_mbms->umod_numService) > 0;
-
-  //2. Update messages if neccessary (but message Modified and Notified will be created on sending)
-  if (p_rg_mbms->flags.modifiedServicesInformation) {
-    rrc_rg_mbms_MCCH_encode(MCCH_mbmsModifiedServicesInformation);
-    rrc_rg_mbms_message_update(&p_rg_mbms->messageModif);
-  }
-
-  if (p_rg_mbms->flags.unmodifiedServicesInformation) {
-    rrc_rg_mbms_MCCH_encode(MCCH_mbmsUnmodifiedServicesInformation);
-    rrc_rg_mbms_message_update(&p_rg_mbms->messageUnmodif);
-  }
-
-  if (p_rg_mbms->flags.generalInformation) {
-    rrc_rg_mbms_MCCH_encode(MCCH_mbmsGeneralInformation);
-    rrc_rg_mbms_message_update(&p_rg_mbms->messageGeneral);
-  }
-
-  if (p_rg_mbms->flags.commonPTMRBInformation) {
-    rrc_rg_mbms_MCCH_encode(MCCH_mbmsCommonPTMRBInformation);
-    rrc_rg_mbms_message_update(&p_rg_mbms->messageCommon);
-  }
-
-  if (p_rg_mbms->flags.currentCellPTMRBInformation) {
-    rrc_rg_mbms_MCCH_encode(MCCH_mbmsCurrentCellPTMRBInformation);
-    rrc_rg_mbms_message_update(&p_rg_mbms->messageCurrent);
-  }
-
-  //3. Recreate the Neighbouring messages if neccessary
-  if (p_rg_mbms->flags.neighbouringCellPTMRBInformation)
-    for (i = 0; i<p_rg_mbms->neighb_cellCount; i++) {
-      p_rg_mbms->neighb_index = i; //Create the message for the ith neighbour
-      rrc_rg_mbms_MCCH_encode(MCCH_mbmsNeighbouringCellPTMRBInformation);
-      rrc_rg_mbms_message_update(&p_rg_mbms->messageNeighbouring[i]);
-    }
-
-  //4. Prepare for the next modification
-  //Reset all the message flags
-  memset(&p_rg_mbms->flags, 0, sizeof(rrc_rg_mbms_msg_flags));
-}
-
-/**
- * @brief Called by rrc_rg_mbms_advance_time whenever it determines a new repetition period.
- * Used to start a new process of sending on MCCH
- * @date May 31, 2005 4:54:16 PM
- * @see rrc_rg_mbms_advance_time()
- */
-//-----------------------------------------------------------------------------
-void rrc_rg_mbms_activate_repetition_period(void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_MBMS
-  msg("-------------------------------------------------\n");
-  msg("[RRC-RG][MBMS] START A NEW REPETITION PERIOD\n");
-#endif
-  // p_rg_mbms->curr_repetition_counter = 1;
-  p_rg_mbms->msgToSend_type = 0;  //Restart the counter on MCCH
-  p_rg_mbms->messageModif.sent = FALSE;
-}
-
-/**
- * @brief Called by rrc_rg_mbms_advance_time whenever it determines a new access period.
- * used to create the message MBMSAccessInfomation for sending on MCCH.
- * @date May 31, 2005 4:52:31 PM
- * @see rrc_rg_mbms_advance_time()
- */
-//-----------------------------------------------------------------------------
-void rrc_rg_mbms_activate_access_period(void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_MBMS_DETAIL
-  msg("++++++++++++++++++++++++++++++++++++++++++++++++\n");
-  msg("[RRC-RG][MBMS] START A NEW ACCESS PERIOD\n");
-  msg("\n[MW] flags.accessInformation %d\n\n", p_rg_mbms->flags.accessInformation);
-#endif
-
-  //Release old, and prepare a new access message
-  if (p_rg_mbms->flags.accessInformation) {
-    rrc_rg_mbms_message_reset(&p_rg_mbms->messageAccess);
-    rrc_rg_mbms_MCCH_encode(MCCH_mbmsAccessInformation);
-    rrc_rg_mbms_message_update(&p_rg_mbms->messageAccess); //Only updated when allowed
-  }
-}
-
-/**
- * @brief Called by rrc_rg_mbms_advance_time whenever it determines a new scheduling period.
- * @date May 31, 2005 4:52:38 PM
- * @see rrc_rg_mbms_advance_time()
- */
-//-----------------------------------------------------------------------------
-void rrc_rg_mbms_activate_scheduling_period(void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_MBMS_DETAIL
-  msg(".................................................\n");
-  msg("[RRC-RG][MBMS] START A NEW SCHEDULING PERIOD\n");
-#endif
-
-  //Release old, and prepare a new scheduling message
-  if (p_rg_mbms->flags.schedulingInformation) {
-    rrc_rg_mbms_message_reset(&p_rg_mbms->messageScheduling);
-    rrc_rg_mbms_MSCH_encode(MSCH_mbmsSchedulingInformation);
-    rrc_rg_mbms_message_update(&p_rg_mbms->messageScheduling);
-  }
-}
-
-/**
- * @brief advance the timing counter to determine which time event will occur
- * This will be the main interface for the RG side
- * @date May 31, 2005 11:24:19 AM
- */
-//-----------------------------------------------------------------------------
-void rrc_rg_mbms_scheduling_check(void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef ALLOW_MBMS_PROTOCOL
-  if (protocol_bs->rrc.current_SFN % (1 << p_rg_mbms->modifPeriodCoef) == 0)
-    rrc_rg_mbms_activate_modification_period();
-
-  if (protocol_bs->rrc.current_SFN % (1 << (p_rg_mbms->modifPeriodCoef - p_rg_mbms->accessInfoPeriodCoef)) == 0)
-    rrc_rg_mbms_activate_access_period();
-
-  if (protocol_bs->rrc.current_SFN % (1 << (p_rg_mbms->modifPeriodCoef - p_rg_mbms->repetitionPeriodCoef)) == 0)
-    rrc_rg_mbms_activate_repetition_period();
-
-  if (protocol_bs->rrc.current_SFN % (1 << p_rg_mbms->schedPeriodCoef) == 0 )
-    rrc_rg_mbms_activate_scheduling_period();
-
-#endif
-}
-
-/**
- * @brief Delete the index th element in the list of Unmodified Services p_rg_mbms->umod_xxx
- * @date Jul 8, 2005 10:41:40 AM
- * @return TRUE if deleted, FALSE if not.
- */
-//-----------------------------------------------------------------------------
-mbms_bool rrc_rg_mbms_deleteUnmodifService(int index)
-{
-  //-----------------------------------------------------------------------------
-  int rest;
-  mbms_bool result = FALSE;
-
-  //Operation delete is defined as moving 1 to the left all the element: index + 1, index + 2....
-  if ((result = index >= 0 && index < p_rg_mbms->umod_numService)) {
-    if ((rest = p_rg_mbms->umod_numService - (index + 1))) {
-      memmove(&p_rg_mbms->umod_serviceIdentity[index], &p_rg_mbms->umod_serviceIdentity[index+1], rest*sizeof(o3));
-      memmove(&p_rg_mbms->umod_requiredUEAction[index], &p_rg_mbms->umod_requiredUEAction[index+1], rest*sizeof(u8));
-    }
-
-    p_rg_mbms->umod_numService--;
-  }
-
-  return result;
-}
-
-/**
- * @brief Add the service and its action to the list p_rg_mbms->umod_serviceIdentity[].
- * @date Jul 8, 2005 11:26:44 AM
- * @param serviceID service to be added
- * @param umod_requiredAction required action corresponds to the serviceID.
- * @param index defaultIndex = -1 --> append and increase the number of services,  >= 0 --> edit the element.
- * @return TRUE if inserted or modified, FALSE if not.
- */
-//-----------------------------------------------------------------------------
-mbms_bool rrc_rg_mbms_addUnmodifService(int index, o3 serviceID, u8 umod_requiredAction)
-{
-  //-----------------------------------------------------------------------------
-  mbms_bool result = FALSE;
-
-  if ((result = (index < 0) && p_rg_mbms->umod_numService<maxMBMSservUnmodif)) {
-    memcpy(&p_rg_mbms->umod_serviceIdentity[p_rg_mbms->umod_numService], &serviceID, sizeof(o3));
-    p_rg_mbms->umod_requiredUEAction[p_rg_mbms->umod_numService++] = umod_requiredAction;
-  } else {
-    //Otherwise, we update
-    if ((result = (index >= 0) && index<maxMBMSservUnmodif)) //exist --> modified the value of required ue action.
-      p_rg_mbms->umod_requiredUEAction[index] = umod_requiredAction;
-  }
-
-  return result;
-}
-
-/**
- * @brief Delete the index th element in the list of Modified Services p_rg_mbms->buff_mod_xxx
- * if found --> delete this element from the list.
- * @date Jul 8, 2005 10:41:40 AM
- * @return TRUE if deleted, FALSE if not.
- */
-//-----------------------------------------------------------------------------
-mbms_bool rrc_rg_mbms_deleteModifService(int index)
-{
-  //-----------------------------------------------------------------------------
-  int rest;
-  mbms_bool result = FALSE;
-
-  //Operation delete is defined as moving 1 to the left all the element: index + 1, index + 2....
-  if ((result = (index >= 0 && index < p_rg_mbms->buff_mod_numService))) {
-    if ((rest = p_rg_mbms->buff_mod_numService - (index + 1))) { //number of elements
-      memmove(&p_rg_mbms->buff_mod_changed[index], &p_rg_mbms->buff_mod_changed[index+1], rest*sizeof(mbms_bool));
-      memmove(&p_rg_mbms->buff_mod_serviceIdentity[index], &p_rg_mbms->buff_mod_serviceIdentity[index+1], rest*sizeof(o3));
-      memmove(&p_rg_mbms->buff_mod_requiredUEAction[index], &p_rg_mbms->buff_mod_requiredUEAction[index+1], rest*sizeof(u8));
-    }
-
-    p_rg_mbms->buff_mod_numService--;
-  }
-
-  return result;
-}
-
-/**
- * @brief Add the service and its action to the list p_rg_mbms->buff_mod_serviceIdentity[].
-  * @date Jul 8, 2005 11:26:44 AM
- * @param serviceID service to be added
- * @param mod_requiredAction required action corresponds to the serviceID.
- * @param index defaultIndex = -1 --> append and increase the number of services,  >= 0 --> edit the element.
- * @return TRUE if inserted or modified, FALSE if not.
-
- */
-//-----------------------------------------------------------------------------
-mbms_bool rrc_rg_mbms_addModifService(int index, o3 serviceID, u8 requiredAction)
-{
-  //-----------------------------------------------------------------------------
-  mbms_bool result = FALSE;
-
-  if ( (result = (index < 0) && (p_rg_mbms->buff_mod_numService< maxMBMSservModif))) {
-#ifdef DEBUG_RRC_MBMS_BASIC
-    msg("[RRC-RG][MBMS] Add the service %d to the list of Modified Services. (index %d)\n", serviceID, index);
-#endif
-    //Service ID
-    memcpy(&p_rg_mbms->buff_mod_serviceIdentity[p_rg_mbms->buff_mod_numService], &serviceID, sizeof(o3));
-    //Required Action & Others
-    p_rg_mbms->buff_mod_requiredUEAction[p_rg_mbms->buff_mod_numService] = requiredAction;
-    p_rg_mbms->buff_mod_changed[p_rg_mbms->buff_mod_numService] = TRUE;
-    p_rg_mbms->buff_mod_numService++;
-  } else if ((result = (index >= 0))) { //exist --> modified the value of required ue action.
-#ifdef DEBUG_RRC_MBMS_BASIC
-    msg("[RRC-RG][MBMS] Mark the service %d to the list of Modified Services-- removed. (index %d)\n", serviceID, index);
-#endif
-    p_rg_mbms->buff_mod_requiredUEAction[index] = requiredAction;
-    p_rg_mbms->buff_mod_changed[index] = TRUE;
-  }
-
-  return result;
-}
-
-/**
- * @brief Process the received joined services from NAS. copy them to mod_xxx to create the DCCH Notification
- * @date Aug 24, 2005 4:30:52 PM
- */
-//-----------------------------------------------------------------------------
-void rrc_rg_mbms_processJoinedServices(void)
-{
-  //-----------------------------------------------------------------------------
-  int i, index, ueID;
-  u8 act_numService;
-
-  ueID = p_rg_mbms->nas_ueID;
-
-  for (i = 0; i<maxMBMSServices && p_rg_mbms->nas_joinedServices[i] != -1; i++) {
-    act_numService = protocol_bs->rrc.Mobile_List[ueID].act_numService;
-    //Check if this service exist in the list of services/UE of the user p_rg_mbms->nas_ueID
-    index = rrc_mbms_service_id_find(act_numService, &(protocol_bs->rrc.Mobile_List[ueID].act_serviceIdentity), p_rg_mbms->nas_joinedServices[i]);
-
-    //We add this service in the notification only if it hasn't been activated before
-    if (index < 0) {
-      p_rg_mbms->mod_requiredUEAction[p_rg_mbms->mod_numService] = Mod_acquirePTM_RBInfo;
-      p_rg_mbms->mod_sessionIdentity[p_rg_mbms->mod_numService] = 0;   //temp
-      memcpy(&p_rg_mbms->mod_serviceIdentity[p_rg_mbms->mod_numService++], &p_rg_mbms->nas_joinedServices[i], sizeof(o3));
-
-      //add in the managed services/ue list
-      memcpy(&(protocol_bs->rrc.Mobile_List[ueID].act_serviceIdentity[act_numService]), &(p_rg_mbms->nas_joinedServices[i]), sizeof(o3));
-      protocol_bs->rrc.Mobile_List[ueID].act_numService++;
-    } else {
-#ifdef DEBUG_RRC_MBMS
-      msg("[RRC-RG][MBMS] Joined service %d has previously been notified to UE %d. Ignore this request\n", p_rg_mbms->nas_joinedServices[i], p_rg_mbms->nas_ueID);
-#endif
-    }
-  }
-}
-
-/**
- * @brief Process the received left services from NAS. copy them to mod_xxx to create the DCCH Notification
- * @date Aug 24, 2005 4:29:57 PM
- */
-//-----------------------------------------------------------------------------
-void rrc_rg_mbms_processLeftServices(void)
-{
-  //-----------------------------------------------------------------------------
-  int i, index, ueID;
-  u8 act_numService;
-  int remaining;
-
-  ueID = p_rg_mbms->nas_ueID;
-
-  for (i = 0; i<maxMBMSServices && p_rg_mbms->nas_leftServices[i] != -1; i++) {
-    act_numService = protocol_bs->rrc.Mobile_List[ueID].act_numService;
-    index = rrc_mbms_service_id_find(act_numService, &(protocol_bs->rrc.Mobile_List[ueID].act_serviceIdentity), p_rg_mbms->nas_leftServices[i]);
-
-    //We add this service in the notification only if it has previously been activated
-    if (index >= 0) {
-      p_rg_mbms->mod_requiredUEAction[p_rg_mbms->mod_numService] = Mod_releasePTM_RB;
-      memcpy(& p_rg_mbms->mod_serviceIdentity[p_rg_mbms->mod_numService++], &p_rg_mbms->nas_leftServices[i], 3);
-
-      //delete from the services/ue list
-      remaining = act_numService - (index + 1);
-
-      if (remaining > 0)
-        memmove(&(protocol_bs->rrc.Mobile_List[ueID].act_serviceIdentity[index]), &(protocol_bs->rrc.Mobile_List[ueID].act_serviceIdentity[index+1]), remaining * sizeof(o3));
-
-      protocol_bs->rrc.Mobile_List[ueID].act_numService --;
-    } else {
-#ifdef DEBUG_RRC_MBMS
-      msg("[RRC-RG][MBMS] Service %d was not joined. Ignore this request\n", p_rg_mbms->nas_leftServices[i]);
-#endif
-    }
-  }
-}
-
-/**
- * @brief If the length of p_rg_mbms->curr_Message > 0,
- * copy the current content of p_rg_mbms->curr_Message in to the struct pointed by ptrMsgInfo.
- * @param ptrMsgInfo pointer pointing to a static buffer in p_rg_mbms
- *
- */
-//-----------------------------------------------------------------------------
-void rrc_rg_mbms_message_update(rrc_rg_mbms_msg_buf * ptrMsgInfo)
-{
-  //-----------------------------------------------------------------------------
-  if (p_rg_mbms->curr_Message.msg_length >0)
-    memcpy(ptrMsgInfo, &p_rg_mbms->curr_Message, sizeof(rrc_rg_mbms_msg_buf));
-}
-
-/**
- * @brief Reset the content of message info.
- * @param ptrMsgInfo pointer pointing to the message information
- */
-//-----------------------------------------------------------------------------
-void rrc_rg_mbms_message_reset(rrc_rg_mbms_msg_buf * ptrMsgInfo)
-{
-  //-----------------------------------------------------------------------------
-  memset(ptrMsgInfo, 0, sizeof(rrc_rg_mbms_msg_buf));
-}
-
-/**
- * @brief Used to print out the list of modified services
- * @date Jul 29, 2005 10:24:11 AM
- */
-//-----------------------------------------------------------------------------
-void rrc_rg_mbms_modif_services_print(void)
-{
-  //-----------------------------------------------------------------------------
-  int i;
-
-  for (i = 0; i< p_rg_mbms->mod_numService; i++) {
-    msg("\t\t[RRC-RG][MBMS] service id = %d", p_rg_mbms->mod_serviceIdentity[i]);
-    msg(", required action = ");
-
-    switch (p_rg_mbms->mod_requiredUEAction[i]) {
-    case Mod_none:
-      msg("None\n");
-      break;
-
-    case Mod_acquirePTM_RBInfo:
-      msg("Acquire PTM RB Info\n");
-      break;
-
-    case Mod_releasePTM_RB:
-      msg("Release PTM RB Info\n");
-      break;
-    }
-  }
-}
-
-/**
- * @brief Used to print out the list of unmodified services
- * @date Jul 29, 2005 10:24:11 AM
- */
-//-----------------------------------------------------------------------------
-void rrc_rg_mbms_unmodif_services_print(void)
-{
-  //-----------------------------------------------------------------------------
-  int i;
-
-  for (i = 0; i< p_rg_mbms->umod_numService; i++) {
-    msg("\t\t[RRC-RG][MBMS] service id = %d", p_rg_mbms->umod_serviceIdentity[i]);
-    msg(", required action = ");
-
-    switch (p_rg_mbms->umod_requiredUEAction[i]) {
-    case UMod_none:
-      msg("None\n");
-      break;
-
-    case UMod_acquirePTM_RBInfo:
-      msg("Acquire PTM RB Info\n");
-      break;
-
-    case UMod_releasePTM_RB:
-      msg("Release PTM RB Info\n");
-      break;
-    }
-  }
-}
diff --git a/openair2/RRC/CELLULAR/rrc_rg_mbms_variables.h b/openair2/RRC/CELLULAR/rrc_rg_mbms_variables.h
deleted file mode 100755
index dcba9d5101..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg_mbms_variables.h
+++ /dev/null
@@ -1,149 +0,0 @@
-/***************************************************************************
-                          rrc_rg_mbms_variables.h - description
-                          -------------------
-    begin               : May 30, 2005
-    copyright           : (C) 2005, 2010 by Eurecom
-    created by          : Huu-Nghia.Nguyen@eurecom.fr
-    modified by         :
-    description         : Definitions of variables in control block for RRC MBMS
- **************************************************************************/
-#ifndef _RRC_RG_MBMS_VARIABLES_H_
-#define _RRC_RG_MBMS_VARIABLES_H_
-
-#include "rrc_mbms_constant.h"
-#include "rrc_constant.h"
-
-
-/** this struct store flags to identify which messages
- * need to be reconstructed at the begining of modification period */
-typedef struct rrc_rg_mbms_msg_flags {
-  int accessInformation;
-  int commonPTMRBInformation;
-  int currentCellPTMRBInformation;
-  int generalInformation;
-  int modifiedServicesInformation;
-  int neighbouringCellPTMRBInformation;
-  int unmodifiedServicesInformation;
-  int schedulingInformation;
-} rrc_rg_mbms_msg_flags;
-
-/** this struct is used to avoid creating repeatly the mbms in a modification period.
- * Once the message is created, we will store it in this buffer, and use the flag 'sent'
- * to determine if this message has been sent on its channel*/
-typedef struct rrc_rg_mbms_msg_buf {
-  int   msg_length;
-  char  msg_ptr[MBMS_MAX_BUFFER_SIZE];
-  mbms_bool sent;
-} rrc_rg_mbms_msg_buf;
-
-
-/**
- *  **control block for RRC MBMS **
- * For more information, read the design document
- **/
-typedef struct rrc_rg_mbms_variables {
-  //Used to encode the MBMS message
-  u8  acc_numAccessInfo; //0..maxMBMSservCount (=4), @see MBMS_ServiceAccessInfoList */
-  u8  acc_shortTransmissionID     [maxMBMSservCount]; /** Integer(1..32),  @see MBMS_ShortTransmissionID */
-  u16 acc_accessprobabilityFactor_Idle  [maxMBMSservCount]; /** Integer(0, 32, 64..960, 1000), @see MBMS_AccessProbabilityFactor */
-
-  u16 gen_t_318; /** Default value ms1000, @see T_318 */
-  u16 gen_cellGroupIdentity; /** Bit string (12), @see MBMS_CellGroupIdentity */
-
-  u8  umod_numService;  //0..maxMBMSservUnmodif
-  o3  umod_serviceIdentity  [maxMBMSservUnmodif];   /** OctetString(3), @see MBMS_ServiceIdentity @see also rrc_mbms_constant*/
-  u8  umod_requiredUEAction [maxMBMSservUnmodif]; /** @see MBMS_RequiredUEAction_UMod */
-
-  u8  mod_numService; /** 0..maxMBMSservModif  */
-  o3  mod_serviceIdentity   [maxMBMSservModif];   /** OctetString(3), @see MBMS_ServiceIdentity */
-  u8  mod_sessionIdentity   [maxMBMSservModif];
-  u8  mod_requiredUEAction  [maxMBMSservModif]; /** @see MBMS_RequiredUEAction_Mod */
-  mbms_bool contMCCHReading [maxMBMSservModif];
-  mbms_bool mod_reacquireMCCH;
-  //  u8  mod_endOfModifiedMCCHInformation;
-  u8  mod_numberOfNeighbourCells;
-  u8  mod_ptm_activationTime;
-  mbms_bool mod_all_unmodified_ptm_services;
-
-  //BUFFER to interact with NAS. Only needed for notification message on MCCH
-  u8  buff_mod_numService;  /** 0..maxMBMSservModif  */
-  o3  buff_mod_serviceIdentity    [maxMBMSservModif];   /** OctetString(3), @see MBMS_ServiceIdentity */
-  u8  buff_mod_requiredUEAction [maxMBMSservModif]; /** @see MBMS_RequiredUEAction_Mod */
-  mbms_bool buff_mod_changed  [maxMBMSservModif]; /** Used  to determine if we need to transfer this service to unmodified message */
-
-  //u8 comm_l12Configuration  [MBMS_L12_CONFIGURATION_SIZE]; /** OctetString, @see MBMS_L12Configuration */
-  int comm_l12Config_lgth;
-  u8  comm_l12Config_data[MTCH_CONFIGURATION_SIZE];
-  //u8 curr_l12Configuration  [MBMS_L12_CONFIGURATION_SIZE]; /** OctetString, @see MBMS_L12Configuration */
-  int curr_l12Config_lgth;
-  u8  curr_l12Config_data[MTCH_CONFIGURATION_SIZE];
-
-  u8  neighb_cellCount; /** number of neighbouring cell in the list, 0..maxNeighbouringCellIdentity (=32) is supposed, @see maxNeighbouringCellIdentity */
-  u16 neighb_cellConf_lgth  [MBMS_MAX_NEIGBOURING_COUNT]; /** neigbouring cells' configuration length, @see MBMS_NeighbouringCellConfiguration*/
-  u8  neighb_cellConf_data  [MBMS_MAX_NEIGBOURING_COUNT][NEIGHBOUR_CONFIGURATION_SIZE]; /** neigbouring cells' configuration, @see MBMS_NeighbouringCellConfiguration*/
-  u8  neighb_cellIDList [MBMS_MAX_NEIGBOURING_COUNT]; /** list of neighb identity (1..X), used as a pointer to SIB 11? */
-  u8  neighb_index; /** current neighb index of the list - Use it to create the msg corresponding*/
-
-  u8  sched_numInfo;  /** 0..maxMBMSservSched  */
-  o3  sched_serviceIdentity   [maxMBMSservSched];   /** OctetString(3), @see MBMS_ServiceIdentity */
-  u8  sched_trans_numTransmis [maxMBMSservSched]; /** 0..maxMBMSTransmis */
-  u16 sched_trans_start [maxMBMSservSched][maxMBMSTransmis];  /** 0..1024 by step of 4 */
-  u16 sched_trans_duration  [maxMBMSservSched][maxMBMSTransmis]; /** 4..1024 */
-  u8  sched_nextSchedPeriod [maxMBMSservSched]; /** 0..31 */
-
-  //  //Used for scheduling on MCCH
-  mbms_bool l12ConfigurationChanged;  /** Used to signal if we have to configure L12 at the end of modification period*/
-  //  u32 rg_mbms_frame;
-  //  u32 curr_repetition_counter;  /** counter for modification period */
-  //  u32 curr_modif_counter;   /** counter for modification period */
-  //  u32 curr_access_counter;    /** counter for access period */
-  //  u32 curr_sched_counter;   /** counter for scheduling period */
-
-  u8  accessInfoPeriodCoef;
-  u8  repetitionPeriodCoef;
-  u8  modifPeriodCoef;
-  u8  schedPeriodCoef;
-  // mbms_bool  allowNotification; //allow the message Notification to be sent on DCCH at the begining of the repetion period.
-  mbms_bool allowCellRBInfo; //Turned on when we start at least one mbms service.
-  rrc_rg_mbms_msg_flags flags; /** Used to see if the message need to be reconstructed ? */
-
-  //Used to send MCCH message in the order specified by TS25.331
-  rrc_rg_mbms_msg_buf*  msgToSend_ptr;
-  int     msgToSend_type; //the current message type to be sent
-  int     msgToSend_neigbIndex; //Used only when neighbouring rb info msg is available
-
-  //A list of DCCH, MCCH, MSCH stored messages during periods
-  rrc_rg_mbms_msg_buf   curr_Message; /** Buffer for encoding message */
-  rrc_rg_mbms_msg_buf   messageAccess;
-  rrc_rg_mbms_msg_buf   messageNotification; //Modification Services Information on DCCH
-  rrc_rg_mbms_msg_buf   messageModif; //Modification Services Information on MCCH
-  rrc_rg_mbms_msg_buf   messageUnmodif;
-  rrc_rg_mbms_msg_buf   messageGeneral;
-  rrc_rg_mbms_msg_buf   messageCommon;
-  rrc_rg_mbms_msg_buf   messageCurrent;
-  rrc_rg_mbms_msg_buf   messageNeighbouring[MBMS_MAX_NEIGBOURING_COUNT] ;
-  rrc_rg_mbms_msg_buf   messageScheduling;
-
-
-  //Other variables are stored here.
-  int mbms_num_active_service;
-  int nas_ueID;
-  o3  nas_serviceId;
-  u16 nas_sessionId; //1 byte
-  u16 nas_rbId; //
-  u16 nas_QoSclass;
-  u32 nas_sapId;
-  u16 nas_duration;
-  int nas_status;
-  o3  nas_joinedServices[maxMBMSServices]; /** OctetString(3), @see MBMS_ServiceIdentity */
-  o3  nas_leftServices[maxMBMSServices]; /** OctetString(3), @see MBMS_ServiceIdentity */
-
-  //mbms rrm config. flag =  TRUE --> contacted RRM; FALSE --> otherwise
-  mbms_bool  ptm_config_requested;
-  mbms_bool  ptm_config_updating;
-  u32        ptm_config_transaction_id;
-  int ptm_requested_action;
-
-} rrc_rg_mbms_variables;
-
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_rg_msg_decode.c b/openair2/RRC/CELLULAR/rrc_rg_msg_decode.c
deleted file mode 100755
index cc836a5d3e..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg_msg_decode.c
+++ /dev/null
@@ -1,693 +0,0 @@
-/***************************************************************************
-                          rrc_rg_msg_decode.c  -  description
-                             -------------------
-    begin                : June 17, 2002
-    copyright            : (C) 2002, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Decodes messages received in one of the signalling Radio Bearer
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-#include "rtos_header.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_rg_vars.h"
-#include "rrc_messages.h"
-#include "rrc_qos_classes.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_int.h"
-#include "rrc_proto_fsm.h"
-#include "rrc_proto_intf.h"
-#include "rrc_proto_msg.h"
-#include "rrc_proto_bch.h"
-#include "rrc_proto_mbms.h"
-//-----------------------------------------------------------------------------
-// For FIFOS interface
-#ifdef USER_MODE
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#endif
-
-
-//#define DEBUG_RRC_MEASURE_REPORT
-
-//-----------------------------------------------------------------------------
-// Generic function to decode RRC messages received on CCCH
-//void rrc_rg_srb0_decode (mem_block_t * sduP, int length){
-void rrc_rg_srb0_decode (char * sduP, int length)
-{
-  //-----------------------------------------------------------------------------
-  int UE_Id;
-  UL_CCCH_Message *ul_ccch_msg;
-  int status = SUCCESS;
-#ifdef DEBUG_RRC_STATE
-  //    msg("[RRC_RG][DECODE]Decoding from Srb0 --%d-- \n", &sduP->data[length]);
-  msg ("\n[RRC_RG][DECODE]Decoding from Srb0 -- start of message: \n");
-  rrc_print_buffer ((char*)&sduP[length], 15);
-#endif
-  //msg ("[RRC][SRB-RG] frame received: %s\n", (char*)&sduP[sdu_offset]);
-  //ul_ccch_msg = (UL_CCCH_Message *) (&sduP->data[length]);
-  ul_ccch_msg = (UL_CCCH_Message *) (&sduP[length]);
-
-  switch (ul_ccch_msg->message.type) {
-  case UL_CCCH_rrcConnectionRequest:
-    status = rrc_rg_msg_connreq (&UE_Id, ul_ccch_msg);
-
-    if (status == SUCCESS)
-      rrc_rg_fsm_control (UE_Id, RRC_CONNECT_REQ);
-
-    break;
-
-  case UL_CCCH_cellUpdate:
-    status = rrc_rg_msg_cellUpdate (&UE_Id, ul_ccch_msg);
-
-    if (status == SUCCESS)
-      rrc_rg_fsm_control (UE_Id, UE_CELLU);
-
-    break;
-
-  default:
-    status = FAILURE;
-  }
-
-#ifdef DEBUG_RRC_STATE
-
-  if (status != SUCCESS)
-    msg ("\n[RRC_RG][DECODE]Message from Srb0 could not be decoded. No call to FSM \n");
-
-#endif
-
-}
-
-//-----------------------------------------------------------------------------
-// Generic function to decode RRC messages received on DCCH-UM
-void rrc_rg_srb1_decode (int UE_Id, char * sduP, int length)
-{
-  //-----------------------------------------------------------------------------
-  UL_DCCH_Message *ul_dcch_msg;
-  int status = SUCCESS;
-
-#ifdef DEBUG_RRC_STATE
-  // msg("[RRC_RG][DECODE]Decoding from Srb1 --%s-- \n", &sduP->data[length]);
-  msg ("\n[RRC_RG][DECODE]Decoding from Srb1 -- start of message: \n");
-  rrc_print_buffer (&sduP[length], 15);
-#endif
-  ul_dcch_msg = (UL_DCCH_Message *) (&sduP[length]);
-
-  switch (ul_dcch_msg->message.type) {
-  case UL_DCCH_rrcConnectionReleaseComplete:       //not in 1st step
-    status = FAILURE;
-    break;
-
-  case UL_DCCH_measurementReport:
-    status = rrc_rg_msg_measrepr (UE_Id, ul_dcch_msg);
-
-    if (status == SUCCESS) {
-      // forward to RRM;
-      rrc_rg_fwd_meas_report (UE_Id);
-      //rrc_rg_tick[UE_Id] = 0;
-    }
-
-#ifdef DEBUG_RRC_MEASURE_REPORT
-    rrc_rg_print_meas_report (&(protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_rep[protocol_bs->rrc.Mobile_List[UE_Id].rrc_rg_last_measurement]));
-#endif
-    break;
-
-  default:
-    status = FAILURE;
-  }
-
-#ifdef DEBUG_RRC_STATE
-
-  if (status != SUCCESS)
-    msg ("\n[RRC_RG][DECODE]Message from Srb1 could not be decoded. No call to FSM \n");
-
-#endif
-
-}
-
-//-----------------------------------------------------------------------------
-// Generic function to decode RRC messages received on DCCH-AM
-void rrc_rg_srb2_decode (int UE_Id, char * sduP, int length)
-{
-  //-----------------------------------------------------------------------------
-  UL_DCCH_Message *ul_dcch_msg;
-  int status = SUCCESS;
-
-#ifdef DEBUG_RRC_STATE
-  // msg("[RRC_RG][DECODE]Decoding from Srb2 --%s-- \n", &sduP->data[length]);
-  msg ("\n[RRC_RG][DECODE]Decoding from Srb2 -- start of message: \n");
-  rrc_print_buffer (&sduP[length], 15);
-#endif
-  ul_dcch_msg = (UL_DCCH_Message *) (&sduP[length]);
-
-  switch (ul_dcch_msg->message.type) {
-  case UL_DCCH_rrcConnectionSetupComplete:
-    status = rrc_rg_msg_connsucompl (UE_Id, ul_dcch_msg);
-
-    if (status == SUCCESS)
-#ifdef DEBUG_RRC_STATE
-      msg("\n[RRC_RG][DECODE] conn_complete_timer = %d , Resetting \n", protocol_bs->rrc.Mobile_List[UE_Id].conn_complete_timer);
-
-#endif
-    protocol_bs->rrc.Mobile_List[UE_Id].conn_complete_timer =0;
-    rrc_rg_fsm_control (UE_Id, RRC_CONN_SETUP_COMP);
-    protocol_bs->rrc.num_connected_UEs++;
-    break;
-
-  case UL_DCCH_rrcConnectionReleaseComplete:       // Not in 1st step
-    status = FAILURE;
-    break;
-
-  case UL_DCCH_rrcConnectionReleaseUL:
-    status = rrc_rg_msg_connrelUL (UE_Id, ul_dcch_msg);
-
-    if (status == SUCCESS)
-      rrc_rg_fsm_control (UE_Id, RRC_CONNECT_RELUL);
-
-    break;
-
-  case UL_DCCH_radioBearerSetupComplete:
-    status = rrc_rg_msg_rbsetupcompl (UE_Id, ul_dcch_msg);
-
-    if (status == SUCCESS)
-      rrc_rg_config_LTE_default_drb(0);
-
-#ifdef ALLOW_MBMS_PROTOCOL
-    rrc_rg_config_LTE_srb2(0);
-#endif
-    rrc_rg_fsm_control (UE_Id, UE_RB_SU_CMP);
-    break;
-
-  case UL_DCCH_radioBearerSetupFailure:
-    status = rrc_rg_msg_rbsetupfail (UE_Id, ul_dcch_msg);
-
-    if (status == SUCCESS)
-      rrc_rg_fsm_control (UE_Id, UE_RB_SU_FAIL);
-
-    break;
-
-  case UL_DCCH_radioBearerReleaseComplete:
-    status = rrc_rg_msg_rbreleasecompl (UE_Id, ul_dcch_msg);
-
-    if (status == SUCCESS)
-      rrc_rg_config_LTE_default_drb(0);
-
-    rrc_rg_fsm_control (UE_Id, UE_RB_REL_CMP);
-    break;
-
-  case UL_DCCH_radioBearerReleaseFailure:
-    status = rrc_rg_msg_rbreleasefail (UE_Id, ul_dcch_msg);
-
-    if (status == SUCCESS)
-      rrc_rg_fsm_control (UE_Id, UE_RB_REL_FAIL);
-
-    break;
-
-  case UL_DCCH_measurementReport:
-    status = rrc_rg_msg_measrepr (UE_Id, ul_dcch_msg);
-
-    if (status == SUCCESS)
-      rrc_rg_fwd_meas_report (UE_Id);
-
-#ifdef DEBUG_RRC_MEASURE_REPORT
-    rrc_rg_print_meas_report (&(protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_rep[protocol_bs->rrc.Mobile_List[UE_Id].rrc_rg_last_measurement]));
-#endif
-    break;
-
-  case UL_DCCH_ueCapabilityInformation:
-    status = rrc_rg_msg_ueCapInfo(UE_Id, ul_dcch_msg);
-
-    if (status == SUCCESS)
-      rrc_rg_fsm_control(UE_Id, UE_CAP_INFO);
-
-    break;
-
-  default:
-    status = FAILURE;
-  }
-
-#ifdef DEBUG_RRC_STATE
-
-  if (status != SUCCESS)
-    msg ("\n[RRC_RG][DECODE]Message from Srb2 could not be decoded. No call to FSM \n");
-
-#endif
-}
-
-//-----------------------------------------------------------------------------
-// Generic function to decode RRC messages received on srb3 (NAS messages)
-void rrc_rg_srb3_decode (int UE_Id, char * sduP, int length)
-{
-  //-----------------------------------------------------------------------------
-  UL_DCCH_Message *ul_dcch_msg;
-  int status = SUCCESS;
-
-#ifdef DEBUG_RRC_STATE
-  // msg("[RRC_RG][DECODE]Decoding from Srb3 --%s-- \n", &sduP->data[length]);
-  msg ("\n[RRC_RG][DECODE]Decoding from Srb3 -- start of message: \n");
-  rrc_print_buffer (&sduP[length], 15);
-#endif
-  ul_dcch_msg = (UL_DCCH_Message *) (&sduP[length]);
-
-  switch (ul_dcch_msg->message.type) {
-  case UL_DCCH_initialDirectTransfer:
-    status = rrc_rg_msg_initXfer (UE_Id, ul_dcch_msg);
-    break;
-
-  case UL_DCCH_uplinkDirectTransfer:
-    status = rrc_rg_msg_ulXfer (UE_Id, ul_dcch_msg);
-    break;
-
-  default:
-    status = FAILURE;
-  }
-
-#ifdef DEBUG_RRC_STATE
-
-  if (status != SUCCESS)
-    msg ("\n[RRC_RG][DECODE]Message from Srb3 could not be processed. \n");
-
-#endif
-
-  if (status == SUCCESS)
-    RRC_RG_O_NAS_DATA_IND (UE_Id);
-}
-
-//-----------------------------------------------------------------------------
-// Read data in DC FIFO
-int rrc_rg_read_DCin_FIFO (int UE_Id, u8 *buffer, int count)
-{
-  //-----------------------------------------------------------------------------
-  //int maxlen = NAS_MAX_LENGTH;
-  int Message_Id;
-  int data_length;
-  //u8  rcve_buffer[maxlen];
-  struct nas_rg_dc_element *p;
-  int prim_length;
-  int prim_type;
-#ifdef ALLOW_MBMS_PROTOCOL
-  int i;
-#endif
-
-  if (count > 0) {
-#ifdef DEBUG_RRC_STATE
-    msg ("[RRC_RG] Message Received from NAS: -%hx- for UE %d\n", buffer[0], UE_Id);
-#endif
-    p = (struct nas_rg_dc_element *) buffer;
-    prim_length = (int) (p->length);
-    prim_type = (int) (p->type);
-#ifdef DEBUG_RRC_STATE
-    msg ("[RRC_RG] Primitive Type %d,\t Primitive length %d \n", prim_type, prim_length);
-#endif
-    //get the rest of the primitive
-    //count += rtf_get (protocol_bs->rrc.rrc_rg_DCIn_fifo[UE_Id], &(rcve_buffer[NAS_TL_SIZE]), prim_length - NAS_TL_SIZE);
-
-    //switch (rcve_buffer[0]) {
-    switch (prim_type) {
-    case CONN_ESTABLISH_CNF:
-      if (protocol_bs->rrc.Mobile_List[UE_Id].local_connection_ref == (int) (p->nasRGDCPrimitive.conn_establish_conf.localConnectionRef)) {
-        protocol_bs->rrc.establishment_cause = p->nasRGDCPrimitive.conn_establish_conf.status;
-        //Temp FFS
-        //protocol_bs->rrc.Mobile_List[UE_Id].rb_id = (int)(p->nasRGDCPrimitive.conn_establish_conf.num_RBs);
-#ifdef DEBUG_RRC_STATE
-        msg ("[RRC_RG] primitive length: %d\t", (int) (p->length));
-        msg ("Local Connection reference: %d\t", p->nasRGDCPrimitive.conn_establish_conf.localConnectionRef);
-        msg ("Establishment status: %d\n", (int) (protocol_bs->rrc.establishment_cause));
-#endif
-        rrc_rg_fsm_control (UE_Id, NAS_CONN_CNF);
-      }
-
-      break;
-
-    case DATA_TRANSFER_REQ:
-      if (protocol_bs->rrc.Mobile_List[UE_Id].local_connection_ref == (int) (p->nasRGDCPrimitive.data_transfer_req.localConnectionRef)) {
-        data_length = (u16) p->nasRGDCPrimitive.data_transfer_req.nasDataLength;
-        protocol_bs->rrc.Mobile_List[UE_Id].dl_nas_message_ptr = get_free_mem_block (data_length);
-        protocol_bs->rrc.Mobile_List[UE_Id].dl_nas_message_lgth = data_length;
-        //get the associated data
-#ifndef RRC_NETLINK
-        count += rtf_get (protocol_bs->rrc.rrc_rg_DCIn_fifo[UE_Id], (protocol_bs->rrc.Mobile_List[UE_Id].dl_nas_message_ptr)->data, data_length);
-        // memcpy((protocol_bs->rrc.Mobile_List[UE_Id].dl_nas_message_ptr)->data,&(rcve_buffer[p->length]),data_length);
-#else
-        count += rrc_rg_read_data_from_nlh ((char *)(protocol_bs->rrc.Mobile_List[UE_Id].dl_nas_message_ptr)->data, data_length, (int) (p->length));
-#endif
-#ifdef DEBUG_RRC_STATE
-        rrc_print_buffer ((char *)buffer, count);
-        msg ("[RRC_RG] DATA_TRANSFER_REQ primitive length: %d\n", (int) (p->length));
-        msg ("[RRC_RG] Local Connection reference: %d\n", p->nasRGDCPrimitive.data_transfer_req.localConnectionRef);
-        msg ("[RRC_RG] Priority (not used yet): %d\n", p->nasRGDCPrimitive.data_transfer_req.priority);
-        msg ("[RRC_RG] Data length: %d\n", data_length);
-        rrc_print_buffer ((char *) (protocol_bs->rrc.Mobile_List[UE_Id].dl_nas_message_ptr)->data, data_length);
-#endif
-        rrc_rg_msg_dlXfer (UE_Id, &Message_Id);
-        RRC_RG_SEND_AM_SRB3 (UE_Id);
-        free_mem_block (protocol_bs->rrc.Mobile_List[UE_Id].dl_nas_message_ptr);
-      }
-
-      break;
-
-    case RB_ESTABLISH_REQ:
-      if (protocol_bs->rrc.Mobile_List[UE_Id].local_connection_ref == (int) (p->nasRGDCPrimitive.rb_establish_req.localConnectionRef)) {
-#ifdef DEBUG_RRC_STATE
-        rrc_print_buffer ((char *)buffer, count);
-        msg ("[RRC_RG] RB_ESTABLISH_REQ primitive length: %d\n", (int) (p->length));
-        msg ("[RRC_RG] Local Connection reference: %d\n", p->nasRGDCPrimitive.rb_establish_req.localConnectionRef);
-        msg ("[RRC_RG] RB Id: %d ", p->nasRGDCPrimitive.rb_establish_req.rbId);
-        msg ("         QoS Class: %d", p->nasRGDCPrimitive.rb_establish_req.QoSclass);
-        msg ("         IP DSCP: %d\n", p->nasRGDCPrimitive.rb_establish_req.dscp);
-#endif
-        protocol_bs->rrc.Mobile_List[UE_Id].requested_rbId = p->nasRGDCPrimitive.rb_establish_req.rbId;
-        protocol_bs->rrc.Mobile_List[UE_Id].requested_MTrbId = protocol_bs->rrc.Mobile_List[UE_Id].requested_rbId - (UE_Id * maxRB);
-        protocol_bs->rrc.Mobile_List[UE_Id].requested_QoSclass = p->nasRGDCPrimitive.rb_establish_req.QoSclass;
-        protocol_bs->rrc.Mobile_List[UE_Id].requested_dscp = p->nasRGDCPrimitive.rb_establish_req.dscp;
-
-        if ((p->nasRGDCPrimitive.rb_establish_req.QoSclass >= 1) || (p->nasRGDCPrimitive.rb_establish_req.QoSclass <= RRC_QOS_LAST)) {
-          rrc_rg_fsm_control (UE_Id, NAS_RB_ESTAB);
-        } else {
-          RRC_RG_O_O_NAS_RB_Failure (UE_Id);
-        }
-      }
-
-      break;
-
-    case RB_RELEASE_REQ:
-      if (protocol_bs->rrc.Mobile_List[UE_Id].local_connection_ref == (int) (p->nasRGDCPrimitive.rb_release_req.localConnectionRef)) {
-#ifdef DEBUG_RRC_STATE
-        rrc_print_buffer ((char *)buffer, count);
-        msg ("[RRC_RG] RB_RELEASE_REQ primitive length: %d\n", (int) (p->length));
-        msg ("[RRC_RG] Local Connection reference: %d\n", p->nasRGDCPrimitive.rb_release_req.localConnectionRef);
-        msg ("[RRC_RG] RB Id: %d \n", p->nasRGDCPrimitive.rb_release_req.rbId);
-#endif
-        protocol_bs->rrc.Mobile_List[UE_Id].requested_rbId = p->nasRGDCPrimitive.rb_establish_req.rbId;
-        protocol_bs->rrc.Mobile_List[UE_Id].requested_MTrbId = protocol_bs->rrc.Mobile_List[UE_Id].requested_rbId - (UE_Id * maxRB);
-        rrc_rg_fsm_control (UE_Id, NAS_RB_RELEASE);
-      }
-
-      break;
-#ifdef ALLOW_MBMS_PROTOCOL
-
-    case MBMS_UE_NOTIFY_REQ:
-      if (protocol_bs->rrc.Mobile_List[UE_Id].local_connection_ref  == (int)(p->nasRGDCPrimitive.mbms_ue_notify_req.localConnectionRef)) {
-        //Copy primitive information into the control block
-        p_rg_mbms->nas_ueID = (int)(p->nasRGDCPrimitive.mbms_ue_notify_req.localConnectionRef);
-
-        for (i = 0; i<MAX_MBMS_SERVICES; i++) {
-          p_rg_mbms->nas_joinedServices[i] = p->nasRGDCPrimitive.mbms_ue_notify_req.joined_services[i].mbms_serviceId;
-          p_rg_mbms->nas_leftServices[i] = p->nasRGDCPrimitive.mbms_ue_notify_req.left_services[i].mbms_serviceId;
-        }
-
-#ifdef DEBUG_RRC_STATE
-        rrc_print_buffer((char *)buffer,count);
-        msg("[RRC_RG][MBMS] MBMS_UE_NOTIFY_REQ primitive length: %d\n",(int)(p->length));
-        msg("[RRC_RG][MBMS] Local Connection reference: %d\n",p->nasRGDCPrimitive.mbms_ue_notify_req.localConnectionRef);
-        // msg("[RRC_RG][MBMS] Lists of joined services and left services are not shown \n");
-#endif
-        // rrc_rg_mbms_NAS_Notification_rx(UE_Id); //send notify to this MT
-        rrc_rg_mbms_NAS_Notification_rx(); //send notify to this MT
-      }
-
-      break;
-#endif
-
-      // end MBMS
-      // Next message to be transferred to GC FIFO.
-    case ENB_MEASUREMENT_REQ:
-      // TEMP : CELL_ID coordination to be checked
-      //if (protocol_bs->rrc.rg_cell_id  == (int)(p->nasRGDCPrimitive.eNBmeasurement_req.cell_id)){
-      protocol_bs->rrc.eNB_measures_flag = 1;
-#ifdef DEBUG_RRC_STATE
-      rrc_print_buffer((char *)buffer,count);
-      msg("[RRC_RG] ENB_MEASUREMENT_REQ primitive length: %d\n",(int)(p->length));
-      msg("[RRC_RG] ENB measurement started for Cell_ID: %d\n",p->nasRGDCPrimitive.eNBmeasurement_req.cell_id);
-#endif
-      //}
-      break;
-
-    default:
-      msg ("[RRC_RG] Invalid message received in DC SAP\n");
-      rrc_print_buffer ((char *)buffer, count);
-      count = -1;
-      break;
-    }
-  }
-
-  return count;
-  return 0;
-}
-
-//-----------------------------------------------------------------------------
-int rrc_rg_read_GC_FIFO (u8 *buffer, int count)
-{
-  //-----------------------------------------------------------------------------
-  int data_length, category, new_period;
-  int remaining_data = 0;
-  //u8  rcve_buffer[maxlen];
-  struct nas_rg_gc_element *p;
-  int prim_length;
-  int prim_type;
-
-  if (count > 0) {
-#ifdef DEBUG_RRC_BROADCAST
-    msg ("[RRC_RG] Message Received from NAS - GC SAP: -%hx- \n", buffer[0]);
-#endif
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-    rrc_print_buffer ((char *)buffer, count);
-#endif
-    p = (struct nas_rg_gc_element *) buffer;
-    prim_length = (int) (p->length);
-    prim_type = (int) (p->type);
-#ifdef DEBUG_RRC_BROADCAST
-    msg ("[RRC_RG] Primitive Type %d,\t Primitive length %d \n", prim_type, prim_length);
-#endif
-    //get the rest of the primitive
-    //count += rtf_get (protocol_bs->rrc.rrc_rg_GC_fifo, &(rcve_buffer[NAS_TL_SIZE]), prim_length - NAS_TL_SIZE);
-
-    switch (prim_type) {
-    case INFO_BROADCAST_REQ:
-      data_length = (u16) p->nasRGGCPrimitive.broadcast_req.nasDataLength;
-      category = p->nasRGGCPrimitive.broadcast_req.category;
-      new_period = p->nasRGGCPrimitive.broadcast_req.period;
-
-      switch (category) {
-      case NAS_SIB1:
-
-        // size is limited - truncate if too large
-        if (data_length > maxSIB1NAS) {
-          remaining_data = data_length - maxSIB1NAS;
-          data_length = maxSIB1NAS;
-        }
-
-        protocol_bs->rrc.rg_bch_blocks.currSIB1.subnet_NAS_SysInfo.numocts = data_length;
-        //get the associated data
-#ifndef RRC_NETLINK
-        count += rtf_get (protocol_bs->rrc.rrc_rg_GC_fifo, protocol_bs->rrc.rg_bch_blocks.currSIB1.subnet_NAS_SysInfo.data, data_length);
-#else
-        count += rrc_rg_read_data_from_nlh ((char *)(protocol_bs->rrc.rg_bch_blocks.currSIB1.subnet_NAS_SysInfo.data), data_length, (int) (p->length));
-#endif
-
-        if (new_period == 0)
-          new_period = 100;     //Temp, block one-time shot
-
-#ifndef USER_MODE
-        rrc_update_SIB1_period (new_period);
-#endif
-        rrc_init_sib1 ();
-        break;
-
-      case NAS_SIB18:
-
-        // size is limited - truncate if too large
-        if (data_length > maxSIBNAS) {
-          remaining_data = data_length - maxSIBNAS;
-          data_length = maxSIBNAS;
-        }
-
-        protocol_bs->rrc.rg_bch_blocks.currSIB18.cellIdentities.numocts = data_length;
-        //get the associated data
-#ifndef RRC_NETLINK
-        count += rtf_get (protocol_bs->rrc.rrc_rg_GC_fifo, protocol_bs->rrc.rg_bch_blocks.currSIB18.cellIdentities.data, data_length);
-#else
-        count += rrc_rg_read_data_from_nlh ((char *)(protocol_bs->rrc.rg_bch_blocks.currSIB18.cellIdentities.data), data_length, (int) (p->length));
-#endif
-
-        if (new_period == 0)
-          new_period = 500;     //Temp, block one-time shot
-
-        rrc_process_sib18 ();
-#ifndef USER_MODE
-        rrc_update_SIB18_period (new_period);
-#endif
-        rrc_init_sib18 ();
-        break;
-
-      default:
-        msg ("[RRC_RG] Invalid categogy received from NAS in Broadcast_req: %d \n", category);
-      }
-
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-      msg ("[RRC_RG] INFO_BROADCAST_REQ primitive length: %d\n", (int) (p->length));
-      // rrc_print_buffer(rcve_buffer,100);
-      msg ("[RRC_RG] Period: %d\t", new_period);
-      msg ("  Category: %d\t", category);
-      msg ("  Data length: %d\n", data_length);
-
-      switch (category) {
-      case NAS_SIB1:
-        msg ("[RRC_RG] Data SIB1 : %s\n", (char *) protocol_bs->rrc.rg_bch_blocks.currSIB1.subnet_NAS_SysInfo.data);
-        rrc_print_buffer ((char *) protocol_bs->rrc.rg_bch_blocks.currSIB1.subnet_NAS_SysInfo.data, data_length);
-        break;
-
-      case NAS_SIB18:
-        msg ("[RRC_RG] Data SIB18 : %s\n", (char *) protocol_bs->rrc.rg_bch_blocks.currSIB18.cellIdentities.data);
-        rrc_print_buffer ((char *) protocol_bs->rrc.rg_bch_blocks.currSIB18.cellIdentities.data, data_length);
-        break;
-
-      default:
-        msg ("[RRC_RG] Unknown category for data in INFO_BROADCAST_REQ primitive %d\n", category);
-        break;
-      }
-
-#endif
-      //read remaining data if any
-#ifndef RRC_NETLINK
-
-      if (remaining_data > 0 && remaining_data < NAS_MAX_LENGTH) {
-        rtf_get (protocol_bs->rrc.rrc_rg_GC_fifo, &(buffer[0]), remaining_data);
-      }
-
-#endif
-      break;
-      //
-#ifdef ALLOW_MBMS_PROTOCOL
-
-    case MBMS_BEARER_ESTABLISH_REQ:
-      // Temp : Only one service and one bearer at a time
-#ifdef DEBUG_RRC_STATE
-      rrc_print_buffer((char *)buffer,100);
-      msg("[RRC_RG][MBMS] MBMS_BEARER_ESTABLISH_REQ primitive length: %d\n",(int)(p->length));
-      msg("[RRC_RG][MBMS] Service Id: %d\n", p->nasRGGCPrimitive.mbms_establish_req.mbms_serviceId);
-      msg("[RRC_RG][MBMS] Session Id: %d \n",p->nasRGGCPrimitive.mbms_establish_req.mbms_sessionId);
-      msg("[RRC_RG][MBMS] RB Id: %d \n",p->nasRGGCPrimitive.mbms_establish_req.mbms_rbId);
-      msg("[RRC_RG][MBMS] QoS Class: %d\n",p->nasRGGCPrimitive.mbms_establish_req.mbms_QoSclass);
-      msg("[RRC_RG][MBMS] Sap Id: %d\n",p->nasRGGCPrimitive.mbms_establish_req.mbms_sapId);
-      msg("[RRC_RG][MBMS] Duration: %d\n",p->nasRGGCPrimitive.mbms_establish_req.mbms_duration);
-#endif
-
-      if (p_rg_mbms->mbms_num_active_service == 0) {
-        //Copy all received information into the control block.
-        p_rg_mbms->nas_serviceId = p->nasRGGCPrimitive.mbms_establish_req.mbms_serviceId;
-        p_rg_mbms->nas_sessionId = p->nasRGGCPrimitive.mbms_establish_req.mbms_sessionId;
-        p_rg_mbms->nas_rbId = p->nasRGGCPrimitive.mbms_establish_req.mbms_rbId;
-        p_rg_mbms->nas_QoSclass = p->nasRGGCPrimitive.mbms_establish_req.mbms_QoSclass;
-        p_rg_mbms->nas_sapId = p->nasRGGCPrimitive.mbms_establish_req.mbms_sapId;
-        p_rg_mbms->nas_duration = p->nasRGGCPrimitive.mbms_establish_req.mbms_duration;
-        // rrc_rg_mbms_NAS_ServStart_rx((MBMS_ServiceIdentity*) &p->nasRGGCPrimitive.mbms_establish_req.mbms_serviceId);
-        rrc_rg_mbms_NAS_ServStart_rx();
-      } else {
-        // No specific action is planned - Only log an error message
-        msg("\n[RRC_RG][MBMS] ERROR - Service Id: %d cannot be activated. Already one Service active.\n\n", p->nasRGGCPrimitive.mbms_establish_req.mbms_serviceId);
-        p_rg_mbms->nas_status = FAILURE;
-        RRC_RG_O_O_NAS_MBMS_RB_ESTAB_CNF ();
-      }
-
-      break;
-
-    case MBMS_BEARER_RELEASE_REQ:
-      //Copy all other information into the control block.
-      p_rg_mbms->nas_serviceId = p->nasRGGCPrimitive.mbms_release_req.mbms_serviceId;
-      p_rg_mbms->nas_sessionId = p->nasRGGCPrimitive.mbms_release_req.mbms_sessionId;
-      p_rg_mbms->nas_rbId      = p->nasRGGCPrimitive.mbms_release_req.mbms_rbId;
-#ifdef DEBUG_RRC_STATE
-      rrc_print_buffer((char *)buffer,100);
-      msg("[RRC_RG][MBMS] MBMS_BEARER_RELEASE_REQ primitive length: %d\n",(int)(p->length));
-      msg("[RRC_RG][MBMS] Service Id: %d\n", p->nasRGGCPrimitive.mbms_release_req.mbms_serviceId);
-      msg("[RRC_RG][MBMS] Session Id: %d \n",p->nasRGGCPrimitive.mbms_release_req.mbms_sessionId);
-      msg("[RRC_RG][MBMS] RB Id: %d \n",p->nasRGGCPrimitive.mbms_release_req.mbms_rbId);
-#endif
-      // rrc_rg_mbms_NAS_ServStop_rx((MBMS_ServiceIdentity*) &p->nasRGGCPrimitive.mbms_release_req.mbms_serviceId);
-      rrc_rg_mbms_NAS_ServStop_rx();
-      break;
-#endif
-
-      // end MBMS
-    default:
-      // TODO : remove all remaining data
-      msg ("[RRC_RG] Invalid message received on GC SAP\n");
-      //rrc_print_buffer(rcve_buffer,count);
-      count = -1;
-      break;
-    }
-  }
-
-  return count;
-}
-
-//-----------------------------------------------------------------------------
-int rrc_rg_read_NT_FIFO (u8 *buffer, int count)
-{
-  //-----------------------------------------------------------------------------
-  int data_length;
-  int Message_Id;
-  int UE_Id;
-  struct nas_rg_nt_element *p;
-  int prim_length;
-  int prim_type;
-
-  if (count > 0) {
-#ifdef DEBUG_RRC_STATE
-    msg ("[RRC_RG] Message Received from NAS - NT SAP: -%hx- \n", buffer[0]);
-#endif
-    p = (struct nas_rg_nt_element *) buffer;
-    prim_length = (int) (p->length);
-    prim_type = (int) (p->type);
-#ifdef DEBUG_RRC_STATE
-    msg ("[RRC_RG] Primitive Type %d,\t Primitive length %d \n", prim_type, prim_length);
-#endif
-
-    //rrc_print_buffer ((char *)rcve_buffer, 100);
-    switch (prim_type) {
-    case PAGING_REQ:
-      data_length = (u16) p->nasRGNTPrimitive.paging_req.nasDataLength;
-      UE_Id = p->nasRGNTPrimitive.paging_req.UeId;
-      protocol_bs->rrc.Mobile_List[UE_Id].paging_message_ptr = get_free_mem_block (data_length);
-      protocol_bs->rrc.Mobile_List[UE_Id].paging_message_lgth = data_length;
-      //get the associated data
-#ifndef RRC_NETLINK
-      count += rtf_get (protocol_bs->rrc.rrc_rg_NT_fifo, (protocol_bs->rrc.Mobile_List[UE_Id].paging_message_ptr)->data, data_length);
-#else
-      count += rrc_rg_read_data_from_nlh ((char *)(protocol_bs->rrc.Mobile_List[UE_Id].paging_message_ptr)->data, data_length, (int) (p->length));
-#endif
-      // memcpy((protocol_bs->rrc.Mobile_List[UE_Id].paging_message_ptr)->data, &(rcve_buffer[p->length]),data_length);
-#ifdef DEBUG_RRC_STATE
-      //rrc_print_buffer ((char *)rcve_buffer, 100);
-      msg ("[RRC_RG] PAGING_REQ primitive length: %d\n", (int) (p->length));
-      msg ("[RRC_RG] UE Id: %d\n", p->nasRGNTPrimitive.paging_req.UeId);
-      msg ("[RRC_RG] Data length: %d\n", data_length);
-      msg ("[RRC_RG] Data %s\n", (protocol_bs->rrc.Mobile_List[UE_Id].paging_message_ptr)->data);
-      rrc_print_buffer ((char *) (protocol_bs->rrc.Mobile_List[UE_Id].paging_message_ptr)->data, data_length);
-#endif
-      // Send paging to MS
-      rrc_rg_msg_pagingt2 (UE_Id, &Message_Id);
-      RRC_RG_O_O_SEND_DCCH_AM (UE_Id);
-      free_mem_block (protocol_bs->rrc.Mobile_List[UE_Id].paging_message_ptr);
-      break;
-
-    default:
-      msg ("[RRC_RG] Invalid message received on NT SAP\n");
-      rrc_print_buffer ((char *)buffer, count);
-      count = -1;
-      break;
-    }
-  }
-
-  return count;
-}
diff --git a/openair2/RRC/CELLULAR/rrc_rg_msg_peer.c b/openair2/RRC/CELLULAR/rrc_rg_msg_peer.c
deleted file mode 100755
index 9ae1e6a4e1..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg_msg_peer.c
+++ /dev/null
@@ -1,631 +0,0 @@
-/***************************************************************************
-                          rrc_rg_msg_peer.c  -  description
-                             -------------------
-    begin                : Jan 6, 2003
-    copyright            : (C) 2003, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Procedures to perform encoding/decoding of RRC messages in RG
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_rg_vars.h"
-#include "rrc_msg_class.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_msg.h"
-#include "rrc_proto_int.h"
-#include "rrc_proto_fsm.h"
-
-/**************************************************************/
-/*  Uplink CCCH messages - Decode                             */
-/**************************************************************/
-/*  RRCConnectionRequest  */
-//-----------------------------------------------------------------------------
-int rrc_rg_msg_connreq(int * pUE ,UL_CCCH_Message * ul_ccch_msg)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  int UE_Id;
-
-  if ((UE_Id = get_new_UE_Id(&(ul_ccch_msg->message.content.rrcConnectionRequest.imei))) == 999)
-    return FAILURE;
-
-  *pUE = UE_Id;
-
-  status = rrc_PERDec_RRCConnectionRequest(UE_Id,(RRCConnectionRequest*) &(ul_ccch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Connection Request Received - status : %d\n", status);
-  rrc_mt_list_print(UE_Id);
-#endif
-  return status;
-}
-
-/*  CellUpdate  */
-//-----------------------------------------------------------------------------
-int rrc_rg_msg_cellUpdate(int* pUE ,UL_CCCH_Message * ul_ccch_msg)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  int UE_Id;
-
-  if  (ul_ccch_msg->integrityCheckInfo != 123)
-    return P_INVINTEGRITY;
-
-  status = rrc_PERDec_CellUpdate(pUE,(CellUpdate*) &(ul_ccch_msg->message.content));
-
-  if (status == SUCCESS)
-    UE_Id = *pUE ;
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Cell Update Received - status : %d\n", status);
-  rrc_mt_list_print(UE_Id);
-#endif
-  return status;
-}
-
-/**************************************************************/
-/*  Uplink DCCH messages - Decode                             */
-/**************************************************************/
-/*  RRCConnectionSetupComplete  */
-//-----------------------------------------------------------------------------
-int rrc_rg_msg_connsucompl(int UE_Id ,UL_DCCH_Message * ul_dcch_msg)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  status = rrc_PERDec_RRCConnectionSetupComplete(UE_Id,(RRCConnectionSetupComplete*) &(ul_dcch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Connection Setup Complete Received - status : %d\n", status);
-  rrc_mt_list_print(UE_Id);
-#endif
-  return status;
-}
-
-/*  RRCConnectionRelease_UL  */
-//-----------------------------------------------------------------------------
-int rrc_rg_msg_connrelUL(int UE_Id ,UL_DCCH_Message * ul_dcch_msg)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  if  (ul_dcch_msg->integrityCheckInfo != 123)
-    return P_INVINTEGRITY;
-
-  status = rrc_PERDec_RRCConnectionRelease_UL(UE_Id,(RRCConnectionRelease_UL*) &(ul_dcch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] RRC Connection Release UL Received - status : %d\n", status);
-  rrc_mt_list_print(UE_Id);
-#endif
-  return status;
-}
-
-/*  InitialDirectTransfer  */
-//-----------------------------------------------------------------------------
-int rrc_rg_msg_initXfer(int UE_Id ,UL_DCCH_Message * ul_dcch_msg)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  if  (ul_dcch_msg->integrityCheckInfo != 123)
-    return P_INVINTEGRITY;
-
-  status = rrc_PERDec_InitialDirectTransfer(UE_Id,(InitialDirectTransfer*) &(ul_dcch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Initial Direct Transfer Received - status : %d\n", status);
-  //rrc_mt_list_print(UE_Id);
-#endif
-  return status;
-}
-/*  UplinkDirectTransfer  */
-//-----------------------------------------------------------------------------
-int rrc_rg_msg_ulXfer(int UE_Id ,UL_DCCH_Message * ul_dcch_msg)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  if  (ul_dcch_msg->integrityCheckInfo != 123)
-    return P_INVINTEGRITY;
-
-  status = rrc_PERDec_UplinkDirectTransfer(UE_Id,(UplinkDirectTransfer*) &(ul_dcch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Uplink Direct Transfer Received - status : %d\n", status);
-  //rrc_mt_list_print(UE_Id);
-#endif
-  return status;
-}
-
-/*  RadioBearerSetupComplete  */
-//-----------------------------------------------------------------------------
-int rrc_rg_msg_rbsetupcompl(int UE_Id ,UL_DCCH_Message * ul_dcch_msg)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  if  (ul_dcch_msg->integrityCheckInfo != 123)
-    return P_INVINTEGRITY;
-
-  status = rrc_PERDec_RadioBearerSetupComplete(UE_Id,(RadioBearerSetupComplete*) &(ul_dcch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Radio Bearer Setup Complete Received - status : %d\n", status);
-  rrc_mt_list_print(UE_Id);
-#endif
-  return status;
-}
-/*  RadioBearerSetupFailure  */
-//-----------------------------------------------------------------------------
-int rrc_rg_msg_rbsetupfail(int UE_Id ,UL_DCCH_Message * ul_dcch_msg)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  if  (ul_dcch_msg->integrityCheckInfo != 123)
-    return P_INVINTEGRITY;
-
-  status = rrc_PERDec_RadioBearerSetupFailure(UE_Id,(RadioBearerSetupFailure*) &(ul_dcch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Radio Bearer Setup Failure Received - status : %d\n", status);
-  rrc_mt_list_print(UE_Id);
-#endif
-  return status;
-}
-/*  RadioBearerReleaseComplete  */
-//-----------------------------------------------------------------------------
-int rrc_rg_msg_rbreleasecompl(int UE_Id ,UL_DCCH_Message * ul_dcch_msg)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  if  (ul_dcch_msg->integrityCheckInfo != 123)
-    return P_INVINTEGRITY;
-
-  status = rrc_PERDec_RadioBearerReleaseComplete(UE_Id,(RadioBearerReleaseComplete*) &(ul_dcch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Radio Bearer Release Complete Received - status : %d\n", status);
-  rrc_mt_list_print(UE_Id);
-#endif
-  return status;
-}
-/*  RadioBearerReleaseFailure  */
-//-----------------------------------------------------------------------------
-int rrc_rg_msg_rbreleasefail(int UE_Id ,UL_DCCH_Message * ul_dcch_msg)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  if  (ul_dcch_msg->integrityCheckInfo != 123)
-    return P_INVINTEGRITY;
-
-  status = rrc_PERDec_RadioBearerReleaseFailure(UE_Id,(RadioBearerReleaseFailure*) &(ul_dcch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Radio Bearer Release Failure Received - status : %d\n", status);
-  rrc_mt_list_print(UE_Id);
-#endif
-  return status;
-}
-
-/*  Measurement Report   */
-//-----------------------------------------------------------------------------
-int rrc_rg_msg_measrepr(int UE_Id ,UL_DCCH_Message * ul_dcch_msg)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  if  (ul_dcch_msg->integrityCheckInfo != 123)
-    return P_INVINTEGRITY;
-
-  status = rrc_PERDec_MeasurementReport(UE_Id,(MeasurementReport*) &(ul_dcch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Measurement Report Received - status : %d\n", status);
-  rrc_mt_list_print(UE_Id);
-#endif
-  return status;
-}
-
-/*  UE Capability Information  */
-//-----------------------------------------------------------------------------
-int rrc_rg_msg_ueCapInfo(int UE_Id ,UL_DCCH_Message * ul_dcch_msg)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  if  (ul_dcch_msg->integrityCheckInfo != 123)
-    return P_INVINTEGRITY;
-
-  status = rrc_PERDec_UECapabilityInformation(UE_Id,(UECapabilityInformation*) &(ul_dcch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] UE Capability Information Received - status : %d\n", status);
-  msg("[RRC_MSG] UE_Id = %d, Kernel Release = %d, ", UE_Id, protocol_bs->rrc.Mobile_List[UE_Id].ind_eurecomKernelRelease);
-  msg("Access Stratum Release = ");
-
-  switch(protocol_bs->rrc.Mobile_List[UE_Id].ind_accessStratumRelease) {
-  case ACCESS_STRATUM_RELEASE_INDICATOR_REL_4:
-    msg("REL-4\n");
-    break;
-
-  case ACCESS_STRATUM_RELEASE_INDICATOR_REL_5:
-    msg("REL-5\n");
-    break;
-
-  case ACCESS_STRATUM_RELEASE_INDICATOR_REL_6:
-    msg("REL-6\n");
-    break;
-
-  default:
-    msg("Unrecoginized!\n");
-  }
-
-  rrc_mt_list_print(UE_Id);
-#endif
-  return status;
-}
-
-
-/**************************************************************/
-/*  Downlink CCCH messages - Encode                           */
-/**************************************************************/
-/*  RRCConnectionSetup  */
-//-----------------------------------------------------------------------------
-void rrc_rg_msg_connsetup(int UE_Id, int *Message_Id)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  DL_CCCH_Message * dl_ccch_msg;
-  mem_block_t *p;
-
-  protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].msg_type = DL_CCCH_rrcConnectionSetup;
-  protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id =
-    (protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id +1) %4;
-  //
-  // prepare encoding
-  // *Message_Id = ++ protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_Id;
-  *Message_Id = UE_Id;
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length =
-    MSG_HEAD_LGTH + sizeof(RRCConnectionSetup);
-  // Temp - Test/Messages
-  //   dl_ccch_msg = malloc (protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  //   memset (dl_ccch_msg, 0, protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  p = get_free_mem_block(protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  dl_ccch_msg = (struct DL_CCCH_Message *)p->data;
-  //
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.mem_block_ptr = p;
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_ptr = dl_ccch_msg;
-
-  // Encode
-  dl_ccch_msg->integrityCheckInfo = 0; // No check with RRC Connection Setup
-  dl_ccch_msg->message.type = DL_CCCH_rrcConnectionSetup;
-  status = rrc_PEREnc_RRCConnectionSetup(UE_Id,(RRCConnectionSetup*) &(dl_ccch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] RRC Connection Setup - status : %d - length : %d\n",
-      status, protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  rrc_print_buffer((char*)protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_ptr,protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-#endif
-}
-
-/*  RRCConnectionReject */
-//-----------------------------------------------------------------------------
-void rrc_rg_msg_connreject(int UE_Id, int *Message_Id)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  DL_CCCH_Message * dl_ccch_msg;
-  mem_block_t *p;
-
-  protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].msg_type = DL_CCCH_rrcConnectionReject;
-  protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id =
-    (protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id +1) %4;
-  //
-  // prepare encoding
-  // *Message_Id = ++ protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_Id;
-  *Message_Id = UE_Id;
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length = MSG_HEAD_LGTH + sizeof(RRCConnectionReject);
-  // Temp - Test/Messages
-  //   dl_ccch_msg = malloc (protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  //   memset (dl_ccch_msg, 0, protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  p = get_free_mem_block(protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  dl_ccch_msg = (struct DL_CCCH_Message *)p->data;
-  //
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.mem_block_ptr = p;
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_ptr = dl_ccch_msg;
-  // Encode
-  dl_ccch_msg->integrityCheckInfo = 0; // No check with RRC Connection Reject
-  dl_ccch_msg->message.type = DL_CCCH_rrcConnectionReject;
-  status = rrc_PEREnc_RRCConnectionReject(UE_Id,(RRCConnectionReject*) &(dl_ccch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] RRC Connection Reject - status : %d - length : %d\n",
-      status, protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  rrc_print_buffer((char*)protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_ptr,protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-#endif
-}
-
-/*  CellUpdateConfirm_CCCH  */
-//-----------------------------------------------------------------------------
-void rrc_rg_msg_cellupdatecnfccch(int UE_Id, int *Message_Id)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  DL_CCCH_Message * dl_ccch_msg;
-  mem_block_t *p;
-
-  protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].msg_type = DL_CCCH_cellUpdateConfirm;
-  protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id =
-    (protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id +1) %4;
-  //
-  // prepare encoding
-  //   *Message_Id = ++ protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_Id;
-  *Message_Id = UE_Id;
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length = MSG_HEAD_LGTH + sizeof(CellUpdateConfirm_CCCH);
-  // Temp - Test/Messages
-  //   dl_ccch_msg = malloc (protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  //   memset (dl_ccch_msg, 0, protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  p = get_free_mem_block(protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  dl_ccch_msg = (struct DL_CCCH_Message *)p->data;
-  //
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.mem_block_ptr = p;
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_ptr = dl_ccch_msg;
-
-  // Encode
-  dl_ccch_msg->integrityCheckInfo = 123;
-  dl_ccch_msg->message.type = DL_CCCH_cellUpdateConfirm;
-  status = rrc_PEREnc_CellUpdateConfirm_CCCH(UE_Id,(CellUpdateConfirm_CCCH*) &(dl_ccch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Cell Update Confirm (CCCH) - status : %d - length : %d\n",
-      status, protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  rrc_print_buffer((char*)protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_ptr,protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-#endif
-}
-
-
-/**************************************************************/
-/*  Downlink DCCH messages - Encode                           */
-/**************************************************************/
-/*  RadioBearerSetup  */
-//-----------------------------------------------------------------------------
-void rrc_rg_msg_rbsetup(int UE_Id, int *Message_Id)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  DL_DCCH_Message * dl_dcch_msg;
-  mem_block_t *p;
-
-  protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].msg_type = DL_DCCH_radioBearerSetup;
-  protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id =
-    (protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id +1) %4;
-  //
-  // prepare encoding
-  // *Message_Id = ++ protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_Id;
-  *Message_Id = UE_Id;
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length =
-    MSG_HEAD_LGTH + sizeof(RadioBearerSetup);
-  // Temp - Test/Messages
-  //   dl_dcch_msg = malloc (protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  //   memset (dl_dcch_msg, 0, protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  p = get_free_mem_block(protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  dl_dcch_msg = (struct DL_DCCH_Message *)p->data;
-  //
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.mem_block_ptr = p;
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_ptr = dl_dcch_msg;
-
-  // Encode
-  dl_dcch_msg->integrityCheckInfo = 123;
-  dl_dcch_msg->message.type = DL_DCCH_radioBearerSetup;
-  status = rrc_PEREnc_RadioBearerSetup(UE_Id,(RadioBearerSetup*) &(dl_dcch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Radio Bearer Setup - status : %d - length : %d\n",
-      status, protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  rrc_print_buffer((char*)protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_ptr,protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-#endif
-}
-
-/*  RadioBearerRelease   */
-//-----------------------------------------------------------------------------
-void rrc_rg_msg_rbrelease(int UE_Id, int *Message_Id)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  DL_DCCH_Message * dl_dcch_msg;
-  mem_block_t *p;
-
-  protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].msg_type = DL_DCCH_radioBearerRelease;
-  protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id =
-    (protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id +1) %4;
-  //
-  // prepare encoding
-  //   *Message_Id = ++ protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_Id;
-  *Message_Id = UE_Id;
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length =
-    MSG_HEAD_LGTH + sizeof(RadioBearerRelease);
-  // Temp - Test/Messages
-  //   dl_dcch_msg = malloc (protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  //   memset (dl_dcch_msg, 0, protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  p = get_free_mem_block(protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  dl_dcch_msg = (struct DL_DCCH_Message *)p->data;
-  //
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.mem_block_ptr = p;
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_ptr = dl_dcch_msg;
-
-  // Encode
-  dl_dcch_msg->integrityCheckInfo = 123;
-  dl_dcch_msg->message.type = DL_DCCH_radioBearerRelease;
-  status = rrc_PEREnc_RadioBearerRelease(UE_Id,(RadioBearerRelease*) &(dl_dcch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Radio Bearer Release - status : %d - length : %d\n",
-      status, protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  rrc_print_buffer((char*)protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_ptr,protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-#endif
-}
-
-/*  DownlinkDirectTransfer */
-//-----------------------------------------------------------------------------
-void rrc_rg_msg_dlXfer(int UE_Id, int *Message_Id)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  DL_DCCH_Message * dl_dcch_msg;
-  mem_block_t *p;
-
-  protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].msg_type = DL_DCCH_downlinkDirectTransfer;
-  protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id =
-    (protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id +1) %4;
-  //
-  // prepare encoding
-  // *Message_Id = ++ protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_Id;
-  *Message_Id = UE_Id;
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length =
-    MSG_HEAD_LGTH + sizeof(DownlinkDirectTransfer);
-  // Temp - Test/Messages
-  //   dl_dcch_msg = malloc (protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  //   memset (dl_dcch_msg, 0, protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  p = get_free_mem_block(protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  dl_dcch_msg = (struct DL_DCCH_Message *)p->data;
-  //
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.mem_block_ptr = p;
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_ptr = dl_dcch_msg;
-
-  // Encode
-  dl_dcch_msg->integrityCheckInfo = 123;
-  dl_dcch_msg->message.type = DL_DCCH_downlinkDirectTransfer;
-  status = rrc_PEREnc_DownlinkDirectTransfer(UE_Id,(DownlinkDirectTransfer*) &(dl_dcch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Downlink Direct Transfer - status : %d - length : %d\n",
-      status, protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  rrc_print_buffer((char*)protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_ptr,protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-#endif
-}
-
-/*  PagingType2   */
-//-----------------------------------------------------------------------------
-void rrc_rg_msg_pagingt2(int UE_Id, int *Message_Id)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  DL_DCCH_Message * dl_dcch_msg;
-  mem_block_t *p;
-
-  protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].msg_type = DL_DCCH_pagingType2;
-  protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id =
-    (protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id +1) %4;
-  //
-  // prepare encoding
-  //   *Message_Id = ++ protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_Id;
-  *Message_Id = UE_Id;
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length =
-    MSG_HEAD_LGTH + sizeof(PagingType2);
-  // Temp - Test/Messages
-  // dl_dcch_msg = malloc (protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  // memset (dl_dcch_msg, 0, protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  p = get_free_mem_block(protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  dl_dcch_msg = (struct DL_DCCH_Message *)p->data;
-  //
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.mem_block_ptr = p;
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_ptr = dl_dcch_msg;
-
-  // Encode
-  dl_dcch_msg->integrityCheckInfo = 123;
-  dl_dcch_msg->message.type = DL_DCCH_pagingType2;
-  status = rrc_PEREnc_PagingType2(UE_Id,(PagingType2*) &(dl_dcch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Paging Type 2 - status : %d - length : %d\n",
-      status, protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  rrc_print_buffer((char*)protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_ptr,protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-#endif
-}
-
-/*  Measurement Control   */
-//-----------------------------------------------------------------------------
-void rrc_rg_msg_measctl(int UE_Id, int *Message_Id)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  DL_DCCH_Message * dl_dcch_msg;
-  mem_block_t *p;
-
-  protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].msg_type = DL_DCCH_measurementControl;
-  protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id =
-    (protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id +1) %4;
-  //
-  // prepare encoding
-  *Message_Id = UE_Id;
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length = MSG_HEAD_LGTH + sizeof(MeasurementControl);
-  // Temp - Test/Messages
-  //   dl_dcch_msg = malloc (protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  //   memset (dl_dcch_msg, 0, protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  p = get_free_mem_block(protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  dl_dcch_msg = (struct DL_DCCH_Message *)p->data;
-  //
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.mem_block_ptr = p;
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_ptr = dl_dcch_msg;
-
-  // Encode
-  dl_dcch_msg->integrityCheckInfo = 123;
-  dl_dcch_msg->message.type = DL_DCCH_measurementControl;
-  status = rrc_PEREnc_MeasurementControl(UE_Id,(MeasurementControl*) &(dl_dcch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Measurement Control - status : %d - length : %d\n",
-      status, protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  rrc_print_buffer((char*)protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_ptr,protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-#endif
-}
-
-
-/*  UE Capability Information Confirm */
-//-----------------------------------------------------------------------------
-void rrc_rg_msg_ueCapInfoCnf(int UE_Id, int *Message_Id)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  DL_DCCH_Message * dl_dcch_msg;
-  mem_block_t *p;
-
-  protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].msg_type = DL_DCCH_measurementControl;
-  // TODO
-  //protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id =
-  //         (protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id +1) %4;
-
-  // prepare encoding
-  *Message_Id = UE_Id;
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length = MSG_HEAD_LGTH + sizeof(UECapabilityInformationConfirm);
-  //Allocation
-  p = get_free_mem_block(protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  dl_dcch_msg = (struct DL_DCCH_Message *)p->data;
-  //
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.mem_block_ptr = p;
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_ptr = dl_dcch_msg;
-
-  // Encode
-  dl_dcch_msg->integrityCheckInfo = 123;
-  dl_dcch_msg->message.type =  DL_DCCH_ueCapabilityInformationConfirm;
-  status = rrc_PEREnc_UECapabilityInformationConfirm(UE_Id, (UECapabilityInformationConfirm*) &(dl_dcch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Measurement Control - status : %d - length : %d\n",
-      status, protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-  rrc_print_buffer((char*)protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_ptr,protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length);
-#endif
-}
-
diff --git a/openair2/RRC/CELLULAR/rrc_rg_nas_intf.c b/openair2/RRC/CELLULAR/rrc_rg_nas_intf.c
deleted file mode 100755
index 7d31d07ce6..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg_nas_intf.c
+++ /dev/null
@@ -1,406 +0,0 @@
-/***************************************************************************
-                          rrc_rg_nas_intf.c  -
-                          -------------------
-    begin                : Tue Jan 15 2002
-    copyright            : (C) 2002, 2010 by Eurecom
-    created by           : michelle.wetterwald@eurecom.fr
- **************************************************************************
-      This file contains the functions used to interface the NAS
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-#include "rtos_header.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_rg_vars.h"
-#include "rrc_nas_sap.h"
-#include "rrc_messages.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_int.h"
-
-//-----------------------------------------------------------------------------
-// For FIFOS interface
-#ifdef USER_MODE
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-#ifdef RRC_NETLINK
-#include <sys/socket.h>
-#include <linux/netlink.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#endif
-#endif
-
-#ifdef RRC_NETLINK
-//#define MAX_PAYLOAD 4096  /* this sould cover the max mtu size*/
-struct nlmsghdr *rrcnl_nlh;
-int rrcnl_sock_fd;
-struct sockaddr_nl rrcnl_src_addr, rrcnl_dest_addr;
-struct iovec rrcnl_iov;
-struct msghdr rrcnl_msg;
-#endif
-
-#ifdef USER_MODE
-#ifndef RRC_NETLINK
-//-----------------------------------------------------------------------------
-// Create and initialize FIFOs for UE RRC SAPs
-void rrc_rg_sap_init (void)
-{
-  //-----------------------------------------------------------------------------
-  int write_flag = O_WRONLY | O_NONBLOCK | O_NDELAY;
-  int read_flag = O_RDONLY | O_NONBLOCK | O_NDELAY;
-
-  // Create FIFOs
-  rrc_create_fifo (RRC_SAPI_RG_GCSAP);
-  rrc_create_fifo (RRC_SAPI_RG_NTSAP);
-  rrc_create_fifo (RRC_SAPI_RG_DCSAP0_IN);
-  rrc_create_fifo (RRC_SAPI_RG_DCSAP0_OUT);
-  rrc_create_fifo (RRC_SAPI_RG_DCSAP1_IN);
-  rrc_create_fifo (RRC_SAPI_RG_DCSAP1_OUT);
-  rrc_create_fifo (RRC_SAPI_RG_DCSAP2_IN);
-  rrc_create_fifo (RRC_SAPI_RG_DCSAP2_OUT);
-
-  // Open FIFOs
-  while ((protocol_bs->rrc.rrc_rg_GC_fifo = open (RRC_SAPI_RG_GCSAP, read_flag)) < 0) {
-    msg ("%s returned value %d\n", RRC_SAPI_RG_GCSAP, protocol_bs->rrc.rrc_rg_GC_fifo);
-    perror("RRC_SAPI_RG_GCSAP - open failed: ");
-    sleep (1);
-  }
-
-  msg("FIFO opened %s\n", RRC_SAPI_RG_GCSAP);
-
-  while ((protocol_bs->rrc.rrc_rg_NT_fifo = open (RRC_SAPI_RG_NTSAP, read_flag)) < 0) {
-    msg ("%s returned value %d\n", RRC_SAPI_RG_NTSAP, protocol_bs->rrc.rrc_rg_NT_fifo);
-    sleep (1);
-  }
-
-  msg("FIFO opened %s\n", RRC_SAPI_RG_NTSAP);
-
-  // Currently 3 MT supported -- will become a loop ???
-  while ((protocol_bs->rrc.rrc_rg_DCIn_fifo[0] = open (RRC_SAPI_RG_DCSAP0_IN, read_flag)) < 0) {
-    msg ("%s returned value %d\n", RRC_SAPI_RG_DCSAP0_IN, protocol_bs->rrc.rrc_rg_DCIn_fifo[0]);
-    sleep (1);
-  }
-
-  msg("FIFO opened %s\n", RRC_SAPI_RG_DCSAP0_IN);
-
-  while ((protocol_bs->rrc.rrc_rg_DCOut_fifo[0] = open (RRC_SAPI_RG_DCSAP0_OUT, write_flag)) < 0) {
-    msg ("%s returned value %d\n", RRC_SAPI_RG_DCSAP0_OUT, protocol_bs->rrc.rrc_rg_DCOut_fifo[0]);
-    perror("RRC_SAPI_RG_DCSAP0_OUT - open failed: ");
-    sleep (1);
-  }
-
-  msg("FIFO opened %s\n", RRC_SAPI_RG_DCSAP0_OUT);
-
-  while ((protocol_bs->rrc.rrc_rg_DCIn_fifo[1] = open (RRC_SAPI_RG_DCSAP1_IN, read_flag)) < 0) {
-    msg ("%s returned value %d\n", RRC_SAPI_RG_DCSAP1_IN, protocol_bs->rrc.rrc_rg_DCIn_fifo[1]);
-    sleep (1);
-  }
-
-  msg("FIFO opened %s\n", RRC_SAPI_RG_DCSAP1_IN);
-
-  while ((protocol_bs->rrc.rrc_rg_DCOut_fifo[1] = open (RRC_SAPI_RG_DCSAP1_OUT, write_flag)) < 0) {
-    msg ("%s returned value %d\n", RRC_SAPI_RG_DCSAP1_OUT, protocol_bs->rrc.rrc_rg_DCOut_fifo[1]);
-    sleep (1);
-  }
-
-  msg("FIFO opened %s\n", RRC_SAPI_RG_DCSAP1_OUT);
-
-  while ((protocol_bs->rrc.rrc_rg_DCIn_fifo[2] = open (RRC_SAPI_RG_DCSAP2_IN, read_flag)) < 0) {
-    msg ("%s returned value %d\n", RRC_SAPI_RG_DCSAP2_IN, protocol_bs->rrc.rrc_rg_DCIn_fifo[2]);
-    sleep (1);
-  }
-
-  msg("FIFO opened %s\n", RRC_SAPI_RG_DCSAP2_IN);
-
-  while ((protocol_bs->rrc.rrc_rg_DCOut_fifo[2] = open (RRC_SAPI_RG_DCSAP2_OUT, write_flag)) < 0) {
-    msg ("%s returned value %d\n", RRC_SAPI_RG_DCSAP2_OUT, protocol_bs->rrc.rrc_rg_DCOut_fifo[2]);
-    sleep (1);
-  }
-
-  msg("FIFO opened %s\n", RRC_SAPI_RG_DCSAP2_OUT);
-
-  // Print result
-  msg ("%s returned value %d\n", "RRC_SAPI_RG_GCSAP", protocol_bs->rrc.rrc_rg_GC_fifo);
-  msg ("%s returned value %d\n", "RRC_SAPI_RG_NTSAP", protocol_bs->rrc.rrc_rg_NT_fifo);
-  msg ("%s returned value %d\n", "RRC_SAPI_RG_DCSAP0_IN", protocol_bs->rrc.rrc_rg_DCIn_fifo[0]);
-  msg ("%s returned value %d\n", "RRC_SAPI_RG_DCSAP0_OUT", protocol_bs->rrc.rrc_rg_DCOut_fifo[0]);
-  msg ("%s returned value %d\n", "RRC_SAPI_RG_DCSAP1_IN", protocol_bs->rrc.rrc_rg_DCIn_fifo[1]);
-  msg ("%s returned value %d\n", "RRC_SAPI_RG_DCSAP1_OUT", protocol_bs->rrc.rrc_rg_DCOut_fifo[1]);
-  msg ("%s returned value %d\n", "RRC_SAPI_RG_DCSAP2_IN", protocol_bs->rrc.rrc_rg_DCIn_fifo[2]);
-  msg ("%s returned value %d\n", "RRC_SAPI_RG_DCSAP2_OUT", protocol_bs->rrc.rrc_rg_DCOut_fifo[2]);
-}
-#else
-//-----------------------------------------------------------------------------
-// Create and initialize NETLINK Sockets for UE RRC SAPs
-void rrc_rg_netlink_init (void)
-{
-  //-----------------------------------------------------------------------------
-  int ret;
-
-
-  rrcnl_sock_fd = socket(PF_NETLINK, SOCK_RAW, NAS_RRCNL_ID);
-  printf("rrc_ue_netlink_init - Opened socket with fd %d\n", rrcnl_sock_fd);
-
-  ret = fcntl(rrcnl_sock_fd,F_SETFL,O_NONBLOCK);
-  printf("rrc_ue_netlink_init - fcntl returns %d\n",ret);
-
-  memset(&rrcnl_src_addr, 0, sizeof(rrcnl_src_addr));
-  rrcnl_src_addr.nl_family = AF_NETLINK;
-  rrcnl_src_addr.nl_pid = NL_DEST_RRC_PID;//getpid();  /* self pid */
-  rrcnl_src_addr.nl_groups = 0;  /* not in mcast groups */
-  ret = bind(rrcnl_sock_fd, (struct sockaddr*)&rrcnl_src_addr, sizeof(rrcnl_src_addr));
-  printf("rrc_ue_netlink_init - bind returns %d\n",ret);
-
-  memset(&rrcnl_dest_addr, 0, sizeof(rrcnl_dest_addr));
-  rrcnl_dest_addr.nl_family = AF_NETLINK;
-  rrcnl_dest_addr.nl_pid = 0;   /* For Linux Kernel */
-  rrcnl_dest_addr.nl_groups = 0; /* unicast */
-
-  rrcnl_nlh=(struct nlmsghdr *)malloc(NLMSG_SPACE(RRC_NAS_MAX_SIZE));
-  //memset(rrcnl_nlh, 0, NLMSG_SPACE(MAX_PAYLOAD));
-  /* Fill the netlink message header */
-  rrcnl_nlh->nlmsg_len = NLMSG_SPACE(RRC_NAS_MAX_SIZE);
-  rrcnl_nlh->nlmsg_pid = NL_DEST_RRC_PID;//getpid();  /* self pid */
-  rrcnl_nlh->nlmsg_flags = 0;
-
-  rrcnl_iov.iov_base = (void *)rrcnl_nlh;
-  rrcnl_iov.iov_len = rrcnl_nlh->nlmsg_len;
-  memset(&rrcnl_msg,0,sizeof(rrcnl_msg));
-  rrcnl_msg.msg_name = (void *)&rrcnl_dest_addr;
-  rrcnl_msg.msg_namelen = sizeof(rrcnl_dest_addr);
-  rrcnl_msg.msg_iov = &rrcnl_iov;
-  rrcnl_msg.msg_iovlen = 1;
-
-  /* Read message from kernel */
-  memset(rrcnl_nlh, 0, NLMSG_SPACE(RRC_NAS_MAX_SIZE));
-  // Initialize FIFO values (to be used for SAP indicator in netlink xmit)
-  protocol_bs->rrc.rrc_rg_DCOut_fifo[0] = RRC_NAS_DC0_OUT;
-  protocol_bs->rrc.rrc_rg_DCOut_fifo[1] = RRC_NAS_DC1_OUT;
-  protocol_bs->rrc.rrc_rg_DCOut_fifo[2] = RRC_NAS_DC2_OUT;
-}
-#endif //RRC_NETLINK
-
-#endif
-
-#ifndef RRC_NETLINK
-//-----------------------------------------------------------------------------
-// This function sends data from RRC to the NAS
-void rrc_rg_write_FIFO (mem_block_t *p)
-{
-  //-----------------------------------------------------------------------------
-  int count = 0;
-  int xmit_length;
-  //  int message_type;
-  char *xmit_ptr;
-
-  // transmit the primitive
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_DEBUG] Message to transmit in DC FIFO\n");
-#endif
-  xmit_length = ((struct nas_rg_if_element *) p->data)->prim_length;
-  xmit_ptr = (char *) &((struct nas_rg_if_element *) p->data)->nasRgPrimitive;
-
-  if (xmit_ptr != NULL) {
-    count = rtf_put (((struct nas_rg_if_element *) p->data)->xmit_fifo, xmit_ptr, xmit_length);
-  } else {
-    count = 0;
-  }
-
-  if (count == xmit_length) {
-#ifdef DEBUG_RRC_DETAILS
-    msg ("[RRC_RG][NAS] NAS primitive sent successfully, length %d \n", count);
-    msg("\n[RRC_RG][NAS] on FIFO, %d \n", ((struct nas_rg_if_element *) p->data)->xmit_fifo);
-#endif
-    protocol_bs->rrc.NASMessageToXmit = p->next;        //Dequeue next message if any
-    free_mem_block (p);
-#ifndef USER_MODE
-
-    if (protocol_bs->rrc.ip_rx_irq > 0) {
-      rt_pend_linux_srq (protocol_bs->rrc.ip_rx_irq);
-    } else {
-      msg ("[RRC_RG] ERROR IF IP STACK WANTED NOTIF PACKET(S) ip_rx_irq not initialized\n");
-    }
-
-#endif
-  } else {
-    msg ("[RRC_RG][NAS] transmission on FIFO failed, %d bytes sent\n", count);
-  }
-}
-#else
-//-----------------------------------------------------------------------------
-// This function sends data from RRC to the NAS via Netlink socket
-// Name has been kept rrc_ue_write_FIFO for backwards compatibility
-void rrc_rg_write_FIFO (mem_block_t * p)
-{
-  //-----------------------------------------------------------------------------
-  int count = 0;
-  int xmit_length;
-  char *xmit_ptr;
-  int ret;
-  char sap_to_write;
-
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_DEBUG] Message to transmit in DC FIFO\n");
-#endif
-
-  sap_to_write = (char) ((struct nas_rg_if_element *) p->data)->xmit_fifo;
-
-  // transmit the SAP value
-  memcpy (NLMSG_DATA(rrcnl_nlh), &sap_to_write, 1);
-
-  // transmit the primitive
-  xmit_length = ((struct nas_rg_if_element *) p->data)->prim_length;
-  xmit_ptr = (char *) &((struct nas_rg_if_element *) p->data)->nasRgPrimitive;
-
-  if (xmit_ptr != NULL) {
-    memcpy (NLMSG_DATA(rrcnl_nlh)+1, xmit_ptr, xmit_length);
-  }
-
-  rrcnl_nlh->nlmsg_len = xmit_length+1;
-  //rrc_print_buffer (xmit_ptr, xmit_length);
-
-  ret = sendmsg(rrcnl_sock_fd,&rrcnl_msg,0);
-
-  if (ret<0) {
-    msg ("[RRC_RG][NAS] rrc_rg_write_FIFO - sendmsg returns %d (errno: %d)\n", ret, errno);
-    mac_xface->macphy_exit("RRC Netlink Socket could not be written");
-  } else {
-    count = xmit_length+1;
-#ifdef DEBUG_RRC_STATE
-    msg ("[RRC_RG][NAS] NAS primitive sent successfully, length %d (including NETLINK SAP value)\n", count);
-    //rrc_print_buffer (NLMSG_DATA(rrcnl_nlh), count);
-    //msg("\n[RRC_UE][NAS] on FIFO, %d \n", ((struct nas_rg_if_element *) p->data)->xmit_fifo);
-#endif
-    protocol_bs->rrc.NASMessageToXmit = p->next;        //Dequeue next message if any
-    free_mem_block (p);
-  }
-}
-#endif
-//-----------------------------------------------------------------------------
-// Enqueue a message for NAS
-void rrc_rg_nas_xmit_enqueue (mem_block_t * p)
-{
-  //-----------------------------------------------------------------------------
-  protocol_bs->rrc.NASMessageToXmit = p;
-}
-
-//-----------------------------------------------------------------------------
-// This function receives data in RRC from the NAS
-void rrc_rg_read_FIFO (void)
-{
-  //-----------------------------------------------------------------------------
-  int count = 0;
-  u8  rcve_buffer[RRC_NAS_MAX_SIZE];
-#ifdef RRC_NETLINK
-  struct nas_rg_dc_element *p;
-#endif
-  u16 prim_length;
-  char sap_to_read;
-#ifndef RRC_NETLINK
-  int i;
-#endif
-
-  memset (rcve_buffer, 0, RRC_NAS_MAX_SIZE);
-  // Read Message header
-#ifndef RRC_NETLINK
-
-  for (i = 0; i < maxUsers; i++) {
-    if ((count = rtf_get (protocol_bs->rrc.rrc_rg_DCIn_fifo[i], rcve_buffer, NAS_TL_SIZE)) > 0) {
-      sap_to_read = RRC_NAS_DC0_IN + (2*i);
-      prim_length = (int) (((struct nas_rg_dc_element *) rcve_buffer)->length);
-      count += rtf_get (protocol_bs->rrc.rrc_rg_DCIn_fifo[i], &(rcve_buffer[NAS_TL_SIZE]), prim_length - NAS_TL_SIZE);
-      rrc_rg_read_DCin_FIFO (i, rcve_buffer, count);
-      break;
-    }
-  }
-
-  //msg ("[RRC_RG]rrc_rg_read_FIFO - After DC-SAPs - count = %d\n", count);
-  if (count<0) {
-    if ((count = rtf_get (protocol_bs->rrc.rrc_rg_GC_fifo, rcve_buffer, NAS_TL_SIZE)) > 0) {
-      sap_to_read = RRC_NAS_GC_IN;
-      //msg ("[RRC_RG]rrc_rg_read_FIFO - GC SAP - count = %d\n", count);
-      prim_length =  ((struct nas_rg_gc_element *) rcve_buffer)->length;
-      count += rtf_get (protocol_bs->rrc.rrc_rg_GC_fifo, &(rcve_buffer[NAS_TL_SIZE]), prim_length - NAS_TL_SIZE);
-      rrc_rg_read_GC_FIFO (rcve_buffer, count);
-    } else {
-      if ((count = rtf_get (protocol_bs->rrc.rrc_rg_NT_fifo, rcve_buffer, NAS_TL_SIZE)) > 0) {
-        sap_to_read = RRC_NAS_NT_IN;
-        prim_length =  ((struct nas_rg_nt_element *) rcve_buffer)->length;
-        count += rtf_get (protocol_bs->rrc.rrc_rg_NT_fifo, &(rcve_buffer[NAS_TL_SIZE]), prim_length - NAS_TL_SIZE);
-        rrc_rg_read_NT_FIFO (rcve_buffer, count);
-      }
-    }
-  }
-
-#else
-  count = recvmsg(rrcnl_sock_fd, &rrcnl_msg, 0);
-
-  /*  if (!(protocol_bs->rrc.current_SFN%50)){
-      msg ("[RRC_RG][NETLINK] rrc_rg_read_FIFO - count = %d\n", count);
-    }*/
-  if (count  > 0) {
-    msg ("[RRC_RG][NETLINK] Received socket with length %d (nlmsg_len = %d)\n", count, (rrcnl_nlh->nlmsg_len)-sizeof(struct nlmsghdr));
-    sap_to_read = ((char*)NLMSG_DATA(rrcnl_nlh))[0];
-    p = (struct nas_rg_dc_element *)&((char*)NLMSG_DATA(rrcnl_nlh))[1];
-    //memcpy(rcve_buffer, &((char*)NLMSG_DATA(rrcnl_nlh))[1], prim_length);
-    //prim_length = (int) (((struct nas_rg_dc_element *) rcve_buffer)->length);
-    prim_length = p->length;
-    msg ("[RRC_RG][NETLINK] SAP %d, prim_length %d\n", sap_to_read, prim_length);
-    memcpy(rcve_buffer, p, prim_length);
-    count --;
-
-    switch (sap_to_read) {
-    case RRC_NAS_GC_IN:
-      rrc_rg_read_GC_FIFO (rcve_buffer, count);
-      break;
-
-    case RRC_NAS_NT_IN:
-      rrc_rg_read_NT_FIFO (rcve_buffer, count);
-      break;
-
-    case RRC_NAS_DC0_IN:
-      rrc_rg_read_DCin_FIFO (0, rcve_buffer, count);
-      break;
-
-    case RRC_NAS_DC1_IN:
-      rrc_rg_read_DCin_FIFO (1, rcve_buffer, count);
-      break;
-
-    case RRC_NAS_DC2_IN:
-      rrc_rg_read_DCin_FIFO (2, rcve_buffer, count);
-      break;
-      break;
-
-    default:
-      msg ("[RRC_RG][NETLINK] ERROR Invalid SAP received %d \n", sap_to_read);
-      return;
-    }
-  }
-
-#endif
-
-}
-
-
-#ifdef RRC_NETLINK
-//-----------------------------------------------------------------------------
-// This function receives data in RRC from the NAS
-int rrc_rg_read_data_from_nlh (char * buffer, int length, int offset)
-{
-  //-----------------------------------------------------------------------------
-  int count = length;
-  memcpy(buffer, &((char*)NLMSG_DATA(rrcnl_nlh))[1+offset], count);
-  return count;
-}
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_rg_outputs.c b/openair2/RRC/CELLULAR/rrc_rg_outputs.c
deleted file mode 100755
index 5122c8b148..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg_outputs.c
+++ /dev/null
@@ -1,441 +0,0 @@
-/***************************************************************************
-                          rrc_rg_outputs.c  -  description
-                             -------------------
-    begin                : May 29, 2002
-    copyright            : (C) 2002, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Contains the output functions for the RRC_RG model
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_rg_vars.h"
-#include "rrc_nas_primitives.h"
-#include "rrc_messages.h"
-//-------------------------------------------------------------------
-#include "rrc_proto_fsm.h"
-#include "rrc_proto_intf.h"
-#include "rrc_proto_int.h"
-
-//-------------------------------------------------------------------
-// #ifndef USER_MODE
-// #ifndef BYPASS_L1
-// #include "daq.h"
-// #include "L1L_extern.h"
-// #endif
-// #endif
-//
-// #ifndef BYPASS_L1
-// #include "L1L_proto.h"
-// #include "L1H_proto.h"
-// #include "L1C.h"
-// #include "L1H.h"
-// #include "L1L.h"
-// #endif
-//
-// #include "umts_sched_struct.h"
-// #include "umts_sched_proto_extern.h"
-// #include "rlc.h"
-// #include "mac_log_interface_flow_proto_extern.h"
-// #include "mac_traffic_measurement_proto_extern.h"
-// #include "mac_control_primitives_proto_extern.h"
-// #include "rb_proto_extern.h"
-
-/* Output Trigger functions - Radio Gateway Model (protos in rrc_rg_data.h) */
-//-------------------------------------------------------------------
-void RRC_RG_O_O_SEND_CCCH (int msgId)
-{
-  //-------------------------------------------------------------------
-  // Temp 01/03 - msgId contains UE_Id
-  char *tx_ccch_info;
-  int  data_length = 0;
-  int  retcode;
-
-  tx_ccch_info = (char *) protocol_bs->rrc.Mobile_List[msgId].rg_msg_infos.msg_ptr;
-  data_length = protocol_bs->rrc.Mobile_List[msgId].rg_msg_infos.msg_length;
-
-  if (data_length > 0) {
-    //retcode = Mac_rlc_xface->rrc_rlc_data_req (RRC_MODULE_INST_ID, RRC_LCHAN_SRB0_ID, 0, RRC_RLC_CONFIRM_NO, data_length, tx_ccch_info);
-    retcode = rrc_rg_send_to_srb_rlc (msgId, RRC_SRB0_ID, tx_ccch_info, data_length);
-#ifdef DEBUG_RRC_STATE
-    msg ("[RRC_RG][FSM-OUT] Message sent on CCCH. SRB0 -- retcode = %d -- data length %d\n", retcode, data_length); //RC = 1 ==> OK
-    //msg ("[RRC_RG][FSM-OUT] Message %s sent on CCCH. SRB0\n", tx_ccch_info);
-#endif
-  }
-
-  // clear resources
-  protocol_bs->rrc.Mobile_List[msgId].rg_msg_infos.msg_length = 0;
-  //free(protocol_bs->rrc.Mobile_List[msgId].rg_msg_infos.msg_ptr);
-  free_mem_block (protocol_bs->rrc.Mobile_List[msgId].rg_msg_infos.mem_block_ptr);
-}
-
-//-------------------------------------------------------------------
-void RRC_RG_O_O_SEND_DCCH_UM (int msgId)
-{
-  //-------------------------------------------------------------------
-  // Temp 01/03 - msgId contains UE_Id
-  char tx_dcch_info;
-  int  data_length = 0 ;
-  int  retcode;
-
-  // prepare message
-  tx_dcch_info = (char *) protocol_bs->rrc.Mobile_List[msgId].rg_msg_infos.msg_ptr;
-  data_length = protocol_bs->rrc.Mobile_List[msgId].rg_msg_infos.msg_length;
-
-  if (data_length > 0) {
-    //retcode = rb_tx_data_srb_rg (RRC_SRB1_ID + (msgId * maxRB), tx_dcch_info, data_length * 8, 0, FALSE);
-    //retcode = Mac_rlc_xface->rrc_rlc_data_req (RRC_MODULE_INST_ID, RRC_LCHAN_SRB1_ID, 0, RRC_RLC_CONFIRM_NO, data_length, tx_dcch_info);
-    retcode = rrc_rg_send_to_srb_rlc (msgId, RRC_SRB1_ID, tx_dcch_info, data_length);
-#ifdef DEBUG_RRC_STATE
-    msg ("[RRC_RG][FSM-OUT] Message %s sent on DCCH-UM, ret code= %d.\n", tx_dcch_info, retcode);
-#endif
-  }
-
-  // clear resources
-  protocol_bs->rrc.Mobile_List[msgId].rg_msg_infos.msg_length = 0;
-  //free(protocol_bs->rrc.Mobile_List[msgId].rg_msg_infos.msg_ptr);
-  free_mem_block (protocol_bs->rrc.Mobile_List[msgId].rg_msg_infos.mem_block_ptr);
-}
-
-//-------------------------------------------------------------------
-void RRC_RG_O_O_SEND_DCCH_AM (int msgId)
-{
-  //-------------------------------------------------------------------
-  // Temp 01/03 - msgId contains UE_Id
-  char *tx_dcch_info;
-  int data_length = 0;
-  int retcode;
-
-  // send message
-  tx_dcch_info = (char *) protocol_bs->rrc.Mobile_List[msgId].rg_msg_infos.msg_ptr;
-  data_length = protocol_bs->rrc.Mobile_List[msgId].rg_msg_infos.msg_length;
-
-  if (data_length > 0) {
-    //retcode = rb_tx_data_srb_rg (RRC_SRB2_ID + (msgId * maxRB), tx_dcch_info, data_length * 8, protocol_bs->rrc.next_MUI++, TRUE);
-    //retcode = Mac_rlc_xface->rrc_rlc_data_req (RRC_MODULE_INST_ID, RRC_LCHAN_SRB2_ID, protocol_bs->rrc.next_MUI++, 0, data_length, tx_dcch_info);
-    retcode = rrc_rg_send_to_srb_rlc (msgId, RRC_SRB2_ID, tx_dcch_info, data_length);
-#ifdef DEBUG_RRC_STATE
-    msg ("[RRC_RG][FSM-OUT] Message %s sent on DCCH-AM, MUI %d, ret code= %d.\n", tx_dcch_info, (protocol_bs->rrc.next_MUI)-1,retcode);
-    rrc_print_buffer (tx_dcch_info, 15);
-#endif
-  }
-
-  // clear resources
-  protocol_bs->rrc.Mobile_List[msgId].rg_msg_infos.msg_length = 0;
-  //  free(protocol_bs->rrc.Mobile_List[msgId].rg_msg_infos.msg_ptr);
-  free_mem_block (protocol_bs->rrc.Mobile_List[msgId].rg_msg_infos.mem_block_ptr);
-}
-
-//-------------------------------------------------------------------
-void RRC_RG_SEND_AM_SRB3 (int msgId)
-{
-  //-------------------------------------------------------------------
-  // Temp 01/03 - msgId contains UE_Id
-  char *tx_dcch_info;
-  int data_length = 0;
-  int retcode;
-
-  // send message
-  tx_dcch_info = (char *) protocol_bs->rrc.Mobile_List[msgId].rg_msg_infos.msg_ptr;
-  data_length = protocol_bs->rrc.Mobile_List[msgId].rg_msg_infos.msg_length;
-
-  if (data_length > 0) {
-    //retcode = rb_tx_data_srb_rg (RRC_SRB3_ID + (msgId * maxRB), tx_dcch_info, data_length * 8, protocol_bs->rrc.next_MUI++, TRUE);
-    retcode = rrc_rg_send_to_srb_rlc (msgId, RRC_SRB3_ID, tx_dcch_info, data_length);
-#ifdef DEBUG_RRC_STATE
-    msg ("[RRC_RG][DATA-OUT] Message %s sent on DCCH-AM-SRB3, ret code= %d.\n", tx_dcch_info, retcode);
-#endif
-  }
-
-  // clear resources
-  protocol_bs->rrc.Mobile_List[msgId].rg_msg_infos.msg_length = 0;
-  //  free(protocol_bs->rrc.Mobile_List[msgId].rg_msg_infos.msg_ptr);
-  free_mem_block (protocol_bs->rrc.Mobile_List[msgId].rg_msg_infos.mem_block_ptr);
-}
-
-//Output of primitives to NAS
-//-------------------------------------------------------------------
-void RRC_RG_O_O_NAS_CONN_ESTAB_IND (int UE_Id)
-{
-  //-------------------------------------------------------------------
-  struct nas_rg_if_element *msgToBuild;
-  int j;
-
-  mem_block_t *p = get_free_mem_block (sizeof (struct nas_rg_if_element));
-  protocol_bs->rrc.NASMessageToXmit = p;
-
-  //Set pointer to newly allocated structure and fills it
-  msgToBuild = (struct nas_rg_if_element *) p->data;
-
-  msgToBuild->prim_length = NAS_TL_SIZE + sizeof (struct NASConnEstablishInd);
-  msgToBuild->xmit_fifo = protocol_bs->rrc.rrc_rg_DCOut_fifo[UE_Id];
-  msgToBuild->nasRgPrimitive.dc_sap_prim.type = CONN_ESTABLISH_IND;
-  msgToBuild->nasRgPrimitive.dc_sap_prim.length = msgToBuild->prim_length;
-  // Initial setting of local connection reference - still TBD
-  msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.conn_establish_ind.localConnectionRef = protocol_bs->rrc.Mobile_List[UE_Id].local_connection_ref;
-
-  for (j = 0; j < 14; j++)
-    msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.conn_establish_ind.InterfaceIMEI[j]
-      = protocol_bs->rrc.Mobile_List[UE_Id].IMEI[j];
-
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RG][FSM-OUT] CONN Indication Message sent to NAS, for mobile %d.\n", UE_Id);
-  msg ("[RRC] RG NAS PRIMITIVE ENCODE, length Id %d.\n", msgToBuild->prim_length);
-  //  msg("[RRC_DEBUG] Pointer p %p , Control Block %p.\n",p, protocol_bs->rrc.NASMessageToXmit);
-#endif
-}
-
-//-------------------------------------------------------------------
-void RRC_RG_O_O_NAS_CONN_RELEASE_IND (int UE_Id)
-{
-  //-------------------------------------------------------------------
-  struct nas_rg_if_element *msgToBuild;
-
-  mem_block_t *p = get_free_mem_block (sizeof (struct nas_rg_if_element));
-  protocol_bs->rrc.NASMessageToXmit = p;        // Temp - will later enqueue at bottom of list
-  //Set pointer to newly allocated structure and fills it
-  msgToBuild = (struct nas_rg_if_element *) p->data;
-
-  msgToBuild->prim_length = NAS_TL_SIZE + sizeof (struct NASConnReleaseInd);
-  msgToBuild->xmit_fifo = protocol_bs->rrc.rrc_rg_DCOut_fifo[UE_Id];
-  msgToBuild->nasRgPrimitive.dc_sap_prim.type = CONN_RELEASE_IND;
-  msgToBuild->nasRgPrimitive.dc_sap_prim.length = msgToBuild->prim_length;
-  msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.conn_release_ind.localConnectionRef = protocol_bs->rrc.Mobile_List[UE_Id].local_connection_ref;
-  msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.conn_release_ind.releaseCause = protocol_bs->rrc.Mobile_List[UE_Id].release_cause;
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM-OUT] CONN_RELEASE_IND primitive sent to NAS, length %d, with cause code %d.\n", msgToBuild->prim_length, protocol_bs->rrc.Mobile_List[UE_Id].release_cause);
-#endif
-}
-
-//-------------------------------------------------------------------
-void RRC_RG_O_O_NAS_CONN_LOSS_IND (int UE_Id)
-{
-  //-------------------------------------------------------------------
-  struct nas_rg_if_element *msgToBuild;
-
-  mem_block_t *p = get_free_mem_block (sizeof (struct nas_rg_if_element));
-  protocol_bs->rrc.NASMessageToXmit = p;        // Temp - will later enqueue at bottom of list
-  //Set pointer to newly allocated structure and fills it
-  msgToBuild = (struct nas_rg_if_element *) p->data;
-
-  msgToBuild->prim_length = NAS_TL_SIZE + sizeof (struct NASConnLossInd);
-  msgToBuild->xmit_fifo = protocol_bs->rrc.rrc_rg_DCOut_fifo[UE_Id];
-  msgToBuild->nasRgPrimitive.dc_sap_prim.type = CONN_LOSS_IND;
-  msgToBuild->nasRgPrimitive.dc_sap_prim.length = msgToBuild->prim_length;
-  msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.conn_loss_ind.localConnectionRef = protocol_bs->rrc.Mobile_List[UE_Id].local_connection_ref;
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM-OUT] CONN LOSS IND primitive sent to NAS, length %d.\n", msgToBuild->prim_length);
-#endif
-}
-
-//-------------------------------------------------------------------
-void RRC_RG_O_O_NAS_RB_ESTAB_CNF (int UE_Id)
-{
-  //-------------------------------------------------------------------
-  struct nas_rg_if_element *msgToBuild;
-
-  mem_block_t *p = get_free_mem_block (sizeof (struct nas_rg_if_element));
-  protocol_bs->rrc.NASMessageToXmit = p;        // Temp - will later enqueue at bottom of list
-  //Set pointer to newly allocated structure and fills it
-  msgToBuild = (struct nas_rg_if_element *) p->data;
-
-  msgToBuild->prim_length = NAS_TL_SIZE + sizeof (struct NASrbEstablishConf);
-  msgToBuild->xmit_fifo = protocol_bs->rrc.rrc_rg_DCOut_fifo[UE_Id];
-  msgToBuild->nasRgPrimitive.dc_sap_prim.type = RB_ESTABLISH_CNF;
-  msgToBuild->nasRgPrimitive.dc_sap_prim.length = msgToBuild->prim_length;
-  msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.rb_establish_conf.localConnectionRef = protocol_bs->rrc.Mobile_List[UE_Id].local_connection_ref;
-  msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.rb_establish_conf.rbId = protocol_bs->rrc.Mobile_List[UE_Id].requested_rbId;
-  msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.rb_establish_conf.sapId = protocol_bs->rrc.Mobile_List[UE_Id].requested_sapid;
-  msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.rb_establish_conf.status = ACCEPTED;
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RG][FSM-OUT] RB_ESTABLISH_Cnf primitive sent to NAS, for mobile %d, RB %u.\n", UE_Id, protocol_bs->rrc.Mobile_List[UE_Id].requested_rbId);
-#endif
-}
-
-//-------------------------------------------------------------------
-void RRC_RG_O_O_NAS_RB_Failure (int UE_Id)
-{
-  //-------------------------------------------------------------------
-  struct nas_rg_if_element *msgToBuild;
-
-  mem_block_t *p = get_free_mem_block (sizeof (struct nas_rg_if_element));
-  protocol_bs->rrc.NASMessageToXmit = p;        // Temp - will later enqueue at bottom of list
-  //Set pointer to newly allocated structure and fills it
-  msgToBuild = (struct nas_rg_if_element *) p->data;
-
-  msgToBuild->prim_length = NAS_TL_SIZE + sizeof (struct NASrbEstablishConf);
-  msgToBuild->xmit_fifo = protocol_bs->rrc.rrc_rg_DCOut_fifo[UE_Id];
-  msgToBuild->nasRgPrimitive.dc_sap_prim.type = RB_ESTABLISH_CNF;
-  msgToBuild->nasRgPrimitive.dc_sap_prim.length = msgToBuild->prim_length;
-  msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.rb_establish_conf.localConnectionRef = protocol_bs->rrc.Mobile_List[UE_Id].local_connection_ref;
-  msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.rb_establish_conf.rbId = protocol_bs->rrc.Mobile_List[UE_Id].requested_rbId;
-  msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.rb_establish_conf.sapId = 3;  //Temp
-  msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.rb_establish_conf.status = FAILURE;
-  msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.rb_establish_conf.fail_code = protocol_bs->rrc.curr_rb_failure_code;
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RG][FSM-OUT] RB_Establish_Failure primitive sent to NAS, for mobile %d, RB %u.\n", UE_Id, protocol_bs->rrc.Mobile_List[UE_Id].requested_rbId);
-#endif
-}
-
-// Control of other Access Stratum entities
-//-------------------------------------------------------------------
-void RRC_RG_O_O_CPHY_RL_SETUP_Req (void)
-{
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RG][FSM-OUT] Sending RL_SETUP_Req primitive to PHY.\n");
-#endif
-  CPHY_config_req (rrm_config, 0, 0);
-}
-
-//-------------------------------------------------------------------
-void RRC_RG_O_O_CPHY_RL_RELEASE_Req (void)
-{
-  //-------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RG][FSM-OUT] Sending RL_RELEASE_Req primitive to PHY.\n");
-#endif
-  CPHY_config_req (rrm_config, 0, 0);
-}
-
-//-------------------------------------------------------------------
-void RRC_RG_O_O_CRLC_CONFIG_Req (void)
-{
-  // WARNING : RLC Config must be done before MAC config
-  //-------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RG][FSM-OUT] Sending CRLC_CONFIG_Req primitive to RLC (crb).\n");
-#endif
-  crb_config_req (0);
-}
-
-//-------------------------------------------------------------------
-void RRC_RG_O_O_CMAC_CONFIG_Req (void)
-{
-  //-------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RG][FSM-OUT] Sending CMAC_CONFIG_Req primitive to MAC.\n");
-  msg ("TEMP OPENAIR : COMMENTED\n");
-#endif
-  cmac_config_req (protocol_bs->rrc.rrc_UE_updating, 0);
-}
-
-//-------------------------------------------------------------------
-void RRC_RG_O_O_Action (int action)
-{
-  //-------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RG][FSM-OUT] New action will be requested from RRM : %d.\n", action);
-#endif
-  protocol_bs->rrc.curr_config_action = (u8) action;
-}
-
-//-------------------------------------------------------------------
-void RRC_RG_O_O_Compute_Configuration (int UE_Id)
-{
-  //-------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RG][FSM-OUT] Request to compute configuration.\n");
-#endif
-  protocol_bs->rrc.rrc_multicast_bearer = FALSE;
-  rrc_rg_compute_configuration (UE_Id, protocol_bs->rrc.curr_config_action);
-}
-
-//-------------------------------------------------------------------
-void RRC_RG_O_O_RB_failure_code(int error_cause)
-{
-  //-------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RG][FSM-OUT] RB Establishment failure cause %d.\n", error_cause);
-#endif
-  protocol_bs->rrc.curr_rb_failure_code = error_cause;
-}
-
-//Other functions, not related with Esterel
-//-------------------------------------------------------------------
-void RRC_RG_O_NAS_DATA_IND (int UE_Id)
-{
-  //-------------------------------------------------------------------
-  struct nas_rg_if_element *msgToBuild;
-  char *pdata;
-
-  mem_block_t *p = get_free_mem_block (sizeof (struct nas_rg_if_element) + RRC_NAS_MAX_SIZE);
-  protocol_bs->rrc.NASMessageToXmit = p;        // Temp - will later enqueue at bottom of list
-  //Set pointer to newly allocated structure and fills it
-  msgToBuild = (struct nas_rg_if_element *) p->data;
-
-  msgToBuild->prim_length = NAS_TL_SIZE + sizeof (struct NASDataInd);
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][DATA-OUT] DATA_TRANSFER_IND, length #1 %d.\n", msgToBuild->prim_length);
-#endif
-  msgToBuild->xmit_fifo = protocol_bs->rrc.rrc_rg_DCOut_fifo[UE_Id];
-  msgToBuild->nasRgPrimitive.dc_sap_prim.type = DATA_TRANSFER_IND;
-  msgToBuild->nasRgPrimitive.dc_sap_prim.length = msgToBuild->prim_length;
-  msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.data_transfer_ind.localConnectionRef = protocol_bs->rrc.Mobile_List[UE_Id].local_connection_ref;
-  msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.data_transfer_ind.priority = protocol_bs->rrc.current_SFN;
-  msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.data_transfer_ind.nasDataLength = protocol_bs->rrc.Mobile_List[UE_Id].ul_nas_message_lgth;
-  pdata = (char *) &(msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.data_transfer_ind.nasDataLength);
-  pdata += 2;
-  memcpy (pdata, protocol_bs->rrc.Mobile_List[UE_Id].ul_nas_message_ptr, protocol_bs->rrc.Mobile_List[UE_Id].ul_nas_message_lgth);
-#ifdef DEBUG_RRC_DETAILS
-  rrc_print_buffer (pdata - 2, 20);
-  //msg ("[RRC][DATA-OUT] DATA_TRANSFER_IND, length #1.0 %d.\n", msgToBuild->prim_length);
-#endif
-  msgToBuild->prim_length += (int) protocol_bs->rrc.Mobile_List[UE_Id].ul_nas_message_lgth;
-#ifdef DEBUG_RRC_DETAILS
-  //msg ("[RRC][DATA-OUT] DATA_TRANSFER_IND, length #1.1 %d.\n", protocol_bs->rrc.Mobile_List[UE_Id].ul_nas_message_lgth);
-  msg ("[RRC][DATA-OUT] DATA_TRANSFER_IND, length #2 %d.\n", msgToBuild->prim_length);
-#endif
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][DATA-OUT] DATA_TRANSFER_IND primitive ready to send to NAS, length %d.\n", msgToBuild->prim_length);
-#endif
-}
-
-//-------------------------------------------------------------------
-void RRC_RG_O_NAS_ENB_MEASUREMENT_IND (void)
-{
-  //-------------------------------------------------------------------
-
-  int UE_Id = 0;
-  int num_connected_UEs;
-  int ix;
-  struct nas_rg_if_element *msgToBuild;
-
-  mem_block_t *p = get_free_mem_block (sizeof (struct nas_rg_if_element));
-  protocol_bs->rrc.NASMessageToXmit = p;        // Temp - will later enqueue at bottom of list
-  //Set pointer to newly allocated structure and fills it
-  msgToBuild = (struct nas_rg_if_element *) p->data;
-
-  msgToBuild->prim_length = NAS_TL_SIZE + sizeof (struct NASEnbMeasureInd);
-  msgToBuild->xmit_fifo = protocol_bs->rrc.rrc_rg_DCOut_fifo[UE_Id];
-  msgToBuild->nasRgPrimitive.dc_sap_prim.type = ENB_MEASUREMENT_IND;
-  msgToBuild->nasRgPrimitive.dc_sap_prim.length = msgToBuild->prim_length;
-
-  // comment or uncomment next lines according to test
-#ifdef RRC_ENABLE_REAL_ENB_MESURES
-  num_connected_UEs = protocol_bs->rrc.num_connected_UEs;
-#else
-  num_connected_UEs =2;
-#endif
-  msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.eNBmeasurement_ind.cell_id = protocol_bs->rrc.rg_cell_id;
-  // next values are temp hard coded, to be replaced by real values
-  msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.eNBmeasurement_ind.num_UEs = num_connected_UEs;
-
-  for (ix=0; ix<num_connected_UEs; ix++) {
-    msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.eNBmeasurement_ind.measures[ix].rlcBufferOccupancy = rrc_rg_ENbMeas_get_rlcBufferOccupancy(ix);
-    msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.eNBmeasurement_ind.measures[ix].scheduledPRB = rrc_rg_ENbMeas_get_scheduledPRB(ix);
-    msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.eNBmeasurement_ind.measures[ix].totalDataVolume = rrc_rg_ENbMeas_get_totalDataVolume(ix);
-  }
-
-  msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.eNBmeasurement_ind.totalNumPRBs = rrc_rg_ENbMeas_get_totalNumPRBs();
-
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][DATA-OUT] ENB_MEASUREMENT_IND primitive ready to send to NAS, length %d.\n", msgToBuild->prim_length);
-#endif
-}
\ No newline at end of file
diff --git a/openair2/RRC/CELLULAR/rrc_rg_process.c b/openair2/RRC/CELLULAR/rrc_rg_process.c
deleted file mode 100755
index 87c532dd62..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg_process.c
+++ /dev/null
@@ -1,362 +0,0 @@
-/***************************************************************************
-                          rrc_rg_process.c  -  description
-                             -------------------
-    begin                : May 29, 2002
-    copyright            : (C) 2002, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Procedures associated with the rrc_rg.c file generated by Esterel Studio
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_rg_vars.h"
-#include "rrc_messages.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_fsm.h"
-#include "rrc_proto_intf.h"
-#include "rrc_proto_msg.h"
-//#include "rlc.h"
-
-//-----------------------------------------------------------------------------
-/* Generic function to encode RRC messages */
-void encode_message (int *Message_Id, int UE_Id, int Message_Type)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM-PROC]encode message %d for UE %d\n", Message_Type, UE_Id);
-#endif
-
-  if (protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length) {
-#ifdef DEBUG_RRC_STATE
-    msg ("\n\n[RRC_MSG] There is already one message pending %d\n", protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_Id);
-#endif
-  } else {
-    switch (Message_Type) {
-    case RRC_CONN_SETUP:
-      rrc_rg_msg_connsetup (UE_Id, Message_Id);
-      protocol_bs->rrc.Mobile_List[UE_Id].conn_complete_timer = 1;
-      break;
-
-    case RRC_CONN_REJECT:
-      rrc_rg_msg_connreject (UE_Id, Message_Id);
-      break;
-
-    case RRC_CONN_RELEASE: // not in 1st step
-      break;
-
-    case RB_SETUP:
-      rrc_rg_msg_rbsetup (UE_Id, Message_Id);
-      break;
-
-    case RB_RELEASE:
-      rrc_rg_msg_rbrelease (UE_Id, Message_Id);
-      break;
-
-    case CELL_UPDATE_CONFIRM:
-      rrc_rg_msg_cellupdatecnfccch (UE_Id, Message_Id);
-      break;
-
-    case UE_CAPABILITY_INFO_CONF:
-      rrc_rg_msg_ueCapInfoCnf(UE_Id, Message_Id);
-      break;
-
-    default:
-      msg ("\n\n[RRC_MSG] unknown message type %d\n", Message_Type);
-      break;
-    }
-  }
-}
-
-//-------------------------------------------------------------------
-int Current_State (int UE_Id)
-{
-  //-------------------------------------------------------------------
-  int curr_state;
-  curr_state = protocol_bs->rrc.Mobile_List[UE_Id].state;
-
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RG][FSM-PROC]returning state %d for mobile %d. \n", curr_state, UE_Id);
-#endif
-  // rrc_mt_list_print(UE_Id);
-  return curr_state;
-}
-
-//-------------------------------------------------------------------
-int INTEGER_COMBINE (int Id1, int Id2)
-{
-  //-------------------------------------------------------------------
-  // signals an error in the automata. Combination should never occur.
-  return 999;
-}
-
-//-------------------------------------------------------------------
-int BOOLEAN_COMBINE (int Id1, int Id2)
-{
-  //-------------------------------------------------------------------
-  // signals an error in the automata. Combination should never occur.
-  return FALSE;
-}
-
-
-/* Management of Mobile Nodes
- */
-//-------------------------------------------------------------------
-void create_Mobile (int UE_Id)
-{
-  //-------------------------------------------------------------------
-  // rrm_simulate_download_configuration(); /*      Added, 1/10/02 by DN      */
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RG][FSM-PROC]creating Mobile %d with state Conn_Received. \n", UE_Id);
-#endif
-  protocol_bs->rrc.Mobile_List[UE_Id].mt_id = UE_Id;
-  protocol_bs->rrc.Mobile_List[UE_Id].state = Conn_Received;
-  //this is an implementation choice and agreement with NAS
-  protocol_bs->rrc.Mobile_List[UE_Id].local_connection_ref = UE_Id;
-  protocol_bs->rrc.Mobile_List[UE_Id].established_background = FALSE;
-  protocol_bs->rrc.Mobile_List[UE_Id].num_rb = 0 ;
-  // Initialize message area
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length = 0;
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_Id = 0;
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_ptr = 0;
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.mem_block_ptr = 0;
-  protocol_bs->rrc.Mobile_List[UE_Id].ul_nas_message_lgth = 0;
-  protocol_bs->rrc.Mobile_List[UE_Id].dl_nas_message_lgth = 0;
-  protocol_bs->rrc.Mobile_List[UE_Id].paging_message_lgth = 0;
-
-}
-
-//-------------------------------------------------------------------
-void update_Mobile (int UE_Id, int new_state)
-{
-  //-------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RG][FSM-PROC]updating Mobile %d to new state %d .\n", UE_Id, new_state);
-#endif
-  protocol_bs->rrc.Mobile_List[UE_Id].mt_id = UE_Id;
-  protocol_bs->rrc.Mobile_List[UE_Id].state = new_state;
-  protocol_bs->rrc.protocol_state[UE_Id] = new_state;
-}
-
-//-------------------------------------------------------------------
-void delete_Mobile (int UE_Id)
-{
-  //-------------------------------------------------------------------
-  int j;
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RG][FSM-PROC]deleting Mobile %d .\n", UE_Id);
-#endif
-  protocol_bs->rrc.Mobile_List[UE_Id].mt_id = 999;
-  protocol_bs->rrc.Mobile_List[UE_Id].local_connection_ref = 999;
-  protocol_bs->rrc.Mobile_List[UE_Id].u_rnti = 999;
-  protocol_bs->rrc.Mobile_List[UE_Id].state = RRC_CELL_IDLE;
-  protocol_bs->rrc.protocol_state[UE_Id] = RRC_CELL_IDLE;
-  strcpy (protocol_bs->rrc.Mobile_List[UE_Id].IMEI, "01231234564569");
-
-  for (j = 4; j < maxRB; j++) {
-    protocol_bs->rrc.Mobile_List[UE_Id].rg_established_rbs[j].rb_identity = 99;
-    protocol_bs->rrc.Mobile_List[UE_Id].rg_established_rbs[j].rb_started = RB_STOPPED;
-    protocol_bs->rrc.Mobile_List[UE_Id].rg_established_rbs[j].qos_class = 0;
-    protocol_bs->rrc.Mobile_List[UE_Id].rg_established_rbs[j].dscp_code = 0;
-    protocol_bs->rrc.Mobile_List[UE_Id].rg_established_rbs[j].sap_id = 3;
-  }
-
-  protocol_bs->rrc.Mobile_List[UE_Id].num_rb = 0;
-  protocol_bs->rrc.Mobile_List[UE_Id].establishment_cause = 0;
-  protocol_bs->rrc.Mobile_List[UE_Id].prot_error_indicator = FALSE;
-  protocol_bs->rrc.Mobile_List[UE_Id].established_background = FALSE;
-}
-
-/* Other processes for ESTEREL
- */
-//-------------------------------------------------------------------
-//void proc_RB_List (int *Message_Id, int rb_id){
-void proc_RB_List(int *Message_Id, int rb_id, int UE_Id)
-{
-  //-------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  //  msg ("[RRC_RG][FSM-PROC]proc_RB_List(), %d .\n", rb_id);
-  msg("[RRC_RG][FSM-PROC]proc_RB_List(), %d , UE_Id = %d.\n",  rb_id, UE_Id);
-#endif
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_established_rbs[rb_id].rb_identity = protocol_bs->rrc.Mobile_List[UE_Id].requested_rbId;
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_established_rbs[rb_id].qos_class = protocol_bs->rrc.Mobile_List[UE_Id].requested_QoSclass;
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_established_rbs[rb_id].dscp_code = protocol_bs->rrc.Mobile_List[UE_Id].requested_dscp;
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_established_rbs[rb_id].rb_started = RB_STOPPED;
-  //Temp
-  *Message_Id = 555;
-}
-
-//-------------------------------------------------------------------
-void release_DCH_Resources (int UE_Id)
-{
-  //-------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RG][FSM-PROC]releasing DCH resources for Mobile %d .\n", UE_Id);
-#endif
-  //rrc_rg_connection_mac_release(UE_Id);
-  //rrc_rg_connection_srb_release(UE_Id);
-  //rrc_rg_connection_rb_release(UE_Id);
-#ifndef BYPASS_L1
-  //rrc_rg_connection_L1_release(UE_Id);
-#endif
-  cmac_config_req (UE_Id, 0);
-  crb_config_req (0);
-#ifndef BYPASS_L1
-  CPHY_config_req (rrm_config, 0, 0);
-#endif
-}
-
-//-------------------------------------------------------------------
-void restore_former_config (int UE_Id)
-{
-  //-------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RG][FSM-PROC]NI--restoring former Radio configuration for Mobile %d.\n", UE_Id);
-#endif
-}
-
-//-------------------------------------------------------------------
-void rg_clear_transaction (int UE_Id, int Message_Type)
-{
-  //-------------------------------------------------------------------
-  int i;
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RG][FSM-PROC]clearing transaction ID for message %d and Mobile %d.\n", Message_Type, UE_Id);
-#endif
-  protocol_bs->rrc.Mobile_List[UE_Id].xmit_trans[0].transaction_Id = 0;
-  //save valid configuration for ms
-  memcpy (&(protocol_bs->rrc.saved_configuration.mt_config[UE_Id]), &(rrm_config)->mt_config[UE_Id], sizeof (MT_CONFIG));
-  //save valid configuration for bs
-  memcpy (&(protocol_bs->rrc.saved_configuration.rg_config), &(rrm_config->rg_config), sizeof (RG_CONFIG));
-
-  //clean commands in configuration
-  for (i = 0; i < JRRM_MAX_COMMANDS_PER_TRANSACTION; i++) {
-    (&(rrm_config->rg_config))->rrm_commands[i].rrm_action = 0;
-  }
-
-  for (i = 0; i < JRRM_MAX_COMMANDS_PER_TRANSACTION; i++) {
-    (&(rrm_config)->mt_config[UE_Id])->rrm_commands[i].rrm_action = 0;
-  }
-
-  switch (Message_Type) {
-  case RRC_CONN_SETUP:
-    break;
-
-  case RB_SETUP:
-  case RB_RELEASE:
-    //protocol_bs->rrc.Mobile_List[UE_Id].requested_rbId = 0;
-    //protocol_bs->rrc.Mobile_List[UE_Id].requested_QoSclass = 0;
-    //protocol_bs->rrc.Mobile_List[UE_Id].requested_dscp = 0;
-    break;
-
-  default:
-    break;
-  }
-
-  // transaction is closed. Clear rrc_UE_updating Id with out of range value
-  protocol_bs->rrc.rrc_UE_updating = maxUsers;
-}
-
-//-------------------------------------------------------------------
-void clear_rbsetup_variables(int UE_Id)
-{
-  //-------------------------------------------------------------------
-  int new_cctrch;
-  int rb_id;
-  int qos_class;
-
-  //Temp - Store cctrch
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RG][FSM-PROC] clear_rbsetup_variables - Store cctrch %d.\n", new_cctrch);
-#endif
-  // commented for OpenAir
-  //new_cctrch = rrm_get_ue_cctrch_index_ul (UE_Id, protocol_bs->rrc.Mobile_List[UE_Id].requested_rbId);
-  new_cctrch = 0;
-  rrc_rg_CPHY_Synch_rx (new_cctrch);
-
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][FSM-PROC] clearing variables after RB setup completion for Mobile %d.\n", UE_Id);
-#endif
-  rb_id = protocol_bs->rrc.Mobile_List[UE_Id].requested_rbId;
-  protocol_bs->rrc.Mobile_List[UE_Id].rg_established_rbs[rb_id].rb_started = RB_STARTED;
-  qos_class = protocol_bs->rrc.Mobile_List[UE_Id].requested_QoSclass;
-
-  if (qos_class == 7 || qos_class == 8 || qos_class == 9) {
-    protocol_bs->rrc.Mobile_List[UE_Id].established_background = TRUE;
-  }
-
-  protocol_bs->rrc.Mobile_List[UE_Id].requested_rbId = 0;
-  protocol_bs->rrc.Mobile_List[UE_Id].requested_QoSclass = 0;
-  protocol_bs->rrc.Mobile_List[UE_Id].requested_dscp = 0;
-  protocol_bs->rrc.Mobile_List[UE_Id].requested_MTrbId = 0;
-  protocol_bs->rrc.Mobile_List[UE_Id].requested_sapid = 0;
-  rrm_add_radio_access_bearer_confirm(UE_Id, rb_id);
-
-}
-
-//-------------------------------------------------------------------
-void clear_rbrelease_variables(int UE_Id)
-{
-  //-------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][FSM-PROC] clearing variables after RB release completion for Mobile %d.\n", UE_Id);
-#endif
-}
-
-//-------------------------------------------------------------------
-void rg_update_UE_numrb(int UE_Id, int Action)
-{
-  //-------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][FSM-PROC] rg_update_UE_numrb (action %d) for Mobile %d.\n", Action, UE_Id);
-#endif
-
-  switch (Action) {
-  case E_ADD_RB:
-    ++protocol_bs->rrc.Mobile_List[UE_Id].num_rb;
-    break;
-
-  case E_REL_RB:
-    --protocol_bs->rrc.Mobile_List[UE_Id].num_rb; //Temp
-    break;
-
-  default:
-    break;
-  }
-}
-
-//-------------------------------------------------------------------
-/* See comments in rrc_constant.h
-   TEMP - This should be part of the Esterel FSM  */
-void rrc_rg_temp_checkConnection(int UE_Id)
-{
-  //-------------------------------------------------------------------
-  if (protocol_bs->rrc.Mobile_List[UE_Id].conn_complete_timer < RG_CONN_TIMEOUT)
-    protocol_bs->rrc.Mobile_List[UE_Id].conn_complete_timer ++;
-  else if (protocol_bs->rrc.Mobile_List[UE_Id].conn_complete_timer == RG_CONN_TIMEOUT) {
-    msg("\n[RRC_RG][XXFSM-PROCXX] ERROR - Timeout expired before receiving CONN_SETUP_COMPLETE \n");
-    msg("\t Calling FSM to clean MT resources\n\n");
-    protocol_bs->rrc.Mobile_List[UE_Id].conn_complete_timer =0;
-    rrc_rg_fsm_control(UE_Id, RG_CRLC_STATUS);
-  }
-}
-
-//-----------------------------------------------------------------------------
-// TEMP - This should be part of the Esterel FSM
-void rrc_RG_UE_Cap_Info_rx(int UE_Id)
-{
-  //-----------------------------------------------------------------------------
-  int msgId;
-  //Send the message UE Capability Confirm.
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC_RG][XXFSM-PROCXX] UE Capability Received from UE.\n");
-#endif
-  encode_message(&msgId, UE_Id, UE_CAPABILITY_INFO_CONF);
-  RRC_RG_O_O_SEND_DCCH_AM(msgId);
-}
diff --git a/openair2/RRC/CELLULAR/rrc_rg_rrm_decode.c b/openair2/RRC/CELLULAR/rrc_rg_rrm_decode.c
deleted file mode 100755
index 4bce7a78c2..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg_rrm_decode.c
+++ /dev/null
@@ -1,526 +0,0 @@
-/***************************************************************************
-                          rrc_rg_rrm_message.c
-                          -------------------
-    copyright            : (C) 2010 by Eurecom
-    created by           : Lionel.Gauthier@eurecom.fr
-    modified by          : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Message handling for RRM interface
- **************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_rg_vars.h"
-//#include "rrc_mbms_constant.h"
-#include "rrc_messages.h"
-#include "rrc_rrm_primitives.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_rrm.h"
-#include "rrc_proto_int.h"
-#include "rrc_proto_fsm.h"
-#include "rrc_proto_intf.h"
-// #include "rrc_proto_bch.h"
-#include "rrc_proto_mbms.h"
-//-----------------------------------------------------------------------------
-
-/****************************************
- * Processes to execute messages from RRM
- ****************************************/
-//-------------------------------------------------------------------
-void rrc_config_indication (int transaction_Id, int return_code)
-{
-  //-------------------------------------------------------------------
-  int UE_Id;
-
-  UE_Id = protocol_bs->rrc.rrc_UE_updating;
-
-  //Check transaction_id to validate the configuration
-  if ((transaction_Id == protocol_bs->rrc.curr_transaction_id) && (!return_code)) {
-    // trigger event in the FSM
-#ifdef DEBUG_RRC_STATE
-    msg ("[RRC_RG][RRM] Config_indication : RRM transaction_Id received: %d , return code %d \n", transaction_Id, return_code);
-#endif
-
-    if ( protocol_bs->rrc.rrc_multicast_bearer == FALSE) {
-      // continue unicast bearer procedure
-      rrc_rg_fsm_control (UE_Id, RRM_CFG);
-    } else {
-      // continue MBMS bearer procedure
-      protocol_bs->rrc.mbms.l12ConfigurationChanged = TRUE;
-      //Update the content for Notification and Unmodif message, set the flags if having changes
-      protocol_bs->rrc.mbms.flags.modifiedServicesInformation |= rrc_rg_mbms_addModifService(-1, protocol_bs->rrc.mbms.nas_serviceId, Mod_acquirePTM_RBInfo);
-      // increment the number of active services in the RG (TEMP Max =1)
-      protocol_bs->rrc.mbms.mbms_num_active_service ++;
-      //No need to copy the RG configuration.  Same as in unicast
-      //Save MT configuration for later sending in PTMCurrentCellConfiguration
-      msg("[RRC_RG][MBMS] compress & copy from  rrm_config->mt_config  to curr_l12Config_data, size %d\n", protocol_bs->rrc.mbms.curr_l12Config_lgth);
-      rrc_compress_config ((char *) &(rrm_config->mt_config[UE_Id]), &(protocol_bs->rrc.mbms.curr_l12Config_data), &(protocol_bs->rrc.mbms.curr_l12Config_lgth));
-      protocol_bs->rrc.mbms.nas_status = ACCEPTED;
-
-      if (p_rg_mbms->ptm_requested_action == E_ADD_RB ) {
-        RRC_RG_O_O_NAS_MBMS_RB_ESTAB_CNF (); // send response only if activate
-        p_rg_mbms->ptm_requested_action = 0;
-      }
-    }
-  } else {
-#ifdef DEBUG_RRC_STATE
-    msg ("[RRC_RG][RRM] RRM transaction_Id received: %d , expected %d \n", transaction_Id, protocol_bs->rrc.curr_transaction_id);
-    msg ("[RRC_RG][RRM] RRM error return code received: %d \n", return_code);
-#endif
-
-    if ( protocol_bs->rrc.rrc_multicast_bearer == FALSE) {
-      // if not multicast drop the computed configuration procedure and
-      // inform NAS
-      rrc_rg_fsm_control (UE_Id, RRM_FAILURE);
-    } else {
-      // clean variables
-      protocol_bs->rrc.mbms.nas_status = FAILURE;
-      RRC_RG_O_O_NAS_MBMS_RB_ESTAB_CNF ();
-      protocol_bs->rrc.rrc_multicast_bearer = FALSE;
-    }
-  }
-
-  protocol_bs->rrc.rrc_currently_updating = FALSE;
-}
-
-//-------------------------------------------------------------------
-// Function called when a Measure Command from RRM is received by RRC
-void rrc_rrm_measure_request (struct rrc_rrm_measure_ctl rrm_control)
-{
-  //-------------------------------------------------------------------
-  int i, UE_Id;
-  int mesg;
-  struct rrc_rg_bs_meas_cmd *pCmd;
-
-  protocol_bs->rrc.current_SFN = Mac_rlc_xface->frame;
-
-  if (!rrm_control.BaseStation) {
-#ifdef DEBUG_RRC_MEASURE_CONTROL
-    msg ("\n[RRC_RG_RRM] RRM requests measurement in Mobile Station\n");
-#endif
-
-    if (rrm_control.UE_Id >= maxUsers)
-      return;
-
-    UE_Id = rrm_control.UE_Id;
-
-    //send it only if connected mode
-    if ((protocol_bs->rrc.Mobile_List[UE_Id].state != CELL_FACH_Connected)
-        && (protocol_bs->rrc.Mobile_List[UE_Id].state != CELL_DCH_Connected)) {
-#ifdef DEBUG_RRC_MEASURE_CONTROL
-      msg ("[RRC_RG_RRM] Mobile Station is not connected. Command dropped.\n");
-#endif
-      return;
-    }
-
-    protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.command = rrm_control.command;
-    protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.criteria_type = RC_PeriodicalReportingCriteria;
-    protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.rep_amount = rrm_control.amount;
-    protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.rep_interval = rrm_control.period;
-    protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.identity = rrm_control.type;
-    //  reporting mode  UM-Periodical
-    protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.xfer_mode = unacknowledgedModeRLC;
-    protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.trigger = periodical;
-
-    if (rrm_control.command == RRC_RRM_SETUP) {
-      switch (rrm_control.type) {
-      case IX_ifM:
-        // measurementType  intraFrequencyMeasurement
-        protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.type = MT_intraFrequencyMeasurement;
-        // intraFrequency Measurement parameters
-        protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.if_coeff = coeff0;  //default value
-        protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.if_cellIdentity_ri = TRUE;
-        protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.if_timeslotISCP_ri = TRUE;
-        protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.if_BCH_RSCP_ri = TRUE;
-        protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.if_pathloss_ri = TRUE;
-        protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.if_validity = mv_all_States;
-        break;
-
-      case IX_tvM:
-        // measurementType  trafficVolumeMeasurement
-        protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.type = MT_trafficVolumeMeasurement;
-        // trafficVolumeMeasurement parameters
-        protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.tv_validity = mv_all_States;
-        protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.tv_payload_ri = TRUE;
-        protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.tv_average_ri = TRUE;
-        protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.tv_variance_ri = TRUE;
-        break;
-
-      case IX_qM:
-        // measurementType  qualityMeasurement
-        protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.type = MT_qualityMeasurement;
-        // qualityMeasurement parameters
-        protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.q_dl_trch_bler_ri = TRUE;
-
-        for (i = 0; i < MAXMEASTFCS; i++)
-          protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.q_sir_TFCSid[i] = i + 1;
-
-        break;
-
-      case IX_iueM:
-        // measurementType  ue_InternalMeasurement
-        protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.type = MT_ue_InternalMeasurement;
-        // ue_InternalMeasurement parameters
-        protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.int_quantity = ue_TransmittedPower;
-        protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.int_coeff = coeff0; //default value
-        protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.int_rep_ue_TransmittedPower = TRUE;
-        protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_cmd.int_rep_appliedTA = TRUE;
-        break;
-
-      default:
-        msg ("\n[RRC_RG_RRM] RRM : Invalid type of measurement requested for Mobile Terminal\n");
-        return;
-      }
-    }
-
-    //send to UE
-    rrc_rg_msg_measctl (UE_Id, &mesg);
-    RRC_RG_O_O_SEND_DCCH_AM (mesg);
-  } else {
-#ifdef DEBUG_RRC_MEASURE_CONTROL
-    msg ("\n[RRC_RG_RRM] RRM requests measurement in Base Station\n");
-#endif
-    i = 0;
-
-    switch (rrm_control.type) {
-    case IX_ibsM:          // index = 0
-      i = 0;
-      break;
-
-    case IX_tvbM:          // index = 1 -> maxUsers
-      if (rrm_control.UE_Id >= maxUsers)
-        return;
-
-      i = rrm_control.UE_Id + 1;
-      break;
-
-    case IX_qbM:           // index = maxUsers+1 -> 2*maxUsers
-      if (rrm_control.UE_Id >= maxUsers)
-        return;
-
-      i = maxUsers + rrm_control.UE_Id + 1;
-      break;
-
-    default:
-      msg ("\n[RRC_RG_RRM] RRM : Invalid type of measurement requested in Base Station\n");
-      return;
-    }
-
-    pCmd = &(protocol_bs->rrc.rg_meas_blocks.bs_meas_cmd[i]);
-    pCmd->identity = i;
-    pCmd->command = rrm_control.command;
-    pCmd->UE_Id = rrm_control.UE_Id;
-
-
-    // activate or stop measurement
-    switch (pCmd->command) {
-    case MC_setup:
-    case MC_modify:
-      pCmd->trigger = periodical;
-      pCmd->type = rrm_control.type;
-      pCmd->criteria_type = RC_PeriodicalReportingCriteria;
-      pCmd->rep_amount = rrm_control.amount;
-      pCmd->rep_interval = rrm_control.period;
-#ifdef DEBUG_RRC_MEASURE_CONTROL
-      rrc_rg_print_meas_bs_control (pCmd);
-      msg ("\n[RRC_MSG] BS activates measurement: %d, type: %d for Mobile: %d.\n\n", pCmd->identity, pCmd->type, pCmd->UE_Id);
-#endif
-      protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[i].meas_counter = pCmd->rep_amount;
-      protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[i].meas_interval = pCmd->rep_interval / 10;
-      protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[i].meas_start = protocol_bs->rrc.current_SFN % protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[i].meas_interval;
-
-      if (!protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[i].meas_counter)
-        protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[i].meas_counter = -1;
-
-      protocol_bs->rrc.rg_meas_blocks.rrc_rg_bs_meas_next[i] = protocol_bs->rrc.current_SFN;
-#ifdef DEBUG_RRC_DETAILS
-      msg ("\n[RRC_MSG] Next measure at time : %d \n\n", protocol_bs->rrc.rg_meas_blocks.rrc_rg_bs_meas_next[i]);
-#endif
-      break;
-
-    case MC_release:
-#ifdef DEBUG_RRC_MEASURE_CONTROL
-      rrc_rg_print_meas_bs_control (pCmd);
-      msg ("\n[RRC_MSG] BS stops measurement: %d\n\n", pCmd->identity);
-#endif
-      protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[i].meas_start = 0;
-      protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[i].meas_counter = 0;
-      protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[i].meas_interval = 0;
-      memset (pCmd, 0, sizeof (struct rrc_rg_bs_meas_cmd));
-      protocol_bs->rrc.rg_meas_blocks.rrc_rg_bs_meas_next[i] = 0;
-      break;
-
-    default:
-      msg ("[RRC_MSG] Invalid Measure command received: %d\n\n", pCmd->command);
-    }
-  }
-}
-
-/****************************************
- * Decode Message from RRM
- ****************************************/
-/*--------------------------------------------------------------------*/
-void rrc_connection_response (void *mP, int lengthP)
-{
-  /*--------------------------------------------------------------------*/
-  connection_response *cr;
-  cr = (connection_response *) mP;
-
-  switch (cr->status) {
-  case STATUS_CONNECTION_ACCEPTED:
-    msg ("[RRC-RRM-INTF] RX CONNECTION_RESPONSE ACCEPTED eid %d @frame %d\n", cr->equipment_id, protocol_bs->rrc.current_SFN);
-
-    if (protocol_bs->rrc.rc_rrm.connected_to_rrm != RRC_CONNECTED_TO_RRM) {
-      rrc_rrm_rcve_config ((u8 *) & cr[1], lengthP - sizeof (connection_response));
-      rrc_rg_rrm_connected_init();
-      protocol_bs->rrc.rc_rrm.connected_to_rrm = RRC_CONNECTED_TO_RRM;
-      protocol_bs->rrc.rc_rrm.equipment_id = cr->equipment_id;
-    } else {
-      msg ("[RRC-RRM-INTF][WARNING] RX CONNECTION_RESPONSE ACCEPTED eid %d\n BUT ALREADY CONNECTED\n", cr->equipment_id);
-    }
-
-    break;
-
-  case STATUS_CONNECTION_REFUSED_ALREADY_CONNECTED:
-    msg ("[RRC-RRM-INTF] RX STATUS_CONNECTION_REFUSED_ALREADY_CONNECTED  %d\n", cr->status);
-    break;
-
-  case STATUS_CONNECTION_REFUSED_TOO_MANY_RG:
-    msg ("[RRC-RRM-INTF] RX STATUS_CONNECTION_REFUSED_TOO_MANY_RG  %d\n", cr->status);
-    //rrc_event(&cx.connection_state, CX_EVT_CX_REFUSED);
-    break;
-
-  default:
-    msg ("[RRC-RRM-INTF] RX CONNECTION_RESPONSE UNKNOWN STATUS %d\n", cr->status);
-  }
-}
-
-/*--------------------------------------------------------------------*/
-void rrc_add_user_response (void *mP, int lengthP)
-{
-  /*--------------------------------------------------------------------*/
-  add_user_response *r;
-
-  r = (add_user_response *) mP;
-
-  msg ("---------------------------------------------------------------------------\n");
-  msg ("[RRC-RRM-INTF] RX ADD_USER_RESPONSE %d TXID %d status %d %d bytes frame %d\n", r->user_id, r->tx_id, r->status, lengthP, protocol_bs->rrc.current_SFN);
-  msg ("---------------------------------------------------------------------------\n");
-
-  if (r->status == ADD_USER_SUCCESSFUL) {
-    rrc_rrm_rcve_config ((u8 *) & r[1], lengthP - sizeof (add_user_response));
-    rrc_config_indication (r->tx_id, 0);
-  } else {
-    rrc_config_indication (r->tx_id, 1);
-  }
-}
-
-/*--------------------------------------------------------------------*/
-void rrc_remove_user_response (void *mP, int lengthP)
-{
-  /*--------------------------------------------------------------------*/
-  remove_user_response *r;
-
-  r = (remove_user_response *) mP;
-
-  msg ("---------------------------------------------------------------------------\n");
-  msg ("[RRC-RRM-INTF] RX REMOVE_USER_RESPONSE %d TXID %d status %d %d bytes @frame %d\n", r->user_id, r->tx_id, r->status, lengthP, protocol_bs->rrc.current_SFN);
-  msg ("---------------------------------------------------------------------------\n");
-
-  if (r->status == REMOVE_USER_SUCCESSFUL) {
-    rrc_rrm_rcve_config ((u8 *) & r[1], lengthP - sizeof (remove_user_response));
-    rrc_config_indication (r->tx_id, 0);
-  } else {
-    rrc_config_indication (r->tx_id, 1);
-  }
-}
-
-/*--------------------------------------------------------------------*/
-void rrc_add_radio_access_bearer_response (void *mP, int lengthP)
-{
-  /*--------------------------------------------------------------------*/
-  add_radio_access_bearer_response *r;
-
-  r = (add_radio_access_bearer_response *) mP;
-  msg ("[RRC-RRM-INTF] rc.rx_bytes=%d\n", protocol_bs->rrc.rc_rrm.rx_bytes);
-  msg ("---------------------------------------------------------------------------\n");
-  msg ("[RRC-RRM-INTF] RX ADD_RADIO_ACCESS_BEARER_RESPONSE TXID %d status %d %d bytes @frame %d\n", r->tx_id, r->status, lengthP, protocol_bs->rrc.current_SFN);
-  msg ("---------------------------------------------------------------------------\n");
-
-  if (r->status == ADD_RADIO_ACCESS_BEARER_SUCCESSFUL) {
-    rrc_rrm_rcve_config ((u8 *) & r[1], lengthP - sizeof (add_radio_access_bearer_response));
-    rrc_config_indication (r->tx_id, 0);
-  } else {
-    rrc_config_indication (r->tx_id, 1);
-  }
-}
-/*--------------------------------------------------------------------*/
-void rrc_remove_radio_access_bearer_response (void *mP, int lengthP)
-{
-  /*--------------------------------------------------------------------*/
-  remove_radio_access_bearer_response *r;
-
-  r = (remove_radio_access_bearer_response *) mP;
-
-  msg ("---------------------------------------------------------------------------\n");
-  msg ("[RRC-RRM-INTF] RX REMOVE_RADIO_ACCESS_BEARER_RESPONSE TXID %d status %d %d bytes @frame %d\n", r->tx_id, r->status, lengthP, protocol_bs->rrc.current_SFN);
-  msg ("---------------------------------------------------------------------------\n");
-
-  if (r->status == REMOVE_RADIO_ACCESS_BEARER_SUCCESSFUL) {
-    rrc_rrm_rcve_config ((u8 *) & r[1], lengthP - sizeof (remove_radio_access_bearer_response));
-    rrc_config_indication (r->tx_id, 0);
-  } else {
-    rrc_config_indication (r->tx_id, 1);
-  }
-}
-
-/*--------------------------------------------------------------------*/
-void rrc_measurement_request (void *mP, int lengthP)
-{
-  /*--------------------------------------------------------------------*/
-  measurement_request *r;
-  struct rrc_rrm_measure_ctl rrm_control;
-
-  r = (measurement_request *) mP;
-  rrm_control.type = r->measurement_type;
-  rrm_control.command = r->measurement_command;
-
-  if (r->equipment_type == MOBILE_TERMINAL) {
-    rrm_control.BaseStation = 0;
-  } else {
-    rrm_control.BaseStation = 1;
-  }
-
-  rrm_control.UE_Id = r->equipment_id;
-  rrm_control.amount = r->amount;
-
-  if (r->period == 12800) {
-    rrm_control.period = 2000;    //r->period * 10; Coming from RRM
-  } else {
-    rrm_control.period = r->period;    //r->period * 10; Coming from test tool
-  }
-
-  msg ("---------------------------------------------------------------------------\n");
-  msg ("[RRC-RRM-INTF] RX MEASUREMENT_REQUEST  @frame %d  length %d type %d command %d isRG %d id %d amount %d period %d\n",
-       protocol_bs->rrc.current_SFN, lengthP, rrm_control.type, rrm_control.command, rrm_control.BaseStation, rrm_control.UE_Id, rrm_control.amount, rrm_control.period);
-  msg ("---------------------------------------------------------------------------\n");
-  rrc_rrm_measure_request (rrm_control);
-}
-
-/****************************************
- * identify message from RRM and call decoder
- ****************************************/
-/*--------------------------------------------------------------------*/
-void rrc_rrm_decode_message (void)
-{
-  /*--------------------------------------------------------------------*/
-  rpc_message *m;
-#ifdef DEBUG_RRC_RRM_INTF
-  msg ("[RRC-RRM-INTF][DECODE MESSAGE]   rrc_rrm_decode_message - begin \n");
-  msg ("  size rx_bytes %d, size (rpc_message) %d \n", protocol_bs->rrc.rc_rrm.rx_bytes, sizeof (rpc_message));
-#endif
-
-  while ((protocol_bs->rrc.rc_rrm.rx_bytes) > sizeof (rpc_message)) {
-    m = (rpc_message *)protocol_bs->rrc.rc_rrm.rx_buffer;
-#ifdef DEBUG_RRC_RRM_INTF
-    msg("[RRC-RRM-INTF][DECODE MESSAGE]  PACKET  length %d (header removed)\n", m->length);
-#endif
-    memset (protocol_bs->rrc.rc_rrm.rx_message, 0, RRM_MAX_MESSAGE_SIZE);
-
-    switch (m->type) {
-    case RPC_CONNECTION_RESPONSE:
-      memcpy (protocol_bs->rrc.rc_rrm.rx_message, &protocol_bs->rrc.rc_rrm.rx_buffer[sizeof (rpc_message)], m->length);
-      protocol_bs->rrc.rc_rrm.rx_bytes = protocol_bs->rrc.rc_rrm.rx_bytes - m->length - sizeof (rpc_message);
-#ifdef DEBUG_RRC_RRM_INTF
-      msg("[RRC-RRM-INTF][DECODE MESSAGE] Remaining message in queue, length %d\n", protocol_bs->rrc.rc_rrm.rx_bytes);
-#endif
-      rrc_connection_response (protocol_bs->rrc.rc_rrm.rx_message, m->length);
-      break;
-
-    case RPC_ADD_USER_RESPONSE:
-      memcpy (protocol_bs->rrc.rc_rrm.rx_message, &protocol_bs->rrc.rc_rrm.rx_buffer[sizeof (rpc_message)], m->length);
-      protocol_bs->rrc.rc_rrm.rx_bytes = protocol_bs->rrc.rc_rrm.rx_bytes - m->length - sizeof (rpc_message);
-#ifdef DEBUG_RRC_RRM_INTF
-      msg("[RRC-RRM-INTF][DECODE MESSAGE] Remaining message in queue, length %d\n", protocol_bs->rrc.rc_rrm.rx_bytes);
-#endif
-      rrc_add_user_response (protocol_bs->rrc.rc_rrm.rx_message, m->length);
-      break;
-
-    case RPC_REMOVE_USER_RESPONSE:
-      memcpy (protocol_bs->rrc.rc_rrm.rx_message, &protocol_bs->rrc.rc_rrm.rx_buffer[sizeof (rpc_message)], m->length);
-      protocol_bs->rrc.rc_rrm.rx_bytes = protocol_bs->rrc.rc_rrm.rx_bytes - m->length - sizeof (rpc_message);
-#ifdef DEBUG_RRC_RRM_INTF
-      msg("[RRC-RRM-INTF][DECODE MESSAGE] Remaining message in queue, length %d\n", protocol_bs->rrc.rc_rrm.rx_bytes);
-#endif
-      rrc_remove_user_response (protocol_bs->rrc.rc_rrm.rx_message, m->length);
-      break;
-
-    case RPC_ADD_RADIO_ACCESS_BEARER_RESPONSE:
-      memcpy (protocol_bs->rrc.rc_rrm.rx_message, &protocol_bs->rrc.rc_rrm.rx_buffer[sizeof (rpc_message)], m->length);
-      protocol_bs->rrc.rc_rrm.rx_bytes = protocol_bs->rrc.rc_rrm.rx_bytes - m->length - sizeof (rpc_message);
-#ifdef DEBUG_RRC_RRM_INTF
-      msg("[RRC-RRM-INTF][DECODE MESSAGE] Remaining message in queue, length %d\n", protocol_bs->rrc.rc_rrm.rx_bytes);
-#endif
-      rrc_add_radio_access_bearer_response (protocol_bs->rrc.rc_rrm.rx_message, m->length);
-      break;
-
-    case RPC_REMOVE_RADIO_ACCESS_BEARER_RESPONSE:
-      memcpy (protocol_bs->rrc.rc_rrm.rx_message, &protocol_bs->rrc.rc_rrm.rx_buffer[sizeof (rpc_message)], m->length);
-      protocol_bs->rrc.rc_rrm.rx_bytes = protocol_bs->rrc.rc_rrm.rx_bytes - m->length - sizeof (rpc_message);
-#ifdef DEBUG_RRC_RRM_INTF
-      msg("[RRC-RRM-INTF][DECODE MESSAGE] Remaining message in queue, length %d\n", protocol_bs->rrc.rc_rrm.rx_bytes);
-#endif
-      rrc_remove_radio_access_bearer_response (protocol_bs->rrc.rc_rrm.rx_message, m->length);
-      break;
-
-    case RPC_MEASUREMENT_REQUEST:
-      memcpy (protocol_bs->rrc.rc_rrm.rx_message, &protocol_bs->rrc.rc_rrm.rx_buffer[sizeof (rpc_message)], m->length);
-      protocol_bs->rrc.rc_rrm.rx_bytes = protocol_bs->rrc.rc_rrm.rx_bytes - m->length - sizeof (rpc_message);
-#ifdef DEBUG_RRC_RRM_INTF
-      msg("[RRC-RRM-INTF][DECODE MESSAGE] Remaining message in queue, length %d\n", protocol_bs->rrc.rc_rrm.rx_bytes);
-#endif
-      rrc_measurement_request (protocol_bs->rrc.rc_rrm.rx_message, m->length);
-      break;
-
-    case RPC_CONFIG_REQUEST:
-    case RPC_CONNECTION_CLOSE:
-    case RPC_UPLINK_PHYSICAL_CHANNEL_CONTROL:
-    case RPC_ACK:
-      memcpy (protocol_bs->rrc.rc_rrm.rx_message, &protocol_bs->rrc.rc_rrm.rx_buffer[sizeof (rpc_message)], m->length);
-      protocol_bs->rrc.rc_rrm.rx_bytes = protocol_bs->rrc.rc_rrm.rx_bytes - m->length - sizeof (rpc_message);
-#ifdef DEBUG_RRC_RRM_INTF
-      msg("[RRC-RRM-INTF][DECODE MESSAGE] Remaining message in queue, length %d\n", protocol_bs->rrc.rc_rrm.rx_bytes);
-#endif
-      msg ("[RRC-RRM-INTF][WARNING] rrc_rrm_decode_message IGNORED MESSAGE %d\n", m->type);
-      break;
-
-    default:
-      msg ("[RRC-RRM-INTF][WARNING] rrc_rrm_decode_message UNKNOWN MESSAGE %d FLUSHING BUFFER\n", m->type);
-      rrc_connection_response_TEMPdummy();
-      protocol_bs->rrc.rc_rrm.rx_bytes = 0;
-      return;
-    }
-  }
-}
-
-
-/*--------------------------------------------------------------------*/
-void rrc_connection_response_TEMPdummy (void)
-{
-  /*--------------------------------------------------------------------*/
-
-  if (protocol_bs->rrc.rc_rrm.connected_to_rrm != RRC_CONNECTED_TO_RRM) {
-    rrc_rg_rrm_connected_init();
-    protocol_bs->rrc.rc_rrm.connected_to_rrm = RRC_CONNECTED_TO_RRM;
-    protocol_bs->rrc.rc_rrm.equipment_id = 0;
-    msg ("[RRC-RRM-INTF] TEMP DUMMY RX CONNECTION_RESPONSE ACCEPTED eid 0 @frame %d\n",  protocol_bs->rrc.current_SFN);
-
-  }
-}
-
diff --git a/openair2/RRC/CELLULAR/rrc_rg_rrm_outputs.c b/openair2/RRC/CELLULAR/rrc_rg_rrm_outputs.c
deleted file mode 100755
index 5a4240bd1d..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg_rrm_outputs.c
+++ /dev/null
@@ -1,560 +0,0 @@
-/***************************************************************************
-                          rrc_rg_rrm_intf.c  -  description
-                             -------------------
-    begin                : November 25, 2002
-    copyright            : (C) 2002, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
-    email                : Lionel.gauthier@eurecom.fr
- **************************************************************************
-  Procedures associated with the control of the RG protocol stack
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-#include "rtos_header.h"
-
-/********************
-// RRC definitions
- ********************/
-//#include "rlc.h"
-#include "rrc_rg_vars.h"
-//#include "rrc_messages.h"
-//#include "rrm_as_sap.h"
-#include "rrc_qos_classes.h"
-#include "rrc_qos_definitions.h"
-//-----------------------------------------------------------------------------
-//#include "rrc_proto_intf.h"
-//#include "rrc_proto_fsm.h"
-#include "rrc_proto_int.h"
-//#include "rrc_proto_mbms.h"
-//#include "rrc_proto_msg.h"
-//-----------------------------------------------------------------------------
-
-//-------------------------------------------------------------------
-void rrc_rg_init_check_qos_classes(void)
-{
-  //-------------------------------------------------------------------
-  int i;
-
-  msg("\n\n***********************************************\n");
-  msg("***      [CHECK QOS CLASSES]               ****\n");
-  msg("***********************************************\n");
-
-  for (i=0; i<RRC_QOS_LAST; i++) {
-    msg("\n Traffic Class %d \n",i+1);
-    printk("\trab.traffic_class = %s \n",rrc_traffic_class_names[(rrc_qos_classes_definition [i][0])-1]);
-    printk("\trab.guaranted_bit_rate_uplink   = %d \n",rrc_qos_classes_definition [i][1]);
-    printk("\trab.max_bit_rate_uplink         = %d \n",rrc_qos_classes_definition [i][2]);
-    printk("\trab.guaranted_bit_rate_downlink = %d \n",rrc_qos_classes_definition [i][3]);
-    printk("\trab.max_bit_rate_downlink       = %d \n",rrc_qos_classes_definition [i][4]);
-  }
-}
-
-//-------------------------------------------------------------------
-// Request computation of the configuration from RRM
-int rrc_rg_compute_configuration (int UE_Id, u8 action)
-{
-  //-------------------------------------------------------------------
-  rpc_message     rpc_mess;
-  add_user_request add_user;
-  remove_user_request remove_user;
-  add_radio_access_bearer_request add_rab;
-  remove_radio_access_bearer_request remove_rab;
-  int result = SUCCESS;
-  int rab_qos_class_ix;
-  int count;
-
-  if (protocol_bs->rrc.rrc_currently_updating != FALSE) {
-    result = FAILURE;
-    return result;
-  }
-
-  msg ("[RRC][REQUEST] -> RRM rrm_config_change_request : Transaction ID %d\n", ++(protocol_bs->rrc.curr_transaction_id));
-
-  switch (action) {
-  case E_ADD_MT:
-    msg ("[RRC][REQUEST] RRC -> RRM ADD_MOBILE %d \n", UE_Id);
-    rpc_mess.type = RPC_ADD_USER_REQUEST;
-    rpc_mess.length = sizeof (add_user_request);
-    rpc_mess.frame = protocol_bs->rrc.current_SFN;
-    add_user.equipment_id = protocol_bs->rrc.rc_rrm.equipment_id;
-    /*        add_user.user_id = config_request.mobile_id;
-            add_user.tx_id = config_request.transaction_id;*/
-    add_user.user_id = UE_Id;
-    add_user.tx_id = protocol_bs->rrc.curr_transaction_id;
-
-    count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & rpc_mess, sizeof (rpc_message));
-    count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & add_user, sizeof (struct add_user_request));
-    break;
-
-  case E_REL_MT:
-    msg ("[RRC][REQUEST] RRC -> RRM REMOVE_MOBILE %d \n", UE_Id);
-    rpc_mess.type = RPC_REMOVE_USER_REQUEST;
-    rpc_mess.length = sizeof (remove_user_request);
-    rpc_mess.frame = protocol_bs->rrc.current_SFN;
-    remove_user.equipment_id = protocol_bs->rrc.rc_rrm.equipment_id;
-    /*       remove_user.user_id = config_request.mobile_id;
-           remove_user.tx_id = config_request.transaction_id;*/
-    remove_user.user_id = UE_Id;
-    remove_user.tx_id = protocol_bs->rrc.curr_transaction_id;
-
-    count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & rpc_mess, sizeof (rpc_message));
-    count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & remove_user, sizeof (struct remove_user_request));
-    break;
-
-  case E_ADD_RB:
-    rpc_mess.type = RPC_ADD_RADIO_ACCESS_BEARER_REQUEST;
-    rpc_mess.length = sizeof (add_radio_access_bearer_request);
-    rpc_mess.frame = protocol_bs->rrc.current_SFN;
-    add_rab.equipment_id = protocol_bs->rrc.rc_rrm.equipment_id;
-    /*        add_rab.user_id = config_request.rb_list[0] / maxRB;
-            add_rab.tx_id = config_request.transaction_id;
-            add_rab.rab_id = config_request.rb_list[0];
-            rab_qos_class_ix = config_request.qos_class_list[0].umts_qos_class-1;*/
-    add_rab.user_id = UE_Id;
-    add_rab.tx_id = protocol_bs->rrc.curr_transaction_id;
-    // HARD CODED request.num_rbs = 1; ONLY ONE RB AT A TIME
-    add_rab.rab_id = protocol_bs->rrc.Mobile_List[UE_Id].requested_rbId;
-    rab_qos_class_ix = (protocol_bs->rrc.Mobile_List[UE_Id].requested_QoSclass)-1;
-
-    if ((rab_qos_class_ix<0)||(rab_qos_class_ix>=RRC_QOS_LAST))
-      msg ("\n[RRC][REQUEST] RRC -> RRM MOBILE %d ADD_RADIO_BEARER QOS NOT UNDERSTOOD NO ACTION \n", UE_Id);
-    else {
-      add_rab.traffic_class = rrc_qos_classes_definition [rab_qos_class_ix][0];
-      add_rab.guaranted_bit_rate_uplink   = rrc_qos_classes_definition [rab_qos_class_ix][1];
-      add_rab.max_bit_rate_uplink         = rrc_qos_classes_definition [rab_qos_class_ix][2];
-      add_rab.guaranted_bit_rate_downlink = rrc_qos_classes_definition [rab_qos_class_ix][3];
-      add_rab.max_bit_rate_downlink       = rrc_qos_classes_definition [rab_qos_class_ix][4];
-      msg ("[RRC][REQUEST] RRC -> RRM MOBILE %d ADD_RADIO_BEARER %d %s GBR %d Kbits DL %d Kbits UL\n",
-           add_rab.user_id, add_rab.rab_id, rrc_traffic_class_names[add_rab.traffic_class-1],
-           add_rab.guaranted_bit_rate_downlink, add_rab.guaranted_bit_rate_uplink);
-    }
-
-    count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & rpc_mess, sizeof (rpc_message));
-    count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & add_rab, sizeof (struct add_radio_access_bearer_request));
-    break;
-
-  case E_REL_RB:
-    msg ("[RRC][REQUEST] RRC -> RRM MOBILE %d REMOVE_RADIO_BEARER %d \n", UE_Id, protocol_bs->rrc.Mobile_List[UE_Id].requested_rbId);
-    rpc_mess.type = RPC_REMOVE_RADIO_ACCESS_BEARER_REQUEST;
-    rpc_mess.length = sizeof (remove_radio_access_bearer_request);
-    rpc_mess.frame = protocol_bs->rrc.current_SFN;
-    remove_rab.equipment_id = protocol_bs->rrc.rc_rrm.equipment_id;
-    /*        remove_rab.tx_id = config_request.transaction_id;
-            remove_rab.rab_id = config_request.rb_list[0];
-            remove_rab.user_id = config_request.mobile_id;*/
-    remove_rab.user_id = UE_Id;
-    remove_rab.tx_id = protocol_bs->rrc.curr_transaction_id;
-    remove_rab.rab_id = protocol_bs->rrc.Mobile_List[UE_Id].requested_rbId;
-    count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & rpc_mess, sizeof (rpc_message));
-    count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & remove_rab, sizeof (struct remove_radio_access_bearer_request));
-    break;
-
-  default:
-    msg ("[RRC][REQUEST] RRC -> RRM Invalid config_request.action %d \n", action);
-  }
-
-  protocol_bs->rrc.rrc_currently_updating = TRUE;
-  protocol_bs->rrc.rrc_UE_updating = UE_Id;
-  protocol_bs->rrc.Mobile_List[UE_Id].requested_sapid = 3;    //Temp - will later be read from a table
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RG][RRM] Configuration requested: mobile_id %d , rb_id %d, Qos %d \n",
-       UE_Id, protocol_bs->rrc.Mobile_List[UE_Id].requested_rbId, protocol_bs->rrc.Mobile_List[UE_Id].requested_QoSclass);
-#endif
-  return result;
-}
-
-//-------------------------------------------------------------------
-// Report MOBILE CONNECTION COMPLETE
-void rrm_add_user_confirm (int ue_idP)
-{
-  //-------------------------------------------------------------------
-  rpc_message     rpc_mess;
-  add_user_confirm confirm;
-  int count;
-
-  msg ("[RRC-RRM-INTF] RPC_ADD_USER_CONFIRM --> RRM\n ");
-
-  rpc_mess.type = RPC_ADD_USER_CONFIRM;
-  rpc_mess.length = sizeof (add_user_confirm);
-  confirm.equipment_id = protocol_bs->rrc.rc_rrm.equipment_id;
-  confirm.user_id = ue_idP;
-
-  count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & rpc_mess, sizeof (rpc_message));
-  count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & confirm, sizeof (add_user_confirm));
-}
-
-
-//-------------------------------------------------------------------
-// Report MOBILE CONNECTION COMPLETE
-void rrm_add_radio_access_bearer_confirm (int ue_idP, int rb_idP)
-{
-  //-------------------------------------------------------------------
-  rpc_message     rpc_mess;
-  add_radio_access_bearer_confirm confirm;
-  int count;
-
-  msg ("[RRC-RRM-INTF] RPC_ADD_RADIO_ACCESS_BEARER_CONFIRM --> RRM\n ");
-
-  rpc_mess.type = RPC_ADD_RADIO_ACCESS_BEARER_CONFIRM;
-  rpc_mess.length = sizeof (add_radio_access_bearer_confirm);
-  confirm.equipment_id = protocol_bs->rrc.rc_rrm.equipment_id;
-  confirm.user_id = ue_idP;
-  confirm.rab_id = rb_idP;
-
-  count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & rpc_mess, sizeof (rpc_message));
-  count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & confirm, sizeof (add_radio_access_bearer_confirm));
-}
-
-// Measurement report to RRM
-// 1 - from Mobile Terminal
-//-------------------------------------------------------------------
-// Report Intra-frequency measurements from MT
-void rrm_meas_report_mt_if (struct rrc_rrm_meas_report_mt_if *pmeas)
-{
-  //-------------------------------------------------------------------
-  rpc_message     rpc_mess;
-  l1_measurement_mt_intra_frequency_report measurement_report;
-  int count;
-
-#ifdef DEBUG_RRC_MEASURE_REPORT
-  msg ("[RRC][MEASUREMENT REPORT] INTRA FREQUENCY MT frame %d\n", protocol_bs->rrc.current_SFN);
-#endif
-  rpc_mess.type = RPC_L1_MEASUREMENT_MT_INTRA_FREQUENCY_REPORT;
-  rpc_mess.length = sizeof (l1_measurement_mt_intra_frequency_report);
-  //  rpc_mess.frame = frame;
-  rpc_mess.frame = protocol_bs->rrc.current_SFN;
-  measurement_report.equipment_id = protocol_bs->rrc.rc_rrm.equipment_id;
-  memcpy (&measurement_report.measurements, pmeas, sizeof (struct rrc_rrm_meas_report_mt_if));
-
-  count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & rpc_mess, sizeof (rpc_message));
-  count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & measurement_report, sizeof (l1_measurement_mt_intra_frequency_report));
-
-}
-
-//-------------------------------------------------------------------
-// Report Traffic Volume measurements from MT
-void rrm_meas_report_mt_tv (struct rrc_rrm_meas_report_mt_tv *pmeas)
-{
-  //-------------------------------------------------------------------
-  rpc_message     rpc_mess;
-  l1_measurement_mt_traffic_volume_report measurement_report;
-  int count;
-
-#ifdef DEBUG_RRC_MEASURE_REPORT
-  //msg("[RRC][MEASUREMENT REPORT] TRAFFIC VOLUME MT frame %d\n", protocol_bs->rrc.current_SFN);
-#endif
-  rpc_mess.type = RPC_L1_MEASUREMENT_MT_TRAFFIC_VOLUME_REPORT;
-  rpc_mess.length = sizeof (l1_measurement_mt_traffic_volume_report);
-  //  rpc_mess.frame = frame;
-  rpc_mess.frame = protocol_bs->rrc.current_SFN;
-  measurement_report.equipment_id = protocol_bs->rrc.rc_rrm.equipment_id;
-  memcpy (&measurement_report.measurements, pmeas, sizeof (struct rrc_rrm_meas_report_mt_tv));
-
-  count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & rpc_mess, sizeof (rpc_message));
-  count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & measurement_report, sizeof (l1_measurement_mt_traffic_volume_report));
-}
-
-//-------------------------------------------------------------------
-// Report Quality measurements from MT
-void rrm_meas_report_mt_q (struct rrc_rrm_meas_report_mt_q *pmeas)
-{
-  //-------------------------------------------------------------------
-  rpc_message     rpc_mess;
-  l1_measurement_mt_quality_report measurement_report;
-  int count;
-
-#ifdef DEBUG_RRC_MEASURE_REPORT
-  msg ("[RRC][MEASUREMENT REPORT] QUALITY MT frame %d\n", protocol_bs->rrc.current_SFN);
-#endif
-  rpc_mess.type = RPC_L1_MEASUREMENT_MT_QUALITY_REPORT;
-  rpc_mess.length = sizeof (l1_measurement_mt_quality_report);
-  //  rpc_mess.frame = frame;
-  rpc_mess.frame = protocol_bs->rrc.current_SFN;
-  measurement_report.equipment_id = protocol_bs->rrc.rc_rrm.equipment_id;
-  memcpy (&measurement_report.measurements, pmeas, sizeof (struct rrc_rrm_meas_report_mt_q));
-
-  count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & rpc_mess, sizeof (rpc_message));
-  count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & measurement_report, sizeof (l1_measurement_mt_quality_report));
-}
-
-//-------------------------------------------------------------------
-// Report UE Internal measurements from MT
-void rrm_meas_report_mt_int (struct rrc_rrm_meas_report_mt_int *pmeas)
-{
-  //-------------------------------------------------------------------
-  rpc_message     rpc_mess;
-  l1_measurement_mt_internal_report measurement_report;
-  int count;
-
-#ifdef DEBUG_RRC_MEASURE_REPORT
-  msg ("[RRC][MEASUREMENT REPORT] INTERNAL MT frame %d\n", protocol_bs->rrc.current_SFN);
-#endif
-  rpc_mess.type = RPC_L1_MEASUREMENT_MT_INTERNAL_REPORT;
-  rpc_mess.length = sizeof (l1_measurement_mt_internal_report);
-  //  rpc_mess.frame = frame;
-  rpc_mess.frame = protocol_bs->rrc.current_SFN;
-  measurement_report.equipment_id = protocol_bs->rrc.rc_rrm.equipment_id;
-  memcpy (&measurement_report.measurements, pmeas, sizeof (struct rrc_rrm_meas_report_mt_int));
-
-  count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & rpc_mess, sizeof (rpc_message));
-  count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & measurement_report, sizeof (l1_measurement_mt_internal_report));
-}
-
-// 2 - from Base station
-//-------------------------------------------------------------------
-// Report Traffic Volume measurements from RG
-void rrm_meas_report_bs_tv (struct rrc_rrm_meas_report_bs_tv *pmeas)
-{
-  //-------------------------------------------------------------------
-  rpc_message     rpc_mess;
-  l1_measurement_rg_traffic_volume_report measurement_report;
-  int count;
-
-#ifdef DEBUG_RRC_MEASURE_REPORT
-  //msg("[RRC][MEASUREMENT REPORT] TRAFFIC VOLUME RG frame %d\n", protocol_bs->rrc.current_SFN);
-#endif
-  rpc_mess.type = RPC_L1_MEASUREMENT_RG_TRAFFIC_VOLUME_REPORT;
-  rpc_mess.length = sizeof (l1_measurement_rg_traffic_volume_report);
-  //  rpc_mess.frame = frame;
-  rpc_mess.frame = protocol_bs->rrc.current_SFN;
-  measurement_report.equipment_id = protocol_bs->rrc.rc_rrm.equipment_id;
-  memcpy (&measurement_report.measurements, pmeas, sizeof (struct rrc_rrm_meas_report_bs_tv));
-
-  count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & rpc_mess, sizeof (rpc_message));
-  count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & measurement_report, sizeof (struct l1_measurement_rg_traffic_volume_report));
-}
-
-//-------------------------------------------------------------------
-// Report Quality measurements from RG
-void rrm_meas_report_bs_q (struct rrc_rrm_meas_report_bs_q *pmeas)
-{
-  //-------------------------------------------------------------------
-  rpc_message     rpc_mess;
-  l1_measurement_rg_internal_report measurement_report;
-  int count;
-
-#ifdef DEBUG_RRC_MEASURE_REPORT
-  //msg("[RRC][MEASUREMENT REPORT] QUALITY RG frame %d\n", protocol_bs->rrc.current_SFN);
-#endif
-  rpc_mess.type = RPC_L1_MEASUREMENT_RG_QUALITY_REPORT;
-  rpc_mess.length = sizeof (l1_measurement_rg_quality_report);
-  //  rpc_mess.frame = frame;
-  rpc_mess.frame = protocol_bs->rrc.current_SFN;
-  measurement_report.equipment_id = protocol_bs->rrc.rc_rrm.equipment_id;
-  memcpy (&measurement_report.measurements, pmeas, sizeof (struct rrc_rrm_meas_report_bs_q));
-
-  count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & rpc_mess, sizeof (rpc_message));
-  count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & measurement_report, sizeof (struct l1_measurement_rg_quality_report));
-}
-
-//-------------------------------------------------------------------
-// Report BS Internal measurements from RG
-void rrm_meas_report_bs_int (struct rrc_rrm_meas_report_bs_int *pmeas)
-{
-  //-------------------------------------------------------------------
-  rpc_message rpc_mess;
-  l1_measurement_rg_internal_report measurement_report;
-#ifdef DEBUG_RRC_MEASURE_REPORT
-  int slot;
-#endif
-  int count;
-
-  rpc_mess.type = RPC_L1_MEASUREMENT_RG_INTERNAL_REPORT;
-  rpc_mess.length = sizeof (l1_measurement_rg_internal_report);
-  //  rpc_mess.frame = frame;
-  rpc_mess.frame = protocol_bs->rrc.current_SFN;
-  measurement_report.equipment_id = protocol_bs->rrc.rc_rrm.equipment_id;
-  memcpy (&measurement_report.measurements, pmeas, sizeof (struct rrc_rrm_meas_report_bs_int));
-
-  //msg("[RRC][MEASUREMENT REPORT] INTERNAL RG frame %d length %d\n", protocol_bs->rrc.current_SFN, rpc_mess.length);
-
-#ifdef DEBUG_RRC_MEASURE_REPORT
-  msg ("[RG][MEASUREMENT REPORT]\n");
-
-  for (slot = 0; slot < JRRM_SLOTS_PER_FRAME; slot++) {
-    msg (" Slot %d  \tRSSI RRM %d", slot, measurement_report.measurements.int_rssi_rf[0][slot]);
-    msg ("\tRSSI RRC %d\n", pmeas->int_rssi_rf[0][slot]);
-  }
-
-#endif
-
-  count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & rpc_mess, sizeof (rpc_message));
-  count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & measurement_report, sizeof (struct l1_measurement_rg_internal_report));
-}
-
-//-------------------------------------------------------------------
-// Forward MT measurement to RRM
-void rrc_rg_fwd_meas_report (int UE_Id)
-{
-  //-------------------------------------------------------------------
-  struct rrc_rg_mt_meas_rep *p;
-  union rrc_rrm_meas_report_mt_rrc meas_mt;
-  int i, j;
-
-  p = (struct rrc_rg_mt_meas_rep *)&(protocol_bs->rrc.Mobile_List[UE_Id].rg_meas_rep[protocol_bs->rrc.Mobile_List[UE_Id].rrc_rg_last_measurement]);
-
-  switch (p->meas_results_type) {
-  case MR_intraFreqMeasuredResultsList:
-    meas_mt.meas_rep_mt_if.UE_Id = UE_Id;
-    meas_mt.meas_rep_mt_if.if_num_cells = p->if_num_cells;
-
-    for (i = 0; i < p->if_num_cells; i++) {
-      meas_mt.meas_rep_mt_if.if_cell_id[i] = p->if_cell_id[i];
-      meas_mt.meas_rep_mt_if.if_cell_parms_id[i] = p->if_cell_parms_id[i];
-      meas_mt.meas_rep_mt_if.if_BCH_RSCP[i] = p->if_BCH_RSCP[i];
-      meas_mt.meas_rep_mt_if.if_pathloss[i] = p->if_pathloss[i];
-
-      for (j = 0; j < JRRM_SLOTS_PER_FRAME; j++)
-        meas_mt.meas_rep_mt_if.if_slot_iscp[i][j] = p->if_slot_iscp[i][j];
-    }
-
-#ifdef DEBUG_RRC_FORWARD_MT_MEASURE_REPORT
-    msg ("[RRC_RG][MEAS]Reporting MT Intra Frequency Measurement to RRM at time %d\n", protocol_bs->rrc.current_SFN);
-#endif
-    rrm_meas_report_mt_if (&(meas_mt.meas_rep_mt_if));
-    break;
-
-  case MR_trafficVolumeMeasuredResultsList:
-    meas_mt.meas_rep_mt_tv.UE_Id = UE_Id;
-    meas_mt.meas_rep_mt_tv.tv_num_rbs = p->tv_num_rbs;
-
-    for (i = 0; i < p->tv_num_rbs; i++) {
-      meas_mt.meas_rep_mt_tv.tv_rbid[i] = p->tv_rbid[i];
-      meas_mt.meas_rep_mt_tv.tv_rb_payload[i] = p->tv_rb_payload[i];
-      meas_mt.meas_rep_mt_tv.tv_rb_average[i] = p->tv_rb_average[i];
-      meas_mt.meas_rep_mt_tv.tv_rb_variance[i] = p->tv_rb_variance[i];
-    }
-
-#ifdef DEBUG_RRC_FORWARD_MT_MEASURE_REPORT
-    msg ("[RRC_RG][MEAS]Reporting MT Traffic Volume Measurement to RRM at time %d\n", protocol_bs->rrc.current_SFN);
-#endif
-    rrm_meas_report_mt_tv (&(meas_mt.meas_rep_mt_tv));
-    break;
-
-  case MR_qualityMeasuredResults:
-    meas_mt.meas_rep_mt_q.UE_Id = UE_Id;
-    meas_mt.meas_rep_mt_q.q_num_TrCH = p->q_num_TrCH;
-
-    for (i = 0; i < p->q_num_TrCH; i++) {
-      meas_mt.meas_rep_mt_q.q_dl_TrCH_id[i] = p->q_dl_TrCH_id[i];
-      meas_mt.meas_rep_mt_q.q_dl_TrCH_BLER[i] = p->q_dl_TrCH_BLER[i];
-    }
-
-    meas_mt.meas_rep_mt_q.q_num_tfcs = p->q_num_tfcs;
-
-    for (i = 0; i < p->q_num_tfcs; i++) {
-#ifdef DEBUG_RRC_FORWARD_MT_MEASURE_REPORT
-      msg ("[RRC_RG][MEAS] Reporting MT  %d  SIR(dB) for slots  \n", UE_Id);
-#endif
-      meas_mt.meas_rep_mt_q.q_tfcs_id[i] = p->q_tfcs_id[i];
-
-      for (j = 0; j < JRRM_SLOTS_PER_FRAME; j++)
-        meas_mt.meas_rep_mt_q.q_sir[i][j] = p->q_sir[i][j];
-
-#ifdef DEBUG_RRC_FORWARD_MT_MEASURE_REPORT
-      msg ("%d:%d-", j, meas_mt.meas_rep_mt_q.q_sir[i][j]);
-#endif
-    }
-
-#ifdef DEBUG_RRC_FORWARD_MT_MEASURE_REPORT
-    msg ("\n[RRC_RG][MEAS]Reporting MT Quality Measurement to RRM at time %d\n", protocol_bs->rrc.current_SFN);
-#endif
-    rrm_meas_report_mt_q (&(meas_mt.meas_rep_mt_q));
-    break;
-
-  case MR_ue_InternalMeasuredResults:
-    meas_mt.meas_rep_mt_int.UE_Id = UE_Id;
-
-    for (i = 0; i < JRRM_SLOTS_PER_FRAME; i++) {
-      meas_mt.meas_rep_mt_int.int_xmit_power[i] = p->int_xmit_power[i];
-    }
-
-    meas_mt.meas_rep_mt_int.int_timing_advance = p->int_timing_advance;
-#ifdef DEBUG_RRC_FORWARD_MT_MEASURE_REPORT
-    msg ("[RRC_RG][MEAS]Reporting UE internal Measurement to RRM at time %d\n", protocol_bs->rrc.current_SFN);
-#endif
-    rrm_meas_report_mt_int (&(meas_mt.meas_rep_mt_int));
-    break;
-  }
-}
-
-//-----------------------------------------------------------------------------
-void rrc_rg_send_bs_meas_report (int index)
-{
-  //-----------------------------------------------------------------------------
-  int i, j;
-  struct rrc_rg_bs_meas_rep *p;
-  union rrc_rrm_meas_report_bs_rrc meas_bs;
-
-  p = (struct rrc_rg_bs_meas_rep *)&(protocol_bs->rrc.rg_meas_blocks.bs_meas_rep[index]);
-
-  switch (p->meas_results_type) {
-  case IX_tvbM:
-    meas_bs.meas_rep_bs_tv.UE_Id = index - 1;
-    meas_bs.meas_rep_bs_tv.tv_num_rbs = p->tv_num_rbs;
-
-    for (i = 0; i < p->tv_num_rbs; i++) {
-      meas_bs.meas_rep_bs_tv.tv_rbid[i] = p->tv_rbid[i];
-      meas_bs.meas_rep_bs_tv.tv_rb_payload[i] = p->tv_rb_payload[i];
-      meas_bs.meas_rep_bs_tv.tv_rb_average[i] = p->tv_rb_average[i];
-      meas_bs.meas_rep_bs_tv.tv_rb_variance[i] = p->tv_rb_variance[i];
-    }
-
-#ifdef DEBUG_RRC_MEASURE_REPORT
-    msg ("[RRC_RG][MEAS]Reporting BS Traffic Volume Measurement to RRM at time %d\n", protocol_bs->rrc.current_SFN);
-#endif
-    rrm_meas_report_bs_tv (&(meas_bs.meas_rep_bs_tv));
-    break;
-
-  case IX_qbM:
-    meas_bs.meas_rep_bs_q.UE_Id = index - maxUsers - 1;
-    meas_bs.meas_rep_bs_q.q_num_TrCH = p->q_num_TrCH;
-
-    for (i = 0; i < p->q_num_TrCH; i++) {
-      meas_bs.meas_rep_bs_q.q_dl_TrCH_id[i] = p->q_dl_TrCH_id[i];
-      meas_bs.meas_rep_bs_q.q_dl_TrCH_BLER[i] = p->q_dl_TrCH_BLER[i];
-    }
-
-    meas_bs.meas_rep_bs_q.q_num_tfcs = p->q_num_tfcs;
-
-    for (i = 0; i < p->q_num_tfcs; i++) {
-      meas_bs.meas_rep_bs_q.q_tfcs_id[i] = p->q_tfcs_id[i];
-
-      for (j = 0; j < JRRM_SLOTS_PER_FRAME; j++)
-        meas_bs.meas_rep_bs_q.q_sir[i][j] = p->q_sir[i][j];
-    }
-
-#ifdef DEBUG_RRC_MEASURE_REPORT
-    msg ("[RRC_RG][MEAS]Reporting BS Quality Measurement to RRM at time %d\n", protocol_bs->rrc.current_SFN);
-#endif
-    rrm_meas_report_bs_q (&(meas_bs.meas_rep_bs_q));
-    break;
-
-  case IX_ibsM:
-    for (i = 0; i < numANTENNAS; i++) {
-      for (j = 0; j < JRRM_SLOTS_PER_FRAME; j++) {
-        meas_bs.meas_rep_bs_int.int_xmit_power[i][j] = p->int_xmit_power[i][j];
-        meas_bs.meas_rep_bs_int.int_rssi_rf[i][j] = p->int_rssi_rf[i][j];
-      }
-    }
-
-    for (i = 0; i < JRRM_SLOTS_PER_FRAME; i++) {
-      for (j = 0; j < MAXCH; j++)
-        meas_bs.meas_rep_bs_int.int_rscp[i][j] = p->int_rscp[i][j];
-    }
-
-    for (i = 0; i < NUMSPARE; i++) {
-      meas_bs.meas_rep_bs_int.int_spare[i] = p->int_spare[i];
-    }
-
-#ifdef DEBUG_RRC_MEASURE_REPORT
-    msg ("[RRC_RG][MEAS]Reporting BS Internal Measurement to RRM at time %d\n", protocol_bs->rrc.current_SFN);
-#endif
-    rrm_meas_report_bs_int (&(meas_bs.meas_rep_bs_int));
-    break;
-  }
-}
-
diff --git a/openair2/RRC/CELLULAR/rrc_rg_rrm_process.c b/openair2/RRC/CELLULAR/rrc_rg_rrm_process.c
deleted file mode 100755
index 0218aabeb7..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg_rrm_process.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/***************************************************************************
-                          rrc_rg_rrm_process.c
-                          -------------------
-    copyright            : (C) 2009, 2010 by Eurecom
-    created by           : Lionel.Gauthier@eurecom.fr
-    modified by          : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  main process for RRM interface
- **************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-#include "rtos_header.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_rg_vars.h"
-#include "rrc_rrm_sap.h"
-//#include "rrc_mbms_constant.h"
-#include "rrc_rrm_primitives.h"
-//#include "rrm_config_structs.h"
-//#include "rrc_rg_rrm_intf.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_int.h"
-#include "rrc_proto_fsm.h"
-#include "rrc_proto_intf.h"
-#include "rrc_proto_bch.h"
-#include "rrc_proto_mbms.h"
-#include "rrc_proto_rrm.h"
-//-----------------------------------------------------------------------------
-// For FIFOS interface
-#ifdef USER_MODE
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#endif
-
-
-//protocol_bs->rrc.rc_rrm.
-#ifdef USER_MODE
-//-----------------------------------------------------------------------------
-// Create and initialize FIFOs for RG RRM-RRC SAPs
-void rrc_rg_rrm_sap_init (void)
-{
-  //-----------------------------------------------------------------------------
-  int write_flag = O_WRONLY | O_NONBLOCK | O_NDELAY;
-  int read_flag = O_RDONLY | O_NONBLOCK | O_NDELAY;
-
-  // Create FIFOs
-  rrc_create_fifo (RRM_INPUT_SAPI);
-  rrc_create_fifo (RRM_OUTPUT_SAPI);
-
-  // Open FIFOs
-  while ((protocol_bs->rrc.rc_rrm.input_fifo = open (RRM_INPUT_SAPI, read_flag)) < 0) {
-    msg ("%s returned value %d\n", RRM_INPUT_SAPI, protocol_bs->rrc.rc_rrm.input_fifo);
-    perror("RRM_INPUT_SAPI - open failed: ");
-    sleep (1);
-  }
-
-  msg("FIFO opened %s\n", RRM_INPUT_SAPI);
-
-  while ((protocol_bs->rrc.rc_rrm.output_fifo = open (RRM_OUTPUT_SAPI, write_flag)) < 0) {
-    msg ("%s returned value %d\n", RRM_OUTPUT_SAPI, protocol_bs->rrc.rc_rrm.output_fifo);
-    perror("RRM_OUTPUT_SAPI - open failed: ");
-    sleep (1);
-  }
-
-  msg("FIFO opened %s\n", RRM_OUTPUT_SAPI);
-
-  // Print result
-  msg ("%s returned value %d\n", "RRM_INPUT_SAPI", protocol_bs->rrc.rc_rrm.input_fifo);
-  msg ("%s returned value %d\n", "RRM_OUTPUT_SAPI", protocol_bs->rrc.rc_rrm.output_fifo);
-}
-#endif
-
-//-----------------------------------------------------------------------------
-int rrc_rrm_main_proc (void)
-{
-  //-----------------------------------------------------------------------------
-  int bytes_read =0;
-  // int tx_id;
-  rpc_message  rpc_mess;
-  connection_request cr;
-  int count = 0;
-
-  // prevoir ifdef
-  //msg ("[RRC-RRM-INTF] rrc_rrm_main_proc state %d\n", protocol_bs->rrc.rc_rrm.connected_to_rrm);
-
-  bytes_read = rtf_get (protocol_bs->rrc.rc_rrm.input_fifo, &protocol_bs->rrc.rc_rrm.rx_buffer, RRC_RRM_RX_BUFFER_SIZE);
-
-  //  bytes_read = rtf_get (protocol_bs->rrc.rc_rrm.input_fifo, &protocol_bs->rrc.rc_rrm.rx_buffer[protocol_bs->rrc.rc_rrm.rx_bytes], RRC_RRM_RX_BUFFER_SIZE);
-  // send CONNECTION_REQUEST TO RRM if not CONNECTED
-  if (protocol_bs->rrc.rc_rrm.connected_to_rrm != RRC_CONNECTED_TO_RRM) {
-    //    if ((((frame + 1) % (RPC_CONNECTION_REQUEST_TIME_OUT / 10)) == 0) || (frame == 6)) {
-    if ((((protocol_bs->rrc.current_SFN + 1) % (RPC_CONNECTION_REQUEST_TIME_OUT / 10)) == 0) || (protocol_bs->rrc.current_SFN == 6)) {
-      rpc_mess.type = RPC_CONNECTION_REQUEST;
-      rpc_mess.length = sizeof (connection_request);
-#ifdef NODE_RG_SLAVE
-      cr.radio_gateway_type = RADIO_GATEWAY_SLAVE;
-#else
-      cr.radio_gateway_type = RADIO_GATEWAY_MASTER;
-#endif
-
-#ifdef USER_MODE
-      cr.radio_gateway_execution_mode = RADIO_GATEWAY_SIMULATION;
-#else
-      cr.radio_gateway_execution_mode = RADIO_GATEWAY_REAL_TIME_RF;
-#endif
-      cr.nb_antennas = numANTENNAS;
-      //      msg ("[RRC-RRM-INTF] sending CONNECTION_REQUEST %d + %d bytes to RRM througth FIFO frame %d\n", sizeof (rpc_message), sizeof (connection_request), frame);
-      msg ("[RRC-RRM-INTF] sending CONNECTION_REQUEST %d + %d bytes to RRM through FIFO frame %d\n", sizeof (rpc_message), sizeof (connection_request), protocol_bs->rrc.current_SFN);
-
-      count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & rpc_mess, sizeof (rpc_message));
-
-      if (count == sizeof (rpc_message)) {
-#ifdef DEBUG_RRC_STATE
-        msg ("[RRC-RRM-INTF] RRM message sent successfully, length %d \n", count);
-#endif
-      } else {
-        msg ("[RRC-RRM-INTF] transmission on FIFO failed, %d bytes sent instaed of %d\n", count, sizeof (rpc_message));
-      }
-
-      count = rtf_put (protocol_bs->rrc.rc_rrm.output_fifo, (u8 *) & cr, sizeof (connection_request));
-
-      if (count == sizeof (connection_request)) {
-#ifdef DEBUG_RRC_STATE
-        msg ("[RRC-RRM-INTF] RRM message sent successfully, length %d \n", count);
-#endif
-      } else {
-        msg ("[RRC-RRM-INTF] transmission on FIFO failed, %d bytes sent instaed of %d\n", count, sizeof(connection_request));
-      }
-
-#ifdef USER_MODE
-      sleep (2);
-#endif
-    }
-  }
-
-  if (bytes_read > 0) {
-    // interface beetween RRM and RRC...
-    msg("[RRC RRM][AS] RX %d bytes from RRM\n", bytes_read);
-    protocol_bs->rrc.rc_rrm.rx_bytes += bytes_read;
-    rrc_rrm_decode_message ();
-  }
-
-  return protocol_bs->rrc.rc_rrm.connected_to_rrm;
-}
-
diff --git a/openair2/RRC/CELLULAR/rrc_rg_rrm_variables.h b/openair2/RRC/CELLULAR/rrc_rg_rrm_variables.h
deleted file mode 100755
index 579599d9c2..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg_rrm_variables.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/***************************************************************************
-                          rrc_rg_rrm_variables.h
-                          -------------------
-    copyright            : (C) 2010 by Eurecom
-    created by           : Lionel.Gauthier@eurecom.fr
-    modified by          : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Definition of RRC interface to RRM
- **************************************************************************/
-#ifndef __RRC_RG_RRM_VARS_H__
-#define __RRC_RG_RRM_VARS_H__
-//-----------------------------------------------------------------------------
-//#include "platform.h"
-#include "rrc_rrm_primitives.h"
-
-#define RRC_RRM_RX_BUFFER_SIZE RRM_MAX_MESSAGE_SIZE * 10
-
-struct rrc_rg_rrm_variables {
-  u8  rx_buffer[RRC_RRM_RX_BUFFER_SIZE];
-  u8  rx_message[RRM_MAX_MESSAGE_SIZE];
-  int rx_bytes;
-
-  int input_fifo;
-  int output_fifo;
-
-  int connected_to_rrm;
-  int equipment_id;
-
-  u8 *config_to_be_expanded;
-  int config_read_byte_index;
-  int config_read_bit_index;
-
-  //  void (*rrc_handler[RPC_NB_RPC]) (void *rpcP, int lengthP);
-
-} rrc_rg_rrm_variables;
-
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_rg_srb_bch.c b/openair2/RRC/CELLULAR/rrc_rg_srb_bch.c
deleted file mode 100755
index 14e9b977b9..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg_srb_bch.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/***************************************************************************
-                          rrc_rg_srb_bch.c  -  description
-                             -------------------
-    copyright         : (C) 2001, 2010 by Eurecom
-    created by        : Lionel.Gauthier@eurecom.fr
-    modified by       : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
- Handling of Signalling Radio Bearers
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_rg_vars.h"
-#include "rrc_nas_sap.h"
-#include "rrc_messages.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_bch.h"
-#include "rrc_proto_int.h"
-#include "rrc_proto_fsm.h"
-#include "rrc_proto_mbms.h"
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-int rrc_broadcast_tx (char *buffer)
-{
-  //-----------------------------------------------------------------------------
-  int retcode;
-
-  if ((protocol_bs->rrc.current_SFN & 0x0001) == 0) {
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-    msg("[RRC] RG BROADCAST PREPARE SIB \n");
-#endif
-    rrc_rg_prepare_next_segment();
-    // send it
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-    msg("[RRC] RG BROADCAST TRANSMIT SIB \n");
-#endif
-    memcpy (buffer, (char *) protocol_bs->rrc.rg_bch_blocks.encoded_currSIBCH, maxSI);
-    // send buffer on BCCH - As of 08/07/2010, this call is actually a NOP, since
-    // broadcast is actually retrieved through the rrc_L2_data_req_rx function
-    retcode = rrc_rg_send_to_srb_rlc (0, RRC_BCCH_ID, buffer, maxSI);
-
-    // free temp memory
-    switch (protocol_bs->rrc.rg_bch_blocks.currSI_BCH.payload.type) {
-    case BCH_noSegment:
-      break;
-
-    case BCH_completeSIB:
-    case BCH_firstSegment:
-    case BCH_subsequentSegment:
-    case BCH_lastSegment:
-      free_mem_block (protocol_bs->rrc.rg_bch_blocks.tSegment);
-      break;
-
-    default:
-      msg("[RRC] rrc_broadcast_tx : unknown payload type %d\n", protocol_bs->rrc.rg_bch_blocks.currSI_BCH.payload.type);
-      break;
-    }
-  }
-
-  return maxSI;
-}
-
-//-----------------------------------------------------------------------------
-void rrc_rg_mcch_tx (u8 * dataP, u16 lengthP)
-{
-  //-----------------------------------------------------------------------------
-  int  retcode, UE_Id =0;
-
-  //TEMP - UE_Id hard coded because MCCH is actually a common channel
-  if (lengthP > 0) {
-    retcode = rrc_rg_send_to_srb_rlc (UE_Id, RRC_MCCH_ID, dataP, lengthP);
-#ifdef DEBUG_RRC_MBMS
-    msg ("[RRC-RG][MBMS][FSM-OUT] Message %s sent on MCCH, ret code= %d.\n", dataP, retcode);
-#endif
-  }
-}
-
-//-----------------------------------------------------------------------------
-int rrc_rg_srb_rx (char* sduP, int srb_id,  int UE_Id)
-{
-  //-----------------------------------------------------------------------------
-  //int srb_id, rb_id = 0;
-  //int UE_Id;
-  int sdu_offset = 0; // not used anymore
-
-  //rb_id = ch_idP;
-  //srb_id = rb_id % maxRB;
-  //UE_Id = (rb_id - srb_id) / maxRB;
-
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][SRB-RG] SRB%d for UE %d RX in frame %d\n", srb_id, UE_Id, protocol_bs->rrc.current_SFN);
-#endif
-
-#ifdef DEBUG_RRC_STATE
-  //msg ("[RRC][SRB-RG] RB %d, SRB%d received, UE_Id %d\n", rb_id, srb_id, UE_Id);
-  //msg ("[RRC][SRB-RG] frame received: %s\n", (char*)&sduP[sdu_offset]);
-#endif
-
-  switch (srb_id) {
-  case RRC_SRB0_ID:
-    //rrc_rg_srb0_decode (Rcved_sdu, sizeof (struct rlc_indication));
-    rrc_rg_srb0_decode (sduP, sdu_offset);
-    break;
-
-  case RRC_SRB1_ID:
-    //rrc_rg_srb1_decode (UE_Id, sduP, sizeof (struct rlc_indication));
-    rrc_rg_srb1_decode (UE_Id, sduP, sdu_offset);
-    break;
-
-  case RRC_SRB2_ID:
-    //rrc_rg_srb2_decode (UE_Id, sduP, sizeof (struct rlc_indication));
-    rrc_rg_srb2_decode (UE_Id, sduP, sdu_offset);
-    break;
-
-  case RRC_SRB3_ID:
-    //rrc_rg_srb3_decode (UE_Id, sduP, sizeof (struct rlc_indication));
-    rrc_rg_srb3_decode (UE_Id, sduP, sdu_offset);
-    break;
-
-  default:
-    msg ("[RRC] [SRB-RG] Invalid call to rrc_rg_srb_rx : SRB Receive\n");
-    break;
-  }
-
-  return 0;
-}
-
-//module_id_t , rb_id_t , mui_t
-//-----------------------------------------------------------------------------
-//void* rrc_srb_confirm (u32 muiP, u8 rb_idP, u8 statusP){
-void* rrc_rg_srb_confirm (u32 muiP, u8 rb_idP, u8 statusP)
-{
-  //-----------------------------------------------------------------------------
-  int srb_id;
-  int UE_Id;
-
-  srb_id = rb_idP % maxRB;
-  UE_Id = (rb_idP - srb_id) / maxRB;
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC-SRB] RB%d RX SDU CONFIRM MUI %d, status %d\n", rb_idP, muiP, statusP);
-  msg ("[RRC-SRB] SRB_Id %d UE_Id %d\n", srb_id, UE_Id);
-#endif
-  /*  Temp OpenAir
-  //  if (srb_id == RRC_SRB2_ID){
-  if (statusP == RLC_TX_CONFIRM_SUCCESSFULL) {
-    rrc_rg_fsm_control (UE_Id, RG_RLC_SUCCESS);
-  } else {
-    rrc_rg_fsm_control (UE_Id, RG_RLC_FAILURE);
-  }
-  //  }
-  */
-  rrc_rg_fsm_control (UE_Id, RG_RLC_SUCCESS);
-
-  return NULL;
-}
diff --git a/openair2/RRC/CELLULAR/rrc_rg_variables.h b/openair2/RRC/CELLULAR/rrc_rg_variables.h
deleted file mode 100755
index 8f8e59cb0e..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg_variables.h
+++ /dev/null
@@ -1,184 +0,0 @@
-/***************************************************************************
-                          rrc_rg_variables.h  -  description
-                             -------------------
-    begin                : Jan 6, 2003
-    copyright            : (C) 2003, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Some additional definitions for RG variables
- ***************************************************************************/
-#ifndef __RRC_RG_VARIABLES_H__
-#define __RRC_RG_VARIABLES_H__
-
-#include "rrc_platform_types.h"
-#include "rrc_msg_class.h"
-#include "rrc_mbms_constant.h"
-
-struct rrc_rg_msg_infos {
-  int  msg_Id;
-  int  msg_length;
-  void *msg_ptr;
-  mem_block_t *mem_block_ptr;
-};
-
-struct rrc_rg_trans {
-  int  msg_type;
-  int  transaction_Id;
-};
-
-struct rrc_rg_rb_information {
-  u16  rb_identity;
-  u16  rb_started;
-  u16  qos_class;
-  u16  dscp_code;
-  u16  sap_id;
-  u8   rbsetup_status;
-};
-
-//Structure for measurements in UE
-struct rrc_rg_mt_meas_cmd {
-  u16  identity;
-  u16  command;
-  u16  xfer_mode;
-  u16  trigger;
-  u16  type;
-  u16  if_coeff;
-  u8   if_cellIdentity_ri;
-  u8   if_timeslotISCP_ri;
-  u8   if_BCH_RSCP_ri;
-  u8   if_pathloss_ri;
-  u16  if_validity;
-  u16  tv_validity;
-  u8   tv_payload_ri;
-  u8   tv_average_ri;
-  u8   tv_variance_ri;
-  u16  q_dl_trch_bler_ri;
-  u16  q_sir_TFCSid[MAXMEASTFCS];
-  u16  int_quantity;
-  u16  int_coeff;
-  u8   int_rep_ue_TransmittedPower;
-  u8   int_rep_appliedTA;
-  u16  criteria_type;
-  u16  rep_amount;
-  u16  rep_interval;
-};
-
-struct rrc_rg_mt_meas_rep {
-  u16 identity;
-  u16 meas_results_type;
-  u16 if_num_cells;
-  u16 if_cell_id[maxCells];
-  u16 if_cell_parms_id[maxCells];
-  u16 if_BCH_RSCP[maxCells];
-  u16 if_pathloss[maxCells];
-  u16 if_slot_iscp[maxCells][maxTS];
-  u16 tv_num_rbs;
-  u16 tv_rbid[MAXMEASRBS];
-  u16 tv_rb_payload[MAXMEASRBS];
-  u16 tv_rb_average[MAXMEASRBS];
-  u16 tv_rb_variance[MAXMEASRBS];
-  u16 q_num_TrCH;
-  u16 q_dl_TrCH_id[MAXMEASTRCH];
-  u16 q_dl_TrCH_BLER[MAXMEASTRCH];
-  u16 q_num_tfcs;
-  u16 q_tfcs_id[MAXMEASTFCS];
-  u16 q_sir[MAXMEASTFCS][maxTS];
-  u16 int_xmit_power[maxTS];
-  u16 int_timing_advance;
-};
-
-struct Mobile_Node {
-  int mt_id;
-  int state;
-  char IMEI[14];
-  int local_connection_ref;
-  int release_cause;
-  int u_rnti;
-  u8 establishment_cause;
-  u8 prot_error_indicator; // boolean
-  int  conn_complete_timer;
-  struct rrc_rg_msg_infos rg_msg_infos;
-  struct rrc_rg_trans xmit_trans[MAXTRANS];
-  //Added MSG2
-  u8 am_RLC_ErrorIndicationRb2_3or4;
-  u8 am_RLC_ErrorIndicationRb5orAbove;
-  u8 cellUpdateCause;
-  u16 ul_nas_message_lgth;
-  u8  *ul_nas_message_ptr;
-  u16 dl_nas_message_lgth;
-  mem_block_t  *dl_nas_message_ptr;
-  u16 paging_message_lgth;
-  mem_block_t  *paging_message_ptr;
-  //     int  rb_id;
-  //     u8  qos_classes[MAXURAB];
-  //     u8  dscp_codes[MAXURAB];
-  struct rrc_rg_rb_information rg_established_rbs[maxRB];
-  u16 num_rb;
-  int established_background;
-  u16 requested_rbId;
-  u16 requested_MTrbId;
-  u16 requested_QoSclass;
-  u16 requested_dscp;
-  u16 requested_sapid;
-  // u8  rbsetup_status;
-  // Control blocks for measures
-  int rrc_rg_last_measurement;
-  struct rrc_rg_mt_meas_cmd rg_meas_cmd;
-  struct rrc_rg_mt_meas_rep rg_meas_rep[MAXMEASTYPES];
-  // UE Capability Information
-  u8 ind_accessStratumRelease;
-  u8 ind_eurecomKernelRelease; //An adaptation for Eurecom TD-CDMA
-  // List of services for MBMS
-  o3 act_serviceIdentity [maxMBMSServices]; /** OctetString(3), @see MBMS_ServiceIdentity */
-  u8 act_numService;
-};
-
-struct rrc_rg_nas_neighbor_list {
-  char  sub_type;
-  int  num_rg;
-  char *ng_list;      // transparent to RRC
-};
-
-//Structure for measurements in BS
-struct rrc_rg_bs_meas_cmd {
-  u16 identity;
-  u16 command;
-  u16 UE_Id;
-  u16 trigger;
-  u16 type;
-  u16 criteria_type;
-  u16 rep_amount;
-  u16 rep_interval;
-};
-
-struct rrc_rg_bs_meas_rep {
-  int meas_counter;
-  int meas_interval;
-  int meas_start;
-  u16 identity;
-  u16 meas_results_type;
-  u16 tv_num_rbs;
-  u16 tv_rbid[MAXMEASRBS];
-  u16 tv_rb_payload[MAXMEASRBS];
-  u16 tv_rb_average[MAXMEASRBS];
-  u16 tv_rb_variance[MAXMEASRBS];
-  u16 q_num_TrCH;
-  u16 q_dl_TrCH_id[MAXMEASTRCH];
-  u16 q_dl_TrCH_BLER[MAXMEASTRCH];
-  u16 q_num_tfcs;
-  u16 q_tfcs_id[MAXMEASTFCS];
-  u16 q_sir[MAXMEASTFCS][maxTS];
-  s32 int_xmit_power[numANTENNAS][maxTS];
-  s32 int_rscp[maxTS][MAXCH];
-  s32 int_rssi_rf[numANTENNAS][maxTS];
-  u16 int_spare[NUMSPARE];
-};
-
-//BS Measures
-struct rrc_rg_meas_blocks {
-  struct rrc_rg_bs_meas_cmd bs_meas_cmd[2 * maxUsers + 1];
-  struct rrc_rg_bs_meas_rep bs_meas_rep[2 * maxUsers + 1];
-  int rrc_rg_bs_meas_next[2 * maxUsers + 1];
-};
-
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_rg_vars.h b/openair2/RRC/CELLULAR/rrc_rg_vars.h
deleted file mode 100644
index 80883e68c5..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg_vars.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*********************************************************************
-                          rrc_rg_vars.h  -  description
-                             -------------------
-    copyright            : (C) 2005, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- *********************************************************************
-  Define control block memory for RRC_UE
- ********************************************************************/
-#ifndef __RRC_RG_VARS_H__
-#define __RRC_RG_VARS_H__
-
-#include "COMMON/mac_rrc_primitives.h"
-#include "rrc_platform_types.h"
-#include "mem_pool.h"
-
-#include "rrc_rg_entity.h"
-//-----------------------------------------------------------------------------
-struct protocol_pool_bs {
-  struct rrc_rg_entity rrc;
-};
-
-volatile struct protocol_pool_bs prot_pool_bs;
-volatile struct protocol_pool_bs *protocol_bs;
-RRC_XFACE *Rrc_xface;
-
-RRM_VARS rrc_as_config;
-RRM_VARS *rrm_config;
-
-rrc_rg_mbms_variables * volatile p_rg_mbms; /** pointer reference to protocol_bs->rrc.mbms */
-
-int rrc_release_all_ressources;
-int rrc_ethernet_id;
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_rg_vars_extern.h b/openair2/RRC/CELLULAR/rrc_rg_vars_extern.h
deleted file mode 100644
index 56e6f590bb..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rg_vars_extern.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/*********************************************************************
-                          rrc_rg_vars_extern.h  -  description
-                             -------------------
-    copyright            : (C) 2005, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- *********************************************************************
-  External definitions for control block memory for RRC_UE
- ********************************************************************/
-#ifndef __RRC_UE_VARS_EXTERN_H__
-#define __RRC_UE_VARS_EXTERN_H__
-
-#include "COMMON/mac_rrc_primitives.h"
-#include "rrc_constant.h"
-#include "rrc_rg_entity.h"
-
-#include "mem_pool.h"
-//-----------------------------------------------------------------------------
-
-extern volatile struct protocol_pool_bs *protocol_bs;
-extern int      rrc_release_all_ressources;
-extern RRC_XFACE *Rrc_xface;
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_rrm_primitives.h b/openair2/RRC/CELLULAR/rrc_rrm_primitives.h
deleted file mode 100755
index 691e98c66a..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rrm_primitives.h
+++ /dev/null
@@ -1,361 +0,0 @@
-/***************************************************************************
-                          rrc_rrm_primitives.h
-                          -------------------
-    copyright            : (C) 2010 by Eurecom
-    created by           : Lionel.Gauthier@eurecom.fr
-    modified by          : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Definition of RRC external interface to RRM
- **************************************************************************/
-#ifndef __RRC_RRMPRIM_H__
-#define __RRC_RRMPRIM_H__
-
-#include "rrm_constants.h"
-
-//----------------------------------------------------------
-// Primitives
-//----------------------------------------------------------
-// LG : IT IS MANDATORY THAT ALL MESSAGES ARE INDEXED FROM
-// 0 TO N WHITH NO HOLE IN NUMEROTATION -> ARRAY OF POINTERS
-#define RPC_CONNECTION_REQUEST    0
-#define RPC_CONNECTION_RESPONSE   1
-#define RPC_CONNECTION_CLOSE      2
-#define RPC_CONNECTION_CLOSE_ACK  3
-#define RPC_ADD_USER_REQUEST      4
-#define RPC_ADD_USER_RESPONSE     5
-#define RPC_ADD_USER_CONFIRM      6
-#define RPC_REMOVE_USER_REQUEST   7
-#define RPC_REMOVE_USER_RESPONSE  8
-#define RPC_ADD_RADIO_ACCESS_BEARER_REQUEST       9
-#define RPC_ADD_RADIO_ACCESS_BEARER_RESPONSE     10
-#define RPC_ADD_RADIO_ACCESS_BEARER_CONFIRM      11
-#define RPC_REMOVE_RADIO_ACCESS_BEARER_REQUEST   12
-#define RPC_REMOVE_RADIO_ACCESS_BEARER_RESPONSE  13
-#define RPC_MEASUREMENT_REQUEST                  14
-#define RPC_L1_MEASUREMENT_RG_INTERNAL_REPORT        15
-#define RPC_L1_MEASUREMENT_RG_QUALITY_REPORT         16
-#define RPC_L1_MEASUREMENT_RG_TRAFFIC_VOLUME_REPORT  17
-#define RPC_L1_MEASUREMENT_RG_PHYSICAL_CHANNEL_DATA_AMP_REPORT  18
-#define RPC_L1_MEASUREMENT_MT_INTERNAL_REPORT                   19
-#define RPC_L1_MEASUREMENT_MT_QUALITY_REPORT                    20
-#define RPC_L1_MEASUREMENT_MT_TRAFFIC_VOLUME_REPORT             21
-#define RPC_L1_MEASUREMENT_MT_INTRA_FREQUENCY_REPORT            22
-#define RPC_UPLINK_PHYSICAL_CHANNEL_CONTROL                     23
-#define RPC_CONFIG_REQUEST                                      24
-#define RPC_ACK                                                 25
-#define RPC_NB_RPC                                              26
-
-//----------------------------------------------------------
-// Constants
-//----------------------------------------------------------
-#define RRM_MAX_MESSAGE_SIZE  1500
-
-#define RRM_SERVER_PORT 9900L
-#define RRC_SERVER_PORT 9899L
-
-#define RADIO_GATEWAY_MASTER     77
-#define RADIO_GATEWAY_SLAVE      83
-#define RADIO_GATEWAY_SIMULATION 83
-#define RADIO_GATEWAY_SIMULATION_BYPASS_L1 66
-#define RADIO_GATEWAY_REAL_TIME_RF 82
-#define RADIO_GATEWAY_REAL_TIME_IF 73
-
-// CLASS_OF_TRAFFIC
-#define CONVERSATIONAL 1
-#define STREAMING      2
-#define INTERACTIVE    3
-#define BACKGROUND     4
-
-// CONNECTION RESPONSE STATUS
-#define STATUS_CONNECTION_ACCEPTED                   0
-#define STATUS_CONNECTION_REFUSED_ALREADY_CONNECTED -1
-#define STATUS_CONNECTION_REFUSED_TOO_MANY_RG       -2
-// ADD USER RESPONSE STATUS
-#define ADD_USER_SUCCESSFUL  3
-#define ADD_USER_FAILED     -3
-// REMOVE USER RESPONSE STATUS
-#define REMOVE_USER_SUCCESSFUL  4
-#define REMOVE_USER_FAILED     -4
-// ADD RADIO ACCESS BEARER STATUS
-#define ADD_RADIO_ACCESS_BEARER_SUCCESSFUL  5
-#define ADD_RADIO_ACCESS_BEARER_FAILED     -5
-// REMOVE RADIO ACCESS BEARER STATUS
-#define REMOVE_RADIO_ACCESS_BEARER_SUCCESSFUL  6
-#define REMOVE_RADIO_ACCESS_BEARER_FAILED     -6
-
-// Measure command
-#define RRC_RRM_SETUP    1
-#define RRC_RRM_RELEASE  3
-
-// Measure type
-#define RRC_RRM_TYPE_IntraFreq      0
-#define RRC_RRM_TYPE_TrafficVolume  1
-#define RRC_RRM_TYPE_Quality        2
-#define RRC_RRM_TYPE_Internal       3
-
-
-//----------------------------------------------------------
-// Parameter types
-//----------------------------------------------------------
-struct rrc_rrm_measure_ctl {
-  u8  command;      //setup-release as above
-  u8  amount;       //number of measures 0-1-2-4-8-16-32-64
-  u16 period;       //250--> 64000 ms
-  u8  type;
-  u8  BaseStation;  //1=YES
-  u16 UE_Id;
-};
-
-// Measure report
-// from Mobile Terminal
-struct rrc_rrm_meas_report_mt_if {
-  u16 UE_Id __attribute__ ((packed));
-  u16 if_num_cells __attribute__ ((packed));
-  u16 if_cell_id[maxCells] __attribute__ ((packed));
-  u16 if_cell_parms_id[maxCells] __attribute__ ((packed));
-  u16 if_BCH_RSCP[maxCells] __attribute__ ((packed));
-  u16 if_pathloss[maxCells] __attribute__ ((packed));
-  u16 if_slot_iscp[maxCells][JRRM_SLOTS_PER_FRAME] __attribute__ ((packed));
-};
-struct rrc_rrm_meas_report_mt_tv {
-  u16 UE_Id __attribute__ ((packed));
-  u16 tv_num_rbs __attribute__ ((packed));
-  u16 tv_rbid[MAXMEASRBS] __attribute__ ((packed));
-  u16 tv_rb_payload[MAXMEASRBS] __attribute__ ((packed));
-  u16 tv_rb_average[MAXMEASRBS] __attribute__ ((packed));
-  u16 tv_rb_variance[MAXMEASRBS] __attribute__ ((packed));
-};
-struct rrc_rrm_meas_report_mt_q {
-  u16 UE_Id __attribute__ ((packed));
-  u16 q_num_TrCH __attribute__ ((packed));
-  u16 q_dl_TrCH_id[MAXMEASTRCH] __attribute__ ((packed));
-  u16 q_dl_TrCH_BLER[MAXMEASTRCH] __attribute__ ((packed));
-  u16 q_num_tfcs __attribute__ ((packed));
-  u16 q_tfcs_id[MAXMEASTFCS] __attribute__ ((packed));
-  u16 q_sir[MAXMEASTFCS][JRRM_SLOTS_PER_FRAME] __attribute__ ((packed));
-};
-struct rrc_rrm_meas_report_mt_int {
-  //  u8 UE_Id;
-  u16 UE_Id __attribute__ ((packed));
-  u16 int_xmit_power[JRRM_SLOTS_PER_FRAME] __attribute__ ((packed));
-  u16 int_timing_advance __attribute__ ((packed));
-};
-
-union rrc_rrm_meas_report_mt_rrc {
-  struct rrc_rrm_meas_report_mt_if meas_rep_mt_if;
-  struct rrc_rrm_meas_report_mt_tv meas_rep_mt_tv;
-  struct rrc_rrm_meas_report_mt_q meas_rep_mt_q;
-  struct rrc_rrm_meas_report_mt_int meas_rep_mt_int;
-};
-
-// from Base station
-struct rrc_rrm_meas_report_bs_tv {
-  u16 UE_Id __attribute__ ((packed));
-  u16 tv_num_rbs __attribute__ ((packed));
-  u16 tv_rbid[MAXMEASRBS] __attribute__ ((packed));
-  u16 tv_rb_payload[MAXMEASRBS] __attribute__ ((packed));
-  u16 tv_rb_average[MAXMEASRBS] __attribute__ ((packed));
-  u16 tv_rb_variance[MAXMEASRBS] __attribute__ ((packed));
-};
-
-struct rrc_rrm_meas_report_bs_q {
-  u16 UE_Id __attribute__ ((packed));
-  u16 q_num_TrCH __attribute__ ((packed));
-  u16 q_dl_TrCH_id[MAXMEASTRCH] __attribute__ ((packed));
-  u16 q_dl_TrCH_BLER[MAXMEASTRCH] __attribute__ ((packed));
-  u16 q_num_tfcs __attribute__ ((packed));
-  u16 q_tfcs_id[MAXMEASTFCS] __attribute__ ((packed));
-  u16 q_sir[MAXMEASTFCS][JRRM_SLOTS_PER_FRAME] __attribute__ ((packed));
-};
-
-struct rrc_rrm_meas_report_bs_int {
-  s32 int_xmit_power[numANTENNAS][JRRM_SLOTS_PER_FRAME] __attribute__ ((packed));
-  s32 int_rscp[JRRM_SLOTS_PER_FRAME][MAXCH] __attribute__ ((packed));
-  s32 int_rssi_rf[numANTENNAS][JRRM_SLOTS_PER_FRAME] __attribute__ ((packed));
-  u16 int_spare[NUMSPARE] __attribute__ ((packed));
-};
-
-union rrc_rrm_meas_report_bs_rrc {
-  struct rrc_rrm_meas_report_bs_tv meas_rep_bs_tv;
-  struct rrc_rrm_meas_report_bs_q meas_rep_bs_q;
-  struct rrc_rrm_meas_report_bs_int meas_rep_bs_int;
-};
-
-//----------------------------------------------------------
-// Primitive definitions
-//----------------------------------------------------------
-// Message Header
-typedef struct rrc_rrm_message_header {
-  u16  type;
-  u16  length;       // length includes only data following this header
-  u32  frame;
-} rpc_message;
-
-
-// Message Content
-
-// Primitives without content
-//  RPC_CONNECTION_CLOSE_ACK  3
-//  RPC_UPLINK_PHYSICAL_CHANNEL_CONTROL                     23
-//  RPC_CONFIG_REQUEST                                      24
-//  RPC_ACK                                                 25
-//  RPC_NB_RPC                                              26
-
-//-------------------------------------------
-//  RPC_CONNECTION_REQUEST    0
-typedef struct connection_request {
-  char radio_gateway_type;   // master or slave
-  char radio_gateway_execution_mode; // simulation, simulation + bypass L1, real time RF, real time IF
-  u8   nb_antennas;
-} connection_request;
-//-------------------------------------------
-//  RPC_CONNECTION_RESPONSE   1
-typedef struct connection_response {
-  s8   status;
-  u8   equipment_id;
-} connection_response;
-//-------------------------------------------
-//  RPC_CONNECTION_CLOSE      2
-typedef struct connection_close {
-  u8   equipment_id;
-} connection_close;
-//-------------------------------------------
-//  RPC_ADD_USER_REQUEST      4
-typedef struct add_user_request {
-  u8   equipment_id;
-  u8   user_id;
-  u8   tx_id;
-} add_user_request;
-
-//-------------------------------------------
-//  RPC_ADD_USER_RESPONSE     5
-typedef struct add_user_response {
-  u8   equipment_id;
-  u8   user_id;
-  u8   status;
-  u8   tx_id;
-} add_user_response;
-//-------------------------------------------
-//  RPC_ADD_USER_CONFIRM      6
-typedef struct add_user_confirm {
-  u8   equipment_id;
-  u8   user_id;
-} add_user_confirm;
-//-------------------------------------------
-//  RPC_REMOVE_USER_REQUEST   7
-typedef struct remove_user_request {
-  u8   equipment_id;
-  u8   user_id;
-  u8   tx_id;
-} remove_user_request;
-//-------------------------------------------
-//  RPC_REMOVE_USER_RESPONSE  8
-typedef struct remove_user_response {
-  u8   equipment_id;
-  u8   user_id;
-  u8   status;
-  u8   tx_id;
-} remove_user_response;
-//-------------------------------------------
-//  RPC_ADD_RADIO_ACCESS_BEARER_REQUEST       9
-typedef struct add_radio_access_bearer_request {
-  u8   equipment_id;
-  u8   user_id;
-  u8   tx_id;
-  u8   rab_id;
-  u16  traffic_class;
-  u16  delay;
-  u32  guaranted_bit_rate_uplink;
-  u32  max_bit_rate_uplink;
-  u32  guaranted_bit_rate_downlink;
-  u32  max_bit_rate_downlink;
-} add_radio_access_bearer_request;
-//-------------------------------------------
-//  RPC_ADD_RADIO_ACCESS_BEARER_RESPONSE     10
-typedef struct add_radio_access_bearer_response {
-  u8   user_id;
-  u8   rab_id;
-  u8   status;
-  u8   tx_id;
-} add_radio_access_bearer_response;
-//-------------------------------------------
-//  RPC_ADD_RADIO_ACCESS_BEARER_CONFIRM      11
-typedef struct add_radio_access_bearer_confirm {
-  u8   equipment_id;
-  u8   user_id;
-  u8   rab_id;
-} add_radio_access_bearer_confirm;
-//-------------------------------------------
-//  RPC_REMOVE_RADIO_ACCESS_BEARER_REQUEST   12
-typedef struct remove_radio_access_bearer_request {
-  u8   equipment_id;
-  u8   user_id;
-  u8   rab_id;
-  u8   tx_id;
-} remove_radio_access_bearer_request;
-//-------------------------------------------
-//  RPC_REMOVE_RADIO_ACCESS_BEARER_RESPONSE  13
-typedef struct remove_radio_access_bearer_response {
-  u8   user_id;
-  u8   rab_id;
-  u8   status;
-  u8   tx_id;
-} remove_radio_access_bearer_response;
-//-------------------------------------------
-//  RPC_MEASUREMENT_REQUEST                  14
-typedef struct measurement_request {
-  u8   measurement_type;
-  u8   measurement_command;
-  u8   equipment_type;
-  u8   equipment_id;
-  u16  amount;
-  u16  period;
-} measurement_request;
-//-------------------------------------------
-//  RPC_L1_MEASUREMENT_RG_INTERNAL_REPORT        15
-typedef struct l1_measurement_rg_internal_report {
-  u32  equipment_id;
-  struct rrc_rrm_meas_report_bs_int measurements;
-} l1_measurement_rg_internal_report;
-//-------------------------------------------
-//  RPC_L1_MEASUREMENT_RG_QUALITY_REPORT         16
-typedef struct l1_measurement_rg_quality_report {
-  u32  equipment_id;
-  struct rrc_rrm_meas_report_bs_q measurements;
-} l1_measurement_rg_quality_report;
-//-------------------------------------------
-//  RPC_L1_MEASUREMENT_RG_TRAFFIC_VOLUME_REPORT  17
-typedef struct l1_measurement_rg_traffic_volume_report {
-  u32  equipment_id;
-  struct rrc_rrm_meas_report_bs_tv measurements;
-} l1_measurement_rg_traffic_volume_report;
-//-------------------------------------------
-//  RPC_L1_MEASUREMENT_RG_PHYSICAL_CHANNEL_DATA_AMP_REPORT  18
-//-------------------------------------------
-//  RPC_L1_MEASUREMENT_MT_INTERNAL_REPORT                   19
-typedef struct l1_measurement_mt_internal_report {
-  u32  equipment_id;
-  struct rrc_rrm_meas_report_mt_int measurements;
-} l1_measurement_mt_internal_report;
-//-------------------------------------------
-//  RPC_L1_MEASUREMENT_MT_QUALITY_REPORT                    20
-typedef struct l1_measurement_mt_quality_report {
-  u32  equipment_id;
-  struct rrc_rrm_meas_report_mt_q measurements;
-} l1_measurement_mt_quality_report;
-//-------------------------------------------
-//  RPC_L1_MEASUREMENT_MT_TRAFFIC_VOLUME_REPORT             21
-typedef struct l1_measurement_mt_traffic_volume_report {
-  u32  equipment_id;
-  struct rrc_rrm_meas_report_mt_tv measurements;
-} l1_measurement_mt_traffic_volume_report;
-//-------------------------------------------
-//  RPC_L1_MEASUREMENT_MT_INTRA_FREQUENCY_REPORT            22
-typedef struct l1_measurement_mt_intra_frequency_report {
-  u32  equipment_id;
-  struct rrc_rrm_meas_report_mt_if measurements;
-} l1_measurement_mt_intra_frequency_report;
-//-------------------------------------------
-
-
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_rrm_sap.h b/openair2/RRC/CELLULAR/rrc_rrm_sap.h
deleted file mode 100755
index c18ad4796a..0000000000
--- a/openair2/RRC/CELLULAR/rrc_rrm_sap.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/***************************************************************************
-                          rrc_rrm_sap.h
-                          -------------------
-    copyright            : (C) 2010 by Eurecom
-    created by           : Lionel.Gauthier@eurecom.fr
-    modified by          : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Definition of RRC FIFOs and SAPs to interface RRM
- **************************************************************************/
-#ifndef __RRC_RRM_SAP_H__
-#define __RRC_RRM_SAP_H__
-
-#ifndef USER_MODE
-#define RRM_INPUT_DEVICE     "/dev/rtf32"
-#define RRM_OUTPUT_DEVICE    "/dev/rtf33"
-#define RRM_INPUT_SAPI       32
-#define RRM_OUTPUT_SAPI      33
-#else
-#define RRM_INPUT_DEVICE  "./RG_RRM_I"
-#define RRM_OUTPUT_DEVICE "./RG_RRM_O"
-#define RRM_INPUT_SAPI    "./RG_RRM_I"
-#define RRM_OUTPUT_SAPI   "./RG_RRM_O"
-#endif
-
-#endif
-
diff --git a/openair2/RRC/CELLULAR/rrc_ue.c b/openair2/RRC/CELLULAR/rrc_ue.c
deleted file mode 100755
index 5e076a04de..0000000000
--- a/openair2/RRC/CELLULAR/rrc_ue.c
+++ /dev/null
@@ -1,1475 +0,0 @@
-/***************************************************************************
-                            rrc_ue.c
-                           -------------------
-    begin                : Nov 10, 2001
-    copyright            : (C) 2001, 2010 by Eurecom
-    author               : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  This file contains the code generated by the Esterel engine
-
-  IT MUST NOT BE MODIFIED MANUALLY
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-//-----------------------------------------------------------------------------
-#include "rrc_ue_vars.h"
-//-----------------------------------------------------------------------------
-/* "SAXORT STRL Compiler version 3.1.6n compiled on Fri_Oct_18_15:50:53_CEST_2002" */
-
-/* automaton kernel code*/
-//#include <stdlib.h>
-//#include <stdio.h>
-//#include <string.h>
-#include "rrc_ue.h"
-#define SIZEOFINT 32
-#define B_SET_VECTOR_MASK(i) ((unsigned int)1 << i)
-#define B_RES_VECTOR_MASK(i) (~((unsigned int)1 << i))
-#define BIT_SET(b_vector, bit_number) (b_vector)[(bit_number) / SIZEOFINT] |= B_SET_VECTOR_MASK((bit_number) % SIZEOFINT)
-#define BIT_RESET(b_vector, bit_number) (b_vector)[(bit_number) / SIZEOFINT] &= ~B_SET_VECTOR_MASK((bit_number) % SIZEOFINT)
-
-#define IS_ON(point) (_On[point / SIZEOFINT] & B_SET_VECTOR_MASK(point % SIZEOFINT))
-#define IS_PAUSE_ON(point) (_Pause[point / SIZEOFINT] & B_SET_VECTOR_MASK(point % SIZEOFINT))
-
-#define HALT_POINT_NUM 43
-#define HALT_POINT_VECTOR_SIZE ((HALT_POINT_NUM-1)/(int)SIZEOFINT)+1
-static unsigned int _On[HALT_POINT_VECTOR_SIZE];
-static unsigned int _Pause[HALT_POINT_VECTOR_SIZE];
-
-#define SIGNAL_NUM 55
-#define SIGNAL_VECTOR_SIZE 2
-#define SIGNAL_WITH_PRE_VECTOR_SIZE 1
-#define GLOBALMAXPRELEVEL 2
-static unsigned int _Sig[SIGNAL_VECTOR_SIZE];
-static unsigned int _SigPreTab[GLOBALMAXPRELEVEL][SIGNAL_WITH_PRE_VECTOR_SIZE];
-static unsigned int *_SigPre_0 = _SigPreTab[0];
-static unsigned int *_SigPre_1 = _SigPreTab[1];
-#define EMIT(vector, signal) (vector)[signal / SIZEOFINT] |= B_SET_VECTOR_MASK(signal % SIZEOFINT)
-#define CLEAR_SIGNAL(vector, signal) (vector)[signal / SIZEOFINT] &= B_RES_VECTOR_MASK(signal % SIZEOFINT)
-#define IS_SIGNAL(vector, signal) ((vector)[signal / SIZEOFINT] & B_SET_VECTOR_MASK(signal % SIZEOFINT))
-
-#define GUARD_NUM 13
-#define GUARD_VECTOR_SIZE ((GUARD_NUM-1)/(int)SIZEOFINT)+1
-static unsigned int _Guard[GUARD_VECTOR_SIZE];
-#define IS_GUARD(guard) (_Guard[guard / SIZEOFINT] & B_SET_VECTOR_MASK(guard % SIZEOFINT))
-#define SET_GUARD(guard) _Guard[guard / SIZEOFINT] |= B_SET_VECTOR_MASK(guard % SIZEOFINT)
-#define RESET_GUARD(guard) _Guard[guard / SIZEOFINT] &= B_RES_VECTOR_MASK(guard % SIZEOFINT)
-
-#ifndef _PREDEFINED_TYPES
-#    define _PREDEFINED_TYPES
-typedef int     boolean;
-typedef int     integer;
-#    ifndef STRLEN
-#        define STRLEN 81
-#    endif
-typedef char   *string;
-#    define _integer(x, y) (*x) = (y)
-#    define _boolean(x, y) (*x) = (y)
-#    define _float(x, y) (*x) = (y)
-#    define _double(x, y) (*x) = (y)
-#    define _string(x, y) strcpy((*x), (y))
-#    define _eq_integer(x, y) ((x) == (y))
-#    define _eq_boolean(x, y) ((x) == (y))
-#    define _eq_float(x, y) ((x) == (y))
-#    define _eq_double(x, y) ((x) == (y))
-#    define _eq_string(x, y) (!strcmp((x), (y)))
-#    define _ne_integer(x, y) ((x) != (y))
-#    define _ne_boolean(x, y) ((x) != (y))
-#    define _ne_float(x, y) ((x) != (y))
-#    define _ne_double(x, y) ((x) != (y))
-#    define _ne_string(x, y) (strcmp((x), (y)))
-#    define _cond_integer(x, y, z) ((x)?(y):(z))
-#    define _cond_boolean(x, y, z) ((x)?(y):(z))
-#    define _cond_float(x, y, z) ((x)?(y):(z))
-#    define _cond_double(x, y, z) ((x)?(y):(z))
-#    define _cond_string(x, y, z) ((x)?(y):(z))
-#    define _string_to_text(x) (x)
-#    define _text_to_string(x, y) (strcpy((*x), (y)))
-#    define _plus_(x, y) (x) + (y)
-#    define _minus_(x, y) (x) - (y)
-#    define _times_(x, y) (x) * (y)
-#    define _div_(x, y) (x) / (y)
-#    define _mod_(x, y) (x) % (y)
-#    define _not_(x) !(x)
-#    define _or_(x, y) (x) || (y)
-#    define _and_(x, y) (x) && (y)
-#    define _equal_(x, y) (x) == (y)
-#    define _diff_(x, y) (x) != (y)
-#    define _sup_(x, y) (x) > (y)
-#    define _supequal_(x, y) (x) >= (y)
-#    define _inf_(x, y) (x) < (y)
-#    define _infequal_(x, y) (x) <= (y)
-#endif
-#ifndef SUCCESS
-extern integer  SUCCESS;
-#endif
-#ifndef FAILURE
-extern integer  FAILURE;
-#endif
-#ifndef ALREADY_C
-extern integer  ALREADY_C;
-#endif
-#ifndef CELL_FACH
-extern integer  CELL_FACH;
-#endif
-#ifndef CELL_DCH
-extern integer  CELL_DCH;
-#endif
-#ifndef CELL_PCH
-extern integer  CELL_PCH;
-#endif
-#ifndef RRC_CONN_REQ
-extern integer  RRC_CONN_REQ;
-#endif
-#ifndef RRC_CONN_SETUP
-extern integer  RRC_CONN_SETUP;
-#endif
-#ifndef RRC_CONN_SETUP_COMPLETE
-extern integer  RRC_CONN_SETUP_COMPLETE;
-#endif
-#ifndef RRC_CONN_REL_COMPLETE
-extern integer  RRC_CONN_REL_COMPLETE;
-#endif
-#ifndef RRC_CONN_RELEASE
-extern integer  RRC_CONN_RELEASE;
-#endif
-#ifndef IDLE
-extern integer  IDLE;
-#endif
-#ifndef N300
-extern integer  N300;
-#endif
-#ifndef N308
-extern integer  N308;
-#endif
-static boolean  Var__ThisIsTheEnd__157;
-#define __Sig_sc_in_Connection_Management_DOT_Idle_117 0
-#define __Sig_sc_in_Connection_Management_DOT_Connected_DOT_CELL_DCH_118 0
-#define __Sig_sc_in_Connection_Management_DOT_Connected_DOT_CELL_FACH_119 1
-#define __Sig_sc_go_5_CELL_DCH_138 1
-static integer  Var_msg_142;
-#define __Sig_sc_go_24_ConnReq_sent_141 2
-static integer  Var_msg_143;
-#define __Sig_sc_go_18_ConnSU_fail2_145 3
-#define __Sig_sc_go_14_Timer_started_153 4
-static integer  Sig_max_value_151;
-#define __Sig_sc_go_14_Timer_started_156 5
-static integer  Sig_max_value_154;
-#define __Sig_sc_go_41_ConnRel_send_146 6
-#define __Sig_sc_go_40_ConnRel_proc_148 7
-static integer  Var_msg_147;
-static integer  Var_msg_149;
-static integer  Var_msg_150;
-#define __Sig_Conn_Setup_End_136 8
-static int      Sig_V308_135_Pre0 = 0;
-static int      Sig_V308_135_Pre1 = 0;
-static integer  Sig_V308_135[2];
-#define __Sig_start_T308_133 9
-static integer  Sig_start_T308_133;
-static int      Sig_V300_132_Pre0 = 0;
-static int      Sig_V300_132_Pre1 = 0;
-static integer  Sig_V300_132[2];
-#define __Sig_inc_V300_131 10
-#define __Sig_start_T300_130 11
-static integer  Sig_start_T300_130;
-#define __Sig_Conn_Rel_Compl_Repeat_129 12
-#define __Sig_Conn_Rel_Compl_Stop_128 13
-#define __Sig_Conn_Request_Repeat_127 14
-#define __Sig_Conn_Request_Stop_126 15
-#define __Sig_Waiting_Connection_124 16
-#define __Sig_Go_state_CELL_FACH_122 17
-#define __Sig_Go_state_CELL_DCH_121 18
-#define __Sig_Go_Idle_120 19
-#define __Out_O_wait_116 20
-static integer  Out_O_wait_116;
-#define __Out_O_UpdateSI_852_115 21
-#define __Out_O_startT308_114 22
-#define __Out_O_stopT300_113 23
-#define __Out_O_startT300_112 24
-#define __Out_O_NAS_CONN_LOSS_IND_111 25
-#define __Out_O_NAS_CONN_RELEASE_IND_110 26
-#define __Out_O_NAS_CONN_ESTAB_RESP_109 27
-static integer  Out_O_NAS_CONN_ESTAB_RESP_109;
-#define __Out_O_SEND_DCCH_UM_108 28
-static integer  Out_O_SEND_DCCH_UM_108;
-#define __Out_O_SEND_DCCH_AM_107 29
-static integer  Out_O_SEND_DCCH_AM_107;
-#define __Out_O_SEND_CCCH_106 30
-static integer  Out_O_SEND_CCCH_106;
-#define __Out_O_Setup_FACHRACH_105 31
-#define __Out_O_PHY_SYNCH_104 32
-#define __In_I_Go_CELL_FACH_103 33
-#define __In_I_Go_CELL_DCH_102 34
-#define __In_I_WaitTimerExpired_101 35
-#define __In_I_T308_TimeOut_100 36
-#define __In_I_T300_TimeOut_99 37
-#define __In_I_NAS_CONN_RELEASE_REQ_98 38
-#define __In_I_NAS_CONN_ESTABLISHMENT_REQ_97 39
-#define __In_I_RRC_CONNECTION_RELEASE_96 40
-#define __In_I_RRC_CONNECTION_REJECT_95 41
-#define __In_I_RRC_CONNECTION_SETUP_94 42
-#define __In_I_RLC_Success_93 43
-#define __In_I_RLC_Failure_92 44
-#define __In_I_CPHY_CONNECTION_LOSS_91 45
-#define __In_I_CPHY_SYNCH_IND_90 46
-#define __In_I_CPHY_SYNCH_Failure_89 47
-#define __In_I_rcved_on_CCCH_88 48
-#define __In_I_rcved_on_DCCH_87 49
-#define __In_I_Wait_Time_86 50
-static integer  In_I_Wait_Time_86;
-#define __In_I_IE_Freq_Info_85 51
-#define __In_I_IE_RRC_State_84 52
-static integer  In_I_IE_RRC_State_84;
-#define __In_UE_ID_INIT_83 53
-static integer  In_UE_ID_INIT_83;
-#define __In_UE_ID_MSG_82 54
-static integer  In_UE_ID_MSG_82;
-#ifndef encode_message
-extern void     encode_message (integer *, integer);
-#endif
-#ifndef Select_PRACH
-extern void     Select_PRACH ();
-#endif
-#ifndef Select_Secondary_CCPCH
-extern void     Select_Secondary_CCPCH ();
-#endif
-#ifndef Set_State
-extern void     Set_State (integer, boolean);
-#endif
-#ifndef release_radio_resources
-extern void     release_radio_resources ();
-#endif
-#ifndef clear_variables_rel
-extern void     clear_variables_rel ();
-#endif
-#ifndef ue_clear_transaction
-extern void     ue_clear_transaction (integer);
-#endif
-#ifndef INTEGER_COMBINE
-extern integer  INTEGER_COMBINE (integer, integer);
-#endif
-
-extern void     RRC_UE_O_O_wait (integer);
-extern void     RRC_UE_O_O_UpdateSI_852 (void);
-extern void     RRC_UE_O_O_startT308 (void);
-extern void     RRC_UE_O_O_stopT300 (void);
-extern void     RRC_UE_O_O_startT300 (void);
-extern void     RRC_UE_O_O_NAS_CONN_LOSS_IND (void);
-extern void     RRC_UE_O_O_NAS_CONN_RELEASE_IND (void);
-extern void     RRC_UE_O_O_NAS_CONN_ESTAB_RESP (integer);
-extern void     RRC_UE_O_O_SEND_DCCH_UM (integer);
-extern void     RRC_UE_O_O_SEND_DCCH_AM (integer);
-extern void     RRC_UE_O_O_SEND_CCCH (integer);
-extern void     RRC_UE_O_O_Setup_FACHRACH (void);
-extern void     RRC_UE_O_O_PHY_SYNCH (void);
-void
-RRC_UE_I_I_Go_CELL_FACH (void)
-{
-  EMIT (_Sig, __In_I_Go_CELL_FACH_103);
-}
-
-void
-RRC_UE_I_I_Go_CELL_DCH (void)
-{
-  EMIT (_Sig, __In_I_Go_CELL_DCH_102);
-}
-
-void
-RRC_UE_I_I_WaitTimerExpired (void)
-{
-  EMIT (_Sig, __In_I_WaitTimerExpired_101);
-}
-
-void
-RRC_UE_I_I_T308_TimeOut (void)
-{
-  EMIT (_Sig, __In_I_T308_TimeOut_100);
-}
-
-void
-RRC_UE_I_I_T300_TimeOut (void)
-{
-  EMIT (_Sig, __In_I_T300_TimeOut_99);
-}
-
-void
-RRC_UE_I_I_NAS_CONN_RELEASE_REQ (void)
-{
-  EMIT (_Sig, __In_I_NAS_CONN_RELEASE_REQ_98);
-}
-
-void
-RRC_UE_I_I_NAS_CONN_ESTABLISHMENT_REQ (void)
-{
-  EMIT (_Sig, __In_I_NAS_CONN_ESTABLISHMENT_REQ_97);
-}
-
-void
-RRC_UE_I_I_RRC_CONNECTION_RELEASE (void)
-{
-  EMIT (_Sig, __In_I_RRC_CONNECTION_RELEASE_96);
-}
-
-void
-RRC_UE_I_I_RRC_CONNECTION_REJECT (void)
-{
-  EMIT (_Sig, __In_I_RRC_CONNECTION_REJECT_95);
-}
-
-void
-RRC_UE_I_I_RRC_CONNECTION_SETUP (void)
-{
-  EMIT (_Sig, __In_I_RRC_CONNECTION_SETUP_94);
-}
-
-void
-RRC_UE_I_I_RLC_Success (void)
-{
-  EMIT (_Sig, __In_I_RLC_Success_93);
-}
-
-void
-RRC_UE_I_I_RLC_Failure (void)
-{
-  EMIT (_Sig, __In_I_RLC_Failure_92);
-}
-
-void
-RRC_UE_I_I_CPHY_CONNECTION_LOSS (void)
-{
-  EMIT (_Sig, __In_I_CPHY_CONNECTION_LOSS_91);
-}
-
-void
-RRC_UE_I_I_CPHY_SYNCH_IND (void)
-{
-  EMIT (_Sig, __In_I_CPHY_SYNCH_IND_90);
-}
-
-void
-RRC_UE_I_I_CPHY_SYNCH_Failure (void)
-{
-  EMIT (_Sig, __In_I_CPHY_SYNCH_Failure_89);
-}
-
-void
-RRC_UE_I_I_rcved_on_CCCH (void)
-{
-  EMIT (_Sig, __In_I_rcved_on_CCCH_88);
-}
-
-void
-RRC_UE_I_I_rcved_on_DCCH (void)
-{
-  EMIT (_Sig, __In_I_rcved_on_DCCH_87);
-}
-
-void
-RRC_UE_I_I_Wait_Time (integer value)
-{
-  EMIT (_Sig, __In_I_Wait_Time_86);
-  _integer (&In_I_Wait_Time_86, value);
-}
-
-void
-RRC_UE_I_I_IE_Freq_Info (void)
-{
-  EMIT (_Sig, __In_I_IE_Freq_Info_85);
-}
-
-void
-RRC_UE_I_I_IE_RRC_State (integer value)
-{
-  EMIT (_Sig, __In_I_IE_RRC_State_84);
-  _integer (&In_I_IE_RRC_State_84, value);
-}
-
-void
-RRC_UE_I_UE_ID_INIT (integer value)
-{
-  EMIT (_Sig, __In_UE_ID_INIT_83);
-  _integer (&In_UE_ID_INIT_83, value);
-}
-
-void
-RRC_UE_I_UE_ID_MSG (integer value)
-{
-  EMIT (_Sig, __In_UE_ID_MSG_82);
-  _integer (&In_UE_ID_MSG_82, value);
-}
-
-static void
-Point_0 (void)
-{
-  /*#0 */
-  _boolean (&Var__ThisIsTheEnd__157, 1);
-  CLEAR_SIGNAL (_SigPre_0, __Sig_sc_in_Connection_Management_DOT_Connected_DOT_CELL_DCH_118);
-  CLEAR_SIGNAL (_SigPre_1, __Sig_sc_in_Connection_Management_DOT_Connected_DOT_CELL_DCH_118);
-  CLEAR_SIGNAL (_SigPre_0, __Sig_sc_in_Connection_Management_DOT_Connected_DOT_CELL_FACH_119);
-  CLEAR_SIGNAL (_SigPre_1, __Sig_sc_in_Connection_Management_DOT_Connected_DOT_CELL_FACH_119);
-  Set_State (IDLE, 0);
-  _Pause[0] |= 0x2088011a;
-  _Pause[1] |= 0x12;            /* PauseOn: #1 #3 #4 #8 #19 #23 #29 #33 #36 */
-}
-
-static void
-Point_1 (void)
-{
-  /*#1 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __In_I_NAS_CONN_RELEASE_REQ_98)) {
-    if ((IS_SIGNAL (_SigPre_1, __Sig_sc_in_Connection_Management_DOT_Connected_DOT_CELL_FACH_119) || IS_SIGNAL (_SigPre_1, __Sig_sc_in_Connection_Management_DOT_Connected_DOT_CELL_DCH_118))) {
-      encode_message (&Var_msg_150, RRC_CONN_RELEASE);
-      EMIT (_Sig, __Out_O_SEND_DCCH_AM_107);
-
-      if (!(IS_GUARD (9)))
-        _integer (&Out_O_SEND_DCCH_AM_107, Var_msg_150);
-      else
-        _integer (&Out_O_SEND_DCCH_AM_107, INTEGER_COMBINE (Out_O_SEND_DCCH_AM_107, Var_msg_150));
-
-      SET_GUARD (9);
-      _On[0] |= 0x100000;       /* On: #20 */
-      _On[0] &= ~0x2;           /* Off: #1 */
-      _Pause[0] |= 0x4;         /* PauseOn: #2 */
-    }
-  }
-}
-
-static void
-Point_2 (void)
-{
-  /*#2 AutoPauseOn */
-  if ((IS_SIGNAL (_Sig, __In_I_RLC_Success_93) || IS_SIGNAL (_Sig, __In_I_RLC_Failure_92))) {
-    release_radio_resources ();
-    clear_variables_rel ();
-    EMIT (_Sig, __Sig_Go_Idle_120);
-    EMIT (_Sig, __Out_O_UpdateSI_852_115);
-
-    if (!(IS_GUARD (1))) {
-      RRC_UE_O_O_UpdateSI_852 ();
-      SET_GUARD (1);
-    }
-
-    EMIT (_Sig, __Sig_Conn_Setup_End_136);
-    _On[0] |= 0x1000000;        /* On: #24 */
-    _On[0] &= ~0x4;             /* Off: #2 */
-  }
-}
-
-static void
-Point_3 (void)
-{
-  /*#3 AutoPauseOn */
-  EMIT (_Sig, __Sig_sc_in_Connection_Management_DOT_Idle_117);
-}
-
-static void
-Point_4 (void)
-{
-  /*#4 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __In_I_NAS_CONN_ESTABLISHMENT_REQ_97)) {
-    _On[0] |= 0x10000000;       /* On: #28 */
-    _On[0] &= ~0x10;            /* Off: #4 */
-  }
-}
-
-static void
-Point_5 (void)
-{
-  /*#5 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __In_I_WaitTimerExpired_101)) {
-    EMIT (_Sig, __Sig_inc_V300_131);
-    _On[0] |= 0x10000;          /* On: #16 */
-    _On[0] &= ~0x20;            /* Off: #5 */
-  }
-}
-
-static void
-Point_6 (void)
-{
-  /*#6 */
-  if (IS_SIGNAL (_Sig, __In_I_RRC_CONNECTION_REJECT_95)) {
-    EMIT (_Sig, __Out_O_stopT300_113);
-
-    if (!(IS_GUARD (3))) {
-      RRC_UE_O_O_stopT300 ();
-      SET_GUARD (3);
-    }
-
-    if (((In_I_Wait_Time_86 > 0) && (Sig_V300_132[Sig_V300_132_Pre1] <= N300))) {
-      if (IS_SIGNAL (_Sig, __In_I_IE_Freq_Info_85)) {
-        EMIT (_Sig, __Sig_sc_go_18_ConnSU_fail2_145);
-        _On[0] |= 0x10000;      /* On: #16 */
-      } else {
-        EMIT (_Sig, __Out_O_wait_116);
-        _integer (&Out_O_wait_116, In_I_Wait_Time_86);
-        RRC_UE_O_O_wait (Out_O_wait_116);
-        _Pause[0] |= 0x20;      /* PauseOn: #5 */
-      }
-    } else {
-      EMIT (_Sig, __Sig_sc_go_18_ConnSU_fail2_145);
-      _On[0] |= 0x10000;        /* On: #16 */
-    }
-  } else {
-    if (IS_SIGNAL (_Sig, __In_I_RRC_CONNECTION_SETUP_94)) {
-      EMIT (_Sig, __Out_O_stopT300_113);
-
-      if (!(IS_GUARD (3))) {
-        RRC_UE_O_O_stopT300 ();
-        SET_GUARD (3);
-      }
-
-      _Pause[0] |= 0x80;        /* PauseOn: #7 */
-
-      if (_eq_integer (In_I_IE_RRC_State_84, CELL_FACH)) {
-        Select_PRACH ();
-        Select_Secondary_CCPCH ();
-      }
-
-      EMIT (_Sig, __Out_O_PHY_SYNCH_104);
-
-      if (!(IS_GUARD (12))) {
-        RRC_UE_O_O_PHY_SYNCH ();
-        SET_GUARD (12);
-      }
-    } else {
-      _On[1] |= 0x80;           /* On: #39 */
-    }
-  }
-}
-
-static void
-Point_7 (void)
-{
-  /*#7 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __In_I_CPHY_SYNCH_Failure_89)) {
-    _On[0] &= ~0x80;            /* Off: #7 */
-
-    if ((Sig_V300_132[Sig_V300_132_Pre1] <= N300)) {
-      EMIT (_Sig, __Sig_inc_V300_131);
-      _On[0] |= 0x10000;        /* On: #16 */
-    } else {
-      EMIT (_Sig, __Sig_sc_go_18_ConnSU_fail2_145);
-      _On[0] |= 0x10000;        /* On: #16 */
-    }
-  } else {
-    if (IS_SIGNAL (_Sig, __In_I_CPHY_SYNCH_IND_90)) {
-      _On[0] &= ~0x80;          /* Off: #7 */
-      _Pause[0] |= 0x8000;      /* PauseOn: #15 */
-
-      if (_eq_integer (In_I_IE_RRC_State_84, CELL_FACH)) {
-        EMIT (_Sig, __Sig_Go_state_CELL_FACH_122);
-      }
-
-      if (_eq_integer (In_I_IE_RRC_State_84, CELL_DCH)) {
-        EMIT (_Sig, __Sig_Go_state_CELL_DCH_121);
-      }
-
-      encode_message (&Var_msg_143, RRC_CONN_SETUP_COMPLETE);
-      EMIT (_Sig, __Out_O_SEND_DCCH_AM_107);
-
-      if (!(IS_GUARD (9)))
-        _integer (&Out_O_SEND_DCCH_AM_107, Var_msg_143);
-      else
-        _integer (&Out_O_SEND_DCCH_AM_107, INTEGER_COMBINE (Out_O_SEND_DCCH_AM_107, Var_msg_143));
-
-      SET_GUARD (9);
-      _On[0] |= 0x100000;       /* On: #20 */
-    }
-  }
-}
-
-static void
-Point_8 (void)
-{
-  /*#8 AutoPauseOn */
-  if ((IS_SIGNAL (_Sig, __Sig_Go_state_CELL_DCH_121) || IS_SIGNAL (_Sig, __Sig_Go_state_CELL_FACH_122))) {
-    CLEAR_SIGNAL (_Sig, __Sig_sc_go_5_CELL_DCH_138);
-    _On[0] |= 0x200;            /* On: #9 */
-    _On[0] &= ~0x100;           /* Off: #8 */
-    _Pause[0] |= 0x8000000;     /* PauseOn: #27 */
-    _Pause[0] &= ~0x8;
-    _On[0] &= ~0x8;             /* PauseOff: #3 */
-  }
-}
-
-static void
-Point_9 (void)
-{
-  /*#9 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __Sig_Go_state_CELL_FACH_122)) {
-    SET_GUARD (0);
-    _On[0] &= ~0x200;           /* Off: #9 */
-  } else {
-    if (IS_SIGNAL (_Sig, __Sig_Go_state_CELL_DCH_121)) {
-      SET_GUARD (0);
-      EMIT (_Sig, __Sig_sc_go_5_CELL_DCH_138);
-      _On[0] &= ~0x200;         /* Off: #9 */
-    }
-  }
-
-  if (IS_GUARD (0)) {
-    if (IS_SIGNAL (_Sig, __Sig_sc_go_5_CELL_DCH_138)) {
-      EMIT (_SigPre_0, __Sig_sc_in_Connection_Management_DOT_Connected_DOT_CELL_DCH_118);
-      _Pause[0] |= 0xc00;       /* PauseOn: #10 #11 */
-
-      if (IS_SIGNAL (_Sig, __In_I_Go_CELL_DCH_102)) {
-        Set_State (CELL_DCH, 1);
-      } else {
-        Set_State (CELL_DCH, 0);
-      }
-    } else {
-      EMIT (_SigPre_0, __Sig_sc_in_Connection_Management_DOT_Connected_DOT_CELL_FACH_119);
-      _Pause[0] |= 0x3000;      /* PauseOn: #12 #13 */
-
-      if (IS_SIGNAL (_Sig, __In_I_Go_CELL_FACH_103)) {
-        Set_State (CELL_FACH, 1);
-      } else {
-        Set_State (CELL_FACH, 0);
-      }
-    }
-  }
-}
-
-static void
-Point_10 (void)
-{
-  /*#10 AutoPauseOn */
-  EMIT (_SigPre_0, __Sig_sc_in_Connection_Management_DOT_Connected_DOT_CELL_DCH_118);
-}
-
-static void
-Point_11 (void)
-{
-  /*#11 AutoPauseOn */
-  if ((IS_SIGNAL (_Sig, __Sig_Go_state_CELL_FACH_122) || IS_SIGNAL (_Sig, __In_I_Go_CELL_FACH_103))) {
-    _On[0] |= 0x4000;           /* On: #14 */
-    _On[0] &= ~0x800;           /* Off: #11 */
-    _Pause[0] &= ~0x400;
-    _On[0] &= ~0x400;           /* PauseOff: #10 */
-  }
-}
-
-static void
-Point_12 (void)
-{
-  /*#12 AutoPauseOn */
-  EMIT (_SigPre_0, __Sig_sc_in_Connection_Management_DOT_Connected_DOT_CELL_FACH_119);
-}
-
-static void
-Point_13 (void)
-{
-  /*#13 AutoPauseOn */
-  if ((IS_SIGNAL (_Sig, __Sig_Go_state_CELL_DCH_121) || IS_SIGNAL (_Sig, __In_I_Go_CELL_DCH_102))) {
-    EMIT (_Sig, __Sig_sc_go_5_CELL_DCH_138);
-    _On[0] |= 0x4000;           /* On: #14 */
-    _On[0] &= ~0x2000;          /* Off: #13 */
-    _Pause[0] &= ~0x1000;
-    _On[0] &= ~0x1000;          /* PauseOff: #12 */
-  }
-}
-
-static void
-Point_14 (void)
-{
-  /*#14 */
-  if (IS_SIGNAL (_Sig, __Sig_sc_go_5_CELL_DCH_138)) {
-    EMIT (_SigPre_0, __Sig_sc_in_Connection_Management_DOT_Connected_DOT_CELL_DCH_118);
-    _Pause[0] |= 0xc00;         /* PauseOn: #10 #11 */
-
-    if (IS_SIGNAL (_Sig, __In_I_Go_CELL_DCH_102)) {
-      Set_State (CELL_DCH, 1);
-    } else {
-      Set_State (CELL_DCH, 0);
-    }
-  } else {
-    EMIT (_SigPre_0, __Sig_sc_in_Connection_Management_DOT_Connected_DOT_CELL_FACH_119);
-    _Pause[0] |= 0x3000;        /* PauseOn: #12 #13 */
-
-    if (IS_SIGNAL (_Sig, __In_I_Go_CELL_FACH_103)) {
-      Set_State (CELL_FACH, 1);
-    } else {
-      Set_State (CELL_FACH, 0);
-    }
-  }
-}
-
-static void
-Point_15 (void)
-{
-  /*#15 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __In_I_RLC_Failure_92)) {
-    EMIT (_Sig, __Sig_Go_Idle_120);
-    EMIT (_Sig, __Sig_sc_go_18_ConnSU_fail2_145);
-    _On[0] |= 0x10000;          /* On: #16 */
-    _On[0] &= ~0x8000;          /* Off: #15 */
-  } else {
-    if (IS_SIGNAL (_Sig, __In_I_RLC_Success_93)) {
-      EMIT (_Sig, __Out_O_NAS_CONN_ESTAB_RESP_109);
-
-      if (!(IS_GUARD (7)))
-        _integer (&Out_O_NAS_CONN_ESTAB_RESP_109, SUCCESS);
-      else
-        _integer (&Out_O_NAS_CONN_ESTAB_RESP_109, INTEGER_COMBINE (Out_O_NAS_CONN_ESTAB_RESP_109, SUCCESS));
-
-      SET_GUARD (7);
-      ue_clear_transaction (RRC_CONN_SETUP);
-      EMIT (_Sig, __Sig_Conn_Setup_End_136);
-      _On[1] |= 0x200;          /* On: #41 */
-      _On[0] &= ~0x8000;        /* Off: #15 */
-    }
-  }
-}
-
-static void
-Point_16 (void)
-{
-  /*#16 */
-  if (IS_SIGNAL (_Sig, __Sig_sc_go_18_ConnSU_fail2_145)) {
-    EMIT (_Sig, __Sig_Conn_Setup_End_136);
-    EMIT (_Sig, __Out_O_UpdateSI_852_115);
-
-    if (!(IS_GUARD (1))) {
-      RRC_UE_O_O_UpdateSI_852 ();
-      SET_GUARD (1);
-    }
-
-    EMIT (_Sig, __Out_O_NAS_CONN_ESTAB_RESP_109);
-
-    if (!(IS_GUARD (7)))
-      _integer (&Out_O_NAS_CONN_ESTAB_RESP_109, FAILURE);
-    else
-      _integer (&Out_O_NAS_CONN_ESTAB_RESP_109, INTEGER_COMBINE (Out_O_NAS_CONN_ESTAB_RESP_109, FAILURE));
-
-    SET_GUARD (7);
-    _On[1] |= 0x200;            /* On: #41 */
-  } else {
-    _Pause[0] |= 0x40;          /* PauseOn: #6 */
-  }
-}
-
-static void
-Point_17 (void)
-{
-  /*#17 */
-  if (IS_SIGNAL (_Sig, __In_I_T308_TimeOut_100)) {
-    if ((Sig_V308_135[Sig_V308_135_Pre1] > Sig_max_value_154)) {
-      EMIT (_Sig, __Sig_Conn_Rel_Compl_Stop_128);
-      _On[1] |= 0x4;            /* On: #34 */
-    } else {
-      EMIT (_Sig, __Sig_Conn_Rel_Compl_Repeat_129);
-      _On[1] |= 0x1;            /* On: #32 */
-    }
-  } else {
-    _On[0] |= 0x80000000;       /* On: #31 */
-  }
-}
-
-static void
-Point_18 (void)
-{
-  /*#18 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __Sig_Conn_Rel_Compl_Repeat_129)) {
-    EMIT (_Sig, __Sig_sc_go_41_ConnRel_send_146);
-    _On[0] |= 0x400000;         /* On: #22 */
-    _On[0] &= ~0x40000;         /* Off: #18 */
-  } else {
-    if (IS_SIGNAL (_Sig, __Sig_Conn_Rel_Compl_Stop_128)) {
-      EMIT (_Sig, __Sig_sc_go_40_ConnRel_proc_148);
-      _On[0] |= 0x400000;       /* On: #22 */
-      _On[0] &= ~0x40000;       /* Off: #18 */
-    }
-  }
-}
-
-static void
-Point_19 (void)
-{
-  /*#19 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __In_I_RRC_CONNECTION_RELEASE_96)) {
-    _On[0] &= ~0x80000;         /* Off: #19 */
-
-    if (IS_SIGNAL (_SigPre_1, __Sig_sc_in_Connection_Management_DOT_Connected_DOT_CELL_FACH_119)) {
-      if (IS_SIGNAL (_Sig, __In_I_rcved_on_CCCH_88)) {
-        EMIT (_Sig, __Sig_sc_go_40_ConnRel_proc_148);
-        _On[0] |= 0x400000;     /* On: #22 */
-      } else {
-        if (IS_SIGNAL (_Sig, __In_I_rcved_on_DCCH_87)) {
-          encode_message (&Var_msg_147, RRC_CONN_REL_COMPLETE);
-          EMIT (_Sig, __Out_O_SEND_DCCH_AM_107);
-
-          if (!(IS_GUARD (9)))
-            _integer (&Out_O_SEND_DCCH_AM_107, Var_msg_147);
-          else
-            _integer (&Out_O_SEND_DCCH_AM_107, INTEGER_COMBINE (Out_O_SEND_DCCH_AM_107, Var_msg_147));
-
-          SET_GUARD (9);
-          _On[0] |= 0x100000;   /* On: #20 */
-          _Pause[0] |= 0x200000;        /* PauseOn: #21 */
-        } else {
-          _On[0] |= 0x400000;   /* On: #22 */
-        }
-      }
-    } else {
-      if (IS_SIGNAL (_SigPre_1, __Sig_sc_in_Connection_Management_DOT_Connected_DOT_CELL_DCH_118)) {
-        encode_message (&Var_msg_147, RRC_CONN_REL_COMPLETE);
-        EMIT (_Sig, __Sig_start_T308_133);
-        _integer (&Sig_start_T308_133, N308);
-        EMIT (_Sig, __Sig_sc_go_41_ConnRel_send_146);
-        _On[0] |= 0x400000;     /* On: #22 */
-      } else {
-        _On[0] |= 0x400000;     /* On: #22 */
-      }
-    }
-  }
-}
-
-static void
-Point_20 (void)
-{
-  /*#20 */
-  RRC_UE_O_O_SEND_DCCH_AM (Out_O_SEND_DCCH_AM_107);
-}
-
-static void
-Point_21 (void)
-{
-  /*#21 AutoPauseOn */
-  if ((IS_SIGNAL (_Sig, __In_I_RLC_Success_93) || IS_SIGNAL (_Sig, __In_I_RLC_Failure_92))) {
-    EMIT (_Sig, __Sig_sc_go_40_ConnRel_proc_148);
-    _On[0] |= 0x400000;         /* On: #22 */
-    _On[0] &= ~0x200000;        /* Off: #21 */
-  }
-}
-
-static void
-Point_22 (void)
-{
-  /*#22 */
-  if (IS_SIGNAL (_Sig, __Sig_sc_go_40_ConnRel_proc_148)) {
-    release_radio_resources ();
-    EMIT (_Sig, __Out_O_NAS_CONN_RELEASE_IND_110);
-
-    if (!(IS_GUARD (6))) {
-      RRC_UE_O_O_NAS_CONN_RELEASE_IND ();
-      SET_GUARD (6);
-    }
-
-    clear_variables_rel ();
-    EMIT (_Sig, __Sig_Go_Idle_120);
-    EMIT (_Sig, __Out_O_UpdateSI_852_115);
-
-    if (!(IS_GUARD (1))) {
-      RRC_UE_O_O_UpdateSI_852 ();
-      SET_GUARD (1);
-    }
-
-    EMIT (_Sig, __Sig_Conn_Setup_End_136);
-    _On[0] |= 0x4000000;        /* On: #26 */
-  } else {
-    _On[0] |= 0x40000000;       /* On: #30 */
-  }
-}
-
-static void
-Point_23 (void)
-{
-  /*#23 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __In_I_CPHY_CONNECTION_LOSS_91)) {
-    release_radio_resources ();
-    EMIT (_Sig, __Out_O_NAS_CONN_LOSS_IND_111);
-
-    if (!(IS_GUARD (5))) {
-      RRC_UE_O_O_NAS_CONN_LOSS_IND ();
-      SET_GUARD (5);
-    }
-
-    clear_variables_rel ();
-    EMIT (_Sig, __Out_O_UpdateSI_852_115);
-
-    if (!(IS_GUARD (1))) {
-      RRC_UE_O_O_UpdateSI_852 ();
-      SET_GUARD (1);
-    }
-
-    EMIT (_Sig, __Sig_Conn_Setup_End_136);
-    EMIT (_Sig, __Sig_Go_Idle_120);
-    _On[0] |= 0x2000000;        /* On: #25 */
-    _On[0] &= ~0x800000;        /* Off: #23 */
-  }
-}
-
-static void
-Point_24 (void)
-{
-  /*#24 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __Sig_Conn_Setup_End_136)) {
-    _On[0] &= ~0x1000000;       /* Off: #24 */
-    _Pause[0] |= 0x2;           /* PauseOn: #1 */
-  }
-}
-
-static void
-Point_25 (void)
-{
-  /*#25 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __Sig_Conn_Setup_End_136)) {
-    _On[0] &= ~0x2000000;       /* Off: #25 */
-    _Pause[0] |= 0x800000;      /* PauseOn: #23 */
-  }
-}
-
-static void
-Point_26 (void)
-{
-  /*#26 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __Sig_Conn_Setup_End_136)) {
-    _On[0] |= 0x40000000;       /* On: #30 */
-    _On[0] &= ~0x4000000;       /* Off: #26 */
-  }
-}
-
-static void
-Point_27 (void)
-{
-  /*#27 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __Sig_Go_Idle_120)) {
-    Set_State (IDLE, 0);
-    EMIT (_Sig, __Sig_sc_in_Connection_Management_DOT_Idle_117);
-    _On[0] &= ~0x8000000;       /* Off: #27 */
-    _Pause[0] |= 0x108;         /* PauseOn: #3 #8 */
-    _Pause[0] &= ~0x3e00;
-    _On[0] &= ~0x3e00;          /* PauseOff: #9 #10 #11 #12 #13 */
-  }
-}
-
-static void
-Point_28 (void)
-{
-  /*#28 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __Sig_sc_in_Connection_Management_DOT_Idle_117)) {
-    EMIT (_Sig, __Out_O_Setup_FACHRACH_105);
-
-    if (!(IS_GUARD (11))) {
-      RRC_UE_O_O_Setup_FACHRACH ();
-      SET_GUARD (11);
-    }
-
-    encode_message (&Var_msg_142, RRC_CONN_REQ);
-    EMIT (_Sig, __Sig_Waiting_Connection_124);
-    EMIT (_Sig, __Sig_start_T300_130);
-    _integer (&Sig_start_T300_130, N300);
-    EMIT (_Sig, __Sig_sc_go_24_ConnReq_sent_141);
-    _On[1] |= 0x400;            /* On: #42 */
-    _On[0] &= ~0x10000000;      /* Off: #28 */
-  } else {
-    if ((!IS_SIGNAL (_Sig, __Sig_sc_in_Connection_Management_DOT_Idle_117))) {
-      EMIT (_Sig, __Out_O_NAS_CONN_ESTAB_RESP_109);
-
-      if (!(IS_GUARD (7)))
-        _integer (&Out_O_NAS_CONN_ESTAB_RESP_109, ALREADY_C);
-      else
-        _integer (&Out_O_NAS_CONN_ESTAB_RESP_109, INTEGER_COMBINE (Out_O_NAS_CONN_ESTAB_RESP_109, ALREADY_C));
-
-      SET_GUARD (7);
-      _On[1] |= 0x600;          /* On: #41 #42 */
-      _On[0] &= ~0x10000000;    /* Off: #28 */
-    }
-  }
-}
-
-static void
-Point_29 (void)
-{
-  /*#29 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __Sig_Waiting_Connection_124)) {
-    _On[1] |= 0x100;            /* On: #40 */
-    _On[0] &= ~0x20000000;      /* Off: #29 */
-    _Pause[0] |= 0x40;          /* PauseOn: #6 */
-  }
-}
-
-static void
-Point_30 (void)
-{
-  /*#30 */
-  if (IS_SIGNAL (_Sig, __Sig_sc_go_41_ConnRel_send_146)) {
-    EMIT (_Sig, __Out_O_SEND_DCCH_UM_108);
-
-    if (!(IS_GUARD (8)))
-      _integer (&Out_O_SEND_DCCH_UM_108, Var_msg_147);
-    else
-      _integer (&Out_O_SEND_DCCH_UM_108, INTEGER_COMBINE (Out_O_SEND_DCCH_UM_108, Var_msg_147));
-
-    SET_GUARD (8);
-    EMIT (_Sig, __Out_O_startT308_114);
-
-    if (!(IS_GUARD (2))) {
-      RRC_UE_O_O_startT308 ();
-      SET_GUARD (2);
-    }
-
-    RRC_UE_O_O_SEND_DCCH_UM (Out_O_SEND_DCCH_UM_108);
-    _Pause[0] |= 0x40000;       /* PauseOn: #18 */
-  } else {
-    _Pause[0] |= 0x80000;       /* PauseOn: #19 */
-  }
-}
-
-static void
-Point_31 (void)
-{
-  /*#31 */
-  if (IS_SIGNAL (_Sig, __Sig_Conn_Setup_End_136)) {
-    _On[1] |= 0x4;              /* On: #34 */
-  } else {
-    _Pause[0] |= 0x20000;       /* PauseOn: #17 */
-  }
-}
-
-static void
-Point_32 (void)
-{
-  /*#32 */
-  Sig_V308_135_Pre0 = Sig_V308_135_Pre1 ^ 1;
-  _integer (&Sig_V308_135[Sig_V308_135_Pre0], (Sig_V308_135[Sig_V308_135_Pre1] + 1));
-  EMIT (_Sig, __Sig_sc_go_14_Timer_started_156);
-  _On[1] |= 0x4;                /* On: #34 */
-}
-
-static void
-Point_33 (void)
-{
-  /*#33 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __Sig_start_T308_133)) {
-    Sig_V308_135_Pre0 = Sig_V308_135_Pre1 ^ 1;
-    _integer (&Sig_V308_135[Sig_V308_135_Pre0], 1);
-    _integer (&Sig_max_value_154, Sig_start_T308_133);
-    EMIT (_Sig, __Sig_sc_go_14_Timer_started_156);
-    _On[1] |= 0x4;              /* On: #34 */
-    _On[1] &= ~0x2;             /* Off: #33 */
-  }
-}
-
-static void
-Point_34 (void)
-{
-  /*#34 */
-  if (IS_SIGNAL (_Sig, __Sig_sc_go_14_Timer_started_156)) {
-    _Pause[0] |= 0x20000;       /* PauseOn: #17 */
-  } else {
-    _Pause[1] |= 0x2;           /* PauseOn: #33 */
-  }
-}
-
-static void
-Point_35 (void)
-{
-  /*#35 AutoPauseOn */
-  if ((IS_SIGNAL (_Sig, __In_I_T300_TimeOut_99) || IS_SIGNAL (_Sig, __Sig_inc_V300_131))) {
-    _On[1] &= ~0x8;             /* Off: #35 */
-
-    if ((Sig_V300_132[Sig_V300_132_Pre1] > Sig_max_value_151)) {
-      EMIT (_Sig, __Sig_Conn_Request_Stop_126);
-      _On[1] |= 0x20;           /* On: #37 */
-    } else {
-      EMIT (_Sig, __Sig_Conn_Request_Repeat_127);
-      Sig_V300_132_Pre0 = Sig_V300_132_Pre1 ^ 1;
-      _integer (&Sig_V300_132[Sig_V300_132_Pre0], (Sig_V300_132[Sig_V300_132_Pre1] + 1));
-      EMIT (_Sig, __Sig_sc_go_14_Timer_started_153);
-      _On[1] |= 0x20;           /* On: #37 */
-    }
-  } else {
-    if (IS_SIGNAL (_Sig, __Sig_Conn_Setup_End_136)) {
-      _On[1] |= 0x20;           /* On: #37 */
-      _On[1] &= ~0x8;           /* Off: #35 */
-    }
-  }
-}
-
-static void
-Point_36 (void)
-{
-  /*#36 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __Sig_start_T300_130)) {
-    Sig_V300_132_Pre0 = Sig_V300_132_Pre1 ^ 1;
-    _integer (&Sig_V300_132[Sig_V300_132_Pre0], 1);
-    _integer (&Sig_max_value_151, Sig_start_T300_130);
-    EMIT (_Sig, __Sig_sc_go_14_Timer_started_153);
-    _On[1] |= 0x20;             /* On: #37 */
-    _On[1] &= ~0x10;            /* Off: #36 */
-  }
-}
-
-static void
-Point_37 (void)
-{
-  /*#37 */
-  if (IS_SIGNAL (_Sig, __Sig_sc_go_14_Timer_started_153)) {
-    _Pause[1] |= 0x8;           /* PauseOn: #35 */
-  } else {
-    _Pause[1] |= 0x10;          /* PauseOn: #36 */
-  }
-}
-
-static void
-Point_38 (void)
-{
-  /*#38 AutoPauseOn */
-  if (IS_SIGNAL (_Sig, __Sig_Conn_Request_Repeat_127)) {
-    EMIT (_Sig, __Sig_sc_go_24_ConnReq_sent_141);
-    _On[1] |= 0x400;            /* On: #42 */
-    _On[1] &= ~0x40;            /* Off: #38 */
-  } else {
-    if (IS_SIGNAL (_Sig, __Sig_Conn_Request_Stop_126)) {
-      _On[1] |= 0x400;          /* On: #42 */
-      _On[1] &= ~0x40;          /* Off: #38 */
-    } else {
-      if (IS_SIGNAL (_Sig, __Sig_Conn_Setup_End_136)) {
-        _On[1] |= 0x400;        /* On: #42 */
-        _On[1] &= ~0x40;        /* Off: #38 */
-      }
-    }
-  }
-}
-
-static void
-Point_39 (void)
-{
-  /*#39 */
-  if (IS_SIGNAL (_Sig, __Sig_Conn_Request_Stop_126)) {
-    EMIT (_Sig, __Out_O_NAS_CONN_ESTAB_RESP_109);
-
-    if (!(IS_GUARD (7)))
-      _integer (&Out_O_NAS_CONN_ESTAB_RESP_109, FAILURE);
-    else
-      _integer (&Out_O_NAS_CONN_ESTAB_RESP_109, INTEGER_COMBINE (Out_O_NAS_CONN_ESTAB_RESP_109, FAILURE));
-
-    SET_GUARD (7);
-    _On[1] |= 0x200;            /* On: #41 */
-  } else {
-    _Pause[0] |= 0x40;          /* PauseOn: #6 */
-  }
-}
-
-static void
-Point_40 (void)
-{
-  /*#40 AutoPauseOn */
-  if ((IS_SIGNAL (_Sig, __Sig_Conn_Setup_End_136) || IS_SIGNAL (_Sig, __Sig_Conn_Request_Stop_126))) {
-    _On[1] &= ~0x100;           /* Off: #40 */
-    _Pause[0] |= 0x20000000;    /* PauseOn: #29 */
-    _Pause[0] &= ~0x80e0;
-    _On[0] &= ~0x80a0;          /* PauseOff: #5 #6 #7 #15 */
-  }
-}
-
-static void
-Point_41 (void)
-{
-  /*#41 */
-  RRC_UE_O_O_NAS_CONN_ESTAB_RESP (Out_O_NAS_CONN_ESTAB_RESP_109);
-}
-
-static void
-Point_42 (void)
-{
-  /*#42 */
-  if (IS_SIGNAL (_Sig, __Sig_sc_go_24_ConnReq_sent_141)) {
-    EMIT (_Sig, __Out_O_SEND_CCCH_106);
-
-    if (!(IS_GUARD (10)))
-      _integer (&Out_O_SEND_CCCH_106, Var_msg_142);
-    else
-      _integer (&Out_O_SEND_CCCH_106, INTEGER_COMBINE (Out_O_SEND_CCCH_106, Var_msg_142));
-
-    SET_GUARD (10);
-    EMIT (_Sig, __Out_O_startT300_112);
-
-    if (!(IS_GUARD (4))) {
-      RRC_UE_O_O_startT300 ();
-      SET_GUARD (4);
-    }
-
-    RRC_UE_O_O_SEND_CCCH (Out_O_SEND_CCCH_106);
-    _Pause[1] |= 0x40;          /* PauseOn: #38 */
-  } else {
-    _Pause[0] |= 0x10;          /* PauseOn: #4 */
-  }
-}
-
-
-int
-RRC_UE (void)
-{
-  unsigned int   *Points;
-
-  Points = _On;
-
-  if (*Points) {
-    if (*Points & 0x1) {
-      Point_0 ();
-    }
-
-    if (*Points & 0x2) {
-      Point_1 ();
-    }
-
-    if (*Points & 0x4) {
-      Point_2 ();
-    }
-
-    if (*Points & 0x8) {
-      Point_3 ();
-    }
-
-    if (*Points & 0x10) {
-      Point_4 ();
-    }
-
-    if (*Points & 0x20) {
-      Point_5 ();
-    }
-
-    if (*Points & 0x40) {
-      Point_6 ();
-    }
-
-    if (*Points & 0x80) {
-      Point_7 ();
-    }
-
-    if (*Points & 0x100) {
-      Point_8 ();
-    }
-
-    if (*Points & 0x200) {
-      Point_9 ();
-    }
-
-    if (*Points & 0x400) {
-      Point_10 ();
-    }
-
-    if (*Points & 0x800) {
-      Point_11 ();
-    }
-
-    if (*Points & 0x1000) {
-      Point_12 ();
-    }
-
-    if (*Points & 0x2000) {
-      Point_13 ();
-    }
-
-    if (*Points & 0x4000) {
-      Point_14 ();
-    }
-
-    if (*Points & 0x8000) {
-      Point_15 ();
-    }
-
-    if (*Points & 0x10000) {
-      Point_16 ();
-    }
-
-    if (*Points & 0x20000) {
-      Point_17 ();
-    }
-
-    if (*Points & 0x40000) {
-      Point_18 ();
-    }
-
-    if (*Points & 0x80000) {
-      Point_19 ();
-    }
-
-    if (*Points & 0x100000) {
-      Point_20 ();
-    }
-
-    if (*Points & 0x200000) {
-      Point_21 ();
-    }
-
-    if (*Points & 0x400000) {
-      Point_22 ();
-    }
-
-    if (*Points & 0x800000) {
-      Point_23 ();
-    }
-
-    if (*Points & 0x1000000) {
-      Point_24 ();
-    }
-
-    if (*Points & 0x2000000) {
-      Point_25 ();
-    }
-
-    if (*Points & 0x4000000) {
-      Point_26 ();
-    }
-
-    if (*Points & 0x8000000) {
-      Point_27 ();
-    }
-
-    if (*Points & 0x10000000) {
-      Point_28 ();
-    }
-
-    if (*Points & 0x20000000) {
-      Point_29 ();
-    }
-
-    if (*Points & 0x40000000) {
-      Point_30 ();
-    }
-
-    if (*Points & 0x80000000) {
-      Point_31 ();
-    }
-  }
-
-  Points++;
-
-  if (*Points) {
-    if (*Points & 0x1) {
-      Point_32 ();
-    }
-
-    if (*Points & 0x2) {
-      Point_33 ();
-    }
-
-    if (*Points & 0x4) {
-      Point_34 ();
-    }
-
-    if (*Points & 0x8) {
-      Point_35 ();
-    }
-
-    if (*Points & 0x10) {
-      Point_36 ();
-    }
-
-    if (*Points & 0x20) {
-      Point_37 ();
-    }
-
-    if (*Points & 0x40) {
-      Point_38 ();
-    }
-
-    if (*Points & 0x80) {
-      Point_39 ();
-    }
-
-    if (*Points & 0x100) {
-      Point_40 ();
-    }
-
-    if (*Points & 0x200) {
-      Point_41 ();
-    }
-
-    if (*Points & 0x400) {
-      Point_42 ();
-    }
-  }
-
-  Points++;
-  {
-    int             j;
-    unsigned int   *_tmp;
-
-    _tmp = _SigPre_1;
-    _SigPre_1 = _SigPre_0;
-    _SigPre_0 = _tmp;
-
-    for (j = 0; j < SIGNAL_WITH_PRE_VECTOR_SIZE; j++)
-      _SigPre_0[j] = 0;
-
-    for (j = 0; j < SIGNAL_VECTOR_SIZE; j++)
-      _Sig[j] = 0;
-
-    Sig_V308_135_Pre1 = Sig_V308_135_Pre0;
-    Sig_V300_132_Pre1 = Sig_V300_132_Pre0;
-    _On[0] = _Pause[0] | (_On[0] & 0x3facbfbe);
-    _On[1] = _Pause[1] | (_On[1] & 0x15a);
-
-    /* AutoPauseOn: #1 #2 #3 #4 #5 #7 #8 #9 #10 #11 #12 #13 #15 #18 #19 #21 #23 #24 #25 #26 #27 #28 #29 #33 #35 #36 #38 #40 */
-    for (j = 0; j < HALT_POINT_VECTOR_SIZE; j++)
-      _Pause[j] = 0;
-
-    for (j = 0; j < GUARD_VECTOR_SIZE; j++)
-      _Guard[j] = 0;
-  }
-  return Var__ThisIsTheEnd__157;
-}
-
-int
-RRC_UE_reset (void)
-{
-  int             i, j;
-
-  for (j = 0; j < SIGNAL_VECTOR_SIZE; j++)
-    _Sig[j] = 0;
-
-  for (i = 0; i < GLOBALMAXPRELEVEL; i++)
-    for (j = 0; j < SIGNAL_WITH_PRE_VECTOR_SIZE; j++)
-      _SigPreTab[i][j] = 0;
-
-  _integer (&In_UE_ID_INIT_83, 33);
-
-  for (i = 0; i < HALT_POINT_VECTOR_SIZE; i++)
-    _On[i] = 0;
-
-  for (i = 0; i < HALT_POINT_VECTOR_SIZE; i++)
-    _Pause[i] = 0;
-
-  for (i = 0; i < GUARD_VECTOR_SIZE; i++)
-    _Guard[i] = 0;
-
-  BIT_SET (_On, 0);
-  return 1;
-}
-
-typedef int     (*SimInitFunc_t) ();
-int
-RRC_UE_init (char **pError, SimInitFunc_t pFunc)
-{
-  return 1;
-}
-typedef int     (*SimEndFunc_t) ();
-int
-RRC_UE_end (SimEndFunc_t pFunc)
-{
-  return 1;
-}
-
-int
-RRC_UE_run (void)
-{
-  return RRC_UE ();
-}
-
-int
-RRC_UE_getError (void)
-{
-  return 0;
-}
-
-char           *
-RRC_UE_getErrorMessage (void)
-{
-  return (char *) 0;
-}
diff --git a/openair2/RRC/CELLULAR/rrc_ue.h b/openair2/RRC/CELLULAR/rrc_ue.h
deleted file mode 100755
index 92a45c1ea4..0000000000
--- a/openair2/RRC/CELLULAR/rrc_ue.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/***************************************************************************
-                          rrc_ue.h  -  description
-                             -------------------
-    begin                : Nov 7, 2001
-    copyright            : (C) 2001, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Header associated with the rrc_ue.c file generated by Esterel Studio
- ***************************************************************************/
-#include  "rrc_constant.h"
-// redefined here to avoid confusion with RRC LITE value
-#define IDLE RRC_CELL_IDLE
-
-/* Generic function to encode RRC messages */
-//void encode_message(int *Message_Id, int Message_Type);
-
-int  INTEGER_COMBINE (int Id1, int Id2);
-
-/* Selection of channels during RRC Connection SetUp
- */
-void  Select_PRACH (void);
-void  Select_Secondary_CCPCH (void);
-
-/* Record of current RRC state - to be stored in: protocol_ms->rrc.protocol_state
- */
-void  Set_State (int new_state, int forward);
-
-/* release resources in RLC, MAC, PHY (no reply)
- */
-void  release_radio_resources (void);
-
-/* clear RRC variables: TRANSACTIONS, ESTABLISHED_SIGNALLING_CONNECTIONS, ESTABLISHED_RBs...
- */
-void  clear_variables_rel (void);
-
-/* clear RRC TRANSACTIONS IDENTIFIER...
- */
-void  ue_clear_transaction (int Message_Type);
diff --git a/openair2/RRC/CELLULAR/rrc_ue_L2_frontend.c b/openair2/RRC/CELLULAR/rrc_ue_L2_frontend.c
deleted file mode 100755
index 2cf81d3690..0000000000
--- a/openair2/RRC/CELLULAR/rrc_ue_L2_frontend.c
+++ /dev/null
@@ -1,753 +0,0 @@
-/***************************************************************************
-                          rrc_ue_L2_frontend.c - description
-                          -------------------
-    begin               : July 2010
-    copyright           : (C) 2005, 2010 by Eurecom
-    created by    : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-      This file contain front end functions to isolate L2 interface
- **************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-// TEMP DRB
-//#include "DL-DCCH-Message.h"
-
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_ue_vars.h"
-#include "rrc_proto_intf.h"
-
-extern rlc_info_t Rlc_info_um;
-extern rlc_info_t Rlc_info_am_config;
-
-
-//-----------------------------------------------------------------------------
-/*  global variables copied from RRC LITE for logical channels */
-long logicalChannelGroup0 = 0;
-long  logicalChannelSR_Mask_r9=0;
-
-struct LogicalChannelConfig__ul_SpecificParameters LCSRB1 =  {1,
-         LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_infinity,
-         0,
-         &logicalChannelGroup0
-};
-
-struct LogicalChannelConfig__ul_SpecificParameters LCSRB2 =  {3,
-         LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_infinity,
-         0,
-         &logicalChannelGroup0
-};
-
-// These are the default SRB configurations from 36.331 (Chapter 9, p. 176-179 in v8.6)
-
-LogicalChannelConfig_t  SRB1_logicalChannelConfig_defaultValue = {&LCSRB1
-#ifdef Rel10
-                                                                  , &logicalChannelSR_Mask_r9
-#endif
-                                                                 };
-
-LogicalChannelConfig_t SRB2_logicalChannelConfig_defaultValue = {&LCSRB2
-#ifdef Rel10
-                                                                 , &logicalChannelSR_Mask_r9
-#endif
-                                                                };
-/*  END - global variables copied from RRC LITE for logical channels */
-//-----------------------------------------------------------------------------
-
-// Configuration Functions for L1-L2 layers
-//-----------------------------------------------------------------------------
-void crb_config_req (int activation_timeP)
-{
-  //-----------------------------------------------------------------------------
-#ifdef RRC_DEBUG_DUMMIES
-  msg ("\n[RRC][RG-DUMMIES] DUMMY CALL to crb_config_req\n");
-#endif
-}
-//-----------------------------------------------------------------------------
-void cmac_config_req (int userP, int activation_timeP)
-{
-  //-----------------------------------------------------------------------------
-#ifdef RRC_DEBUG_DUMMIES
-  msg ("\n[RRC][RG-DUMMIES] DUMMY CALL to cmac_config_req\n");
-#endif
-}
-//-----------------------------------------------------------------------------
-void CPHY_config_req (void *config, int activation_time, int userP)
-{
-  //-----------------------------------------------------------------------------
-#ifndef BYPASS_L1
-#ifdef RRC_DEBUG_DUMMIES
-  msg ("\n[RRC][RG-DUMMIES] DUMMY CALL to CPHY_config_req\n");
-#endif
-#endif
-}
-
-// Functions for data transmission
-//-------------------------------------------------------------------
-int rrc_ue_test_rlc_intf_xmit_dcch (void)
-{
-  //-----------------------------------------------------------------------------
-  //char *tx_dcch_info = {"This is a sample data to test the interface with the RLC module. Check segmentation and transmission"};
-  char *tx_dcch_info = {"DYNAMIC ACCESS REQUEST"};
-  int data_length = 0;
-  int retcode;
-
-#ifdef DEBUG_RRC_TEMP_OPENAIR
-  msg ("\n[RRC][UE-DUMMIES] TEMP - CALL to rrc_ue_test_rlc_intf_xmit_dcch\n");
-#endif
-  data_length=strlen(tx_dcch_info);
-  //retcode = rb_tx_data_srb_rg (RRC_SRB2_ID + (msgId * maxRB), tx_dcch_info, data_length * 8, protocol_bs->rrc.next_MUI++, TRUE);
-
-  //  Mac_rlc_xface->rrc_rlc_data_req (Mod_id+NB_CH_INST, UE_rrc_inst[Mod_id].Srb2[Idx2].Srb_info.Srb_id, mui++, 0, W_IDX, UE_rrc_inst[Mod_id].Srb2[Idx2].Srb_info.Tx_buffer.Payload);
-  retcode = Mac_rlc_xface->rrc_rlc_data_req (RRC_MODULE_INST_ID, RRC_LTE_DCCH_ID, protocol_ms->rrc.next_MUI++, 0, data_length, tx_dcch_info);
-#ifdef DEBUG_RRC_TEMP_OPENAIR
-  msg ("[RRC][UE-DUMMIES] rrc_ue_test_rlc_intf_xmit_dcch -- retcode = %d\n",retcode);  //RC = 1 ==> OK
-#endif
-  return 0;
-}
-
-//-------------------------------------------------------------------
-int rrc_ue_force_uplink (void)
-{
-  //-----------------------------------------------------------------------------
-  //TEST ACCESS communication
-  if ((Mac_rlc_xface->frame%5) == 2) {
-    rrc_ue_test_rlc_intf_xmit_dcch ();
-  }
-
-  return 0;
-}
-
-//-----------------------------------------------------------------------------
-void rrc_remove_UE(u8 Mod_id,u8 UE_id)
-{
-  //-----------------------------------------------------------------------------
-  msg ("\n[RRC-UE]call to rrc_remove_UE [empty - to be implemented in CELLULAR mode]\n");
-}
-
-// Unified function to send data
-//-----------------------------------------------------------------------------
-int rrc_ue_send_to_srb_rlc (int rb_id, char * data_buffer, int data_length)
-{
-  //-----------------------------------------------------------------------------
-  char tx_data[500];
-  int stxtlen = 0;
-  int result =0;
-  //int Mod_id = protocol_ms->rrc.mod_id;
-  int Mod_id = rrc_ue_mobileId;
-
-  int eNB_flag = 0; //1=eNB, 0=UE
-  int srb1 =1;
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC-UE-FRONTEND] Send Data to PDCP-RLC, srb %d at frame %d\n",rb_id, protocol_ms->rrc.current_SFN );
-  rrc_print_buffer (data_buffer, data_length);
-#endif
-
-  // OpenAirInterface, as of 02/01/2013, requires passing all the RRC CELL srb through the DCCH
-  // Multiplexing is performed by adding the srb_id as first byte of data buffer
-  memset(tx_data,0,500);
-  tx_data[0] = rb_id;
-  memcpy ((char*)&tx_data[1],data_buffer, data_length);
-  data_length = data_length +1;
-
-  switch (rb_id) {
-  case RRC_SRB0_ID: //CCCH
-  case RRC_SRB1_ID: //DCCH-UM
-
-    //result = rrc_rlc_data_req(Mod_id+NB_eNB_INST, protocol_ms->rrc.current_SFN, eNB_flag, srb1, protocol_ms->rrc.next_MUI++, RRC_RLC_CONFIRM_NO, data_length, tx_data);
-    if (pdcp_data_req(Mod_id+NB_eNB_INST,protocol_ms->rrc.current_SFN, eNB_flag,srb1,protocol_ms->rrc.next_MUI++,RRC_RLC_CONFIRM_NO,data_length,tx_data,PDCP_MODE_DATA_PDU))
-      result = 1;
-
-    break;
-
-  case RRC_SRB2_ID: //DCCH-AM
-  case RRC_SRB3_ID: //DCCH-AM - NAS
-    //result = rrc_rlc_data_req(Mod_id+NB_eNB_INST,protocol_ms->rrc.current_SFN, eNB_flag, srb1,protocol_ms->rrc.next_MUI++, RRC_RLC_CONFIRM_YES, data_length, tx_data);
-    protocol_ms->rrc.rrc_ue_ackSimu_mui = protocol_ms->rrc.next_MUI;
-
-    if (pdcp_data_req(Mod_id+NB_eNB_INST,protocol_ms->rrc.current_SFN, eNB_flag,srb1,protocol_ms->rrc.next_MUI++,RRC_RLC_CONFIRM_YES,data_length,tx_data,1)) {
-      result = 1;
-      protocol_ms->rrc.rrc_ue_ackSimu_flag = 1;
-      protocol_ms->rrc.rrc_ue_ackSimu_srbid = rb_id;
-    }
-
-    break;
-
-  default:
-    msg ("\n[RRC-UE-FRONTEND] ERROR - Unable to send data to RLC, Channel srb %d not supported\n",rb_id);
-  }
-
-  if (result !=1)
-    msg ("\n[RRC-UE-FRONTEND] ERROR - RLC returned an error code %d\n", result);
-
-  return result;
-
-}
-
-//-----------------------------------------------------------------------------
-int rrc_ue_receive_from_srb_rlc (char* sduP, u8 ch_idP, unsigned int Sdu_size)
-{
-  //-----------------------------------------------------------------------------
-  int srb_id, rb_id;
-  int UE_Id;
-  int sdu_offset=0;
-
-  // get UE_Id
-  rb_id = ch_idP;
-  srb_id = rb_id % NB_RB_MAX;
-  UE_Id = (rb_id - srb_id) / NB_RB_MAX;
-  // get RRC_CELL srb_id
-  srb_id = sduP[0];
-
-#ifdef DEBUG_RRC_DETAILS
-#ifndef DEBUG_RRC_MBMS
-
-  if (srb_id != RRC_MCCH_ID)
-#endif
-    msg ("\n[RRC-UE-FRONTEND] Begin rrc_ue_receive_from_srb_rlc, lchannel %d, srb %d for UE %d at frame %d\n", ch_idP, srb_id, UE_Id, protocol_ms->rrc.current_SFN);
-
-  //rrc_print_buffer ((char*)&sduP[0], Sdu_size);
-#endif
-
-  switch (srb_id) {
-  case RRC_SRB0_ID: //CCCH
-  case RRC_SRB1_ID: //DCCH-UM
-  case RRC_SRB2_ID: //DCCH-AM
-  case RRC_SRB3_ID: //DCCH-AM - NAS
-  case RRC_MCCH_ID: //MCCH
-    rrc_ue_srb_rx ((char*)&sduP[1], srb_id, UE_Id);
-    break;
-
-  default:
-    msg ("\n[RRC-UE-FRONTEND] Invalid Channel srb  number %d\n",srb_id);
-  }
-
-  return 0;
-}
-
-//-----------------------------------------------------------------------------
-void rrc_ue_simu_receive_ack_from_rlc (void)
-{
-  //-----------------------------------------------------------------------------
-  unsigned char Mod_id =protocol_ms->rrc.mod_id;
-
-  rrc_L2_rlc_confirm_ind_rx (Mod_id, protocol_ms->rrc.rrc_ue_ackSimu_srbid, protocol_ms->rrc.rrc_ue_ackSimu_mui);
-  protocol_ms->rrc.rrc_ue_ackSimu_mui = 0;
-  protocol_ms->rrc.rrc_ue_ackSimu_flag = 0;
-  protocol_ms->rrc.rrc_ue_ackSimu_srbid = 0;
-}
-
-/*****************************************
- Configuration Functions for L1-L2 layers
- *****************************************/
-//-----------------------------------------------------------------------------
-void  rrc_ue_L2_setupFachRach(void)
-{
-  //-----------------------------------------------------------------------------
-  rrc_ue_config_common_channels ();
-
-  rrc_ue_xmit_ccch();
-}
-
-//-----------------------------------------------------------------------------
-void rrc_ue_config_common_channels (void)
-{
-  //-----------------------------------------------------------------------------
-  //int Mod_id = protocol_ms->rrc.mod_id;
-  int Mod_id = rrc_ue_mobileId;
-  int eNB_flag=0;
-  int UE_index=rrc_ue_mobileId;
-  int eNB_index=0;
-  //  int eNB_index = 0;
-  //  int Mod_id = 0;
-
-  u8 result;
-  u8 SIwindowsize=1;
-  u16 SIperiod=8;
-
-  // Simulate decoding SIB1
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC-UE-FRONTEND] rrc_ue_config_common_channels \n");
-#endif
-
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC-UE-FRONTEND] do_SIB1_TDD_config_cell\n");
-#endif
-  // Initialize TDD_config parameters (TDD_Config_t tdd_Config;) calling asn1_msg.c
-  result = do_SIB1_TDD_config_cell (mac_xface->lte_frame_parms, &protocol_ms->rrc.ue_bch_asn1.tdd_Config);
-
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC-UE-FRONTEND] Frame TDD config %d, protocol_ms value %d\n", (int)mac_xface->lte_frame_parms->tdd_config, (int)protocol_ms->rrc.ue_bch_asn1.tdd_Config.subframeAssignment);
-  msg ("[RRC-UE-FRONTEND] MAC_CONFIG_REQ  (SIB1)--->][MAC_UE]\n");
-  msg ("[RRC-UE-FRONTEND] Parameters : Mod_id %d, eNB_flag %d, UE_index %d, eNB_index %d \n",Mod_id, eNB_flag, UE_index, eNB_index);
-#endif
-
-  // After Decoding SIB1 (l. 776)
-  /* rrc_mac_config_req(Mod_id,0,0,eNB_index,
-       (RadioResourceConfigCommonSIB_t *)NULL,
-       (struct PhysicalConfigDedicated *)NULL,
-       (MAC_MainConfig_t *)NULL,
-       0,
-       (struct LogicalChannelConfig *)NULL,
-       (MeasGapConfig_t *)NULL,
-       UE_rrc_inst[Mod_id].sib1[eNB_index]->tdd_Config,
-       &UE_rrc_inst[Mod_id].Info[eNB_index].SIwindowsize,
-       &UE_rrc_inst[Mod_id].Info[eNB_index].SIperiod); */
-
-  rrc_mac_config_req(Mod_id,eNB_flag,UE_index,eNB_index,
-                     NULL, //(RadioResourceConfigCommonSIB_t *)
-                     NULL, //(struct PhysicalConfigDedicated *)
-                     (MeasObjectToAddMod_t **)NULL,
-                     NULL, // (MAC_MainConfig_t *)
-                     0,
-                     NULL, // (struct LogicalChannelConfig *)
-                     NULL, //(MeasGapConfig_t *)
-                     (TDD_Config_t *)&protocol_ms->rrc.ue_bch_asn1.tdd_Config,
-                     &SIwindowsize,
-                     &SIperiod,
-                     NULL,
-                     NULL,
-                     NULL,
-                     (MBSFN_SubframeConfigList_t *)NULL
-#ifdef Rel10
-                     , 0,
-                     (MBSFN_AreaInfoList_r9_t *)NULL,
-                     (PMCH_InfoList_r9_t *)NULL
-#endif
-                    );
-
-  // Simulate decoding SIB2
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC-UE-FRONTEND] do_SIB2_cell\n");
-#endif
-
-  //uint8_t do_SIB2_cell(uint8_t Mod_id, LTE_DL_FRAME_PARMS *frame_parms, uint8_t *buffer,
-  //                  BCCH_DL_SCH_Message_t *bcch_message, SystemInformationBlockType2_t **sib2) {
-  protocol_ms->rrc.ue_bch_asn1.sizeof_SIB2 = do_SIB2_cell(0, mac_xface->lte_frame_parms, &protocol_ms->rrc.ue_bch_asn1.SIB23,
-      &protocol_ms->rrc.ue_bch_asn1.systemInformation, &protocol_ms->rrc.ue_bch_asn1.sib2);
-
-#ifdef DEBUG_RRC_DETAILS
-  msg ("\n[RRC-UE] SystemInformation SIB2 %d bytes\n", protocol_ms->rrc.ue_bch_asn1.sizeof_SIB2);
-  //LOG_D(RRC,"[eNB] SystemInformation Encoded %d bits (%d bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8);
-#endif
-
-  if (protocol_ms->rrc.ue_bch_asn1.sizeof_SIB2 == 255)
-    mac_xface->macphy_exit("rrc_sizeof_SIB2 is 255");
-  else {
-    //protocol_ms->rrc.ue_bch_asn1.sizeof_SIB2 = (u8)sizeof(SystemInformationBlockType2_t);
-
-#ifdef DEBUG_RRC_STATE
-    msg ("[RRC-UE-FRONTEND] MAC_CONFIG_REQ  (SIB2)--->][MAC_UE]\n");
-    msg ("[RRC-UE-FRONTEND] Parameters : Mod_id %d, eNB_flag %d, UE_index %d, eNB_index %d \n",Mod_id, eNB_flag, UE_index, eNB_index);
-#endif
-    // After Decoding SIB2 (l. 1363)
-    /*       rrc_mac_config_req(Mod_id,0,0,eNB_index,
-      &UE_rrc_inst[Mod_id].sib2[eNB_index]->radioResourceConfigCommon,
-      (struct PhysicalConfigDedicated *)NULL,
-      (MeasObjectToAddMod_t **)NULL,
-      (MAC_MainConfig_t *)NULL,
-      0,
-      (struct LogicalChannelConfig *)NULL,
-      (MeasGapConfig_t *)NULL,
-      (TDD_Config_t *)NULL,
-      NULL,
-      NULL,
-      UE_rrc_inst[Mod_id].sib2[eNB_index]->freqInfo.ul_CarrierFreq,
-      UE_rrc_inst[Mod_id].sib2[eNB_index]->freqInfo.ul_Bandwidth,
-      &UE_rrc_inst[Mod_id].sib2[eNB_index]->freqInfo.additionalSpectrumEmission,
-      UE_rrc_inst[Mod_id].sib2[eNB_index]->mbsfn_SubframeConfigList
-    #ifdef Rel10
-      ,
-      0,
-      (MBSFN_AreaInfoList_r9_t *)NULL,
-      (PMCH_InfoList_r9_t *)NULL
-    #endif
-      ); */
-
-    rrc_mac_config_req(Mod_id,eNB_flag,UE_index,eNB_index,
-                       //       &UE_rrc_inst[Mod_id].sib2[eNB_index]->radioResourceConfigCommon,
-                       (RadioResourceConfigCommonSIB_t *)&protocol_ms->rrc.ue_bch_asn1.sib2->radioResourceConfigCommon,
-                       NULL, // (struct PhysicalConfigDedicated *)
-                       (MeasObjectToAddMod_t **)NULL,
-                       NULL, //(MAC_MainConfig_t *)
-                       0,
-                       NULL, //(struct LogicalChannelConfig *)
-                       NULL, // (MeasGapConfig_t *)
-                       NULL, //(TDD_Config_t *)
-                       NULL,
-                       NULL,
-                       protocol_ms->rrc.ue_bch_asn1.sib2->freqInfo.ul_CarrierFreq,
-                       protocol_ms->rrc.ue_bch_asn1.sib2->freqInfo.ul_Bandwidth,
-                       &protocol_ms->rrc.ue_bch_asn1.sib2->freqInfo.additionalSpectrumEmission,
-                       protocol_ms->rrc.ue_bch_asn1.sib2->mbsfn_SubframeConfigList
-#ifdef Rel10
-                       , 0,
-                       (MBSFN_AreaInfoList_r9_t *)NULL,
-                       (PMCH_InfoList_r9_t *)NULL
-#endif
-                      );
-
-
-#ifdef DEBUG_RRC_STATE
-    msg ("\n[RRC-UE-FRONTEND] rrc_ue_config_common_channels - END\n\n");
-#endif
-  }
-}
-
-//-----------------------------------------------------------------------------
-void rrc_ue_xmit_ccch (void)
-{
-  //-----------------------------------------------------------------------------
-  u8 i=0,rv[6];
-  //char ccch_buffer[100];
-  //int ccch_buffer_size;
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC-UE-FRONTEND] rrc_ue_xmit_ccch\n");
-#endif
-
-  if(protocol_ms->rrc.ccch_buffer_size ==0) {
-
-    for (i=0; i<6; i++) {
-      rv[i]=i+rrc_ue_mobileId;
-    }
-
-    protocol_ms->rrc.ccch_buffer_size = do_RRCConnectionRequest((u8 *)protocol_ms->rrc.ccch_buffer,rv);
-  }
-}
-
-//-----------------------------------------------------------------------------
-void rrc_ue_config_LTE_srb1 (void)
-{
-  //-----------------------------------------------------------------------------
-  //  char Mod_id = protocol_ms->rrc.mod_id;
-  char Mod_id = rrc_ue_mobileId;
-  int UE_index = rrc_ue_mobileId;
-  int eNB_index = 0;
-  int eNB_flag = 0; //1=eNB, 0=UE
-  int srb1 = 1;
-  char buffer[1024];
-  //LogicalChannelConfig_t *SRB1_logicalChannelConfig,*SRB2_logicalChannelConfig;
-
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC-UE-FRONTEND] rrc_ue_config_LTE_srb1\n");
-#endif
-
-  // get the parameters values SRB1_config, SRB2_config, physicalConfigDedicated
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC-UE-FRONTEND] do_RRCConnectionSetup\n");
-#endif
-  do_RRCConnectionSetup(buffer,
-                        //mac_xface->get_transmission_mode(Mod_id,find_UE_RNTI(Mod_id,UE_index)),
-                        1,  // TEMP - hardcoded in UE
-                        UE_index,0,
-                        mac_xface->lte_frame_parms,
-                        //&eNB_rrc_inst[Mod_id].SRB1_config[UE_index],
-                        //&protocol_ms->rrc.ue_rb_asn1.SRB1_config,
-                        //&eNB_rrc_inst[Mod_id].SRB2_config[UE_index],
-                        //&protocol_ms->rrc.ue_rb_asn1.SRB2_config,
-                        &protocol_ms->rrc.ue_rb_asn1.SRB_configList[UE_index],
-                        //&eNB_rrc_inst[Mod_id].physicalConfigDedicated[UE_index]);
-                        &protocol_ms->rrc.ue_rb_asn1.physicalConfigDedicated);
-
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC-UE-FRONTEND] SRB1_logicalChannelConfig\n");
-#endif
-  // get the parameters values SRB1_logicalChannelConfig
-  // Default value set as global variable
-  protocol_ms->rrc.ue_rb_asn1.SRB1_logicalChannelConfig = &SRB1_logicalChannelConfig_defaultValue;
-
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC-UE-FRONTEND] MAC_CONFIG_REQ  (SRB1 UE %d)--->][MAC_eNB]\n", UE_index);
-  msg ("[RRC-UE-FRONTEND] Parameters : Mod_id %d, eNB_flag %d, UE_index %d, eNB_index %d \n",Mod_id, eNB_flag, UE_index, eNB_index);
-#endif
-  //Apply configurations to MAC and RLC for SRB1 and SRB2
-  /*
-  UE:   rrc_mac_config_req(Mod_id,0,0,eNB_index,
-         (RadioResourceConfigCommonSIB_t *)NULL,
-         UE_rrc_inst[Mod_id].physicalConfigDedicated[eNB_index],
-         UE_rrc_inst[Mod_id].mac_MainConfig[eNB_index],
-         1,
-         SRB1_logicalChannelConfig,
-         (MeasGapConfig_t *)NULL,
-         NULL,
-         NULL,
-         NULL);
-  }
-  */
-
-  rrc_mac_config_req(Mod_id,eNB_flag,UE_index,eNB_index,  //OK
-                     (RadioResourceConfigCommonSIB_t *)NULL,  //OK
-                     //(PhysicalConfigDedicated_t *)&protocol_ms->rrc.ue_rb_asn1.physicalConfigDedicated,  //OK
-                     protocol_ms->rrc.ue_rb_asn1.physicalConfigDedicated,  //OK
-                     (MeasObjectToAddMod_t **)NULL,
-                     //(MAC_MainConfig_t*)&protocol_ms->rrc.ue_rb_asn1.mac_MainConfig,  //OK = NULL
-                     (MAC_MainConfig_t*)NULL,
-                     srb1, //logicalChannelIdentity  //OK
-                     protocol_ms->rrc.ue_rb_asn1.SRB1_logicalChannelConfig,  //OK
-                     protocol_ms->rrc.ue_rb_asn1.measGapConfig, //OK = NULL
-                     //(MeasGapConfig_t *)NULL, //OK = NULL
-                     (TDD_Config_t *)NULL, //OK
-                     (u8 *)NULL,  //OK
-                     (u16 *)NULL, //OK
-                     NULL,
-                     NULL,
-                     NULL,
-                     (MBSFN_SubframeConfigList_t *)NULL
-#ifdef Rel10
-                     , 0,
-                     (MBSFN_AreaInfoList_r9_t *)NULL,
-                     (PMCH_InfoList_r9_t *)NULL
-#endif
-                    );
-
-  msg("[UE %d], CONFIG_SRB1 %d corresponding to eNB_index %d\n", Mod_id,srb1,eNB_index);
-  msg ("[RRC-UE-FRONTEND] Parameters : Mod_id %d, eNB_flag %d, UE_index %d, NB_eNB_INST %d \n",Mod_id, eNB_flag, UE_index, NB_eNB_INST);
-  //   rrc_pdcp_config_req (Mod_id+NB_eNB_INST, protocol_ms->rrc.current_SFN, eNB_flag, ACTION_ADD, srb1);
-  //   rrc_rlc_config_req(Mod_id+NB_eNB_INST, protocol_ms->rrc.current_SFN, eNB_flag, ACTION_ADD, srb1, SIGNALLING_RADIO_BEARER, Rlc_info_am_config);
-  rrc_pdcp_config_asn1_req(Mod_id,UE_index,protocol_ms->rrc.current_SFN,eNB_flag,
-                           protocol_ms->rrc.ue_rb_asn1.SRB_configList[UE_index],
-                           (DRB_ToAddModList_t*)NULL,
-                           (DRB_ToReleaseList_t*)NULL
-#ifdef Rel10
-                           ,(MBMS_SessionInfoList_r9_t *)NULL
-#endif
-                          );
-
-  rrc_rlc_config_asn1_req(Mod_id+NB_eNB_INST,protocol_ms->rrc.current_SFN,eNB_flag,UE_index,
-                          protocol_ms->rrc.ue_rb_asn1.SRB_configList[UE_index],
-                          (DRB_ToAddModList_t*)NULL,
-                          (DRB_ToReleaseList_t*)NULL
-#ifdef Rel10
-                          ,(MBMS_SessionInfoList_r9_t *)NULL
-#endif
-                         );
-
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC-UE-FRONTEND] rrc_ue_config_LTE_srb1 - END\n\n");
-#endif
-}
-
-//-----------------------------------------------------------------------------
-void rrc_ue_config_LTE_srb2 (void)
-{
-  //-----------------------------------------------------------------------------
-  char Mod_id = protocol_ms->rrc.mod_id;
-  int UE_index = rrc_ue_mobileId;
-  int eNB_index = 0;
-  int eNB_flag = 0; //1=eNB, 0=UE
-  int srb2 = 2;
-  //char buffer[1024];
-  //LogicalChannelConfig_t *SRB1_logicalChannelConfig,*SRB2_logicalChannelConfig;
-
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC-UE-FRONTEND] rrc_ue_config_LTE_srb2\n");
-#endif
-
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC-UE-FRONTEND] SRB2_logicalChannelConfig\n");
-#endif
-  // get the parameters values SRB1_logicalChannelConfig SRB2_logicalChannelConfig
-  // Default value set as global variable
-  protocol_ms->rrc.ue_rb_asn1.SRB2_logicalChannelConfig = &SRB2_logicalChannelConfig_defaultValue;
-
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC-UE-FRONTEND] MAC_CONFIG_REQ  (SRB2 UE 0)--->][MAC_eNB]\n");
-  msg ("[RRC-UE-FRONTEND] Parameters : Mod_id %d, eNB_flag %d, UE_index %d, eNB_index %d \n",Mod_id, eNB_flag, UE_index, eNB_index);
-#endif
-  rrc_mac_config_req(Mod_id,eNB_flag,UE_index,eNB_index,  //OK
-                     (RadioResourceConfigCommonSIB_t *)NULL,  //OK
-                     protocol_ms->rrc.ue_rb_asn1.physicalConfigDedicated,
-                     (MeasObjectToAddMod_t **)NULL,
-                     //(MAC_MainConfig_t*)&protocol_ms->rrc.ue_rb_asn1.mac_MainConfig,  //OK = NULL
-                     (MAC_MainConfig_t*)NULL,
-                     srb2, //logicalChannelIdentity  //OK
-                     protocol_ms->rrc.ue_rb_asn1.SRB2_logicalChannelConfig,  //OK
-                     //(MeasGapConfig_t *)&protocol_ms->rrc.ue_rb_asn1.measGapConfig, //OK = NULL
-                     (MeasGapConfig_t *)NULL, //OK = NULL
-                     (TDD_Config_t *)NULL, //OK
-                     (u8 *)NULL,  //OK
-                     (u16 *)NULL, //OK
-                     NULL,
-                     NULL,
-                     NULL,
-                     (MBSFN_SubframeConfigList_t *)NULL
-#ifdef Rel10
-                     , 0,
-                     (MBSFN_AreaInfoList_r9_t *)NULL,
-                     (PMCH_InfoList_r9_t *)NULL
-#endif
-                    );
-
-  msg("[UE %d], CONFIG_SRB2 %d corresponding to eNB_index %d\n", Mod_id,srb2,eNB_index);
-  //   rrc_pdcp_config_req (Mod_id+NB_eNB_INST, protocol_ms->rrc.current_SFN, eNB_flag, ACTION_ADD, srb2);
-  //   rrc_rlc_config_req(Mod_id+NB_eNB_INST,protocol_ms->rrc.current_SFN,eNB_flag,ACTION_ADD,srb2,SIGNALLING_RADIO_BEARER,Rlc_info_am_config);
-  rrc_pdcp_config_asn1_req(Mod_id,UE_index,protocol_ms->rrc.current_SFN,eNB_flag,
-                           protocol_ms->rrc.ue_rb_asn1.SRB_configList[UE_index],
-                           (DRB_ToAddModList_t*)NULL,
-                           (DRB_ToReleaseList_t*)NULL
-#ifdef Rel10
-                           ,(MBMS_SessionInfoList_r9_t *)NULL
-#endif
-                          );
-
-  rrc_rlc_config_asn1_req(Mod_id+NB_eNB_INST,protocol_ms->rrc.current_SFN,eNB_flag,UE_index,
-                          protocol_ms->rrc.ue_rb_asn1.SRB_configList[UE_index],
-                          (DRB_ToAddModList_t*)NULL,
-                          (DRB_ToReleaseList_t*)NULL
-#ifdef Rel10
-                          ,(MBMS_SessionInfoList_r9_t *)NULL
-#endif
-                         );
-
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC-UE-FRONTEND] rrc_ue_config_LTE_srb2 - END\n\n");
-#endif
-}
-
-//-----------------------------------------------------------------------------
-void rrc_ue_config_LTE_default_drb (unsigned char Mod_id)
-{
-  //-----------------------------------------------------------------------------
-  int UE_index = rrc_ue_mobileId;
-  int eNB_index = 0;
-  int eNB_flag = 0; //1=eNB, 0=UE
-  int drb_ix=0;  // default DRB
-  u8 buffer[100];
-  u8 size;
-  u8 DRB2LCHAN[8];
-  //DL_DCCH_Message_t *dl_dcch_msg=NULL;//&dldcchmsg;
-  struct PhysicalConfigDedicated  physicalConfigDedicated_drb;
-
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC-UE-FRONTEND] rrc_ue_config_LTE_default_drb: begin\n");
-#endif
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC-UE-FRONTEND] do_RRCConnReconf_defaultCELL\n");
-#endif
-
-  size = do_RRCConnReconf_defaultCELL(Mod_id, buffer, UE_index, 0,
-                                      //&eNB_rrc_inst[Mod_id].SRB2_config[UE_index],
-                                      &protocol_ms->rrc.ue_rb_asn1.SRB_configList[UE_index],
-                                      //&eNB_rrc_inst[Mod_id].DRB_config[UE_id][0],
-                                      &protocol_ms->rrc.ue_rb_asn1.DRB_configList[UE_index],
-                                      //&eNB_rrc_inst[Mod_id].physicalConfigDedicated[UE_index]);
-                                      //&protocol_ms->rrc.ue_rb_asn1.physicalConfigDedicated);
-                                      &physicalConfigDedicated_drb);
-
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC-UE-FRONTEND] do_DRB_UE_MAC_config_cell\n");
-#endif
-  do_DRB_UE_MAC_config_cell (&protocol_ms->rrc.ue_rb_asn1.mac_MainConfig);
-
-  if (protocol_ms->rrc.ue_rb_asn1.DRB_configList[UE_index]->list.array[0]) {
-
-    DRB2LCHAN[drb_ix] = (u8)*protocol_ms->rrc.ue_rb_asn1.DRB_configList[UE_index]->list.array[0]->logicalChannelIdentity;
-
-    //if (eNB_rrc_inst[Mod_id].DRB_config[UE_index][i]) {
-    msg("[RRC-UE-FRONTEND] rrc_ue_config_LTE_default_drb: reconfiguring DRB %d/LCID %d, DRB2LCHAN %d\n",
-        (int)protocol_ms->rrc.ue_rb_asn1.DRB_configList[UE_index]->list.array[0]->drb_Identity,
-        (int)*protocol_ms->rrc.ue_rb_asn1.DRB_configList[UE_index]->list.array[0]->logicalChannelIdentity, (int) DRB2LCHAN[drb_ix]);
-
-    if (protocol_ms->rrc.ue_rb_asn1.DRB1_active == 0) {
-      msg("[RRC-UE-FRONTEND] rrc_ue_config_LTE_default_drb: Frame %d: Establish PDCP + RLC UM Bidirectional, DRB %d Active\n",
-          protocol_ms->rrc.current_SFN, (int)protocol_ms->rrc.ue_rb_asn1.DRB_configList[UE_index]->list.array[0]->drb_Identity);
-
-      /*      rrc_pdcp_config_req (Mod_id+NB_eNB_INST, protocol_ms->rrc.current_SFN, eNB_flag, ACTION_ADD,
-                                  (UE_index * NB_RB_MAX) + (int)*protocol_ms->rrc.ue_rb_asn1.DRB1_config->logicalChannelIdentity);
-            rrc_rlc_config_req(Mod_id+NB_eNB_INST,protocol_ms->rrc.current_SFN,eNB_flag,ACTION_ADD,
-                                (UE_index * NB_RB_MAX) + (int)*protocol_ms->rrc.ue_rb_asn1.DRB1_config->logicalChannelIdentity,
-                                RADIO_ACCESS_BEARER,Rlc_info_um);*/
-      rrc_pdcp_config_asn1_req(Mod_id,UE_index,protocol_ms->rrc.current_SFN,eNB_flag,
-                               (SRB_ToAddModList_t*)NULL,
-                               protocol_ms->rrc.ue_rb_asn1.DRB_configList[UE_index],
-                               (DRB_ToReleaseList_t*)NULL
-#ifdef Rel10
-                               ,(MBMS_SessionInfoList_r9_t *)NULL
-#endif
-                              );
-      rrc_rlc_config_asn1_req(Mod_id+NB_eNB_INST,protocol_ms->rrc.current_SFN,eNB_flag,UE_index,
-                              (SRB_ToAddModList_t*)NULL,
-                              protocol_ms->rrc.ue_rb_asn1.DRB_configList[UE_index],
-                              (DRB_ToReleaseList_t*)NULL
-#ifdef Rel10
-                              ,(MBMS_SessionInfoList_r9_t *)NULL
-#endif
-                             );
-      protocol_ms->rrc.ue_rb_asn1.DRB1_active = 1;
-
-      msg("[RRC-UE-FRONTEND] rrc_ue_config_LTE_default_drb:[--- MAC_CONFIG_REQ  (DRB UE %d) --->][MAC_eNB]\n", UE_index);
-      msg("[RRC-UE-FRONTEND] Parameters : Mod_id %d, eNB_flag %d, UE_index %d, eNB_index %d \n",Mod_id, eNB_flag, UE_index, eNB_index);
-      //DRB2LCHAN[drb_ix] = (u8)*protocol_ms->rrc.ue_rb_asn1.DRB1_config->logicalChannelIdentity;
-
-      rrc_mac_config_req(Mod_id,eNB_flag,UE_index,eNB_index,
-                         (RadioResourceConfigCommonSIB_t *)NULL,
-                         protocol_ms->rrc.ue_rb_asn1.physicalConfigDedicated,
-                         (MeasObjectToAddMod_t **)NULL,
-                         (MAC_MainConfig_t*)&protocol_ms->rrc.ue_rb_asn1.mac_MainConfig,
-                         DRB2LCHAN[drb_ix],
-                         protocol_ms->rrc.ue_rb_asn1.DRB_configList[UE_index]->list.array[0]->logicalChannelConfig,
-                         (MeasGapConfig_t *)&protocol_ms->rrc.ue_rb_asn1.measGapConfig,
-                         (TDD_Config_t *)NULL,
-                         (u8 *)NULL,
-                         (u16 *)NULL, //OK
-                         NULL,
-                         NULL,
-                         NULL,
-                         (MBSFN_SubframeConfigList_t *)NULL
-#ifdef Rel10
-                         , 0,
-                         (MBSFN_AreaInfoList_r9_t *)NULL,
-                         (PMCH_InfoList_r9_t *)NULL
-#endif
-                        );
-
-    } else { // remove LCHAN from MAC/PHY
-      // Initialized here because it is a local variable (global in RRC Lite)
-      //DRB2LCHAN[drb_ix] = (u8)*protocol_ms->rrc.ue_rb_asn1.DRB1_config->logicalChannelIdentity;
-      if (protocol_ms->rrc.ue_rb_asn1.DRB1_active ==1) {
-        // DRB has just been removed so remove RLC + PDCP for DRB
-        msg("[RRC-UE-FRONTEND] rrc_ue_config_LTE_default_drb: Frame %d: Remove PDCP + RLC UM Bidirectional, DRB 0 \n",
-            //protocol_ms->rrc.current_SFN, (int)protocol_ms->rrc.ue_rb_asn1.DRB1_config->drb_Identity);
-            protocol_ms->rrc.current_SFN);
-        msg("                  COMMENTED - not yet supported with ASN1 \n");
-
-        /*        rrc_pdcp_config_req (Mod_id+NB_eNB_INST, protocol_ms->rrc.current_SFN, eNB_flag, ACTION_REMOVE,
-                                      (UE_index * NB_RB_MAX) + DRB2LCHAN[drb_ix]);*/
-        /*        rrc_rlc_config_req(Mod_id+NB_eNB_INST,protocol_ms->rrc.current_SFN,eNB_flag,ACTION_REMOVE,
-                                    (UE_index * NB_RB_MAX) + DRB2LCHAN[drb_ix],
-                                    RADIO_ACCESS_BEARER,Rlc_info_um);*/
-      }
-
-      protocol_ms->rrc.ue_rb_asn1.DRB1_active = 0;
-      msg("[RRC-UE-FRONTEND] rrc_ue_config_LTE_default_drb:[--- MAC_CONFIG_REQ  (DRB UE %d) --->][MAC_eNB]\n", UE_index);
-      msg ("[RRC-UE-FRONTEND] Parameters : Mod_id %d, eNB_flag %d, UE_index %d, eNB_index %d \n",Mod_id, eNB_flag, UE_index, eNB_index);
-      rrc_mac_config_req(Mod_id,eNB_flag,UE_index,eNB_index,
-                         (RadioResourceConfigCommonSIB_t *)NULL,
-                         protocol_ms->rrc.ue_rb_asn1.physicalConfigDedicated,
-                         (MeasObjectToAddMod_t **)NULL,
-                         (MAC_MainConfig_t*)&protocol_ms->rrc.ue_rb_asn1.mac_MainConfig,
-                         DRB2LCHAN[drb_ix],
-                         (LogicalChannelConfig_t *)NULL,
-                         (MeasGapConfig_t *)NULL,
-                         (TDD_Config_t *)NULL,
-                         (u8 *)NULL,
-                         (u16 *)NULL, //OK
-                         NULL,
-                         NULL,
-                         NULL,
-                         (MBSFN_SubframeConfigList_t *)NULL
-#ifdef Rel10
-                         , 0,
-                         (MBSFN_AreaInfoList_r9_t *)NULL,
-                         (PMCH_InfoList_r9_t *)NULL
-#endif
-                        );
-    }
-  }
-}
-
diff --git a/openair2/RRC/CELLULAR/rrc_ue_L2_interface.c b/openair2/RRC/CELLULAR/rrc_ue_L2_interface.c
deleted file mode 100755
index a549790a55..0000000000
--- a/openair2/RRC/CELLULAR/rrc_ue_L2_interface.c
+++ /dev/null
@@ -1,390 +0,0 @@
-/***************************************************************************
-                          rrc_ue_L2_interface.c  -
-                          -------------------
-    begin                : Sept 9, 2008
-    copyright            : (C) 2008, 2010 by Eurecom
-    created by           : michelle.wetterwald@eurecom.fr
-    description
- **************************************************************************
-    Entry point for L2 interfaces
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "COMMON/openair_defs.h"
-#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
-#include "LAYER2/RLC/rlc.h"
-#include "COMMON/mac_rrc_primitives.h"
-#include "UTIL/MEM/mem_block.h"
-
-//#include "SIMULATION/simulation_defs.h"
-//extern EMULATION_VARS *Emul_vars;
-//extern CH_MAC_INST *CH_mac_inst;
-//extern UE_MAC_INST *UE_mac_inst;
-/********************
-// RRC definitions
- ********************/
-#include "rrc_ue_vars.h"
-//-----------------------------------------------------------------------------
-#include "rrc_L2_proto.h"
-#include "rrc_proto_bch.h"
-//-----------------------------------------------------------------------------
-extern LCHAN_DESC BCCH_LCHAN_DESC,CCCH_LCHAN_DESC, DCCH_LCHAN_DESC, DTCH_DL_LCHAN_DESC,DTCH_UL_LCHAN_DESC;
-extern rlc_info_t Rlc_info_um;
-extern rlc_info_t Rlc_info_am_config;
-
-//-----------------------------------------------------------------------------
-s8 rrc_L2_data_req_rx (unsigned char Mod_id, unsigned short Srb_id, unsigned char Nb_tb,char *Buffer,u8 CH_index)
-{
-  //-----------------------------------------------------------------------------
-  unsigned char br_size=0;
-
-#ifdef DEBUG_RRC_BROADCAST
-  msg ("\n[RRC CELL][L2_INTF] rrc_L2_data_req_rx - begin - UE => Rcve only in BCCH\n");
-  msg ("Received parameters Mod_id %d, Srb_id %d, nb_tb %d, CH_index %d\n",Mod_id, Srb_id,Nb_tb,CH_index);
-#endif
-
-  if( protocol_ms->rrc.ccch_buffer_size > 0) {
-#ifdef DEBUG_RRC_STATE
-    msg ("\n[RRC CELL][L2_INTF] rrc_L2_data_req_rx - begin - Fill CCCH\n");
-    msg ("Received parameters Mod_id %d, Srb_id %d, nb_tb %d, CH_index %d\n",Mod_id, Srb_id,Nb_tb,CH_index);
-    msg ("CCCH buffer size %d\n",protocol_ms->rrc.ccch_buffer_size);
-#endif
-    memcpy(&Buffer[0],&protocol_ms->rrc.ccch_buffer[0],protocol_ms->rrc.ccch_buffer_size);
-    br_size = protocol_ms->rrc.ccch_buffer_size;
-    protocol_ms->rrc.ccch_buffer_size = 0;
-  }
-
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC CELL][L2_INTF] rrc_L2_data_req_rx - end, return %d\n", br_size);
-#endif
-  return br_size;
-}
-
-//-----------------------------------------------------------------------------
-s8 rrc_L2_mac_data_ind_rx (u8 Mod_id, u16 Srb_id, char *Sdu, u16 Sdu_len, u8 eNB_index)
-{
-  //-----------------------------------------------------------------------------
-
-  int rxStatus=0;
-
-  if((Srb_id & RAB_OFFSET) == BCCH) {
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-    msg ("\n[RRC CELL][L2_INTF] rrc_L2_mac_data_ind_rx - begin - BCCH\n");
-    //msg ("Received parameters Mod_id %d, Srb_id %d, CH_index %d\n",Mod_id, Srb_id,CH_index);
-#endif
-    rrc_broadcast_rx (Sdu);
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-    msg ("\n[RRC CELL][L2_INTF] rrc_L2_mac_data_ind_rx - end\n");
-#endif
-  } else if( (Srb_id & RAB_OFFSET ) == CCCH) {
-#ifdef DEBUG_RRC_STATE
-    msg ("\n[RRC CELL][L2_INTF] rrc_L2_mac_data_ind_rx - begin - CCCH\n");
-    msg ("Received parameters Mod_id %d, eNB_index %d, SDU length %d\n", Mod_id, eNB_index, Sdu_len);
-#endif
-    // temp - establish srb1-srb2
-    rrc_ue_config_LTE_srb1();
-
-  } else msg ("\n[RRC CELL][L2_INTF] rrc_L2_mac_data_ind_rx, Srb_id %d unexpected \n" , Srb_id);
-
-  return rxStatus;
-}
-
-//-----------------------------------------------------------------------------
-void rrc_L2_rlc_data_ind_rx (unsigned char Mod_id, unsigned int Srb_id, unsigned int Sdu_size,unsigned char *Buffer)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_DETAILS_2
-  msg ("\n[RRC][L2_INTF] rrc_L2_rlc_data_ind_rx - begin\n");
-#endif
-  //rrc_ue_test_rlc_intf_rcve (Buffer, Srb_id);
-  rrc_ue_receive_from_srb_rlc (Buffer, Srb_id, Sdu_size);
-}
-
-//-----------------------------------------------------------------------------
-void rrc_L2_rlc_confirm_ind_rx (unsigned char Mod_id, unsigned int Srb_id, unsigned int mui)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_DETAILS_2
-  msg ("\n[RRC][L2_INTF] rrc_L2_rlc_confirm_ind_rx - begin\n");
-#endif
-  //void* rrc_srb_confirm (u32 muiP, u8 rb_idP, u8 statusP);
-  rrc_ue_srb_confirm (mui, Srb_id, 0);
-}
-
-//-----------------------------------------------------------------------------
-void rrc_L2_mac_meas_ind_rx (void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_DETAILS
-  msg ("\n[RRC][L2_INTF] rrc_L2_mac_meas_ind_rx - begin\n");
-#endif
-}
-
-//-----------------------------------------------------------------------------
-void rrc_L2_def_meas_ind_rx (unsigned char Mod_id, unsigned char Idx2)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_DETAILS
-  msg ("\n[RRC][L2_INTF] rrc_L2_def_meas_ind_rx - begin\n");
-#endif
-}
-
-//-----------------------------------------------------------------------------
-void rrc_L2_sync_ind_rx (u8 Mod_id)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_DETAILS
-  if (!protocol_ms->rrc.current_SFN %100 )
-    msg ("\n[RRC][L2_INTF] rrc_L2_sync_ind_rx at frame %d \n", protocol_ms->rrc.current_SFN);
-
-#endif
-}
-
-//-----------------------------------------------------------------------------
-void rrc_L2_out_sync_ind_rx (void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_DETAILS
-  msg ("\n[RRC][L2_INTF] rrrc_L2_out_sync_ind_rx - begin\n");
-#endif
-}
-
-//-----------------------------------------------------------------------------
-int rrc_L2_get_rrc_status(u8 Mod_id,u8 eNB_flag,u8 index)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_DETAILS
-  msg ("\n[RRC][L2_INTF] rrc_L2_get_rrc_status - begin\n");
-#endif
-  /*
-    if(eNB_flag == 1)
-      return(eNB_rrc_inst[Mod_id].Info.Status[index]);
-    else
-      return(UE_rrc_inst[Mod_id].Info[index].Status);
-  */
-  return 0;
-}
-
-//-----------------------------------------------------------------------------
-char rrc_L2_ue_init(u8 Mod_id, unsigned char eNB_index)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_DETAILS
-  msg ("\n[RRC][L2_INTF] rrc_L2_ue_init - begin\n");
-#endif
-  rrc_ue_init (Mod_id);
-  return 0;
-}
-
-
-//-----------------------------------------------------------------------------
-char rrc_L2_eNB_init(u8 Mod_id)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_DETAILS
-  msg ("\n[RRC][L2_INTF] rrc_L2_eNB_init - begin\n");
-#endif
-  rrc_ue_rglite_init(Mod_id, 0);
-  return 0;
-}
-
-//-----------------------------------------------------------------------------
-// Out of openair_rrc_L2_interface.c
-void openair_rrc_lite_top_init(void)
-{
-  //-----------------------------------------------------------------------------
-  //#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC CELL] [L2_INTF] openair_rrc_lite_top_init - Empty function to keep compatibility with RRC LITE\n\n");
-  //#endif
-}
-
-//-----------------------------------------------------------------------------
-RRC_status_t rrc_rx_tx(u8 Mod_id,u32 frame, u8 eNB_flag,u8 index)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_DETAILS
-  // msg ("\n[RRC][L2_INTF] rrc_rx_tx - begin %d \n", frame);
-#endif
-  // call RRC only if new frame number
-  if (frame > protocol_ms->rrc.current_SFN) {
-    protocol_ms->rrc.current_SFN = frame;
-    rrc_ue_main_scheduler(Mod_id, protocol_ms->rrc.current_SFN, 0, index);
-  }
-
-  return 0;
-}
-
-/*------------------------------------------------------------------------------*/
-// Dummy function - to keep compatibility with RRC LITE
-char rrc_ue_rglite_init(u8 Mod_id, unsigned char eNB_index)
-{
-  /*------------------------------------------------------------------------------*/
-  //#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC CELL] Called rrc_ue_rglite_init - Dummy function - to keep compatibility with RRC LITE\n\n");
-  //#endif
-  return 0;
-}
-
-/*------------------------------------------------------------------------------*/
-// Send config to the MAC Layer
-void rrc_init_mac_config(void)
-{
-  /*------------------------------------------------------------------------------*/
-  MAC_CONFIG_REQ Mac_config_req;
-  int UE_index,Idx;
-
-  // The content of this function has been commented on 23/03/2012
-  printk("\n rrc_init_mac_config -- WORK IN PROGRESS\n");
-
-  // Test config on 02/04/2012
-  BCCH_LCHAN_DESC.transport_block_size=BCCH_PAYLOAD_SIZE_MAX;
-  BCCH_LCHAN_DESC.max_transport_blocks=15;//MAX 16 (4bits for Seq_id)
-
-  DCCH_LCHAN_DESC.transport_block_size=4;
-  DCCH_LCHAN_DESC.max_transport_blocks=16;
-  DCCH_LCHAN_DESC.Delay_class=1;
-  DTCH_DL_LCHAN_DESC.transport_block_size=52;
-  DTCH_DL_LCHAN_DESC.max_transport_blocks=20;
-  DTCH_DL_LCHAN_DESC.Delay_class=1;
-  DTCH_UL_LCHAN_DESC.transport_block_size=52;
-  DTCH_UL_LCHAN_DESC.max_transport_blocks=20;
-  DTCH_UL_LCHAN_DESC.Delay_class=1;
-
-  // Config copied from RRC LITE on 02/04/2012
-  Rlc_info_um.rlc_mode=RLC_UM;
-  Rlc_info_um.rlc.rlc_um_info.timer_reordering=0;
-  Rlc_info_um.rlc.rlc_um_info.sn_field_length=10;
-  Rlc_info_um.rlc.rlc_um_info.is_mXch=0;
-  //Rlc_info_um.rlc.rlc_um_info.sdu_discard_mode=16;
-
-  Rlc_info_am_config.rlc_mode=RLC_AM;
-  Rlc_info_am_config.rlc.rlc_am_info.max_retx_threshold = 255;
-  Rlc_info_am_config.rlc.rlc_am_info.poll_pdu           = 8;
-  Rlc_info_am_config.rlc.rlc_am_info.poll_byte          = 1000;
-  Rlc_info_am_config.rlc.rlc_am_info.t_poll_retransmit  = 15;
-  Rlc_info_am_config.rlc.rlc_am_info.t_reordering       = 5000;
-  Rlc_info_am_config.rlc.rlc_am_info.t_status_prohibit  = 10;
-
-}
-
-/*------------------------------------------------------------------------------*/
-// Send config to the MAC Layer
-void rrc_init_mac_default_param(void)
-{
-  /*------------------------------------------------------------------------------*/
-
-  // The following code has been commented on 23/03/2012
-  printk("\n rrc_init_mac_default_param -- COMMENTED\n");
-
-  /*
-  BCCH_LCHAN_DESC.transport_block_size=BCCH_PAYLOAD_SIZE_MAX;
-  BCCH_LCHAN_DESC.max_transport_blocks=15;//MAX 16 (4bits for Seq_id)
-
-  CCCH_LCHAN_DESC.transport_block_size=CCCH_PAYLOAD_SIZE_MAX;
-  CCCH_LCHAN_DESC.max_transport_blocks=15;//MAX 16 (4bits for Seq_id)
-
-  //   BCCH_LCHAN_DESC.transport_block_size=30;//+CH_BCCH_HEADER_SIZE;
-  //   BCCH_LCHAN_DESC.max_transport_blocks=15;//MAX 16 (4bits for Seq_id)
-  //   CCCH_LCHAN_DESC.transport_block_size=30;//+CH_CCCH_HEADER_SIZE;
-  //   CCCH_LCHAN_DESC.max_transport_blocks=15;//MAX 16 (4bits for Seq_id)
-   DCCH_LCHAN_DESC.transport_block_size=40;//+CH_BCCH_HEADER_SIZE;
-   DCCH_LCHAN_DESC.max_transport_blocks=20;
-   DTCH_LCHAN_DESC.transport_block_size=40;//120;//200;//+CH_BCCH_HEADER_SIZE;
-   DTCH_LCHAN_DESC.max_transport_blocks=20;
-  //
-   Rlc_info_um.rlc_mode=RLC_UM;
-   Rlc_info_um.rlc.rlc_um_info.timer_discard=0;
-   Rlc_info_um.rlc.rlc_um_info.sdu_discard_mode=16;
-  //
-  Rlc_info_am.rlc_mode=RLC_AM;
-  Rlc_info_am.rlc.rlc_am_info.sdu_discard_mode      = SDU_DISCARD_MODE_RESET;
-  Rlc_info_am.rlc.rlc_am_info.timer_poll            = 0;
-  Rlc_info_am.rlc.rlc_am_info.timer_poll_prohibit   = 0;
-  Rlc_info_am.rlc.rlc_am_info.timer_discard         = 1000*10;
-  Rlc_info_am.rlc.rlc_am_info.timer_poll_periodic   = 0;
-  Rlc_info_am.rlc.rlc_am_info.timer_status_prohibit = 0;
-  Rlc_info_am.rlc.rlc_am_info.timer_status_periodic = 250*10;
-  Rlc_info_am.rlc.rlc_am_info.timer_rst             = 100*10;
-  Rlc_info_am.rlc.rlc_am_info.max_rst               = 8;
-  Rlc_info_am.rlc.rlc_am_info.timer_mrw             = 60*10;
-
-  Rlc_info_am.rlc.rlc_am_info.pdu_size              = 320; // in bits
-  //Rlc_info_am.rlc.rlc_am_info.in_sequence_delivery  = 1;//boolean
-  Rlc_info_am.rlc.rlc_am_info.max_dat               = 63;
-  Rlc_info_am.rlc.rlc_am_info.poll_pdu              = 16;
-  Rlc_info_am.rlc.rlc_am_info.poll_sdu              = 1;
-  Rlc_info_am.rlc.rlc_am_info.poll_window           = 50;
-  Rlc_info_am.rlc.rlc_am_info.tx_window_size        = 128;
-  Rlc_info_am.rlc.rlc_am_info.rx_window_size        = 128;
-  Rlc_info_am.rlc.rlc_am_info.max_mrw               = 8;
-
-  Rlc_info_am.rlc.rlc_am_info.last_transmission_pdu_poll_trigger   = 1;//boolean
-  Rlc_info_am.rlc.rlc_am_info.last_retransmission_pdu_poll_trigger = 1;//boolean
-  Rlc_info_am.rlc.rlc_am_info.send_mrw              = 0;//boolean*
-  */
-
-  // Config copied from RRC LITE on 02/04/2012
-  Rlc_info_um.rlc_mode=RLC_UM;
-  Rlc_info_um.rlc.rlc_um_info.timer_reordering=0;
-  Rlc_info_um.rlc.rlc_um_info.sn_field_length=10;
-  Rlc_info_um.rlc.rlc_um_info.is_mXch=0;
-  //Rlc_info_um.rlc.rlc_um_info.sdu_discard_mode=16;
-
-  Rlc_info_am_config.rlc_mode=RLC_AM;
-  Rlc_info_am_config.rlc.rlc_am_info.max_retx_threshold = 255;
-  Rlc_info_am_config.rlc.rlc_am_info.poll_pdu           = 8;
-  Rlc_info_am_config.rlc.rlc_am_info.poll_byte          = 1000;
-  Rlc_info_am_config.rlc.rlc_am_info.t_poll_retransmit  = 15;
-  Rlc_info_am_config.rlc.rlc_am_info.t_reordering       = 5000;
-  Rlc_info_am_config.rlc.rlc_am_info.t_status_prohibit  = 10;
-}
-
-/*------------------------------------------------------------------------------*/
-//Entry function for RRC - MAC interface  init - Copied from RRC MESH (MW 09/09/2008)
-int rrc_init_global_param(void)
-{
-  /*------------------------------------------------------------------------------*/
-  //  Nb_mod=0;
-  //#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC CELL] Called rrc_init_global_param - Begin \n\n");
-  //#endif
-
-  /*
-  #ifdef USER_MODE
-   Rrc_xface = (RRC_XFACE*)malloc16(sizeof(RRC_XFACE));
-  #endif
-   Rrc_xface->openair_rrc_top_init = rrc_ue_toplite_init;
-   Rrc_xface->openair_rrc_eNB_init = rrc_ue_rglite_init;
-   Rrc_xface->openair_rrc_UE_init = rrc_ue_init;
-   Rrc_xface->mac_rrc_data_ind = mac_rrc_data_ind;
-   Rrc_xface->mac_rrc_data_req = mac_rrc_data_req;
-   Rrc_xface->rrc_data_indP    = rlcrrc_data_ind;
-   Rrc_xface->rrc_rx_tx        = rrc_ue_main_scheduler;
-   Rrc_xface->mac_rrc_meas_ind = mac_rrc_meas_ind;
-   Rrc_xface->def_meas_ind     = rrc_L2_def_meas_ind_rx;
-   Mac_rlc_xface->mac_out_of_sync_ind = mac_out_of_sync_ind;
-   printk("[RRC]INIT_GLOBAL_PARAM: Mac_rlc_xface %p, rrc_rlc_register %p,rlcrrc_data_ind %p\n",Mac_rlc_xface,Mac_rlc_xface->rrc_rlc_register_rrc,rlcrrc_data_ind);
-   if (Mac_rlc_xface==NULL || Mac_rlc_xface->rrc_rlc_register_rrc==NULL||rlcrrc_data_ind==NULL)
-     return -1;
-   //register with rlc -1st function= data_ind/srb_rx, 2nd function = srb_confirm
-   Mac_rlc_xface->rrc_rlc_register_rrc(rlcrrc_data_ind ,rrc_L2_rlc_confirm_ind_rx);
-
-   rrc_init_mac_default_param();
-   */
-
-  //register with rlc -1st function= data_ind/srb_rx, 2nd function = srb_confirm
-  printk("[RRC CELL]INIT_GLOBAL_PARAM: rrc_rlc_register_rrc %p,rlcrrc_data_ind %p, rrc_L2_rlc_confirm_ind_rx %p\n", rrc_rlc_register_rrc, rlcrrc_data_ind, rrc_L2_rlc_confirm_ind_rx );
-
-  if( rrc_rlc_register_rrc==NULL||rlcrrc_data_ind==NULL|| rrc_L2_rlc_confirm_ind_rx==NULL)
-    return -1;
-
-  rrc_rlc_register_rrc(rlcrrc_data_ind , rrc_L2_rlc_confirm_ind_rx);
-
-  return 0;
-}
-
-
-
-
diff --git a/openair2/RRC/CELLULAR/rrc_ue_L2_intf_variables.h b/openair2/RRC/CELLULAR/rrc_ue_L2_intf_variables.h
deleted file mode 100644
index 44d397ed40..0000000000
--- a/openair2/RRC/CELLULAR/rrc_ue_L2_intf_variables.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/***************************************************************************
-                          rrc_ue_L2_intf_variables.h  -  description
-                             -------------------
-    begin                : Aug 30, 2002
-    copyright            : (C) 2002, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Some additional definitions for UE broadcast
- ***************************************************************************/
-#ifndef __RRC_UE_L2INTF_H__
-#define __RRC_UE_L2INTF_H__
-
-#include "SystemInformationBlockType2.h"
-#include "SystemInformation.h"
-#include "BCCH-DL-SCH-Message.h"
-#include "TDD-Config.h"
-
-// RRC LTE standard asn1 compliant block
-struct rrc_ue_bch_asn1 {
-  u8 sizeof_SIB2;
-  u8 SIB23[128];
-  //BCCH_DL_SCH_Message_t siblock1;
-  BCCH_DL_SCH_Message_t systemInformation;
-  //SystemInformationBlockType1_t *sib1;
-  SystemInformationBlockType2_t *sib2;
-  //SystemInformationBlockType3_t *sib3;
-  TDD_Config_t tdd_Config;
-};
-
-/* Version RRC LITE !!!! RG
-struct rrc_rg_srb_drb_asn1{
-  struct SRB_ToAddMod             *SRB1_config[NB_CNX_eNB];
-  struct SRB_ToAddMod             *SRB2_config[NB_CNX_eNB];
-  struct DRB_ToAddMod             *DRB_config[NB_CNX_eNB][8];
-  u8                               DRB_active[NB_CNX_eNB][8];
-  struct PhysicalConfigDedicated  *physicalConfigDedicated[NB_CNX_eNB];
-  struct SPS_Config               *sps_Config[NB_CNX_eNB];
-  MAC_MainConfig_t                *mac_MainConfig[NB_CNX_eNB];
-  MeasGapConfig_t                 *measGapConfig[NB_CNX_eNB];
-};
-*/
-
-struct rrc_srb_drb_asn1 {
-  /*  struct SRB_ToAddMod             *SRB1_config;
-    struct SRB_ToAddMod             *SRB2_config;
-    struct DRB_ToAddMod             *DRB1_config;
-    struct DRB_ToAddMod             *DRB2_config;*/
-  int DRB1_active;
-  int DRB2_active;
-  SRB_ToAddModList_t   *SRB_configList[NUMBER_OF_UE_MAX];
-  DRB_ToAddModList_t   *DRB_configList[NUMBER_OF_UE_MAX];
-
-  struct PhysicalConfigDedicated  *physicalConfigDedicated;
-  //struct SPS_Config               *sps_Config[NB_CNX_eNB];
-  MAC_MainConfig_t                *mac_MainConfig;
-  MeasGapConfig_t                 *measGapConfig;
-  /* Logical channel config */
-  LogicalChannelConfig_t     *SRB1_logicalChannelConfig;
-  LogicalChannelConfig_t     *SRB2_logicalChannelConfig;
-};
-
-
-
-
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_ue_bch_process.c b/openair2/RRC/CELLULAR/rrc_ue_bch_process.c
deleted file mode 100755
index 2e44c18491..0000000000
--- a/openair2/RRC/CELLULAR/rrc_ue_bch_process.c
+++ /dev/null
@@ -1,319 +0,0 @@
-/***************************************************************************
-                          rrc_ue_bch_process.c  -  description
-                             -------------------
-    begin                : Aug 30, 2002
-    copyright            : (C) 2002, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Procedures to perform de-scheduling of SIBs
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_ue_vars.h"
-#include "rrc_bch_mib.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_bch.h"
-#include "rrc_proto_int.h"
-#include "rrc_proto_intf.h"
-
-//#define DEBUG_RRC_BROADCAST
-//-----------------------------------------------------------------------------
-void rrc_ue_bch_init (void)
-{
-  //-----------------------------------------------------------------------------
-  MasterInformationBlock *pmib = &(protocol_ms->rrc.ue_bch_blocks.currMIB);
-  pmib->sibSb_ReferenceList.sib_ref[0].sibSb_Type.type = SIBSb_sysInfoType1;
-  pmib->sibSb_ReferenceList.sib_ref[1].sibSb_Type.type = SIBSb_sysInfoType2;
-  pmib->sibSb_ReferenceList.sib_ref[2].sibSb_Type.type = SIBSb_sysInfoType5;
-  pmib->sibSb_ReferenceList.sib_ref[3].sibSb_Type.type = SIBSb_sysInfoType11;
-  pmib->sibSb_ReferenceList.sib_ref[4].sibSb_Type.type = SIBSb_sysInfoType14;
-  pmib->sibSb_ReferenceList.sib_ref[5].sibSb_Type.type = SIBSb_sysInfoType18;
-
-  protocol_ms->rrc.ue_bch_blocks.SIB14_timeout = TRUE;
-  protocol_ms->rrc.ue_bch_blocks.SIB14_timeout_value = (2 << SIB14_REP) * SIB14_TFACTOR;
-  protocol_ms->rrc.ue_bch_blocks.bch_ue_vts.mib_vt = 15;        //0x0f >8
-}
-
-//-----------------------------------------------------------------------------
-void rrc_ue_bch_process_MIB (PERParms * pParms)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  //Temp - test MIB value tag directly in MIB - TBD later 8.1.1.7.3 [25.331]
-  if ((int) protocol_ms->rrc.ue_bch_blocks.encoded_currMIB[1] != protocol_ms->rrc.ue_bch_blocks.bch_ue_vts.mib_vt) {
-    // skip segment decoding, 1st step works on bytes only
-    status = rrc_PERDec_MasterInformationBlock (pParms, &(protocol_ms->rrc.ue_bch_blocks.currMIB));
-#ifdef DEBUG_RRC_BROADCAST
-    msg ("[RRC_BCH-UE] Decode MIB status %d.\n", status);
-#endif
-
-    if (status == P_SUCCESS) {
-#ifdef DEBUG_RRC_BROADCAST
-      msg ("[RRC_BCH-UE] Process information from MIB.\n");
-      msg ("[RRC_BCH-UE] MIB value tag: %d\n", protocol_ms->rrc.ue_bch_blocks.currMIB.mib_ValueTag);
-      msg ("[RRC_BCH-UE] PLMN Identity: MCC %d%d%d , MNC %d\n",
-           protocol_ms->rrc.ue_bch_blocks.currMIB.plmn_Identity.mcc.elem[0],
-           protocol_ms->rrc.ue_bch_blocks.currMIB.plmn_Identity.mcc.elem[1],
-           protocol_ms->rrc.ue_bch_blocks.currMIB.plmn_Identity.mcc.elem[2],
-           protocol_ms->rrc.ue_bch_blocks.currMIB.plmn_Identity.mnc);
-      // protocol_ms->rrc.ue_bch_blocks.currMIB.plmn_Identity.mnc.elem[0],
-      // protocol_ms->rrc.ue_bch_blocks.currMIB.plmn_Identity.mnc.elem[1],
-      // protocol_ms->rrc.ue_bch_blocks.currMIB.plmn_Identity.mnc.elem[2]);
-      msg ("[RRC_BCH-UE] Value tags: SIB1 %d , SIB2 %d , SIB5 %d, SIB11 %d, SIB18 %d.\n",
-           protocol_ms->rrc.ue_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[0].sibSb_Type.type_tag.sysInfoType1,
-           protocol_ms->rrc.ue_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[1].sibSb_Type.type_tag.sysInfoType2,
-           protocol_ms->rrc.ue_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[2].sibSb_Type.type_tag.sysInfoType5,
-           protocol_ms->rrc.ue_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[3].sibSb_Type.type_tag.sysInfoType11,
-           protocol_ms->rrc.ue_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[5].sibSb_Type.type_tag.sysInfoType18);
-#endif
-      protocol_ms->rrc.ue_bch_blocks.bch_ue_vts.mib_vt = protocol_ms->rrc.ue_bch_blocks.currMIB.mib_ValueTag;
-
-      //  if first base, store cell_id from RG - Otherwise, check this is the right cell (PLMN)
-      if (protocol_ms->rrc.cell_id == 0)
-        protocol_ms->rrc.cell_id = protocol_ms->rrc.ue_bch_blocks.currMIB.plmn_Identity.mnc;
-      else if (protocol_ms->rrc.cell_id != protocol_ms->rrc.ue_bch_blocks.currMIB.plmn_Identity.mnc)
-        msg ("\n\n[RRC_BCH-UE] Decode MIB Error - Broadcast received from another RG - cell  %d.\n\n", protocol_ms->rrc.ue_bch_blocks.currMIB.plmn_Identity.mnc);
-
-#ifdef DEBUG_RRC_BROADCAST
-      msg ("[RRC_BCH-UE] Decode MIB status - Cell_id %d.\n", protocol_ms->rrc.cell_id);
-#endif
-      // check sib_ref information
-    }
-  } else {
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-    msg ("[RRC_BCH-UE] Ignore information from MIB %d , %d.\n", (int) protocol_ms->rrc.ue_bch_blocks.encoded_currMIB[1], protocol_ms->rrc.ue_bch_blocks.bch_ue_vts.mib_vt);
-    // rrc_print_buffer (protocol_ms->rrc.ue_bch_blocks.encoded_currMIB,20);
-#endif
-  }
-}
-
-//-----------------------------------------------------------------------------
-void rrc_ue_bch_process_SIB1 (PERParms * pParms)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  //if (protocol_ms->rrc.ue_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[0].sibSb_Type.type_tag.sysInfoType1
-  //                != protocol_ms->rrc.ue_bch_blocks.bch_ue_vts.sib1_vt){
-  //skip segment decoding, 1st step works on bytes only
-  status = rrc_PERDec_SysInfoType1 (pParms, &(protocol_ms->rrc.ue_bch_blocks.currSIB1));
-#ifdef DEBUG_RRC_BROADCAST
-  msg ("[RRC_BCH-UE] Decode SIB1 status %d.\n", status);
-#endif
-
-  if (status == P_SUCCESS) {
-#ifdef DEBUG_RRC_BROADCAST
-    msg ("[RRC_BCH-UE] Process information from System Information Block 1.\n");
-    msg ("[RRC_BCH-UE] NAS System Information.\n");
-    rrc_print_buffer ((char *) &protocol_ms->rrc.ue_bch_blocks.currSIB1.subnet_NAS_SysInfo.data, protocol_ms->rrc.ue_bch_blocks.currSIB1.subnet_NAS_SysInfo.numocts);
-    msg ("[RRC_BCH-UE] UE timers and counters.\n");
-    rrc_print_buffer ((char *) &protocol_ms->rrc.ue_bch_blocks.currSIB1.ue_TimersAndConstants.data, protocol_ms->rrc.ue_bch_blocks.currSIB1.ue_TimersAndConstants.numocts);
-#endif
-
-    // save values of timers and counters
-    // send NAS data to NAS
-    if (protocol_ms->rrc.ue_wait_establish_req == 1) {
-      rrc_ue_broadcast_encode_nas_sib1 ();
-      rrc_ue_write_FIFO (protocol_ms->rrc.NASMessageToXmit);
-    } else {
-      protocol_ms->rrc.ue_wait_establish_req = 2;
-    }
-
-    protocol_ms->rrc.ue_bch_blocks.bch_ue_vts.sib1_vt = protocol_ms->rrc.ue_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[0].sibSb_Type.type_tag.sysInfoType1;
-  }
-
-  //   }
-}
-
-//-----------------------------------------------------------------------------
-void rrc_ue_bch_process_SIB2 (PERParms * pParms)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  if (protocol_ms->rrc.ue_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[1].sibSb_Type.type_tag.sysInfoType2 != protocol_ms->rrc.ue_bch_blocks.bch_ue_vts.sib2_vt) {
-    // skip segment decoding, 1st step works on bytes only
-    status = rrc_PERDec_SysInfoType2 (pParms, &(protocol_ms->rrc.ue_bch_blocks.currSIB2));
-
-    if (status != P_SUCCESS) {
-#ifdef DEBUG_RRC_BROADCAST
-      msg ("[RRC_BCH-UE] Decode SIB2 status %d.\n", status);
-#endif
-    } else {
-#ifdef DEBUG_RRC_BROADCAST
-      msg ("[RRC_BCH-UE] Process information from System Information Block 2.\n");
-      msg ("[RRC_BCH-UE] IP address.\n");
-      rrc_print_buffer ((char *) &protocol_ms->rrc.ue_bch_blocks.currSIB2.net_IP_addr.data, 16);
-#endif
-      // save IP address of RG
-      protocol_ms->rrc.ue_bch_blocks.bch_ue_vts.sib2_vt = protocol_ms->rrc.ue_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[1].sibSb_Type.type_tag.sysInfoType2;
-    }
-  }
-}
-
-//-----------------------------------------------------------------------------
-void rrc_ue_bch_process_SIB5 (PERParms * pParms)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  if (protocol_ms->rrc.ue_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[2].sibSb_Type.type_tag.sysInfoType5 != protocol_ms->rrc.ue_bch_blocks.bch_ue_vts.sib5_vt) {
-    // skip segment decoding, 1st step works on bytes only
-    status = rrc_PERDec_SysInfoType5 (pParms, &(protocol_ms->rrc.ue_bch_blocks.currSIB5));
-#ifdef DEBUG_RRC_STATE
-    msg ("[RRC_BCH-UE] Decode SIB5 status %d.\n", status);
-#endif
-
-    if (status == P_SUCCESS) {
-#ifdef  DEBUG_RRC_BROADCAST
-      msg ("[RRC_BCH-UE] Process information from System Information Block 5.\n");
-      msg ("[RRC_BCH-UE] FACH RACH configuration Information.");
-      rrc_print_buffer ((char *) &protocol_ms->rrc.ue_bch_blocks.currSIB5.prach_sCCPCH_SIList.data, protocol_ms->rrc.ue_bch_blocks.currSIB5.prach_sCCPCH_SIList.numocts);
-      msg ("[RRC_BCH-UE] Config data: %s \n", (char *) &protocol_ms->rrc.ue_bch_blocks.currSIB5.prach_sCCPCH_SIList.data);
-#endif
-      /*  **** REMOVED FOR OPENAIR ****
-            // save configuration
-            memcpy ((char *) &(rrm_config->sccpch), (char *) protocol_ms->rrc.ue_bch_blocks.currSIB5.prach_sCCPCH_SIList.data, protocol_ms->rrc.ue_bch_blocks.currSIB5.prach_sCCPCH_SIList.numocts);
-              if ((rrm_config->prach.rach_trch.tf[0].bs == 0) || (rrm_config->sccpch.fach_trch.tf[0].bs == 0))  // bad config DN april 05
-              wcdma_handle_error (WCDMA_ERROR_RRC_NASTY_BCH_CONFIG);
-            #ifdef  DEBUG_RRC_BROADCAST
-            msg ("[RRC_BCH-UE] config RACH-FACH BS RACH= %d FACH=%d \n ", rrm_config->prach.rach_trch.tf[0].bs, rrm_config->sccpch.fach_trch.tf[0].bs);
-            msg ("[RRC_BCH-UE] OpenLoopPowerControl: BCH Tx power %d, alpha %d, prach %d, dpch %d .\n",
-                 protocol_ms->rrc.ue_bch_blocks.currSIB5.openLoopPowerControl_TDD.primaryCCPCH_TX_Power,
-                 protocol_ms->rrc.ue_bch_blocks.currSIB5.openLoopPowerControl_TDD.alpha,
-                 protocol_ms->rrc.ue_bch_blocks.currSIB5.openLoopPowerControl_TDD.prach_ConstantValue, protocol_ms->rrc.ue_bch_blocks.currSIB5.openLoopPowerControl_TDD.dpch_ConstantValue);
-            #endif
-            // save outer loop power control parameters
-            rrm_config->outer_loop_vars.PCCPCH_POWER = protocol_ms->rrc.ue_bch_blocks.currSIB5.openLoopPowerControl_TDD.primaryCCPCH_TX_Power;
-            rrm_config->pccpch.bch_cctrch.BCH_Power = rrm_config->outer_loop_vars.PCCPCH_POWER;
-            rrm_config->outer_loop_vars.alpha = protocol_ms->rrc.ue_bch_blocks.currSIB5.openLoopPowerControl_TDD.alpha;
-            rrm_config->outer_loop_vars.PRACH_CNST = protocol_ms->rrc.ue_bch_blocks.currSIB5.openLoopPowerControl_TDD.prach_ConstantValue;
-            rrm_config->outer_loop_vars.DPCH_CNST = protocol_ms->rrc.ue_bch_blocks.currSIB5.openLoopPowerControl_TDD.dpch_ConstantValue;
-      */
-
-      //  w NAS : Forward broadcast to NAS -
-#ifdef DEBUG_RRC_STATE
-      msg ("[RRC_BCH-UE] DEBUG SIB5 ue_wait_establish_req = %d.\n", protocol_ms->rrc.ue_wait_establish_req );
-#endif
-
-      if (protocol_ms->rrc.ue_wait_establish_req == 0) {
-        msg ("\n\n [RRC]-FSM can start - SIB5 with Common Configuration received - \n\n");
-        protocol_ms->rrc.ue_wait_establish_req = 1;
-        protocol_ms->rrc.ue_broadcast_counter = 1;
-      } else {
-        if (protocol_ms->rrc.ue_wait_establish_req == 2) {
-          rrc_ue_broadcast_encode_nas_sib1 ();
-          rrc_ue_write_FIFO (protocol_ms->rrc.NASMessageToXmit);
-          protocol_ms->rrc.ue_wait_establish_req = 1;
-        }
-      }
-
-      protocol_ms->rrc.ue_bch_blocks.bch_ue_vts.sib5_vt = protocol_ms->rrc.ue_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[2].sibSb_Type.type_tag.sysInfoType5;
-    }
-  }
-}
-
-//-----------------------------------------------------------------------------
-void rrc_ue_bch_process_SIB11 (PERParms * pParms)
-{
-  //-----------------------------------------------------------------------------
-  /*
-    int status = P_SUCCESS;
-    if (protocol_ms->rrc.ue_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[3].sibSb_Type.type_tag.sysInfoType11
-                     != protocol_ms->rrc.ue_bch_blocks.bch_ue_vts.sib11_vt){
-      // skip segment decoding, 1st step works on bytes only
-      status = rrc_PERDec_SysInfoType11 (pParms, &(protocol_ms->rrc.ue_bch_blocks.currSIB11));
-      if (status != P_SUCCESS){
-        #ifdef DEBUG_RRC_BROADCAST
-         msg("[RRC_BCH-UE] Decode SIB11 status %d.\n", status);
-        #endif
-      }else{
-        #ifdef DEBUG_RRC_BROADCAST
-        msg("[RRC_BCH-UE] Process information from System Information Block 11.\n");
-        #endif
-        // save data
-        // update value tag
-        protocol_ms->rrc.ue_bch_blocks.bch_ue_vts.sib11_vt =
-            protocol_ms->rrc.ue_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[3].sibSb_Type.type_tag.sysInfoType11;
-      }
-    }
-  */
-}
-
-//-----------------------------------------------------------------------------
-void rrc_ue_bch_process_SIB14 (PERParms * pParms)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  int i, numslots;
-
-  // skip segment decoding, 1st step works on bytes only
-  status = rrc_PERDec_SysInfoType14 (pParms, &(protocol_ms->rrc.ue_bch_blocks.currSIB14));
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-  msg ("[RRC_BCH-UE] Decode SIB14 status %d.\n", status);
-#endif
-
-  if (status == P_SUCCESS) {
-    if (protocol_ms->rrc.ue_bch_blocks.SIB14_timeout == TRUE) {
-      numslots = protocol_ms->rrc.ue_bch_blocks.currSIB14.individualTS_InterferenceList.numSlots;
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-      msg ("[RRC_BCH-UE] Process information from System Information Block 14.\n");
-      msg ("[RRC_BCH-UE] Expiration Time factor : %d,  Number of slots: %d \n", protocol_ms->rrc.ue_bch_blocks.currSIB14.expirationTimeFactor, numslots);
-
-      for (i = 0; i < numslots; i++) {
-        msg ("[RRC_BCH-UE] Slot : %d,  Interference: %d \n",
-             protocol_ms->rrc.ue_bch_blocks.currSIB14.individualTS_InterferenceList.data[i].timeslot,
-             protocol_ms->rrc.ue_bch_blocks.currSIB14.individualTS_InterferenceList.data[i].ul_TimeslotInterference);
-      }
-
-#endif
-      /*  **** REMOVED FOR OPENAIR ****
-            // save data
-            for (i = 0; i < numslots; i++) {
-              rrm_config->outer_loop_vars.IBTS[i] = protocol_ms->rrc.ue_bch_blocks.currSIB14.individualTS_InterferenceList.data[i].ul_TimeslotInterference;
-            }
-      */
-      //  no update of value tag for SIB14
-      protocol_ms->rrc.ue_bch_blocks.SIB14_timeout = FALSE;
-    }
-  }
-}
-
-//-----------------------------------------------------------------------------
-void rrc_ue_bch_process_SIB18 (PERParms * pParms)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  if (protocol_ms->rrc.ue_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[5].sibSb_Type.type_tag.sysInfoType18 != protocol_ms->rrc.ue_bch_blocks.bch_ue_vts.sib18_vt) {
-    // skip segment decoding, 1st step works on bytes only
-    status = rrc_PERDec_SysInfoType18 (pParms, &(protocol_ms->rrc.ue_bch_blocks.currSIB18));
-#ifdef DEBUG_RRC_BROADCAST
-    msg ("[RRC_BCH-UE] Decode SIB18 status %d.\n", status);
-#endif
-
-    if (status == P_SUCCESS) {
-#ifdef DEBUG_RRC_BROADCAST
-      msg ("[RRC_BCH-UE] Process information from System Information Block 18.\n");
-      msg ("[RRC_BCH-UE] Neighbour cells list.");
-      rrc_print_buffer ((char *) &protocol_ms->rrc.ue_bch_blocks.currSIB18.cellIdentities.data, protocol_ms->rrc.ue_bch_blocks.currSIB18.cellIdentities.numocts);
-      msg ("[RRC_BCH-UE] data <<%s>>\n", (char *) &protocol_ms->rrc.ue_bch_blocks.currSIB18.cellIdentities.data);
-      msg ("[RRC_BCH-UE] Code groups, cell 1 %d, cell 2 %d. \n",
-           protocol_ms->rrc.ue_bch_blocks.currSIB18.cellCodegroups.data[0], protocol_ms->rrc.ue_bch_blocks.currSIB18.cellCodegroups.data[1]);
-#endif
-      rrc_ue_read_neighboring_cells_info ();
-      rrc_ue_broadcast_encode_nas_sib18 ();
-      rrc_ue_write_FIFO (protocol_ms->rrc.NASMessageToXmit);
-      // update value tag
-      protocol_ms->rrc.ue_bch_blocks.bch_ue_vts.sib18_vt = protocol_ms->rrc.ue_bch_blocks.currMIB.sibSb_ReferenceList.sib_ref[5].sibSb_Type.type_tag.sysInfoType18;
-    }
-  }
-}
diff --git a/openair2/RRC/CELLULAR/rrc_ue_bch_read.c b/openair2/RRC/CELLULAR/rrc_ue_bch_read.c
deleted file mode 100755
index 5e85ef54c1..0000000000
--- a/openair2/RRC/CELLULAR/rrc_ue_bch_read.c
+++ /dev/null
@@ -1,390 +0,0 @@
-/***************************************************************************
-                          rrc_ue_bch_read.c  -  description
-                             -------------------
-    begin                : Aug 30, 2002
-    copyright            : (C) 2002, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Procedures to perform decoding of SIBs
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_ue_vars.h"
-#include "rrc_bch_mib.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_bch.h"
-
-//-----------------------------------------------------------------------------
-void rrc_ue_read_Seg10 (PERParms * pParms)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  unsigned int  SIB_type;
-
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-  msg ("[RRC_BCH-UE] Get information from Complete SIB.\n");
-#endif
-  /* decode sib_Type */
-  status = rrc_PERDec_SIB_Type (pParms, &SIB_type);
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-  msg ("[RRC_BCH-UE] SI-BCH, SIB_type %d, status %d\n", SIB_type, status);
-#endif
-  protocol_ms->rrc.ue_bch_blocks.curr_block_type = SIB_type;
-
-  switch (SIB_type) {
-  case masterInformationBlock:
-    memcpy (&(protocol_ms->rrc.ue_bch_blocks.encoded_currMIB), ((char *) pParms->buffer) + pParms->buff_index, pParms->buff_size);
-    rrc_ue_bch_process_MIB (pParms);
-    break;
-
-  case systemInformationBlockType1:
-    memcpy (&(protocol_ms->rrc.ue_bch_blocks.encoded_currSIB1), ((char *) pParms->buffer) + pParms->buff_index, pParms->buff_size);
-    rrc_ue_bch_process_SIB1 (pParms);
-    break;
-
-  case systemInformationBlockType2:
-    memcpy (&(protocol_ms->rrc.ue_bch_blocks.encoded_currSIB2), ((char *) pParms->buffer) + pParms->buff_index, pParms->buff_size);
-    rrc_ue_bch_process_SIB2 (pParms);
-    break;
-
-  case systemInformationBlockType5:
-    memcpy (&(protocol_ms->rrc.ue_bch_blocks.encoded_currSIB5), ((char *) pParms->buffer) + pParms->buff_index, pParms->buff_size);
-    rrc_ue_bch_process_SIB5 (pParms);
-    break;
-
-  case systemInformationBlockType14:
-    memcpy (&(protocol_ms->rrc.ue_bch_blocks.encoded_currSIB14), ((char *) pParms->buffer) + pParms->buff_index, pParms->buff_size);
-    rrc_ue_bch_process_SIB14 (pParms);
-    break;
-
-  case systemInformationBlockType18:
-    memcpy (&(protocol_ms->rrc.ue_bch_blocks.encoded_currSIB18), ((char *) pParms->buffer) + pParms->buff_index, pParms->buff_size);
-    rrc_ue_bch_process_SIB18 (pParms);
-    break;
-
-  default:
-    msg ("[RRC_BCH-UE] Seg10, unknown SIB_type \n");
-    break;
-  }
-}
-
-//-----------------------------------------------------------------------------
-void rrc_ue_read_Seg2 (PERParms * pParms)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  unsigned int SIB_type;
-  int SEG_count;
-
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-  msg ("[RRC_BCH-UE] Get information from First Segment.\n");
-#endif
-  /* decode sib_Type */
-  status = rrc_PERDec_SIB_Type (pParms, &SIB_type);
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-  msg ("[RRC_BCH-UE] SI-BCH, SIB_type %d , status %d\n", SIB_type, status);
-#endif
-  protocol_ms->rrc.ue_bch_blocks.curr_block_type = SIB_type;
-
-  /* decode seg_Count */
-  status = rrc_PERDec_SegCount (pParms, &SEG_count);
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-  //msg("[RRC_BCH-UE] SI-BCH, SEG_count, status %d \n", SEG_count, status);
-#endif
-  protocol_ms->rrc.ue_bch_blocks.curr_segment_count = SEG_count;
-  protocol_ms->rrc.ue_bch_blocks.curr_segment_index = 0;        //1st segment
-
-  /* save received block */
-  switch (SIB_type) {
-  case masterInformationBlock:
-    memcpy (&(protocol_ms->rrc.ue_bch_blocks.encoded_currMIB), ((char *) pParms->buffer) + pParms->buff_index, pParms->buff_size);
-    break;
-
-  case systemInformationBlockType1:
-    memcpy (&(protocol_ms->rrc.ue_bch_blocks.encoded_currSIB1), ((char *) pParms->buffer) + pParms->buff_index, pParms->buff_size);
-    break;
-
-  case systemInformationBlockType5:
-    memcpy (&(protocol_ms->rrc.ue_bch_blocks.encoded_currSIB5), ((char *) pParms->buffer) + pParms->buff_index, pParms->buff_size);
-    break;
-
-  case systemInformationBlockType14:
-    memcpy (&(protocol_ms->rrc.ue_bch_blocks.encoded_currSIB14), ((char *) pParms->buffer) + pParms->buff_index, pParms->buff_size);
-    break;
-
-  case systemInformationBlockType18:
-    memcpy (&(protocol_ms->rrc.ue_bch_blocks.encoded_currSIB18), ((char *) pParms->buffer) + pParms->buff_index, pParms->buff_size);
-    break;
-
-  default:
-    msg ("[RRC_BCH-UE] Seg2, unknown SIB_type \n");
-    break;
-  }
-
-  protocol_ms->rrc.ue_bch_blocks.curr_block_index = pParms->buff_size;
-  protocol_ms->rrc.ue_bch_blocks.curr_block_length = pParms->buff_size;
-}
-
-//-----------------------------------------------------------------------------
-void rrc_ue_read_Seg3 (PERParms * pParms)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  unsigned int SIB_type;
-  int SEG_index;
-
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-  msg ("[RRC_BCH-UE] Get information from Subsequent Segment.\n");
-#endif
-  /* decode sib_Type */
-  status = rrc_PERDec_SIB_Type (pParms, &SIB_type);
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-  msg ("[RRC_BCH-UE] SI-BCH, SIB_type %d , status %d\n", SIB_type, status);
-#endif
-
-  /* decode seg_Index */
-  status = rrc_PERDec_SegmentIndex (pParms, &SEG_index);
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-  //msg("[RRC_BCH-UE] SI-BCH, SEG_index %d , status %d \n", SEG_index, status);
-#endif
-
-  // check valid segment
-  if ((SIB_type != protocol_ms->rrc.ue_bch_blocks.curr_block_type) ||
-      (SEG_index != protocol_ms->rrc.ue_bch_blocks.curr_segment_index + 1) || (SEG_index >= (protocol_ms->rrc.ue_bch_blocks.curr_segment_count - 1))) {
-    protocol_ms->rrc.ue_bch_blocks.curr_block_type = NO_BLOCK;
-    protocol_ms->rrc.ue_bch_blocks.curr_block_index = 0;
-    protocol_ms->rrc.ue_bch_blocks.curr_block_length = 0;
-    protocol_ms->rrc.ue_bch_blocks.curr_segment_index = 0;
-    protocol_ms->rrc.ue_bch_blocks.curr_segment_count = 0;
-    msg ("[RRC_BCH-UE] Invalid subsequent segment received SIB Type: %d , SEG_index :%d\n", SIB_type, SEG_index);
-    return;
-  }
-
-  protocol_ms->rrc.ue_bch_blocks.curr_segment_index += 1;       //inc segment index
-
-  /* save received block */
-  switch (SIB_type) {
-  case masterInformationBlock:
-    memcpy ((char *) &(protocol_ms->rrc.ue_bch_blocks.encoded_currMIB) + protocol_ms->rrc.ue_bch_blocks.curr_block_index, ((char *) pParms->buffer) + pParms->buff_index, pParms->buff_size);
-    break;
-
-  case systemInformationBlockType1:
-    memcpy ((char *) &(protocol_ms->rrc.ue_bch_blocks.encoded_currSIB1) + protocol_ms->rrc.ue_bch_blocks.curr_block_index, ((char *) pParms->buffer) + pParms->buff_index, pParms->buff_size);
-    break;
-
-  case systemInformationBlockType5:
-    memcpy ((char *) &(protocol_ms->rrc.ue_bch_blocks.encoded_currSIB5) + protocol_ms->rrc.ue_bch_blocks.curr_block_index, ((char *) pParms->buffer) + pParms->buff_index, pParms->buff_size);
-    break;
-
-  case systemInformationBlockType14:
-    memcpy ((char *) &(protocol_ms->rrc.ue_bch_blocks.encoded_currSIB14) + protocol_ms->rrc.ue_bch_blocks.curr_block_index, ((char *) pParms->buffer) + pParms->buff_index, pParms->buff_size);
-    break;
-
-  case systemInformationBlockType18:
-    memcpy ((char *) &(protocol_ms->rrc.ue_bch_blocks.encoded_currSIB18) + protocol_ms->rrc.ue_bch_blocks.curr_block_index, ((char *) pParms->buffer) + pParms->buff_index, pParms->buff_size);
-    break;
-
-  default:
-    msg ("[RRC_BCH-UE] Seg3, unknown SIB_type \n");
-    break;
-  }
-
-  protocol_ms->rrc.ue_bch_blocks.curr_block_index += pParms->buff_size;
-  protocol_ms->rrc.ue_bch_blocks.curr_block_length += pParms->buff_size;
-}
-
-//-----------------------------------------------------------------------------
-void rrc_ue_read_Seg11 (PERParms * pParms)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  unsigned int SIB_type;
-  int SEG_index;
-
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-  msg ("[RRC_BCH-UE] Get information from Last Segment.\n");
-#endif
-  /* decode sib_Type */
-  status = rrc_PERDec_SIB_Type (pParms, &SIB_type);
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-  msg ("[RRC_BCH-UE] SI-BCH, SIB_type %d, status %d.\n", SIB_type, status);
-#endif
-
-  /* decode seg_Index */
-  status = rrc_PERDec_SegmentIndex (pParms, &SEG_index);
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-  //msg("[RRC_BCH-UE] SI-BCH, SEG_index %d, status %d \n", SEG_index, status);
-#endif
-
-  // check valid segment
-  if ((SIB_type != protocol_ms->rrc.ue_bch_blocks.curr_block_type) ||
-      (SEG_index != protocol_ms->rrc.ue_bch_blocks.curr_segment_index + 1) || (SEG_index != (protocol_ms->rrc.ue_bch_blocks.curr_segment_count - 1))) {
-    protocol_ms->rrc.ue_bch_blocks.curr_block_type = NO_BLOCK;
-    protocol_ms->rrc.ue_bch_blocks.curr_block_index = 0;
-    protocol_ms->rrc.ue_bch_blocks.curr_block_length = 0;
-    protocol_ms->rrc.ue_bch_blocks.curr_segment_index = 0;
-    protocol_ms->rrc.ue_bch_blocks.curr_segment_count = 0;
-    msg ("[RRC_BCH-UE] Invalid last segment received SIB Type: %d , SEG_index :%d\n", SIB_type, SEG_index);
-    return;
-  }
-
-  /* save received block */
-  switch (SIB_type) {
-  case masterInformationBlock:
-    memcpy ((char *) &(protocol_ms->rrc.ue_bch_blocks.encoded_currMIB) + protocol_ms->rrc.ue_bch_blocks.curr_block_index, ((char *) pParms->buffer) + pParms->buff_index, pParms->buff_size);
-    break;
-
-  case systemInformationBlockType1:
-    memcpy ((char *) &(protocol_ms->rrc.ue_bch_blocks.encoded_currSIB1) + protocol_ms->rrc.ue_bch_blocks.curr_block_index, ((char *) pParms->buffer) + pParms->buff_index, pParms->buff_size);
-    break;
-
-  case systemInformationBlockType5:
-    memcpy ((char *) &(protocol_ms->rrc.ue_bch_blocks.encoded_currSIB5) + protocol_ms->rrc.ue_bch_blocks.curr_block_index, ((char *) pParms->buffer) + pParms->buff_index, pParms->buff_size);
-    break;
-
-  case systemInformationBlockType14:
-    memcpy ((char *) &(protocol_ms->rrc.ue_bch_blocks.encoded_currSIB14) + protocol_ms->rrc.ue_bch_blocks.curr_block_index, ((char *) pParms->buffer) + pParms->buff_index, pParms->buff_size);
-    break;
-
-  case systemInformationBlockType18:
-    memcpy ((char *) &(protocol_ms->rrc.ue_bch_blocks.encoded_currSIB18) + protocol_ms->rrc.ue_bch_blocks.curr_block_index, ((char *) pParms->buffer) + pParms->buff_index, pParms->buff_size);
-    break;
-
-  default:
-    msg ("[RRC_BCH-UE] Seg11, unknown SIB_type \n");
-    break;
-  }
-
-  protocol_ms->rrc.ue_bch_blocks.curr_block_index += pParms->buff_size;
-  protocol_ms->rrc.ue_bch_blocks.curr_block_length += pParms->buff_size;
-
-  switch (SIB_type) {
-    /* MIB  */
-  case masterInformationBlock:
-    rrc_ue_bch_process_MIB (pParms);
-    break;
-
-    /* SIB1  */
-  case systemInformationBlockType1:
-    rrc_ue_bch_process_SIB1 (pParms);
-    break;
-
-    /* SIB5  */
-  case systemInformationBlockType5:
-    rrc_ue_bch_process_SIB5 (pParms);
-    break;
-
-    /* SIB14  */
-  case systemInformationBlockType14:
-    rrc_ue_bch_process_SIB14 (pParms);
-    break;
-
-    /* SIB18  */
-  case systemInformationBlockType18:
-    rrc_ue_bch_process_SIB18 (pParms);
-    break;
-
-  default:
-    msg ("[RRC_BCH-UE] Seg11, unknown SIB_type \n");
-    break;
-  }
-
-  protocol_ms->rrc.ue_bch_blocks.curr_block_type = NO_BLOCK;
-  protocol_ms->rrc.ue_bch_blocks.curr_block_index = 0;
-  protocol_ms->rrc.ue_bch_blocks.curr_block_length = 0;
-  protocol_ms->rrc.ue_bch_blocks.curr_segment_index = 0;
-  protocol_ms->rrc.ue_bch_blocks.curr_segment_count = 0;
-}
-
-//-----------------------------------------------------------------------------
-int rrc_ue_get_SIBCH_info (PERParms * pParms)
-{
-  //-----------------------------------------------------------------------------
-  char *pBuffer;
-  int message_length;
-  unsigned int payload_type;
-  int status = P_SUCCESS;
-
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-  //  msg("[RRC_BCH-UE] Get main information from SI-BCH \n");
-#endif
-  pBuffer = (char *) &(protocol_ms->rrc.ue_bch_blocks.encoded_currSIBCH);
-  rrc_new_per_parms (pParms, pBuffer);
-
-  message_length = rrc_get_per_length ((ENCODEDBLOCK *) pBuffer);
-  pParms->buff_size = message_length - 1;       // idem
-  pParms->buff_index = 1;       // idem
-
-  /* decode sfn_Prime */
-  status = rrc_PERDec_SFN_Prime (pParms, &protocol_ms->rrc.ue_bch_blocks.currSI_BCH.sfn_Prime);
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-
-  if (status != P_SUCCESS)
-    msg ("[RRC_BCH-UE] Decode SFN_Prime, status %d.\n", status);
-
-#endif
-
-  /* decode payload_type */
-  status = rrc_PERDec_ConsUnsigned (pParms, &payload_type, 0, 15);
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-
-  if (status != P_SUCCESS)
-    msg ("[RRC_BCH-UE] Decode payload_type, status %d.\n", status);
-
-#endif
-  protocol_ms->rrc.ue_bch_blocks.currSI_BCH.payload.type = payload_type + 1;
-
-  switch (protocol_ms->rrc.ue_bch_blocks.currSI_BCH.payload.type) {
-  case BCH_completeSIB:
-    rrc_ue_read_Seg10 (pParms);
-    break;
-
-  case BCH_firstSegment:
-    rrc_ue_read_Seg2 (pParms);
-    break;
-
-  case BCH_subsequentSegment:
-    rrc_ue_read_Seg3 (pParms);
-    break;
-
-  case BCH_lastSegment:
-    rrc_ue_read_Seg11 (pParms);
-    break;
-
-  case BCH_noSegment:
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-    msg ("[RRC_BCH-UE] payload type is noSegment, SFN %d.\n", protocol_ms->rrc.ue_bch_blocks.currSI_BCH.sfn_Prime);
-#endif
-    // Nothing else to do
-    break;
-
-  default:
-    //log error message
-    msg ("[RRC_BCH-UE] rrc_ue_get_SIBCH_info : unknown payload type %d.\n", protocol_ms->rrc.ue_bch_blocks.currSI_BCH.payload.type);
-    break;
-  }
-
-  return status;
-}
-
-//-----------------------------------------------------------------------------
-void rrc_ue_read_next_segment (void)
-{
-  //-----------------------------------------------------------------------------
-  //  int status = P_SUCCESS;
-  PERParms *pParms = &(protocol_ms->rrc.ue_bch_blocks.perParms);
-
-  // Get main info and decode SI_BCH
-  rrc_ue_get_SIBCH_info (pParms);
-  //status = rrc_PERDec_SI_BCH (pParms, &(protocol_ms->rrc.ue_bch_blocks.currSI_BCH));
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-  // msg("[RRC_BCH] Decode Broadcast  - status : %d\n", status);
-#endif
-}
diff --git a/openair2/RRC/CELLULAR/rrc_ue_bch_variables.h b/openair2/RRC/CELLULAR/rrc_ue_bch_variables.h
deleted file mode 100755
index 28f31f0cdf..0000000000
--- a/openair2/RRC/CELLULAR/rrc_ue_bch_variables.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/***************************************************************************
-                          rrc_ue_bch_variables.h  -  description
-                             -------------------
-    begin                : Aug 30, 2002
-    copyright            : (C) 2002, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Some additional definitions for UE broadcast
- ***************************************************************************/
-#ifndef __RRC_UE_BCH_H__
-#define __RRC_UE_BCH_H__
-
-#include "rrc_bch_mib.h"
-
-#include "SystemInformationBlockType2.h"
-#include "SystemInformation.h"
-#include "BCCH-DL-SCH-Message.h"
-#include "TDD-Config.h"
-
-struct rrc_ue_bch_value_tags {
-  int             mib_vt;
-  int             sib1_vt;
-  int             sib2_vt;
-  int             sib5_vt;
-  int             sib11_vt;
-  int             sib18_vt;
-};
-
-struct rrc_ue_bch_blocks {
-  struct rrc_ue_bch_value_tags bch_ue_vts;
-  PERParms        perParms;
-  int             next_block_type;
-  int             curr_block_type;
-  int             curr_block_index;
-  int             curr_block_length;
-  int             curr_segment_index;;
-  int             curr_segment_count;
-  int             SIB14_timeout;
-  int             SIB14_timeout_value;
-  SystemInformation_BCH currSI_BCH;
-  ENCODEDSI       encoded_currSIBCH;
-  ENCODEDSI       encoded_prevSIBCH;
-  MasterInformationBlock currMIB;
-  int             encodedMIB_lgth;
-  ENCODEDBLOCK    encoded_currMIB;
-  ENCODEDBLOCK    encoded_prevMIB;
-  struct SysInfoType1 currSIB1;
-  int             encodedSIB1_lgth;
-  ENCODEDBLOCK    encoded_currSIB1;
-  ENCODEDBLOCK    encoded_prevSIB1;
-  struct SysInfoType2 currSIB2;
-  int             encodedSIB2_lgth;
-  ENCODEDBLOCK    encoded_currSIB2;
-  ENCODEDBLOCK    encoded_prevSIB2;
-  struct SysInfoType5 currSIB5;
-  int             encodedSIB5_lgth;
-  ENCODEDBLOCK    encoded_currSIB5;
-  ENCODEDBLOCK    encoded_prevSIB5;
-  //struct SysInfoType11 currSIB11;
-  int             encodedSIB11_lgth;
-  ENCODEDBLOCK    encoded_currSIB11;
-  ENCODEDBLOCK    encoded_prevSIB11;
-  struct SysInfoType14 currSIB14;
-  int             encodedSIB14_lgth;
-  ENCODEDBLOCK    encoded_currSIB14;
-  ENCODEDBLOCK    encoded_prevSIB14;
-  struct SysInfoType18 currSIB18;
-  int             encodedSIB18_lgth;
-  ENCODEDBLOCK    encoded_currSIB18;
-  ENCODEDBLOCK    encoded_prevSIB18;
-};
-
-
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_ue_control.c b/openair2/RRC/CELLULAR/rrc_ue_control.c
deleted file mode 100755
index 8c6be29417..0000000000
--- a/openair2/RRC/CELLULAR/rrc_ue_control.c
+++ /dev/null
@@ -1,379 +0,0 @@
-/***************************************************************************
-                          rrc_ue_control.c  -  description
-                             -------------------
-    copyright            : (C) 2002, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Procedures associated with the control of the UE protocol stack
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_ue_vars.h"
-#include "rrc_messages.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_fsm.h"
-#include "rrc_proto_intf.h"
-//#include "rrc_rrm_proto.h"
-#include "rrc_proto_msg.h"
-//-----------------------------------------------------------------------------
-//#include "rlc.h"
-
-//-----------------------------------------------------------------------------
-void rrc_ue_CRLC_Status_rx (int rb_id, int evcP)
-{
-  //-----------------------------------------------------------------------------
-  // temp - Esterel to be updated
-  rrc_ue_fsm_control (UE_CRLC_STATUS);
-}
-
-// Indications from L1
-//-----------------------------------------------------------------------------
-void rrc_ue_CPHY_Synch_rx (int CCTrCH)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC-CPHY] In-synch received from PHY for CCTrCH %d \n", CCTrCH);
-#endif
-  protocol_ms->rrc.rrc_ue_synch_ind = TRUE;
-  protocol_ms->rrc.rrc_ue_cctrch_synch[CCTrCH] = TRUE;
-}
-
-//-----------------------------------------------------------------------------
-void rrc_ue_CPHY_Out_Synch_rx (int CCTrCH)
-{
-  //-----------------------------------------------------------------------------
-  msg ("[RRC-CPHY] Outsynch received from PHY for CCTrCH %d \n", CCTrCH);
-  protocol_ms->rrc.rrc_ue_outsynch_ind = TRUE;
-  protocol_ms->rrc.rrc_ue_cctrch_outsynch[CCTrCH] = TRUE;
-}
-
-/* Check if an event arrived from L1 */
-//-------------------------------------------------------------------
-void rrc_ue_L1_check (void)
-{
-  //-------------------------------------------------------------------
-  int  data_ccTrCh;
-  int  trch;
-
-  /*
-  if (rrc_ue_tick > RRC_UE_TICK_THRESHOLD) {
-    rrc_ue_tick=0;
-    msg ("[RRC_RG][CPHY] Mobile OUT due to lack of mesures %d \n\n\n \n");
-    protocol_ms->rrc.rrc_ue_outsynch_ind=TRUE;
-    for (data_ccTrCh = 0; data_ccTrCh < maxCCTrCH_rg; data_ccTrCh++) {
-    protocol_ms->rrc.rrc_ue_cctrch_outsynch[data_ccTrCh] = TRUE;
-    }
-    #ifndef BYPASS_L1
-    for (trch = 0; trch < 5; trch++)
-      L1L_vars->L1_stats.trch_suc_errors[trch] = 3000;
-    #endif
-  }
-  */
-  // First step is to test InSynch conditions
-  if (protocol_ms->rrc.rrc_ue_synch_ind == TRUE) {
-    //insynch detected- read it
-    protocol_ms->rrc.rrc_ue_synch_ind = FALSE;
-
-    for (data_ccTrCh = 0; data_ccTrCh < maxCCTrCH; data_ccTrCh++) {
-      if (protocol_ms->rrc.rrc_ue_cctrch_synch[data_ccTrCh] == TRUE) {
-#ifdef DEBUG_RRC_STATE
-        msg ("[RRC_UE][CPHY] In-Synch detected for CCTRCH %d \n", data_ccTrCh);
-#endif
-        protocol_ms->rrc.rrc_ue_cctrch_synch[data_ccTrCh] = FALSE;
-        protocol_ms->rrc.rrc_ue_cctrch[data_ccTrCh] = TRUE;
-        rrc_ue_fsm_control (UE_PHY_SETUP);
-      }
-    }
-  }
-
-  // Next step is to test OutOfSynch conditions
-  if (protocol_ms->rrc.rrc_ue_outsynch_ind == TRUE) {
-    //outsynch detected- read it
-    protocol_ms->rrc.rrc_ue_outsynch_ind = FALSE;
-
-    for (data_ccTrCh = 0; data_ccTrCh < maxCCTrCH; data_ccTrCh++) {
-      if (protocol_ms->rrc.rrc_ue_cctrch_outsynch[data_ccTrCh] == TRUE) {
-        //  #ifdef DEBUG_RRC_STATE
-        msg ("[RRC_UE][CPHY] Out-Synch detected for CCTRCH %d \n", data_ccTrCh);
-        //   #endif
-        protocol_ms->rrc.rrc_ue_cctrch_outsynch[data_ccTrCh] = FALSE;
-        rrc_ue_fsm_control (UE_CONN_LOSS);
-
-        if (data_ccTrCh == 0) {
-          msg ("[RRC_UE] Restarting 3GPP AS\n");
-          //wcdma_handle_error (WCDMA_ERROR_L1_OUT_OF_SYNC);
-        }
-      }
-    }
-  }
-}
-
-/* Read cell system configuration from SIB18 */
-//-------------------------------------------------------------------
-void rrc_ue_read_neighboring_cells_info (void)
-{
-  //-------------------------------------------------------------------
-  int i;
-  struct rrc_ue_nas_neighbor_list *p;
-
-  // store number of neighboring bases
-  p = (struct rrc_ue_nas_neighbor_list *)protocol_ms->rrc.ue_bch_blocks.currSIB18.cellIdentities.data;
-  protocol_ms->rrc.rg_ngbr_list.num_cells = p->num_rg;
-
-  if (p->num_rg <= maxCells) {
-    // store cell information in list
-    for (i = 0; i < p->num_rg; i++) {
-      protocol_ms->rrc.rg_ngbr_list.cell_info[i].cell_id = i + 1;
-      protocol_ms->rrc.rg_ngbr_list.cell_info[i].pccpch_code_group = protocol_ms->rrc.ue_bch_blocks.currSIB18.cellCodegroups.data[i];
-    }
-
-#ifdef DEBUG_RRC_STATE
-    msg ("[RRC_UE][SIB18] Neighbor cells. Number %d \n", protocol_ms->rrc.rg_ngbr_list.num_cells);
-#endif
-#ifdef DEBUG_RRC_BROADCAST
-
-    for (i = 0; i < p->num_rg; i++)
-      msg ("[RRC_UE][SIB18] Cell %d #%d , codegroup  %d\n", i + 1, protocol_ms->rrc.rg_ngbr_list.cell_info[i].cell_id, protocol_ms->rrc.rg_ngbr_list.cell_info[i].pccpch_code_group);
-
-#endif
-  } else {
-    protocol_ms->rrc.rg_ngbr_list.num_cells = 1;        // Error in config, force standalone cell
-    msg ("\n\n ERROR IN RT CONFIGURATION - RG num cells > Max Number of cells \n\n");
-  }
-}
-// TEMP OPEMAIR : The next 4 functions provide some dummy values for L1 and L2 measurements.
-//                To be replaced when interface is set-up.
-
-//-------------------------------------------------------------------
-// Performs the Intra-Frequency measurements in L1
-void rrc_ue_measure_if (void)
-{
-  //-------------------------------------------------------------------
-  //    u16 num_measurement_counter;
-  //    u16 identity;
-  //    u16 meas_results_type;
-  //    u16 if_num_cells;
-  //    u16 if_cell_id[maxCells];
-  //    u16 if_cell_parms_id[maxCells];
-  //    u16 if_BCH_RSCP[maxCells];
-  //    u16 if_pathloss[maxCells];
-  //    u16 if_slot_iscp[maxCells][maxTS];
-  int i,j;
-
-  protocol_ms->rrc.rrc_ue_last_measurement = IX_ifM;
-
-  protocol_ms->rrc.ue_meas_rep[IX_ifM].identity =IX_ifM;
-  protocol_ms->rrc.ue_meas_rep[IX_ifM].meas_results_type =MR_intraFreqMeasuredResultsList;
-
-  // Intra-Freq measurements - Temp dummy values
-  protocol_ms->rrc.ue_meas_rep[IX_ifM].if_num_cells =MAXMEASCELLS;
-
-  for (i=0; i<protocol_ms->rrc.ue_meas_rep[IX_ifM].if_num_cells; i++) {
-    protocol_ms->rrc.ue_meas_rep[IX_ifM].if_cell_id[i]=i;
-    protocol_ms->rrc.ue_meas_rep[IX_ifM].if_cell_parms_id[i]=16+(4*i); //0-127
-    protocol_ms->rrc.ue_meas_rep[IX_ifM].if_BCH_RSCP[i]=100+(10*i);    //0-127
-    protocol_ms->rrc.ue_meas_rep[IX_ifM].if_pathloss[i]=46+(100*i);    //46-173
-
-    for (j=0; j<14; j++)
-      protocol_ms->rrc.ue_meas_rep[IX_ifM].if_slot_iscp[i][j]=50+(40*i)+j;    //0-127
-  }
-}
-
-//-------------------------------------------------------------------
-// Performs the Internal UE measurements in L1
-void rrc_ue_measure_tv (void)
-{
-  //-------------------------------------------------------------------
-  int i, numRBs;
-
-  protocol_ms->rrc.rrc_ue_last_measurement = IX_tvM;
-
-  protocol_ms->rrc.ue_meas_rep[IX_tvM].identity = IX_tvM;
-  protocol_ms->rrc.ue_meas_rep[IX_tvM].meas_results_type = MR_trafficVolumeMeasuredResultsList;
-
-  // Traffic Volume measurements - Temp dummy values
-  numRBs = MAXMEASRBS;
-  protocol_ms->rrc.ue_meas_rep[IX_tvM].tv_num_rbs = numRBs;
-
-  for (i = 0; i < numRBs; i++) {
-    protocol_ms->rrc.ue_meas_rep[IX_tvM].tv_rbid[i] = i;
-    protocol_ms->rrc.ue_meas_rep[IX_tvM].tv_rb_payload[i] = 2 * i;      //0-19
-    protocol_ms->rrc.ue_meas_rep[IX_tvM].tv_rb_average[i] = (2 * i) + 5;        //0-19
-    protocol_ms->rrc.ue_meas_rep[IX_tvM].tv_rb_variance[i] = i + 2;     //0-104
-  }
-}
-
-//-------------------------------------------------------------------
-// Performs the Internal UE measurements in L1
-void rrc_ue_measure_q (void)
-{
-  //-------------------------------------------------------------------
-  //    u16 q_num_TrCH;
-  //    u16 q_dl_TrCH_id[MAXMEASTRCH];
-  //    u16 q_dl_TrCH_BLER[MAXMEASTRCH];
-  //    u16 q_num_tfcs;
-  //    u16 q_tfcs_id[MAXMEASTFCS];
-  //    u16 q_sir[MAXMEASTFCS][maxTS];
-  int i,j,numTrCH=MAXMEASTRCH,numTFCS=MAXMEASTFCS;
-
-  protocol_ms->rrc.rrc_ue_last_measurement = IX_qM;
-
-  protocol_ms->rrc.ue_meas_rep[IX_qM].identity =IX_qM;
-  protocol_ms->rrc.ue_meas_rep[IX_qM].meas_results_type = MR_qualityMeasuredResults;
-
-  // Quality measurements - Temp dummy values
-  numTrCH = MAXMEASTRCH;
-  protocol_ms->rrc.ue_meas_rep[IX_qM].q_num_TrCH = numTrCH;
-
-  for (i=0; i<numTrCH; i++) {
-    protocol_ms->rrc.ue_meas_rep[IX_qM].q_dl_TrCH_id[i]=i;
-    protocol_ms->rrc.ue_meas_rep[IX_qM].q_dl_TrCH_BLER[i]=((i+1)*4)-1;  //0-63
-  }
-
-  numTFCS = MAXMEASTFCS;
-  protocol_ms->rrc.ue_meas_rep[IX_qM].q_num_tfcs = numTFCS;
-
-  for (i=0; i<numTFCS; i++) {
-    protocol_ms->rrc.ue_meas_rep[IX_qM].q_tfcs_id[i]=i;
-
-    for (j=0; j<14; j++)
-      protocol_ms->rrc.ue_meas_rep[IX_qM].q_sir[i][j]=(5*(i+1))+j+10;    //0-63
-  }
-}
-
-
-//-------------------------------------------------------------------
-// Performs the Internal UE measurements in L1
-void rrc_ue_measure_int_ue (void)
-{
-  //-------------------------------------------------------------------
-  //    u16 num_measurement_counter;
-  //    u16 identity;
-  //    u16 meas_results_type;
-  //    u16 int_xmit_power[maxTS];
-  //    u16 int_timing_advance;
-  int i;
-
-  protocol_ms->rrc.rrc_ue_last_measurement = IX_iueM;
-
-  protocol_ms->rrc.ue_meas_rep[IX_iueM].identity =IX_iueM;
-  protocol_ms->rrc.ue_meas_rep[IX_iueM].meas_results_type = MR_ue_InternalMeasuredResults;
-
-  // internal UE measurements - Temp dummy values
-  for (i=0; i<14; i++)
-    protocol_ms->rrc.ue_meas_rep[IX_iueM].int_xmit_power[i]=25+(6*i);  //0-104
-
-  protocol_ms->rrc.ue_meas_rep[IX_iueM].int_timing_advance =63;      //0-63
-}
-
-//-------------------------------------------------------------------
-// stop and clean the measurement process
-void  rrc_ue_cleanup_meas_ctl (int m_id)
-{
-  //-------------------------------------------------------------------
-  memset (&(protocol_ms->rrc.ue_meas_cmd[m_id]), 0, sizeof (struct rrc_ue_meas_cmd));
-}
-
-//-------------------------------------------------------------------
-// Activates the measurement process
-void rrc_ue_trigger_measure (void)
-{
-  //-------------------------------------------------------------------
-  int  m_id;
-  m_id = protocol_ms->rrc.rrc_ue_meas_to_activate;
-
-  switch (protocol_ms->rrc.ue_meas_cmd[m_id].command) {
-  case MC_setup:
-  case MC_modify:
-#ifdef DEBUG_RRC_STATE
-    msg ("[RRC_MSG] UE activates measurement: %d\n\n", m_id);
-#endif
-    protocol_ms->rrc.ue_meas_rep[m_id].meas_counter = protocol_ms->rrc.ue_meas_cmd[m_id].rep_amount;
-    protocol_ms->rrc.ue_meas_rep[m_id].meas_interval = protocol_ms->rrc.ue_meas_cmd[m_id].rep_interval / 10;
-    protocol_ms->rrc.ue_meas_rep[m_id].meas_start = protocol_ms->rrc.current_SFN % protocol_ms->rrc.ue_meas_rep[m_id].meas_interval;
-
-    if (!protocol_ms->rrc.ue_meas_rep[m_id].meas_counter)
-      protocol_ms->rrc.ue_meas_rep[m_id].meas_counter = -1;
-
-    break;
-
-  case MC_release:
-#ifdef DEBUG_RRC_STATE
-    msg ("[RRC_MSG] UE stops measurement: %d\n\n", m_id);
-#endif
-    protocol_ms->rrc.ue_meas_rep[m_id].meas_start = 0;
-    protocol_ms->rrc.ue_meas_rep[m_id].meas_counter = 0;
-    protocol_ms->rrc.ue_meas_rep[m_id].meas_interval = 0;
-    rrc_ue_cleanup_meas_ctl (m_id);
-    break;
-
-  default:
-    msg ("[RRC_MSG] Invalid Measure command received: %d\n\n", protocol_ms->rrc.ue_meas_cmd[m_id].command);
-  }
-}
-
-//-------------------------------------------------------------------
-// Triggers the necessary measurements in L1
-void rrc_ue_sync_measures (int time, int *message_id)
-{
-  //-------------------------------------------------------------------
-  int i;
-
-  for (i = 0; i < MAXMEASTYPES; i++) {
-    if ((protocol_ms->rrc.ue_meas_rep[i].meas_counter) && (protocol_ms->rrc.ue_meas_rep[i].meas_start == time % protocol_ms->rrc.ue_meas_rep[i].meas_interval)) {
-      switch (i) {
-      case IX_ifM:
-        // Measurement Report - Intra-frequency
-#ifdef DEBUG_RRC_MEASURE_REPORT_MAIN
-        msg ("[RRC_MSG] UE sends Measurement Report (Intra-freq) message at time : %d\n\n", time);
-#endif
-        rrc_ue_measure_if ();
-        break;
-
-      case IX_tvM:
-        // Measurement Report - Traffic Volume
-#ifdef DEBUG_RRC_MEASURE_REPORT_MAIN
-        msg ("[RRC_MSG] UE sends Measurement Report (Traffic Volume) message at time : %d\n\n", time);
-#endif
-        rrc_ue_measure_tv ();
-        break;
-
-      case IX_qM:
-        // Measurement Report - Quality
-#ifdef DEBUG_RRC_MEASURE_REPORT_MAIN
-        msg ("[RRC_MSG] UE sends Measurement Report (Quality) message at time : %d\n\n", time);
-#endif
-        rrc_ue_measure_q ();
-        break;
-
-      case IX_iueM:
-        // Measurement Report - internal UE
-#ifdef DEBUG_RRC_MEASURE_REPORT_MAIN
-        msg ("[RRC_MSG] UE sends Measurement Report (Int UE) message at time : %d\n\n", time);
-#endif
-        rrc_ue_measure_int_ue ();
-        break;
-      }
-
-      protocol_ms->rrc.ue_meas_rep[i].meas_counter--;
-      rrc_ue_msg_measrep (message_id);
-
-      if (protocol_ms->rrc.ue_meas_cmd[i].xfer_mode == acknowledgedModeRLC)
-        RRC_UE_O_O_SEND_DCCH_AM (*message_id);
-      else
-        RRC_UE_O_O_SEND_DCCH_UM (*message_id);
-
-      return;
-
-      if (!protocol_ms->rrc.ue_meas_rep[i].meas_counter)
-        rrc_ue_cleanup_meas_ctl (i);
-    }
-  }
-}
diff --git a/openair2/RRC/CELLULAR/rrc_ue_data.c b/openair2/RRC/CELLULAR/rrc_ue_data.c
deleted file mode 100755
index 58108c0c2b..0000000000
--- a/openair2/RRC/CELLULAR/rrc_ue_data.c
+++ /dev/null
@@ -1,240 +0,0 @@
-/***************************************************************************
-                          rrc_ue_data.c  -  description
-                             -------------------
-    begin                : Nov 10, 2001
-    copyright            : (C) 2001, 2010 by Eurecom
-    author               : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  This file contains the definition of the functions called by Esterel FSM
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_ue_vars.h"
-#include "rrc_messages.h"
-#include "as_configuration.h"
-//-------------------------------------------------------------------
-#include "rrc_proto_fsm.h"
-#include "rrc_proto_int.h"
-
-// #include "mac_ue_proto_extern.h"
-// #ifndef USER_MODE
-// #ifndef BYPASS_L1
-// #include "daq.h"
-// #include "L1L_extern.h"
-//   #endif
-//   #endif
-
-/* Initialization
-  input parm: User Equipment Id*/
-//-------------------------------------------------------------------
-void rrc_ue_fsm_init (int Id)
-{
-  //-------------------------------------------------------------------
-  // execute reset
-  RRC_UE_reset ();
-  RRC_UE ();
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM] UE_ID_INIT initialized to %d \n", Id);
-#endif
-  // First init tick
-  RRC_UE_I_UE_ID_INIT (Id);
-  RRC_UE ();
-}
-
-/* Input trigger functions - to be called by rrc_ue_fsm_control() only */
-
-//-------------------------------------------------------------------
-void rrc_NAS_Conn_Est_Req_Rx (void)
-{
-  //-------------------------------------------------------------------
-  // send input signal NAS_CONN_ESTABLISHMENT_REQ
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM-IN] Conn_establishment_req message from NAS \n");
-#endif
-  RRC_UE_I_I_NAS_CONN_ESTABLISHMENT_REQ ();
-  RRC_UE ();
-}
-
-//-------------------------------------------------------------------
-void rrc_NAS_Conn_Release_Req_Rx (void)
-{
-  //-------------------------------------------------------------------
-  // send input signal NAS_CONN_RELEASE_REQ
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM-IN] Conn_release_req message from NAS \n");
-#endif
-  RRC_UE_I_I_NAS_CONN_RELEASE_REQ ();
-  RRC_UE ();
-}
-
-//-------------------------------------------------------------------
-void rrc_RRC_Conn_Setup_rx (int Id, int State)
-{
-  //-------------------------------------------------------------------
-  // send input signal RRC_Conn_Setup
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM-IN] Connection Setup Received, Id %d, state %d.\n", Id, State);
-#endif
-  RRC_UE_I_UE_ID_MSG (Id);
-  RRC_UE_I_I_IE_RRC_State (State);
-  RRC_UE_I_I_RRC_CONNECTION_SETUP ();
-  RRC_UE ();
-}
-
-//-------------------------------------------------------------------
-void rrc_RRC_Conn_Reject_rx (int Id, int WaitTime)
-{
-  //-------------------------------------------------------------------
-  // send input signal RRC_Conn_Reject
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM-IN] Connection Reject Received, Id %d, wait time %d.\n", Id, WaitTime);
-#endif
-  RRC_UE_I_UE_ID_MSG (Id);
-  RRC_UE_I_I_Wait_Time (WaitTime);
-  RRC_UE_I_I_RRC_CONNECTION_REJECT ();
-  RRC_UE ();
-}
-
-//-------------------------------------------------------------------
-void rrc_RRC_Conn_Reject_Freq_rx (int Id, int WaitTime)
-{
-  //-------------------------------------------------------------------
-  // send input signal RRC_Conn_Reject
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM-IN] Connection Reject Received w/ IE_Freq_Info, Id %d, wait time %d.\n", Id, WaitTime);
-#endif
-  RRC_UE_I_UE_ID_MSG (Id);
-  RRC_UE_I_I_Wait_Time (WaitTime);
-  RRC_UE_I_I_IE_Freq_Info ();
-  RRC_UE_I_I_RRC_CONNECTION_REJECT ();
-  RRC_UE ();
-}
-
-//-------------------------------------------------------------------
-void rrc_RRC_Conn_Release_DCCH_rx (void)
-{
-  //-------------------------------------------------------------------
-  // RRC_CONN_RELEASE has been received on DCCH
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM-IN] Connection Release received on DCCH.\n");
-#endif
-  RRC_UE_I_I_RRC_CONNECTION_RELEASE ();
-  RRC_UE_I_I_rcved_on_DCCH ();
-  RRC_UE ();
-}
-
-//-------------------------------------------------------------------
-void rrc_RRC_Conn_Release_CCCH_rx (void)
-{
-  //-------------------------------------------------------------------
-  // RRC_CONN_RELEASE has been received on CCCH
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM-IN] Connection Release received on CCCH.\n");
-#endif
-  RRC_UE_I_I_RRC_CONNECTION_RELEASE ();
-  RRC_UE_I_I_rcved_on_CCCH ();
-  RRC_UE ();
-}
-
-//-------------------------------------------------------------------
-void PHY_Setup_rx (void)
-{
-  //-------------------------------------------------------------------
-  // simulate PHY_Synch received (DCH established)
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM-IN] PHY_Synch_Success Received \n");
-#endif
-  RRC_UE_I_I_CPHY_SYNCH_IND ();
-  RRC_UE ();
-}
-
-//-------------------------------------------------------------------
-void PHY_Synch_Failure_rx (void)
-{
-  //-------------------------------------------------------------------
-  // simulate PHY_Failure received (DCH failed to established)
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM-IN] PHY_Synch_Failure Received \n");
-#endif
-  RRC_UE_I_I_CPHY_SYNCH_Failure ();
-  RRC_UE ();
-}
-
-//-------------------------------------------------------------------
-void PHY_Connection_Loss_rx (void)
-{
-  //-------------------------------------------------------------------
-  // simulate PHY_Connection_Loss received (DCH failed to established)
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM-IN] PHY_Connection_Loss Received \n");
-#endif
-  RRC_UE_I_I_CPHY_CONNECTION_LOSS ();
-  RRC_UE ();
-}
-
-//-------------------------------------------------------------------
-void RLC_Data_Confirm_rx (void)
-{
-  //-------------------------------------------------------------------
-  // RLC_Data_Confirm received
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM-IN] RLC_Data_Confirm Received\n");
-#endif
-  RRC_UE_I_I_RLC_Success ();
-  RRC_UE ();
-}
-
-//-------------------------------------------------------------------
-void RLC_failure_rx (void)
-{
-  //-------------------------------------------------------------------
-  // RLC_Data_Failure received
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM-IN] RLC_Data_Failure Received\n");
-#endif
-  RRC_UE_I_I_RLC_Failure ();
-  RRC_UE ();
-}
-
-//-------------------------------------------------------------------
-void TIMER_T300_Timeout (void)
-{
-  //-------------------------------------------------------------------
-  // Notify T300 Time-out
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM-IN] Timer T300 has expired.\n");
-#endif
-  RRC_UE_I_I_T300_TimeOut ();
-  RRC_UE ();
-}
-
-//-------------------------------------------------------------------
-void TIMER_T308_Timeout (void)
-{
-  //-------------------------------------------------------------------
-  // Notify T308 Time-out
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM-IN] Timer T308 has expired.\n");
-#endif
-  RRC_UE_I_I_T308_TimeOut ();
-  RRC_UE ();
-}
-
-//-------------------------------------------------------------------
-void Wait_Timer_Timeout (void)
-{
-  //-------------------------------------------------------------------
-  // Notify T308 Time-out
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM-IN] CONN REJECT wait timer has expired.\n");
-#endif
-  RRC_UE_I_I_WaitTimerExpired ();
-  RRC_UE ();
-}
diff --git a/openair2/RRC/CELLULAR/rrc_ue_dummies.c b/openair2/RRC/CELLULAR/rrc_ue_dummies.c
deleted file mode 100755
index e78f413e0a..0000000000
--- a/openair2/RRC/CELLULAR/rrc_ue_dummies.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/***************************************************************************
-                          rrc_ue_dummies.c - description
-                          -------------------
-    begin               : April 2009
-    copyright           : (C) 2005, 2010 by Eurecom
-    created by    : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-      TEMP - This file contains dummy functions to be removed
- **************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_ue_vars.h"
-
-void rrc_compress_config (MT_CONFIG * config, char *dest_buffer, int *dest_length)
-{
-#ifdef RRC_DEBUG_DUMMIES
-  msg ("\n[RRC][UE-DUMMIES] CALL to rrc_compress_config\n");
-#endif
-}
-
-void rrc_uncompress_config (MT_CONFIG * config, char *source_buffer)
-{
-#ifdef RRC_DEBUG_DUMMIES
-  msg ("\n[RRC][UE-DUMMIES] CALL to rrc_uncompress_config\n");
-#endif
-}
diff --git a/openair2/RRC/CELLULAR/rrc_ue_entity.h b/openair2/RRC/CELLULAR/rrc_ue_entity.h
deleted file mode 100755
index 36c3df1eea..0000000000
--- a/openair2/RRC/CELLULAR/rrc_ue_entity.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/********************************************************************
-                          rrc_ue_entity.h  -
-                          -------------------
-    copyright            : (C) 2001, 2010 by Eurecom
-    created by     : Lionel.Gauthier@eurecom.fr
-    modified by          : Michelle.Wetterwald@eurecom.fr
- ********************************************************************
-  Data structure with RRC UE protocol parameters
- *******************************************************************/
-
-#ifndef __RRC_UE_ENTITY_H__
-#define __RRC_UE_ENTITY_H__
-//-------------------------------------------------------------------
-#include "rrc_platform_types.h"
-#include "rrc_constant.h"
-#include "rrc_ue_bch_variables.h"
-#include "rrm_config_structs.h"
-#include "rrc_ue_variables.h"
-#include "rrc_ue_mbms_variables.h"
-#include "rrc_ue_L2_intf_variables.h"
-
-/********************************************************************
-*                        Protocol variables                         *
-********************************************************************/
-
-struct rrc_ue_entity {
-  //-------------------------------------------------------------------
-  // implementation variables
-  int protocol_state;       //values in rrc_constant.h
-  int ue_initial_id;
-  u32 local_connection_ref;
-  u16 cell_id;
-  int current_SFN;
-
-  struct rrc_neighbor_cells rg_ngbr_list;
-  char IMEI[14];
-  u8  establishment_cause;
-  u8  release_cause;
-  //  u8  failure_cause;        // not mw
-  //  u8  failure_indicator;    // boolean - not mw
-  u32 next_MUI;     // for RLC AM
-  int idata_xfer;   // flag for Initial data transfer
-
-  int last_message_sent;
-  //Added MSG1
-  u8  prot_error_indicator; // boolean
-  u16 nextActivationTime;
-  int next_state;
-  struct rrc_ue_msg_infos ue_msg_infos;
-  struct rrc_ue_trans accepted_trans[MAXTRANS];
-  struct rrc_ue_trans rejected_trans[MAXTRANS];
-  struct rrc_ue_trans rcved_trans;      //transaction id received in last message
-  u16 c_rnti;
-  u16 u_rnti;
-  //Added MSG2
-  u8  am_RLC_ErrorIndicationRb2_3or4;
-  u8  am_RLC_ErrorIndicationRb5orAbove;
-  u8  rlc_Re_establishIndicatorRb2_3or4;
-  u8  rlc_Re_establishIndicatorRb5orAbove;
-  u8  cellUpdateCause;
-  u8  rejectWaitTime;
-  u16 ul_nas_message_lgth;
-  mem_block_t *ul_nas_message_ptr;
-  u16 dl_nas_message_lgth;
-  u8 *dl_nas_message_ptr;
-  u16 paging_message_lgth;
-  u8 *paging_message_ptr;
-  struct rrc_ue_rb_information ue_established_rbs[maxRB];
-  u16 num_rb;
-  //   u8  qos_classes[MAXURAB];
-  //   u8  dscp_codes[MAXURAB];
-  u16 requested_rbId;
-  u16 requested_QoSclass;
-  u16 requested_dscp;
-  u16 requested_sapid;
-
-  // platform configuration
-  int rrc_currently_updating;
-  RRM_VARS saved_configuration;
-
-  // link to L1
-  u8  rrc_ue_synch_ind;
-  u8  rrc_ue_cctrch_synch[maxCCTrCH];
-  u8  rrc_ue_cctrch[maxCCTrCH];
-  u8  rrc_ue_outsynch_ind;
-  u8  rrc_ue_cctrch_outsynch[maxCCTrCH];
-
-  /* ** OAI compatible part - begin **/
-  // Control block for srb-drb asn1-compliant
-  struct rrc_srb_drb_asn1 ue_rb_asn1;
-
-  // Control block for Broadcast asn1-compliant
-  struct rrc_ue_bch_asn1 ue_bch_asn1;
-  int mod_id;
-  /* ** OAI compatible part - end **/
-
-  // Control block for Broadcast
-  struct rrc_ue_bch_blocks ue_bch_blocks;
-
-  // Control blocks for measures
-  int rrc_ue_last_measurement;
-  int rrc_ue_meas_to_activate;
-  struct rrc_ue_meas_cmd ue_meas_cmd[MAXMEASTYPES];
-  struct rrc_ue_meas_rep ue_meas_rep[MAXMEASTYPES];
-
-  // Control block for MBMS
-  rrc_ue_mbms_variables mbms;
-
-  // pointer to next message to transmit to NAS
-  //   this is actually the start of a linked list
-  mem_block_t *NASMessageToXmit;
-  int ip_rx_irq;
-
-  // RT-fifo descriptors
-  int rrc_ue_GC_fifo;
-  int rrc_ue_NT_fifo;
-  int rrc_ue_DCIn_fifo;
-  int rrc_ue_DCOut_fifo;
-
-  //internal parameters
-  unsigned int ue_broadcast_counter; // temp for sending broadcast to NAS
-  int ue_wait_establish_req;  // possible values = 0 (init), 1 (SIB5 OK), 2 (SIB5 Not OK, SIB1 OK)
-  int L2_ccch_status;  // possible values = 0 (OFF), 1 (IN_PROGRESS), 2 (ON)
-  char ccch_buffer[100];
-  int ccch_buffer_size;
-  int rrc_ue_t300_target;
-  int rrc_ue_t300_retry;
-  int rrc_ue_ackSimu_flag;
-  unsigned int rrc_ue_ackSimu_mui;
-  unsigned int rrc_ue_ackSimu_srbid;
-  //list2_t rrc_timers;
-};
-
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_ue_esterfsm.c b/openair2/RRC/CELLULAR/rrc_ue_esterfsm.c
deleted file mode 100755
index e6e5e21a77..0000000000
--- a/openair2/RRC/CELLULAR/rrc_ue_esterfsm.c
+++ /dev/null
@@ -1,130 +0,0 @@
-/***************************************************************************
-                          rrc_ue_esterfsm.c  -  description
-                             -------------------
-    begin                : June 21, 2002
-    copyright            : (C) 2002, 2010 by Eurecom
-    author               : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  This file contains the function that prepares and controls the UE FSM
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_ue_vars.h"
-#include "rrc_messages.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_fsm.h"
-#include "rrc_proto_intf.h"
-//#include "mac_ue_proto_extern.h"
-
-// for FSM
-int started = 0;
-
-//-----------------------------------------------------------------------------
-void rrc_ue_fsm_control (int rrc_event)
-{
-  //-----------------------------------------------------------------------------
-  //#ifdef USER_MODE
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM] RX EVENT %d\n", rrc_event);
-#endif
-
-  //#endif
-  switch (rrc_event) {
-  case UE_PHY_SETUP:
-    //PHY_Setup_rx();
-    break;
-
-  case NAS_CONN_REQ:
-    rrc_NAS_Conn_Est_Req_Rx ();
-    break;
-
-  case RRC_CONNECT_SETUP:
-    rrc_RRC_Conn_Setup_rx (protocol_ms->rrc.ue_initial_id, protocol_ms->rrc.next_state);
-    PHY_Setup_rx ();
-    break;
-
-  case RRC_CONNECT_REJECT:
-    rrc_RRC_Conn_Reject_rx (protocol_ms->rrc.ue_initial_id, protocol_ms->rrc.rejectWaitTime);
-    break;
-
-  case UE_RB_SETUP:
-    ++protocol_ms->rrc.num_rb;  //Temp
-#ifdef DEBUG_RRC_STATE
-    msg ("[RRC][FSM] UE_RB_SETUP, num_rb = %d\n", protocol_ms->rrc.num_rb);
-#endif
-    rrc_rb_ue_RB_Setup_rx (protocol_ms->rrc.requested_rbId, protocol_ms->rrc.next_state, FALSE);
-    rrc_rb_ue_PHY_Setup_rx ();
-    break;
-
-  case UE_RB_RELEASE:
-    rrc_rb_ue_RB_Release_rx (protocol_ms->rrc.requested_rbId, protocol_ms->rrc.next_state, FALSE);
-    break;
-
-  case CELLU_CNF:
-    rrc_rb_ue_Cell_Update_cnf_rx ();
-    break;
-
-  case T300_TO:
-    TIMER_T300_Timeout ();
-    break;
-
-  case RRC_RLC_SUCCESS:
-    switch (protocol_ms->rrc.last_message_sent) {
-    case RRC_CONN_REQ:
-    case RRC_CONN_SETUP_COMPLETE:
-    case RRC_CONN_RELEASE:
-      RLC_Data_Confirm_rx ();
-      break;
-
-    case RB_SETUP_COMPLETE:
-    case RB_SETUP_FAILURE:
-    case RB_RELEASE_COMPLETE:
-    case RB_RELEASE_FAILURE:
-    case CELL_UPDATE:
-      rrc_rb_ue_RLC_Data_Confirm_rx ();
-      break;
-
-    default:
-      //nothing to do
-      break;
-    }
-
-    protocol_ms->rrc.last_message_sent = 0;
-    break;
-
-  case RRC_RLC_FAILURE:
-    RLC_failure_rx ();
-    break;
-
-  case NAS_REL_REQ:
-    rrc_NAS_Conn_Release_Req_Rx ();
-    break;
-
-  case UE_CRLC_STATUS:
-    rrc_rb_ue_CRLC_Status_rx ();
-    break;
-
-  case UE_CONN_LOSS:
-    PHY_Connection_Loss_rx ();
-    break;
-
-  case UE_CAP_INFO_CNF:
-    //Do nothing.
-    break;
-
-  default:
-    msg ("[RRC][FSM] Invalid call to RRC FSM control %d \n", rrc_event);
-    break;
-  }
-
-  if (rrc_event == NAS_CONN_REQ) {
-    started = 1;
-  }
-}
diff --git a/openair2/RRC/CELLULAR/rrc_ue_init.c b/openair2/RRC/CELLULAR/rrc_ue_init.c
deleted file mode 100755
index f48021e9e7..0000000000
--- a/openair2/RRC/CELLULAR/rrc_ue_init.c
+++ /dev/null
@@ -1,182 +0,0 @@
-/***************************************************************************
-                          rrc_ue_init.c
-                          -------------------
-    copyright            : (C) 2008, 2010 by Eurecom
-    created by           : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Initialization of RRC protocol entity for User Equipment
- ***************************************************************************/
-/********************
-// OpenAir includes
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "COMMON/openair_defs.h"
-#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
-#include "LAYER2/RLC/rlc.h"
-#include "COMMON/mac_rrc_primitives.h"
-
-//#include "SIMULATION/simulation_defs.h"
-//extern EMULATION_VARS *Emul_vars;
-//extern CH_MAC_INST *CH_mac_inst;
-//extern UE_MAC_INST *UE_mac_inst;
-
-/********************
-// RRC includes
- ********************/
-#include "rrc_ue_vars.h"
-#include "as_configuration.h"
-//#include "rrc_L2_proto.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_int.h"
-#include "rrc_proto_fsm.h"
-//#include "rrc_proto_intf.h"
-#include "rrc_proto_bch.h"
-#include "rrc_proto_mbms.h"
-//-----------------------------------------------------------------------------
-
-int *pt_nas_ue_irq;
-u8  nas_IMEI[14];
-#ifndef  USER_MODE
-EXPORT_SYMBOL(pt_nas_ue_irq);
-EXPORT_SYMBOL(nas_IMEI);
-#endif
-
-LCHAN_DESC BCCH_LCHAN_DESC,CCCH_LCHAN_DESC, DCCH_LCHAN_DESC, DTCH_DL_LCHAN_DESC,DTCH_UL_LCHAN_DESC;
-rlc_info_t Rlc_info_um;
-rlc_info_t Rlc_info_am_config;
-
-//-------------------------------------------------------------------
-void rrc_ue_get_mobile_id (void)
-{
-  //-------------------------------------------------------------------
-  // TEMP : This function sets the mobile ID - 1st version, hard coded
-  // Later, will be retrieved from configuration to allow sevearl mobile terminals
-
-  rrc_ue_mobileId = 0;
-  //#ifdef OAI_EMU
-#ifdef RRC_OAI_EMU
-  rrc_ue_mobileId = rrc_ethernet_id - 1;
-  msg ("[RRC CELL]rrc_ue_get_mobile_id - EMULATION - UE_ID initialized to: %d\n", rrc_ue_mobileId);
-#endif
-#ifndef RRC_OAI_EMU
-  msg ("[RRC CELL]rrc_ue_get_mobile_id - UE_ID not initialized. Use default value: %d\n", rrc_ue_mobileId);
-#endif
-}
-//-------------------------------------------------------------------
-int rrc_ue_get_initial_id (void)
-{
-  //-------------------------------------------------------------------
-  int UE_Id = 99;
-
-  //   #ifdef USER_MODE
-  //   int uni;
-  //
-  //   UE_Id = rrc_ue_mobileId;
-  //
-  //   uni = uniform ();
-  //   protocol_ms->rrc.IMEI[0] = (uni & 0x0F000000) >> 24;
-  //   protocol_ms->rrc.IMEI[1] = (uni & 0x000F0000) >> 16;
-  //   protocol_ms->rrc.IMEI[2] = (uni & 0x00000F00) >> 8;
-  //   protocol_ms->rrc.IMEI[3] = uni & 0x0000000F;
-  //   uni = uniform ();
-  //   protocol_ms->rrc.IMEI[4] = (uni & 0x0F000000) >> 24;
-  //   protocol_ms->rrc.IMEI[5] = (uni & 0x000F0000) >> 16;
-  //   protocol_ms->rrc.IMEI[6] = (uni & 0x00000F00) >> 8;
-  //   protocol_ms->rrc.IMEI[7] = uni & 0x0000000F;
-  //   uni = uniform ();
-  //   protocol_ms->rrc.IMEI[8] = (uni & 0x0F000000) >> 24;
-  //   protocol_ms->rrc.IMEI[9] = (uni & 0x000F0000) >> 16;
-  //   protocol_ms->rrc.IMEI[10] = (uni & 0x00000F00) >> 8;
-  //   protocol_ms->rrc.IMEI[11] = uni & 0x0000000F;
-  //   uni = uniform ();
-  //   protocol_ms->rrc.IMEI[12] = (uni & 0x0F000000) >> 24;
-  //   protocol_ms->rrc.IMEI[13] = (uni & 0x000F0000) >> 16;
-  //   #else
-
-  protocol_ms->rrc.IMEI[0] = IMEI_D0;
-  protocol_ms->rrc.IMEI[1] = IMEI_D1;
-  protocol_ms->rrc.IMEI[2] = IMEI_D2;
-  protocol_ms->rrc.IMEI[3] = IMEI_D3;
-  protocol_ms->rrc.IMEI[4] = IMEI_D4;
-  protocol_ms->rrc.IMEI[5] = IMEI_D5;
-  protocol_ms->rrc.IMEI[6] = IMEI_D6;
-  protocol_ms->rrc.IMEI[7] = IMEI_D7;
-  protocol_ms->rrc.IMEI[8] = IMEI_D8;
-  protocol_ms->rrc.IMEI[9] = IMEI_D9;
-  protocol_ms->rrc.IMEI[10] = IMEI_D10;
-  protocol_ms->rrc.IMEI[11] = IMEI_D11;
-  protocol_ms->rrc.IMEI[12] = IMEI_D12;
-  protocol_ms->rrc.IMEI[13] = rrc_ue_mobileId;
-  //   protocol_ms->rrc.IMEI[13] = IMEI_D13;
-  //   #endif
-  UE_Id = 32- rrc_ue_mobileId;
-
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC CELL]rrc_ue_get_initial_id (UE_ID %d) IMEI initialized to:", UE_Id);
-  rrc_print_buffer ((char *)protocol_ms->rrc.IMEI, 14);
-#endif
-  return UE_Id;
-}
-
-//-----------------------------------------------------------------------------
-void rrc_ue_init (u8 Mod_id)
-{
-  //-----------------------------------------------------------------------------
-  //  int i;
-#ifdef DEBUG_RRC_STATE
-  printk("\n\n***********************************************\n");
-  printk("**************[RRC CELL][UE-INIT]**************\n");
-  printk("***********************************************\n");
-#endif
-  printk("[RRC CELL][UE-INIT] Init UE function start\n");
-
-  // Initialize the control block for variables
-  pool_buffer_init();
-  protocol_ms = &prot_pool_ms;
-  memset ((char *)protocol_ms, 0, sizeof (struct protocol_pool_ms));
-
-  rrm_config = &rrc_as_config;
-  memset ((char *)rrm_config, 0, sizeof (RRM_VARS));
-
-  rrc_release_all_ressources = 0;
-
-  protocol_ms->rrc.ue_wait_establish_req = 0;
-  protocol_ms->rrc.protocol_state = RRC_UE_IDLE;
-  protocol_ms->rrc.u_rnti = 0;
-  protocol_ms->rrc.cell_id = 0;
-  protocol_ms->rrc.mod_id = Mod_id; //Saved for future use in rrc_ue_L2_frontend.c
-  //list2_init (&protocol_ms->rrc.rrc_timers, NULL);
-
-  rrc_ue_bch_init ();
-  rrc_rb_ue_init ();
-
-  // initialise NAS global variables
-  pt_nas_ue_irq = (int *) &(protocol_ms->rrc.ip_rx_irq);
-  rrc_ue_get_mobile_id();  // Read mobile Id from command line parameters
-  protocol_ms->rrc.ue_initial_id = rrc_ue_get_initial_id ();
-  memcpy (nas_IMEI, (char *)protocol_ms->rrc.IMEI, 14);
-  rrc_ue_fsm_init (protocol_ms->rrc.ue_initial_id);
-  protocol_ms->rrc.rrc_currently_updating = FALSE;
-
-#ifdef USER_MODE
-#ifdef RRC_NETLINK
-  rrc_ue_netlink_init ();
-#else
-  rrc_ue_sap_init (); // init FIFOs towards NAS
-  //qos_fifo_open ();
-#endif
-#endif
-  //Initialise MBMS
-#ifdef ALLOW_MBMS_PROTOCOL
-  rrc_ue_mbms_init();
-#endif
-
-  rrc_init_mac_config();
-
-  //
-  printk("\n[RRC CELL][UE-INIT] cell_id %d\n",protocol_ms->rrc.cell_id );
-  printk("[RRC CELL][UE-INIT] Init UE function completed\n");
-  printk("***********************************************\n\n\n");
-
-}
-
diff --git a/openair2/RRC/CELLULAR/rrc_ue_main.c b/openair2/RRC/CELLULAR/rrc_ue_main.c
deleted file mode 100755
index 767f3a7c82..0000000000
--- a/openair2/RRC/CELLULAR/rrc_ue_main.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/***************************************************************************
-                          rrc_ue_main.c  -
-                          -------------------
-    begin                : Tue Jan 15 2002
-    copyright            : (C) 2002, 2010 by Eurecom
-    created by           : michelle.wetterwald@eurecom.fr
- **************************************************************************
-    This file contains the main function of the RRC module
- ***************************************************************************/
-//#include "rtos_header.h"
-//#include "platform.h"
-//#include "protocol_vars_extern.h"
-//#include "print.h"
-//-----------------------------------------------------------------------------
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-//-----------------------------------------------------------------------------
-/********************
-// RRC definitions
- ********************/
-#include "rrc_ue_vars.h"
-//#include "rrc_nas_sap.h"
-//#include "rrc_messages.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_int.h"
-//#include "rrc_proto_fsm.h"
-//#include "rrc_proto_intf.h"
-//#include "rrc_proto_bch.h"
-#include "rrc_proto_mbms.h"
-
-#include "umts_timer_proto_extern.h"
-
-//-----------------------------------------------------------------------------
-// entry point for rrc-ue process
-//void rrc_ue_main_scheduler (u8 Mod_id){
-int rrc_ue_main_scheduler(u8 Mod_id,u32 frame, u8 eNB_flag,u8 index)
-{
-  //-----------------------------------------------------------------------------
-  mem_block_t *p;
-  int Message_Id;
-
-  //     while(1)
-  //     {sleep(2);}
-
-  //  protocol_ms->rrc.current_SFN = Mac_rlc_xface->frame;
-  // protocol_ms->rrc.current_SFN = frame;
-
-  /*************/
-  // TODO TO BE REMOVED TEMP -- stop RRC process action (for early traces)
-  //if (protocol_ms->rrc.current_SFN > 300)
-  // return 0;
-
-#ifdef DEBUG_RRC_DETAILS
-
-  if (protocol_ms->rrc.current_SFN % 50 == 0) {
-    msg ("\n\n[RRC][MSG_TEST] System Time : %d\n", protocol_ms->rrc.current_SFN);
-#ifdef  DEBUG_RRC_BROADCAST
-    msg ("[RRC_BCH-UE] DEBUG ue_wait_establish_req = %d.\n", protocol_ms->rrc.ue_wait_establish_req );
-#endif
-  }
-
-#endif
-
-#ifdef ALLOW_MBMS_PROTOCOL
-  //     ATTENTION: This must be the first event of RRC process.
-  //     Used to find the beginning of the modification period.
-  rrc_ue_mbms_scheduling_check();
-#endif
-
-  if (rrc_release_all_ressources) {
-#ifdef DEBUG_RRC_STATE
-    msg ("[RRC_UE]rrc_ue_main_scheduler : release_radio_resources() \n");
-#endif
-    //mac_remove_all ();
-    //rb_remove_all ();
-    // Set RRM Functions to remove RBs, TrChs, CCTrChs
-    // Put UE in Cell-BCH mode
-    /* BYPASS_L1 */
-
-    rrc_release_all_ressources = 0;
-  }
-
-  // check L1
-  rrc_ue_L1_check ();
-
-
-  // check if there is some message to transmit to NAS and do it
-  if ((p = protocol_ms->rrc.NASMessageToXmit) != NULL) {
-    rrc_ue_write_FIFO (p);
-  } else {
-    if (protocol_ms->rrc.ue_broadcast_counter % 500 == 2) {
-      RRC_UE_O_NAS_MEASUREMENT_IND ();
-      rrc_ue_write_FIFO (protocol_ms->rrc.NASMessageToXmit);
-    }
-
-    // modulo to improve stability
-    protocol_ms->rrc.ue_broadcast_counter = (protocol_ms->rrc.ue_broadcast_counter++) % 1000000000;
-  }
-
-  // time out for SIB14 - cf RG
-  if (protocol_ms->rrc.ue_broadcast_counter % (protocol_ms->rrc.ue_bch_blocks.SIB14_timeout_value) == 2) {
-    protocol_ms->rrc.ue_bch_blocks.SIB14_timeout = TRUE;
-  }
-
-  // Wait for message in DC FIFO
-  //rrc_ue_read_DCin_FIFO ();  // old version before Netlink sockets
-  rrc_ue_read_FIFO();
-
-  // check for a time-out event
-  // umts_timer_check_time_out (&protocol_ms->rrc.rrc_timers, protocol_ms->frame_tick_milliseconds);
-  //umts_timer_check_time_out (&protocol_ms->rrc.rrc_timers, Mac_rlc_xface->frame/RRC_FRAME_DURATION);
-  if (protocol_ms->rrc.rrc_ue_t300_target >0) {
-#ifdef DEBUG_RRC_STATE
-    msg ("[RRC_UE][DEBUG]rrc_ue_main_scheduler: T300 running at frame %d , target %d, msg length %d\n",
-         protocol_ms->rrc.current_SFN, protocol_ms->rrc.rrc_ue_t300_target, protocol_ms->rrc.ue_msg_infos.msg_length);
-#endif
-  }
-
-  if (protocol_ms->rrc.rrc_ue_t300_target == protocol_ms->rrc.current_SFN) {
-    rrc_ue_t300_timeout();
-  }
-
-  // Measurements
-  //rrc_ue_meas_loop();   // for test only
-  //check if report of measure needed in UE
-  rrc_ue_sync_measures (protocol_ms->rrc.current_SFN, &Message_Id);
-
-  // TEMP - 06/02/2013
-  // PDCP does not returm ack in AM mode, so it is simulated here to process with the FSM
-  if (protocol_ms->rrc.rrc_ue_ackSimu_flag ==1)
-    rrc_ue_simu_receive_ack_from_rlc();
-
-  //Force Uplink RLC communication
-  rrc_ue_force_uplink ();
-
-#ifdef USER_MODE
-  fflush(stdout);
-#endif
-
-  return 0;
-}
diff --git a/openair2/RRC/CELLULAR/rrc_ue_mbms_decode.c b/openair2/RRC/CELLULAR/rrc_ue_mbms_decode.c
deleted file mode 100755
index 8ae17bd949..0000000000
--- a/openair2/RRC/CELLULAR/rrc_ue_mbms_decode.c
+++ /dev/null
@@ -1,344 +0,0 @@
-/***************************************************************************
-                          rrc_ue_mbms_decode.c - description
-                          -------------------
-    begin               : May 30, 2005
-    copyright           : (C) 2005, 2010 by Eurecom
-    created by          : Huu-Nghia.Nguyen@eurecom.fr
-    modified by         : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Procedures to Decode received MBMS messages on MCCH, DCCH, MSCH
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_ue_vars.h"
-#include "rrc_mbms_pdus.h"
-#include "rrc_msg_class.h"
-#include "rrc_ue_mbms_variables.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_mbms.h"
-#include "rrc_proto_int.h"
-
-//-----------------------------------------------------------------------------
-// Generic function to decode RRC messages received on MCCH
-//void rrc_ue_mcch_decode (mem_block_t * sduP, u16 length){
-void rrc_ue_mcch_decode (char * sduP, int offset)
-{
-  //-----------------------------------------------------------------------------
-  MCCH_Message * mcch_msg;
-  int  status = SUCCESS;
-#ifdef DEBUG_RRC_MBMS_DETAIL
-  msg ("\n[RRC_UE][MBMS][DECODE]Decoding from MCCH -- start of message: \n");
-  rrc_print_buffer (&sduP[offset], 15);
-#endif
-  mcch_msg = (MCCH_Message *)&sduP[offset];
-#ifdef DEBUG_RRC_MBMS
-  msg("\033[0;32m[RRC-UE][MBMS][RX] ");
-
-  switch (mcch_msg->message.type) {
-  case MCCH_mbmsAccessInformation:
-    msg("AccessInformation");
-    break;
-
-  case MCCH_mbmsCommonPTMRBInformation:
-    msg("CommonPTMRBInformation");
-    break;
-
-  case MCCH_mbmsCurrentCellPTMRBInformation:
-    msg("CurrentCellPTMRBInformation");
-    break;
-
-  case MCCH_mbmsGeneralInformation:
-    msg("GeneralInformation");
-    break;
-
-  case MCCH_mbmsModifiedServicesInformation:
-    msg("ModifiedServicesInformation");
-    break;
-
-  case MCCH_mbmsNeighbouringCellPTMRBInformation:
-    msg("NeighbouringCellPTMRBInformation");
-    break;
-
-  case MCCH_mbmsUnmodifiedServicesInformation:
-    msg("UnmodifiedServicesInformation");
-    break;
-
-  default:
-    msg("ERROR : Unrecognized message type %d", mcch_msg->message.type);
-  }
-
-  msg(", MCCH , at frame %d\n\033[0m", protocol_ms->rrc.current_SFN);
-#endif
-  status = rrc_ue_mbms_MCCH_decode(mcch_msg);
-
-  if (status!=SUCCESS)
-    msg("\n[RRC-UE][MBMS][DECODE]Message from MCCH could not be decoded. %d \n", mcch_msg->message.type);
-}
-
-/**
- * @brief Used to decode the MCCH Messages, the decoded content is stored in p_ue_mbms->...
- * @date May 20, 2005 11:18:55 AM
- * @param mcch_msg_ptr: pointer of message MCCH to be decoded
- * @param length: length of data read on MCCH (length of the messsage)
- */
-//-----------------------------------------------------------------------------
-int rrc_ue_mbms_MCCH_decode(MCCH_Message *mcch_msg_ptr)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  int index = 0; // will return the index (in the list) where the neigbouring rb info is inserted
-
-  if (!mcch_msg_ptr) {
-    msg("[RRC-UE][MBMS] rrc_ue_mbms_MCCH_decode : mcch_msg_ptr is NULL\n");
-    status = FAILURE;
-    return status;
-  }
-
-  //Decode message
-  switch (mcch_msg_ptr->message.type) {
-    //----------------
-  case MCCH_mbmsAccessInformation:
-    status = rrc_PERDec_MBMSAccessInformation((MBMSAccessInformation*) &mcch_msg_ptr->message.content);
-    break;
-
-    //----------------
-  case MCCH_mbmsCommonPTMRBInformation:
-    if (p_ue_mbms->flags.commonPTMRBInformation) {
-#ifdef DEBUG_RRC_MBMS_DETAIL
-      msg("[RRC-UE][MBMS] Message %s has previously been decoded in the same current modification period\n", rrc_mbms_message_getName(MCCH_ID, 0, mcch_msg_ptr->message.type));
-#endif
-    } else {
-      if (p_ue_mbms->mustAcquireRBInfo == 0) {
-#ifdef DEBUG_RRC_MBMS_DETAIL
-        msg("[RRC-UE][MBMS] No need to acquire RB Information\n");
-#endif
-      } else {
-#ifdef DEBUG_RRC_MBMS_DETAIL
-        msg("[RRC-UE][MBMS] Procedure rrc_ue_mbms_MCCH_decode is now processing the message CommonPTMRBInformation \n");
-#endif
-        status = rrc_PERDec_MBMSCommonPTMRBInformation((MBMSCommonPTMRBInformation*) &mcch_msg_ptr->message.content);
-
-        if (status == P_SUCCESS) {
-          p_ue_mbms->flags.commonPTMRBInformation = TRUE;
-          RRC_UE_MBMS_I_COMMON_CELL_RB_INFO();
-          rrc_ue_mbms_fsm();
-        }
-      }
-    }
-
-    break;
-
-    //----------------
-  case MCCH_mbmsCurrentCellPTMRBInformation:
-    if (p_ue_mbms->flags.currentCellPTMRBInformation) {
-#ifdef DEBUG_RRC_MBMS_DETAIL
-      msg("[RRC-UE][MBMS] Message %s has previously been decoded in the same current modification period\n", rrc_mbms_message_getName(MCCH_ID,0 , mcch_msg_ptr->message.type));
-#endif
-    } else {
-      if (p_ue_mbms->mustAcquireRBInfo == 0) {
-#ifdef DEBUG_RRC_MBMS_DETAIL
-        msg("[RRC-UE][MBMS] No need to acquire RB Information\n");
-#endif
-      } else {
-#ifdef DEBUG_RRC_MBMS_DETAIL
-        msg("[RRC-UE][MBMS] Procedure rrc_ue_mbms_MCCH_decode is now processing the message CurrentCellPTMRBInformation \n");
-#endif
-        status = rrc_PERDec_MBMSCurrentCellPTMRBInformation((MBMSCurrentCellPTMRBInformation*) &mcch_msg_ptr->message.content);
-
-        if (status == P_SUCCESS) {
-          p_ue_mbms->flags.currentCellPTMRBInformation = TRUE;
-          RRC_UE_MBMS_I_CURRENT_CELL_RB_INFO();
-          rrc_ue_mbms_fsm();
-        }
-      }
-    }
-
-    break;
-
-    //----------------
-  case MCCH_mbmsGeneralInformation:
-    if (p_ue_mbms->flags.generalInformation) {
-#ifdef DEBUG_RRC_MBMS_DETAIL
-      msg("[RRC-UE][MBMS] Message %s has previously been decoded in the same current modification period\n", rrc_mbms_message_getName(MCCH_ID,0 , mcch_msg_ptr->message.type));
-#endif
-    } else {
-#ifdef DEBUG_RRC_MBMS_DETAIL
-      msg("[RRC-UE][MBMS] Procedure rrc_ue_mbms_MCCH_decode is now processing the message GeneralInformation \n");
-#endif
-      status = rrc_PERDec_MBMSGeneralInformation((MBMSGeneralInformation*) &mcch_msg_ptr->message.content);
-
-      if (status == P_SUCCESS)
-        p_ue_mbms->flags.generalInformation = 1;
-    }
-
-    break;
-
-    //----------------
-  case MCCH_mbmsModifiedServicesInformation:
-    if (p_ue_mbms->flags.modifiedServicesInformation) {
-#ifdef DEBUG_RRC_MBMS_DETAIL
-      msg("[RRC-UE][MBMS] Message %s has previously been decoded in the same current modification period\n", rrc_mbms_message_getName(MCCH_ID,0 , mcch_msg_ptr->message.type));
-#endif
-    } else {
-#ifdef DEBUG_RRC_MBMS_DETAIL
-      msg("[RRC-UE][MBMS] Procedure rrc_ue_mbms_MCCH_decode is now processing the message ModifiedServicesInformation \n");
-#endif
-      status = rrc_PERDec_MBMSModifiedServicesInformation((MBMSModifiedServicesInformation*) &mcch_msg_ptr->message.content);
-
-      if (status == P_SUCCESS) {
-        p_ue_mbms->flags.modifiedServicesInformation = TRUE;
-        RRC_UE_MBMS_I_MCCH_MODIF_SERV_INFO();
-
-        if (p_ue_mbms->mod_all_unmodified_ptm_services)
-          RRC_UE_MBMS_I_ALL_UNMODIF_PTM_SERVICES();
-
-        rrc_ue_mbms_fsm();
-      }
-    }
-
-    break;
-
-    //----------------
-  case MCCH_mbmsNeighbouringCellPTMRBInformation:
-#ifdef DEBUG_RRC_MBMS_DETAIL
-    msg("[RRC-UE][MBMS] Procedure rrc_ue_mbms_MCCH_decode is now processing the message NeighbouringCellPTMRBInformation \n");
-#endif
-    status = rrc_PERDec_MBMSNeighbouringCellPTMRBInformation(&index, (MBMSNeighbouringCellPTMRBInformation*) &mcch_msg_ptr->message.content);
-
-    if (status == P_SUCCESS) {
-      RRC_UE_MBMS_I_NEIGHBOURING_CELL_RB_INFO();
-      rrc_ue_mbms_fsm();
-    }
-
-    break;
-
-    //----------------
-  case MCCH_mbmsUnmodifiedServicesInformation:
-    if (p_ue_mbms->flags.unmodifiedServicesInformation) {
-#ifdef DEBUG_RRC_MBMS_DETAIL
-      msg("[RRC-UE][MBMS] Message %s has previously been decoded in the same current modification period\n", rrc_mbms_message_getName(MCCH_ID, 0 , mcch_msg_ptr->message.type));
-#endif
-    } else {
-      if (!p_ue_mbms->flags.modifiedServicesInformation) {
-#ifdef DEBUG_RRC_MBMS_DETAIL
-        msg("[RRC-UE][MBMS] Do nothing because there has not been any ModifiedServiceInformation message.\n");
-#endif
-      } else {
-#ifdef DEBUG_RRC_MBMS_DETAIL
-        msg("[RRC-UE][MBMS] Procedure rrc_ue_mbms_MCCH_decode is now processing the message UnmodifiedServicesInformation \n");
-#endif
-        status = rrc_PERDec_MBMSUnmodifiedServicesInformation((MBMSUnmodifiedServicesInformation*) &mcch_msg_ptr->message.content);
-
-        if (status == P_SUCCESS) {
-          p_ue_mbms->flags.unmodifiedServicesInformation = TRUE;
-          RRC_UE_MBMS_I_UNMODIF_SERV_INFO();
-          rrc_ue_mbms_fsm();
-        }
-      }
-    }
-
-    break;
-
-  default:
-    //nothing to do
-    status = FAILURE;
-  }
-
-  return status;
-}
-
-/**
- * @brief Used to decode the MBMSModificationServicesInformation on DCCH
- * the decoded content is stored in p_ue_mbms->...
- * @date May 20, 2005
- * @param dl_dcch_msg: message DCCH - MBMSModificationServicesInformation to be decoded
- * @param length: length of data read on DCCH (length of the messsage)
- */
-//-----------------------------------------------------------------------------
-int rrc_ue_mbms_DCCH_decode(DL_DCCH_Message *dl_dcch_msg_ptr)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  if (!dl_dcch_msg_ptr) {
-    msg("[RRC-UE][MBMS] rrc_ue_mbms_DCCH_decode : dl_dcch_msg_ptr is NULL\n");
-    status = FAILURE;
-    return status;
-  }
-
-#ifdef DEBUG_RRC_MBMS_DETAIL
-  msg("[RRC-UE][MBMS] Procedure rrc_ue_mbms_DCCH_decode is now processing the message MBMSModifiedServicesInformation\n");
-#endif
-
-  //Decode message
-  switch (dl_dcch_msg_ptr->message.type) {
-  case DL_DCCH_mbmsModifiedServicesInformation:
-    //We always decode this message
-    status = rrc_PERDec_MBMSModifiedServicesInformation((MBMSModifiedServicesInformation*) & dl_dcch_msg_ptr->message.content);
-
-    if (status == P_SUCCESS) {
-      RRC_UE_MBMS_I_MODIF_SERV_INFO();
-
-      if (p_ue_mbms->mod_all_unmodified_ptm_services) {
-        RRC_UE_MBMS_I_ALL_UNMODIF_PTM_SERVICES();
-        //p_ue_mbms->flags.unmodifiedServicesInformation = FALSE; //should reacquire UnmodifiedServiceInfo on MCCH.
-      }
-
-      rrc_ue_mbms_fsm();
-      //p_ue_mbms->flags.modifiedServicesInformation = TRUE; //don't need anymore to acquire ModifiedServiceInfo on MCCH.
-    }
-
-    break;
-
-  default:
-    status = FAILURE;
-    //nothing to do
-  }
-
-  return status;
-}
-
-/**
- * @brief Used to decode the messages on MSCH
- * the decoded content is stored in p_ue_mbms->...
- * @date May 30, 2005 4:08:30 PM
- * @param msch_msg_ptr: message MSCH - MSCHSchedulingInformation to be decoded
- * @param length: length of data read on MSCH (length of the messsage)
- */
-//-----------------------------------------------------------------------------
-int rrc_ue_mbms_MSCH_decode(MSCH_Message *msch_msg_ptr)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  if (!msch_msg_ptr) {
-    msg("[RRC-UE][MBMS] rrc_ue_mbms_MSCH_decode : msch_msg_ptr is NULL\n");
-    status = FAILURE;
-    return status;
-  }
-
-  //decode msch message
-#ifdef DEBUG_RRC_MBMS_DETAIL
-  msg("[RRC-UE][MBMS] Procedure rrc_ue_mbms_MSCH_decode is now processing the message MSCHSchedulingInformation\n");
-#endif
-
-  //Decode message
-  switch (msch_msg_ptr->message.type) {
-  case MSCH_mbmsSchedulingInformation:
-    status = rrc_PERDec_MBMSSchedulingInformation( (MBMSSchedulingInformation*) & msch_msg_ptr->message.content);
-    break;
-
-  default:
-    //nothing to do
-    status = FAILURE;
-  }
-
-  return status;
-}
diff --git a/openair2/RRC/CELLULAR/rrc_ue_mbms_fsm.c b/openair2/RRC/CELLULAR/rrc_ue_mbms_fsm.c
deleted file mode 100755
index d3a275cb62..0000000000
--- a/openair2/RRC/CELLULAR/rrc_ue_mbms_fsm.c
+++ /dev/null
@@ -1,316 +0,0 @@
-/***************************************************************************
-                          rrc_ue_mbms_fsm.c - description
-                          -------------------
-    begin               : Jun 1, 2005
-    copyright           : (C) 2005, 2010 by Eurecom
-    created by          : Huu-Nghia.Nguyen@eurecom.fr
-    modified by         : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  This file implements the state machine for UE side.
-  The code is created manually in the same manner as Esterel.
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_ue_vars.h"
-#include "rrc_mbms_pdus.h"
-#include "rrc_msg_class.h"
-#include "rrc_ue_mbms_variables.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_mbms.h"
-
-//-----------------------------------------------------------------------------
-int stateAcquisition = ACQUI_START;
-//-----------------------------------------------------------------------------
-
-//INPUT
-//condition for acquisition
-mbms_bool I_CONTROLING_CELL_CHANGED;
-mbms_bool I_RETURN_FROM_LOSS_COVERAGE;
-mbms_bool I_ACTIVATED_SERVICE_CHANGED;
-mbms_bool I_SELECTING_CELL_MBMS;
-
-//determine if message arrive ?
-mbms_bool I_MODIF_SERV_INFO;
-mbms_bool I_MCCH_MODIF_SERV_INFO; //more detailed
-mbms_bool I_ALL_UNMODIF_PTM_SERVICES;
-mbms_bool I_UNMODIF_SERV_INFO;
-
-mbms_bool I_COMMON_CELL_RB_INFO;
-mbms_bool I_CURRENT_CELL_RB_INFO;
-
-mbms_bool I_NEIGHBOURING_CELL_RB_INFO;
-mbms_bool I_MODIF_PERIOD_ENDED;
-
-//local signal
-mbms_bool modifServInfoReceived = FALSE;
-//int ptmServCount = 0; //value is in protocol_ms->rrc.mbms.activatedServicesList.numService
-
-#ifdef DEBUG_UE_MBMS_FSM_TEST
-mbms_bool O_NAS_MBMS_UE_NOTIFY_IND;
-mbms_bool O_ANALYSE_UNMODIF;
-mbms_bool O_CURRENT_CELL_RB_CONFIGURATION;
-mbms_bool O_NEIGHBOURING_CELL_RB_CONFIGURATION;
-mbms_bool O_MCCH_NOTIFICATION;
-mbms_bool O_DCCH_NOTIFICATION;
-#endif
-
-//-----------------------------------------------------------------------------
-void RRC_UE_MBMS_I_CONTROLING_CELL_CHANGED(void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_UE_MBMS_FSM
-  msg("[RRC-UE][MBMS][FSM] input: I_CONTROLING_CELL_CHANGED\n");
-#endif
-  I_CONTROLING_CELL_CHANGED = TRUE;
-}
-
-//-----------------------------------------------------------------------------
-void RRC_UE_MBMS_I_RETURN_FROM_LOSS_COVERAGE(void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_UE_MBMS_FSM
-  msg("[RRC-UE][MBMS][FSM] input: I_RETURN_FROM_LOSS_COVERAGE\n");
-#endif
-  I_RETURN_FROM_LOSS_COVERAGE = TRUE;
-}
-
-//-----------------------------------------------------------------------------
-void RRC_UE_MBMS_I_ACTIVATED_SERVICE_CHANGED(void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_UE_MBMS_FSM
-  msg("[RRC-UE][MBMS][FSM] input: I_ACTIVATED_SERVICE_CHANGED\n");
-#endif
-  I_ACTIVATED_SERVICE_CHANGED = TRUE;
-}
-
-//-----------------------------------------------------------------------------
-void RRC_UE_MBMS_I_SELECTING_CELL_MBMS(void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_UE_MBMS_FSM
-  msg("[RRC-UE][MBMS][FSM] input: I_SELECTING_CELL_MBMS\n");
-#endif
-  I_SELECTING_CELL_MBMS = TRUE;
-}
-
-//-----------------------------------------------------------------------------
-void RRC_UE_MBMS_I_MODIF_SERV_INFO(void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_UE_MBMS_FSM
-  msg("[RRC-UE][MBMS][FSM] input: I_MODIF_SERV_INFO\n");
-#endif
-  I_MODIF_SERV_INFO = TRUE;
-  modifServInfoReceived = TRUE;
-}
-
-//-----------------------------------------------------------------------------
-void RRC_UE_MBMS_I_MCCH_MODIF_SERV_INFO(void)
-{
-  //-----------------------------------------------------------------------------
-  RRC_UE_MBMS_I_MODIF_SERV_INFO();
-#ifdef DEBUG_UE_MBMS_FSM
-  msg("[RRC-UE][MBMS][FSM] input: I_MCCH_MODIF_SERV_INFO\n");
-#endif
-  I_MCCH_MODIF_SERV_INFO = TRUE;
-}
-
-
-//-----------------------------------------------------------------------------
-void RRC_UE_MBMS_I_UNMODIF_SERV_INFO(void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_UE_MBMS_FSM
-  msg("[RRC-UE][MBMS][FSM] input: I_UNMODIF_SERV_INFO\n");
-#endif
-  I_UNMODIF_SERV_INFO = TRUE;
-}
-
-//-----------------------------------------------------------------------------
-void RRC_UE_MBMS_I_COMMON_CELL_RB_INFO(void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_UE_MBMS_FSM
-  msg("[RRC-UE][MBMS][FSM] input: I_COMMON_CELL_RB_INFO\n");
-#endif
-  I_COMMON_CELL_RB_INFO = TRUE;
-}
-
-//-----------------------------------------------------------------------------
-void RRC_UE_MBMS_I_CURRENT_CELL_RB_INFO(void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_UE_MBMS_FSM
-  msg("[RRC-UE][MBMS][FSM] input: I_CURRENT_CELL_RB_INFO\n");
-#endif
-  I_CURRENT_CELL_RB_INFO = TRUE;
-}
-
-//-----------------------------------------------------------------------------
-void RRC_UE_MBMS_I_NEIGHBOURING_CELL_RB_INFO(void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_UE_MBMS_FSM
-  msg("[RRC-UE][MBMS][FSM] input: I_NEIGHBOURING_CELL_RB_INFO\n");
-#endif
-  I_NEIGHBOURING_CELL_RB_INFO = TRUE;
-}
-
-//-----------------------------------------------------------------------------
-void RRC_UE_MBMS_I_MODIF_PERIOD_ENDED(void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_UE_MBMS_FSM
-  msg("[RRC-UE][MBMS][FSM] input: I_MODIF_PERIOD_ENDED\n");
-#endif
-  I_MODIF_PERIOD_ENDED = TRUE;
-}
-
-//-----------------------------------------------------------------------------
-void RRC_UE_MBMS_I_ALL_UNMODIF_PTM_SERVICES(void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_UE_MBMS_FSM
-  msg("[RRC-UE][MBMS][FSM] input: I_ALL_UNMODIF_PTM_SERVICES\n");
-#endif
-  I_ALL_UNMODIF_PTM_SERVICES = TRUE;
-}
-
-
-/**
- * @brief FSM for the RRC UE MBMS
- * @date Jun 1, 2005 2:48:00 PM
- */
-//-----------------------------------------------------------------------------
-void rrc_ue_mbms_fsm(void)
-{
-  //-----------------------------------------------------------------------------
-  // ptmServCount =  p_ue_mbms->act_numService;
-  switch (stateAcquisition) {
-  case ACQUI_START:
-    stateAcquisition = ACQUI_I_ACQUISITION;
-#ifdef DEBUG_UE_MBMS_FSM
-    msg("[RRC-UE][MBMS][FSM] transition: START to I_ACQUISITION\n");
-#endif
-    rrc_ue_mbms_fsm(); //Propagation
-    break;
-
-  case ACQUI_I_ACQUISITION:
-    if (I_CONTROLING_CELL_CHANGED || I_ACTIVATED_SERVICE_CHANGED ||
-        I_RETURN_FROM_LOSS_COVERAGE || I_SELECTING_CELL_MBMS) {
-#ifdef DEBUG_UE_MBMS_FSM
-      msg("[RRC-UE][MBMS][FSM] transition: I_ACQUISITION to WAIT_MBMS_MSG\n");
-#endif
-      stateAcquisition = ACQUI_WAIT_MBMS_MSG;
-      I_MODIF_PERIOD_ENDED = FALSE;
-      rrc_ue_mbms_fsm(); //Propagation
-    }
-
-    break;
-
-  case ACQUI_WAIT_MBMS_MSG:
-
-    //Notification
-    if (I_MODIF_SERV_INFO) {
-      if (I_MCCH_MODIF_SERV_INFO)
-        RRC_UE_MBMS_O_MCCH_NOTIFICATION();
-      else
-        RRC_UE_MBMS_O_DCCH_NOTIFICATION();
-
-      I_MCCH_MODIF_SERV_INFO = FALSE;
-      I_MODIF_SERV_INFO = FALSE;
-    }
-
-    if (I_ALL_UNMODIF_PTM_SERVICES && I_UNMODIF_SERV_INFO) {
-      I_UNMODIF_SERV_INFO = FALSE;
-      RRC_UE_MBMS_O_ANALYSE_UNMODIF();
-    }
-
-    //RB configuration
-    // if (ptmServCount > 0 && I_COMMON_CELL_RB_INFO && I_CURRENT_CELL_RB_INFO)
-    if (I_COMMON_CELL_RB_INFO && I_CURRENT_CELL_RB_INFO) {
-      RRC_UE_MBMS_O_CURRENT_CELL_RB_CONFIGURATION();
-      I_COMMON_CELL_RB_INFO = FALSE;
-      I_CURRENT_CELL_RB_INFO = FALSE;
-    }
-
-    // if (ptmServCount > 0 && I_NEIGHBOURING_CELL_RB_INFO)
-    if (I_NEIGHBOURING_CELL_RB_INFO) {
-      RRC_UE_MBMS_O_NEIGHBOURING_CELL_RB_CONFIGURATION();
-      I_NEIGHBOURING_CELL_RB_INFO = FALSE;
-    }
-
-    //End of modification period?
-    if (I_MODIF_PERIOD_ENDED) {
-      //This is an adaptation for OAI, we don't return to the initial state as specififed in TS 25.331
-      //Because, at this moment, the primitive NAS for UE is not specified yet
-#if 0
-      if (modifServInfoReceived) {
-#ifdef DEBUG_UE_MBMS_FSM
-        msg("[RRC-UE][MBMS][FSM] transition: WAIT_MBMS_MSG to I_ACQUISITION\n");
-#endif
-        stateAcquisition = ACQUI_I_ACQUISITION;
-        modifServInfoReceived = FALSE;
-        I_ACTIVATED_SERVICE_CHANGED = FALSE;
-        I_CONTROLING_CELL_CHANGED = FALSE;
-        I_RETURN_FROM_LOSS_COVERAGE = FALSE;
-        I_SELECTING_CELL_MBMS = FALSE;
-      }
-
-#endif
-      // else stay in this state!
-      I_MODIF_PERIOD_ENDED = FALSE;
-      I_MODIF_SERV_INFO = FALSE;
-      I_UNMODIF_SERV_INFO = FALSE;
-      I_COMMON_CELL_RB_INFO = FALSE;
-      I_CURRENT_CELL_RB_INFO = FALSE;
-      I_ALL_UNMODIF_PTM_SERVICES = FALSE;
-    }
-
-    break;
-  }
-}
-
-/**
- * @brief Reset the FSM.
- * @date Jun 1, 2005 2:48:16 PM
- * @warning must be called some where in the rrc_ue_mbms_init function
- */
-//-----------------------------------------------------------------------------
-void rrc_ue_mbms_fsm_reset(void)
-{
-  //-----------------------------------------------------------------------------
-  stateAcquisition = ACQUI_START;
-
-  //condition for acquisition
-  I_ACTIVATED_SERVICE_CHANGED = TRUE;
-  I_CONTROLING_CELL_CHANGED = FALSE;
-  I_RETURN_FROM_LOSS_COVERAGE = FALSE;
-  I_SELECTING_CELL_MBMS = FALSE;
-
-  //variables determining if messages arrive
-  I_MODIF_SERV_INFO = FALSE;
-  I_UNMODIF_SERV_INFO = FALSE;
-  I_COMMON_CELL_RB_INFO = FALSE;
-  I_CURRENT_CELL_RB_INFO = FALSE;
-  I_NEIGHBOURING_CELL_RB_INFO = FALSE;
-  I_MODIF_PERIOD_ENDED = FALSE;
-
-#ifdef DEBUG_UE_MBMS_FSM_TEST
-  O_NAS_MBMS_UE_NOTIFY_IND = FALSE;
-  O_ANALYSE_UNMODIF = FALSE;
-  O_CURRENT_CELL_RB_CONFIGURATION = FALSE;
-  O_NEIGHBOURING_CELL_RB_CONFIGURATION = FALSE;
-  O_MCCH_NOTIFICATION = FALSE;
-  O_DCCH_NOTIFICATION = FALSE;
-#endif
-  modifServInfoReceived = FALSE;
-}
diff --git a/openair2/RRC/CELLULAR/rrc_ue_mbms_outputs.c b/openair2/RRC/CELLULAR/rrc_ue_mbms_outputs.c
deleted file mode 100755
index 4c95f98bcb..0000000000
--- a/openair2/RRC/CELLULAR/rrc_ue_mbms_outputs.c
+++ /dev/null
@@ -1,534 +0,0 @@
-/***************************************************************************
-                          rrc_ue_mbms_outputs.c - description
-                          -------------------
-    begin               : Jun 1, 2005
-    copyright           : (C) 2005, 2010 by Eurecom
-    created by          : Huu-Nghia.Nguyen@eurecom.fr
-    modified by         : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-    This file implements the UE's output signals
- **************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_ue_vars.h"
-#include "rrc_mbms_pdus.h"
-#include "rrc_msg_class.h"
-#include "rrc_ue_mbms_variables.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_mbms.h"
-
-#ifdef MBMS_INTEGRATION_MODE
-#include "rrc_messages.h"
-#include "rrc_nas_primitives.h"
-#include "rrc_proto_int.h"
-#endif
-
-#ifdef DEBUG_UE_MBMS_FSM_TEST
-extern mbms_bool O_NAS_MBMS_UE_NOTIFY_IND;
-extern mbms_bool O_ANALYSE_UNMODIF;
-extern mbms_bool O_CURRENT_CELL_RB_CONFIGURATION;
-extern mbms_bool O_NEIGHBOURING_CELL_RB_CONFIGURATION;
-extern mbms_bool O_MCCH_NOTIFICATION;
-extern mbms_bool O_DCCH_NOTIFICATION;
-#endif
-//-----------------------------------------------------------------------------
-
-/**
- * @brief briefdescription
- * @date Aug 24, 2005 10:45:47 AM
- */
-//-----------------------------------------------------------------------------
-void rrc_ue_mbms_saveMCCHModifiedServiceInformation(void)
-{
-  //-----------------------------------------------------------------------------
-  p_ue_mbms->saved_mod_all_unmodified_ptm_services = p_ue_mbms->mod_all_unmodified_ptm_services;
-  //p_ue_mbms->saved_mod_endOfModifiedMCCHInformation = p_ue_mbms->mod_endOfModifiedMCCHInformation;
-  p_ue_mbms->saved_mod_numService = p_ue_mbms->mod_numService;
-  p_ue_mbms->saved_mod_reacquireMCCH = p_ue_mbms->mod_reacquireMCCH;
-  memcpy(&p_ue_mbms->saved_mod_requiredUEAction, &p_ue_mbms->mod_requiredUEAction, p_ue_mbms->mod_numService * sizeof(u8));
-  memcpy(&p_ue_mbms->saved_mod_serviceIdentity, &p_ue_mbms->mod_serviceIdentity, p_ue_mbms->mod_numService * sizeof(o3));
-}
-
-/**
-* @brief Search for the element in the list p_ue_mbms->activatedServiceList.
-* if not found --> insert this element to the list.
-* @return the position in the list where the service is inserted: POSITIVE if inserted or modified, NEGATIVE if not.
-* @author nguyenhn
-* @date Jul 28, 2005 4:26:40 PM
-*/
-//-----------------------------------------------------------------------------
-int rrc_ue_mbms_addActivatedService(o3 serviceID)
-{
-  //-----------------------------------------------------------------------------
-  int index;
-  index  = rrc_mbms_service_id_find(p_ue_mbms->act_numService, &p_ue_mbms->act_serviceIdentity, serviceID);
-
-  if (index < 0) { // we will add
-#ifdef DEBUG_RRC_STATE
-    msg("[RRC-UE][MBMS] Add the service %d to the MBMS Activated Services List\n", serviceID);
-#endif
-    p_ue_mbms->act_serviceIdentity[p_ue_mbms->act_numService] = serviceID;
-    p_ue_mbms->act_serviceType[p_ue_mbms->act_numService] = MBMS_MULTICAST; //Impl default
-    p_ue_mbms->act_activated[p_ue_mbms->act_numService] = FALSE;
-    index = p_ue_mbms->act_numService++;
-  } else {
-#ifdef DEBUG_RRC_STATE
-    msg("[RRC-UE][MBMS] The service %d exists in the MBMS Activated Services List (position = %d)\n", serviceID, index);
-#endif
-  }
-
-  return index;
-}
-
-/**
-* @brief Search for the element in the list p_ue_mbms->activatedServiceList
-* if found --> delete this element from the list.
-* @return the deleted position: POSITIVE if deleted, NEGATIVE if not.
-* @author nguyenhn
-* @date Jul 28, 2005 4:27:01 PM
-*/
-//-----------------------------------------------------------------------------
-int rrc_ue_mbms_deleteActivatedService(o3 serviceID)
-{
-  //-----------------------------------------------------------------------------
-  int index, rest;
-
-  index  = rrc_mbms_service_id_find(p_ue_mbms->act_numService, &p_ue_mbms->act_serviceIdentity, serviceID);
-
-  if (index >= 0) { // we will delete
-    //Operation delete is defined as moving 1 to the left all the element: index + 1, index + 2....
-#ifdef DEBUG_RRC_STATE
-    msg("[RRC-UE][MBMS] Delete the service %d from the MBMS Activated Services List\n", serviceID);
-#endif
-
-    rest = p_ue_mbms->act_numService - (index + 1);
-
-    if (rest>0) {
-      memmove(&p_ue_mbms->act_serviceIdentity[index], &p_ue_mbms->act_serviceIdentity[index+1], rest * sizeof(o3));
-      memmove(&p_ue_mbms->act_activated[index], &p_ue_mbms->act_activated[index+1], rest*sizeof(mbms_bool));
-      memmove(&p_ue_mbms->act_serviceType[index], &p_ue_mbms->act_serviceType[index+1], rest*sizeof(u8));
-    }
-
-    p_ue_mbms->act_numService--;
-  }
-
-  return index;
-}
-
-/**
- * @brief Add the service pointed by pserviceID into the variable p_ue_mbms->nas_joinedServices.
- * No need to check for the existance of this service in the variable
- * @author nguyenhn
- * @date Aug 23, 2005 4:22:20 PM
- */
-//-----------------------------------------------------------------------------
-void rrc_ue_mbms_addJoinedService(o3 serviceID)
-{
-  //-----------------------------------------------------------------------------
-  if (p_ue_mbms->nas_joinedCount < maxMBMSServices) {
-    p_ue_mbms->nas_joinedServices[p_ue_mbms->nas_joinedCount++] = serviceID;
-    p_ue_mbms->nas_joinedServices[p_ue_mbms->nas_joinedCount] = -1;
-  } else {
-#ifdef DEBUG_RRC_STATE
-    msg("[RRC-UE][MBMS][ERROR] Joined Services Overflow !\n");
-#endif
-  }
-}
-
-/**
- * @brief add the service pointed by pserviceID into the variable p_ue_mbms->nas_leftServices
- * No need to check for the existance of this service in the variable
- * @author nguyenhn
- * @date Aug 23, 2005 4:22:54 PM
- */
-//-----------------------------------------------------------------------------
-void rrc_ue_mbms_addLeftService(o3 serviceID)
-{
-  //-----------------------------------------------------------------------------
-  if (p_ue_mbms->nas_leftCount < maxMBMSServices) {
-    p_ue_mbms->nas_leftServices[p_ue_mbms->nas_leftCount++] = serviceID;
-    p_ue_mbms->nas_leftServices[p_ue_mbms->nas_leftCount] = -1;
-  } else {
-#ifdef DEBUG_RRC_STATE
-    msg("[RRC-UE][MBMS][ERROR] Left Services Overflow !\n");
-#endif
-  }
-}
-
-/**
- * @brief Activate the service index in the list of MBMS Activated Services (joined services)
- * @author nguyenhn
- * @date Aug 24, 2005 9:57:05 AM
- */
-//-----------------------------------------------------------------------------
-void rrc_ue_mbms_activateService(int index)
-{
-  //-----------------------------------------------------------------------------
-  if (index < p_ue_mbms->act_numService) {
-#ifdef DEBUG_RRC_STATE
-    msg("[RRC-UE][MBMS] Activate the service %d in L1-L2\n", p_ue_mbms->act_serviceIdentity[index]);
-#endif
-    // Uncompress the stored configuration
-    rrc_uncompress_config ((char *) &(rrm_config->mt_config), (char *) (&(protocol_ms->rrc.mbms.curr_l12Config_data)));
-    // TEMP :
-    //   Until further checking, this prevents the start of a unicast resource
-    //   between activation in RG and activation in MT.
-    //
-    //activate the config with Unicast procedures
-    //FACH is used, no need for PHY Config
-    RRC_RB_UE_O_O_CMAC_CONFIG_Req();
-    RRC_RB_UE_O_O_CRLC_CONFIG_Req ();
-    set_RRC_Transaction_ID();
-    //
-    p_ue_mbms->act_activated[index] = TRUE;
-  } else {
-#ifdef DEBUG_RRC_STATE
-    msg("[RRC-UE][MBMS] Activate: MBMS Activated Service out of range - %d is out of 0..%d", index, p_ue_mbms->act_numService);
-#endif
-  }
-}
-
-/**
- * @brief Deactivate the service index in the list of MBMS Activated Services (joined services)
- * @author nguyenhn
- * @date Aug 24, 2005 10:01:12 AM
- */
-//-----------------------------------------------------------------------------
-void rrc_ue_mbms_deactivateService(int index)
-{
-  //-----------------------------------------------------------------------------
-  if (index < p_ue_mbms->act_numService) {
-#ifdef DEBUG_RRC_STATE
-    msg("[RRC-UE][MBMS] Deactivate the service %d in L1-L2\n", p_ue_mbms->act_serviceIdentity[index]);
-#endif
-    p_ue_mbms->act_activated[index] = FALSE;
-  } else {
-#ifdef DEBUG_RRC_STATE
-    msg("[RRC-UE][MBMS] Deactivate: MBMS Activated Service out of range - %d is out of 0..%d", index, p_ue_mbms->act_numService);
-#endif
-  }
-}
-
-/**
- * @brief Process the joined services list from NAS (3GPP) / Network Notification (Daidalos)
- * @author nguyenhn
- * @date Aug 24, 2005 10:07:31 AM
- */
-//-----------------------------------------------------------------------------
-void rrc_ue_mbms_processJoinedServices(void)
-{
-  //-----------------------------------------------------------------------------
-  int i, index;
-
-  for (i = 0; i<p_ue_mbms->nas_joinedCount; i++) {
-    index = rrc_ue_mbms_addActivatedService(p_ue_mbms->nas_joinedServices[i]);
-
-    //If This service has been joined before --> this may be a handover
-    /*    Adapted to DAIDALOS
-        this is a joined service, so we check if this service is currently being transferred & the configuration is available
-        If "yes", we activate immediately the service if we could find it in the list of Modified Services or Unmodified Services.
-        If the service started in last modification periods --> configuration is available
-        If in this modification period --> must wait until the configuration info is available.
-    */
-    if ((p_ue_mbms->flags.currentCellPTMRBInformation
-         && rrc_mbms_service_id_find(p_ue_mbms->saved_mod_numService,&p_ue_mbms->saved_mod_serviceIdentity,p_ue_mbms->nas_joinedServices[i]) >= 0)
-        ||
-        rrc_mbms_service_id_find(p_ue_mbms->umod_numService, &p_ue_mbms->umod_serviceIdentity,p_ue_mbms->nas_joinedServices[i]) >= 0) {
-      rrc_ue_mbms_activateService(index);
-    }
-  }
-}
-
-/**
- * @brief Process the left services list from NAS (3GPP) / Network Notification (Daidalos)
- * @author nguyenhn
- * @date Aug 24, 2005 10:23:12 AM
- */
-//-----------------------------------------------------------------------------
-void rrc_ue_mbms_processLeftServices(void)
-{
-  //-----------------------------------------------------------------------------
-  int i, index;
-
-  for (i = 0; i<p_ue_mbms->nas_leftCount; i++) {
-    //This service is being transferred on the network --> deactivate now
-    if (rrc_mbms_service_id_find(p_ue_mbms->saved_mod_numService, &p_ue_mbms->saved_mod_serviceIdentity,p_ue_mbms->nas_leftServices[i])
-        || rrc_mbms_service_id_find(p_ue_mbms->umod_numService, &p_ue_mbms->umod_serviceIdentity,p_ue_mbms->nas_leftServices[i])) {
-      index = rrc_mbms_service_id_find(p_ue_mbms->act_numService, &p_ue_mbms->act_serviceIdentity, p_ue_mbms->nas_leftServices[i]) ;
-
-      if (index >= 0 && p_ue_mbms->act_activated[index])
-        rrc_ue_mbms_deactivateService(index);
-    }
-
-    rrc_ue_mbms_deleteActivatedService(p_ue_mbms->nas_leftServices[i]);
-  }
-}
-
-
-/**
- * @brief inform NAS about services left/join by sending MBMS_UE_NOTIFY_IND
- * @date Jun 3, 2005 9:45:15 AM
- * @param serviceID id of the service to be stopped
- */
-//-----------------------------------------------------------------------------
-void RRC_UE_MBMS_O_NAS_MBMS_UE_NOTIFY_IND(void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef MBMS_INTEGRATION_MODE
-  struct nas_ue_if_element *msgToBuild;
-  int i;
-  mem_block_t *p = get_free_mem_block(sizeof (struct nas_ue_if_element));
-
-  protocol_ms->rrc.NASMessageToXmit = p;  // Temp - will later enqueue at bottom of list
-  //Set pointer to newly allocated structure and fills it
-  msgToBuild = (struct nas_ue_if_element *) p->data;
-  msgToBuild->prim_length = NAS_TL_SIZE + sizeof(struct NASMBMSUENotifyInd);
-  msgToBuild->xmit_fifo = protocol_ms->rrc.rrc_ue_DCOut_fifo;
-  msgToBuild->nasUePrimitive.dc_sap_prim.type = MBMS_UE_NOTIFY_IND;
-  msgToBuild->nasUePrimitive.dc_sap_prim.length = msgToBuild->prim_length;
-
-  //Fill the list
-  for (i = 0; i<MAX_MBMS_SERVICES; i++) {
-    msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.mbms_ue_notify_ind.joined_services[i].mbms_serviceId = (u32) -1;
-    msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.mbms_ue_notify_ind.left_services[i].mbms_serviceId = (u32) -1;
-  }
-
-  for (i = 0; i<p_ue_mbms->nas_joinedCount; i++)
-    msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.mbms_ue_notify_ind.joined_services[i].mbms_serviceId = (u32) p_ue_mbms->nas_joinedServices[i];
-
-  for (i = 0; i<p_ue_mbms->nas_leftCount; i++)
-    msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.mbms_ue_notify_ind.left_services[i].mbms_serviceId = (u32) p_ue_mbms->nas_leftServices[i];
-
-  //msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.mbms_ue_notify_ind.localConnectionRef
-
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC-UE][MBMS] MBMS_UE_NOTIFY_IND primitive sent to NAS, length %d\n",  msgToBuild->prim_length);
-#endif
-#endif
-
-#ifdef MBMS_TEST_MODE
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC-UE][MBMS] MBMS_UE_NOTIFY_IND primitive sent to NAS\n");
-#endif
-#endif
-
-#ifdef DEBUG_UE_MBMS_FSM_TEST
-  O_NAS_MBMS_UE_NOTIFY_IND = TRUE;
-#endif
-}
-
-/**
- * @brief Analyse the message Unmodified Service Information if required in Modified Service Information
- * @author nguyenhn
- * @date Jul 29, 2005 10:47:27 AM
- */
-//-----------------------------------------------------------------------------
-void RRC_UE_MBMS_O_ANALYSE_UNMODIF(void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  msg("\033[0;31m[RRC-UE][MBMS][FSM] Analysing the required actions in Unmodified Service Information (as required in Modified Service Information) ...\033[0m\n");
-#endif
-
-#ifdef DEBUG_UE_MBMS_FSM_TEST
-  O_ANALYSE_UNMODIF = TRUE;
-#endif
-
-
-  //TODO Code here
-}
-
-/**
- * @brief activate the PTM RB Configuration procedure for the current cell
- * @date Jun 9, 2005 4:40:57 PM
- */
-//-----------------------------------------------------------------------------
-void RRC_UE_MBMS_O_CURRENT_CELL_RB_CONFIGURATION(void)
-{
-  //-----------------------------------------------------------------------------
-  int i, index;
-
-#ifdef DEBUG_RRC_STATE
-  msg("\033[0;31m[RRC-UE][MBMS][FSM] Processing the cell configuration  at frame %d \033[0m\n", protocol_ms->rrc.current_SFN);
-#endif
-
-#ifdef DEBUG_UE_MBMS_FSM_TEST
-  O_CURRENT_CELL_RB_CONFIGURATION = TRUE;
-#endif
-
-  // Complete the initialisation process.
-  if (!p_ue_mbms->initialised)
-    p_ue_mbms->initialised = TRUE;
-
-  // Do as specified in 8.7.5.3. -- MBMS Modified service was received
-  // Start : continue receiving the indicated p-t-m radio bearers
-  // depending on its UE capabilities
-  for (i = 0; i< p_ue_mbms->saved_mod_numService; i++) {
-    if (p_ue_mbms->saved_mod_requiredUEAction[i] == Mod_acquirePTM_RBInfo) {
-      //Check if the service has been joined before. If yes --> activate the service.
-      index = rrc_mbms_service_id_find(p_ue_mbms->act_numService, &p_ue_mbms->act_serviceIdentity, p_ue_mbms->saved_mod_serviceIdentity[i]) ;
-
-      if (index >= 0 && !p_ue_mbms->act_activated[index])
-        rrc_ue_mbms_activateService(index);
-    }
-  }
-}
-
-/**
- * @brief Activate the PTM RB Configuration procedure for the
- * neighbouring cell.
- * @date Jun 9, 2005 4:41:11 PM
- */
-//-----------------------------------------------------------------------------
-void RRC_UE_MBMS_O_NEIGHBOURING_CELL_RB_CONFIGURATION(void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  msg("\033[0m[RRC-UE][MBMS][FSM] Processing the received neighbouring Cell Configuration at frame %d \033[0m\n", protocol_ms->rrc.current_SFN);
-#endif
-
-#ifdef DEBUG_UE_MBMS_FSM_TEST
-  O_NEIGHBOURING_CELL_RB_CONFIGURATION = TRUE;
-#endif
-}
-
-/**
- * @brief Process the information in the Modified Service Information message as specified in 8.7.3
- * @date Sep 6, 2005 10:30:33 AM
- */
-//-----------------------------------------------------------------------------
-void RRC_UE_MBMS_O_MCCH_NOTIFICATION(void)
-{
-  //-----------------------------------------------------------------------------
-  int i;
-  int index;
-  int acquireRBInfo;
-#ifdef DEBUG_RRC_MBMS
-  msg("\033[0;31m[RRC-UE][MBMS][FSM] Processing the received MCCH Modified Service Information at frame %d \033[0m \n", protocol_ms->rrc.current_SFN);
-#ifdef DEBUG_RRC_MBMS_DETAIL
-  rrc_ue_mbms_modif_services_print();
-#endif
-
-  if (p_ue_mbms->mod_numService == 0)
-    msg("[RRC-UE][MBMS] Modified Service Information doesn't contain any service, ignore!\n");
-
-#endif
-
-#ifdef DEBUG_UE_MBMS_FSM_TEST
-  O_MCCH_NOTIFICATION = TRUE;
-#endif
-
-  //For each of the services included in the message MODIFIED SERVICES INFORMATION
-  //provided that the service is included in variable MBMS_ACTIVATED_SERVICES and upper layer
-  //indicate that the session has not yet been received correctly (refered as 'applicable services'):
-
-  // Implementation : to speed up service activation, the configuration is
-  // read and stored every time it is changed (Modified Services +
-  // required action = acquirePTM_RBInfo, releasePTM_RB )
-  acquireRBInfo = FALSE;
-
-  for (i = 0; i< p_ue_mbms->mod_numService; i++) {
-    //Do as 8.6.9
-    switch (p_ue_mbms->mod_requiredUEAction[i]) {
-    case Mod_acquirePTM_RBInfo:
-      //do 8.7.5 if received...PTM RB Information.
-      acquireRBInfo = TRUE;
-      break;
-
-    case Mod_releasePTM_RB:
-      //Check if the service is activated or not. If activated, deactivate the service.
-      index = rrc_mbms_service_id_find(p_ue_mbms->act_numService, &p_ue_mbms->act_serviceIdentity, p_ue_mbms->mod_serviceIdentity[i]) ;
-
-      if (index >= 0 && p_ue_mbms->act_activated[index])
-        rrc_ue_mbms_deactivateService(index);
-
-      //Adaptation for Daidalos, we need to reacquire the RB Info
-      acquireRBInfo = TRUE;
-      break;
-
-    case Mod_none:
-      //Do nothing
-      break;
-
-    default:
-      msg("[RRC-UE][MBMS]MCCH Notification - requiredAction[%d] = %d not recognized\n", i, p_ue_mbms->mod_requiredUEAction[i]);
-      break;
-    }
-  }
-
-  if (acquireRBInfo) {
-#ifdef DEBUG_RRC_STATE
-    msg("[RRC-UE][MBMS] Allow the procedure MBMS PTM RB Configuration\n");
-#endif
-    p_ue_mbms->mustAcquireRBInfo = TRUE; //We will acquire Common and Current RB Info msg.
-  }
-
-  //The procedure end, we store all values of mod_ into saved_mod_
-  rrc_ue_mbms_saveMCCHModifiedServiceInformation();
-
-#ifdef DEBUG_RRC_MBMS_STATUS
-  rrc_ue_mbms_status_services_print();
-#endif
-}
-
-/**
- * @brief activate the notification procedure, process the information in the DCCH MBMSModifiedServicesInfo message .
- * The procedure is adapted to DAIDALOS. Used to inform services left/join
- * @date Jun 9, 2005 4:39:10 PM
- */
-//-----------------------------------------------------------------------------
-void RRC_UE_MBMS_O_DCCH_NOTIFICATION(void)
-{
-  //-----------------------------------------------------------------------------
-  int i;
-
-#ifdef DEBUG_RRC_STATE
-  msg("\033[0;31m[RRC-UE][MBMS][FSM] Processing the received DCCH Notification at frame %d \033[0m\n", protocol_ms->rrc.current_SFN);
-#ifdef DEBUG_RRC_MBMS_DETAIL
-  rrc_ue_mbms_modif_services_print();
-#endif
-#endif
-
-#ifdef DEBUG_UE_MBMS_FSM_TEST
-  O_DCCH_NOTIFICATION = TRUE;
-#endif
-
-  //Copy all services in notification message to nas_xxx. Used for the future compability
-  p_ue_mbms->nas_joinedCount = 0;
-  p_ue_mbms->nas_leftCount = 0;
-
-  for (i = 0; i< p_ue_mbms->mod_numService; i++) {
-    switch (p_ue_mbms->mod_requiredUEAction[i]) {
-    case Mod_acquirePTM_RBInfo:
-      rrc_ue_mbms_addJoinedService(p_ue_mbms->mod_serviceIdentity[i]);
-      break;
-
-    case Mod_releasePTM_RB:
-      rrc_ue_mbms_addLeftService(p_ue_mbms->mod_serviceIdentity[i]);
-      break;
-
-    default:
-#ifdef DEBUG_RRC_MBMS
-      msg("[RRC-UE][MBMS][WARNING] requiredAction[%d] = %d not recognized\n", i, p_ue_mbms->mod_requiredUEAction[i]);
-#endif
-      break;
-    }
-  }
-
-  //Process the received joined/left services
-  if (p_ue_mbms->nas_joinedCount > 0)
-    rrc_ue_mbms_processJoinedServices();
-
-  if (p_ue_mbms->nas_leftCount > 0 )
-    rrc_ue_mbms_processLeftServices();
-
-  //Should we send UE_NOTIFY_IND to NAS ?
-  RRC_UE_MBMS_O_NAS_MBMS_UE_NOTIFY_IND();
-}
diff --git a/openair2/RRC/CELLULAR/rrc_ue_mbms_process.c b/openair2/RRC/CELLULAR/rrc_ue_mbms_process.c
deleted file mode 100755
index 3afcbc2763..0000000000
--- a/openair2/RRC/CELLULAR/rrc_ue_mbms_process.c
+++ /dev/null
@@ -1,208 +0,0 @@
-/***************************************************************************
-                         rrc_ue_mbms_process.c - description
-                          -------------------
-    begin               : May 30, 2005
-    copyright           : (C) 2005, 2010 by Eurecom
-    created by          : Huu-Nghia.Nguyen@eurecom.fr
-    modified by          : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-    This file implements Interface procedures for UE
- **************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_ue_vars.h"
-#include "rrc_mbms_pdus.h"
-#include "rrc_msg_class.h"
-#include "rrc_ue_mbms_variables.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_mbms.h"
-
-rrc_ue_mbms_variables * volatile p_ue_mbms; /** pointer reference to protocol_ms->rrc.mbms */
-
-/**
- * @brief Init the UE side mbms variables
- * @date May 27, 2005 6:45:24 PM
- */
-//-----------------------------------------------------------------------------
-void rrc_ue_mbms_init(void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC-UE][MBMS] START OF MBMS INITIALISATION.......................\n");
-#endif
-
-  p_ue_mbms = &protocol_ms->rrc.mbms;
-  memset(p_ue_mbms, 0, sizeof(rrc_ue_mbms_variables));
-
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC-UE][MBMS] Allow the procedure MBMS PTM RB Configuration\n");
-#endif
-  p_ue_mbms->initialised = FALSE;
-  p_ue_mbms->mustAcquireRBInfo = TRUE;
-
-  p_ue_mbms->modifPeriodCoef = MODIF_PERIOD_COEF_DEFAULT;
-  rrc_ue_mbms_fsm_reset();
-  rrc_ue_mbms_fsm(); //Enter the state machine.
-
-#ifdef DEBUG_RRC_STATE
-  msg("[RRC-UE][MBMS] END OF MBMS INITIALISATION\n\n");
-#endif
-}
-
-/**
- * @brief Reset all flags and signals for a new modification period
- * @date May 31, 2005 4:52:48 PM
- * @see rrc_ue_mbms_advance_time()
- */
-//-----------------------------------------------------------------------------
-void rrc_ue_mbms_activate_modification_period(void)
-{
-  //-----------------------------------------------------------------------------
-  int i;
-#ifdef DEBUG_RRC_MBMS
-  msg("\033[31m\n**************************************************\033[0m\n");
-  msg("[RRC-UE][MBMS] START A NEW MODIFICATION PERIOD at frame %d \n", protocol_ms->rrc.current_SFN);
-#endif
-
-  //If this is the first time, we didn't have the RB info, we must acquire it. Otherwise we reset it to FALSE
-  p_ue_mbms->mustAcquireRBInfo = !p_ue_mbms->initialised;
-
-  memset(&p_ue_mbms->flags, 0, sizeof(p_ue_mbms->flags)); //Clear flags
-  RRC_UE_MBMS_I_MODIF_PERIOD_ENDED();
-  rrc_ue_mbms_fsm();
-
-  //Print a list of MBMS Activated Services:
-#ifdef DEBUG_RRC_MBMS
-  msg("[RRC-UE][MBMS] MBMS Activated Services: { ");
-
-  for (i = 0; i<p_ue_mbms->act_numService; i++) {
-    msg(" service%d/", p_ue_mbms->act_serviceIdentity[i]);
-
-    if (p_ue_mbms->act_activated[i])
-      msg("active");
-    else
-      msg("standby");
-  }
-
-  msg(" }\n");
-#endif
-}
-
-/**
- * @brief check for the modification period
- * @warning the counter p_ue_mbms->curr_modif_counter will be synchronize with RG when
- * decoding the MBMS Modified Services Information message.
- * @date May 31, 2005 11:24:19 AM
- */
-//-----------------------------------------------------------------------------
-void rrc_ue_mbms_scheduling_check(void)
-{
-  //-----------------------------------------------------------------------------
-  if (protocol_ms->rrc.current_SFN % (1 << p_ue_mbms->modifPeriodCoef) == 0)
-    rrc_ue_mbms_activate_modification_period();
-}
-
-/**
- * @brief Local function, used to print out the list of modified services
- * @date Jul 29, 2005 10:24:11 AM
- */
-//-----------------------------------------------------------------------------
-void rrc_ue_mbms_modif_services_print(void)
-{
-  //-----------------------------------------------------------------------------
-  int i;
-  msg("[RRC-UE][MBMS] MBMS Modified Services: \n");
-
-  for (i = 0; i< p_ue_mbms->mod_numService; i++) {
-    msg("[RRC-UE][MBMS]\t\t service id = %d, required action = ", p_ue_mbms->mod_serviceIdentity[i]);
-
-    switch (p_ue_mbms->mod_requiredUEAction[i]) {
-    case Mod_none:
-      msg("None\n");
-      break;
-
-    case Mod_acquirePTM_RBInfo:
-      msg("Acquire PTM RB Info\n");
-      break;
-
-    case Mod_releasePTM_RB:
-      msg("Release PTM RB Info\n");
-      break;
-    }
-  }
-}
-
-/**
- * @brief Local function, used to print out the status of activated services
- * @date Sept 06, 2006
- */
-//-----------------------------------------------------------------------------
-void rrc_ue_mbms_status_services_print(void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_MBMS_STATUS
-  int i;
-  //Print the list of MBMS broadcasted services
-  msg("[RRC-UE][MBMS] MBMS Started Services: \n");
-
-  for (i = 0; i< maxMBMSServices; i++) {
-    msg("[RRC-UE][MBMS]\t\t service id = %d, activated = ", i+1);
-
-    switch (p_ue_mbms->act_activated[i]) {
-    case TRUE  :
-      msg("YES\n");
-      break;
-
-    case FALSE :
-      msg("NO\n");
-      break;
-
-    default:
-      msg("UNDEFINED\n");
-      break;
-    }
-  }
-
-  //Print a list of MBMS Activated Services:
-  msg("[RRC-UE][MBMS] MBMS Activated Services: { ");
-
-  for (i = 0; i<p_ue_mbms->act_numService; i++) {
-    msg(" service%d/", p_ue_mbms->act_serviceIdentity[i]);
-
-    if (p_ue_mbms->act_activated[i]) msg("active");
-    else msg("standby");
-  }
-
-  msg(" }\n");
-#endif
-}
-
-//-----------------------------------------------------------------------------
-const char * rrc_mbms_message_getName(int channelID, char* pmsg, int msgtype)
-{
-  //-----------------------------------------------------------------------------
-  const char * mcch_message_name[8] = {"", "AccessInfomation", "CommonPTMRBInformation", "CurrentCellPTMRBInformation", "GeneralInformation", "ModifiedServicesInformation", "NeighbouringCellPTMRBInformation", "UnmodifiedServicesInformation" };
-
-  switch (channelID) {
-  case DCCH_ID:
-    return "ModifiedServicesInformation";
-
-  case MCCH_ID:
-    if (pmsg != NULL) return mcch_message_name[((MCCH_Message*) pmsg)->message.type];
-    else return mcch_message_name[msgtype];
-
-  case MSCH_ID:
-    return "SchedulingInformation";
-
-  default:
-    return "Unrecognized";
-  }
-}
-
diff --git a/openair2/RRC/CELLULAR/rrc_ue_mbms_variables.h b/openair2/RRC/CELLULAR/rrc_ue_mbms_variables.h
deleted file mode 100755
index 2d3e899a64..0000000000
--- a/openair2/RRC/CELLULAR/rrc_ue_mbms_variables.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/***************************************************************************
-                          rrc_ue_mbms_variables.h - description
-                          -------------------
-    begin               : May 30, 2005
-    copyright           : (C) 2005, 2010 by Eurecom
-    created by          : Huu-Nghia.Nguyen@eurecom.fr
-    modified by         :
-    description         :
- **************************************************************************/
-#ifndef _RRC_UE_MBMS_VARIABLES_H_
-#define _RRC_UE_MBMS_VARIABLES_H_
-
-#include "rrc_mbms_constant.h"
-
-/**
- * @brief Use this struct to determine if the msg has received in the period:
- * value = Modication period, Access info period, scheduling period
- * if already, this message will not be decoded.
- * @date May 20, 2005 11:23:20 AM
- */
-typedef struct rrc_ue_mbms_period_flags {
-  int commonPTMRBInformation;
-  int currentCellPTMRBInformation;
-  int generalInformation;
-  int modifiedServicesInformation;
-  int unmodifiedServicesInformation;
-} rrc_ue_mbms_period_flags;
-
-typedef struct rrc_ue_mbms_variables {
-  //Used for scheduling on MCCH
-  rrc_ue_mbms_period_flags flags; //tags to determine which msg has been received in the period
-
-  //Used to get MBMS message
-#ifdef MBMS_TEST_MODE
-  int curr_msgLen;
-  u8  curr_msgBuf[MBMS_MAX_BUFFER_SIZE];
-#endif
-
-  //Used to decode the MBMS message
-  u8  acc_numAccessInfo; //0..maxMBMSservCount (=4), @see MBMS_ServiceAccessInfoList */
-  u8  acc_shortTransmissionID[maxMBMSservCount]; /** Integer(1..32),  @see MBMS_ShortTransmissionID */
-  u16 acc_accessprobabilityFactor_Idle[maxMBMSservCount]; /** Integer(0, 32, 64..960, 1000), @see MBMS_AccessProbabilityFactor */
-
-  u16 gen_t_318; /** Default value ms1000, @see T_318 */
-  u16 gen_cellGroupIdentity; /** Bit string (12), @see MBMS_CellGroupIdentity */
-
-  u8  umod_numService;  //0..maxMBMSservUnmodif
-  o3  umod_serviceIdentity[maxMBMSservUnmodif];   /** OctetString(3), @see MBMS_ServiceIdentity */
-  u8  umod_requiredUEAction[maxMBMSservUnmodif]; /** @see MBMS_RequiredUEAction_UMod */
-
-
-  u8  mod_numService; /** 0..maxMBMSservModif  */
-  o3  mod_serviceIdentity   [maxMBMSservModif];   /** OctetString(3), @see MBMS_ServiceIdentity */
-  u8  mod_sessionIdentity   [maxMBMSservModif];
-  u8  mod_requiredUEAction  [maxMBMSservModif]; /** @see MBMS_RequiredUEAction_Mod */
-  mbms_bool contMCCHReading [maxMBMSservModif];
-  mbms_bool mod_reacquireMCCH;
-  //  u8  mod_endOfModifiedMCCHInformation;
-  u8  mod_numberOfNeighbourCells;  //MCCH only
-  u8  mod_ptm_activationTime;      //MCCH only
-  mbms_bool mod_all_unmodified_ptm_services;
-
-
-  //Because we use mod_xxx for DCCH & MCCH Notification message
-  //we need to store the value of MCCH Notification message
-  u8  saved_mod_numService; /** 0..maxMBMSservModif  */
-  o3  saved_mod_serviceIdentity[maxMBMSservModif];    /** OctetString(3), @see MBMS_ServiceIdentity */
-  u8  saved_mod_sessionIdentity   [maxMBMSservModif];
-  u8  saved_mod_requiredUEAction[maxMBMSservModif]; /** @see MBMS_RequiredUEAction_Mod */
-  mbms_bool saved_mod_reacquireMCCH;
-  mbms_bool saved_mod_all_unmodified_ptm_services;
-  //  u8  saved_mod_endOfModifiedMCCHInformation;
-
-  //u8  comm_l12Configuration [MBMS_L12_CONFIGURATION_SIZE]; /** OctetString, @see MBMS_L12Configuration */
-  int comm_l12Config_lgth;
-  u8  comm_l12Config_data[MTCH_CONFIGURATION_SIZE];
-  //u8  curr_l12Configuration [MBMS_L12_CONFIGURATION_SIZE]; /** OctetString, @see MBMS_L12Configuration */
-  int curr_l12Config_lgth;
-  u8  curr_l12Config_data[MTCH_CONFIGURATION_SIZE];
-
-  u8  neighb_cellCount; /** number of neighbouring cell in the list, 0..maxNeighbouringCellIdentity (=32) is supposed, @see maxNeighbouringCellIdentity */
-  u16 neighb_cellConf_lgth    [MBMS_MAX_NEIGBOURING_COUNT]; /** neigbouring cells' configuration length, @see MBMS_NeighbouringCellConfiguration*/
-  u8  neighb_cellConf_data    [MBMS_MAX_NEIGBOURING_COUNT][NEIGHBOUR_CONFIGURATION_SIZE]; /** neigbouring cells' configuration, @see MBMS_NeighbouringCellConfiguration*/
-  u8  neighb_cellIDList   [MBMS_MAX_NEIGBOURING_COUNT]; /** list of neighb identity (1..X), used as a pointer to SIB 11? */
-  u8  neighb_index; /** current neighb index of the list - Use it to create the msg corresponding*/
-
-  u8  sched_numInfo;  /** 0..maxMBMSservSched  */
-  o3  sched_serviceIdentity   [maxMBMSservSched];   /** OctetString(3), @see MBMS_ServiceIdentity */
-  u8  sched_trans_numTransmis [maxMBMSservSched]; /** 0..maxMBMSTransmis */
-  u16 sched_trans_start     [maxMBMSservSched][maxMBMSTransmis];  /** 0..1024 by step of 4 */
-  u16 sched_trans_duration    [maxMBMSservSched][maxMBMSTransmis]; /** 4..1024 */
-  u8  sched_nextSchedPeriod   [maxMBMSservSched]; /** 0..31 */
-
-  //Usage is not the same as in specification of 3GPP.
-  //Because there isn't any NAS primitive of UE, this variable will contain all services  acquiring PTM RB Information.
-  u8      act_numService;
-  o3      act_serviceIdentity [maxMBMSServices];    /** OctetString(3), @see MBMS_ServiceIdentity */
-  mbms_bool act_activated   [maxMBMSServices];
-  u8      act_serviceType [maxMBMSServices];
-
-  //Those variables are prepared for future compatibility
-  u8  nas_joinedCount;
-  u8  nas_leftCount;
-  int nas_joinedServices    [maxMBMSServices]; /** OctetString(3), @see MBMS_ServiceIdentity */
-  int nas_leftServices    [maxMBMSServices]; /** OctetString(3), @see MBMS_ServiceIdentity */
-  //Other variables is stored here.
-  u8        modifPeriodCoef;
-  mbms_bool   mustAcquireRBInfo; //To determine if we have to acquire Common, Current Messages.
-  mbms_bool   initialised; //To know if we have passed the fist modification period.
-  //  mbms_bool   hasFirstRBInfo; //To determinde if we have the Common/Current configuration. If hasn't, --> must acquire RB Info
-} rrc_ue_mbms_variables;
-
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_ue_msg_decode.c b/openair2/RRC/CELLULAR/rrc_ue_msg_decode.c
deleted file mode 100755
index ee8d2c14ff..0000000000
--- a/openair2/RRC/CELLULAR/rrc_ue_msg_decode.c
+++ /dev/null
@@ -1,339 +0,0 @@
-/***************************************************************************
-                          rrc_ue_msg_decode.c  -  description
-                             -------------------
-    begin                : June 21, 2002
-    copyright            : (C) 2002, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Decodes messages received in one of the signalling Radio Bearer
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-#include "rtos_header.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_ue_vars.h"
-#include "rrc_messages.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_fsm.h"
-#include "rrc_proto_int.h"
-#include "rrc_proto_msg.h"
-#include "rrc_proto_mbms.h"
-//-----------------------------------------------------------------------------
-// For FIFOS interface
-#ifdef USER_MODE
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#endif
-
-//-----------------------------------------------------------------------------
-// Generic function to decode RRC messages received on CCCH
-void rrc_ue_srb0_decode (char * sduP, int length)
-{
-  //-----------------------------------------------------------------------------
-  DL_CCCH_Message *dl_ccch_msg;
-  int status = SUCCESS;
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC_UE][DECODE]Decoding from Srb0b -- start of message: \n");
-  rrc_print_buffer (sduP, 100);
-#endif
-
-  dl_ccch_msg = (DL_CCCH_Message *) (sduP);
-
-  // TEMPComment - OPENAIR
-  switch (dl_ccch_msg->message.type) {
-  case DL_CCCH_rrcConnectionSetup:
-    status = rrc_ue_msg_connsetup (dl_ccch_msg);
-
-    if (status == SUCCESS)
-      rrc_ue_fsm_control (RRC_CONNECT_SETUP);
-
-    break;
-
-  case DL_CCCH_rrcConnectionRelease:       // not in 1st step
-    status = FAILURE;
-    break;
-
-  case DL_CCCH_rrcConnectionReject:
-    status = rrc_ue_msg_connreject (dl_ccch_msg);
-
-    if (status == SUCCESS)
-      rrc_ue_fsm_control (RRC_CONNECT_REJECT);
-
-    break;
-
-  case DL_CCCH_cellUpdateConfirm:
-    status = rrc_ue_msg_cellupdatecnfccch (dl_ccch_msg);
-
-    if (status == SUCCESS)
-      rrc_ue_fsm_control (CELLU_CNF);
-
-    break;
-
-  default:
-    status = FAILURE;
-  }
-
-  if (status != SUCCESS)
-    msg ("\n[RRC_UE][DECODE]Message from Srb0 could not be decoded. No call to FSM. %d \n",dl_ccch_msg->message.type);
-}
-
-//-----------------------------------------------------------------------------
-// Generic function to decode RRC messages received on DCCH-UM
-void rrc_ue_srb1_decode (char * sduP, int offset)
-{
-  //-----------------------------------------------------------------------------
-  DL_DCCH_Message *dl_dcch_msg;
-  int status = SUCCESS;
-#ifdef DEBUG_RRC_STATE
-  msg ("\n[RRC_UE][DECODE]Decoding from Srb1 -- start of message: \n");
-  rrc_print_buffer (&sduP[offset], 15);
-#endif
-
-  dl_dcch_msg = (DL_DCCH_Message *) (&sduP[offset]);
-
-  // TEMPComment - OPENAIR
-  switch (dl_dcch_msg->message.type) {
-  case DL_DCCH_rrcConnectionRelease:       // not in 1st step
-    status = FAILURE;
-    break;
-
-  case DL_DCCH_cellUpdateConfirm:  // not in 1st step
-    status = FAILURE;
-    break;
-    // MBMS - Receive Notification
-#ifdef ALLOW_MBMS_PROTOCOL
-
-  case DL_DCCH_mbmsModifiedServicesInformation:
-#ifdef DEBUG_RRC_STATE
-    msg("\033[0;32m[RRC-UE][MBMS][RX] ModifiedServicesInformation, DCCH-UM(SRB1), frame %d \n\033[0m", protocol_ms->rrc.current_SFN);
-#endif
-    status = rrc_ue_mbms_DCCH_decode(dl_dcch_msg);
-    break;
-#endif
-
-  default:
-    status = FAILURE;
-  }
-
-  if (status != SUCCESS)
-    msg ("\n[RRC_UE][DECODE]Message from Srb1 could not be decoded. No call to FSM. %d \n", dl_dcch_msg->message.type);
-
-}
-
-//-----------------------------------------------------------------------------
-// Generic function to decode RRC messages received on DCCH-AM
-void rrc_ue_srb2_decode (char * sduP, int length)
-{
-  //-----------------------------------------------------------------------------
-  DL_DCCH_Message *dl_dcch_msg;
-  int status = SUCCESS;
-#ifdef DEBUG_RRC_STATE
-  // msg("[RRC_UE][DECODE]Decoding from Srb2 --%s-- \n", &sduP->data[length]);
-  msg ("\n[RRC_UE][DECODE]Decoding from Srb2 -- start of message: \n");
-  rrc_print_buffer (&sduP[length], 15);
-#endif
-
-  dl_dcch_msg = (DL_DCCH_Message *) (&sduP[length]);
-  msg ("\n[RRC_UE][DECODE]Decoding from Srb2 -- Message type: %d\n", dl_dcch_msg->message.type);
-
-  // TEMPComment - OPENAIR
-  switch (dl_dcch_msg->message.type) {
-  case DL_DCCH_radioBearerSetup:
-    status = rrc_ue_msg_rbsetup (dl_dcch_msg);
-
-    if (status == SUCCESS)
-      rrc_ue_fsm_control (UE_RB_SETUP);
-
-    break;
-
-  case DL_DCCH_radioBearerRelease:
-    status = rrc_ue_msg_rbrelease (dl_dcch_msg);
-
-    if (status == SUCCESS)
-      rrc_ue_fsm_control (UE_RB_RELEASE);
-
-    break;
-
-  case DL_DCCH_pagingType2:
-    status = rrc_ue_msg_pagingt2 (dl_dcch_msg);
-
-    if (status == SUCCESS)
-      RRC_UE_O_NAS_NOTIFICATION_IND ();
-
-    break;
-
-  case DL_DCCH_measurementControl:
-    status = rrc_ue_msg_measctl (dl_dcch_msg);
-
-    if (status == SUCCESS) {
-#ifdef DEBUG_RRC_MEASURE_CONTROL
-      rrc_ue_print_meas_control (&(protocol_ms->rrc.ue_meas_cmd[protocol_ms->rrc.rrc_ue_meas_to_activate]));
-#endif
-      rrc_ue_trigger_measure ();
-    }
-
-    break;
-
-  case DL_DCCH_ueCapabilityInformationConfirm:
-    status = rrc_ue_msg_ueCapInfoCnf(dl_dcch_msg);
-
-    if (status == SUCCESS)
-      rrc_ue_fsm_control(UE_CAP_INFO_CNF);
-
-    break;
-
-  default:
-    status = FAILURE;
-  }
-
-  if (status != SUCCESS)
-    msg ("\n[RRC_UE][DECODE]Message from Srb2 could not be decoded. No call to FSM. %d \n", dl_dcch_msg->message.type);
-}
-
-//-----------------------------------------------------------------------------
-// Generic function to decode RRC messages received on DCCH-AM
-void rrc_ue_srb3_decode (char * sduP, int length)
-{
-  //-----------------------------------------------------------------------------
-  DL_DCCH_Message *dl_dcch_msg;
-  int status = SUCCESS;
-
-#ifdef DEBUG_RRC_STATE
-  // msg("[RRC_UE][DECODE]Decoding from Srb3 --%s-- \n", &sduP->data[length]);
-  msg ("\n[RRC_UE][DECODE]Decoding from Srb3 -- start of message: \n");
-  rrc_print_buffer (&sduP[length], 15);
-#endif
-
-  dl_dcch_msg = (DL_DCCH_Message *) (&sduP[length]);
-
-  // TEMPComment - OPENAIR
-  switch (dl_dcch_msg->message.type) {
-  case DL_DCCH_downlinkDirectTransfer:
-    status = rrc_ue_msg_dlXfer (dl_dcch_msg);
-
-    if (status == SUCCESS)
-      RRC_UE_O_NAS_DATA_IND ();
-
-    break;
-
-  default:
-    status = FAILURE;
-  }
-
-  if (status != SUCCESS)
-    msg ("\n[RRC_UE][DECODE]Message from Srb3 could not be decoded. \n");
-}
-
-//-----------------------------------------------------------------------------
-void rrc_ue_read_DCin_FIFO (struct nas_ue_dc_element *p, int count)
-{
-  //-----------------------------------------------------------------------------
-  //int count = 0;
-  int maxlen = NAS_MAX_LENGTH;
-  u8  rcve_buffer[maxlen];
-  u16 data_length;
-  int Message_Id;
-  //struct nas_ue_dc_element *p;
-  //int prim_length;
-  //int prim_type;
-  //int status;
-
-  //   memset (rcve_buffer, 0, maxlen);
-  //   if ((count = rtf_get (protocol_ms->rrc.rrc_ue_DCIn_fifo, rcve_buffer, NAS_TL_SIZE)) > 0) {
-  //
-  //     #ifdef DEBUG_RRC_STATE
-  //      msg ("[RRC_UE] Message Received from NAS: -%hx- \n", rcve_buffer[0]);
-  //     #endif
-  //     p = (struct nas_ue_dc_element *) rcve_buffer;
-  //     prim_length = (int) (p->length);
-  //     prim_type = (int) (p->type);
-  //     #ifdef DEBUG_RRC_STATE
-  //      msg ("[RRC_UE] Primitive Type %d,\t Primitive length %d \n", prim_type, prim_length);
-  //     #endif
-  //     //get the rest of the primitive
-  //     count += rtf_get (protocol_ms->rrc.rrc_ue_DCIn_fifo, &(rcve_buffer[NAS_TL_SIZE]), prim_length - NAS_TL_SIZE);
-
-  // Decode the primitive
-  //    switch (rcve_buffer[0]) {
-  switch (p->type) {
-  case CONN_ESTABLISH_REQ:
-    protocol_ms->rrc.local_connection_ref = (int) (p->nasUEDCPrimitive.conn_establish_req.localConnectionRef);
-    //Temp
-    //protocol_ms->rrc.cell_id = (int)(p->nasUEDCPrimitive.conn_establish_req.cellId);
-#ifdef DEBUG_RRC_STATE
-    msg ("[RRC_UE] CONN_ESTABLISH_REQ primitive length: %d\n", (int) (p->length));
-    msg ("[RRC_UE] Local Connection reference: %d\n", (int) (protocol_ms->rrc.local_connection_ref));
-    msg ("[RRC_UE] Requested Cell_id: %d\n", (int) (protocol_ms->rrc.cell_id));
-#endif
-    rrc_ue_fsm_control (NAS_CONN_REQ);
-    break;
-
-  case CONN_RELEASE_REQ:
-    protocol_ms->rrc.local_connection_ref = (int) (p->nasUEDCPrimitive.conn_release_req.localConnectionRef);
-    protocol_ms->rrc.release_cause = p->nasUEDCPrimitive.conn_release_req.releaseCause;
-#ifdef DEBUG_RRC_STATE
-    msg ("[RRC_UE] CONN_RELEASE_REQ primitive length: %d\n", (int) (p->length));
-    msg ("[RRC_UE] Local Connection reference: %d\n", (int) (protocol_ms->rrc.local_connection_ref));
-    msg ("[RRC_UE] Establishment status: %d\n", (int) (protocol_ms->rrc.release_cause));
-#endif
-    rrc_ue_fsm_control (NAS_REL_REQ);
-    break;
-
-  case DATA_TRANSFER_REQ:
-    if (protocol_ms->rrc.local_connection_ref == (int) (p->nasUEDCPrimitive.data_transfer_req.localConnectionRef)) {
-      data_length = (u16) p->nasUEDCPrimitive.data_transfer_req.nasDataLength;
-      protocol_ms->rrc.ul_nas_message_ptr = get_free_mem_block (data_length);
-      protocol_ms->rrc.ul_nas_message_lgth = data_length;
-      //get the associated data
-#ifndef RRC_NETLINK
-      count += rtf_get (protocol_ms->rrc.rrc_ue_DCIn_fifo, (protocol_ms->rrc.ul_nas_message_ptr)->data, data_length);
-      //memcpy((protocol_ms->rrc.ul_nas_message_ptr)->data,&(rcve_buffer[p->length]),data_length);
-#else
-      count += rrc_ue_read_data_from_nlh ((char *)(protocol_ms->rrc.ul_nas_message_ptr)->data, data_length, (int) (p->length));
-#endif
-#ifdef DEBUG_RRC_STATE
-      rrc_print_buffer (rcve_buffer, 100);
-      msg ("[RRC_UE] DATA_TRANSFER_REQ primitive length: %d\n", (int) (p->length));
-      msg ("[RRC_UE] Local Connection reference: %d\n", p->nasUEDCPrimitive.data_transfer_req.localConnectionRef);
-      msg ("[RRC_UE] Priority (not used yet): %d\n", p->nasUEDCPrimitive.data_transfer_req.priority);
-      msg ("[RRC_UE] Data length: %d\n", data_length);
-      rrc_print_buffer ((char *) (protocol_ms->rrc.ul_nas_message_ptr)->data, data_length);
-#endif
-
-      //send it only if connected mode
-      if (protocol_ms->rrc.protocol_state & CONNECTED) {
-        if (protocol_ms->rrc.idata_xfer) {
-          rrc_ue_msg_initXfer (&Message_Id);
-          protocol_ms->rrc.idata_xfer = FALSE;
-        } else {
-          rrc_ue_msg_ulXfer (&Message_Id);
-        }
-
-        RRC_UE_SEND_AM_SRB3 (Message_Id);
-      } else {
-        msg ("[RRC_UE_ERROR] DATA_TRANSFER_REQ primitive received in invalid state: %d\n", protocol_ms->rrc.protocol_state);
-      }
-
-      free_mem_block (protocol_ms->rrc.ul_nas_message_ptr);
-    }
-
-    break;
-
-  default:
-    msg ("[RRC_UE] Invalid message received\n");
-    rrc_print_buffer (rcve_buffer, count);
-    count = -1;
-    break;
-  }
-
-  return count;
-
-}
diff --git a/openair2/RRC/CELLULAR/rrc_ue_msg_peer.c b/openair2/RRC/CELLULAR/rrc_ue_msg_peer.c
deleted file mode 100755
index a275eb37eb..0000000000
--- a/openair2/RRC/CELLULAR/rrc_ue_msg_peer.c
+++ /dev/null
@@ -1,687 +0,0 @@
-/***************************************************************************
-                          rrc_ue_msg_peer.c  -  description
-                             -------------------
-    begin                : Jan 6, 2003
-    copyright            : (C) 2003, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Procedures to perform encoding/decoding of RRC messages in UE
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_ue_vars.h"
-#include "rrc_msg_class.h"
-// A verifier
-// #include "rrc_msg_pdus.h"
-// #include "rrc_msg_constant.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_msg.h"
-#include "rrc_proto_int.h"
-
-/**************************************************************/
-/*  Uplink CCCH messages - Encode                             */
-/**************************************************************/
-//-----------------------------------------------------------------------------
-/*  RRC Connection Request                                    */
-void rrc_ue_msg_connreq(int *Message_Id)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  UL_CCCH_Message * ul_ccch_msg;
-  mem_block_t *p;
-
-  if (!protocol_ms->rrc.establishment_cause)
-    protocol_ms->rrc.establishment_cause = registration;
-  else
-    protocol_ms->rrc.establishment_cause = callRe_establishment;
-
-  protocol_ms->rrc.prot_error_indicator = noError;
-
-  // prepare encoding
-  *Message_Id = ++ protocol_ms->rrc.ue_msg_infos.msg_Id;
-  protocol_ms->rrc.ue_msg_infos.msg_length = MSG_HEAD_LGTH + sizeof(RRCConnectionRequest);
-  // Temp - Test/Messages
-  //   ul_ccch_msg = malloc (protocol_ms->rrc.ue_msg_infos.msg_length);
-  //   memset (ul_ccch_msg, 0, protocol_ms->rrc.ue_msg_infos.msg_length);
-  //   //
-  //   protocol_ms->rrc.ue_msg_infos.msg_ptr = ul_ccch_msg;
-  p = get_free_mem_block(protocol_ms->rrc.ue_msg_infos.msg_length);
-  ul_ccch_msg = (struct UL_CCCH_Message *)p->data;
-  //
-  protocol_ms->rrc.ue_msg_infos.mem_block_ptr = p;
-  protocol_ms->rrc.ue_msg_infos.msg_ptr = ul_ccch_msg;
-  // Encode
-  ul_ccch_msg->integrityCheckInfo = 0; // No check with RRC Connection Request
-  ul_ccch_msg->message.type = UL_CCCH_rrcConnectionRequest;
-  status = rrc_PEREnc_RRCConnectionRequest((RRCConnectionRequest*) &(ul_ccch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Connection Request - status : %d\n", status);
-  msg("\n[RRC_MSG] Connection Request - length : %d\n", protocol_ms->rrc.ue_msg_infos.msg_length);
-  rrc_print_buffer((char*)protocol_ms->rrc.ue_msg_infos.msg_ptr,protocol_ms->rrc.ue_msg_infos.msg_length);
-#endif
-}
-
-//-----------------------------------------------------------------------------
-/*  Cell Update    */
-void rrc_ue_msg_cellUpdate(int *Message_Id)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  UL_CCCH_Message * ul_ccch_msg;
-  mem_block_t *p;
-
-  // Temp : Hard coded values
-  protocol_ms->rrc.am_RLC_ErrorIndicationRb2_3or4 = FALSE;
-  protocol_ms->rrc.am_RLC_ErrorIndicationRb5orAbove = FALSE;
-  protocol_ms->rrc.cellUpdateCause = re_enteredServiceArea;
-
-  // prepare encoding
-  *Message_Id = ++ protocol_ms->rrc.ue_msg_infos.msg_Id;
-  protocol_ms->rrc.ue_msg_infos.msg_length = MSG_HEAD_LGTH + sizeof(CellUpdate);
-  // Temp - Test/Messages
-  //ul_ccch_msg = malloc (protocol_ms->rrc.ue_msg_infos.msg_length);
-  //memset (ul_ccch_msg, 0, protocol_ms->rrc.ue_msg_infos.msg_length);
-  //
-  //protocol_ms->rrc.ue_msg_infos.msg_ptr = ul_ccch_msg;
-  p = get_free_mem_block(protocol_ms->rrc.ue_msg_infos.msg_length);
-  ul_ccch_msg = (struct UL_CCCH_Message *)p->data;
-  //
-  protocol_ms->rrc.ue_msg_infos.mem_block_ptr = p;
-  protocol_ms->rrc.ue_msg_infos.msg_ptr = ul_ccch_msg;
-  // Encode
-  ul_ccch_msg->integrityCheckInfo = 123;
-  ul_ccch_msg->message.type = UL_CCCH_cellUpdate;
-  status = rrc_PEREnc_CellUpdate ((CellUpdate*) &(ul_ccch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Cell Update - status : %d\n", status);
-  msg("\n[RRC_MSG] Cell Update - length : %d\n", protocol_ms->rrc.ue_msg_infos.msg_length);
-  rrc_print_buffer((char*)protocol_ms->rrc.ue_msg_infos.msg_ptr,protocol_ms->rrc.ue_msg_infos.msg_length);
-#endif
-}
-
-/**************************************************************/
-/*  Uplink DCCH messages - Encode                             */
-/**************************************************************/
-//-----------------------------------------------------------------------------
-/*  RRC Connection Setup Complete      */
-void rrc_ue_msg_connsucompl(int *Message_Id)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  UL_DCCH_Message * ul_dcch_msg;
-  mem_block_t *p;
-
-  // prepare encoding
-  *Message_Id = ++ protocol_ms->rrc.ue_msg_infos.msg_Id;
-  protocol_ms->rrc.ue_msg_infos.msg_length = MSG_HEAD_LGTH + sizeof(RRCConnectionSetupComplete);
-  // Temp - Test/Messages
-  //   ul_dcch_msg = malloc (protocol_ms->rrc.ue_msg_infos.msg_length);
-  //   memset (ul_dcch_msg, 0, protocol_ms->rrc.ue_msg_infos.msg_length);
-  //   //
-  //   protocol_ms->rrc.ue_msg_infos.msg_ptr = ul_dcch_msg;
-  p = get_free_mem_block(protocol_ms->rrc.ue_msg_infos.msg_length);
-  ul_dcch_msg = (struct UL_DCCH_Message *)p->data;
-  //
-  protocol_ms->rrc.ue_msg_infos.mem_block_ptr = p;
-  protocol_ms->rrc.ue_msg_infos.msg_ptr = ul_dcch_msg;
-  // Encode
-  ul_dcch_msg->integrityCheckInfo = 0; // No check with RRC Connection Setup Complete
-  ul_dcch_msg->message.type = UL_DCCH_rrcConnectionSetupComplete;
-  status = rrc_PEREnc_RRCConnectionSetupComplete((RRCConnectionSetupComplete*) &(ul_dcch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Connection Setup Compl - status : %d - length : %d\n", status, protocol_ms->rrc.ue_msg_infos.msg_length);
-  rrc_print_buffer((char*)protocol_ms->rrc.ue_msg_infos.msg_ptr,protocol_ms->rrc.ue_msg_infos.msg_length);
-#endif
-}
-
-//-----------------------------------------------------------------------------
-/*  RRC Connection Release MD      */
-void rrc_ue_msg_connrelUL(int *Message_Id)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  UL_DCCH_Message * ul_dcch_msg;
-  mem_block_t *p;
-
-  // prepare encoding
-  *Message_Id = ++ protocol_ms->rrc.ue_msg_infos.msg_Id;
-  protocol_ms->rrc.ue_msg_infos.msg_length = MSG_HEAD_LGTH + sizeof(RRCConnectionRelease_UL);
-  // Temp - Test/Messages
-  //   ul_dcch_msg = malloc (protocol_ms->rrc.ue_msg_infos.msg_length);
-  //   memset (ul_dcch_msg, 0, protocol_ms->rrc.ue_msg_infos.msg_length);
-  //   //
-  //   protocol_ms->rrc.ue_msg_infos.msg_ptr = ul_dcch_msg;
-  p = get_free_mem_block(protocol_ms->rrc.ue_msg_infos.msg_length);
-  ul_dcch_msg = (struct UL_DCCH_Message *)p->data;
-  //
-  protocol_ms->rrc.ue_msg_infos.mem_block_ptr = p;
-  protocol_ms->rrc.ue_msg_infos.msg_ptr = ul_dcch_msg;
-  // Encode
-  ul_dcch_msg->integrityCheckInfo = 123;
-  ul_dcch_msg->message.type = UL_DCCH_rrcConnectionReleaseUL;
-  status = rrc_PEREnc_RRCConnectionRelease_UL((RRCConnectionRelease_UL*) &(ul_dcch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Connection Release Uplink - status : %d - length : %d\n", status, protocol_ms->rrc.ue_msg_infos.msg_length);
-  rrc_print_buffer((char*)protocol_ms->rrc.ue_msg_infos.msg_ptr,protocol_ms->rrc.ue_msg_infos.msg_length);
-#endif
-}
-
-//-----------------------------------------------------------------------------
-/*  InitialDirectTransfer      */
-void rrc_ue_msg_initXfer(int *Message_Id)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  UL_DCCH_Message * ul_dcch_msg;
-  mem_block_t *p;
-
-  // prepare encoding
-  *Message_Id = ++ protocol_ms->rrc.ue_msg_infos.msg_Id;
-  protocol_ms->rrc.ue_msg_infos.msg_length = MSG_HEAD_LGTH + sizeof(InitialDirectTransfer);
-  // Temp - Test/Messages
-  //   ul_dcch_msg = malloc (protocol_ms->rrc.ue_msg_infos.msg_length);
-  //   memset (ul_dcch_msg, 0, protocol_ms->rrc.ue_msg_infos.msg_length);
-  //   //
-  //   protocol_ms->rrc.ue_msg_infos.msg_ptr = ul_dcch_msg;
-  p = get_free_mem_block(protocol_ms->rrc.ue_msg_infos.msg_length);
-  ul_dcch_msg = (struct UL_DCCH_Message *)p->data;
-  //
-  protocol_ms->rrc.ue_msg_infos.mem_block_ptr = p;
-  protocol_ms->rrc.ue_msg_infos.msg_ptr = ul_dcch_msg;
-
-  // Encode
-  ul_dcch_msg->integrityCheckInfo = 123;
-  ul_dcch_msg->message.type = UL_DCCH_initialDirectTransfer;
-  status = rrc_PEREnc_InitialDirectTransfer((InitialDirectTransfer*) &(ul_dcch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Initial Direct Transfer - status : %d - length : %d\n", status, protocol_ms->rrc.ue_msg_infos.msg_length);
-  rrc_print_buffer((char*)protocol_ms->rrc.ue_msg_infos.msg_ptr,protocol_ms->rrc.ue_msg_infos.msg_length);
-#endif
-}
-
-//-----------------------------------------------------------------------------
-/*  Uplink Direct Transfer      */
-void rrc_ue_msg_ulXfer(int *Message_Id)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  UL_DCCH_Message * ul_dcch_msg;
-  mem_block_t *p;
-
-  // prepare encoding
-  *Message_Id = ++ protocol_ms->rrc.ue_msg_infos.msg_Id;
-  protocol_ms->rrc.ue_msg_infos.msg_length = MSG_HEAD_LGTH + sizeof(UplinkDirectTransfer);
-  // Temp - Test/Messages
-  //   ul_dcch_msg = malloc (protocol_ms->rrc.ue_msg_infos.msg_length);
-  //   memset (ul_dcch_msg, 0, protocol_ms->rrc.ue_msg_infos.msg_length);
-  //   //
-  //   protocol_ms->rrc.ue_msg_infos.msg_ptr = ul_dcch_msg;
-  p = get_free_mem_block(protocol_ms->rrc.ue_msg_infos.msg_length);
-  ul_dcch_msg = (struct UL_DCCH_Message *)p->data;
-  //
-  protocol_ms->rrc.ue_msg_infos.mem_block_ptr = p;
-  protocol_ms->rrc.ue_msg_infos.msg_ptr = ul_dcch_msg;
-
-  // Encode
-  ul_dcch_msg->integrityCheckInfo = 123;
-  ul_dcch_msg->message.type = UL_DCCH_uplinkDirectTransfer;
-  status = rrc_PEREnc_UplinkDirectTransfer((UplinkDirectTransfer*) &(ul_dcch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Uplink Direct Transfer - status : %d - length : %d\n", status, protocol_ms->rrc.ue_msg_infos.msg_length);
-  rrc_print_buffer((char*)protocol_ms->rrc.ue_msg_infos.msg_ptr,protocol_ms->rrc.ue_msg_infos.msg_length);
-#endif
-}
-
-//-----------------------------------------------------------------------------
-/*  Radio Bearer Setup Complete      */
-void rrc_ue_msg_rbsetupcompl(int *Message_Id)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  UL_DCCH_Message * ul_dcch_msg;
-  mem_block_t *p;
-
-  // prepare encoding
-  *Message_Id = ++ protocol_ms->rrc.ue_msg_infos.msg_Id;
-  protocol_ms->rrc.ue_msg_infos.msg_length = MSG_HEAD_LGTH + sizeof(RadioBearerSetupComplete);
-  // Temp - Test/Messages
-  //   ul_dcch_msg = malloc (protocol_ms->rrc.ue_msg_infos.msg_length);
-  //   memset (ul_dcch_msg, 0, protocol_ms->rrc.ue_msg_infos.msg_length);
-  //   //
-  //   protocol_ms->rrc.ue_msg_infos.msg_ptr = ul_dcch_msg;
-  p = get_free_mem_block(protocol_ms->rrc.ue_msg_infos.msg_length);
-  ul_dcch_msg = (struct UL_DCCH_Message *)p->data;
-  //
-  protocol_ms->rrc.ue_msg_infos.mem_block_ptr = p;
-  protocol_ms->rrc.ue_msg_infos.msg_ptr = ul_dcch_msg;
-  // Encode
-  ul_dcch_msg->integrityCheckInfo = 123;
-  ul_dcch_msg->message.type = UL_DCCH_radioBearerSetupComplete;
-  status = rrc_PEREnc_RadioBearerSetupComplete((RadioBearerSetupComplete*) &(ul_dcch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Radio Bearer Setup Complete - status : %d - length : %d\n", status, protocol_ms->rrc.ue_msg_infos.msg_length);
-  rrc_print_buffer((char*)protocol_ms->rrc.ue_msg_infos.msg_ptr,protocol_ms->rrc.ue_msg_infos.msg_length);
-#endif
-}
-
-//-----------------------------------------------------------------------------
-/*  Radio Bearer Setup Failure      */
-void rrc_ue_msg_rbsetupfail(int *Message_Id)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  UL_DCCH_Message * ul_dcch_msg;
-  mem_block_t *p;
-
-  // prepare encoding
-  *Message_Id = ++ protocol_ms->rrc.ue_msg_infos.msg_Id;
-  protocol_ms->rrc.ue_msg_infos.msg_length = MSG_HEAD_LGTH + sizeof(RadioBearerSetupFailure);
-  // Temp - Test/Messages
-  //   ul_dcch_msg = malloc (protocol_ms->rrc.ue_msg_infos.msg_length);
-  //   memset (ul_dcch_msg, 0, protocol_ms->rrc.ue_msg_infos.msg_length);
-  //   //
-  //   protocol_ms->rrc.ue_msg_infos.msg_ptr = ul_dcch_msg;
-  p = get_free_mem_block(protocol_ms->rrc.ue_msg_infos.msg_length);
-  ul_dcch_msg = (struct UL_DCCH_Message *)p->data;
-  //
-  protocol_ms->rrc.ue_msg_infos.mem_block_ptr = p;
-  protocol_ms->rrc.ue_msg_infos.msg_ptr = ul_dcch_msg;
-  // Encode
-  ul_dcch_msg->integrityCheckInfo = 123;
-  ul_dcch_msg->message.type = UL_DCCH_radioBearerSetupFailure;
-  status = rrc_PEREnc_RadioBearerSetupFailure((RadioBearerSetupFailure*) &(ul_dcch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Radio Bearer Setup Failure - status : %d - length : %d\n", status, protocol_ms->rrc.ue_msg_infos.msg_length);
-  rrc_print_buffer((char*)protocol_ms->rrc.ue_msg_infos.msg_ptr,protocol_ms->rrc.ue_msg_infos.msg_length);
-#endif
-}
-
-//-----------------------------------------------------------------------------
-/*  Radio Bearer Release Complete      */
-void rrc_ue_msg_rbreleasecompl(int *Message_Id)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  UL_DCCH_Message * ul_dcch_msg;
-  mem_block_t *p;
-
-  // prepare encoding
-  *Message_Id = ++ protocol_ms->rrc.ue_msg_infos.msg_Id;
-  protocol_ms->rrc.ue_msg_infos.msg_length = MSG_HEAD_LGTH + sizeof(RadioBearerReleaseComplete);
-  // Temp - Test/Messages
-  //   ul_dcch_msg = malloc (protocol_ms->rrc.ue_msg_infos.msg_length);
-  //   memset (ul_dcch_msg, 0, protocol_ms->rrc.ue_msg_infos.msg_length);
-  //   //
-  //   protocol_ms->rrc.ue_msg_infos.msg_ptr = ul_dcch_msg;
-  p = get_free_mem_block(protocol_ms->rrc.ue_msg_infos.msg_length);
-  ul_dcch_msg = (struct UL_DCCH_Message *)p->data;
-  //
-  protocol_ms->rrc.ue_msg_infos.mem_block_ptr = p;
-  protocol_ms->rrc.ue_msg_infos.msg_ptr = ul_dcch_msg;
-  // Encode
-  ul_dcch_msg->integrityCheckInfo = 123;
-  ul_dcch_msg->message.type = UL_DCCH_radioBearerReleaseComplete;
-  status = rrc_PEREnc_RadioBearerReleaseComplete((RadioBearerReleaseComplete*) &(ul_dcch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Radio Bearer Release Complete - status : %d - length : %d\n", status, protocol_ms->rrc.ue_msg_infos.msg_length);
-  rrc_print_buffer((char*)protocol_ms->rrc.ue_msg_infos.msg_ptr,protocol_ms->rrc.ue_msg_infos.msg_length);
-#endif
-}
-
-//-----------------------------------------------------------------------------
-/*  Radio Bearer Release Failure      */
-void rrc_ue_msg_rbreleasefail(int *Message_Id)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  UL_DCCH_Message * ul_dcch_msg;
-  mem_block_t *p;
-
-  // prepare encoding
-  *Message_Id = ++ protocol_ms->rrc.ue_msg_infos.msg_Id;
-  protocol_ms->rrc.ue_msg_infos.msg_length = MSG_HEAD_LGTH + sizeof(RadioBearerReleaseFailure);
-  // Temp - Test/Messages
-  //   ul_dcch_msg = malloc (protocol_ms->rrc.ue_msg_infos.msg_length);
-  //   memset (ul_dcch_msg, 0, protocol_ms->rrc.ue_msg_infos.msg_length);
-  //   //
-  //   protocol_ms->rrc.ue_msg_infos.msg_ptr = ul_dcch_msg;
-  p = get_free_mem_block(protocol_ms->rrc.ue_msg_infos.msg_length);
-  ul_dcch_msg = (struct UL_DCCH_Message *)p->data;
-  //
-  protocol_ms->rrc.ue_msg_infos.mem_block_ptr = p;
-  protocol_ms->rrc.ue_msg_infos.msg_ptr = ul_dcch_msg;
-  // Encode
-  ul_dcch_msg->integrityCheckInfo = 123;
-  ul_dcch_msg->message.type = UL_DCCH_radioBearerReleaseFailure;
-  status = rrc_PEREnc_RadioBearerReleaseFailure((RadioBearerReleaseFailure*) &(ul_dcch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Radio Bearer Release Failure - status : %d - length : %d\n", status, protocol_ms->rrc.ue_msg_infos.msg_length);
-  rrc_print_buffer((char*)protocol_ms->rrc.ue_msg_infos.msg_ptr,protocol_ms->rrc.ue_msg_infos.msg_length);
-#endif
-}
-
-/*  Measurement Report   */
-//-----------------------------------------------------------------------------
-void rrc_ue_msg_measrep(int *Message_Id)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  UL_DCCH_Message * ul_dcch_msg;
-  mem_block_t *p;
-
-  // prepare encoding
-  *Message_Id = ++ protocol_ms->rrc.ue_msg_infos.msg_Id;
-  protocol_ms->rrc.ue_msg_infos.msg_length = MSG_HEAD_LGTH + sizeof(MeasurementReport);
-  // Temp - Test/Messages
-  //   ul_dcch_msg = malloc (protocol_ms->rrc.ue_msg_infos.msg_length);
-  //   memset (ul_dcch_msg, 0, protocol_ms->rrc.ue_msg_infos.msg_length);
-  //
-  //   protocol_ms->rrc.ue_msg_infos.msg_ptr = ul_dcch_msg;
-  p = get_free_mem_block(protocol_ms->rrc.ue_msg_infos.msg_length);
-  ul_dcch_msg = (struct UL_DCCH_Message *)p->data;
-  //
-  protocol_ms->rrc.ue_msg_infos.mem_block_ptr = p;
-  protocol_ms->rrc.ue_msg_infos.msg_ptr = ul_dcch_msg;
-  // Encode
-  ul_dcch_msg->integrityCheckInfo = 123;
-  ul_dcch_msg->message.type = UL_DCCH_measurementReport;
-  status = rrc_PEREnc_MeasurementReport((MeasurementReport*) &(ul_dcch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Measurement Report - status : %d - length : %d\n", status, protocol_ms->rrc.ue_msg_infos.msg_length);
-  rrc_print_buffer((char*)protocol_ms->rrc.ue_msg_infos.msg_ptr,protocol_ms->rrc.ue_msg_infos.msg_length);
-#endif
-}
-
-/**************************************************************/
-/*  Downlink CCCH messages - Decode                           */
-/**************************************************************/
-/*  RRC Connection Setup  */
-//-----------------------------------------------------------------------------
-int rrc_ue_msg_connsetup(DL_CCCH_Message * dl_ccch_msg)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  status = rrc_PERDec_RRCConnectionSetup((RRCConnectionSetup*) &(dl_ccch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] RRC Connection Setup Received - status : %d\n", status);
-  msg("\n[RRC_MSG] Transaction Identifier %d, Activation Time %d\n",
-      protocol_ms->rrc.rcved_trans.transaction_Id,
-      protocol_ms->rrc.nextActivationTime );
-  msg("[RRC_MSG] U-RNTI %d, New_State %d\n",
-      protocol_ms->rrc.u_rnti,
-      protocol_ms->rrc.next_state );
-#endif
-  return status;
-}
-
-/*  RRCConnectionReject  */
-//-----------------------------------------------------------------------------
-int rrc_ue_msg_connreject(DL_CCCH_Message * dl_ccch_msg)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  status = rrc_PERDec_RRCConnectionReject((RRCConnectionReject*) &(dl_ccch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] RRC Connection Reject Received - status : %d\n", status);
-  msg("\n[RRC_MSG] Transaction Identifier %d, Wait Time %d\n",
-      protocol_ms->rrc.rcved_trans.transaction_Id,
-      protocol_ms->rrc.rejectWaitTime );
-#endif
-  return status;
-}
-
-/*  CellUpdateConfirm_CCCH  */
-//-----------------------------------------------------------------------------
-int rrc_ue_msg_cellupdatecnfccch(DL_CCCH_Message * dl_ccch_msg)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  if  (dl_ccch_msg->integrityCheckInfo != 123)
-    return P_INVINTEGRITY;
-
-  status = rrc_PERDec_CellUpdateConfirm_CCCH((CellUpdateConfirm_CCCH*) &(dl_ccch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] CellUpdateConfirm_CCCH Received - status : %d\n", status);
-  msg("\n[RRC_MSG] Transaction Identifier %d, Activation Time %d\n",
-      protocol_ms->rrc.rcved_trans.transaction_Id,
-      protocol_ms->rrc.nextActivationTime );
-  msg("[RRC_MSG] U-RNTI %d, New_State %d\n",
-      protocol_ms->rrc.u_rnti,
-      protocol_ms->rrc.next_state );
-  msg("[RRC_MSG] SRB2-3-4 %d, RB5+ %d\n",
-      protocol_ms->rrc.rlc_Re_establishIndicatorRb2_3or4,
-      protocol_ms->rrc.rlc_Re_establishIndicatorRb5orAbove );
-#endif
-  return status;
-}
-
-/* UE Capability Information */
-//-----------------------------------------------------------------------------
-void  rrc_ue_msg_ueCapInfo(int *Message_Id)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-  UL_DCCH_Message * ul_dcch_msg;
-  mem_block_t *p;
-
-  // prepare encoding
-  *Message_Id = ++ protocol_ms->rrc.ue_msg_infos.msg_Id;
-  protocol_ms->rrc.ue_msg_infos.msg_length = MSG_HEAD_LGTH + sizeof(UECapabilityInformation);
-  p = get_free_mem_block(protocol_ms->rrc.ue_msg_infos.msg_length);
-  ul_dcch_msg = (struct UL_DCCH_Message *)p->data;
-
-  //Reference to the memory block
-  protocol_ms->rrc.ue_msg_infos.mem_block_ptr = p;
-  protocol_ms->rrc.ue_msg_infos.msg_ptr = ul_dcch_msg;
-
-  // Encode
-  ul_dcch_msg->integrityCheckInfo = 123;
-  ul_dcch_msg->message.type = UL_DCCH_ueCapabilityInformation;
-  status = rrc_PEREnc_UECapabilityInformation ((UECapabilityInformation*) &(ul_dcch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] UE Capability Information  - status : %d - length : %d\n",
-      status, protocol_ms->rrc.ue_msg_infos.msg_length);
-  msg("[RRC_MSG] Kernel Release = %d, ", EURECOM_KERNEL_RELEASE_INDICATOR_DEFAULT);
-  msg("Access Stratum Release = ");
-
-  switch(ACCESS_STRATUM_RELEASE_INDICATOR_DEFAULT) {
-  case ACCESS_STRATUM_RELEASE_INDICATOR_REL_4:
-    msg("REL-4\n");
-    break;
-
-  case ACCESS_STRATUM_RELEASE_INDICATOR_REL_5:
-    msg("REL-5\n");
-    break;
-
-  case ACCESS_STRATUM_RELEASE_INDICATOR_REL_6:
-    msg("REL-6\n");
-    break;
-
-  default:
-    msg("Unrecognized!\n");
-  }
-
-  rrc_print_buffer((char*)protocol_ms->rrc.ue_msg_infos.msg_ptr,protocol_ms->rrc.ue_msg_infos.msg_length);
-#endif
-}
-
-/**************************************************************/
-/*  Downlink DCCH messages - Decode                           */
-/**************************************************************/
-/*  RadioBearerSetup  */
-//-----------------------------------------------------------------------------
-int rrc_ue_msg_rbsetup(DL_DCCH_Message * dl_dcch_msg)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  if  (dl_dcch_msg->integrityCheckInfo != 123)
-    return P_INVINTEGRITY;
-
-  status = rrc_PERDec_RadioBearerSetup((RadioBearerSetup*) &(dl_dcch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Radio Bearer Setup Received - status : %d\n", status);
-  msg("\n[RRC_MSG] Transaction Identifier %d, Activation Time %d,",
-      protocol_ms->rrc.rcved_trans.transaction_Id,
-      protocol_ms->rrc.nextActivationTime );
-  msg(" U-RNTI %d, New_State %d\n",
-      protocol_ms->rrc.u_rnti,
-      protocol_ms->rrc.next_state );
-  msg("[RRC_MSG] RB information: ");
-  msg("RB_Id: %d, Radio QoS: %d, IP DSCP: %d, SAP Id: %d. \n",
-      protocol_ms->rrc.requested_rbId, protocol_ms->rrc.requested_QoSclass,
-      protocol_ms->rrc.requested_dscp, protocol_ms->rrc.requested_sapid);
-#endif
-  return status;
-}
-
-/*  RadioBearerRelease  */
-//-----------------------------------------------------------------------------
-int rrc_ue_msg_rbrelease(DL_DCCH_Message * dl_dcch_msg)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  if  (dl_dcch_msg->integrityCheckInfo != 123)
-    return P_INVINTEGRITY;
-
-  status = rrc_PERDec_RadioBearerRelease((RadioBearerRelease*) &(dl_dcch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Radio Bearer Release Received - status : %d\n", status);
-  msg("\n[RRC_MSG] Transaction Identifier %d, Activation Time %d, U-RNTI %d, New_State %d\n",
-      protocol_ms->rrc.rcved_trans.transaction_Id,
-      protocol_ms->rrc.nextActivationTime,
-      protocol_ms->rrc.u_rnti,
-      protocol_ms->rrc.next_state);
-  msg("[RRC_MSG] RB information : RB_Id : %d\n", protocol_ms->rrc.requested_rbId);
-#endif
-  return status;
-}
-
-/*  DownlinkDirectTransfer  */
-//-----------------------------------------------------------------------------
-int rrc_ue_msg_dlXfer(DL_DCCH_Message * dl_dcch_msg)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  if  (dl_dcch_msg->integrityCheckInfo != 123)
-    return P_INVINTEGRITY;
-
-  status = rrc_PERDec_DownlinkDirectTransfer((DownlinkDirectTransfer*) &(dl_dcch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Downlink Direct Transfer Received - status : %d\n", status);
-  msg("\n[RRC_MSG] Transaction Identifier %d\n",
-      protocol_ms->rrc.rcved_trans.transaction_Id);
-#endif
-  return status;
-}
-
-/*  PagingType2  */
-//-----------------------------------------------------------------------------
-int rrc_ue_msg_pagingt2(DL_DCCH_Message * dl_dcch_msg)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  if  (dl_dcch_msg->integrityCheckInfo != 123)
-    return P_INVINTEGRITY;
-
-  status = rrc_PERDec_PagingType2((PagingType2*) &(dl_dcch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Paging Type 2 Received - status : %d\n", status);
-  msg("\n[RRC_MSG] Transaction Identifier %d\n",
-      protocol_ms->rrc.rcved_trans.transaction_Id);
-#endif
-  return status;
-}
-
-/*  MeasurementControl  */
-//-----------------------------------------------------------------------------
-int rrc_ue_msg_measctl(DL_DCCH_Message * dl_dcch_msg)
-{
-  //-----------------------------------------------------------------------------
-
-  int status = P_SUCCESS;
-
-  if  (dl_dcch_msg->integrityCheckInfo != 123)
-    return P_INVINTEGRITY;
-
-  status = rrc_PERDec_MeasurementControl((MeasurementControl *) &(dl_dcch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] Measurement Control message Received - status : %d\n", status);
-  msg("\n[RRC_MSG] Transaction Identifier %d\n",
-      protocol_ms->rrc.rcved_trans.transaction_Id);
-#endif
-  return (status);
-}
-
-// /*  Uplink Physical Channel Control  */
-// //-----------------------------------------------------------------------------
-// int rrc_ue_msg_ULPCHctl(DL_DCCH_Message * dl_dcch_msg){
-// //-----------------------------------------------------------------------------
-//
-//  int status = P_SUCCESS;
-//
-//   if  (dl_dcch_msg->integrityCheckInfo != 123)
-//     return P_INVINTEGRITY;
-//
-//    status = rrc_PERDec_ULPCHControl((MeasurementControl *) &(dl_dcch_msg->message.content));
-//
-//   #ifdef DEBUG_RRC_STATE
-//    msg("\n[RRC_MSG] Uplink Physical Channel Control message Received - status : %d\n", status);
-//    msg("\n[RRC_MSG] Transaction Identifier %d\n",
-//                     protocol_ms->rrc.rcved_trans.transaction_Id);
-//   #endif
-//    return (status);
-// }
-
-
-/* UE Capability Information Confirm*/
-//-----------------------------------------------------------------------------
-int  rrc_ue_msg_ueCapInfoCnf(DL_DCCH_Message * dl_dcch_msg)
-{
-  //-----------------------------------------------------------------------------
-  int status = P_SUCCESS;
-
-  if  (dl_dcch_msg->integrityCheckInfo != 123)
-    return P_INVINTEGRITY;
-
-  status = rrc_PERDec_UECapabilityInformationConfirm((UECapabilityInformationConfirm*) &(dl_dcch_msg->message.content));
-
-#ifdef DEBUG_RRC_STATE
-  msg("\n[RRC_MSG] UE Capability Information Confirm Received - status : %d\n", status);
-#endif
-  return status;
-}
-
diff --git a/openair2/RRC/CELLULAR/rrc_ue_nas_intf.c b/openair2/RRC/CELLULAR/rrc_ue_nas_intf.c
deleted file mode 100755
index d1f7b1f054..0000000000
--- a/openair2/RRC/CELLULAR/rrc_ue_nas_intf.c
+++ /dev/null
@@ -1,326 +0,0 @@
-/***************************************************************************
-                          rrc_ue_nas_intf.c  -
-                          -------------------
-    begin                : Tue Jan 15 2002
-    copyright            : (C) 2002, 2010 by Eurecom
-    created by           : michelle.wetterwald@eurecom.fr
- **************************************************************************
-    This file contains the functions used to interface the NAS
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-#include "rtos_header.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_ue_vars.h"
-#include "rrc_nas_sap.h"
-#include "rrc_messages.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_int.h"
-//-----------------------------------------------------------------------------
-// For FIFOS / NETLINK interface
-#ifdef USER_MODE
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-#ifdef RRC_NETLINK
-#include <sys/socket.h>
-#include <linux/netlink.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#endif
-#endif
-
-extern int rrc_ue_mobileId;
-
-#ifdef RRC_NETLINK
-//#define MAX_PAYLOAD 4096  /* this sould cover the max mtu size*/
-struct nlmsghdr *rrcnl_nlh;
-int rrcnl_sock_fd;
-struct sockaddr_nl rrcnl_src_addr, rrcnl_dest_addr;
-struct iovec rrcnl_iov;
-struct msghdr rrcnl_msg;
-#endif
-
-
-#ifdef USER_MODE
-#ifndef RRC_NETLINK
-//-----------------------------------------------------------------------------
-// Create and initialize FIFOs for UE RRC SAPs
-void rrc_ue_sap_init (void)
-{
-  //-----------------------------------------------------------------------------
-  int  write_flag = O_WRONLY | O_NONBLOCK | O_NDELAY;
-  int  read_flag = O_RDONLY | O_NONBLOCK | O_NDELAY;
-  char gcsap[40], ntsap[40], dcsap_in[40], dcsap_out[40];
-
-  sprintf (gcsap, "%s%d", RRC_SAPI_UE_GCSAP, rrc_ue_mobileId);
-  sprintf (ntsap, "%s%d", RRC_SAPI_UE_NTSAP, rrc_ue_mobileId);
-  sprintf (dcsap_in, "%s%d", RRC_SAPI_UE_DCSAP_IN, rrc_ue_mobileId);
-  sprintf (dcsap_out, "%s%d", RRC_SAPI_UE_DCSAP_OUT, rrc_ue_mobileId);
-
-  // Create FIFOs
-  rrc_create_fifo (gcsap);
-  rrc_create_fifo (ntsap);
-  rrc_create_fifo (dcsap_in);
-  rrc_create_fifo (dcsap_out);
-
-  // Open FIFOs
-  while ((protocol_ms->rrc.rrc_ue_GC_fifo = open (gcsap, write_flag)) < 0) {
-    msg ("%s returned value %d\n", gcsap, protocol_ms->rrc.rrc_ue_GC_fifo);
-    sleep (1);
-  }
-
-  while ((protocol_ms->rrc.rrc_ue_NT_fifo = open (ntsap, write_flag)) < 0) {
-    msg ("%s returned value %d\n", ntsap, protocol_ms->rrc.rrc_ue_NT_fifo);
-    sleep (1);
-  }
-
-  while ((protocol_ms->rrc.rrc_ue_DCIn_fifo = open (dcsap_in, read_flag)) < 0) {
-    msg ("%s returned value %d\n", dcsap_in, protocol_ms->rrc.rrc_ue_DCIn_fifo);
-    sleep (1);
-  }
-
-  while ((protocol_ms->rrc.rrc_ue_DCOut_fifo = open (dcsap_out, write_flag)) < 0) {
-    msg ("%s returned value %d\n", dcsap_out, protocol_ms->rrc.rrc_ue_DCOut_fifo);
-    sleep (1);
-  }
-
-  // Print result
-  msg ("[RRC] %s returned value %d\n", gcsap, protocol_ms->rrc.rrc_ue_GC_fifo);
-  msg ("[RRC] %s returned value %d\n", ntsap, protocol_ms->rrc.rrc_ue_NT_fifo);
-  msg ("[RRC] %s returned value %d\n", dcsap_in, protocol_ms->rrc.rrc_ue_DCIn_fifo);
-  msg ("[RRC] %s returned value %d\n", dcsap_out, protocol_ms->rrc.rrc_ue_DCOut_fifo);
-}
-#else
-//-----------------------------------------------------------------------------
-// Create and initialize NETLINK Sockets for UE RRC SAPs
-void rrc_ue_netlink_init (void)
-{
-  //-----------------------------------------------------------------------------
-  int ret;
-
-  rrcnl_sock_fd = socket(PF_NETLINK, SOCK_RAW, NAS_RRCNL_ID);
-
-  if (rrcnl_sock_fd == -1) {
-    fprintf(stderr, "socket failed (%d:%s)\n", errno, strerror(errno));
-    exit(EXIT_FAILURE);
-  }
-
-  printf("rrc_ue_netlink_init - Opened socket with fd %d\n", rrcnl_sock_fd);
-
-  ret = fcntl(rrcnl_sock_fd,F_SETFL,O_NONBLOCK);
-  printf("rrc_ue_netlink_init - fcntl returns %d\n",ret);
-
-  memset(&rrcnl_src_addr, 0, sizeof(rrcnl_src_addr));
-  rrcnl_src_addr.nl_family = AF_NETLINK;
-  rrcnl_src_addr.nl_pid = NL_DEST_RRC_PID;//getpid();  /* self pid */
-  rrcnl_src_addr.nl_groups = 0;  /* not in mcast groups */
-  ret = bind(rrcnl_sock_fd, (struct sockaddr*)&rrcnl_src_addr, sizeof(rrcnl_src_addr));
-  printf("rrc_ue_netlink_init - bind returns %d\n",ret);
-
-  memset(&rrcnl_dest_addr, 0, sizeof(rrcnl_dest_addr));
-  rrcnl_dest_addr.nl_family = AF_NETLINK;
-  rrcnl_dest_addr.nl_pid = 0;   /* For Linux Kernel */
-  rrcnl_dest_addr.nl_groups = 0; /* unicast */
-
-  rrcnl_nlh=(struct nlmsghdr *)malloc(NLMSG_SPACE(RRC_NAS_MAX_SIZE));
-  //memset(rrcnl_nlh, 0, NLMSG_SPACE(MAX_PAYLOAD));
-  /* Fill the netlink message header */
-  rrcnl_nlh->nlmsg_len = NLMSG_SPACE(RRC_NAS_MAX_SIZE);
-  rrcnl_nlh->nlmsg_pid = NL_DEST_RRC_PID;//getpid();  /* self pid */
-  rrcnl_nlh->nlmsg_flags = 0;
-
-  rrcnl_iov.iov_base = (void *)rrcnl_nlh;
-  rrcnl_iov.iov_len = rrcnl_nlh->nlmsg_len;
-  memset(&rrcnl_msg,0,sizeof(rrcnl_msg));
-  rrcnl_msg.msg_name = (void *)&rrcnl_dest_addr;
-  rrcnl_msg.msg_namelen = sizeof(rrcnl_dest_addr);
-  rrcnl_msg.msg_iov = &rrcnl_iov;
-  rrcnl_msg.msg_iovlen = 1;
-
-  /* Read message from kernel */
-  memset(rrcnl_nlh, 0, NLMSG_SPACE(RRC_NAS_MAX_SIZE));
-  // Initialize FIFO values (to be used for SAP indicator in netlink xmit)
-  protocol_ms->rrc.rrc_ue_GC_fifo = RRC_NAS_GC_OUT;
-  protocol_ms->rrc.rrc_ue_NT_fifo = RRC_NAS_NT_OUT;
-  protocol_ms->rrc.rrc_ue_DCOut_fifo = RRC_NAS_DC0_OUT;
-}
-#endif //RRC_NETLINK
-#endif //USER_MODE
-
-#ifndef RRC_NETLINK
-//-----------------------------------------------------------------------------
-// This function sends data from RRC to the NAS
-void rrc_ue_write_FIFO (mem_block_t * p)
-{
-  //-----------------------------------------------------------------------------
-  int count = 0;
-  int xmit_length;
-  char *xmit_ptr;
-
-  // transmit the primitive
-  xmit_length = ((struct nas_ue_if_element *) p->data)->prim_length;
-  xmit_ptr = (char *) &((struct nas_ue_if_element *) p->data)->nasUePrimitive;
-  count = rtf_put (((struct nas_ue_if_element *) p->data)->xmit_fifo, xmit_ptr, xmit_length);
-
-  if (count == xmit_length) {
-#ifdef DEBUG_RRC_STATE
-    msg ("[RRC_UE][NAS] NAS primitive sent successfully, length %d \n", count);
-    //msg("\n[RRC_UE][NAS] on FIFO, %d \n", ((struct nas_ue_if_element *) p->data)->xmit_fifo);
-#endif
-    protocol_ms->rrc.NASMessageToXmit = p->next;        //Dequeue next message if any
-    free_mem_block (p);
-#ifndef USER_MODE
-
-    if (protocol_ms->rrc.ip_rx_irq > 0) {   //Temp - later a specific control irq
-      rt_pend_linux_srq (protocol_ms->rrc.ip_rx_irq);
-    } else {
-      msg ("[RRC_UE] ERROR IF IP STACK WANTED NOTIF PACKET(S) ip_rx_irq not initialized\n");
-    }
-
-#endif
-  } else {
-    msg ("[RRC_UE][NAS] transmission on FIFO failed, %d bytes sent\n", count);
-  }
-}
-#else
-//-----------------------------------------------------------------------------
-// This function sends data from RRC to the NAS via Netlink socket
-// Name has been kept rrc_ue_write_FIFO for backwards compatibility
-void rrc_ue_write_FIFO (mem_block_t * p)
-{
-  //-----------------------------------------------------------------------------
-  int count = 0;
-  int xmit_length;
-  char *xmit_ptr;
-  int ret;
-  char sap_to_write;
-
-  sap_to_write = (char) ((struct nas_ue_if_element *) p->data)->xmit_fifo;
-
-  // transmit the SAP value
-  memcpy (NLMSG_DATA(rrcnl_nlh), &sap_to_write, 1);
-  //msg ("[RRC_UE][NAS] rrc_ue_write_FIFO - xmit_fifo %d - sap_to_write %d\n", ((struct nas_ue_if_element *) p->data)->xmit_fifo, sap_to_write);
-
-  // transmit the primitive
-  xmit_length = ((struct nas_ue_if_element *) p->data)->prim_length;
-  xmit_ptr = (char *) &((struct nas_ue_if_element *) p->data)->nasUePrimitive;
-  memcpy (NLMSG_DATA(rrcnl_nlh)+1, xmit_ptr, xmit_length);
-  rrcnl_nlh->nlmsg_len = xmit_length+1;
-  //rrc_print_buffer (xmit_ptr, xmit_length);
-
-  ret = sendmsg(rrcnl_sock_fd,&rrcnl_msg,0);
-
-  if (ret<0) {
-    msg ("[RRC_UE][NAS] rrc_ue_write_FIFO - sendmsg returns %d (errno: %d)\n", ret, errno);
-    mac_xface->macphy_exit("RRC Netlink Socket could not be written");
-  } else {
-    count = xmit_length+1;
-#ifdef DEBUG_RRC_STATE
-    msg ("[RRC_UE][NAS] NAS primitive sent successfully, length %d (including NETLINK SAP value)\n", count);
-    //rrc_print_buffer (NLMSG_DATA(rrcnl_nlh), count);
-    //msg("\n[RRC_UE][NAS] on FIFO, %d \n", ((struct nas_ue_if_element *) p->data)->xmit_fifo);
-#endif
-    protocol_ms->rrc.NASMessageToXmit = p->next;        //Dequeue next message if any
-    free_mem_block (p);
-  }
-}
-#endif
-
-//-----------------------------------------------------------------------------
-// Enqueue a message for NAS -- NOT IMPLEMENTED YET
-void rrc_ue_nas_xmit_enqueue (mem_block_t * p)
-{
-  //-----------------------------------------------------------------------------
-  protocol_ms->rrc.NASMessageToXmit = p;
-}
-
-//-----------------------------------------------------------------------------
-// This function receives data in RRC from the NAS
-void rrc_ue_read_FIFO (void)
-{
-  //-----------------------------------------------------------------------------
-  int count = 0;
-  u8  rcve_buffer[RRC_NAS_MAX_SIZE];
-  struct nas_ue_dc_element *p;
-  int prim_length;
-  int prim_type;
-  char sap_to_read;
-
-  memset (rcve_buffer, 0, RRC_NAS_MAX_SIZE);
-  // Read Message header
-#ifndef RRC_NETLINK
-  count = rtf_get (protocol_ms->rrc.rrc_ue_DCIn_fifo, rcve_buffer, NAS_TL_SIZE);
-
-  if (count  > 0)
-    sap_to_read = RRC_NAS_DC0_IN;  // This should be replicated if read from several SAPs
-
-#else
-  count = recvmsg(rrcnl_sock_fd, &rrcnl_msg, 0);
-#ifdef DEBUG_RRC_DETAILS_2
-
-  if (!(protocol_ms->rrc.current_SFN%50)) {
-    msg ("[RRC_UE][NETLINK] rrc_ue_read_FIFO - count = %d\n", count);
-  }
-
-#endif
-
-  if (count  > 0) {
-    msg ("[RRC_UE][NETLINK] Received socket with length %d (nlmsg_len = %d)\n", count, (rrcnl_nlh->nlmsg_len)-sizeof(struct nlmsghdr));
-    sap_to_read = ((char*)NLMSG_DATA(rrcnl_nlh))[0];
-
-    if (sap_to_read != RRC_NAS_DC0_IN) {
-      return;
-    }
-
-    memcpy(rcve_buffer, &((char*)NLMSG_DATA(rrcnl_nlh))[1], NAS_TL_SIZE);
-    count --;
-  }
-
-#endif
-
-  if (count  > 0) {
-    // Message received in DC-SAP - Continue
-#ifdef DEBUG_RRC_STATE
-    msg ("[RRC_UE] Message Received from NAS: -%hx- \n", rcve_buffer[0]);
-#endif
-
-    p = (struct nas_ue_dc_element *) rcve_buffer;
-    prim_length = (int) (p->length);
-    prim_type = (int) (p->type);
-#ifdef DEBUG_RRC_STATE
-    msg ("[RRC_UE] Primitive Type %d,\t Primitive length %d \n", prim_type, prim_length);
-#endif
-    //get the rest of the primitive
-#ifndef RRC_NETLINK
-    count += rtf_get (protocol_ms->rrc.rrc_ue_DCIn_fifo, &(rcve_buffer[NAS_TL_SIZE]), prim_length - NAS_TL_SIZE);
-#else
-    memcpy(&(rcve_buffer[NAS_TL_SIZE]), &((char*)NLMSG_DATA(rrcnl_nlh))[1+NAS_TL_SIZE], prim_length - NAS_TL_SIZE);
-    count = prim_length;
-#endif
-    rrc_ue_read_DCin_FIFO (p, count);
-  }
-}
-
-
-#ifdef RRC_NETLINK
-//-----------------------------------------------------------------------------
-// This function receives data in RRC from the NAS
-int rrc_ue_read_data_from_nlh (char * buffer, int length, int offset)
-{
-  //-----------------------------------------------------------------------------
-  int count = length;
-  memcpy(buffer, &((char*)NLMSG_DATA(rrcnl_nlh))[1+offset], count);
-  return count;
-}
-#endif
\ No newline at end of file
diff --git a/openair2/RRC/CELLULAR/rrc_ue_outputs.c b/openair2/RRC/CELLULAR/rrc_ue_outputs.c
deleted file mode 100755
index 9f51afde8c..0000000000
--- a/openair2/RRC/CELLULAR/rrc_ue_outputs.c
+++ /dev/null
@@ -1,665 +0,0 @@
-/***************************************************************************
-                          rrc_ue_outputs.c  -  description
-                             -------------------
-    begin                : Jan 11, 2002
-    copyright            : (C) 2001, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Output functions for RRC UE FSM
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_ue_vars.h"
-#include "rrc_messages.h"
-//-------------------------------------------------------------------
-#include "rrc_proto_fsm.h"
-#include "rrc_proto_intf.h"
-#include "rrc_proto_int.h"
-#include "rrc_proto_bch.h"
-
-/* Output Trigger functions - Connection Model(protos in rrc_ue.c) */
-//-------------------------------------------------------------------
-void RRC_UE_O_O_PHY_SYNCH(void)
-{
-  //-------------------------------------------------------------------
-  int i;
-
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM-OUT] PHY Synchronization requested.\n");
-#endif
-  CPHY_config_req (rrm_config, 0, protocol_ms->rrc.u_rnti);
-  crb_config_req (0);
-  cmac_config_req (protocol_ms->rrc.u_rnti, 0);
-  /* TEMP - Waiting for new RRM
-  // clean up commands in config
-  for (i = 0; i < JRRM_MAX_COMMANDS_PER_TRANSACTION; i++) {
-    (&rrm_config->mt_config)->rrm_commands[i].rrm_action = 0;
-  }
-  */
-}
-
-//-------------------------------------------------------------------
-void RRC_UE_O_O_SEND_CCCH (int msgId)
-{
-  //-------------------------------------------------------------------
-  char *tx_ccch_info;
-  int data_length = 0;
-  int  retcode;
-
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM-OUT] Sending Message on CCCH.");
-#endif
-
-  tx_ccch_info = (char *) protocol_ms->rrc.ue_msg_infos.msg_ptr;
-  data_length = protocol_ms->rrc.ue_msg_infos.msg_length;
-  msg (" data length %d\n", data_length);
-
-  if (data_length > 0) {
-    //retcode = Mac_rlc_xface->rrc_rlc_data_req (RRC_MODULE_INST_ID, RRC_LCHAN_SRB0_ID, 0, RRC_RLC_CONFIRM_NO, data_length, tx_ccch_info);
-    retcode = rrc_ue_send_to_srb_rlc (RRC_SRB0_ID, tx_ccch_info, data_length);
-#ifdef DEBUG_RRC_STATE
-    msg ("[RRC][FSM-OUT] Message sent on CCCH. SRB0 -- retcode = %d (1=OK) -- data length %d\n", retcode, data_length); //RC = 1 ==> OK
-#endif
-  }
-
-  msg ("[RRC][FSM-OUT] Debug T300 target %d, ", protocol_ms->rrc.rrc_ue_t300_target);
-
-  // clear resources if T300 not running, otherwise keep them available
-  if (protocol_ms->rrc.rrc_ue_t300_target == 0) {
-    protocol_ms->rrc.ue_msg_infos.msg_length = 0;
-    //  free(protocol_ms->rrc.ue_msg_infos.msg_ptr);
-    free_mem_block (protocol_ms->rrc.ue_msg_infos.mem_block_ptr);
-  }
-
-  msg ("Message length %d\n", protocol_ms->rrc.ue_msg_infos.msg_length);
-}
-
-//-------------------------------------------------------------------
-void RRC_UE_O_O_SEND_DCCH_UM (int msgId)
-{
-  //-------------------------------------------------------------------
-  char *tx_dcch_info;
-  int data_length = 0;
-  int retcode;
-
-  // send message
-  tx_dcch_info = (char *) protocol_ms->rrc.ue_msg_infos.msg_ptr;
-  data_length = protocol_ms->rrc.ue_msg_infos.msg_length;
-
-  if (data_length > 0) {
-    //retcode = Mac_rlc_xface->rrc_rlc_data_req (RRC_MODULE_INST_ID, RRC_LCHAN_SRB1_ID, 0, RRC_RLC_CONFIRM_NO, data_length, tx_dcch_info);
-    retcode = rrc_ue_send_to_srb_rlc (RRC_SRB1_ID, tx_dcch_info, data_length);
-#ifdef DEBUG_RRC_STATE
-    msg ("[RRC][FSM-OUT] Message %s sent on DCCH-UM, ret code= %d.\n", tx_dcch_info, retcode);
-#endif
-  }
-
-  // clear resources
-  protocol_ms->rrc.ue_msg_infos.msg_length = 0;
-  //  free(protocol_ms->rrc.ue_msg_infos.msg_ptr);
-  free_mem_block (protocol_ms->rrc.ue_msg_infos.mem_block_ptr);
-}
-
-
-// This is the real function, when all srbs are available -
-//-------------------------------------------------------------------
-void RRC_UE_O_O_SEND_DCCH_AM (int msgId)
-{
-  //-------------------------------------------------------------------
-  char *tx_dcch_info;
-  int data_length = 0;
-  int retcode;
-
-  // send message
-  tx_dcch_info = (char *) protocol_ms->rrc.ue_msg_infos.msg_ptr;
-  data_length = protocol_ms->rrc.ue_msg_infos.msg_length;
-
-  if (data_length > 0) {
-    //retcode = rb_tx_data_srb_mt (RRC_SRB2_ID, tx_dcch_info, data_length * 8, protocol_ms->rrc.next_MUI++, TRUE);
-    retcode = rrc_ue_send_to_srb_rlc (RRC_SRB2_ID, tx_dcch_info, data_length);
-
-#ifdef DEBUG_RRC_STATE
-    msg ("[RRC][FSM-OUT] Message %s sent on DCCH-AM, ret code= %d.\n", tx_dcch_info, retcode);
-#endif
-  }
-
-  // clear resources
-  protocol_ms->rrc.ue_msg_infos.msg_length = 0;
-  //free(protocol_ms->rrc.ue_msg_infos.msg_ptr);
-  free_mem_block (protocol_ms->rrc.ue_msg_infos.mem_block_ptr);
-}
-
-
-//-----------------------------------------------------------------------------
-void RRC_UE_SEND_AM_SRB3 (int msgId)
-{
-  //-----------------------------------------------------------------------------
-  char *tx_dcch_info;
-  int data_length = 0;
-  int retcode;
-
-  // send message
-  tx_dcch_info = (char *) protocol_ms->rrc.ue_msg_infos.msg_ptr;
-  data_length = protocol_ms->rrc.ue_msg_infos.msg_length;
-
-  if (data_length > 0) {
-    //retcode = rb_tx_data_srb_mt (RRC_SRB3_ID, tx_dcch_info, data_length * 8, protocol_ms->rrc.next_MUI++, TRUE);
-    retcode = rrc_ue_send_to_srb_rlc (RRC_SRB3_ID, tx_dcch_info, data_length);
-#ifdef DEBUG_RRC_STATE
-    msg ("[RRC][DATA-OUT] Message %s sent on DCCH-AM-SRB3, ret code= %d.\n", tx_dcch_info, retcode);
-#endif
-  }
-
-  // clear resources
-  protocol_ms->rrc.ue_msg_infos.msg_length = 0;
-  // free(protocol_ms->rrc.ue_msg_infos.msg_ptr);
-  free_mem_block (protocol_ms->rrc.ue_msg_infos.mem_block_ptr);
-}
-
-
-//-------------------------------------------------------------------
-void RRC_UE_O_O_NAS_CONN_ESTAB_RESP (int retCode)
-{
-  //-------------------------------------------------------------------
-  struct nas_ue_if_element *msgToBuild;
-  //Added for UE Capability Information
-  int msgId;
-
-  mem_block_t *p = get_free_mem_block (sizeof (struct nas_ue_if_element));
-  protocol_ms->rrc.NASMessageToXmit = p;        // Temp - will later enqueue at bottom of list
-  //Set pointer to newly allocated structure and fills it
-  msgToBuild = (struct nas_ue_if_element *) p->data;
-
-  msgToBuild->prim_length = NAS_TL_SIZE + sizeof (struct NASConnEstablishResp);
-  msgToBuild->xmit_fifo = protocol_ms->rrc.rrc_ue_DCOut_fifo;
-  msgToBuild->nasUePrimitive.dc_sap_prim.type = CONN_ESTABLISH_RESP;
-  msgToBuild->nasUePrimitive.dc_sap_prim.length = msgToBuild->prim_length;
-  msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.conn_establish_resp.localConnectionRef = protocol_ms->rrc.local_connection_ref;
-  strcpy (((char *) msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.conn_establish_resp.InterfaceIMEI), protocol_ms->rrc.IMEI);
-  msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.conn_establish_resp.status = retCode;
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM-OUT] CONN Response Message sent to NAS, length %d, with status %d.\n", msgToBuild->prim_length, retCode);
-  msg ("TEMP OPENAIR : COMMENTED UE Capability Information\n");
-#endif
-  //Added for UE Capability Information - should be in FSM
-  // TEMPComment - OPENAIR
-  //encode_message(&msgId, UE_CAPABILITY_INFO);
-  RRC_UE_O_O_SEND_DCCH_AM(msgId);
-}
-
-////-------------------------------------------------------------------
-void RRC_UE_O_O_NAS_CONN_RELEASE_IND(void)
-{
-  ////-------------------------------------------------------------------
-  //  struct nas_ue_if_element *msgToBuild;
-  //
-  //  mem_block_t *p =  get_free_mem_block(sizeof (struct nas_ue_if_element));
-  //  protocol_ms->rrc.NASMessageToXmit = p;  // Temp - will later enqueue at bottom of list
-  //  //Set pointer to newly allocated structure and fills it
-  //  msgToBuild = (struct nas_ue_if_element *) p->data;
-  //
-  //  msgToBuild->prim_length = NAS_TL_SIZE + sizeof(struct NASConnReleaseInd);
-  //  msgToBuild->xmit_fifo = protocol_ms->rrc.rrc_ue_DCOut_fifo;
-  //  msgToBuild->nasUePrimitive.dc_sap_prim.type = CONN_RELEASE_IND;
-  //  msgToBuild->nasUePrimitive.dc_sap_prim.length = msgToBuild->prim_length;
-  //  msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.conn_release_ind.localConnectionRef
-  //                                                                                                                                                                                                                      = protocol_ms->rrc.local_connection_ref;
-  //  msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.conn_release_ind.releaseCause=protocol_ms->rrc.failure_cause;
-  //  #ifdef DEBUG_RRC_STATE
-  //      msg("[RRC][FSM-OUT] CONN_RELEASE_IND primitive sent to NAS, length %d, with cause code %d.\n",
-  //                                  msgToBuild->prim_length,  protocol_ms->rrc.failure_cause);
-  //  #endif
-}
-
-//-------------------------------------------------------------------
-void RRC_UE_O_O_NAS_CONN_LOSS_IND(void)
-{
-  //-------------------------------------------------------------------
-  struct nas_ue_if_element *msgToBuild;
-
-  mem_block_t *p = get_free_mem_block (sizeof (struct nas_ue_if_element));
-  protocol_ms->rrc.NASMessageToXmit = p;        // Temp - will later enqueue at bottom of list
-  //Set pointer to newly allocated structure and fills it
-  msgToBuild = (struct nas_ue_if_element *) p->data;
-
-  msgToBuild->prim_length = NAS_TL_SIZE + sizeof (struct NASConnLossInd);
-  msgToBuild->xmit_fifo = protocol_ms->rrc.rrc_ue_DCOut_fifo;
-  msgToBuild->nasUePrimitive.dc_sap_prim.type = CONN_LOSS_IND;
-  msgToBuild->nasUePrimitive.dc_sap_prim.length = msgToBuild->prim_length;
-  msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.conn_loss_ind.localConnectionRef = protocol_ms->rrc.local_connection_ref;
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM-OUT] CONN LOSS IND primitive sent to NAS, length %d.\n", msgToBuild->prim_length);
-#endif
-}
-
-//-------------------------------------------------------------------
-void RRC_UE_O_O_UpdateSI_852(void)
-{
-  //-------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  msg ("\n\n[RRC][FSM-OUT] Clean System Information as described in section 8.5.2.\n");
-#endif
-  memset ((char *) &(protocol_ms->rrc.ue_bch_blocks), 0, sizeof (struct rrc_ue_bch_blocks));
-  rrc_ue_bch_init ();
-
-}
-
-//-------------------------------------------------------------------
-void RRC_UE_O_O_stopT300(void)
-{
-  //-------------------------------------------------------------------
-  // stop timer
-  //umts_timer_delete_timer (&protocol_ms->rrc.rrc_timers, RRC_T300);
-  protocol_ms->rrc.rrc_ue_t300_target =0;
-  protocol_ms->rrc.rrc_ue_t300_retry = 0;
-  // clear resources - Temp
-  protocol_ms->rrc.ue_msg_infos.msg_length = 0;
-
-  //free(protocol_ms->rrc.ue_msg_infos.msg_ptr);
-  if (protocol_ms->rrc.ue_msg_infos.mem_block_ptr != NULL) {
-    free_mem_block (protocol_ms->rrc.ue_msg_infos.mem_block_ptr);
-  }
-
-  protocol_ms->rrc.ue_msg_infos.mem_block_ptr = NULL;
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM-OUT] Stop Physical Timer T300.\n");
-#endif
-}
-
-//-------------------------------------------------------------------
-void RRC_UE_O_O_startT300(void)
-{
-  //-------------------------------------------------------------------
-
-  int targetFrameNumber = protocol_ms->rrc.current_SFN*RRC_FRAME_DURATION;
-
-  //umts_add_timer_list_up (&protocol_ms->rrc.rrc_timers, rrc_ue_t300_timeout, NULL, RRC_T300, T300_DURATION, protocol_ms->rrc.current_SFN/RRC_FRAME_DURATION);
-  // Nest line is for real-time operation while second one is for emulation mode debug
-  //protocol_ms->rrc.rrc_ue_t300_target = protocol_ms->rrc.current_SFN + (T300_DURATION/RRC_FRAME_DURATION);
-  if (protocol_ms->rrc.rrc_ue_t300_retry == 0)
-    protocol_ms->rrc.rrc_ue_t300_target = protocol_ms->rrc.current_SFN + 10;
-  else
-    protocol_ms->rrc.rrc_ue_t300_target = protocol_ms->rrc.current_SFN + 200;
-
-  protocol_ms->rrc.rrc_ue_t300_retry++;
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM-OUT] Start Physical Timer T300. frame %d, target %d\n", protocol_ms->rrc.current_SFN, protocol_ms->rrc.rrc_ue_t300_target);
-#endif
-}
-
-//-------------------------------------------------------------------
-void RRC_UE_O_O_Setup_FACHRACH(void)
-{
-  //-------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM-OUT] Configure FACH-RACH channels.\n");
-#endif
-  rrc_ue_L2_setupFachRach();
-
-}
-
-/*****************************************************************/
-//-------------------------------------------------------------------
-void RRC_UE_O_O_wait (int duration)
-{
-  //-------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM-OUT] Request timer on RRC_CONNECTION_REJECT: duration %d.\n", duration);
-#endif
-}
-
-//-------------------------------------------------------------------
-void RRC_UE_O_O_startT308 (void)
-{
-  //-------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM-OUT] Start Physical Timer T308.\n");
-#endif
-}
-
-/*****************************************************************/
-/* Output Trigger functions - RB Control Model (protos in rrc_rb_ue.c) */
-
-//-------------------------------------------------------------------
-void RRC_RB_UE_O_O_NAS_RB_ESTABLISH_Ind (int rb_id)
-{
-  //-------------------------------------------------------------------
-  struct nas_ue_if_element *msgToBuild;
-
-  mem_block_t *p = get_free_mem_block (sizeof (struct nas_ue_if_element));
-  protocol_ms->rrc.NASMessageToXmit = p;        // Temp - will later enqueue at bottom of list
-  //Set pointer to newly allocated structure and fills it
-  msgToBuild = (struct nas_ue_if_element *) p->data;
-
-  msgToBuild->prim_length = NAS_TL_SIZE + sizeof (struct NASrbEstablishInd);
-  msgToBuild->xmit_fifo = protocol_ms->rrc.rrc_ue_DCOut_fifo;
-  msgToBuild->nasUePrimitive.dc_sap_prim.type = RB_ESTABLISH_IND;
-  msgToBuild->nasUePrimitive.dc_sap_prim.length = msgToBuild->prim_length;
-  msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.rb_establish_ind.localConnectionRef = protocol_ms->rrc.local_connection_ref;
-  // Temp MW 19/9/13 - Next parameter to be hard coded and should be revised for support of multiple DRBs (transferred at arrival in NAS)
-  msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.rb_establish_ind.rbId = protocol_ms->rrc.requested_rbId;
-  //msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.rb_establish_ind.rbId = RRC_OAI_DRB0_ID;
-  msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.rb_establish_ind.QoSclass = protocol_ms->rrc.requested_QoSclass;
-  msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.rb_establish_ind.dscp = protocol_ms->rrc.requested_dscp;
-  msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.rb_establish_ind.sapId = protocol_ms->rrc.requested_sapid;
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RB][FSM-OUT] RB_ESTABLISH_Ind primitive ready to send to NAS, length %d.\n", msgToBuild->prim_length, msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.rb_establish_ind.rbId);
-#endif
-  //Temp - to be put back in clear_transaction
-  protocol_ms->rrc.requested_rbId = 0;
-  protocol_ms->rrc.requested_QoSclass = 0;
-  protocol_ms->rrc.requested_dscp = 0;
-  protocol_ms->rrc.requested_sapid = 0;
-}
-
-//-------------------------------------------------------------------
-void RRC_RB_UE_O_O_NAS_RB_RELEASE_Ind (int rb_id)
-{
-  //-------------------------------------------------------------------
-  struct nas_ue_if_element *msgToBuild;
-
-  mem_block_t *p = get_free_mem_block (sizeof (struct nas_ue_if_element));
-  protocol_ms->rrc.NASMessageToXmit = p;        // Temp - will later enqueue at bottom of list
-  //Set pointer to newly allocated structure and fills it
-  msgToBuild = (struct nas_ue_if_element *) p->data;
-
-  msgToBuild->prim_length = NAS_TL_SIZE + sizeof (struct NASrbReleaseInd);
-  msgToBuild->xmit_fifo = protocol_ms->rrc.rrc_ue_DCOut_fifo;
-  msgToBuild->nasUePrimitive.dc_sap_prim.type = RB_RELEASE_IND;
-  msgToBuild->nasUePrimitive.dc_sap_prim.length = msgToBuild->prim_length;
-  msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.rb_release_ind.localConnectionRef = protocol_ms->rrc.local_connection_ref;
-  msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.rb_release_ind.rbId = protocol_ms->rrc.requested_rbId;
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RB][FSM-OUT] RB_RELEASE_Ind primitive sent to NAS, length %d.\n", msgToBuild->prim_length);
-#endif
-  protocol_ms->rrc.requested_rbId = 0;
-}
-
-//-------------------------------------------------------------------
-void RRC_RB_UE_O_O_CPHY_RL_SETUP_Req (void)
-{
-  //-------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RB][FSM-OUT] Sending RL_SETUP_Req primitive to PHY.\n");
-#endif
-  CPHY_config_req (rrm_config, 0, protocol_ms->rrc.u_rnti);
-}
-
-//-------------------------------------------------------------------
-void RRC_RB_UE_O_O_CPHY_RL_RELEASE_Req (void)
-{
-  //-------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RB][FSM-OUT] Sending RL_RELEASE_Req primitive to PHY.\n");
-  msg ("TEMP OPENAIR : COMMENTED\n");
-#endif
-  CPHY_config_req (rrm_config, 0, protocol_ms->rrc.u_rnti);
-}
-
-//-------------------------------------------------------------------
-void RRC_RB_UE_O_O_CMAC_CONFIG_Req (void)
-{
-  //-------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RB][FSM-OUT] Sending CMAC_CONFIG_Req primitive to RLC + MAC.\n");
-#endif
-  crb_config_req (0);
-  cmac_config_req (protocol_ms->rrc.u_rnti, 0);
-}
-
-//-------------------------------------------------------------------
-void RRC_RB_UE_O_O_CRLC_CONFIG_Req (void)
-{
-  //-------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RB][FSM-OUT] Sending CRLC_CONFIG_Req primitive to RLC.\n");
-#endif
-  crb_config_req(0);
-}
-
-//-------------------------------------------------------------------
-void RRC_RB_UE_O_O_SEND_DCCH_AM (int msgId)
-{
-  //-------------------------------------------------------------------
-  // call function from RRC_UE FSM to avoid duplication of errors
-  RRC_UE_O_O_SEND_DCCH_AM (msgId);
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RB][FSM-OUT] RRC_RB_UE_O_O_SEND_DCCH_AM complete.\n");
-#endif
-}
-
-//-------------------------------------------------------------------
-void RRC_RB_UE_O_O_SEND_CCCH (int msgId)
-{
-  //-------------------------------------------------------------------
-  // call function from RRC_UE FSM to avoid duplication of errors
-  RRC_UE_O_O_SEND_CCCH (msgId);
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RB][FSM-OUT] RRC_RB_UE_O_O_SEND_CCCH complete.\n");
-#endif
-}
-
-//-------------------------------------------------------------------
-void RRC_RB_UE_O_O_New_State_CELL_FACH (void)
-{
-  //-------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RB][FSM-OUT] Transition to CELL_FACH state.\n");
-  msg ("[RRC][FSM-IN] Go_CELL_FACH Received\n");
-#endif
-  RRC_UE_I_I_Go_CELL_FACH ();
-  RRC_UE ();
-}
-
-//-------------------------------------------------------------------
-void RRC_RB_UE_O_O_New_State_CELL_DCH (void)
-{
-  //-------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RB][FSM-OUT] Transition to CELL_DCH state.\n");
-  msg ("[RRC][FSM-IN] Go_CELL_DCH Received\n");
-#endif
-  RRC_UE_I_I_Go_CELL_DCH ();
-  RRC_UE ();
-}
-
-//-------------------------------------------------------------------
-void RRC_RB_UE_O_O_startT305 (void)
-{
-  //-------------------------------------------------------------------
-  // Not implemented yet. Will be in final CELL_UPDATE procedure
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RB][FSM-OUT] Start Physical Timer T305.\n");
-#endif
-}
-
-//-------------------------------------------------------------------
-void RRC_RB_UE_O_O_CELL_Update_Proc (void)
-{
-  //-------------------------------------------------------------------
-  // Not implemented yet. Will be in final CELL_UPDATE procedure
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC_RB][FSM-OUT] Execute Cell Update procedure as requested by RG.\n");
-#endif
-}
-
-/*    Other functions, not related with Esterel   */
-//-----------------------------------------------------------------------------
-// build NAS broadcast indication message
-void rrc_ue_broadcast_encode_nas_sib1 (void)
-{
-  //-----------------------------------------------------------------------------
-  //      char *msgData =  "INFO_BROADCAST_IND\0";
-  struct nas_ue_if_element *msgToBuild;
-  char *pdata;
-  int data_length;
-  mem_block_t *p = NULL;
-
-  data_length = protocol_ms->rrc.ue_bch_blocks.currSIB1.subnet_NAS_SysInfo.numocts;
-
-  if ((data_length > 0) && (protocol_ms->rrc.NASMessageToXmit == NULL)) {
-
-    p = get_free_mem_block (sizeof (struct nas_ue_if_element) + RRC_NAS_MAX_SIZE);
-    protocol_ms->rrc.NASMessageToXmit = p;
-
-    //Set pointer to newly allocated structure and fills it
-    msgToBuild = (struct nas_ue_if_element *) p->data;
-
-    msgToBuild->prim_length = NAS_TL_SIZE + sizeof (struct NASInfoBroadcastInd);
-    msgToBuild->xmit_fifo = protocol_ms->rrc.rrc_ue_GC_fifo;
-    msgToBuild->nasUePrimitive.gc_sap_prim.type = INFO_BROADCAST_IND;
-    msgToBuild->nasUePrimitive.gc_sap_prim.length = msgToBuild->prim_length;
-    //  msgToBuild->nasUePrimitive.gc_sap_prim.nasUEGCPrimitive.broadcast_ind.nasDataLength = strlen (msgData);
-    //  memcpy (((char*) msgToBuild->nasData), msgData , );
-    // (char*)&protocol_ms->rrc.ue_bch_blocks.currSIB1.subnet_NAS_SysInfo.data
-    // (char*)&protocol_ms->rrc.ue_bch_blocks.currSIB1.subnet_NAS_SysInfo.numocts
-    msgToBuild->nasUePrimitive.gc_sap_prim.nasUEGCPrimitive.broadcast_ind.nasDataLength = (u16) data_length;
-    pdata = (char *) &(msgToBuild->nasUePrimitive.gc_sap_prim.nasUEGCPrimitive.broadcast_ind.nasDataLength);
-    pdata += 2;
-    memcpy (pdata, (char *) &protocol_ms->rrc.ue_bch_blocks.currSIB1.subnet_NAS_SysInfo.data, data_length);
-    msgToBuild->prim_length += data_length;
-#ifdef DEBUG_RRC_BROADCAST_NAS
-    msg ("[RRC] Building BROADCAST IND for NAS - SIB1, length:  %d.\n", msgToBuild->prim_length);
-#endif
-  } else {
-#ifdef DEBUG_RRC_BROADCAST_NAS
-    msg ("[RRC] BROADCAST IND for NAS, No SIB1 data.\n");
-#endif
-  }
-
-}
-
-//-----------------------------------------------------------------------------
-// build NAS broadcast indication message
-void rrc_ue_broadcast_encode_nas_sib18 (void)
-{
-  //-----------------------------------------------------------------------------
-  //      char *msgData =  "INFO_BROADCAST_IND\0";
-  struct nas_ue_if_element *msgToBuild;
-  char *pdata;
-  int data_length;
-
-  mem_block_t *p;
-
-  data_length = protocol_ms->rrc.ue_bch_blocks.currSIB18.cellIdentities.numocts;
-
-  if ((data_length > 0) && (protocol_ms->rrc.NASMessageToXmit == NULL)) {
-    p = get_free_mem_block (sizeof (struct nas_ue_if_element) + RRC_NAS_MAX_SIZE);
-    protocol_ms->rrc.NASMessageToXmit = p;
-
-    //Set pointer to newly allocated structure and fills it
-    msgToBuild = (struct nas_ue_if_element *) p->data;
-
-    msgToBuild->prim_length = NAS_TL_SIZE + sizeof (struct NASInfoBroadcastInd);
-    msgToBuild->xmit_fifo = protocol_ms->rrc.rrc_ue_GC_fifo;
-    msgToBuild->nasUePrimitive.gc_sap_prim.type = INFO_BROADCAST_IND;
-    msgToBuild->nasUePrimitive.gc_sap_prim.length = msgToBuild->prim_length;
-    msgToBuild->nasUePrimitive.gc_sap_prim.nasUEGCPrimitive.broadcast_ind.nasDataLength = (u16) data_length;
-    pdata = (char *) &(msgToBuild->nasUePrimitive.gc_sap_prim.nasUEGCPrimitive.broadcast_ind.nasDataLength);
-    pdata += 2;
-    memcpy (pdata, (char *) &protocol_ms->rrc.ue_bch_blocks.currSIB18.cellIdentities.data, data_length);
-    msgToBuild->prim_length += data_length;
-#ifdef DEBUG_RRC_BROADCAST_NAS
-    msg ("[RRC] Building BROADCAST IND - SIB 18 - for NAS, length:  %d.\n", msgToBuild->prim_length);
-#endif
-  } else {
-#ifdef DEBUG_RRC_BROADCAST_NAS
-    msg ("[RRC] BROADCAST IND for NAS, No SIB18 data.\n");
-#endif
-  }
-}
-
-//-------------------------------------------------------------------
-void RRC_UE_O_NAS_DATA_IND (void)
-{
-  //-------------------------------------------------------------------
-  struct nas_ue_if_element *msgToBuild;
-  char *pdata;
-
-  mem_block_t *p = get_free_mem_block (sizeof (struct nas_ue_if_element) + RRC_NAS_MAX_SIZE);
-  protocol_ms->rrc.NASMessageToXmit = p;        // Temp - will later enqueue at bottom of list
-  //Set pointer to newly allocated structure and fills it
-  msgToBuild = (struct nas_ue_if_element *) p->data;
-
-  msgToBuild->prim_length = NAS_TL_SIZE + sizeof (struct NASDataInd);
-  msgToBuild->xmit_fifo = protocol_ms->rrc.rrc_ue_DCOut_fifo;
-  msgToBuild->nasUePrimitive.dc_sap_prim.type = DATA_TRANSFER_IND;
-  msgToBuild->nasUePrimitive.dc_sap_prim.length = msgToBuild->prim_length;
-  msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.data_transfer_ind.localConnectionRef = protocol_ms->rrc.local_connection_ref;
-  msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.data_transfer_ind.priority = 5;
-  msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.data_transfer_ind.nasDataLength = protocol_ms->rrc.dl_nas_message_lgth;
-  pdata = (char *) &(msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.data_transfer_ind.nasDataLength);
-  pdata += 2;
-  memcpy (pdata, protocol_ms->rrc.dl_nas_message_ptr, protocol_ms->rrc.dl_nas_message_lgth);
-  msgToBuild->prim_length += protocol_ms->rrc.dl_nas_message_lgth;
-
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][DATA-OUT] DATA_TRANSFER_IND primitive ready to send to NAS, length %d.\n", msgToBuild->prim_length);
-#endif
-}
-
-//-------------------------------------------------------------------
-void RRC_UE_O_NAS_NOTIFICATION_IND (void)
-{
-  //-------------------------------------------------------------------
-  struct nas_ue_if_element *msgToBuild;
-  char *pdata;
-
-  mem_block_t *p = get_free_mem_block (sizeof (struct nas_ue_if_element) + RRC_NAS_MAX_SIZE);
-  protocol_ms->rrc.NASMessageToXmit = p;        // Temp - will later enqueue at bottom of list
-  //Set pointer to newly allocated structure and fills it
-  msgToBuild = (struct nas_ue_if_element *) p->data;
-
-  msgToBuild->prim_length = NAS_TL_SIZE + sizeof (struct NASNotificationInd);
-  msgToBuild->xmit_fifo = protocol_ms->rrc.rrc_ue_NT_fifo;
-  msgToBuild->nasUePrimitive.nt_sap_prim.type = NOTIFICATION_IND;
-  msgToBuild->nasUePrimitive.nt_sap_prim.length = msgToBuild->prim_length;
-  msgToBuild->nasUePrimitive.nt_sap_prim.nasUENTPrimitive.notification_ind.nasDataLength = protocol_ms->rrc.paging_message_lgth;
-  pdata = (char *) &(msgToBuild->nasUePrimitive.nt_sap_prim.nasUENTPrimitive.notification_ind.nasDataLength);
-  pdata += 2;
-  memcpy (pdata, protocol_ms->rrc.paging_message_ptr, protocol_ms->rrc.paging_message_lgth);
-  msgToBuild->prim_length += protocol_ms->rrc.paging_message_lgth;
-
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][DATA-OUT] NOTIFICATION_IND primitive ready to send to NAS, length %d.\n", msgToBuild->prim_length);
-#endif
-}
-
-//-------------------------------------------------------------------
-void RRC_UE_O_NAS_MEASUREMENT_IND (void)
-{
-  //-------------------------------------------------------------------
-  struct nas_ue_if_element *msgToBuild;
-
-  mem_block_t *p = get_free_mem_block (sizeof (struct nas_ue_if_element));
-  protocol_ms->rrc.NASMessageToXmit = p;        // Temp - will later enqueue at bottom of list
-  //Set pointer to newly allocated structure and fills it
-  msgToBuild = (struct nas_ue_if_element *) p->data;
-
-  msgToBuild->prim_length = NAS_TL_SIZE + sizeof (struct NASMeasureInd);
-  msgToBuild->xmit_fifo = protocol_ms->rrc.rrc_ue_DCOut_fifo;
-  msgToBuild->nasUePrimitive.dc_sap_prim.type = MEASUREMENT_IND;
-  msgToBuild->nasUePrimitive.dc_sap_prim.length = msgToBuild->prim_length;
-  msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.measurement_ind.localConnectionRef = protocol_ms->rrc.local_connection_ref;
-  msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.measurement_ind.nb_rg = 2;
-  msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.measurement_ind.measures[0].cell_id = protocol_ms->rrc.cell_id;
-  msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.measurement_ind.measures[0].level =
-    // TEMPComment - OPENAIR
-    100;  //hard coded value - also translation to get a positive value [0-90]
-  //(rrm_config->outer_loop_vars.RSSI0 / RATIO_RSSI0) + SHIFT_RSSI0;
-  msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.measurement_ind.measures[1].cell_id = 2;
-  msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.measurement_ind.measures[1].level = 50;
-
-#ifdef DEBUG_RRC_STATE
-  // TEMPComment - OPENAIR
-  //msg ("[RRC][DATA-OUT] MEASUREMENT_IND primitive: RSSI0 = %d .\n", rrm_config->outer_loop_vars.RSSI0);
-  msg ("[RRC][DATA-OUT] MEASUREMENT_IND primitive ready to send to NAS, length %d.\n", msgToBuild->prim_length);
-#endif
-}
diff --git a/openair2/RRC/CELLULAR/rrc_ue_process.c b/openair2/RRC/CELLULAR/rrc_ue_process.c
deleted file mode 100755
index c233fe5a9f..0000000000
--- a/openair2/RRC/CELLULAR/rrc_ue_process.c
+++ /dev/null
@@ -1,283 +0,0 @@
-/***************************************************************************
-                          rrc_ue_proc.c  -  description
-                             -------------------
-    begin                : April 30, 2002
-    copyright            : (C) 2002, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Procedures associated with the UE files generated by Esterel Studio
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_ue_vars.h"
-#include "rrc_messages.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_msg.h"
-#include "rrc_proto_fsm.h"
-
-//-----------------------------------------------------------------------------
-/* Generic function to encode RRC messages */
-void  encode_message (int *Message_Id, int Message_Type)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM-PROC]encode message %d \n", Message_Type);
-#endif
-
-  if (protocol_ms->rrc.ue_msg_infos.msg_length) {
-#ifdef DEBUG_RRC_STATE
-    msg ("\n\n[RRC_MSG] There is already one message pending %d\n", protocol_ms->rrc.ue_msg_infos.msg_Id);
-#endif
-  } else {
-    switch (Message_Type) {
-    case RRC_CONN_REQ:
-      rrc_ue_msg_connreq (Message_Id);
-      break;
-
-    case RRC_CONN_SETUP_COMPLETE:
-      rrc_ue_msg_connsucompl (Message_Id);
-      break;
-
-    case RRC_CONN_RELEASE:
-      rrc_ue_msg_connrelUL (Message_Id);
-      break;
-
-    case RB_SETUP_COMPLETE:
-      rrc_ue_config_LTE_default_drb(protocol_ms->rrc.mod_id);  //TEMP OpenAir
-      rrc_ue_config_LTE_srb2(protocol_ms->rrc.mod_id);
-      rrc_ue_msg_rbsetupcompl (Message_Id);
-      break;
-
-    case RB_SETUP_FAILURE:
-      rrc_ue_msg_rbsetupfail (Message_Id);
-      break;
-
-    case RB_RELEASE_COMPLETE:
-      rrc_ue_config_LTE_default_drb(protocol_ms->rrc.mod_id);   //TEMP OpenAir
-      rrc_ue_msg_rbreleasecompl (Message_Id);
-      break;
-
-    case RB_RELEASE_FAILURE:
-      rrc_ue_msg_rbreleasefail (Message_Id);
-      break;
-
-    case CELL_UPDATE:
-      rrc_ue_msg_cellUpdate (Message_Id);
-      break;
-
-    case UE_CAPABILITY_INFO:
-      rrc_ue_msg_ueCapInfo(Message_Id);
-      break;
-
-    default:
-      msg ("\n\n[RRC_MSG] unknown message type %d\n", Message_Type);
-    }
-
-    protocol_ms->rrc.last_message_sent = Message_Type;
-  }
-}
-
-//-----------------------------------------------------------------------------
-int INTEGER_COMBINE (int Id1, int Id2)
-{
-  //-----------------------------------------------------------------------------
-  // signals an error in the automata. Combination should never occur.
-  return 999;
-}
-
-//-----------------------------------------------------------------------------
-int BOOLEAN_COMBINE (int Id1, int Id2)
-{
-  //-----------------------------------------------------------------------------
-  // signals an error in the automata. Combination should never occur.
-  return FALSE;
-}
-
-/* Selection of channels during RRC Connection SetUp
- */
-//-----------------------------------------------------------------------------
-void Select_PRACH (void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM-PROC]Select_RACH() -- not implemented\n");
-#endif
-}
-
-//-----------------------------------------------------------------------------
-void Select_Secondary_CCPCH (void)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM-PROC]Select_Secondary_CCPCH()  -- not implemented \n");
-#endif
-}
-
-/* Record of current RRC state
- */
-//-----------------------------------------------------------------------------
-void Set_State (int new_state, int forward)
-{
-  //-----------------------------------------------------------------------------
-  //protocol_state = new_state;
-  protocol_ms->rrc.protocol_state = new_state;
-#ifdef DEBUG_RRC_STATE
-  // msg("[RRC][FSM-PROC]New state = %d , forward = %d \n",protocol_state, forward);
-  msg ("[RRC][FSM-PROC]New state = %d \n", protocol_ms->rrc.protocol_state);
-#endif
-
-  if (!forward) {
-#ifdef DEBUG_RRC_STATE
-    msg ("[RRC][FSM-PROC] Set_State - State forwarded to RB FSM \n");
-#endif
-    rrc_rb_ue_new_state (new_state);
-  }
-}
-
-/* release resources in RLC, MAC, PHY (no reply)
- */
-//-----------------------------------------------------------------------------
-void release_radio_resources (void)
-{
-  //-----------------------------------------------------------------------------
-  rrc_release_all_ressources = 1;
-}
-
-/* clear RRC variables: TRANSACTIONS, ESTABLISHED_RBs...
- */
-//-----------------------------------------------------------------------------
-void clear_variables_rel (void)
-{
-  //-----------------------------------------------------------------------------
-  int i;
-
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM-PROC]clear_variables_release()- CLEAN RRC variables\n");
-#endif
-  protocol_ms->rrc.ue_wait_establish_req = 0;
-  protocol_ms->rrc.u_rnti = 0;
-  protocol_ms->rrc.c_rnti = 0;
-
-  rrc_rb_ue_init ();
-  protocol_ms->rrc.rrc_currently_updating = FALSE;
-  //Temp - transactions still to be implemented
-  protocol_ms->rrc.accepted_trans[0].transaction_Id = 0;
-  protocol_ms->rrc.rcved_trans.transaction_Id = 0;
-  protocol_ms->rrc.rcved_trans.msg_type = 0;
-  protocol_ms->rrc.last_message_sent = 0;
-  protocol_ms->rrc.num_rb = 0;
-
-  // Clear measurement control blocks
-  for (i=0; i<MAXMEASTYPES; i++) {
-    memset (&(protocol_ms->rrc.ue_meas_cmd[i]), 0, sizeof(struct rrc_ue_meas_cmd));
-    memset (&(protocol_ms->rrc.ue_meas_rep[i]), 0, sizeof(struct rrc_ue_meas_rep));
-  }
-}
-
-//-----------------------------------------------------------------------------
-void ue_clear_transaction (int Message_Type)
-{
-  //-----------------------------------------------------------------------------
-  // TODO with proc_IE_transaction
-  //  int  rb_id = 0;
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][FSM-PROC]UE clear_transaction()\n");
-#endif
-  protocol_ms->rrc.accepted_trans[0].transaction_Id = 0;
-  //save valid configuration for ms
-  memcpy (&(protocol_ms->rrc.saved_configuration.mt_config), &(rrm_config)->mt_config, sizeof (MT_CONFIG));
-
-  switch (Message_Type) {
-  case RRC_CONN_SETUP:
-    protocol_ms->rrc.idata_xfer = TRUE;
-    break;
-
-  case RB_SETUP:
-    protocol_ms->rrc.ue_established_rbs[protocol_ms->rrc.requested_rbId].rb_started = RB_STARTED;
-
-    // Temp - Esterel to be corrected. must be last procedure, after NAS
-    //          protocol_ms->rrc.requested_rbId = 0;
-    //          protocol_ms->rrc.requested_QoSclass = 0;
-    //          protocol_ms->rrc.requested_dscp = 0;
-  case RB_RELEASE:
-    // Temp - Esterel to be corrected. must be last procedure, after NAS
-    //          protocol_ms->rrc.requested_rbId = 0;
-    protocol_ms->rrc.ue_established_rbs[protocol_ms->rrc.requested_rbId].qos_class = 0;
-    protocol_ms->rrc.ue_established_rbs[protocol_ms->rrc.requested_rbId].dscp_code = 0;
-    protocol_ms->rrc.ue_established_rbs[protocol_ms->rrc.requested_rbId].rb_started = RB_STOPPED;
-    break;
-
-  default:
-    msg ("[RRC][FSM-PROC]UE clear_transaction()- unknown message type\n");
-  }
-}
-
-/* function prototypes for the RRC Radio Bearer Establishment and Release procedures, UE side */
-
-void proc_IE_activ_Time (void)
-{
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][RB-PROC] NI--proc_IE_activ_Time()\n");
-#endif
-}
-
-void proc_IE_RNTIs (void)
-{
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][RB-PROC] NI--proc_IE_RNTIs()\n");
-#endif
-}
-
-void proc_IE_transaction (void)
-{
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][RB-PROC] NI--proc_IE_transaction()\n");
-#endif
-}
-
-void proc_IE_configuration (void)
-{
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][RB-PROC] NI--proc_IE_configuration()\n");
-#endif
-}
-
-void clear_C_RNTI (void)
-{
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][RB-PROC] NI--clear_C_RNTI()\n");
-#endif
-}
-
-//-----------------------------------------------------------------------------
-void set_RRC_Transaction_ID (void)
-{
-  //-----------------------------------------------------------------------------
-  int i;
-  // clean up commands in config -- Temp
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC][RB-PROC]set_RRC_Transaction_ID()\n");
-#endif
-  // TEMP Commented for openAir
-  /*  for (i = 0; i < JRRM_MAX_COMMANDS_PER_TRANSACTION; i++) {
-      (&rrm_config->mt_config)->rrm_commands[i].rrm_action = 0;
-    }*/
-}
-
-//-----------------------------------------------------------------------------
-void rrc_ue_t300_timeout (void)
-{
-  //-----------------------------------------------------------------------------
-  msg ("[RRC] TIME OUT RRC_CONNECTION REQUEST frame %d\n", protocol_ms->rrc.current_SFN);
-
-  protocol_ms->rrc.rrc_ue_t300_target = 0;
-  rrc_ue_fsm_control (T300_TO);
-
-}
diff --git a/openair2/RRC/CELLULAR/rrc_ue_srb_bch.c b/openair2/RRC/CELLULAR/rrc_ue_srb_bch.c
deleted file mode 100755
index 7fca06ade7..0000000000
--- a/openair2/RRC/CELLULAR/rrc_ue_srb_bch.c
+++ /dev/null
@@ -1,202 +0,0 @@
-/***************************************************************************
-                          rrc_ue_srb_bch.c  -  description
-                             -------------------
-    begin             : Someday 2001
-    copyright         : (C) 2001, 2010 by Eurecom
-    created by        : Lionel.Gauthier@eurecom.fr
-    modified by       : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
- Handling of Signalling Radio Bearers
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_ue_vars.h"
-#include "rrc_nas_sap.h"
-#include "rrc_messages.h"
-
-#include "rrc_proto_bch.h"
-#include "rrc_proto_int.h"
-#include "rrc_proto_fsm.h"
-#include "rrc_proto_mbms.h"
-//-----------------------------------------------------------------------------
-// #include "rrc_contrib_l1_console_proto_extern.h"
-// #include "rrc_pdcp_control_proto_extern.h"
-// #include "rrc_rlc_control_proto_extern.h"
-// #include "lists_proto_extern.h"
-// #include "umts_sched_struct.h"
-
-//-----------------------------------------------------------------------------
-void rrc_broadcast_rx (char *Sdu)
-{
-  //-----------------------------------------------------------------------------
-  char data_size;
-
-  if ((protocol_ms->rrc.current_SFN & 0x0001) == 0) {
-    data_size = Sdu[0];
-#ifdef DEBUG_RRC_BROADCAST_DETAILS
-    rrc_print_buffer (Sdu, data_size);
-#endif
-    memcpy ((char *) protocol_ms->rrc.ue_bch_blocks.encoded_currSIBCH, &Sdu[0], data_size);
-
-    // decode
-    rrc_ue_read_next_segment ();
-  }
-}
-
-//-----------------------------------------------------------------------------
-void *rrc_mt_ccch_rx_idle_mode (void *unusedP, mem_block_t * data_indicationP, int rb_idP)
-{
-  //-----------------------------------------------------------------------------
-  u16 tb_size_in_bytes;
-
-  //tb_size_in_bytes  = (((struct rlc_indication*)(data_indicationP->data))->primitive.um_ind.data_size + 7) >> 3;
-  //   tb_size_in_bytes = ((struct rlc_indication *) (data_indicationP->data))->primitive.um_ind.data_size;
-
-  msg ("[SRB0] RX %d bytes\n", tb_size_in_bytes);
-  //   rrc_ue_srb0_decode (&(data_indicationP->data[sizeof (struct rlc_indication)]), tb_size_in_bytes);
-  return NULL;
-}
-
-// //-----------------------------------------------------------------------------
-// void *rrc_mt_mcch_rx (void *unusedP, mem_block_t * data_indicationP, int rb_idP){
-// //-----------------------------------------------------------------------------
-//   u16 tb_size_in_bytes;
-// //   tb_size_in_bytes = (((struct rlc_indication *) (data_indicationP->data))->primitive.um_ind.data_size + 7) >> 3;
-//
-//   //msg ("[MCCH]  RX %d bytes\n", tb_size_in_bytes);
-//   //msg ("[MCCH]  RX String : %s\n", &(data_indicationP->data[sizeof (struct rlc_indication)]));
-// //   rrc_ue_mcch_decode (data_indicationP, sizeof (struct rlc_indication));
-//   free_mem_block (data_indicationP);
-//   return NULL;
-// }
-
-/*
-//-----------------------------------------------------------------------------
-void *rrc_srb_rx (void *unusedP, mem_block_t * sduP, u8 rb_idP){
-//-----------------------------------------------------------------------------
-  int srb_id;
-  int UE_Id;
-
-  srb_id = rb_idP % maxRB;
-  UE_Id = (rb_idP - srb_id) / maxRB;
-  #ifdef DEBUG_RRC_STATE
-  msg ("[RRC-SRB-UE] RB%d RX in frame %d\n", rb_idP, protocol_ms->rrc.current_SFN);
-  msg ("[RRC-SRB-UE] SRB%d received, UE_Id %d\n", srb_id, UE_Id);
-  //  msg ("[RRC-SRB] UE SRB%d RX : %hx , in frame %d\n", srb_id, &sduP->data[sizeof (struct rlc_indication)], frame);
-  #endif
-
-  switch (srb_id) {
-    case RRC_SRB0_ID:
-//       rrc_ue_srb0_decode (sduP, sizeof (struct rlc_indication));
-//       break;
-    case RRC_SRB1_ID:
-//       rrc_ue_srb1_decode (sduP, sizeof (struct rlc_indication));
-//       break;
-    case RRC_SRB2_ID:
-//       rrc_ue_srb2_decode (sduP, sizeof (struct rlc_indication));
-//       break;
-    case RRC_SRB3_ID:
-//       rrc_ue_srb3_decode (sduP, sizeof (struct rlc_indication));
-//       break;
-    default:
-      msg ("[RRC-SRB-UE] Invalid call to srb Receive\n");
-      break;
-  }
-
-  free_mem_block (sduP);
-  return NULL;
-}
-*/
-
-//-----------------------------------------------------------------------------
-int rrc_ue_srb_rx (char* sduP, int srb_id,  int UE_Id)
-{
-  //-----------------------------------------------------------------------------
-  //int srb_id, rb_id;
-  //int UE_Id;
-  int sdu_offset=0;
-
-#ifdef DEBUG_RRC_DETAILS
-  //msg ("\n[RRC][SRB-UE] CALL to rrc_ue_srb_rx\n");
-#endif
-  //rb_id = ch_idP - RRC_LCHAN_SRB0_ID;
-  //rb_id = ch_idP;
-  //srb_id = rb_id % maxRB;
-  //UE_Id = (rb_id - srb_id) / maxRB;
-
-#ifdef DEBUG_RRC_STATE
-
-  if (srb_id != RRC_MCCH_ID)
-    msg ("[RRC][SRB-UE] SRB%d for UE %d RX in frame %d\n", srb_id, UE_Id, protocol_ms->rrc.current_SFN);
-
-  //msg ("[RRC][SRB-UE] RB %d, SRB%d received [SRB5=MCCH], UE_Id %d\n", rb_id, srb_id, UE_Id);
-  //msg ("[RRC-SRB-UE] [UE-DUMMIES] frame received: %s\n", (char*)&sduP[sdu_offset]);
-#endif
-
-  switch (srb_id) {
-  case RRC_SRB0_ID:
-    //       rrc_ue_srb0_decode (sduP, sizeof (struct rlc_indication));
-    rrc_ue_srb0_decode (sduP, sdu_offset);
-    break;
-
-  case RRC_SRB1_ID:
-    //       rrc_ue_srb1_decode (sduP, sizeof (struct rlc_indication));
-    rrc_ue_srb1_decode (sduP, sdu_offset);
-    break;
-
-  case RRC_SRB2_ID:
-    //       rrc_ue_srb2_decode (sduP, sizeof (struct rlc_indication));
-    rrc_ue_srb2_decode (sduP, sdu_offset);
-    break;
-
-  case RRC_SRB3_ID:
-    //       rrc_ue_srb3_decode (sduP, sizeof (struct rlc_indication));
-    rrc_ue_srb3_decode (sduP, sdu_offset);
-    break;
-
-  case RRC_MCCH_ID:
-    //rrc_ue_mcch_decode (data_indicationP, sizeof (struct rlc_indication));
-    rrc_ue_mcch_decode (sduP, sdu_offset);
-    break;
-
-  default:
-    msg ("[RRC][SRB-UE] Invalid call to rrc_ue_srb_rx, SRB Receive\n");
-    break;
-  }
-
-  return 0;
-}
-
-
-//-----------------------------------------------------------------------------
-void* rrc_ue_srb_confirm (u32 muiP, u8 rb_idP, u8 statusP)
-{
-  //-----------------------------------------------------------------------------
-  int srb_id;
-  int UE_Id;
-
-  srb_id = rb_idP % maxRB;
-  UE_Id = (rb_idP - srb_id) / maxRB;
-#ifdef DEBUG_RRC_STATE
-  msg ("[RRC-SRB-UE] RB%d RX SDU CONFIRM MUI %d, status %d\n", rb_idP, muiP, statusP);
-  msg ("[RRC-SRB-UE] SRB_Id %d UE_Id %d\n", srb_id, UE_Id);
-#endif
-  /* Temp OpenAir
-  if (srb_id == RRC_SRB2_ID) {
-    if (statusP == RLC_TX_CONFIRM_SUCCESSFULL) {
-      rrc_ue_fsm_control (RRC_RLC_SUCCESS);
-    } else {
-      rrc_ue_fsm_control (RRC_RLC_FAILURE);
-    }
-  }
-  */
-  rrc_ue_fsm_control (RRC_RLC_SUCCESS);
-  return NULL;
-}
diff --git a/openair2/RRC/CELLULAR/rrc_ue_variables.h b/openair2/RRC/CELLULAR/rrc_ue_variables.h
deleted file mode 100755
index 640651e20c..0000000000
--- a/openair2/RRC/CELLULAR/rrc_ue_variables.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/***************************************************************************
-                          rrc_ue_variables.h  -  description
-                             -------------------
-    begin                : Jan 6, 2003
-    copyright            : (C) 2003, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- **************************************************************************
-  Some additional definitions for UE variables
- ***************************************************************************/
-#ifndef __RRC_UE_VARIABLES_H__
-#define __RRC_UE_VARIABLES_H__
-
-#include "rrc_msg_class.h"
-
-struct rrc_ue_msg_infos {
-  int msg_Id;
-  int msg_length;
-  void        *msg_ptr;
-  mem_block_t *mem_block_ptr;
-};
-
-struct rrc_ue_rb_information {
-  u16 rb_identity;
-  u16 rb_started;
-  u16 qos_class;
-  u16 dscp_code;
-  u16 sap_id;
-};
-
-struct rrc_ue_trans {
-  int msg_type;
-  int transaction_Id;
-};
-
-struct rrc_cell_info {
-  u16 cell_id;
-  int pccpch_code_group;
-};
-
-struct rrc_neighbor_cells {
-  int num_cells;
-  struct rrc_cell_info cell_info[maxCells];
-};
-
-struct rrc_ue_nas_neighbor_list {
-  char  sub_type;
-  int   num_rg;
-  char *ng_list;      // transparent to RRC
-};
-
-struct rrc_ue_meas_cmd {
-  u16 identity;
-  u16 command;
-  u16 xfer_mode;
-  u16 trigger;
-  u16 type;
-  u16 if_coeff;
-  u8  if_cellIdentity_ri;
-  u8  if_timeslotISCP_ri;
-  u8  if_BCH_RSCP_ri;
-  u8  if_pathloss_ri;
-  u16 if_validity;
-  u16 tv_validity;
-  u8  tv_payload_ri;
-  u8  tv_average_ri;
-  u8  tv_variance_ri;
-  u16 q_dl_trch_bler_ri;
-  u16 q_num_tfcs;
-  u16 q_sir_TFCSid[MAXMEASTFCS];
-  u16 int_quantity;
-  u16 int_coeff;
-  u8  int_rep_ue_TransmittedPower;
-  u8  int_rep_appliedTA;
-  u16 criteria_type;
-  u16 rep_amount;
-  u16 rep_interval;
-};
-
-struct rrc_ue_meas_rep {
-  int meas_counter;
-  int meas_interval;
-  int meas_start;
-  u16 identity;
-  u16 meas_results_type;
-  u16 if_num_cells;
-  u16 if_cell_id[maxCells];
-  u16 if_cell_parms_id[maxCells];
-  u16 if_BCH_RSCP[maxCells];
-  u16 if_pathloss[maxCells];
-  u16 if_slot_iscp[maxCells][maxTS];
-  u16 tv_num_rbs;
-  u16 tv_rbid[MAXMEASRBS];
-  u16 tv_rb_payload[MAXMEASRBS];
-  u16 tv_rb_average[MAXMEASRBS];
-  u16 tv_rb_variance[MAXMEASRBS];
-  u16 q_num_TrCH;
-  u16 q_dl_TrCH_id[MAXMEASTRCH];
-  u16 q_dl_TrCH_BLER[MAXMEASTRCH];
-  u16 q_num_tfcs;
-  u16 q_tfcs_id[MAXMEASTFCS];
-  u16 q_sir[MAXMEASTFCS][maxTS];
-  u16 int_xmit_power[maxTS];
-  u16 int_timing_advance;
-};
-
-
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_ue_vars.h b/openair2/RRC/CELLULAR/rrc_ue_vars.h
deleted file mode 100644
index 743b7068ac..0000000000
--- a/openair2/RRC/CELLULAR/rrc_ue_vars.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*********************************************************************
-                          rrc_ue_vars.h  -  description
-                             -------------------
-    copyright            : (C) 2005, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- *********************************************************************
-  Define control block memory for RRC_UE
- ********************************************************************/
-#ifndef __RRC_UE_VARS_H__
-#define __RRC_UE_VARS_H__
-
-#include "COMMON/mac_rrc_primitives.h"
-#include "rrc_platform_types.h"
-#include "mem_pool.h"
-
-#include "rrc_ue_entity.h"
-//#include "rrc_L2_asconfig.h"
-
-
-//-----------------------------------------------------------------------------
-struct protocol_pool_ms {
-  struct rrc_ue_entity rrc;
-};
-
-volatile struct protocol_pool_ms prot_pool_ms;
-volatile struct protocol_pool_ms *protocol_ms;
-RRC_XFACE *Rrc_xface;
-
-RRM_VARS rrc_as_config;
-RRM_VARS *rrm_config;
-
-int rrc_release_all_ressources;
-int rrc_ue_mobileId;
-int rrc_ethernet_id;
-
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_ue_vars_extern.h b/openair2/RRC/CELLULAR/rrc_ue_vars_extern.h
deleted file mode 100644
index b28b59072c..0000000000
--- a/openair2/RRC/CELLULAR/rrc_ue_vars_extern.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*********************************************************************
-                          rrc_ue_vars_extern.h  -  description
-                             -------------------
-    copyright            : (C) 2005, 2010 by Eurecom
-    email                : Michelle.Wetterwald@eurecom.fr
- *********************************************************************
-  External definitions for control block memory for RRC_UE
- ********************************************************************/
-#ifndef __RRC_UE_VARS_EXTERN_H__
-#define __RRC_UE_VARS_EXTERN_H__
-
-#include "COMMON/mac_rrc_primitives.h"
-#include "mem_pool.h"
-
-#include "rrc_constant.h"
-#include "rrc_ue_entity.h"
-
-//-----------------------------------------------------------------------------
-
-extern volatile struct protocol_pool_ms *protocol_ms;
-extern int rrc_release_all_ressources;
-extern RRC_XFACE *Rrc_xface;
-#endif
diff --git a/openair2/RRC/CELLULAR/rrc_util_config.c b/openair2/RRC/CELLULAR/rrc_util_config.c
deleted file mode 100755
index a231eeb7c3..0000000000
--- a/openair2/RRC/CELLULAR/rrc_util_config.c
+++ /dev/null
@@ -1,487 +0,0 @@
-/***************************************************************************
-                          rrc_util_config.c  -
-                          -------------------
-    copyright            : (C) 2002, 2010 by Eurecom
-    created by           : michelle.wetterwald@eurecom.fr
-                           raymond.knopp@eurecom.fr
-                           lionel.gauthier@eurecom.fr
- **************************************************************************
-    Utilitiesfor config compression ...
-    WARNING 08/07/2010 : NOT Compiled yet - rrc_xx_dummies.c is used instead
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#include "rrc_ue_vars.h"
-#include "rrc_nas_sap.h"
-#include "rrc_msg_constant.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_int.h"
-
-
-//-----------------------------------------------------------------------------
-//   WARNING 08/07/2010 : NOT Compiled yet - rrc_xx_dummies.c is used instead
-void rrc_compress_config (MT_CONFIG * config, char *dest_buffer, int *dest_length)
-{
-  //-----------------------------------------------------------------------------
-  int             i, j, k, el;
-  char           *outbuf = dest_buffer;
-
-#ifdef DEBUG_LOAD_CONFIG
-  msg ("[RRC][CONFIG][COMPRESS] config size = %d -> %p\n", sizeof (MT_CONFIG), dest_buffer);
-#endif
-  *outbuf++ = config->nb_commands;
-
-  memcpy (outbuf, &config->rrm_commands[0], config->nb_commands * sizeof (RRM_COMMAND_MT));
-
-  outbuf += config->nb_commands * sizeof (RRM_COMMAND_MT);
-
-  for (i = 0; i < JRRM_MAX_COMMANDS_PER_TRANSACTION; i++) {
-    el = config->rrm_commands[i].rrm_element_index;
-
-    switch (config->rrm_commands[i].rrm_action) {
-    case ACTION_ADD:
-    case ACTION_MODIFY:
-#ifdef DEBUG_LOAD_CONFIG
-      msg ("[RRC][CONFIG][COMPRESS] Command %d : action %d element %d index %d\n", i, config->rrm_commands[i].rrm_action, config->rrm_commands[i].rrm_element, el);
-#endif
-
-      switch (config->rrm_commands[i].rrm_element) {
-        //-------------------------------------------
-      case SIGNALLING_RADIO_BEARER:
-      case RADIO_ACCESS_BEARER:
-        //-------------------------------------------
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][COMPRESS]  RB (%d)\n", (int) outbuf - (int) dest_buffer);
-#endif
-        memcpy (outbuf, (void *) &config->bearer_dl[el], sizeof (RADIOBEARER));
-        outbuf += sizeof (RADIOBEARER);
-
-        memcpy (outbuf, (void *) &config->bearer_ul[el], sizeof (RADIOBEARER));
-        outbuf += sizeof (RADIOBEARER);
-        break;
-
-        //-------------------------------------------
-      case TRCH_UL:
-        //-------------------------------------------
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][COMPRESS] TRCH_UL (%d)\n", (int) outbuf - (int) dest_buffer);
-#endif
-        memcpy ((void *) outbuf, (void *) &config->trch_ul[el].peer_id, sizeof (u8));
-        outbuf += sizeof (u8);
-        memcpy ((void *) outbuf, (void *) &config->trch_ul[el].type, sizeof (u8));
-        outbuf += sizeof (u8);
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][COMPRESS]  TRCH_TYPE = %d (%d)\n", config->trch_ul[el].type, (int) outbuf - (int) dest_buffer);
-#endif
-
-        *outbuf++ = config->trch_ul[el].cctrch;
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][COMPRESS]  TRCH_CCTRCH = %d (%d)\n", config->trch_ul[el].cctrch, (int) outbuf - (int) dest_buffer);
-#endif
-        *outbuf++ = config->trch_ul[el].tti;
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][COMPRESS]  TRCH_TTI = %d (%d)\n", config->trch_ul[el].tti, (int) outbuf - (int) dest_buffer);
-#endif
-        *outbuf++ = config->trch_ul[el].code;
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][COMPRESS]  TRCH_CODE = %d (%d)\n", config->trch_ul[el].code, (int) outbuf - (int) dest_buffer);
-#endif
-
-        memcpy ((void *) outbuf, (void *) &config->trch_ul[el].num_tf, sizeof (u8));
-        outbuf += sizeof (u8);
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][COMPRESS]  TRCH_NUM_TF = %d (%d)\n", config->trch_ul[el].num_tf, (int) outbuf - (int) dest_buffer);
-#endif
-
-        memcpy (outbuf, (void *) &config->trch_ul[el].tf, config->trch_ul[el].num_tf * sizeof (TF));
-        outbuf += config->trch_ul[el].num_tf * sizeof (TF);
-        break;
-
-        //-------------------------------------------
-      case TRCH_DL:
-        //-------------------------------------------
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][COMPRESS] TRCH_DL (%d)\n", (int) outbuf - (int) dest_buffer);
-#endif
-        memcpy (outbuf, (void *) &config->trch_dl[el].peer_id, sizeof (u8));
-        outbuf += sizeof (u8);
-        memcpy (outbuf, (void *) &config->trch_dl[el].type, sizeof (u8));
-        outbuf += sizeof (u8);
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][COMPRESS]  TRCH_TYPE = %d (%d)\n", config->trch_dl[el].type, (int) outbuf - (int) dest_buffer);
-#endif
-
-        *outbuf++ = config->trch_dl[el].cctrch;
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][COMPRESS]  TRCH_CCTRCH = %d (%d)\n", config->trch_dl[el].cctrch, (int) outbuf - (int) dest_buffer);
-#endif
-        *outbuf++ = config->trch_dl[el].tti;
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][COMPRESS]  TRCH_TTI = %d (%d)\n", config->trch_dl[el].tti, (int) outbuf - (int) dest_buffer);
-#endif
-        *outbuf++ = config->trch_dl[el].code;
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][COMPRESS]  TRCH_CODE = %d (%d)\n", config->trch_dl[el].code, (int) outbuf - (int) dest_buffer);
-#endif
-
-        memcpy (outbuf, (void *) &config->trch_dl[el].num_tf, sizeof (u8));
-        outbuf += sizeof (u8);
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][COMPRESS]  TRCH_NUM_TF = %d (%d)\n", config->trch_dl[el].num_tf, (int) outbuf - (int) dest_buffer);
-#endif
-
-        memcpy (outbuf, (void *) &config->trch_dl[el].tf, config->trch_dl[el].num_tf * sizeof (TF));
-        outbuf += config->trch_dl[el].num_tf * sizeof (TF);
-        break;
-
-        //-------------------------------------------
-      case CCTRCH_UL:
-        //-------------------------------------------
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][COMPRESS] CCTRCH_UL (%d,%d)\n", (int) outbuf - (int) dest_buffer, (int) &config->cctrch_ul[el] - (int) config);
-#endif
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][COMPRESS] num tfc %d\n", config->cctrch_ul[el].tfcs.num_tfc);
-#endif
-        memcpy (outbuf, (void *) &config->cctrch_ul[el].tfcs.num_tfc, sizeof (u8));
-        outbuf += sizeof (u8);
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][COMPRESS] num trch %d\n", config->cctrch_ul[el].num_trch);
-#endif
-        memcpy (outbuf, (void *) &config->cctrch_ul[el].num_trch, sizeof (u8));
-        outbuf += sizeof (u8);
-
-        for (j = 0; j < config->cctrch_ul[el].tfcs.num_tfc; j++)
-          for (k = 0; k < config->cctrch_ul[el].num_trch; k++) {
-#ifdef DEBUG_LOAD_CONFIG
-            msg ("[RRC][CONFIG][COMPRESS] tfc %d %d\n", j, k);
-#endif
-            *outbuf++ = config->cctrch_ul[el].tfcs.tfc[j][k];
-          }
-
-        memcpy (outbuf, (void *) &config->cctrch_ul[el].trch_id, config->cctrch_ul[el].num_trch);
-        outbuf += config->cctrch_ul[el].num_trch;
-
-        *outbuf++ = config->cctrch_ul[el].type;
-
-        *outbuf++ = config->cctrch_ul[el].pl;
-
-        *outbuf++ = config->cctrch_ul[el].num_tfci_bits;
-
-        *outbuf++ = config->cctrch_ul[el].tti;
-
-        *outbuf++ = config->cctrch_ul[el].num_pch;
-
-        memcpy (outbuf, (void *) &config->cctrch_ul[el].pch[0], sizeof (PCH) * config->cctrch_ul[el].num_pch);
-        outbuf += sizeof (PCH) * config->cctrch_ul[el].num_pch;
-
-        *outbuf++ = config->cctrch_ul[el].DSP_FLAG;
-
-        memcpy (outbuf, (void *) &config->cctrch_ul[el].gain_adjust, sizeof (u16));
-        outbuf += sizeof (u16);
-
-        *outbuf++ = config->cctrch_ul[el].sec_interl;
-        break;
-
-        //-------------------------------------------
-      case CCTRCH_DL:
-        //-------------------------------------------
-        msg ("[RRC][CONFIG][COMPRESS] CCTRCH_DL (%d,%d)\n", (int) outbuf - (int) dest_buffer, (int) &config->cctrch_dl[el] - (int) config);
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][COMPRESS] num tfc %d\n", config->cctrch_dl[el].tfcs.num_tfc);
-#endif
-        memcpy (outbuf, (void *) &config->cctrch_dl[el].tfcs.num_tfc, sizeof (u8));
-        outbuf += sizeof (u8);
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][COMPRESS] num trch %d\n", config->cctrch_dl[el].num_trch);
-#endif
-        memcpy (outbuf, (void *) &config->cctrch_dl[el].num_trch, sizeof (u8));
-        outbuf += sizeof (u8);
-
-        for (j = 0; j < config->cctrch_dl[el].tfcs.num_tfc; j++)
-          for (k = 0; k < config->cctrch_dl[el].num_trch; k++) {
-            msg ("[RRC][CONFIG][COMPRESS] tfc %d %d\n", j, k);
-            *outbuf++ = config->cctrch_dl[el].tfcs.tfc[j][k];
-          }
-
-        memcpy (outbuf, (void *) &config->cctrch_dl[el].trch_id, config->cctrch_dl[el].num_trch);
-        outbuf += config->cctrch_dl[el].num_trch;
-
-        *outbuf++ = config->cctrch_dl[el].type;
-
-        *outbuf++ = config->cctrch_dl[el].pl;
-
-        *outbuf++ = config->cctrch_dl[el].num_tfci_bits;
-
-        *outbuf++ = config->cctrch_dl[el].tti;
-
-        *outbuf++ = config->cctrch_dl[el].num_pch;
-
-        memcpy (outbuf, (void *) &config->cctrch_dl[el].pch[0], sizeof (PCH) * config->cctrch_dl[el].num_pch);
-        outbuf += sizeof (PCH) * config->cctrch_dl[el].num_pch;
-
-
-        *outbuf++ = config->cctrch_dl[el].DSP_FLAG;
-
-        memcpy (outbuf, (void *) &config->cctrch_dl[el].gain_adjust, sizeof (u16));
-        outbuf += sizeof (u16);
-
-        *outbuf++ = config->cctrch_dl[el].sec_interl;
-        break;
-      }
-
-      break;
-
-      //-------------------------------------------
-    default:
-      //-------------------------------------------
-      break;
-    }
-
-  }
-
-  *dest_length = (int) outbuf - (int) dest_buffer;
-  msg ("[RRC][CONFIG][COMPRESS] : Compressed config length = %d end @ %p\n", *dest_length, outbuf);
-}
-
-//-----------------------------------------------------------------------------
-//   WARNING 08/07/2010 : NOT Compiled yet - rrc_xx_dummies.c is used instead
-void rrc_uncompress_config (MT_CONFIG * config, char *source_buffer)
-{
-  //-----------------------------------------------------------------------------
-  int             i, j, k, el;
-  char           *inbuf = source_buffer;
-
-  config->nb_commands = *inbuf++;
-
-#ifdef DEBUG_LOAD_CONFIG
-  msg ("[RRC][CONFIG][EXPAND] config %p\n", source_buffer);
-  msg ("[RRC][CONFIG][EXPAND] RRM_COMMAND_MT = 1\n TRCH_DL = %d \n TRCH_UL = %d\n CCTRCH_DL = %d\n CCTRCH_UL = %d\n RADIOBEARER_DL = %d\n RADIOBEARER_UL = %d\n L3= %d\n\n",
-       1 + JRRM_MAX_COMMANDS_PER_TRANSACTION * sizeof (RRM_COMMAND_MT),
-       1 + JRRM_MAX_COMMANDS_PER_TRANSACTION * sizeof (RRM_COMMAND_MT) + JRRM_MAX_TRCH_MOBILE * sizeof (TRCH),
-       1 + JRRM_MAX_COMMANDS_PER_TRANSACTION * sizeof (RRM_COMMAND_MT) + 2 * JRRM_MAX_TRCH_MOBILE * sizeof (TRCH),
-       1 + JRRM_MAX_COMMANDS_PER_TRANSACTION * sizeof (RRM_COMMAND_MT) + 2 * JRRM_MAX_TRCH_MOBILE * sizeof (TRCH) + JRRM_MAX_CCTRCH_MOBILE * sizeof (CCTRCH),
-       1 + JRRM_MAX_COMMANDS_PER_TRANSACTION * sizeof (RRM_COMMAND_MT) + 2 * JRRM_MAX_TRCH_MOBILE * sizeof (TRCH) + 2 * JRRM_MAX_CCTRCH_MOBILE * sizeof (CCTRCH),
-       1 + JRRM_MAX_COMMANDS_PER_TRANSACTION * sizeof (RRM_COMMAND_MT) + 2 * JRRM_MAX_TRCH_MOBILE * sizeof (TRCH) + 2 * JRRM_MAX_CCTRCH_MOBILE * sizeof (CCTRCH) +
-       JRRM_MAX_RB_MOBILE * sizeof (RADIOBEARER),
-       1 + JRRM_MAX_COMMANDS_PER_TRANSACTION * sizeof (RRM_COMMAND_MT) + 2 * JRRM_MAX_TRCH_MOBILE * sizeof (TRCH) + 2 * JRRM_MAX_CCTRCH_MOBILE * sizeof (CCTRCH) +
-       2 * JRRM_MAX_RB_MOBILE * sizeof (RADIOBEARER));
-  msg ("[RRC][CONFIG][EXPAND] nb_commands = %d\n", config->nb_commands);
-#endif
-  memcpy ((void *) &config->rrm_commands[0], inbuf, config->nb_commands * sizeof (RRM_COMMAND_MT));
-
-  inbuf += config->nb_commands * sizeof (RRM_COMMAND_MT);
-
-  for (i = 0; i < JRRM_MAX_COMMANDS_PER_TRANSACTION; i++) {
-    el = config->rrm_commands[i].rrm_element_index;
-
-    switch (config->rrm_commands[i].rrm_action) {
-
-    case ACTION_ADD:
-    case ACTION_MODIFY:
-#ifdef DEBUG_LOAD_CONFIG
-      msg ("[RRC][CONFIG][EXPAND] Command %d : action %d element %d index %d\n", i, config->rrm_commands[i].rrm_action, config->rrm_commands[i].rrm_element, el);
-#endif
-
-      switch (config->rrm_commands[i].rrm_element) {
-        //-------------------------------------------
-      case SIGNALLING_RADIO_BEARER:
-      case RADIO_ACCESS_BEARER:
-        //-------------------------------------------
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][EXPAND]  RB %d (%d)\n", el, (int) inbuf - (int) source_buffer);
-#endif
-        memcpy ((void *) &config->bearer_dl[el], inbuf, sizeof (RADIOBEARER));
-        inbuf += sizeof (RADIOBEARER);
-
-        memcpy ((void *) &config->bearer_ul[el], inbuf, sizeof (RADIOBEARER));
-        inbuf += sizeof (RADIOBEARER);
-        break;
-
-        //-------------------------------------------
-      case TRCH_UL:
-        //-------------------------------------------
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][EXPAND]  TRCH_UL %d (%d)\n", el, (int) inbuf - (int) source_buffer);
-#endif
-        memcpy ((void *) &config->trch_ul[el].peer_id, inbuf, sizeof (u8));
-        inbuf += sizeof (u8);
-        memcpy ((void *) &config->trch_ul[el].type, inbuf, sizeof (u8));
-        inbuf += sizeof (u8);
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][EXPAND]  TRCH_TYPE = %d (%d)\n", config->trch_ul[el].type, (int) inbuf - (int) source_buffer);
-#endif
-
-        config->trch_ul[el].cctrch = *inbuf++;
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][EXPAND]  TRCH_CCTRCH = %d (%d)\n", config->trch_ul[el].cctrch, (int) inbuf - (int) source_buffer);
-#endif
-        config->trch_ul[el].tti = *inbuf++;
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][EXPAND]  TRCH_TTI = %d (%d)\n", config->trch_ul[el].tti, (int) inbuf - (int) source_buffer);
-#endif
-        config->trch_ul[el].code = *inbuf++;
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][EXPAND]  TRCH_CODE = %d (%d)\n", config->trch_ul[el].code, (int) inbuf - (int) source_buffer);
-#endif
-
-        memcpy ((void *) &config->trch_ul[el].num_tf, inbuf, sizeof (u8));
-        inbuf += sizeof (u8);
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][EXPAND]  TRCH_NUM_TF = %d (%d)\n", config->trch_ul[el].num_tf, (int) inbuf - (int) source_buffer);
-#endif
-
-        memcpy ((void *) &config->trch_ul[el].tf, inbuf, config->trch_ul[el].num_tf * sizeof (TF));
-        inbuf += config->trch_ul[el].num_tf * sizeof (TF);
-        break;
-
-        //-------------------------------------------
-      case TRCH_DL:
-        //-------------------------------------------
-        msg ("[RRC][CONFIG][EXPAND]  TRCH_DL %d (%d)\n", el, (int) inbuf - (int) source_buffer);
-        memcpy ((void *) &config->trch_dl[el].peer_id, inbuf, sizeof (u8));
-        inbuf += sizeof (u8);
-        memcpy ((void *) &config->trch_dl[el].type, inbuf, sizeof (u8));
-        inbuf += sizeof (u8);
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][EXPAND]  TRCH_TYPE = %d (%d)\n", config->trch_dl[el].type, (int) inbuf - (int) source_buffer);
-#endif
-
-        config->trch_dl[el].cctrch = *inbuf++;
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][EXPAND]  TRCH_CCTRCH = %d (%d)\n", config->trch_dl[el].cctrch, (int) inbuf - (int) source_buffer);
-#endif
-        config->trch_dl[el].tti = *inbuf++;
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][EXPAND]  TRCH_TTI = %d (%d)\n", config->trch_dl[el].tti, (int) inbuf - (int) source_buffer);
-#endif
-        config->trch_dl[el].code = *inbuf++;
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][EXPAND]  TRCH_CODE = %d (%d)\n", config->trch_dl[el].code, (int) inbuf - (int) source_buffer);
-#endif
-
-        memcpy ((void *) &config->trch_dl[el].num_tf, inbuf, sizeof (u8));
-        inbuf += sizeof (u8);
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][EXPAND]  TRCH_NUM_TF = %d (%d)\n", config->trch_dl[el].num_tf, (int) inbuf - (int) source_buffer);
-#endif
-
-        memcpy ((void *) &config->trch_dl[el].tf, inbuf, config->trch_dl[el].num_tf * sizeof (TF));
-        inbuf += config->trch_dl[el].num_tf * sizeof (TF);
-        break;
-
-        //-------------------------------------------
-      case CCTRCH_UL:
-        //-------------------------------------------
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][EXPAND]  CCTRCH_UL %d (%d)\n", el, (int) inbuf - (int) source_buffer);
-#endif
-        memcpy ((void *) &config->cctrch_ul[el].tfcs.num_tfc, inbuf, sizeof (u8));
-        inbuf += sizeof (u8);
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][EXPAND] NumTFC = %d\n", config->cctrch_ul[el].tfcs.num_tfc);
-#endif
-        memcpy ((void *) &config->cctrch_ul[el].num_trch, inbuf, sizeof (u8));
-        inbuf += sizeof (u8);
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][EXPAND] NumTrCh = %d\n", config->cctrch_ul[el].num_trch);
-#endif
-
-        for (j = 0; j < config->cctrch_ul[el].tfcs.num_tfc; j++)
-          for (k = 0; k < config->cctrch_ul[el].num_trch; k++) {
-#ifdef DEBUG_LOAD_CONFIG
-            msg ("[RRC][CONFIG][EXPAND] tfc %d %d\n", j, k);
-#endif
-            config->cctrch_ul[el].tfcs.tfc[j][k] = *inbuf++;
-          }
-
-        memcpy ((void *) &config->cctrch_ul[el].trch_id, inbuf, config->cctrch_ul[el].num_trch);
-        inbuf += config->cctrch_ul[el].num_trch;
-
-        config->cctrch_ul[el].type = *inbuf++;
-
-        config->cctrch_ul[el].pl = *inbuf++;
-
-        config->cctrch_ul[el].num_tfci_bits = *inbuf++;
-
-        config->cctrch_ul[el].tti = *inbuf++;
-
-        config->cctrch_ul[el].num_pch = *inbuf++;
-
-        memcpy ((void *) &config->cctrch_ul[el].pch, inbuf, config->cctrch_ul[el].num_pch * sizeof (PCH));
-        inbuf += config->cctrch_ul[el].num_pch * sizeof (PCH);
-
-        config->cctrch_ul[el].DSP_FLAG = *inbuf++;
-
-        memcpy ((void *) &config->cctrch_ul[el].gain_adjust, inbuf, sizeof (u16));
-        inbuf += sizeof (u16);
-
-        config->cctrch_ul[el].sec_interl = *inbuf++;
-        break;
-
-        //-------------------------------------------
-      case CCTRCH_DL:
-        //-------------------------------------------
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][EXPAND]  CCTRCH_DL %d (%d)\n", el, (int) inbuf - (int) source_buffer);
-#endif
-        memcpy ((void *) &config->cctrch_dl[el].tfcs.num_tfc, inbuf, sizeof (u8));
-        inbuf += sizeof (u8);
-
-        memcpy ((void *) &config->cctrch_dl[el].num_trch, inbuf, sizeof (u8));
-        inbuf += sizeof (u8);
-
-#ifdef DEBUG_LOAD_CONFIG
-        msg ("[RRC][CONFIG][EXPAND] NumTrCh = %d\n", config->cctrch_dl[el].num_trch);
-#endif
-
-        for (j = 0; j < config->cctrch_dl[el].tfcs.num_tfc; j++)
-          for (k = 0; k < config->cctrch_dl[el].num_trch; k++) {
-#ifdef DEBUG_LOAD_CONFIG
-            msg ("[RRC][CONFIG][EXPAND] tfc %d %d\n", j, k);
-#endif
-
-            config->cctrch_dl[el].tfcs.tfc[j][k] = *inbuf++;
-          }
-
-        memcpy ((void *) &config->cctrch_dl[el].trch_id, inbuf, config->cctrch_dl[el].num_trch);
-        inbuf += config->cctrch_dl[el].num_trch;
-
-        config->cctrch_dl[el].type = *inbuf++;
-
-        config->cctrch_dl[el].pl = *inbuf++;
-
-        config->cctrch_dl[el].num_tfci_bits = *inbuf++;
-
-        config->cctrch_dl[el].tti = *inbuf++;
-
-        config->cctrch_dl[el].num_pch = *inbuf++;
-
-        memcpy ((void *) &config->cctrch_dl[el].pch, inbuf, config->cctrch_dl[el].num_pch * sizeof (PCH));
-        inbuf += config->cctrch_dl[el].num_pch * sizeof (PCH);
-
-        config->cctrch_dl[el].DSP_FLAG = *inbuf++;
-
-        memcpy ((void *) &config->cctrch_dl[el].gain_adjust, inbuf, sizeof (u16));
-        inbuf += sizeof (u16);
-
-        config->cctrch_dl[el].sec_interl = *inbuf++;
-        break;
-      }
-
-      break;
-
-      //-------------------------------------------
-    default:
-      //-------------------------------------------
-      break;
-    }
-  }
-}
diff --git a/openair2/RRC/CELLULAR/rrc_utilities.c b/openair2/RRC/CELLULAR/rrc_utilities.c
deleted file mode 100755
index 7f23cc7b77..0000000000
--- a/openair2/RRC/CELLULAR/rrc_utilities.c
+++ /dev/null
@@ -1,457 +0,0 @@
-/***************************************************************************
-                          rrc_utilities.c  -
-                          -------------------
-    copyright            : (C) 2002, 2010 by Eurecom
-    created by           : michelle.wetterwald@eurecom.fr
- **************************************************************************
-    Utilities: print buffer, measures ...
- ***************************************************************************/
-/********************
-//OpenAir definitions
- ********************/
-#include "LAYER2/MAC/extern.h"
-#include "UTIL/MEM/mem_block.h"
-
-/********************
-// RRC definitions
- ********************/
-#ifdef NODE_MT
-#include "rrc_ue_vars.h"
-#endif
-#ifdef NODE_RG
-#include "rrc_rg_vars.h"
-#endif
-#include "rrc_nas_sap.h"
-#include "rrc_msg_constant.h"
-//-----------------------------------------------------------------------------
-#include "rrc_proto_int.h"
-//-----------------------------------------------------------------------------
-#ifdef USER_MODE
-#include <sys/stat.h>
-#include <errno.h>
-//#include <fcntl.h>
-#endif
-
-#ifdef USER_MODE
-//-----------------------------------------------------------------------------
-void rrc_create_fifo (char *rrc_fifo)
-{
-  //-----------------------------------------------------------------------------
-  mode_t mode_RWXall = S_IRWXU | S_IRWXG | S_IRWXO;
-
-  if (mkfifo (rrc_fifo, mode_RWXall) && (errno != EEXIST)) {
-    msg ("Impossible to create %s\n", rrc_fifo);
-  } else {
-    msg ("Creation %s\n", rrc_fifo);
-  }
-}
-#endif
-
-//-----------------------------------------------------------------------------
-// Print the content of a buffer in hexadecimal
-void rrc_print_buffer (char *buffer, int length)
-{
-  //-----------------------------------------------------------------------------
-#define DEBUG_RRC_DETAILS
-#ifdef DEBUG_RRC_DETAILS
-  int i;
-  int used_length;
-
-  if (length > 1000) {
-    used_length = 1000;
-    msg ("[RRC-PRINT] buffer length %d too large, restricted to 1000 first bytes.\n", length);
-  } else {
-    used_length = length;
-  }
-
-  msg ("\n[RRC-PRINT] Buffer content: ");
-
-  for (i = 0; i < used_length; i++)
-    msg ("-%hx-", (unsigned char) buffer[i]);
-
-  msg (",\t total length %d\n\n", length);
-#endif
-}
-
-/**
- * @brief Print out the name of the message
- */
-//-----------------------------------------------------------------------------
-void rrc_mbms_mcch_message_name_print(int mcchMsgType)
-{
-  //-----------------------------------------------------------------------------
-  switch (mcchMsgType) {
-  case MCCH_mbmsAccessInformation:
-    msg("AccessInformation");
-    break;
-
-  case MCCH_mbmsCommonPTMRBInformation:
-    msg("CommonPTMRBInformation");
-    break;
-
-  case MCCH_mbmsCurrentCellPTMRBInformation:
-    msg("CurrentCellPTMRBInformation");
-    break;
-
-  case MCCH_mbmsGeneralInformation:
-    msg("GeneralInformation");
-    break;
-
-  case MCCH_mbmsModifiedServicesInformation:
-    msg("ModifiedServicesInformation");
-    break;
-
-  case MCCH_mbmsNeighbouringCellPTMRBInformation:
-    msg("NeighbouringCellPTMRBInformation");
-    break;
-
-  case MCCH_mbmsUnmodifiedServicesInformation:
-    msg("UnmodifiedServicesInformation");
-    break;
-  }
-}
-
-/**
- * @brief find the serivice id in the service list
- * @param services the service list
- * @param numService the number of services in the list
- * @param serviceID service id need to find
- * @return the index in the list
- */
-//-----------------------------------------------------------------------------
-int rrc_mbms_service_id_find(u8 numService, void * services, int serviceID)
-{
-  //-----------------------------------------------------------------------------
-  int index;
-
-  for (index = 0; index < numService; index ++) {
-    if (((o3*) services)[index] == (o3) serviceID)
-      break;
-  }
-
-  return index <  numService ? index: -1;
-}
-
-
-#ifdef NODE_MT
-//-----------------------------------------------------------------------------
-void rrc_ue_print_meas_control (struct rrc_ue_meas_cmd *p)
-{
-  //-----------------------------------------------------------------------------
-  int i = 0;
-  char *command[3]    = { "Setup", "Modify", "Release" };
-  char *transf[2]     = { "RLC AM", "RLC UM" };
-  char *trigger[2]    = { "Periodical", "Event trigger" };
-  char *bool[2]       = { "NO", "YES" };
-  char *validity[3]   = { "cell_DCH", "all_But_Cell_DCH", "all_States" };
-  char *uequantity[2] = { "UE Transmitted Power", "UTRA carrier RSSI" };
-
-  msg ("\n[RRC] ******************    Measurement Control Message   ******************\n");
-  msg ("[RRC] System Measurement Time : %d\n", protocol_ms->rrc.current_SFN);
-  msg ("[RRC] Measurement Identity: %d\t Command: %s\t Transfer Mode: %s\t Reporting Mode: %s\n", p->identity, command[p->command - 1], transf[p->xfer_mode], trigger[p->trigger]);
-
-  if (p->command == MC_release)
-    return;
-
-  switch (p->type) {
-    // Intra Frequency Measurement
-  case MT_intraFrequencyMeasurement:
-    msg ("\n[RRC] Measurement type: Intra Frequency Measurement\n");
-    msg ("[RRC] Measurement quantity-> Filter coefficient : %i, \tState Validity : %s\n", p->if_coeff, validity[p->if_validity]);
-    msg ("[RRC] Reporting quantities : \tCell identity : %s\tTimeslot ISCP : %s\tP-CCPCH RSCP : %s\tPathloss : %s\n",
-         bool[p->if_cellIdentity_ri], bool[p->if_timeslotISCP_ri], bool[p->if_BCH_RSCP_ri], bool[p->if_pathloss_ri]);
-    break;
-
-    // Traffic Volume Measurement
-  case MT_trafficVolumeMeasurement:
-    msg ("\n[RRC] Measurement type: Traffic Volume Measurement\n");
-    msg ("[RRC] State Validity : %s, \tPayload : %s, \tPayload Average : %s, \tPayload Variance : %s\n",
-         validity[p->tv_validity], bool[p->tv_payload_ri], bool[p->tv_average_ri], bool[p->tv_variance_ri]);
-    break;
-
-    // Quality Measurement
-  case MT_qualityMeasurement:
-    msg ("\n[RRC] Measurement type: Quality Measurement\n");
-    msg ("[RRC] Measurement quantity-> TRCH BLER : %s, SIR for TFCS : ", bool[p->q_dl_trch_bler_ri]);
-
-    for (i = 0; i < MAXMEASTFCS; i++)
-      msg ("%d\t", p->q_sir_TFCSid[i]);
-
-    msg ("\n");
-    break;
-
-    // UE Internal Measurement
-  case MT_ue_InternalMeasurement:
-    msg ("\n[RRC] Measurement type: UE Internal Measurement\n");
-    msg ("[RRC] Measurement quantity-> Filter coefficient : %i, \tMeasured Quantity : %s\n", p->int_coeff, uequantity[p->int_quantity]);
-    msg ("[RRC] Reporting quantities : \tUE Transmitted Power : %s\tApplied Timing Advance : %s\n", bool[p->int_rep_ue_TransmittedPower], bool[p->int_rep_appliedTA]);
-    break;
-  }
-
-  //
-  switch (p->criteria_type) {
-  case RC_ThresholdReportingCriteria:
-    msg ("\n[RRC] Report criteria: Threshold reporting -- FFS\n");
-    break;
-
-  case RC_PeriodicalReportingCriteria:
-    msg ("\n[RRC] Report criteria: Periodical Reporting\tAmount of reporting : %d  \tReporting interval : %i\n", p->rep_amount, p->rep_interval);
-    break;
-
-  case RC_NoReporting:
-    msg ("\n[RRC] Report criteria: No reporting\n");
-  }
-
-  //
-  msg ("[RRC] *******END********    Measurement Control Message   ****\n\n");
-}
-#endif
-
-#ifdef NODE_RG
-//-----------------------------------------------------------------------------
-void rrc_rg_print_meas_report (struct rrc_rg_mt_meas_rep *p)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_MEASURE_REPORT
-  int i, j;
-  char *payload[20] =
-  { "pl0", "pl4", "pl8", "pl16", "pl32", "pl64", "pl128", "pl256", "pl512", "pl1024", "pl2k", "pl4k", "pl8k", "pl16k", "pl32k", "pl64k", "pl128k", "pl256k", "pl512k", "pl1024k" };
-  char *average[20] = {
-    "pla0", "pla4", "pla8", "pla16", "pla32", "pla64", "pla128", "pla256", "pla512", "pla1024", "pla2k",
-    "pla4k", "pla8k", "pla16k", "pla32k", "pla64k", "pla128k", "pla256k", "pla512k","pla1024k"
-  };
-  char *variance[14] = { "plv0", "plv4", "plv8", "plv16", "plv32", "plv64", "plv128", "plv256", "plv512", "plv1024", "plv2k", "plv4k", "plv8k", "plv16k" };
-
-
-  msg ("\n[RRC] **************    Measurement Report Message   *****************\n");
-  msg ("[RRC] Measurement Time: %d\n", protocol_bs->rrc.current_SFN);
-  msg ("[RRC] Measurement Identity: %d\t Measured Results type: ", p->identity);
-
-  switch (p->meas_results_type) {
-  case MR_intraFreqMeasuredResultsList:
-    msg ("Intra Frequency Measurement\t Number of cells: %d\n", p->if_num_cells);
-
-    for (i = 0; i < p->if_num_cells; i++) {
-      msg ("[RRC] Cell number: %d\tCell Identity: %d\tCell Parameters Id: %d\tP-CCPCH RSCP: %d\tPathloss: %d\n", i, p->if_cell_id[i], p->if_cell_parms_id[i], p->if_BCH_RSCP[i], p->if_pathloss[i]);
-      msg ("\tTimeslot ISCP for each slot:\t");
-
-      for (j = 0; j < JRRM_SLOTS_PER_FRAME; j++)
-        msg ("%d: %d, ", j, p->if_slot_iscp[i][j]);
-
-      msg ("\n");
-    }
-
-    break;
-
-    // u16 tv_num_rbs;
-    // u16 tv_rbid[MAXMEASRBS];
-    // u16 tv_rb_payload[MAXMEASRBS];
-    // u16 tv_rb_average[MAXMEASRBS];
-    // u16 tv_rb_variance[MAXMEASRBS];
-  case MR_trafficVolumeMeasuredResultsList:
-    msg ("Traffic Volume Measurement -\t Number of RBs: %d\n", p->tv_num_rbs);
-
-    for (i = 0; i < p->tv_num_rbs; i++)
-      msg ("[RRC] RB_Id : %d\t, RLC_BufferPayload : %s\t, Average : %s\t, Variance : %s\n",
-           p->tv_rbid[i], payload[p->tv_rb_payload[i]], average[p->tv_rb_average[i]], variance[p->tv_rb_variance[i]]);
-
-    break;
-
-    // u16 q_num_TrCH;
-    // u16 q_dl_TrCH_id[MAXMEASTRCH];
-    // u16 q_dl_TrCH_BLER[MAXMEASTRCH];
-    // u16 q_num_tfcs;
-    // u16 q_tfcs_id[MAXMEASTFCS];
-    // u16 q_sir[MAXMEASTFCS][JRRM_SLOTS_PER_FRAME];
-  case MR_qualityMeasuredResults:
-    msg ("Quality Measurement -\t Number of Transport Channels : %d, Number of TFCS : %d\n", p->q_num_TrCH, p->q_num_tfcs);
-    msg ("[RRC] BLER for each Transport Channel:\t");
-
-    for (i = 0; i < p->q_num_TrCH; i++)
-      msg ("%d: %d, ", p->q_dl_TrCH_id[i], p->q_dl_TrCH_BLER[i]);
-
-    msg ("\n");
-    msg ("[RRC] SIR for each TFCS for each slot:\n");
-
-    for (i = 0; i < p->q_num_tfcs; i++) {
-      msg ("%d: ", p->q_tfcs_id[i]);
-
-      for (j = 0; j < JRRM_SLOTS_PER_FRAME; j++)
-        msg ("%d, ", p->q_sir[i][j]);
-
-      msg ("\n");
-    }
-
-    break;
-
-  case MR_ue_InternalMeasuredResults:
-    msg ("UE internal Measurement\t Timing Advance: %d\n", p->int_timing_advance);
-    msg ("[RRC] Transmitted Power for each slot:\t");
-
-    for (j = 0; j < JRRM_SLOTS_PER_FRAME; j++)
-      msg ("%d: %d, ", j, p->int_xmit_power[j]);
-
-    msg ("\n");
-    break;
-  }
-
-  msg ("[RRC] *****END*********    Measurement Report Message   *******\n\n");
-#endif
-}
-
-//-----------------------------------------------------------------------------
-void rrc_rg_print_meas_bs_control (struct rrc_rg_bs_meas_cmd *p)
-{
-  //-----------------------------------------------------------------------------
-  // u16 identity;
-  // u16 command;
-  // u16 trigger;
-  // u16 type;
-  // u16 criteria_type;
-  // u16 rep_amount;
-  // u16 rep_interval;
-#ifdef DEBUG_RRC_MEASURE_REPORT
-  char *command[3] = { "Setup", "Modify", "Release" };
-  char *trigger[2] = { "Periodical", "Event trigger" };
-  char *type[3] = { "BS internal", "Traffic Volume", "Quality" };
-
-  msg ("\n[RRC] ******************   BS Measurement Control Message   ******************\n");
-  msg ("[RRC] System Measurement Time : %d\n", protocol_bs->rrc.current_SFN);
-  msg ("[RRC] Measurement Identity: %d\t Command: %s\t ", p->identity, command[p->command - 1]);
-
-  if (p->type != IX_ibsM)
-    msg ("Mobile Id: %d\t", p->UE_Id);
-
-  if (p->command == MC_release) {
-    msg ("\n");
-    return;
-  }
-
-  msg ("Reporting Mode: %s\n", trigger[p->trigger]);
-  msg ("\n[RRC] Measurement type: %s Measurement\n", type[p->type]);
-
-  //
-  switch (p->criteria_type) {
-  case RC_ThresholdReportingCriteria:
-    msg ("[RRC] Report criteria: Threshold reporting -- FFS\n");
-    break;
-
-  case RC_PeriodicalReportingCriteria:
-    msg ("[RRC] Report criteria: Periodical Reporting\tAmount of reporting : %d  \tReporting interval : %i\n", p->rep_amount, p->rep_interval);
-    break;
-
-  case RC_NoReporting:
-    msg ("[RRC] Report criteria: No reporting\n");
-  }
-
-  //
-  msg ("[RRC] *******END********    BS Measurement Control Message   ****\n\n");
-#endif
-}
-
-//-----------------------------------------------------------------------------
-void rrc_rg_print_bs_meas_report (struct rrc_rg_bs_meas_rep *p)
-{
-  //-----------------------------------------------------------------------------
-#ifdef DEBUG_RRC_MEASURE_REPORT
-  int i, j;
-  char *payload[20] =
-  { "pl0", "pl4", "pl8", "pl16", "pl32", "pl64", "pl128", "pl256", "pl512", "pl1024", "pl2k", "pl4k", "pl8k", "pl16k", "pl32k", "pl64k", "pl128k", "pl256k", "pl512k", "pl1024k" };
-  char *average[20] = {
-    "pla0", "pla4", "pla8", "pla16", "pla32", "pla64", "pla128", "pla256", "pla512", "pla1024", "pla2k",
-    "pla4k", "pla8k", "pla16k", "pla32k", "pla64k", "pla128k", "pla256k", "pla512k", "pla1024k"
-  };
-  char *variance[14] = { "plv0", "plv4", "plv8", "plv16", "plv32", "plv64", "plv128", "plv256", "plv512", "plv1024", "plv2k", "plv4k", "plv8k", "plv16k" };
-
-
-  msg ("\n[RRC] **************    Measurement Report Message   *****************\n");
-  msg ("[RRC] Measurement Identity: %d\t Measured Results type: ", p->identity);
-
-  switch (p->meas_results_type) {
-  case IX_tvbM:
-    //    u16 tv_num_rbs;
-    //    u16 tv_rbid[MAXMEASRBS];
-    //    u16 tv_rb_payload[MAXMEASRBS];
-    //    u16 tv_rb_average[MAXMEASRBS];
-    //    u16 tv_rb_variance[MAXMEASRBS];
-    msg ("Traffic Volume Measurement -\t Number of RBs: %d\n", p->tv_num_rbs);
-
-    for (i = 0; i < p->tv_num_rbs; i++)
-      msg ("[RRC] RB_Id : %d\t, RLC_BufferPayload : %s\t, Average : %s\t, Variance : %s\n",
-           p->tv_rbid[i], payload[p->tv_rb_payload[i]], average[p->tv_rb_average[i]], variance[p->tv_rb_variance[i]]);
-
-    break;
-
-  case IX_qbM:
-    //              u16 q_num_TrCH;
-    //    u16 q_dl_TrCH_id[MAXMEASTRCH];
-    //    u16 q_dl_TrCH_BLER[MAXMEASTRCH];
-    //    u16 q_num_tfcs;
-    //    u16 q_tfcs_id[MAXMEASTFCS];
-    //              u16 q_sir[MAXMEASTFCS][JRRM_SLOTS_PER_FRAME];
-    msg ("Quality Measurement -\t Number of Transport Channels : %d, Number of TFCS : %d\n", p->q_num_TrCH, p->q_num_tfcs);
-    msg ("[RRC] BLER for each Transport Channel:\t");
-
-    for (i = 0; i < p->q_num_TrCH; i++)
-      msg ("%d: %d, ", p->q_dl_TrCH_id[i], p->q_dl_TrCH_BLER[i]);
-
-    msg ("\n");
-    msg ("[RRC] SIR for each TFCS for each slot:\n");
-
-    for (i = 0; i < p->q_num_tfcs; i++) {
-      msg ("%d: ", p->q_tfcs_id[i]);
-
-      for (j = 0; j < JRRM_SLOTS_PER_FRAME; j++)
-        msg ("%d, ", p->q_sir[i][j]);
-
-      msg ("\n");
-    }
-
-    break;
-
-  case IX_ibsM:
-    //    u16 int_xmit_power[numANTENNAS][JRRM_SLOTS_PER_FRAME];
-    //    u16 int_rscp[JRRM_SLOTS_PER_FRAME][MAXCH];
-    //    u16 int_rssi_rf[numANTENNAS][JRRM_SLOTS_PER_FRAME];
-    //    u16 int_spare[NUMSPARE];
-    msg ("BS internal Measurement\n");
-
-    for (i = 0; i < numANTENNAS; i++) {
-      msg ("[RRC] Transmitted Power for each slot on antenna %d :  ", i);
-
-      for (j = 0; j < JRRM_SLOTS_PER_FRAME; j++)
-        msg ("%d: %d, ", j, p->int_xmit_power[i][j]);
-
-      msg ("\n");
-    }
-
-    for (i = 0; i < JRRM_SLOTS_PER_FRAME; i++) {
-      msg ("[RRC] RSCP for each channel on slot %d :  ", i);
-
-      for (j = 0; j < MAXCH; j++)
-        msg ("%d: %d, ", j, p->int_rscp[i][j]);
-
-      msg ("\n");
-    }
-
-    for (i = 0; i < numANTENNAS; i++) {
-      msg ("[RRC] RSSI RF for each slot on antenna %d :  ", i);
-
-      for (j = 0; j < JRRM_SLOTS_PER_FRAME; j++)
-        msg ("%d: %d, ", j, p->int_rssi_rf[i][j]);
-
-      msg ("\n");
-    }
-
-    for (i = 0; i < NUMSPARE; i++) {
-      msg ("[RRC] Spare value : %d: %d\n", i, p->int_spare[i]);
-    }
-
-    break;
-  }
-
-  msg ("[RRC] *****END*********    Measurement Report Message   *******\n\n");
-#endif
-}
-
-#endif
-- 
GitLab