diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai
index 0a64c0a672b416bdb2ed991ce60d051c42c3a026..ea28a7131afca1e666ce6db35474c8e1c46f9344 100755
--- a/cmake_targets/build_oai
+++ b/cmake_targets/build_oai
@@ -82,7 +82,7 @@ Options
 --eNB
    Makes the LTE softmodem
 --UE
-   Makes the UE specific parts (ue_ip, usim, nvram) 
+   Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file
 --RRH
    Makes the RRH
 -a | --agent
@@ -145,6 +145,10 @@ Usage (Regular):
 
 
 function main() {
+
+  local gen_nvram_path=$OPENAIR_DIR/targets/bin
+  local conf_nvram_path=$OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf
+
   until [ -z "$1" ]
   do
     case "$1" in
@@ -182,7 +186,16 @@ function main() {
        --UE)
             UE=1
             echo_info "Will compile UE"
-            shift;;
+            shift
+            if test -n "$1"
+            then
+                [ -f "$1" ] || echo_fatal "file invalid for --UE"
+                conf_nvram_path=$(readlink -f "$1")
+                shift 1
+            fi;;
+        --UE-OUTPUT)
+            gen_nvram_path=$(readlink -f $2)
+            shift 2;;
        --RRH)
             RRH=1
             echo_info "Will compile RRH"
@@ -507,20 +520,12 @@ function main() {
     
     cmake ..
     compilations \
-      nas_sim_tools usim \
-      usim $dbin/usim
-    compilations \
-      nas_sim_tools nvram \
-      nvram $dbin/nvram
+        nas_sim_tools conf2uedata \
+        conf2uedata $dbin/conf2uedata
 
     # generate USIM data
-    if [ -f $dbin/nvram ]; then
-      install_nas_tools $dbin $dconf
-      echo_info "Copying UE specific part to $DIR/$lte_build_dir/build"
-      cp -Rvf $dbin/.ue_emm.nvram $DIR/$lte_build_dir/build
-      cp -Rvf $dbin/.ue.nvram $DIR/$lte_build_dir/build
-      cp -Rvf $dbin/.usim.nvram $DIR/$lte_build_dir/build
-
+    if [ -f $dbin/conf2uedata ]; then
+      install_nas_tools $conf_nvram_path $gen_nvram_path
     else
       echo_warning "not generated UE NAS files: binaries not found"
     fi
@@ -637,15 +642,12 @@ function main() {
 	cd $DIR/nas_sim_tools/build
 	cmake ..
 	compilations \
-	    nas_sim_tools usim \
-	    usim $dbin/usim
-	compilations \
-	    nas_sim_tools nvram \
-	    nvram $dbin/nvram
+        nas_sim_tools conf2uedata \
+        conf2uedata $dbin/conf2uedata
 
 	# generate USIM data
-	if [ -f $dbin/nvram ]; then
-	    install_nas_tools $dbin $dconf
+	if [ -f $dbin/conf2uedata ]; then
+	    install_nas_tools $conf_nvram_path $gen_nvram_path
 	else
 	    echo_warning "not generated UE NAS files: binaries not found"
 	fi
diff --git a/cmake_targets/nas_sim_tools/CMakeLists.txt b/cmake_targets/nas_sim_tools/CMakeLists.txt
index 897e4a17735fa35187cff519a4d320e11ca3c3e4..123b274714b882f04ed416b79801d88b42bad0b3 100644
--- a/cmake_targets/nas_sim_tools/CMakeLists.txt
+++ b/cmake_targets/nas_sim_tools/CMakeLists.txt
@@ -2,25 +2,21 @@ cmake_minimum_required(VERSION 2.8)
 
 project(NAS_SIM_TOOLS)
 
+include(FindPkgConfig)
+pkg_search_module(CONFIG libconfig REQUIRED)
+include_directories(${CONFIG_INCLUDE_DIRS})
+add_definitions(-std=gnu99)
 
 ENABLE_LANGUAGE(C)
-#Sends the -std=c99 flag to the gcc compiler
-add_definitions(-std=c99)
-add_definitions(-DNAS_UE)
+
+set(CMAKE_C_FLAGS
+  "${CMAKE_C_FLAGS} ${C_FLAGS_PROCESSOR} -Werror -Wall -Wstrict-prototypes -Wno-packed-bitfield-compat")
 
 set(OPENAIR_DIR     $ENV{OPENAIR_DIR})
-set(OPENAIR1_DIR    $ENV{OPENAIR_DIR}/openair1)
-set(OPENAIR2_DIR    $ENV{OPENAIR_DIR}/openair2)
 set(OPENAIR3_DIR    $ENV{OPENAIR_DIR}/openair3)
-set(OPENAIR3_DIR   $ENV{OPENAIR_DIR}/openair3)
-set(OPENAIR_TARGETS $ENV{OPENAIR_DIR}/targets)
-
-#set(EXECUTABLE_OUTPUT_PATH ${OPENAIR_DIR}/targets/bin)
-
 
-# Add .h files for dependancies
-set(usim_SRC
-    ${OPENAIR_DIR}/openair3/NAS/TOOLS/usim_data.c
+set(conf2uedata_SRC
+    ${OPENAIR_DIR}/openair3/NAS/TOOLS/conf2uedata.c
     ${OPENAIR_DIR}/openair3/NAS/UE/API/USIM/usim_api.c
     ${OPENAIR_DIR}/openair3/NAS/UE/API/USIM/aka_functions.c
     ${OPENAIR_DIR}/openair3/NAS/COMMON/UTIL/memory.c
@@ -29,8 +25,9 @@ set(usim_SRC
     ${OPENAIR_DIR}/openair3/NAS/COMMON/UTIL/TLVEncoder.c
     ${OPENAIR_DIR}/common/utils/utils.c
 )
-set(usim_HDR
-    ${OPENAIR_DIR}/openair3/NAS/TOOLS/network.h
+
+set(conf2uedata_HDR
+    ${OPENAIR_DIR}/openair3/NAS/TOOLS/conf2uedata.h
     ${OPENAIR_DIR}/openair3/NAS/UE/API/USIM/usim_api.h
     ${OPENAIR_DIR}/openair3/NAS/UE/API/USIM/aka_functions.h
     ${OPENAIR_DIR}/openair3/NAS/COMMON/UTIL/memory.h
@@ -39,37 +36,18 @@ set(usim_HDR
     ${OPENAIR_DIR}/openair3/NAS/COMMON/UTIL/TLVEncoder.h
     ${OPENAIR_DIR}/common/utils/utils.h
 )
+
 include_directories(
     ${OPENAIR_DIR}/common/utils
     ${OPENAIR_DIR}/openair3/NAS/UE
     ${OPENAIR_DIR}/openair3/NAS/COMMON
+    ${OPENAIR_DIR}/openair3/NAS/UE/API/USER
     ${OPENAIR_DIR}/openair3/NAS/UE/API/USIM
     ${OPENAIR_DIR}/openair3/NAS/UE/EMM/
     ${OPENAIR_DIR}/openair3/NAS/UE/ESM/
     ${OPENAIR_DIR}/openair3/NAS/COMMON/IES/
     ${OPENAIR_DIR}/openair3/NAS/COMMON/UTIL
 )
-ADD_EXECUTABLE(usim  ${usim_SRC} ${usim_HDR})
-
-
-
-
-set(nvram_SRC
-    ${OPENAIR_DIR}/openair3/NAS/TOOLS/ue_data.c
-    ${OPENAIR_DIR}/openair3/NAS/COMMON/UTIL/memory.c
-    ${OPENAIR_DIR}/openair3/NAS/COMMON/UTIL/nas_log.c
-)
-
-set(nvram_HDR
-    ${OPENAIR_DIR}/openair3/NAS/UE/EMM/emmData.h
-    ${OPENAIR_DIR}/openair3/NAS/COMMON/UTIL/memory.h
-    ${OPENAIR_DIR}/openair3/NAS/COMMON/userDef.h
-)
-
-ADD_EXECUTABLE(nvram  ${nvram_SRC} ${nvram_HDR})
-
-#install (TARGETS usim  DESTINATION ${EXECUTABLE_OUTPUT_PATH})
-#install (TARGETS nvram DESTINATION ${EXECUTABLE_OUTPUT_PATH})
 
-#install(CODE "EXECUTE_PROCESS (COMMAND ${OPENAIR_TARGETS}/bin/nvram --gen WORKING_DIRECTORY ${OPENAIR_TARGETS}/bin)")
-#install(CODE "EXECUTE_PROCESS (COMMAND ${OPENAIR_TARGETS}/bin/usim  --gen WORKING_DIRECTORY ${OPENAIR_TARGETS}/bin)")
+ADD_EXECUTABLE(conf2uedata  ${conf2uedata_SRC} ${conf2uedata_HDR})
+target_link_libraries(conf2uedata ${CONFIG_LIBRARIES})
diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper
index 448d54f334db51dd3ce702312e94e90ca66f201e..8a9d64b6d84de90946c281060286373a47030467 100755
--- a/cmake_targets/tools/build_helper
+++ b/cmake_targets/tools/build_helper
@@ -450,24 +450,13 @@ install_asn1c_from_source(){
 ################################################
 
 install_nas_tools() {
-  cd $1
-  if [ ! -f .ue.nvram ]; then
-    echo_success "generate .ue_emm.nvram .ue.nvram"
-    ./nvram --gen
-  else
-    [ ./nvram -nt .ue.nvram  -o ./nvram -nt .ue_emm.nvram ] && ./nvram --gen
-  fi
-
-  if [ ! -f .usim.nvram ]; then
-    echo_success "generate .usim.nvram"
-    ./usim --gen
-  else
-    [ ./usim -nt .usim.nvram ] && ./usim --gen
+  if [ ! -f $2/§.ue.nvram -o ! -f $2/.usim.nvram ]; then
+    cd $OPENAIR_DIR/targets/bin
+    ./conf2uedata -c $1 -o $2
+    echo_success "$1 $2"
   fi
-
 }
 
-
 ################################
 # set_openair_env
 ###############################
diff --git a/openair3/NAS/COMMON/UTIL/memory.c b/openair3/NAS/COMMON/UTIL/memory.c
index df94d40cfcc7a89d9d1c343e184c8e87b798d775..3b3b6e7f9e1d47caf3e5a2f4736a38eb9f8a1e4b 100644
--- a/openair3/NAS/COMMON/UTIL/memory.c
+++ b/openair3/NAS/COMMON/UTIL/memory.c
@@ -103,6 +103,30 @@ char* memory_get_path(const char* dirname, const char* filename)
   return data_filename;
 }
 
+char* memory_get_path_from_ueid(const char* dirname, const char* filename, int ueid)
+{
+  /* Get non-volatile data directory */
+  const char* path = getenv(dirname);
+  char buffer[2048];
+
+  if (path == NULL) {
+    path = getenv(DEFAULT_NAS_PATH);
+  }
+
+  if (path == NULL) {
+    LOG_TRACE(WARNING, "MEMORY  - %s and %s environment variables are not defined trying local directory", dirname, DEFAULT_NAS_PATH);
+    path = ".";
+  }
+
+  /* Append non-volatile data file name */
+  if ( snprintf(buffer, sizeof(buffer), "%s/%s%d", path, filename, ueid) < 0 ) {
+    return NULL;
+  }
+
+  return strdup(buffer);
+}
+
+
 /****************************************************************************
  **                                                                        **
  ** Name:  memory_read()                                             **
diff --git a/openair3/NAS/COMMON/UTIL/memory.h b/openair3/NAS/COMMON/UTIL/memory.h
index f41f4d586b51b9aaf32df5031700cbb423ba51c9..f7f0733044b50163c262036e5cc0abd9cc85fdc6 100644
--- a/openair3/NAS/COMMON/UTIL/memory.h
+++ b/openair3/NAS/COMMON/UTIL/memory.h
@@ -58,6 +58,8 @@ Description Memory access utilities
 
 char* memory_get_path(const char* dirname, const char* filename);
 
+char* memory_get_path_from_ueid(const char* dirname, const char* filename, int ueid);
+
 int memory_read(const char* datafile, void* data, size_t size);
 
 int memory_write(const char* datafile, const void* data, size_t size);
diff --git a/openair3/NAS/TOOLS/Makefile b/openair3/NAS/TOOLS/Makefile
deleted file mode 100644
index ca2e884c1110f9d3fa6e53e0e9df0fd0f2bfb509..0000000000000000000000000000000000000000
--- a/openair3/NAS/TOOLS/Makefile
+++ /dev/null
@@ -1,79 +0,0 @@
-#/*
-# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
-# * contributor license agreements.  See the NOTICE file distributed with
-# * this work for additional information regarding copyright ownership.
-# * The OpenAirInterface Software Alliance licenses this file to You under
-# * the OAI Public License, Version 1.0  (the "License"); you may not use this file
-# * except in compliance with the License.
-# * You may obtain a copy of the License at
-# *
-# *      http://www.openairinterface.org/?page_id=698
-# *
-# * Unless required by applicable law or agreed to in writing, software
-# * distributed under the License is distributed on an "AS IS" BASIS,
-# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# * See the License for the specific language governing permissions and
-# * limitations under the License.
-# *-------------------------------------------------------------------------------
-# * For more information about the OpenAirInterface (OAI) Software Alliance:
-# *      contact@openairinterface.org
-# */
-
-export PROCESS = UE
-
-ifndef PROJDIR
-PROJDIR = $(PWD)/..
-endif
-
-include $(PROJDIR)/Makerules
-include $(PROJDIR)/Makefile.inc
-include $(PROJDIR)/../Makefile.tools
-
-export LD_RUN_PATH = $(LIBDIR):$(LIBPROCESS)
-
-LIBS		= -luenas.a -lrt 
-INCLUDES	= -I. -I$(INCDIR) -I$(UTILDIR) -I$(USIMAPIDIR) -I$(EMMDIR) -I$(ESMDIR) -I$(IESDIR)
-
-#LIBSUTIL	= $(LIBDIR)/$(LIBUTIL).a $(LIBDIR)/$(LIBUTIL).so
-
-USIM_OBJ	= usim_data.o
-UE_OBJ		= ue_data.o
-
-USIM_TARGET	= usim_data
-UE_TARGET	= ue_data
-
-TARGETS = $(USIM_TARGET) $(UE_TARGET)
-
-all: $(TARGETS)
-
-#-DIMSI_USA_MNC_3DIGITS
-%.o: %.c Makefile
-	$(CC) $(CFLAGS)   -c $< -o $@
-
-$(USIM_TARGET): $(USIM_OBJ) $(LIBSUTIL)
-	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)  -lnettle -lcrypto -lm
-	@echo Replacing $@ to $(BINDIR)
-	@$(RM) $(BINDIR)/$@
-	@$(CP) $@ $(BINDIR)
-
-$(UE_TARGET): $(UE_OBJ) $(LIBSUTIL)
-	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)  -lnettle -lcrypto -lm
-	@echo Replacing $@ to $(BINDIR)
-	@$(RM) $(BINDIR)/$@
-	@$(CP) $@ $(BINDIR)
-
-clean:
-	$(RM) $(OBJS) *.bak *~
-
-veryclean: clean
-	$(RM) $(TARGETS)
-
-veryveryclean: veryclean
-	$(RM) -Rf *.o $(PROJDIR)
-	$(RM) -Rf *.a $(PROJDIR)
-
-depend:
-	makedepend -- ${CFLAGS} -- ${SRCS}
-
-# DO NOT DELETE THIS LINE -- make depend depends on it.
-
diff --git a/openair3/NAS/TOOLS/conf2uedata.c b/openair3/NAS/TOOLS/conf2uedata.c
new file mode 100644
index 0000000000000000000000000000000000000000..a5aaf9ccb047940079efc4fca19b96c861b12fa6
--- /dev/null
+++ b/openair3/NAS/TOOLS/conf2uedata.c
@@ -0,0 +1,1146 @@
+#include <stdio.h>  // perror, printf, fprintf, snprintf
+#include <stdlib.h> // exit, free
+#include <string.h> // memset, strncpy
+
+#include "conf2uedata.h"
+#include "user_api.h"
+#include "utils.h"
+
+char * make_filename(const char *output_dir, const char *filename, int ueid);
+
+int main(int argc, char**argv) {
+	int rc = EXIT_SUCCESS;
+	int option;
+	while ((option = getopt(argc, argv, options)) != -1) {
+		switch (option) {
+		case 'c':
+			parse_data = TRUE;
+			conf_file = optarg;
+			break;
+		case 'o':
+			output_dir = optarg;
+			output = TRUE;
+			break;
+		case 'h':
+			_display_usage();
+			return EXIT_SUCCESS;
+			break;
+		default:
+			break;
+		}
+	}
+	if (output == FALSE && parse_data == TRUE) {
+		printf("No output option found\n");
+		_display_usage();
+		return EXIT_FAILURE;
+	} else if (output == TRUE && parse_data == FALSE) {
+		printf("No Configuration file is given\n");
+		_display_usage();
+		return EXIT_FAILURE;
+	} else if (parse_data == FALSE && print_data == FALSE) {
+		printf("No options found\n");
+		_display_usage();
+		return EXIT_FAILURE;
+	} else if (parse_data) {
+		int ue_nb = 0;
+		config_t cfg;
+		config_setting_t *root_setting = NULL;
+		config_setting_t *ue_setting = NULL;
+		config_setting_t *all_plmn_setting = NULL;
+		char user[10];
+		config_init(&cfg);
+		if (conf_file != NULL) {
+			/* Read the file. If there is an error, report it and exit. */
+			if (!config_read_file(&cfg, conf_file)) {
+				fprintf(stderr, "%s:%d - %s\n", config_error_file(&cfg),
+						config_error_line(&cfg), config_error_text(&cfg));
+				config_destroy(&cfg);
+				return (EXIT_FAILURE);
+			}
+		} else {
+			config_destroy(&cfg);
+			perror("ERROR\t: config_read failed");
+			exit(EXIT_FAILURE);
+		}
+		root_setting = config_root_setting(&cfg);
+		ue_nb = config_setting_length(root_setting) - 1;
+		all_plmn_setting = config_setting_get_member(root_setting, PLMN);
+		if (all_plmn_setting != NULL) {
+			rc = parse_plmns(all_plmn_setting);
+			if (rc == EXIT_FAILURE) {
+				return rc;
+			}
+			fill_network_record_list();
+			for (int i = 0; i < ue_nb; i++) {
+				sprintf(user, "%s%d", UE, i);
+				ue_setting = config_setting_get_member(root_setting, user);
+				if (ue_setting != NULL) {
+					rc = parse_ue_user_param(ue_setting, i);
+					if (rc != EXIT_SUCCESS) {
+						printf("Problem in USER section for UE%d. EXITING...\n",
+								i);
+						return EXIT_FAILURE;
+					}
+					_display_ue_data(i);
+					rc = parse_ue_sim_param(ue_setting, i);
+					if (rc != EXIT_SUCCESS) {
+						printf("Problem in SIM section for UE%d. EXITING...\n",
+								i);
+						return EXIT_FAILURE;
+					}
+					rc = parse_ue_plmn_param(ue_setting, i);
+					if (rc != EXIT_SUCCESS) {
+						return EXIT_FAILURE;
+					}
+					gen_emm_data(i);
+					_display_emm_data(i);
+					gen_usim_data(i);
+					_display_usim_data(i);
+				} else {
+					printf("Check UE%d settings\n", i);
+					return EXIT_FAILURE;
+				}
+			}
+			config_destroy(&cfg);
+
+		} else {
+			printf("NO PLMN SECTION...EXITING...\n");
+			return (EXIT_FAILURE);
+		}
+	}
+	exit(EXIT_SUCCESS);
+
+}
+
+void gen_usim_data(int user_id) {
+	usim_data_t usim_data = { };
+	memset(&usim_data, 0, sizeof(usim_data_t));
+	usim_data.imsi.length = 8;
+	usim_data.imsi.u.num.parity = get_msin_parity(msin);
+
+	usim_data.imsi.u.num.digit1 = user_plmn_list[hplmn_index].mcc[0];
+	usim_data.imsi.u.num.digit2 = user_plmn_list[hplmn_index].mcc[1];
+	usim_data.imsi.u.num.digit3 = user_plmn_list[hplmn_index].mcc[2];
+
+	usim_data.imsi.u.num.digit4 = user_plmn_list[hplmn_index].mnc[0];
+	usim_data.imsi.u.num.digit5 = user_plmn_list[hplmn_index].mnc[1];
+
+	if (strlen(user_plmn_list[hplmn_index].mnc) == 2) {
+		usim_data.imsi.u.num.digit6 = msin[0];
+		usim_data.imsi.u.num.digit7 = msin[1];
+		usim_data.imsi.u.num.digit8 = msin[2];
+		usim_data.imsi.u.num.digit9 = msin[3];
+		usim_data.imsi.u.num.digit10 = msin[4];
+		usim_data.imsi.u.num.digit11 = msin[5];
+		usim_data.imsi.u.num.digit12 = msin[6];
+		usim_data.imsi.u.num.digit13 = msin[7];
+		usim_data.imsi.u.num.digit14 = msin[8];
+		usim_data.imsi.u.num.digit15 = msin[9];
+	} else {
+		usim_data.imsi.u.num.digit6 = user_plmn_list[hplmn_index].mnc[2];
+		usim_data.imsi.u.num.digit7 = msin[0];
+		usim_data.imsi.u.num.digit8 = msin[1];
+		usim_data.imsi.u.num.digit9 = msin[2];
+		usim_data.imsi.u.num.digit10 = msin[3];
+		usim_data.imsi.u.num.digit11 = msin[4];
+		usim_data.imsi.u.num.digit12 = msin[5];
+		usim_data.imsi.u.num.digit13 = msin[6];
+		usim_data.imsi.u.num.digit14 = msin[7];
+		usim_data.imsi.u.num.digit15 = msin[8];
+	}
+
+	/*
+	 * Ciphering and Integrity Keys
+	 */
+	usim_data.keys.ksi = KSI;
+	memset(&usim_data.keys.ck, 0, USIM_CK_SIZE);
+	memset(&usim_data.keys.ik, 0, USIM_IK_SIZE);
+	/*
+	 * Higher Priority PLMN search period
+	 */
+	usim_data.hpplmn = 0x00; /* Disable timer */
+
+	/*
+	 * List of Forbidden PLMNs
+	 */
+	for (int i = 0; i < USIM_FPLMN_MAX; i++) {
+		memset(&usim_data.fplmn[i], 0xff, sizeof(plmn_t));
+	}
+	if (fplmn_nb > 0) {
+		for (int i = 0; i < fplmn_nb; i++) {
+			usim_data.fplmn[i] = user_network_record_list[fplmn[i]].plmn;
+		}
+	}
+
+	/*
+	 * Location Information
+	 */
+	usim_data.loci.tmsi = DEFAULT_TMSI;
+	usim_data.loci.lai.plmn = user_network_record_list[hplmn_index].plmn;
+	usim_data.loci.lai.lac = DEFAULT_LAC;
+	usim_data.loci.status = USIM_LOCI_NOT_UPDATED;
+	/*
+	 * Packet Switched Location Information
+	 */
+	usim_data.psloci.p_tmsi = DEFAULT_P_TMSI;
+	usim_data.psloci.signature[0] = 0x01;
+	usim_data.psloci.signature[1] = 0x02;
+	usim_data.psloci.signature[2] = 0x03;
+	usim_data.psloci.rai.plmn = user_network_record_list[hplmn_index].plmn;
+	usim_data.psloci.rai.lac = DEFAULT_LAC;
+	usim_data.psloci.rai.rac = DEFAULT_RAC;
+	usim_data.psloci.status = USIM_PSLOCI_NOT_UPDATED;
+	/*
+	 * Administrative Data
+	 */
+	usim_data.ad.UE_Operation_Mode = USIM_NORMAL_MODE;
+	usim_data.ad.Additional_Info = 0xffff;
+	usim_data.ad.MNC_Length = strlen(user_plmn_list[hplmn_index].mnc);
+	/*
+	 * EPS NAS security context
+	 */
+	usim_data.securityctx.length = 52;
+	usim_data.securityctx.KSIasme.type = USIM_KSI_ASME_TAG;
+	usim_data.securityctx.KSIasme.length = 1;
+	usim_data.securityctx.KSIasme.value[0] = KSI_ASME;
+	usim_data.securityctx.Kasme.type = USIM_K_ASME_TAG;
+	usim_data.securityctx.Kasme.length = USIM_K_ASME_SIZE;
+	memset(usim_data.securityctx.Kasme.value, 0,
+			usim_data.securityctx.Kasme.length);
+	usim_data.securityctx.ulNAScount.type = USIM_UL_NAS_COUNT_TAG;
+	usim_data.securityctx.ulNAScount.length = USIM_UL_NAS_COUNT_SIZE;
+	memset(usim_data.securityctx.ulNAScount.value, 0,
+			usim_data.securityctx.ulNAScount.length);
+	usim_data.securityctx.dlNAScount.type = USIM_DL_NAS_COUNT_TAG;
+	usim_data.securityctx.dlNAScount.length = USIM_DL_NAS_COUNT_SIZE;
+	memset(usim_data.securityctx.dlNAScount.value, 0,
+			usim_data.securityctx.dlNAScount.length);
+	usim_data.securityctx.algorithmID.type = USIM_INT_ENC_ALGORITHMS_TAG;
+	usim_data.securityctx.algorithmID.length = 1;
+	usim_data.securityctx.algorithmID.value[0] = SECURITY_ALGORITHMS;
+	/*
+	 * Subcriber's Number
+	 */
+	usim_data.msisdn.length = 7;
+	usim_data.msisdn.number.ext = 1;
+	usim_data.msisdn.number.ton = MSISDN_TON_UNKNOWKN;
+	usim_data.msisdn.number.npi = MSISDN_NPI_ISDN_TELEPHONY;
+	usim_data.msisdn.conf1_record_id = 0xff; /* Not used */
+	usim_data.msisdn.ext1_record_id = 0xff; /* Not used */
+	int j = 0;
+	for (int i = 0; i < strlen(msisdn); i += 2) {
+		usim_data.msisdn.number.digit[j].msb = msisdn[i];
+		j++;
+	}
+	j = 0;
+	for (int i = 1; i < strlen(msisdn); i += 2) {
+		usim_data.msisdn.number.digit[j].lsb = msisdn[i];
+		j++;
+
+	}
+	if (strlen(msisdn) % 2 == 0) {
+		for (int i = strlen(msisdn) / 2; i < 10; i++) {
+			usim_data.msisdn.number.digit[i].msb = 0xf;
+			usim_data.msisdn.number.digit[i].lsb = 0xf;
+		}
+	} else {
+		usim_data.msisdn.number.digit[strlen(msisdn) / 2].lsb = 0xf;
+		for (int i = (strlen(msisdn) / 2) + 1; i < 10; i++) {
+			usim_data.msisdn.number.digit[i].msb = 0xf;
+			usim_data.msisdn.number.digit[i].lsb = 0xf;
+		}
+	}
+	/*
+	 * PLMN Network Name and Operator PLMN List
+	 */
+	for (int i = 0; i < oplmn_nb; i++) {
+		network_record_t record = user_network_record_list[oplmn[i]];
+		usim_data.pnn[i].fullname.type = USIM_PNN_FULLNAME_TAG;
+		usim_data.pnn[i].fullname.length = strlen(record.fullname);
+		strncpy((char*) usim_data.pnn[i].fullname.value, record.fullname,
+				usim_data.pnn[i].fullname.length);
+		usim_data.pnn[i].shortname.type = USIM_PNN_SHORTNAME_TAG;
+		usim_data.pnn[i].shortname.length = strlen(record.shortname);
+		strncpy((char*) usim_data.pnn[i].shortname.value, record.shortname,
+				usim_data.pnn[i].shortname.length);
+		usim_data.opl[i].plmn = record.plmn;
+		usim_data.opl[i].start = record.tac_start;
+		usim_data.opl[i].end = record.tac_end;
+		usim_data.opl[i].record_id = i;
+	}
+	if (oplmn_nb < USIM_OPL_MAX) {
+		for (int i = oplmn_nb; i < USIM_OPL_MAX; i++) {
+			memset(&usim_data.opl[i].plmn, 0xff, sizeof(plmn_t));
+		}
+	}
+
+	/*
+	 * List of Equivalent HPLMNs
+	 */
+	for (int i = 0; i < ehplmn_nb; i++) {
+		usim_data.ehplmn[i] = user_network_record_list[ehplmn[i]].plmn;
+	}
+	if (ehplmn_nb < USIM_EHPLMN_MAX) {
+		for (int i = ehplmn_nb; i < USIM_EHPLMN_MAX; i++) {
+			memset(&usim_data.ehplmn[i], 0xff, sizeof(plmn_t));
+		}
+	}
+	/*
+	 * Home PLMN Selector with Access Technology
+	 */
+	usim_data.hplmn.plmn = user_network_record_list[hplmn_index].plmn;
+	usim_data.hplmn.AcT = (USIM_ACT_GSM | USIM_ACT_UTRAN | USIM_ACT_EUTRAN);
+
+	/*
+	 * List of user controlled PLMN selector with Access Technology
+	 */
+	for (int i = 0; i < USIM_PLMN_MAX; i++) {
+		memset(&usim_data.plmn[i], 0xff, sizeof(plmn_t));
+	}
+	if (ucplmn_nb > 0) {
+		for (int i = 0; i < ucplmn_nb; i++) {
+			usim_data.plmn[i].plmn = user_network_record_list[ucplmn[i]].plmn;
+		}
+	}
+
+	// List of operator controlled PLMN selector with Access Technology
+
+	for (int i = 0; i < USIM_OPLMN_MAX; i++) {
+		memset(&usim_data.oplmn[i], 0xff, sizeof(plmn_t));
+	}
+	if (ocplmn_nb > 0) {
+		for (int i = 0; i < ocplmn_nb; i++) {
+			usim_data.oplmn[i].plmn = user_network_record_list[ocplmn[i]].plmn;
+			usim_data.oplmn[i].AcT = (USIM_ACT_GSM | USIM_ACT_UTRAN
+					| USIM_ACT_EUTRAN);
+		}
+	}
+	/*
+	 * EPS Location Information
+	 */
+	usim_data.epsloci.guti.gummei.plmn =
+			user_network_record_list[hplmn_index].plmn;
+	usim_data.epsloci.guti.gummei.MMEgid = DEFAULT_MME_ID;
+	usim_data.epsloci.guti.gummei.MMEcode = DEFAULT_MME_CODE;
+	usim_data.epsloci.guti.m_tmsi = DEFAULT_M_TMSI;
+	usim_data.epsloci.tai.plmn = usim_data.epsloci.guti.gummei.plmn;
+	usim_data.epsloci.tai.tac = DEFAULT_TAC;
+	usim_data.epsloci.status = USIM_EPSLOCI_UPDATED;
+	/*
+	 * Non-Access Stratum configuration
+	 */
+	usim_data.nasconfig.NAS_SignallingPriority.type =
+	USIM_NAS_SIGNALLING_PRIORITY_TAG;
+	usim_data.nasconfig.NAS_SignallingPriority.length = 1;
+	usim_data.nasconfig.NAS_SignallingPriority.value[0] = 0x00;
+	usim_data.nasconfig.NMO_I_Behaviour.type = USIM_NMO_I_BEHAVIOUR_TAG;
+	usim_data.nasconfig.NMO_I_Behaviour.length = 1;
+	usim_data.nasconfig.NMO_I_Behaviour.value[0] = 0x00;
+	usim_data.nasconfig.AttachWithImsi.type = USIM_ATTACH_WITH_IMSI_TAG;
+	usim_data.nasconfig.AttachWithImsi.length = 1;
+#if defined(START_WITH_GUTI)
+	usim_data.nasconfig.AttachWithImsi.value[0] = 0x00;
+#else
+	usim_data.nasconfig.AttachWithImsi.value[0] = 0x01;
+#endif
+	usim_data.nasconfig.MinimumPeriodicSearchTimer.type =
+	USIM_MINIMUM_PERIODIC_SEARCH_TIMER_TAG;
+	usim_data.nasconfig.MinimumPeriodicSearchTimer.length = 1;
+	usim_data.nasconfig.MinimumPeriodicSearchTimer.value[0] = 0x00;
+	usim_data.nasconfig.ExtendedAccessBarring.type =
+	USIM_EXTENDED_ACCESS_BARRING_TAG;
+	usim_data.nasconfig.ExtendedAccessBarring.length = 1;
+	usim_data.nasconfig.ExtendedAccessBarring.value[0] = 0x00;
+	usim_data.nasconfig.Timer_T3245_Behaviour.type =
+	USIM_TIMER_T3245_BEHAVIOUR_TAG;
+	usim_data.nasconfig.Timer_T3245_Behaviour.length = 1;
+	usim_data.nasconfig.Timer_T3245_Behaviour.value[0] = 0x00;
+
+	/* initialize the subscriber authentication security key */
+	hex_string_to_hex_value(usim_data.keys.usim_api_k,
+			usim_api_k, USIM_API_K_SIZE);
+	hex_string_to_hex_value(usim_data.keys.opc, opc,
+	OPC_SIZE);
+
+    char *path = make_filename(output_dir, USIM_API_NVRAM_FILENAME, user_id);
+    usim_api_write(path, &usim_data);
+    free(path);
+}
+void gen_emm_data(int user_id) {
+	hplmn_index = get_plmn_index(hplmn);
+	emm_nvdata_t emm_data;
+	int rc;
+	memset(&emm_data, 0, sizeof(emm_nvdata_t));
+	int hplmn_index = get_plmn_index(hplmn);
+	emm_data.imsi.length = 8;
+	emm_data.imsi.u.num.parity = get_msin_parity(msin);
+	emm_data.imsi.u.num.digit1 = user_plmn_list[hplmn_index].mcc[0];
+	emm_data.imsi.u.num.digit2 = user_plmn_list[hplmn_index].mcc[1];
+	emm_data.imsi.u.num.digit3 = user_plmn_list[hplmn_index].mcc[2];
+
+	emm_data.imsi.u.num.digit4 = user_plmn_list[hplmn_index].mnc[0];
+	emm_data.imsi.u.num.digit5 = user_plmn_list[hplmn_index].mnc[1];
+
+	if (strlen(user_plmn_list[hplmn_index].mnc) == 3) {
+		emm_data.rplmn.MNCdigit3 = user_plmn_list[hplmn_index].mnc[2];
+
+		emm_data.imsi.u.num.digit6 = user_plmn_list[hplmn_index].mnc[2];
+		emm_data.imsi.u.num.digit7 = msin[0];
+		emm_data.imsi.u.num.digit8 = msin[1];
+		emm_data.imsi.u.num.digit9 = msin[2];
+		emm_data.imsi.u.num.digit10 = msin[3];
+		emm_data.imsi.u.num.digit11 = msin[4];
+		emm_data.imsi.u.num.digit12 = msin[5];
+		emm_data.imsi.u.num.digit13 = msin[6];
+		emm_data.imsi.u.num.digit14 = msin[7];
+		emm_data.imsi.u.num.digit15 = msin[8];
+
+	} else {
+		emm_data.rplmn.MNCdigit3 = 0xf;
+
+		emm_data.imsi.u.num.digit6 = msin[0];
+		emm_data.imsi.u.num.digit7 = msin[1];
+		emm_data.imsi.u.num.digit8 = msin[2];
+		emm_data.imsi.u.num.digit9 = msin[3];
+		emm_data.imsi.u.num.digit10 = msin[4];
+		emm_data.imsi.u.num.digit11 = msin[5];
+		emm_data.imsi.u.num.digit12 = msin[6];
+		emm_data.imsi.u.num.digit13 = msin[7];
+		emm_data.imsi.u.num.digit14 = msin[8];
+		emm_data.imsi.u.num.digit15 = msin[9];
+
+	}
+
+	emm_data.rplmn.MCCdigit1 = user_plmn_list[hplmn_index].mcc[0];
+	emm_data.rplmn.MCCdigit2 = user_plmn_list[hplmn_index].mcc[1];
+	emm_data.rplmn.MCCdigit3 = user_plmn_list[hplmn_index].mcc[2];
+	emm_data.rplmn.MNCdigit1 = user_plmn_list[hplmn_index].mnc[0];
+	emm_data.rplmn.MNCdigit2 = user_plmn_list[hplmn_index].mnc[1];
+
+	emm_data.eplmn.n_plmns = ehplmn_nb;
+
+	char* path = make_filename(output_dir, EMM_NVRAM_FILENAME, user_id);
+	rc = memory_write(path, &emm_data, sizeof(emm_nvdata_t));
+	free(path);
+	if (rc != RETURNok) {
+		perror("ERROR\t: memory_write() failed");
+		exit(EXIT_FAILURE);
+	}
+
+}
+
+int parse_plmn_param(config_setting_t *plmn_setting, int index) {
+	int rc = 0;
+	rc = config_setting_lookup_string(plmn_setting,
+	FULLNAME, &user_plmn_list[index].fullname);
+	if (rc != 1) {
+		printf("Check PLMN%d FULLNAME. Exiting\n", index);
+		return EXIT_FAILURE;
+	}
+	rc = config_setting_lookup_string(plmn_setting,
+	SHORTNAME, &user_plmn_list[index].shortname);
+	if (rc != 1) {
+		printf("Check PLMN%d SHORTNAME. Exiting\n", index);
+		return EXIT_FAILURE;
+	}
+	rc = config_setting_lookup_string(plmn_setting,
+	MNC, &user_plmn_list[index].mnc);
+	if (rc != 1 || strlen(user_plmn_list[index].mnc) > 3
+			|| strlen(user_plmn_list[index].mnc) < 2) {
+		printf("Check PLMN%d MNC. Exiting\n", index);
+		return EXIT_FAILURE;
+	}
+	rc = config_setting_lookup_string(plmn_setting,
+	MCC, &user_plmn_list[index].mcc);
+	if (rc != 1 || strlen(user_plmn_list[index].mcc) != 3) {
+		printf("Check PLMN%d MCC. Exiting\n", index);
+		return EXIT_FAILURE;
+	}
+	return EXIT_SUCCESS;
+}
+
+int parse_plmns(config_setting_t *all_plmn_setting) {
+	config_setting_t *plmn_setting = NULL;
+	char plmn[10];
+	int rc = EXIT_SUCCESS;
+	plmn_nb = config_setting_length(all_plmn_setting);
+	user_plmn_list = malloc(sizeof(plmn_conf_param_t) * plmn_nb);
+	user_network_record_list = malloc(sizeof(network_record_t) * plmn_nb);
+	for (int i = 0; i < plmn_nb; i++) {
+		memset(&user_network_record_list[i], 0xff, sizeof(network_record_t));
+		memset(&user_plmn_list[i], 0xff, sizeof(plmn_conf_param_t));
+	}
+	for (int i = 0; i < plmn_nb; i++) {
+		sprintf(plmn, "%s%d", PLMN, i);
+		plmn_setting = config_setting_get_member(all_plmn_setting, plmn);
+		if (plmn_setting != NULL) {
+			rc = parse_plmn_param(plmn_setting, i);
+			if (rc == EXIT_FAILURE) {
+				return rc;
+			}
+		} else {
+			printf("Problem in PLMN%d. Exiting...\n", i);
+			return EXIT_FAILURE;
+		}
+	}
+	return rc;
+}
+
+int parse_ue_plmn_param(config_setting_t *ue_setting, int user_id) {
+	int rc = EXIT_SUCCESS;
+	config_setting_t *setting = NULL;
+	rc = config_setting_lookup_string(ue_setting, HPLMN, &hplmn);
+	if (rc != 1) {
+		printf("Check HPLMN section for UE%d. Exiting\n", user_id);
+		return EXIT_FAILURE;
+	} else if (get_plmn_index(hplmn) == -1) {
+		printf("HPLMN for UE%d is not defined in PLMN section. Exiting\n",
+				user_id);
+		return EXIT_FAILURE;
+	}
+	setting = config_setting_get_member(ue_setting, UCPLMN);
+	if (setting == NULL) {
+		printf("Check UCPLMN section for UE%d. Exiting\n", user_id);
+		return EXIT_FAILURE;
+	}
+	rc = fill_ucplmn(setting, user_id);
+	if (rc != EXIT_SUCCESS) {
+		printf("Check UCPLMN section for UE%d. Exiting\n", user_id);
+		return EXIT_FAILURE;
+	}
+	setting = config_setting_get_member(ue_setting, OPLMN);
+	if (setting == NULL) {
+		printf("Check OPLMN section for UE%d. Exiting\n", user_id);
+		return EXIT_FAILURE;
+	}
+	rc = fill_oplmn(setting, user_id);
+	if (rc != EXIT_SUCCESS) {
+		printf("Check OPLMN section for UE%d. Exiting\n", user_id);
+		return EXIT_FAILURE;
+	}
+	setting = config_setting_get_member(ue_setting, OCPLMN);
+	if (setting == NULL) {
+		printf("Check OCPLMN section for UE%d. Exiting\n", user_id);
+		return EXIT_FAILURE;
+	}
+	rc = fill_ocplmn(setting, user_id);
+	if (rc != EXIT_SUCCESS) {
+		printf("Check OCPLMN section for UE%d. Exiting\n", user_id);
+		return EXIT_FAILURE;
+	}
+	setting = config_setting_get_member(ue_setting, FPLMN);
+	if (setting == NULL) {
+		printf("Check FPLMN section for UE%d. Exiting\n", user_id);
+		return EXIT_FAILURE;
+	}
+	rc = fill_fplmn(setting, user_id);
+	if (rc != EXIT_SUCCESS) {
+		printf("Check FPLMN section for UE%d. Exiting\n", user_id);
+		return EXIT_FAILURE;
+	}
+	setting = config_setting_get_member(ue_setting, EHPLMN);
+	if (setting == NULL) {
+		printf("Check EHPLMN section for UE%d. Exiting\n", user_id);
+		return EXIT_FAILURE;
+	}
+	rc = fill_ehplmn(setting, user_id);
+	if (rc != EXIT_SUCCESS) {
+		printf("Check EHPLMN section for UE%d. Exiting\n", user_id);
+		return EXIT_FAILURE;
+	}
+	return EXIT_SUCCESS;
+}
+
+int parse_ue_sim_param(config_setting_t *ue_setting, int user_id) {
+	int rc = EXIT_SUCCESS;
+	config_setting_t *ue_param_setting = NULL;
+	ue_param_setting = config_setting_get_member(ue_setting, SIM);
+	if (ue_param_setting == NULL) {
+		printf("Check SIM section for UE%d. EXITING...\n", user_id);
+		return EXIT_FAILURE;
+	}
+	rc = config_setting_lookup_string(ue_param_setting, MSIN, &msin);
+	if (rc != 1 || strlen(msin) > 10 || strlen(msin) < 9) {
+		printf("Check SIM MSIN section for UE%d. Exiting\n", user_id);
+		return EXIT_FAILURE;
+	}
+	rc = config_setting_lookup_string(ue_param_setting, USIM_API_K,
+			&usim_api_k);
+	if (rc != 1) {
+		printf("Check SIM USIM_API_K  section for UE%d. Exiting\n", user_id);
+		return EXIT_FAILURE;
+	}
+	rc = config_setting_lookup_string(ue_param_setting, OPC, &opc);
+	if (rc != 1) {
+		printf("Check SIM OPC section for UE%d. Exiting\n", user_id);
+		return EXIT_FAILURE;
+	}
+	rc = config_setting_lookup_string(ue_param_setting, MSISDN, &msisdn);
+	if (rc != 1) {
+		printf("Check SIM MSISDN section for UE%d. Exiting\n", user_id);
+		return EXIT_FAILURE;
+	}
+	return EXIT_SUCCESS;
+}
+
+int parse_ue_user_param(config_setting_t *ue_setting, int user_id) {
+	config_setting_t *ue_param_setting = NULL;
+	user_nvdata_t user_data;
+	const char* imei = NULL;
+	const char* manufacturer = NULL;
+	const char* model = NULL;
+	const char* pin = NULL;
+
+	int rc = EXIT_SUCCESS;
+	ue_param_setting = config_setting_get_member(ue_setting, USER);
+	if (ue_param_setting == NULL) {
+		printf("Check USER section of UE%d. EXITING...\n", user_id);
+		return EXIT_FAILURE;
+	}
+	rc = config_setting_lookup_string(ue_param_setting, UE_IMEI, &imei);
+	if (rc != 1) {
+		printf("Check USER IMEI section for UE%d. Exiting\n", user_id);
+		return EXIT_FAILURE;
+	}
+	rc = config_setting_lookup_string(ue_param_setting, MANUFACTURER,
+			&manufacturer);
+	if (rc != 1) {
+		printf("Check USER MANUFACTURER for UE%d FULLNAME. Exiting\n", user_id);
+		return EXIT_FAILURE;
+	}
+	rc = config_setting_lookup_string(ue_param_setting, MODEL, &model);
+	if (rc != 1) {
+		printf("Check USER MODEL for UE%d FULLNAME. Exiting\n", user_id);
+		return EXIT_FAILURE;
+	}
+	rc = config_setting_lookup_string(ue_param_setting, PINCODE, &pin);
+	if (rc != 1) {
+		printf("Check USER PIN for UE%d FULLNAME. Exiting\n", user_id);
+		return EXIT_FAILURE;
+	}
+	memset(&user_data, 0, sizeof(user_nvdata_t));
+	snprintf(user_data.IMEI, USER_IMEI_SIZE + 1, "%s%d", imei, _luhn(imei));
+	/*
+	 * Manufacturer identifier
+	 */
+	strncpy(user_data.manufacturer, manufacturer, USER_MANUFACTURER_SIZE);
+	/*
+	 * Model identifier
+	 */
+	strncpy(user_data.model, model, USER_MODEL_SIZE);
+	/*
+	 * SIM Personal Identification Number
+	 */
+	strncpy(user_data.PIN, pin, USER_PIN_SIZE);
+
+	char* path = make_filename(output_dir, USER_NVRAM_FILENAME, user_id);
+	rc = memory_write(path, &user_data, sizeof(user_nvdata_t));
+    free(path);
+	if (rc != RETURNok) {
+		perror("ERROR\t: memory_write() failed");
+		exit(EXIT_FAILURE);
+	}
+	return EXIT_SUCCESS;
+}
+
+int fill_ucplmn(config_setting_t* setting, int user_id) {
+	int rc;
+	ucplmn_nb = config_setting_length(setting);
+	ucplmn = malloc(ucplmn_nb * sizeof(int));
+	for (int i = 0; i < ucplmn_nb; i++) {
+		const char *mccmnc = config_setting_get_string_elem(setting, i);
+		if (mccmnc == NULL) {
+			printf("Check UCPLMN section for UE%d. Exiting\n", user_id);
+			return EXIT_FAILURE;
+		}
+		rc = get_plmn_index(mccmnc);
+		if (rc == -1) {
+			printf("The PLMN %s is not defined in PLMN section. Exiting...\n",
+					mccmnc);
+			return EXIT_FAILURE;
+		}
+		ucplmn[i] = rc;
+	}
+	return EXIT_SUCCESS;
+}
+int fill_oplmn(config_setting_t* setting, int user_id) {
+	int rc;
+	oplmn_nb = config_setting_length(setting);
+	oplmn = malloc(oplmn_nb * sizeof(int));
+	for (int i = 0; i < oplmn_nb; i++) {
+		const char *mccmnc = config_setting_get_string_elem(setting, i);
+		if (mccmnc == NULL) {
+			printf("Check OPLMN section for UE%d. Exiting\n", user_id);
+			return EXIT_FAILURE;
+		}
+		rc = get_plmn_index(mccmnc);
+		if (rc == -1) {
+			printf("The PLMN %s is not defined in PLMN section. Exiting...\n",
+					mccmnc);
+			return EXIT_FAILURE;
+		}
+		oplmn[i] = rc;
+	}
+	return EXIT_SUCCESS;
+}
+int fill_ocplmn(config_setting_t* setting, int user_id) {
+	int rc;
+	ocplmn_nb = config_setting_length(setting);
+	ocplmn = malloc(ocplmn_nb * sizeof(int));
+	for (int i = 0; i < ocplmn_nb; i++) {
+		const char *mccmnc = config_setting_get_string_elem(setting, i);
+		if (mccmnc == NULL) {
+			printf("Check OCPLMN section for UE%d. Exiting\n", user_id);
+			return EXIT_FAILURE;
+		}
+		rc = get_plmn_index(mccmnc);
+		if (rc == -1) {
+			printf("The PLMN %s is not defined in PLMN section. Exiting...\n",
+					mccmnc);
+			return EXIT_FAILURE;
+		}
+		ocplmn[i] = rc;
+	}
+	return EXIT_SUCCESS;
+}
+int fill_fplmn(config_setting_t* setting, int user_id) {
+	int rc;
+	fplmn_nb = config_setting_length(setting);
+	fplmn = malloc(fplmn_nb * sizeof(int));
+	for (int i = 0; i < fplmn_nb; i++) {
+		const char *mccmnc = config_setting_get_string_elem(setting, i);
+		if (mccmnc == NULL) {
+			printf("Check FPLMN section for UE%d. Exiting\n", user_id);
+			return EXIT_FAILURE;
+		}
+		rc = get_plmn_index(mccmnc);
+		if (rc == -1) {
+			printf("The PLMN %s is not defined in PLMN section. Exiting...\n",
+					mccmnc);
+			return EXIT_FAILURE;
+		}
+		fplmn[i] = rc;
+	}
+	return EXIT_SUCCESS;
+}
+int fill_ehplmn(config_setting_t* setting, int user_id) {
+	int rc;
+	ehplmn_nb = config_setting_length(setting);
+	ehplmn = malloc(ehplmn_nb * sizeof(int));
+	for (int i = 0; i < ehplmn_nb; i++) {
+		const char *mccmnc = config_setting_get_string_elem(setting, i);
+		if (mccmnc == NULL) {
+			printf("Check EHPLMN section for UE%d. Exiting\n", user_id);
+			return EXIT_FAILURE;
+		}
+		rc = get_plmn_index(mccmnc);
+		if (rc == -1) {
+			printf("The PLMN %s is not defined in PLMN section. Exiting...\n",
+					mccmnc);
+			return EXIT_FAILURE;
+		}
+		ehplmn[i] = rc;
+	}
+	return EXIT_SUCCESS;
+}
+
+int get_plmn_index(const char * mccmnc) {
+	char mcc[4];
+	char mnc[strlen(mccmnc) - 2];
+	strncpy(mcc, mccmnc, 3);
+	mcc[3] = '\0';
+	strncpy(mnc, mccmnc + 3, 3);
+	mnc[strlen(mccmnc) - 3] = '\0';
+	for (int i = 0; i < plmn_nb; i++) {
+		if (strcmp(user_plmn_list[i].mcc, mcc) == 0) {
+			if (strcmp(user_plmn_list[i].mnc, mnc) == 0) {
+				return i;
+			}
+		}
+	}
+	return -1;
+}
+
+int get_msin_parity(const char * msin) {
+	int imsi_size = strlen(msin) + strlen(user_plmn_list[hplmn_index].mcc)
+			+ strlen(user_plmn_list[hplmn_index].mnc);
+	int result = (imsi_size % 2 == 0) ? 0 : 1;
+	return result;
+
+}
+
+void fill_network_record_list() {
+	for (int i = 0; i < plmn_nb; i++) {
+		strcpy(user_network_record_list[i].fullname,
+				user_plmn_list[i].fullname);
+		strcpy(user_network_record_list[i].shortname,
+				user_plmn_list[i].shortname);
+		char num[6];
+		sprintf(num, "%s%s", user_plmn_list[i].mcc, user_plmn_list[i].mnc);
+		user_network_record_list[i].num = atoi(num);
+		user_network_record_list[i].plmn.MCCdigit2 = user_plmn_list[i].mcc[1];
+		user_network_record_list[i].plmn.MCCdigit1 = user_plmn_list[i].mcc[0];
+		user_network_record_list[i].plmn.MCCdigit3 = user_plmn_list[i].mcc[2];
+		user_network_record_list[i].plmn.MNCdigit2 = user_plmn_list[i].mnc[1];
+		user_network_record_list[i].plmn.MNCdigit1 = user_plmn_list[i].mnc[0];
+		user_network_record_list[i].tac_end = 0xfffd;
+		user_network_record_list[i].tac_start = 0x0001;
+		if (strlen(user_plmn_list[i].mnc) > 2) {
+			user_network_record_list[i].plmn.MNCdigit3 =
+					user_plmn_list[i].mnc[2];
+		}
+
+	}
+}
+
+/*
+ * Computes the check digit using Luhn algorithm
+ */
+int _luhn(const char* cc) {
+	const int m[] = { 0, 2, 4, 6, 8, 1, 3, 5, 7, 9 };
+	int odd = 1, sum = 0;
+
+	for (int i = strlen(cc); i--; odd = !odd) {
+		int digit = cc[i] - '0';
+		sum += odd ? m[digit] : digit;
+	}
+
+	return 10 - (sum % 10);
+}
+
+void _display_usim_data(int user_id) {
+
+	int rc;
+	usim_data_t data = { };
+	/*
+	 * Read USIM application data
+	 */
+	memset(&data, 0, sizeof(usim_data_t));
+	char *path = make_filename(output_dir, USIM_API_NVRAM_FILENAME, user_id);
+    rc = usim_api_read(path, &data);
+    free(path);
+
+	if (rc != RETURNok) {
+		perror("ERROR\t: usim_api_read() failed");
+		exit(EXIT_FAILURE);
+	}
+
+	/*
+	 * Display USIM application data
+	 */
+	printf("\nUSIM data:\n\n");
+	int digits;
+
+	printf("Administrative Data:\n");
+	printf("\tUE_Operation_Mode\t= 0x%.2x\n", data.ad.UE_Operation_Mode);
+	printf("\tAdditional_Info\t\t= 0x%.4x\n", data.ad.Additional_Info);
+	printf("\tMNC_Length\t\t= %d\n\n", data.ad.MNC_Length);
+
+	printf("IMSI:\n");
+	printf("\tlength\t= %d\n", data.imsi.length);
+	printf("\tparity\t= %s\n",
+			data.imsi.u.num.parity == EVEN_PARITY ? "Even" : "Odd");
+	digits = (data.imsi.length * 2) - 1
+			- (data.imsi.u.num.parity == EVEN_PARITY ? 1 : 0);
+	printf("\tdigits\t= %d\n", digits);
+	printf("\tdigits\t= %u%u%u%u%u%x%u%u%u%u",
+			data.imsi.u.num.digit1, // MCC digit 1
+			data.imsi.u.num.digit2, // MCC digit 2
+			data.imsi.u.num.digit3, // MCC digit 3
+			data.imsi.u.num.digit4, // MNC digit 1
+			data.imsi.u.num.digit5, // MNC digit 2
+			data.imsi.u.num.digit6, // MNC digit 3
+			data.imsi.u.num.digit7, data.imsi.u.num.digit8,
+			data.imsi.u.num.digit9, data.imsi.u.num.digit10);
+
+	if (digits >= 11)
+		printf("%x", data.imsi.u.num.digit11);
+
+	if (digits >= 12)
+		printf("%x", data.imsi.u.num.digit12);
+
+	if (digits >= 13)
+		printf("%x", data.imsi.u.num.digit13);
+
+	if (digits >= 14)
+		printf("%x", data.imsi.u.num.digit14);
+
+	if (digits >= 15)
+		printf("%x", data.imsi.u.num.digit15);
+
+	printf("\n\n");
+
+	printf("Ciphering and Integrity Keys:\n");
+	printf("\tKSI\t: 0x%.2x\n", data.keys.ksi);
+	char key[USIM_CK_SIZE + 1];
+	key[USIM_CK_SIZE] = '\0';
+	memcpy(key, data.keys.ck, USIM_CK_SIZE);
+	printf("\tCK\t: \"%s\"\n", key);
+	memcpy(key, data.keys.ik, USIM_IK_SIZE);
+	printf("\tIK\t: \"%s\"\n", key);
+
+	printf("EPS NAS security context:\n");
+	printf("\tKSIasme\t: 0x%.2x\n", data.securityctx.KSIasme.value[0]);
+	char kasme[USIM_K_ASME_SIZE + 1];
+	kasme[USIM_K_ASME_SIZE] = '\0';
+	memcpy(kasme, data.securityctx.Kasme.value, USIM_K_ASME_SIZE);
+	printf("\tKasme\t: \"%s\"\n", kasme);
+	printf("\tulNAScount\t: 0x%.8x\n",
+			*(uint32_t*) data.securityctx.ulNAScount.value);
+	printf("\tdlNAScount\t: 0x%.8x\n",
+			*(uint32_t*) data.securityctx.dlNAScount.value);
+	printf("\talgorithmID\t: 0x%.2x\n\n",
+			data.securityctx.algorithmID.value[0]);
+
+	printf("MSISDN\t= %u%u%u %u%u%u%u %u%u%u%u\n\n",
+			data.msisdn.number.digit[0].msb, data.msisdn.number.digit[0].lsb,
+			data.msisdn.number.digit[1].msb, data.msisdn.number.digit[1].lsb,
+			data.msisdn.number.digit[2].msb, data.msisdn.number.digit[2].lsb,
+			data.msisdn.number.digit[3].msb, data.msisdn.number.digit[3].lsb,
+			data.msisdn.number.digit[4].msb, data.msisdn.number.digit[4].lsb,
+			data.msisdn.number.digit[5].msb);
+
+	for (int i = 0; i < USIM_PNN_MAX; i++) {
+		printf("PNN[%d]\t= {%s, %s}\n", i, data.pnn[i].fullname.value,
+				data.pnn[i].shortname.value);
+	}
+
+	printf("\n");
+
+	for (int i = 0; i < USIM_OPL_MAX; i++) {
+		printf("OPL[%d]\t= ", i);
+		PRINT_PLMN(data.opl[i].plmn);
+		printf(", TAC = [%.4x - %.4x], record_id = %d\n", data.opl[i].start,
+				data.opl[i].end, data.opl[i].record_id);
+	}
+
+	printf("\n");
+
+	printf("HPLMN\t\t= ");
+	PRINT_PLMN(data.hplmn.plmn);
+	printf(", AcT = 0x%x\n\n", data.hplmn.AcT);
+
+	for (int i = 0; i < USIM_FPLMN_MAX; i++) {
+		printf("FPLMN[%d]\t= ", i);
+		PRINT_PLMN(data.fplmn[i]);
+		printf("\n");
+	}
+
+	printf("\n");
+
+	for (int i = 0; i < USIM_EHPLMN_MAX; i++) {
+		printf("EHPLMN[%d]\t= ", i);
+		PRINT_PLMN(data.ehplmn[i]);
+		printf("\n");
+	}
+
+	printf("\n");
+
+	for (int i = 0; i < USIM_PLMN_MAX; i++) {
+		printf("PLMN[%d]\t\t= ", i);
+		PRINT_PLMN(data.plmn[i].plmn);
+		printf(", AcTPLMN = 0x%x", data.plmn[i].AcT);
+		printf("\n");
+	}
+
+	printf("\n");
+
+	for (int i = 0; i < USIM_OPLMN_MAX; i++) {
+		printf("OPLMN[%d]\t= ", i);
+		PRINT_PLMN(data.oplmn[i].plmn);
+		printf(", AcTPLMN = 0x%x", data.oplmn[i].AcT);
+		printf("\n");
+	}
+
+	printf("\n");
+
+	printf("HPPLMN\t\t= 0x%.2x (%d minutes)\n\n", data.hpplmn, data.hpplmn);
+
+	printf("LOCI:\n");
+	printf("\tTMSI = 0x%.4x\n", data.loci.tmsi);
+	printf("\tLAI\t: PLMN = ");
+	PRINT_PLMN(data.loci.lai.plmn);
+	printf(", LAC = 0x%.2x\n", data.loci.lai.lac);
+	printf("\tstatus\t= %d\n\n", data.loci.status);
+
+	printf("PSLOCI:\n");
+	printf("\tP-TMSI = 0x%.4x\n", data.psloci.p_tmsi);
+	printf("\tsignature = 0x%x 0x%x 0x%x\n", data.psloci.signature[0],
+			data.psloci.signature[1], data.psloci.signature[2]);
+	printf("\tRAI\t: PLMN = ");
+	PRINT_PLMN(data.psloci.rai.plmn);
+	printf(", LAC = 0x%.2x, RAC = 0x%.1x\n", data.psloci.rai.lac,
+			data.psloci.rai.rac);
+	printf("\tstatus\t= %d\n\n", data.psloci.status);
+
+	printf("EPSLOCI:\n");
+	printf("\tGUTI\t: GUMMEI\t: (PLMN = ");
+	PRINT_PLMN(data.epsloci.guti.gummei.plmn);
+	printf(", MMEgid = 0x%.2x, MMEcode = 0x%.1x)",
+			data.epsloci.guti.gummei.MMEgid, data.epsloci.guti.gummei.MMEcode);
+	printf(", M-TMSI = 0x%.4x\n", data.epsloci.guti.m_tmsi);
+	printf("\tTAI\t: PLMN = ");
+	PRINT_PLMN(data.epsloci.tai.plmn);
+	printf(", TAC = 0x%.2x\n", data.epsloci.tai.tac);
+	printf("\tstatus\t= %d\n\n", data.epsloci.status);
+
+	printf("NASCONFIG:\n");
+	printf("\tNAS_SignallingPriority\t\t: 0x%.2x\n",
+			data.nasconfig.NAS_SignallingPriority.value[0]);
+	printf("\tNMO_I_Behaviour\t\t\t: 0x%.2x\n",
+			data.nasconfig.NMO_I_Behaviour.value[0]);
+	printf("\tAttachWithImsi\t\t\t: 0x%.2x\n",
+			data.nasconfig.AttachWithImsi.value[0]);
+	printf("\tMinimumPeriodicSearchTimer\t: 0x%.2x\n",
+			data.nasconfig.MinimumPeriodicSearchTimer.value[0]);
+	printf("\tExtendedAccessBarring\t\t: 0x%.2x\n",
+			data.nasconfig.ExtendedAccessBarring.value[0]);
+	printf("\tTimer_T3245_Behaviour\t\t: 0x%.2x\n",
+			data.nasconfig.Timer_T3245_Behaviour.value[0]);
+
+}
+
+void _display_ue_data(int user_id) {
+	user_nvdata_t data;
+	int rc;
+	char* path = make_filename(output_dir, USER_NVRAM_FILENAME, user_id);
+	/*
+	 * Read UE's non-volatile data
+	 */
+	memset(&data, 0, sizeof(user_nvdata_t));
+	rc = memory_read(path, &data, sizeof(user_nvdata_t));
+	free(path);
+
+	if (rc != RETURNok) {
+		perror("ERROR\t: memory_read() failed");
+		exit(EXIT_FAILURE);
+	}
+
+	/*
+	 * Display UE's non-volatile data
+	 */
+	printf("\nUE's non-volatile data:\n\n");
+	printf("IMEI\t\t= %s\n", data.IMEI);
+	printf("manufacturer\t= %s\n", data.manufacturer);
+	printf("model\t\t= %s\n", data.model);
+	printf("PIN\t\t= %s\n", data.PIN);
+}
+
+/*
+ * Displays UE's non-volatile EMM data
+ */
+void _display_emm_data(int user_id) {
+
+	int rc;
+	emm_nvdata_t data;
+	char* path = make_filename(output_dir, EMM_NVRAM_FILENAME, user_id);
+
+	/*
+	 * Read EMM non-volatile data
+	 */
+	memset(&data, 0, sizeof(emm_nvdata_t));
+	rc = memory_read(path, &data, sizeof(emm_nvdata_t));
+	free(path);
+	if (rc != RETURNok) {
+		perror("ERROR\t: memory_read() failed ");
+		exit(EXIT_FAILURE);
+	}
+
+	/*
+	 * Display EMM non-volatile data
+	 */
+	printf("\nEMM non-volatile data:\n\n");
+
+	printf("IMSI\t\t= ");
+
+	if (data.imsi.u.num.digit6 == 0b1111) {
+		if (data.imsi.u.num.digit15 == 0b1111) {
+			printf("%u%u%u.%u%u.%u%u%u%u%u%u%u%u\n", data.imsi.u.num.digit1,
+					data.imsi.u.num.digit2, data.imsi.u.num.digit3,
+					data.imsi.u.num.digit4, data.imsi.u.num.digit5,
+
+					data.imsi.u.num.digit7, data.imsi.u.num.digit8,
+					data.imsi.u.num.digit9, data.imsi.u.num.digit10,
+					data.imsi.u.num.digit11, data.imsi.u.num.digit12,
+					data.imsi.u.num.digit13, data.imsi.u.num.digit14);
+		} else {
+			printf("%u%u%u.%u%u.%u%u%u%u%u%u%u%u%u\n", data.imsi.u.num.digit1,
+					data.imsi.u.num.digit2, data.imsi.u.num.digit3,
+					data.imsi.u.num.digit4, data.imsi.u.num.digit5,
+
+					data.imsi.u.num.digit7, data.imsi.u.num.digit8,
+					data.imsi.u.num.digit9, data.imsi.u.num.digit10,
+					data.imsi.u.num.digit11, data.imsi.u.num.digit12,
+					data.imsi.u.num.digit13, data.imsi.u.num.digit14,
+					data.imsi.u.num.digit15);
+		}
+	} else {
+		if (data.imsi.u.num.digit15 == 0b1111) {
+			printf("%u%u%u.%u%u%u.%u%u%u%u%u%u%u%u\n", data.imsi.u.num.digit1,
+					data.imsi.u.num.digit2, data.imsi.u.num.digit3,
+					data.imsi.u.num.digit4, data.imsi.u.num.digit5,
+					data.imsi.u.num.digit6,
+
+					data.imsi.u.num.digit7, data.imsi.u.num.digit8,
+					data.imsi.u.num.digit9, data.imsi.u.num.digit10,
+					data.imsi.u.num.digit11, data.imsi.u.num.digit12,
+					data.imsi.u.num.digit13, data.imsi.u.num.digit14);
+		} else {
+			printf("%u%u%u.%u%u%u.%u%u%u%u%u%u%u%u%u\n", data.imsi.u.num.digit1,
+					data.imsi.u.num.digit2, data.imsi.u.num.digit3,
+					data.imsi.u.num.digit4, data.imsi.u.num.digit5,
+					data.imsi.u.num.digit6,
+
+					data.imsi.u.num.digit7, data.imsi.u.num.digit8,
+					data.imsi.u.num.digit9, data.imsi.u.num.digit10,
+					data.imsi.u.num.digit11, data.imsi.u.num.digit12,
+					data.imsi.u.num.digit13, data.imsi.u.num.digit14,
+					data.imsi.u.num.digit15);
+		}
+	}
+
+	printf("RPLMN\t\t= ");
+	PRINT_PLMN(data.rplmn);
+	printf("\n");
+
+	for (int i = 0; i < data.eplmn.n_plmns; i++) {
+		printf("EPLMN[%d]\t= ", i);
+		PRINT_PLMN(data.eplmn.plmn[i]);
+		printf("\n");
+	}
+}
+
+/*
+ * Displays command line usage
+ */
+void _display_usage(void) {
+	fprintf(stderr, "usage: conf2uedata [OPTION] [directory] ...\n");
+	fprintf(stderr, "\t[-c]\tConfig file to use\n");
+	fprintf(stderr, "\t[-o]\toutput file directory\n");
+	fprintf(stderr, "\t[-h]\tDisplay this usage\n");
+}
+
+
+char * make_filename(const char *output_dir, const char *filename, int ueid) {
+	size_t size;
+    char *str_ueid, *str;
+
+    str_ueid = itoa(ueid);
+
+    if (str_ueid == NULL) {
+        perror("ERROR\t: itoa() failed");
+        exit(EXIT_FAILURE);
+    }
+
+    size = strlen(output_dir)+strlen(filename) + sizeof(ueid) + 1 + 1; // for \0 and for '/'
+    str = malloc(size);
+    if (str == NULL) {
+        perror("ERROR\t: make_filename() failed");
+        exit(EXIT_FAILURE);
+    }
+
+    snprintf(str, size, "%s/%s%s",output_dir, filename, str_ueid);
+    free(str_ueid);
+
+ return str;
+}
diff --git a/openair3/NAS/TOOLS/conf2uedata.h b/openair3/NAS/TOOLS/conf2uedata.h
new file mode 100644
index 0000000000000000000000000000000000000000..06c0027c78aacd910f7b39aac07cc95a02104a9b
--- /dev/null
+++ b/openair3/NAS/TOOLS/conf2uedata.h
@@ -0,0 +1,153 @@
+#ifndef _CONF2UEDATA_H
+#define _CONF2UEDATA_H
+
+#include <libconfig.h>
+#include "emmData.h"
+#include "usim_api.h"
+#include "userDef.h"
+#include "memory.h"
+#include "getopt.h"
+
+#define USER "USER"
+#define UE "UE"
+#define SIM "SIM"
+#define PLMN "PLMN"
+
+#define FULLNAME "FULLNAME"
+#define SHORTNAME "SHORTNAME"
+#define MNC "MNC"
+#define MCC "MCC"
+
+#define MSIN "MSIN"
+#define USIM_API_K "USIM_API_K"
+#define OPC "OPC"
+#define MSISDN "MSISDN"
+
+#define UE_IMEI "IMEI"
+#define MANUFACTURER "MANUFACTURER"
+#define MODEL "MODEL"
+#define PINCODE "PIN"
+
+#define HPLMN "HPLMN"
+#define UCPLMN "UCPLMN_LIST"
+#define OPLMN "OPLMN_LIST"
+#define OCPLMN "OCPLMN_LIST"
+#define FPLMN "FPLMN_LIST"
+#define EHPLMN "EHPLMN_LIST"
+
+#define KSI     USIM_KSI_NOT_AVAILABLE
+#define PRINT_PLMN_DIGIT(d) if ((d) != 0xf) printf("%u", (d))
+
+#define PRINT_PLMN(plmn)    \
+    PRINT_PLMN_DIGIT((plmn).MCCdigit1); \
+    PRINT_PLMN_DIGIT((plmn).MCCdigit2); \
+    PRINT_PLMN_DIGIT((plmn).MCCdigit3); \
+    PRINT_PLMN_DIGIT((plmn).MNCdigit1); \
+    PRINT_PLMN_DIGIT((plmn).MNCdigit2); \
+    PRINT_PLMN_DIGIT((plmn).MNCdigit3)
+
+
+#define KSI_ASME    USIM_KSI_NOT_AVAILABLE
+#define INT_ALGO    USIM_INT_EIA1
+#define ENC_ALGO    USIM_ENC_EEA0
+#define SECURITY_ALGORITHMS (ENC_ALGO | INT_ALGO)
+#define OPC_SIZE	16
+#define MIN_TAC     0x0000
+#define MAX_TAC     0xFFFE
+
+#define DEFAULT_TMSI    0x0000000D
+#define DEFAULT_P_TMSI    0x0000000D
+#define DEFAULT_M_TMSI    0x0000000D
+#define DEFAULT_LAC   0xFFFE
+#define DEFAULT_RAC   0x01
+#define DEFAULT_TAC   0x0001
+
+#define DEFAULT_MME_ID    0x0102
+#define DEFAULT_MME_CODE  0x0F
+
+#define PRINT_PLMN_DIGIT(d) if ((d) != 0xf) printf("%u", (d))
+
+#define PRINT_PLMN(plmn)    \
+    PRINT_PLMN_DIGIT((plmn).MCCdigit1); \
+    PRINT_PLMN_DIGIT((plmn).MCCdigit2); \
+    PRINT_PLMN_DIGIT((plmn).MCCdigit3); \
+    PRINT_PLMN_DIGIT((plmn).MNCdigit1); \
+    PRINT_PLMN_DIGIT((plmn).MNCdigit2); \
+    PRINT_PLMN_DIGIT((plmn).MNCdigit3)
+
+/*
+ * PLMN network operator record
+ */
+typedef struct {
+  unsigned int num;
+  plmn_t plmn;
+  char fullname[NET_FORMAT_LONG_SIZE + 1];
+  char shortname[NET_FORMAT_SHORT_SIZE + 1];
+  tac_t tac_start;
+  tac_t tac_end;
+} network_record_t;
+
+typedef struct {
+	const char* fullname;
+	const char* shortname;
+	const char* mnc;
+	const char* mcc;
+} plmn_conf_param_t;
+
+const char options[]="c:o:h";
+unsigned char parse_data=FALSE;
+unsigned char print_data=FALSE;
+unsigned char output=FALSE;
+const char* conf_file = NULL;
+const char* output_dir = NULL;
+
+const char* imsi=NULL;
+const char* msin=NULL;
+const char* usim_api_k = NULL;
+const char* msisdn = NULL;
+const char* opc=NULL;
+const char* hplmn=NULL;
+
+int* ucplmn=NULL;
+int* oplmn=NULL;
+int* ocplmn=NULL;
+int* fplmn=NULL;
+int* ehplmn=NULL;
+
+int hplmn_index =0;
+int plmn_nb = 0;
+int ucplmn_nb=0;
+int oplmn_nb=0;
+int ocplmn_nb=0;
+int fplmn_nb=0;
+int ehplmn_nb=0;
+
+plmn_conf_param_t* user_plmn_list=NULL;
+network_record_t* user_network_record_list = NULL;
+
+void _display_usim_data(int user_id);
+
+void _display_usage(void);
+void gen_emm_data(int user_id) ;
+void gen_usim_data(int user_id);
+void fill_network_record_list(void);
+
+int _luhn(const char* cc);
+
+void _display_ue_data(int user_id);
+
+void _display_emm_data(int user_id);
+int parse_ue_user_param(config_setting_t *ue_setting, int user_id);
+int parse_ue_sim_param(config_setting_t *ue_setting, int user_id);
+int parse_plmn_param(config_setting_t *plmn_setting, int index);
+int parse_plmns(config_setting_t *all_plmn_setting);
+int get_msin_parity(const char * msin);
+int get_plmn_index(const char * mccmnc);
+int parse_ue_plmn_param(config_setting_t *ue_setting, int user_id);
+int fill_ucplmn(config_setting_t* setting, int use_id);
+int fill_oplmn(config_setting_t* setting, int use_id);
+int fill_ocplmn(config_setting_t* setting, int use_id);
+int fill_fplmn(config_setting_t* setting, int use_id);
+int fill_ehplmn(config_setting_t* setting, int use_id);
+
+#endif // _CONF2UEDATA_H
diff --git a/openair3/NAS/TOOLS/ue_bcom_test.conf b/openair3/NAS/TOOLS/ue_bcom_test.conf
new file mode 100644
index 0000000000000000000000000000000000000000..c60b628941dbdc0090a567ec0ad67e575efc7b03
--- /dev/null
+++ b/openair3/NAS/TOOLS/ue_bcom_test.conf
@@ -0,0 +1,2334 @@
+PLMN:
+{
+	PLMN0:
+	{
+		FULLNAME="B<>COM Cubiq";
+		SHORTNAME="BCOM";
+		MNC="89";
+		MCC="208";
+	};
+};
+
+UE0:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000000";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000000";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE1:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000001";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000001";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE2:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000002";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000002";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE3:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000003";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000003";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE4:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000004";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000004";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE5:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000005";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000005";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE6:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000006";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000006";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE7:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000007";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000007";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE8:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000008";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000008";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE9:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000009";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000009";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE10:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000010";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000010";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE11:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000011";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000011";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE12:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000012";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000012";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE13:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000013";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000013";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE14:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000014";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000014";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE15:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000015";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000015";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE16:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000016";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000016";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE17:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000017";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000017";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE18:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000018";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000018";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE19:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000019";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000019";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE20:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000020";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000020";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE21:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000021";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000021";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE22:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000022";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000022";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE23:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000023";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000023";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE24:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000024";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000024";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE25:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000025";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000025";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE26:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000026";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000026";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE27:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000027";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000027";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE28:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000028";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000028";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE29:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000029";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000029";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE30:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000030";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000030";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE31:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000031";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000031";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE32:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000032";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000032";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE33:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000033";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000033";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE34:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000034";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000034";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE35:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000035";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000035";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE36:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000036";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000036";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE37:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000037";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000037";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE38:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000038";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000038";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE39:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000039";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000039";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE40:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000040";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000040";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE41:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000041";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000041";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE42:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000042";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000042";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE43:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000043";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000043";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE44:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000044";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000044";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE45:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000045";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000045";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE46:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000046";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000046";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE47:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000047";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000047";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE48:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000048";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000048";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE49:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000049";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000049";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE50:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000050";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000050";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE51:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000051";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000051";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE52:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000052";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000052";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE53:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000053";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000053";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE54:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000054";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000054";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE55:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000055";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000055";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE56:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000056";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000056";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE57:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000057";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000057";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE58:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000058";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000058";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE59:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000059";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000059";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE60:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000060";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000060";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE61:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000061";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000061";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE62:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000062";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000062";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE63:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000063";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000063";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE64:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000064";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000064";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE65:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000065";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000065";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE66:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000066";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000066";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE67:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000067";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000067";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE68:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000068";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000068";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE69:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000069";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000069";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE70:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000070";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000070";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE71:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000071";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000071";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE72:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000072";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000072";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE73:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000073";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000073";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE74:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000074";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000074";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE75:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000075";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000075";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE76:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000076";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000076";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE77:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000077";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000077";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE78:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000078";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000078";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE79:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000079";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000079";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE80:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000080";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000080";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE81:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000081";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000081";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE82:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000082";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000082";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE83:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000083";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000083";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE84:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000084";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000084";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE85:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000085";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000085";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE86:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000086";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000086";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE87:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000087";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000087";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE88:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000088";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000088";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE89:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000089";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000089";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE90:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000090";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000090";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE91:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000091";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000091";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE92:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000092";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000092";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE93:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000093";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000093";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE94:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000094";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000094";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE95:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000095";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000095";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE96:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000096";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000096";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE97:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000097";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000097";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE98:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000098";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000098";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE99:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000099";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000099";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
+UE100:
+{
+USER:
+	{
+	IMEI="35609204079299";
+	MANUFACTURER="EURECOM";
+	MODEL="LTE Android PC";
+	PIN="0000";
+	};
+SIM:
+	{
+	MSIN="1000000100";
+	USIM_API_K="00112233445566778899AABBCCDDEEFF";
+	OPC="21C6FD3F84AA71BAC34FA8FCA0EAC64F";
+	MSISDN="33600000100";
+	};
+HPLMN= "20889";
+UCPLMN_LIST=();
+OPLMN_LIST=("20889");
+OCPLMN_LIST = ();
+FPLMN_LIST = ();
+EHPLMN_LIST= ();
+};
diff --git a/openair3/NAS/TOOLS/ue_data.c b/openair3/NAS/TOOLS/ue_data.c
deleted file mode 100644
index 3636ad6ee3d5519ecb61e81976f84a671be15bbe..0000000000000000000000000000000000000000
--- a/openair3/NAS/TOOLS/ue_data.c
+++ /dev/null
@@ -1,536 +0,0 @@
-/*
- * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The OpenAirInterface Software Alliance licenses this file to You under
- * the OAI Public License, Version 1.0  (the "License"); you may not use this file
- * except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.openairinterface.org/?page_id=698
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *-------------------------------------------------------------------------------
- * For more information about the OpenAirInterface (OAI) Software Alliance:
- *      contact@openairinterface.org
- */
-
-/*****************************************************************************
-Source    ue_data.c
-
-Version   0.1
-
-Date    2012/11/02
-
-Product   UE data generator
-
-Subsystem UE data generator main process
-
-Author    Frederic Maurel
-
-Description Implements the utility used to generate data stored in the
-    UE's non-volatile memory device
-
-*****************************************************************************/
-
-#include "userDef.h"
-#include "memory.h"
-
-#include "emmData.h"
-#include "network.h"
-
-#include <stdio.h>  // perror, printf, fprintf, snprintf
-#include <stdlib.h> // exit, free
-#include <string.h> // memset, strncpy
-
-/****************************************************************************/
-/****************  E X T E R N A L    D E F I N I T I O N S  ****************/
-/****************************************************************************/
-
-#define USER_IMEI   "35611302209414"
-#define USER_MANUFACTURER "EURECOM"
-#define USER_MODEL    "LTE Android PC"
-//#define USER_MANUFACTURER "SAGEM"
-//#define USER_MODEL    "my225x"
-#define USER_PIN    "0000"
-
-#define PRINT_PLMN_DIGIT(d) if ((d) != 0xf) printf("%u", (d))
-
-#define PRINT_PLMN(plmn)    \
-    PRINT_PLMN_DIGIT((plmn).MCCdigit1); \
-    PRINT_PLMN_DIGIT((plmn).MCCdigit2); \
-    PRINT_PLMN_DIGIT((plmn).MCCdigit3); \
-    PRINT_PLMN_DIGIT((plmn).MNCdigit1); \
-    PRINT_PLMN_DIGIT((plmn).MNCdigit2); \
-    PRINT_PLMN_DIGIT((plmn).MNCdigit3)
-
-/****************************************************************************/
-/*******************  L O C A L    D E F I N I T I O N S  *******************/
-/****************************************************************************/
-
-static void _display_usage(const char* command);
-
-static void _gen_user_data(user_nvdata_t* data);
-static void _gen_emm_data(emm_nvdata_t* data);
-
-static int _luhn(const char* cc);
-static void _display_ue_data(const user_nvdata_t* data);
-static void _display_emm_data(const emm_nvdata_t* data);
-
-/****************************************************************************/
-/******************  E X P O R T E D    F U N C T I O N S  ******************/
-/****************************************************************************/
-
-int main (int argc, const char* argv[])
-{
-  int rc;
-  char* path;
-  user_nvdata_t user_data;
-  emm_nvdata_t emm_data;
-
-  unsigned char gen_data;
-
-  /*
-   * ----------------------------
-   * Read command line parameters
-   * ----------------------------
-   */
-  if (argc != 2) {
-    fprintf(stderr, "Invalid parameter\n");
-    _display_usage(argv[0]);
-    exit(EXIT_FAILURE);
-  } else if ( (strcmp(argv[1], "--gen") == 0) ||
-              (strcmp(argv[1], "-g") == 0) ) {
-    /* Generate UE data files */
-    gen_data = TRUE;
-  } else if ( (strcmp(argv[1], "--print") == 0) ||
-              (strcmp(argv[1], "-p") == 0) ) {
-    /* Display content of UE data files */
-    gen_data = FALSE;
-  } else {
-    /* Display usage */
-    _display_usage(argv[0]);
-    exit(EXIT_SUCCESS);
-  }
-  /*
-   * ----------------------
-   * UE's non-volatile data
-   * ----------------------
-   */
-  path = memory_get_path(USER_NVRAM_DIRNAME, USER_NVRAM_FILENAME);
-
-  if (path == NULL) {
-    perror("ERROR\t: memory_get_path() failed");
-    exit(EXIT_FAILURE);
-  }
-
-  if (gen_data) {
-    /*
-     * Initialize UE's non-volatile data
-     */
-    memset(&user_data, 0, sizeof(user_nvdata_t));
-    _gen_user_data(&user_data);
-    /*
-     * Write UE's non-volatile data
-     */
-    rc = memory_write(path, &user_data, sizeof(user_nvdata_t));
-
-    if (rc != RETURNok) {
-      perror("ERROR\t: memory_write() failed");
-      free(path);
-      exit(EXIT_FAILURE);
-    }
-  }
-
-  /*
-   * Read UE's non-volatile data
-   */
-  memset(&user_data, 0, sizeof(user_nvdata_t));
-  rc = memory_read(path, &user_data, sizeof(user_nvdata_t));
-
-  if (rc != RETURNok) {
-    perror("ERROR\t: memory_read() failed");
-    free(path);
-    exit(EXIT_FAILURE);
-  }
-
-  free(path);
-  /*
-   * Display UE's non-volatile data
-   */
-  printf("\nUE's non-volatile data:\n\n");
-  _display_ue_data(&user_data);
-
-  /*
-   * ---------------------
-   * EMM non-volatile data
-   * ---------------------
-   */
-  path = memory_get_path(EMM_NVRAM_DIRNAME, EMM_NVRAM_FILENAME);
-
-  if (path == NULL) {
-    perror("ERROR\t: memory_get_path() failed");
-    exit(EXIT_FAILURE);
-  }
-
-  if (gen_data) {
-    /*
-     * Initialize EMM non-volatile data
-     */
-    memset(&emm_data, 0, sizeof(emm_nvdata_t));
-    _gen_emm_data(&emm_data);
-    /*
-     * Write EMM non-volatile data
-     */
-    rc = memory_write(path, &emm_data, sizeof(emm_nvdata_t));
-
-    if (rc != RETURNok) {
-      perror("ERROR\t: memory_write() failed");
-      free(path);
-      exit(EXIT_FAILURE);
-    }
-  }
-
-  /*
-   * Read EMM non-volatile data
-   */
-  memset(&emm_data, 0, sizeof(emm_nvdata_t));
-  rc = memory_read(path, &emm_data, sizeof(emm_nvdata_t));
-
-  if (rc != RETURNok) {
-    perror("ERROR\t: memory_read() failed ");
-    free(path);
-    exit(EXIT_FAILURE);
-  }
-
-  free(path);
-  /*
-   * Display EMM non-volatile data
-   */
-  printf("\nEMM non-volatile data:\n\n");
-  _display_emm_data(&emm_data);
-
-  /*
-   *---------------
-   * Files location
-   *---------------
-   */
-  path = memory_get_path(USER_NVRAM_DIRNAME, USER_NVRAM_FILENAME);
-  printf("\nUE identity data file: %s\n", path);
-  free(path);
-  path = memory_get_path(EMM_NVRAM_DIRNAME, EMM_NVRAM_FILENAME);
-  printf("EPS Mobility Management data file: %s\n", path);
-  free(path);
-
-  exit(EXIT_SUCCESS);
-}
-
-/****************************************************************************/
-/*********************  L O C A L    F U N C T I O N S  *********************/
-/****************************************************************************/
-
-/*
- * Displays command line usage
- */
-static void _display_usage(const char* command)
-{
-  fprintf(stderr, "usage: %s [OPTION]\n", command);
-  fprintf(stderr, "\t[--gen|-g]\tGenerate the UE data files\n");
-  fprintf(stderr, "\t[--print|-p]\tDisplay the content of the UE data files\n");
-  fprintf(stderr, "\t[--help|-h]\tDisplay this usage\n");
-  const char* path = getenv("NVRAM_DIR");
-
-  if (path != NULL) {
-    fprintf(stderr, "NVRAM_DIR = %s\n", path);
-  } else {
-    fprintf(stderr, "NVRAM_DIR environment variable is not defined\n");
-  }
-}
-
-/*
- * Generates UE's non-volatile data
- */
-static void _gen_user_data(user_nvdata_t* data)
-{
-  /*
-   * Product Serial Number Identification
-   * IMEI = AA-BBBBBB-CCCCCC-D
-   * AA-BBBBBB: Type Allocation Code (TAC)
-   * CCCCCC: Serial Number
-   * D: Luhn check digit
-   */
-  snprintf(data->IMEI, USER_IMEI_SIZE+1, "%s%d",
-           USER_IMEI, _luhn(USER_IMEI));
-  /*
-   * Manufacturer identifier
-   */
-  strncpy(data->manufacturer, USER_MANUFACTURER, USER_MANUFACTURER_SIZE);
-  /*
-   * Model identifier
-   */
-  strncpy(data->model, USER_MODEL, USER_MODEL_SIZE);
-  /*
-   * SIM Personal Identification Number
-   */
-  strncpy(data->PIN, USER_PIN, USER_PIN_SIZE);
-}
-
-/*
- * Generates UE's non-volatile EMM data
- */
-static void _gen_emm_data(emm_nvdata_t* data)
-{
-#if (SELECTED_PLMN == FCT1)
-  /*
-   * International Mobile Subscriber Identity
-   * IMSI = MCC + MNC + MSIN = 310 (USA) + 028 (UNKNOWN) + 90832150
-   */
-#warning "IMSI 310.028.90832150"
-  data->imsi.length = 8;
-  data->imsi.u.num.parity = 0x0;  // Type of identity = IMSI, even
-  data->imsi.u.num.digit1 = 3;    // MCC digit 1
-  data->imsi.u.num.digit2 = 1;    // MCC digit 2
-  data->imsi.u.num.digit3 = 0;    // MCC digit 3
-  data->imsi.u.num.digit4 = 0;    // MNC digit 1
-  data->imsi.u.num.digit5 = 2;    // MNC digit 2
-  data->imsi.u.num.digit6 = 8;    // MNC digit 3
-  data->imsi.u.num.digit7 = 9;
-  data->imsi.u.num.digit8 = 0;
-  data->imsi.u.num.digit9 = 8;
-  data->imsi.u.num.digit10 = 3;
-  data->imsi.u.num.digit11 = 2;
-  data->imsi.u.num.digit12 = 1;
-  data->imsi.u.num.digit13 = 5;
-  data->imsi.u.num.digit14 = 0;
-  data->imsi.u.num.digit15 = 0xF;
-  /*
-   * Last registered home PLMN
-   */
-  data->rplmn.MCCdigit1 = 3;
-  data->rplmn.MCCdigit2 = 1;
-  data->rplmn.MCCdigit3 = 0;
-  data->rplmn.MNCdigit1 = 0;
-  data->rplmn.MNCdigit2 = 2;
-  data->rplmn.MNCdigit3 = 8;
-#endif
-#if (SELECTED_PLMN == SFR1)
-  /*
-   * International Mobile Subscriber Identity
-   * IMSI = MCC + MNC + MSIN = 208 (France) + 10 (SFR) + 00001234
-   */
-     data->imsi.length = 8;
-     data->imsi.u.num.parity = 0x0;  // Type of identity = IMSI, even
-     data->imsi.u.num.digit1 = 2;  // MCC digit 1
-     data->imsi.u.num.digit2 = 0;  // MCC digit 2
-     data->imsi.u.num.digit3 = 8;  // MCC digit 3
-     data->imsi.u.num.digit4 = 1;  // MNC digit 1
-     data->imsi.u.num.digit5 = 0;  // MNC digit 2
-     data->imsi.u.num.digit6 = 0;//0xF;  // MNC digit 3
-     data->imsi.u.num.digit7 = 0;
-     data->imsi.u.num.digit8 = 0;
-     data->imsi.u.num.digit9 = 0;
-     data->imsi.u.num.digit10 = 0;
-     data->imsi.u.num.digit11 = 1;
-     data->imsi.u.num.digit12 = 2;
-     data->imsi.u.num.digit13 = 3;
-     data->imsi.u.num.digit14 = 4;
-     data->imsi.u.num.digit15 = 0xF;
-
-     data->rplmn.MCCdigit1 = 2;
-     data->rplmn.MCCdigit2 = 0;
-     data->rplmn.MCCdigit3 = 8;
-     data->rplmn.MNCdigit1 = 1;
-     data->rplmn.MNCdigit2 = 0;
-     data->rplmn.MNCdigit3 = 0xf;
-#endif
-#if (SELECTED_PLMN == OAI_LTEBOX)
-  /*
-   * International Mobile Subscriber Identity
-   * IMSI = MCC + MNC + MSIN = 208 (France) + 93 (OAI) + 00001110
-   */
-     data->imsi.length = 8;
-     data->imsi.u.num.parity = ODD_PARITY;  // Type of identity = IMSI, even
-     data->imsi.u.num.digit1 = 2;  // MCC digit 1
-     data->imsi.u.num.digit2 = 0;  // MCC digit 2
-     data->imsi.u.num.digit3 = 8;  // MCC digit 3
-     data->imsi.u.num.digit4 = 9;  // MNC digit 1
-     data->imsi.u.num.digit5 = 3;  // MNC digit 2
-     data->imsi.u.num.digit6 = 0;  // MNC digit 3
-     data->imsi.u.num.digit7 = 1;
-     data->imsi.u.num.digit8 = 0;
-     data->imsi.u.num.digit9 = 0;
-     data->imsi.u.num.digit10 = 0;
-     data->imsi.u.num.digit11 = 0;
-     data->imsi.u.num.digit12 = 1;
-     data->imsi.u.num.digit13 = 1;
-     data->imsi.u.num.digit14 = 1;
-     data->imsi.u.num.digit15 = 1;
-
-     data->rplmn.MCCdigit1 = 2;
-     data->rplmn.MCCdigit2 = 0;
-     data->rplmn.MCCdigit3 = 8;
-     data->rplmn.MNCdigit1 = 9;
-     data->rplmn.MNCdigit2 = 3;
-     data->rplmn.MNCdigit3 = 0xf;
-#endif
-#if (SELECTED_PLMN == TEST1)
-  /*
-   * International Mobile Subscriber Identity
-   * IMSI = MCC + MNC + MSIN = 001  + 01  + 00001234
-   */
-  data->imsi.length = 8;
-  data->imsi.u.num.parity = 0x0;  // Type of identity = IMSI, even
-  data->imsi.u.num.digit1 = 0;    // MCC digit 1
-  data->imsi.u.num.digit2 = 0;    // MCC digit 2
-  data->imsi.u.num.digit3 = 1;    // MCC digit 3
-  data->imsi.u.num.digit4 = 0;    // MNC digit 1
-  data->imsi.u.num.digit5 = 1;    // MNC digit 2
-  data->imsi.u.num.digit6 = 0;
-  data->imsi.u.num.digit7 = 0;
-  data->imsi.u.num.digit8 = 0;
-  data->imsi.u.num.digit9 = 0;
-  data->imsi.u.num.digit10 = 0;
-  data->imsi.u.num.digit11 = 1;
-  data->imsi.u.num.digit12 = 2;
-  data->imsi.u.num.digit13 = 3;
-  data->imsi.u.num.digit14 = 4;
-  data->imsi.u.num.digit15 = 0xF;
-
-  /*
-   * Last registered home PLMN
-   */
-  data->rplmn.MCCdigit1 = 0;
-  data->rplmn.MCCdigit2 = 0;
-  data->rplmn.MCCdigit3 = 1;
-  data->rplmn.MNCdigit1 = 0;
-  data->rplmn.MNCdigit2 = 1;
-  data->rplmn.MNCdigit3 = 0xf;
-#endif
-  /*
-   * List of Equivalent PLMNs
-   */
-  data->eplmn.n_plmns = 0;
-}
-
-/*
- * Computes the check digit using Luhn algorithm
- */
-static int _luhn(const char* cc)
-{
-  const int m[] = {0,2,4,6,8,1,3,5,7,9};
-  int odd = 1, sum = 0;
-
-  for (int i = strlen(cc); i--; odd = !odd) {
-    int digit = cc[i] - '0';
-    sum += odd ? m[digit] : digit;
-  }
-
-  return 10 - (sum % 10);
-}
-
-/*
- * Displays UE's non-volatile data
- */
-static void _display_ue_data(const user_nvdata_t* data)
-{
-  printf("IMEI\t\t= %s\n", data->IMEI);
-  printf("manufacturer\t= %s\n", data->manufacturer);
-  printf("model\t\t= %s\n", data->model);
-  printf("PIN\t\t= %s\n", data->PIN);
-}
-
-/*
- * Displays UE's non-volatile EMM data
- */
-static void _display_emm_data(const emm_nvdata_t* data)
-{
-  printf("IMSI\t\t= ");
-
-  if (data->imsi.u.num.digit6 == 0b1111) {
-    if (data->imsi.u.num.digit15 == 0b1111) {
-      printf("%u%u%u.%u%u.%u%u%u%u%u%u%u%u\n",
-             data->imsi.u.num.digit1,
-             data->imsi.u.num.digit2,
-             data->imsi.u.num.digit3,
-             data->imsi.u.num.digit4,
-             data->imsi.u.num.digit5,
-
-             data->imsi.u.num.digit7,
-             data->imsi.u.num.digit8,
-             data->imsi.u.num.digit9,
-             data->imsi.u.num.digit10,
-             data->imsi.u.num.digit11,
-             data->imsi.u.num.digit12,
-             data->imsi.u.num.digit13,
-             data->imsi.u.num.digit14);
-    } else {
-      printf("%u%u%u.%u%u.%u%u%u%u%u%u%u%u%u\n",
-             data->imsi.u.num.digit1,
-             data->imsi.u.num.digit2,
-             data->imsi.u.num.digit3,
-             data->imsi.u.num.digit4,
-             data->imsi.u.num.digit5,
-
-             data->imsi.u.num.digit7,
-             data->imsi.u.num.digit8,
-             data->imsi.u.num.digit9,
-             data->imsi.u.num.digit10,
-             data->imsi.u.num.digit11,
-             data->imsi.u.num.digit12,
-             data->imsi.u.num.digit13,
-             data->imsi.u.num.digit14,
-             data->imsi.u.num.digit15);
-    }
-  } else {
-    if (data->imsi.u.num.digit15 == 0b1111) {
-      printf("%u%u%u.%u%u%u.%u%u%u%u%u%u%u%u\n",
-             data->imsi.u.num.digit1,
-             data->imsi.u.num.digit2,
-             data->imsi.u.num.digit3,
-             data->imsi.u.num.digit4,
-             data->imsi.u.num.digit5,
-             data->imsi.u.num.digit6,
-
-             data->imsi.u.num.digit7,
-             data->imsi.u.num.digit8,
-             data->imsi.u.num.digit9,
-             data->imsi.u.num.digit10,
-             data->imsi.u.num.digit11,
-             data->imsi.u.num.digit12,
-             data->imsi.u.num.digit13,
-             data->imsi.u.num.digit14);
-    } else {
-      printf("%u%u%u.%u%u%u.%u%u%u%u%u%u%u%u%u\n",
-             data->imsi.u.num.digit1,
-             data->imsi.u.num.digit2,
-             data->imsi.u.num.digit3,
-             data->imsi.u.num.digit4,
-             data->imsi.u.num.digit5,
-             data->imsi.u.num.digit6,
-
-             data->imsi.u.num.digit7,
-             data->imsi.u.num.digit8,
-             data->imsi.u.num.digit9,
-             data->imsi.u.num.digit10,
-             data->imsi.u.num.digit11,
-             data->imsi.u.num.digit12,
-             data->imsi.u.num.digit13,
-             data->imsi.u.num.digit14,
-             data->imsi.u.num.digit15);
-    }
-  }
-
-  printf("RPLMN\t\t= ");
-  PRINT_PLMN(data->rplmn);
-  printf("\n");
-
-  for (int i = 0; i < data->eplmn.n_plmns; i++) {
-    printf("EPLMN[%d]\t= ", i);
-    PRINT_PLMN(data->eplmn.plmn[i]);
-    printf("\n");
-  }
-}
diff --git a/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf b/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf
new file mode 100644
index 0000000000000000000000000000000000000000..42d174bbbf6d15431574f3324c01c6b762fde122
--- /dev/null
+++ b/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf
@@ -0,0 +1,112 @@
+# List of known PLMNS
+PLMN: {
+    PLMN0: {
+           FULLNAME="Test network";
+           SHORTNAME="OAI4G";
+           MNC="01";
+           MCC="001";
+
+    };
+    PLMN1: {
+           FULLNAME="SFR France";
+           SHORTNAME="SFR";
+           MNC="10";
+           MCC="208";
+
+    };
+    PLMN2: {
+           FULLNAME="SFR France";
+           SHORTNAME="SFR";
+           MNC="11";
+           MCC="208";
+    };
+    PLMN3: {
+           FULLNAME="SFR France";
+           SHORTNAME="SFR";
+           MNC="13";
+           MCC="208";
+    };
+    PLMN4: {
+           FULLNAME="OAI LTEBOX";
+           SHORTNAME="OAIALU";
+           MNC="93";
+           MCC="208";
+    };
+    PLMN5: {
+           FULLNAME="T-Mobile USA";
+           SHORTNAME="T-Mobile";
+           MNC="280";
+           MCC="310";
+    };
+    PLMN6: {
+           FULLNAME="FICTITIOUS USA";
+           SHORTNAME="FICTITIO";
+           MNC="028";
+           MCC="310";
+    };
+    PLMN7: {
+           FULLNAME="Vodafone Italia";
+           SHORTNAME="VODAFONE";
+           MNC="10";
+           MCC="222";
+    };
+    PLMN8: {
+           FULLNAME="Vodafone Spain";
+           SHORTNAME="VODAFONE";
+           MNC="01";
+           MCC="214";
+    };
+    PLMN9: {
+           FULLNAME="Vodafone Spain";
+           SHORTNAME="VODAFONE";
+           MNC="06";
+           MCC="214";
+    };
+    PLMN10: {
+           FULLNAME="Vodafone Germ";
+           SHORTNAME="VODAFONE";
+           MNC="02";
+           MCC="262";
+    };
+    PLMN11: {
+           FULLNAME="Vodafone Germ";
+           SHORTNAME="VODAFONE";
+           MNC="04";
+           MCC="262";
+    };
+};
+
+UE0:
+{
+    USER: {
+        IMEI="356113022094149";
+        MANUFACTURER="EURECOM";
+        MODEL="LTE Android PC";
+        PIN="0000";
+    };
+
+    SIM: {
+        MSIN="0000001234";
+        USIM_API_K="fec86ba6eb707ed08905757b1bb44b8f";
+        OPC="00000000000000000000000000000000";
+        MSISDN="33611123456";
+    };
+
+    # Home PLMN Selector with Access Technology
+    HPLMN= "20810";
+
+    # User controlled PLMN Selector with Access Technology
+    UCPLMN_LIST = ();
+
+    # Operator PLMN List
+    OPLMN_LIST = ("00101", "20810", "20811", "20813", "310280", "310028");
+
+    # Operator controlled PLMN Selector with Access Technology
+    OCPLMN_LIST = ("22210", "21401", "21406", "26202", "26204");
+
+    # Forbidden plmns
+    FPLMN_LIST = ();
+
+    # List of Equivalent HPLMNs
+    EHPLMN_LIST= ("20811", "20813");
+};
diff --git a/openair3/NAS/TOOLS/usim_data.c b/openair3/NAS/TOOLS/usim_data.c
deleted file mode 100644
index 4e3027691f6c096039cea05481641e43fd136ff0..0000000000000000000000000000000000000000
--- a/openair3/NAS/TOOLS/usim_data.c
+++ /dev/null
@@ -1,668 +0,0 @@
-/*
- * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The OpenAirInterface Software Alliance licenses this file to You under
- * the OAI Public License, Version 1.0  (the "License"); you may not use this file
- * except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.openairinterface.org/?page_id=698
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *-------------------------------------------------------------------------------
- * For more information about the OpenAirInterface (OAI) Software Alliance:
- *      contact@openairinterface.org
- */
-
-/*****************************************************************************
-Source    usim_data.c
-
-Version   0.1
-
-Date    2012/10/31
-
-Product   USIM data generator
-
-Subsystem USIM data generator main process
-
-Author    Frederic Maurel
-
-Description Implements the utility used to generate data stored in the
-    USIM application
-
- *****************************************************************************/
-
-#include "network.h"
-
-#include "usim_api.h"
-#include "memory.h"
-#include "network.h"
-
-#include <stdio.h>  // perror, printf
-#include <stdlib.h> // exit
-#include <string.h> // memset, memcpy, strncpy
-
-
-/****************************************************************************/
-/****************  E X T E R N A L    D E F I N I T I O N S  ****************/
-/****************************************************************************/
-
-#define KSI     USIM_KSI_NOT_AVAILABLE
-#define KSI_ASME    USIM_KSI_NOT_AVAILABLE
-#define INT_ALGO    USIM_INT_EIA2
-#define ENC_ALGO    USIM_ENC_EEA0
-#define SECURITY_ALGORITHMS (ENC_ALGO | INT_ALGO)
-
-#define MIN_TAC     0x0000
-#define MAX_TAC     0xFFFE
-
-#define DEFAULT_TMSI    0x0000000D
-#define DEFAULT_P_TMSI    0x0000000D
-#define DEFAULT_M_TMSI    0x0000000D
-#define DEFAULT_LAC   0xFFFE
-#define DEFAULT_RAC   0x01
-#define DEFAULT_TAC   0x0001
-
-#define DEFAULT_MME_ID    0x0102
-#define DEFAULT_MME_CODE  0x0F
-
-#define PRINT_PLMN_DIGIT(d) if ((d) != 0xf) printf("%u", (d))
-
-#define PRINT_PLMN(plmn)    \
-    PRINT_PLMN_DIGIT((plmn).MCCdigit1); \
-    PRINT_PLMN_DIGIT((plmn).MCCdigit2); \
-    PRINT_PLMN_DIGIT((plmn).MCCdigit3); \
-    PRINT_PLMN_DIGIT((plmn).MNCdigit1); \
-    PRINT_PLMN_DIGIT((plmn).MNCdigit2); \
-    PRINT_PLMN_DIGIT((plmn).MNCdigit3)
-
-/****************************************************************************/
-/*******************  L O C A L    D E F I N I T I O N S  *******************/
-/****************************************************************************/
-
-static void _display_usage(const char* command);
-
-static void _display_usim_data(const usim_data_t* data);
-
-/****************************************************************************/
-/******************  E X P O R T E D    F U N C T I O N S  ******************/
-/****************************************************************************/
-
-int main (int argc, const char* argv[])
-{
-  int rc;
-  usim_data_t usim_data;
-
-  unsigned char gen_data;
-
-  /* Get USIM application pathname */
-  char* path = memory_get_path(USIM_API_NVRAM_DIRNAME,
-                               USIM_API_NVRAM_FILENAME);
-
-  if (path == NULL) {
-    fprintf(stderr, "USIM-API  - Failed to get USIM pathname");
-    free(path);
-    exit(EXIT_FAILURE);
-  }
-
-  /*
-   * Read command line parameters
-   */
-  if (argc != 2) {
-    fprintf(stderr, "Invalid parameter\n");
-    _display_usage(argv[0]);
-    exit(EXIT_FAILURE);
-  } else if ( (strcmp(argv[1], "--gen") == 0) ||
-              (strcmp(argv[1], "-g") == 0) ) {
-    /* Generate USIM data files */
-    gen_data = TRUE;
-  } else if ( (strcmp(argv[1], "--print") == 0) ||
-              (strcmp(argv[1], "-p") == 0) ) {
-    /* Display content of USIM data files */
-    gen_data = FALSE;
-  } else {
-    /* Display usage */
-    _display_usage(argv[0]);
-    exit(EXIT_SUCCESS);
-  }
-
-  if (gen_data) {
-    /*
-     * Initialize USIM data
-     */
-    memset(&usim_data, 0, sizeof(usim_data_t));
-
-#if (SELECTED_PLMN == FCT1)
-    /*
-     * International Mobile Subscriber Identity
-     * IMSI = MCC + MNC + MSIN = 310 (USA) + 028 (UNKNOWN) + 90832150
-     */
-#warning "IMSI 310.028.90832150"
-    usim_data.imsi.length = 8;
-    usim_data.imsi.u.num.parity = EVEN_PARITY;      // Parity: even
-    usim_data.imsi.u.num.digit1 = 3;                // MCC digit 1
-    usim_data.imsi.u.num.digit2 = 1;                // MCC digit 2
-    usim_data.imsi.u.num.digit3 = 0;                // MCC digit 3
-    usim_data.imsi.u.num.digit4 = 0;                // MNC digit 1
-    usim_data.imsi.u.num.digit5 = 2;                // MNC digit 2
-    usim_data.imsi.u.num.digit6 = 8;                // MNC digit 3
-    usim_data.imsi.u.num.digit7 = 9;
-    usim_data.imsi.u.num.digit8 = 0;
-    usim_data.imsi.u.num.digit9 = 8;
-    usim_data.imsi.u.num.digit10 = 3;
-    usim_data.imsi.u.num.digit11 = 2;
-    usim_data.imsi.u.num.digit12 = 1;
-    usim_data.imsi.u.num.digit13 = 5;
-    usim_data.imsi.u.num.digit14 = 0;
-    usim_data.imsi.u.num.digit15 = 0b1111;
-#endif
-#if (SELECTED_PLMN == SFR1)
-
-    /*
-     * International Mobile Subscriber Identity
-     * IMSI = MCC + MNC + MSIN = 208 (France) + 10 (SFR) + 00001234
-     */
-#warning "IMSI 208.10.00001234"
-
-    usim_data.imsi.length = 8;
-    usim_data.imsi.u.num.parity = EVEN_PARITY;      // Parity: even
-    usim_data.imsi.u.num.digit1 = 2;                // MCC digit 1
-    usim_data.imsi.u.num.digit2 = 0;                // MCC digit 2
-    usim_data.imsi.u.num.digit3 = 8;                // MCC digit 3
-    usim_data.imsi.u.num.digit4 = 1;                // MNC digit 1
-    usim_data.imsi.u.num.digit5 = 0;                // MNC digit 2
-    usim_data.imsi.u.num.digit6 = 0;//0b1111;     // MNC digit 3
-    usim_data.imsi.u.num.digit7 = 0;
-    usim_data.imsi.u.num.digit8 = 0;
-    usim_data.imsi.u.num.digit9 = 0;
-    usim_data.imsi.u.num.digit10 = 0;
-    usim_data.imsi.u.num.digit11 = 1;
-    usim_data.imsi.u.num.digit12 = 2;
-    usim_data.imsi.u.num.digit13 = 3;
-    usim_data.imsi.u.num.digit14 = 4;
-    usim_data.imsi.u.num.digit15 = 0b1111;
-#endif
-#if (SELECTED_PLMN == OAI_LTEBOX)
-    /*
-     * International Mobile Subscriber Identity
-     * IMSI = MCC + MNC + MSIN = 208 (France) + 10 (SFR) + 00001234
-     */
-#warning "IMSI 208.93.0100001111"
-    usim_data.imsi.length = 8;
-    usim_data.imsi.u.num.parity = ODD_PARITY;      // Parity: even
-    usim_data.imsi.u.num.digit1 = 2;                // MCC digit 1
-    usim_data.imsi.u.num.digit2 = 0;                // MCC digit 2
-    usim_data.imsi.u.num.digit3 = 8;                // MCC digit 3
-    usim_data.imsi.u.num.digit4 = 9;                // MNC digit 1
-    usim_data.imsi.u.num.digit5 = 3;                // MNC digit 2
-    usim_data.imsi.u.num.digit6 = 0;     // MNC digit 3
-    usim_data.imsi.u.num.digit7 = 1;
-    usim_data.imsi.u.num.digit8 = 0;
-    usim_data.imsi.u.num.digit9 = 0;
-    usim_data.imsi.u.num.digit10 = 0;
-    usim_data.imsi.u.num.digit11 = 0;
-    usim_data.imsi.u.num.digit12 = 1;
-    usim_data.imsi.u.num.digit13 = 1;
-    usim_data.imsi.u.num.digit14 = 1;
-    usim_data.imsi.u.num.digit15 = 1;
-#endif
-#if (SELECTED_PLMN == TEST1)
-#warning "IMSI 001.01.000001234"
-    usim_data.imsi.length = 8;
-    usim_data.imsi.u.num.parity = 0x0;  // Type of identity = IMSI, even
-    usim_data.imsi.u.num.digit1 = 0;    // MCC digit 1
-    usim_data.imsi.u.num.digit2 = 0;    // MCC digit 2
-    usim_data.imsi.u.num.digit3 = 1;    // MCC digit 3
-    usim_data.imsi.u.num.digit4 = 0;    // MNC digit 1
-    usim_data.imsi.u.num.digit5 = 1;    // MNC digit 2
-    usim_data.imsi.u.num.digit6 = 0;
-    usim_data.imsi.u.num.digit7 = 0;
-    usim_data.imsi.u.num.digit8 = 0;
-    usim_data.imsi.u.num.digit9 = 0;
-    usim_data.imsi.u.num.digit10 = 0;
-    usim_data.imsi.u.num.digit11 = 1;
-    usim_data.imsi.u.num.digit12 = 2;
-    usim_data.imsi.u.num.digit13 = 3;
-    usim_data.imsi.u.num.digit14 = 4;
-    usim_data.imsi.u.num.digit15 = 0xF;
-    usim_data.usimtestmode = 1; // set usim in test mode in order to get the CMW500 K key
-#endif
-    /*
-     * Ciphering and Integrity Keys
-     */
-    usim_data.keys.ksi = KSI;
-    memset(&usim_data.keys.ck, 0, USIM_CK_SIZE);
-    memset(&usim_data.keys.ik, 0, USIM_IK_SIZE);
-
-    /*
-     * Higher Priority PLMN search period
-     */
-    usim_data.hpplmn = 0x00;  /* Disable timer */
-
-    /*
-     * List of Forbidden PLMNs
-     */
-    for (int i = 0; i < USIM_FPLMN_MAX; i++) {
-      memset(&usim_data.fplmn[i], 0xff, sizeof(plmn_t));
-    }
-
-    /*
-     * Location Information
-     */
-    usim_data.loci.tmsi = DEFAULT_TMSI;
-    usim_data.loci.lai.plmn = network_records[SELECTED_PLMN].plmn;
-    usim_data.loci.lai.lac = DEFAULT_LAC;
-    usim_data.loci.status = USIM_LOCI_NOT_UPDATED;
-    /*
-     * Packet Switched Location Information
-     */
-    usim_data.psloci.p_tmsi = DEFAULT_P_TMSI;
-    usim_data.psloci.signature[0] = 0x01;
-    usim_data.psloci.signature[1] = 0x02;
-    usim_data.psloci.signature[2] = 0x03;
-    usim_data.psloci.rai.plmn = network_records[SELECTED_PLMN].plmn;
-    usim_data.psloci.rai.lac = DEFAULT_LAC;
-    usim_data.psloci.rai.rac = DEFAULT_RAC;
-    usim_data.psloci.status = USIM_PSLOCI_NOT_UPDATED;
-    /*
-     * Administrative Data
-     */
-    usim_data.ad.UE_Operation_Mode = USIM_NORMAL_MODE;
-    usim_data.ad.Additional_Info = 0xffff;
-    usim_data.ad.MNC_Length = 2;
-    /*
-     * EPS NAS security context
-     */
-    usim_data.securityctx.length = 52;
-    usim_data.securityctx.KSIasme.type = USIM_KSI_ASME_TAG;
-    usim_data.securityctx.KSIasme.length = 1;
-    usim_data.securityctx.KSIasme.value[0] = KSI_ASME;
-    usim_data.securityctx.Kasme.type = USIM_K_ASME_TAG;
-    usim_data.securityctx.Kasme.length = USIM_K_ASME_SIZE;
-    memset(usim_data.securityctx.Kasme.value, 0,
-           usim_data.securityctx.Kasme.length);
-    usim_data.securityctx.ulNAScount.type = USIM_UL_NAS_COUNT_TAG;
-    usim_data.securityctx.ulNAScount.length = USIM_UL_NAS_COUNT_SIZE;
-    memset(usim_data.securityctx.ulNAScount.value, 0,
-           usim_data.securityctx.ulNAScount.length);
-    usim_data.securityctx.dlNAScount.type = USIM_DL_NAS_COUNT_TAG;
-    usim_data.securityctx.dlNAScount.length = USIM_DL_NAS_COUNT_SIZE;
-    memset(usim_data.securityctx.dlNAScount.value, 0,
-           usim_data.securityctx.dlNAScount.length);
-    usim_data.securityctx.algorithmID.type = USIM_INT_ENC_ALGORITHMS_TAG;
-    usim_data.securityctx.algorithmID.length = 1;
-    usim_data.securityctx.algorithmID.value[0] = SECURITY_ALGORITHMS;
-    /*
-     * Subcriber's Number
-     */
-    usim_data.msisdn.length = 7;
-    usim_data.msisdn.number.ext = 1;
-    usim_data.msisdn.number.ton = MSISDN_TON_UNKNOWKN;
-    usim_data.msisdn.number.npi = MSISDN_NPI_ISDN_TELEPHONY;
-    usim_data.msisdn.number.digit[0].msb = 3;
-    usim_data.msisdn.number.digit[0].lsb = 3;
-    usim_data.msisdn.number.digit[1].msb = 6;
-    usim_data.msisdn.number.digit[1].lsb = 1;
-    usim_data.msisdn.number.digit[2].msb = 1;
-    usim_data.msisdn.number.digit[2].lsb = 1;
-    usim_data.msisdn.number.digit[3].msb = 2;
-    usim_data.msisdn.number.digit[3].lsb = 3;
-    usim_data.msisdn.number.digit[4].msb = 4;
-    usim_data.msisdn.number.digit[4].lsb = 5;
-    usim_data.msisdn.number.digit[5].msb = 6;
-    usim_data.msisdn.number.digit[5].lsb = 0xf;
-    usim_data.msisdn.number.digit[6].msb = 0xf;
-    usim_data.msisdn.number.digit[6].lsb = 0xf;
-    usim_data.msisdn.number.digit[7].msb = 0xf;
-    usim_data.msisdn.number.digit[7].lsb = 0xf;
-    usim_data.msisdn.number.digit[8].msb = 0xf;
-    usim_data.msisdn.number.digit[8].lsb = 0xf;
-    usim_data.msisdn.number.digit[9].msb = 0xf;
-    usim_data.msisdn.number.digit[9].lsb = 0xf;
-    usim_data.msisdn.conf1_record_id = 0xff;  /* Not used */
-    usim_data.msisdn.ext1_record_id = 0xff;   /* Not used */
-
-    /*
-     * PLMN Network Name and Operator PLMN List
-     */
-    for (int i = TEST1; i < VDF1; i++) {
-      network_record_t record = network_records[i];
-      usim_data.pnn[i].fullname.type = USIM_PNN_FULLNAME_TAG;
-      usim_data.pnn[i].fullname.length = strlen(record.fullname);
-      strncpy((char*)usim_data.pnn[i].fullname.value, record.fullname,
-              usim_data.pnn[i].fullname.length);
-      usim_data.pnn[i].shortname.type = USIM_PNN_SHORTNAME_TAG;
-      usim_data.pnn[i].shortname.length = strlen(record.shortname);
-      strncpy((char*)usim_data.pnn[i].shortname.value, record.shortname,
-              usim_data.pnn[i].shortname.length);
-      usim_data.opl[i].plmn = record.plmn;
-      usim_data.opl[i].start = record.tac_start;
-      usim_data.opl[i].end = record.tac_end;
-      usim_data.opl[i].record_id = i;
-    }
-
-    for (int i = VDF2; i < USIM_OPL_MAX; i++) {
-      memset(&usim_data.opl[i].plmn, 0xff, sizeof(plmn_t));
-    }
-
-    /*
-     * List of Equivalent HPLMNs
-     */
-    usim_data.ehplmn[0] = network_records[SFR2].plmn;
-    usim_data.ehplmn[1] = network_records[SFR3].plmn;
-    /*
-     * Home PLMN Selector with Access Technology
-     */
-    usim_data.hplmn.plmn = network_records[SELECTED_PLMN].plmn;
-    usim_data.hplmn.AcT = (USIM_ACT_GSM | USIM_ACT_UTRAN | USIM_ACT_EUTRAN);
-
-    /*
-     * List of user controlled PLMN selector with Access Technology
-     */
-    for (int i = 0; i < USIM_PLMN_MAX; i++) {
-      memset(&usim_data.plmn[i], 0xff, sizeof(plmn_t));
-    }
-
-    /*
-     * List of operator controlled PLMN selector with Access Technology
-     */
-    usim_data.oplmn[0].plmn = network_records[VDF1].plmn;
-    usim_data.oplmn[0].AcT = (USIM_ACT_GSM | USIM_ACT_UTRAN | USIM_ACT_EUTRAN);
-    usim_data.oplmn[1].plmn = network_records[VDF2].plmn;
-    usim_data.oplmn[1].AcT = (USIM_ACT_GSM | USIM_ACT_UTRAN | USIM_ACT_EUTRAN);
-    usim_data.oplmn[2].plmn = network_records[VDF3].plmn;
-    usim_data.oplmn[2].AcT = (USIM_ACT_GSM | USIM_ACT_UTRAN | USIM_ACT_EUTRAN);
-    usim_data.oplmn[3].plmn = network_records[VDF4].plmn;
-    usim_data.oplmn[3].AcT = (USIM_ACT_GSM | USIM_ACT_UTRAN | USIM_ACT_EUTRAN);
-    usim_data.oplmn[4].plmn = network_records[VDF5].plmn;
-    usim_data.oplmn[4].AcT = (USIM_ACT_GSM | USIM_ACT_UTRAN | USIM_ACT_EUTRAN);
-
-    for (int i = 5; i < USIM_OPLMN_MAX; i++) {
-      memset(&usim_data.oplmn[i], 0xff, sizeof(plmn_t));
-    }
-
-    /*
-     * EPS Location Information
-     */
-    usim_data.epsloci.guti.gummei.plmn = network_records[SELECTED_PLMN].plmn;
-    usim_data.epsloci.guti.gummei.MMEgid = DEFAULT_MME_ID;
-    usim_data.epsloci.guti.gummei.MMEcode = DEFAULT_MME_CODE;
-    usim_data.epsloci.guti.m_tmsi = DEFAULT_M_TMSI;
-    usim_data.epsloci.tai.plmn = usim_data.epsloci.guti.gummei.plmn;
-    usim_data.epsloci.tai.tac = DEFAULT_TAC;
-    usim_data.epsloci.status = USIM_EPSLOCI_UPDATED;
-    /*
-     * Non-Access Stratum configuration
-     */
-    usim_data.nasconfig.NAS_SignallingPriority.type = USIM_NAS_SIGNALLING_PRIORITY_TAG;
-    usim_data.nasconfig.NAS_SignallingPriority.length = 1;
-    usim_data.nasconfig.NAS_SignallingPriority.value[0] = 0x00;
-    usim_data.nasconfig.NMO_I_Behaviour.type = USIM_NMO_I_BEHAVIOUR_TAG;
-    usim_data.nasconfig.NMO_I_Behaviour.length = 1;
-    usim_data.nasconfig.NMO_I_Behaviour.value[0] = 0x00;
-    usim_data.nasconfig.AttachWithImsi.type = USIM_ATTACH_WITH_IMSI_TAG;
-    usim_data.nasconfig.AttachWithImsi.length = 1;
-#if defined(START_WITH_GUTI)
-    usim_data.nasconfig.AttachWithImsi.value[0] = 0x00;
-#else
-    usim_data.nasconfig.AttachWithImsi.value[0] = 0x01;
-#endif
-    usim_data.nasconfig.MinimumPeriodicSearchTimer.type = USIM_MINIMUM_PERIODIC_SEARCH_TIMER_TAG;
-    usim_data.nasconfig.MinimumPeriodicSearchTimer.length = 1;
-    usim_data.nasconfig.MinimumPeriodicSearchTimer.value[0] = 0x00;
-    usim_data.nasconfig.ExtendedAccessBarring.type = USIM_EXTENDED_ACCESS_BARRING_TAG;
-    usim_data.nasconfig.ExtendedAccessBarring.length = 1;
-    usim_data.nasconfig.ExtendedAccessBarring.value[0] = 0x00;
-    usim_data.nasconfig.Timer_T3245_Behaviour.type = USIM_TIMER_T3245_BEHAVIOUR_TAG;
-    usim_data.nasconfig.Timer_T3245_Behaviour.length = 1;
-    usim_data.nasconfig.Timer_T3245_Behaviour.value[0] = 0x00;
-
-    /*
-     * Write USIM application data
-     */
-    rc = usim_api_write(path, &usim_data);
-
-    if (rc != RETURNok) {
-      perror("ERROR\t: usim_api_write() failed");
-      exit(EXIT_FAILURE);
-    }
-  }
-
-  /*
-   * Read USIM application data
-   */
-  memset(&usim_data, 0, sizeof(usim_data_t));
-  rc = usim_api_read(path, &usim_data);
-
-  if (rc != RETURNok) {
-    perror("ERROR\t: usim_api_read() failed");
-    exit(EXIT_FAILURE);
-  }
-
-  /*
-   * Display USIM application data
-   */
-  printf("\nUSIM data:\n\n");
-  _display_usim_data(&usim_data);
-
-  /*
-   * Display USIM file location
-   */
-  printf("\nUSIM data file: %s\n", path);
-  free(path);
-
-  exit(EXIT_SUCCESS);
-}
-
-/****************************************************************************/
-/*********************  L O C A L    F U N C T I O N S  *********************/
-/****************************************************************************/
-
-/*
- * Displays command line usage
- */
-static void _display_usage(const char* command)
-{
-  fprintf(stderr, "usage: %s [OPTION]\n", command);
-  fprintf(stderr, "\t[--gen|-g]\tGenerate the USIM data file\n");
-  fprintf(stderr, "\t[--print|-p]\tDisplay the content of the USIM data file\n");
-  fprintf(stderr, "\t[--help|-h]\tDisplay this usage\n");
-  const char* path = getenv("USIM_DIR");
-
-  if (path != NULL) {
-    fprintf(stderr, "USIM_DIR = %s\n", path);
-  } else {
-    fprintf(stderr, "USIM_DIR environment variable is not defined\n");
-  }
-}
-
-/*
- * Displays USIM application data
- */
-static void _display_usim_data(const usim_data_t* data)
-{
-  int digits;
-
-  printf("Administrative Data:\n");
-  printf("\tUE_Operation_Mode\t= 0x%.2x\n", data->ad.UE_Operation_Mode);
-  printf("\tAdditional_Info\t\t= 0x%.4x\n", data->ad.Additional_Info);
-  printf("\tMNC_Length\t\t= %d\n\n", data->ad.MNC_Length);
-
-  printf("IMSI:\n");
-  printf("\tlength\t= %d\n", data->imsi.length);
-  printf("\tparity\t= %s\n", data->imsi.u.num.parity == EVEN_PARITY ? "Even" : "Odd");
-  digits = (data->imsi.length * 2) - 1 - (data->imsi.u.num.parity == EVEN_PARITY ? 1 : 0);
-  printf("\tdigits\t= %d\n", digits);
-  
-  printf("\tdigits\t= %u%u%u%u%u%x%u%u%u%u",
-         data->imsi.u.num.digit1, // MCC digit 1
-         data->imsi.u.num.digit2, // MCC digit 2
-         data->imsi.u.num.digit3, // MCC digit 3
-         data->imsi.u.num.digit4, // MNC digit 1
-         data->imsi.u.num.digit5, // MNC digit 2
-         data->imsi.u.num.digit6==0xf?0:data->imsi.u.num.digit6, // MNC digit 3
-         data->imsi.u.num.digit7,
-         data->imsi.u.num.digit8,
-         data->imsi.u.num.digit9,
-         data->imsi.u.num.digit10);
-
-  if (digits >= 11)
-    printf("%x", data->imsi.u.num.digit11);
-
-  if (digits >= 12)
-    printf("%x", data->imsi.u.num.digit12);
-
-  if (digits >= 13)
-    printf("%x", data->imsi.u.num.digit13);
-
-  if (digits >= 14)
-    printf("%x", data->imsi.u.num.digit14);
-
-  if (digits >= 15)
-    printf("%x", data->imsi.u.num.digit15);
-
-  printf("\n\n");
-
-  printf("Ciphering and Integrity Keys:\n");
-  printf("\tKSI\t: 0x%.2x\n", data->keys.ksi);
-  char key[USIM_CK_SIZE + 1];
-  key[USIM_CK_SIZE] = '\0';
-  memcpy(key, data->keys.ck, USIM_CK_SIZE);
-  printf("\tCK\t: \"%s\"\n", key);
-  memcpy(key, data->keys.ik, USIM_IK_SIZE);
-  printf("\tIK\t: \"%s\"\n", key);
-
-  printf("EPS NAS security context:\n");
-  printf("\tKSIasme\t: 0x%.2x\n", data->securityctx.KSIasme.value[0]);
-  char kasme[USIM_K_ASME_SIZE + 1];
-  kasme[USIM_K_ASME_SIZE] = '\0';
-  memcpy(kasme, data->securityctx.Kasme.value, USIM_K_ASME_SIZE);
-  printf("\tKasme\t: \"%s\"\n", kasme);
-  printf("\tulNAScount\t: 0x%.8x\n",
-         *(uint32_t*)data->securityctx.ulNAScount.value);
-  printf("\tdlNAScount\t: 0x%.8x\n",
-         *(uint32_t*)data->securityctx.dlNAScount.value);
-  printf("\talgorithmID\t: 0x%.2x\n\n",
-         data->securityctx.algorithmID.value[0]);
-
-  printf("MSISDN\t= %u%u%u %u%u%u%u %u%u%u%u\n\n",
-         data->msisdn.number.digit[0].msb,
-         data->msisdn.number.digit[0].lsb,
-         data->msisdn.number.digit[1].msb,
-         data->msisdn.number.digit[1].lsb,
-         data->msisdn.number.digit[2].msb,
-         data->msisdn.number.digit[2].lsb,
-         data->msisdn.number.digit[3].msb,
-         data->msisdn.number.digit[3].lsb,
-         data->msisdn.number.digit[4].msb,
-         data->msisdn.number.digit[4].lsb,
-         data->msisdn.number.digit[5].msb);
-
-  for (int i = 0; i < USIM_PNN_MAX; i++) {
-    printf("PNN[%d]\t= {%s, %s}\n", i,
-           data->pnn[i].fullname.value, data->pnn[i].shortname.value);
-  }
-
-  printf("\n");
-
-  for (int i = 0; i < USIM_OPL_MAX; i++) {
-    printf("OPL[%d]\t= ", i);
-    PRINT_PLMN(data->opl[i].plmn);
-    printf(", TAC = [%.4x - %.4x], record_id = %d\n",
-           data->opl[i].start, data->opl[i].end, data->opl[i].record_id);
-  }
-
-  printf("\n");
-
-  printf("HPLMN\t\t= ");
-  PRINT_PLMN(data->hplmn.plmn);
-  printf(", AcT = 0x%x\n\n", data->hplmn.AcT);
-
-  for (int i = 0; i < USIM_FPLMN_MAX; i++) {
-    printf("FPLMN[%d]\t= ", i);
-    PRINT_PLMN(data->fplmn[i]);
-    printf("\n");
-  }
-
-  printf("\n");
-
-  for (int i = 0; i < USIM_EHPLMN_MAX; i++) {
-    printf("EHPLMN[%d]\t= ", i);
-    PRINT_PLMN(data->ehplmn[i]);
-    printf("\n");
-  }
-
-  printf("\n");
-
-  for (int i = 0; i < USIM_PLMN_MAX; i++) {
-    printf("PLMN[%d]\t\t= ", i);
-    PRINT_PLMN(data->plmn[i].plmn);
-    printf(", AcTPLMN = 0x%x", data->plmn[i].AcT);
-    printf("\n");
-  }
-
-  printf("\n");
-
-  for (int i = 0; i < USIM_OPLMN_MAX; i++) {
-    printf("OPLMN[%d]\t= ", i);
-    PRINT_PLMN(data->oplmn[i].plmn);
-    printf(", AcTPLMN = 0x%x", data->oplmn[i].AcT);
-    printf("\n");
-  }
-
-  printf("\n");
-
-  printf("HPPLMN\t\t= 0x%.2x (%d minutes)\n\n", data->hpplmn, data->hpplmn);
-
-  printf("LOCI:\n");
-  printf("\tTMSI = 0x%.4x\n", data->loci.tmsi);
-  printf("\tLAI\t: PLMN = ");
-  PRINT_PLMN(data->loci.lai.plmn);
-  printf(", LAC = 0x%.2x\n", data->loci.lai.lac);
-  printf("\tstatus\t= %d\n\n", data->loci.status);
-
-  printf("PSLOCI:\n");
-  printf("\tP-TMSI = 0x%.4x\n", data->psloci.p_tmsi);
-  printf("\tsignature = 0x%x 0x%x 0x%x\n",
-         data->psloci.signature[0],
-         data->psloci.signature[1],
-         data->psloci.signature[2]);
-  printf("\tRAI\t: PLMN = ");
-  PRINT_PLMN(data->psloci.rai.plmn);
-  printf(", LAC = 0x%.2x, RAC = 0x%.1x\n",
-         data->psloci.rai.lac, data->psloci.rai.rac);
-  printf("\tstatus\t= %d\n\n", data->psloci.status);
-
-  printf("EPSLOCI:\n");
-  printf("\tGUTI\t: GUMMEI\t: (PLMN = ");
-  PRINT_PLMN(data->epsloci.guti.gummei.plmn);
-  printf(", MMEgid = 0x%.2x, MMEcode = 0x%.1x)",
-         data->epsloci.guti.gummei.MMEgid,
-         data->epsloci.guti.gummei.MMEcode);
-  printf(", M-TMSI = 0x%.4x\n", data->epsloci.guti.m_tmsi);
-  printf("\tTAI\t: PLMN = ");
-  PRINT_PLMN(data->epsloci.tai.plmn);
-  printf(", TAC = 0x%.2x\n",
-         data->epsloci.tai.tac);
-  printf("\tstatus\t= %d\n\n", data->epsloci.status);
-
-  printf("NASCONFIG:\n");
-  printf("\tNAS_SignallingPriority\t\t: 0x%.2x\n",
-         data->nasconfig.NAS_SignallingPriority.value[0]);
-  printf("\tNMO_I_Behaviour\t\t\t: 0x%.2x\n",
-         data->nasconfig.NMO_I_Behaviour.value[0]);
-  printf("\tAttachWithImsi\t\t\t: 0x%.2x\n",
-         data->nasconfig.AttachWithImsi.value[0]);
-  printf("\tMinimumPeriodicSearchTimer\t: 0x%.2x\n",
-         data->nasconfig.MinimumPeriodicSearchTimer.value[0]);
-  printf("\tExtendedAccessBarring\t\t: 0x%.2x\n",
-         data->nasconfig.ExtendedAccessBarring.value[0]);
-  printf("\tTimer_T3245_Behaviour\t\t: 0x%.2x\n",
-         data->nasconfig.Timer_T3245_Behaviour.value[0]);
-}
-
diff --git a/openair3/NAS/UE/API/USIM/aka_functions.c b/openair3/NAS/UE/API/USIM/aka_functions.c
index 68efb2b24a8ae626a2b28bbf34eb934dd61ea437..4d8f4cd1d31b33370056cea6e4b9556319e5a369 100644
--- a/openair3/NAS/UE/API/USIM/aka_functions.c
+++ b/openair3/NAS/UE/API/USIM/aka_functions.c
@@ -49,16 +49,14 @@
  *
  *-----------------------------------------------------------------*/
 void f1    ( u8 k_pP[16], u8 rand_pP[16], u8 sqn_pP[6], u8 amf_pP[2],
-             u8 mac_a_pP[8], const u8 op[16])
+             u8 mac_a_pP[8], const u8 op_c[16])
 {
-  u8 op_c[16];
   u8 temp[16];
   u8 in1[16];
   u8 out1[16];
   u8 rijndaelInput[16];
   u8 i;
   RijndaelKeySchedule( k_pP );
-  ComputeOPc(op, op_c);
 
   for (i=0; i<16; i++)
     rijndaelInput[i] = rand_pP[i] ^ op_c[i];
@@ -104,9 +102,8 @@ void f1    ( u8 k_pP[16], u8 rand_pP[16], u8 sqn_pP[6], u8 amf_pP[2],
  *
  *-----------------------------------------------------------------*/
 void f2345 ( u8 k_pP[16], u8 rand_pP[16],
-             u8 res_pP[8], u8 ck_pP[16], u8 ik_pP[16], u8 ak_pP[6],const u8 op[16])
+             u8 res_pP[8], u8 ck_pP[16], u8 ik_pP[16], u8 ak_pP[6],const u8 op_c[16])
 {
-  u8 op_c[16];
   u8 temp[16];
   u8 out[16];
   u8 rijndaelInput[16];
@@ -122,7 +119,6 @@ void f2345 ( u8 k_pP[16], u8 rand_pP[16],
             rand_pP[8],rand_pP[9],rand_pP[10],rand_pP[11],rand_pP[12],rand_pP[13],rand_pP[14],rand_pP[15]);
 
   RijndaelKeySchedule( k_pP );
-  ComputeOPc(op, op_c);
 
   for (i=0; i<16; i++)
     rijndaelInput[i] = rand_pP[i] ^ op_c[i];
@@ -205,16 +201,14 @@ void f2345 ( u8 k_pP[16], u8 rand_pP[16],
  *
  *-----------------------------------------------------------------*/
 void f1star( u8 k_pP[16], u8 rand_pP[16], u8 sqn_pP[6], u8 amf_pP[2],
-             u8 mac_s_pP[8],const u8 op[16])
+             u8 mac_s_pP[8],const u8 op_c[16])
 {
-  u8 op_c[16];
   u8 temp[16];
   u8 in1[16];
   u8 out1[16];
   u8 rijndaelInput[16];
   u8 i;
   RijndaelKeySchedule( k_pP );
-  ComputeOPc(op, op_c);
 
   for (i=0; i<16; i++)
     rijndaelInput[i] = rand_pP[i] ^ op_c[i];
@@ -260,15 +254,13 @@ void f1star( u8 k_pP[16], u8 rand_pP[16], u8 sqn_pP[6], u8 amf_pP[2],
  *
  *-----------------------------------------------------------------*/
 void f5star( u8 k_pP[16], u8 rand_pP[16],
-             u8 ak_pP[6], const u8 op[16])
+             u8 ak_pP[6], const u8 op_c[16])
 {
-  u8 op_c[16];
   u8 temp[16];
   u8 out[16];
   u8 rijndaelInput[16];
   u8 i;
   RijndaelKeySchedule( k_pP );
-  ComputeOPc(op, op_c);
 
   for (i=0; i<16; i++)
     rijndaelInput[i] = rand_pP[i] ^ op_c[i];
diff --git a/openair3/NAS/UE/API/USIM/usim_api.c b/openair3/NAS/UE/API/USIM/usim_api.c
index ef6b4f910102e408363e61b059b3004d7012381f..e281999a093779d02199acce5836e7b69c26316d 100644
--- a/openair3/NAS/UE/API/USIM/usim_api.c
+++ b/openair3/NAS/UE/API/USIM/usim_api.c
@@ -88,22 +88,6 @@ int usim_api_read(const char *filename, usim_data_t* data)
     LOG_FUNC_RETURN (RETURNerror);
   }
 
-  /* initialize the subscriber authentication security key */
-  hex_string_to_hex_value(data->keys.usim_api_k, USIM_API_K_VALUE, USIM_API_K_SIZE);
-
-  // initialize OP
-  /* PFT OP used currently in HSS (OPENAIRHSS/auc/kdf.c) */
-  #define OAI_LTEBOX
-
-  #ifdef OAI_LTEBOX
-  u8 _op[16] = {0x10, 0x06, 0x02, 0x0f, 0x0a, 0x47, 0x8b, 0xf6,
-             0xb6, 0x99, 0xf1, 0x5c, 0x06, 0x2e, 0x42, 0xb3 };
-  #else
-  u8 _op[16] = {0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
-             0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11 };
-  #endif
-  memcpy(data->keys.op, _op, sizeof(_op));
-
   LOG_FUNC_RETURN (RETURNok);
 }
 
@@ -367,7 +351,7 @@ int usim_api_authenticate(usim_data_t *usim_data, const OctetString* rand_pP, co
 
   u8 ak[USIM_API_AK_SIZE];
   f2345(usim_data->keys.usim_api_k, rand_pP->value,
-        res_pP->value, ck_pP->value, ik_pP->value, ak, usim_data->keys.op);
+        res_pP->value, ck_pP->value, ik_pP->value, ak, usim_data->keys.opc);
   LOG_TRACE(INFO, "USIM-API  - res(f2)  :%s",dump_octet_string(res_pP));
   LOG_TRACE(INFO, "USIM-API  - ck(f3)   :%s",dump_octet_string(ck_pP));
   LOG_TRACE(INFO, "USIM-API  - ik(f4)   :%s",dump_octet_string(ik_pP));
@@ -388,7 +372,7 @@ int usim_api_authenticate(usim_data_t *usim_data, const OctetString* rand_pP, co
   /* Compute XMAC = f1K (SQN || RAND || AMF) */
 #define USIM_API_XMAC_SIZE 8
   u8 xmac[USIM_API_XMAC_SIZE];
-  f1(usim_data->keys.usim_api_k, rand_pP->value, sqn, &autn_pP->value[USIM_API_SQN_SIZE], xmac, usim_data->keys.op);
+  f1(usim_data->keys.usim_api_k, rand_pP->value, sqn, &autn_pP->value[USIM_API_SQN_SIZE], xmac, usim_data->keys.opc);
   LOG_TRACE(DEBUG,
             "USIM-API  - Computed XMAC %02X%02X%02X%02X%02X%02X%02X%02X",
             xmac[0],xmac[1],xmac[2],xmac[3],
@@ -416,7 +400,7 @@ int usim_api_authenticate(usim_data_t *usim_data, const OctetString* rand_pP, co
 
     /* Concealed value of the counter SQNms in the USIM:
      * Conc(SQNMS) = SQNMS ⊕ f5*K(RAND) */
-    f5star(usim_data->keys.usim_api_k, rand_pP->value, ak, usim_data->keys.op);
+    f5star(usim_data->keys.usim_api_k, rand_pP->value, ak, usim_data->keys.opc);
 
 
     u8 sqn_ms[USIM_API_SQNMS_SIZE];
@@ -445,7 +429,7 @@ int usim_api_authenticate(usim_data_t *usim_data, const OctetString* rand_pP, co
 #define USIM_API_MACS_SIZE USIM_API_XMAC_SIZE
     u8 macs[USIM_API_MACS_SIZE];
     f1star(usim_data->keys.usim_api_k, rand_pP->value, sqn_ms,
-           &rand_pP->value[USIM_API_SQN_SIZE], macs, usim_data->keys.op);
+           &rand_pP->value[USIM_API_SQN_SIZE], macs, usim_data->keys.opc);
     LOG_TRACE(DEBUG, "USIM-API  - MACS %02X%02X%02X%02X%02X%02X%02X%02X",
               macs[0],macs[1],macs[2],macs[3],
               macs[4],macs[5],macs[6],macs[7]);
diff --git a/openair3/NAS/UE/API/USIM/usim_api.h b/openair3/NAS/UE/API/USIM/usim_api.h
index 74123029dd9406aabcbe9d74c3636da0bd8dc2d2..5915d914bf88ba2fdec1a0dff374c4b0d78b29ee 100644
--- a/openair3/NAS/UE/API/USIM/usim_api.h
+++ b/openair3/NAS/UE/API/USIM/usim_api.h
@@ -124,7 +124,7 @@ typedef struct {
 #define USIM_IK_SIZE  16
   Byte_t ik[USIM_IK_SIZE];
   uint8_t usim_api_k[USIM_API_K_SIZE];
-  uint8_t op[16];
+  uint8_t opc[16];
 } usim_keys_t;
 
 /*
diff --git a/openair3/NAS/UE/nas_ue_task.c b/openair3/NAS/UE/nas_ue_task.c
index efb17a13c2b4657765a2c3e5634a02b8a8210fae..d548d480c78d5b30675864e931139b6aaff7dca8 100644
--- a/openair3/NAS/UE/nas_ue_task.c
+++ b/openair3/NAS/UE/nas_ue_task.c
@@ -104,21 +104,21 @@ void *nas_ue_task(void *args_p)
     user->ueid=i;
 
     /* Get USIM data application filename */
-    user->usim_data_store = memory_get_path(USIM_API_NVRAM_DIRNAME, USIM_API_NVRAM_FILENAME);
+    user->usim_data_store = memory_get_path_from_ueid(USIM_API_NVRAM_DIRNAME, USIM_API_NVRAM_FILENAME, user->ueid);
     if ( user->usim_data_store == NULL ) {
-      LOG_E(NAS, "[UE %d] - Failed to get USIM data application filename", user->ueid);
+      LOG_E(NAS, "[UE %d] - Failed to get USIM data application filename", user->ueid, user->ueid);
       exit(EXIT_FAILURE);
     }
 
     /* Get UE's data pathname */
-    user->user_nvdata_store = memory_get_path(USER_NVRAM_DIRNAME, USER_NVRAM_FILENAME);
+    user->user_nvdata_store = memory_get_path_from_ueid(USER_NVRAM_DIRNAME, USER_NVRAM_FILENAME, user->ueid);
     if ( user->user_nvdata_store == NULL ) {
       LOG_E(NAS, "[UE %d] - Failed to get USIM nvdata filename", user->ueid);
       exit(EXIT_FAILURE);
     }
 
     /* Get EMM data pathname */
-    user->emm_nvdata_store = memory_get_path(EMM_NVRAM_DIRNAME, EMM_NVRAM_FILENAME);
+    user->emm_nvdata_store = memory_get_path_from_ueid(EMM_NVRAM_DIRNAME, EMM_NVRAM_FILENAME, user->ueid);
     if ( user->emm_nvdata_store == NULL ) {
       LOG_E(NAS, "[UE %d] - Failed to get EMM nvdata filename", user->ueid);
       exit(EXIT_FAILURE);