Commit 7fe8d45d authored by FredericLeroy's avatar FredericLeroy

refactor(conf2uedata): move usim_data funcions in conf_usim.[c|h]

parent f03e2dbc
......@@ -19,6 +19,7 @@ set(conf2uedata_SRC
${OPENAIR_DIR}/openair3/NAS/TOOLS/conf2uedata.c
${OPENAIR_DIR}/openair3/NAS/TOOLS/conf_emm.c
${OPENAIR_DIR}/openair3/NAS/TOOLS/conf_user_data.c
${OPENAIR_DIR}/openair3/NAS/TOOLS/conf_usim.c
${OPENAIR_DIR}/openair3/NAS/TOOLS/fs.c
${OPENAIR_DIR}/openair3/NAS/TOOLS/display.c
${OPENAIR_DIR}/openair3/NAS/UE/API/USIM/usim_api.c
......
This diff is collapsed.
......@@ -6,7 +6,7 @@
#include "usim_api.h"
#define UE "UE"
#define SIM "SIM"
#define PLMN "PLMN"
#define FULLNAME "FULLNAME"
......@@ -14,16 +14,6 @@
#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"
......@@ -31,26 +21,9 @@
#define FPLMN "FPLMN_LIST"
#define EHPLMN "EHPLMN_LIST"
#define KSI USIM_KSI_NOT_AVAILABLE
#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
/*
* PLMN network operator record
*/
......@@ -70,12 +43,6 @@ typedef struct {
const char *mcc;
} plmn_conf_param_t;
extern const char *msin;
extern const char *usim_api_k;
extern const char *msisdn;
extern const char *opc;
extern const char *hplmn;
extern int *ucplmn;
extern int *oplmn;
extern int *ocplmn;
......@@ -99,14 +66,10 @@ int parse_config_file(const char *output_dir, const char *filename);
void _display_usage(void);
void fill_network_record_list(void);
int write_usim_data(const char *directory, int user_id, usim_data_t *usim_data);
void gen_usim_data(usim_data_t *usim_data);
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_plmn_index(const char * mccmnc);
int parse_ue_plmn_param(config_setting_t *ue_setting, int user_id);
int parse_ue_plmn_param(config_setting_t *ue_setting, int user_id, const char **hplmn);
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);
......
......@@ -5,7 +5,7 @@
#include "conf_emm.h"
#include "fs.h"
void gen_emm_data(emm_nvdata_t *emm_data) {
void gen_emm_data(emm_nvdata_t *emm_data, const char *hplmn, const char *msin) {
hplmn_index = get_plmn_index(hplmn);
memset(emm_data, 0, sizeof(emm_nvdata_t));
int hplmn_index = get_plmn_index(hplmn);
......
......@@ -3,7 +3,7 @@
#include "emmData.h"
void gen_emm_data(emm_nvdata_t *emm_data);
void gen_emm_data(emm_nvdata_t *emm_data, const char *hplmn, const char *msin);
int write_emm_data(const char *directory, int user_id, emm_nvdata_t *emm_data);
int get_msin_parity(const char * msin);
......
This diff is collapsed.
#ifndef _CONF_USIM_H
#define _CONF_USIM_H
#include <libconfig.h>
#include "usim_api.h"
#define SIM "SIM"
#define MSIN "MSIN"
#define USIM_API_K "USIM_API_K"
#define OPC "OPC"
#define MSISDN "MSISDN"
#define KSI USIM_KSI_NOT_AVAILABLE
#define KSI_ASME USIM_KSI_NOT_AVAILABLE
#define OPC_SIZE 16
#define DEFAULT_TMSI 0x0000000D
#define DEFAULT_P_TMSI 0x0000000D
#define DEFAULT_M_TMSI 0x0000000D
#define DEFAULT_RAC 0x01
#define DEFAULT_TAC 0x0001
#define DEFAULT_LAC 0xFFFE
#define DEFAULT_MME_ID 0x0102
#define DEFAULT_MME_CODE 0x0F
#define INT_ALGO USIM_INT_EIA1
#define ENC_ALGO USIM_ENC_EEA0
#define SECURITY_ALGORITHMS (ENC_ALGO | INT_ALGO)
typedef struct {
const char *msin;
const char *usim_api_k;
const char *msisdn;
const char *opc;
const char *hplmn;
} usim_data_conf_t;
int parse_ue_sim_param(config_setting_t *ue_setting, int user_id, usim_data_conf_t *u);
int write_usim_data(const char *directory, int user_id, usim_data_t *usim_data);
void gen_usim_data(usim_data_conf_t *u, usim_data_t *usim_data);
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment