make multiple config instead of one implicit global

This commit is contained in:
Laurent THOMAS
2023-11-10 10:23:11 +01:00
parent 82597e7e8f
commit f50d5f5a9b
74 changed files with 1316 additions and 1118 deletions
+1 -1
View File
@@ -687,7 +687,7 @@ int is_m3ap_MCE_enabled(void)
};
/* TODO: do it per module - we check only first MCE */
config_get(p, sizeof(p)/sizeof(paramdef_t), "MCEs.[0]");
config_get(config_get_if(), p, sizeofArray(p), "MCEs.[0]");
if (enable_m3 != NULL && strcmp(enable_m3, "yes") == 0)
enabled = 1;
+1 -1
View File
@@ -712,7 +712,7 @@ int is_m3ap_MME_enabled(void)
};
/* TODO: do it per module - we check only first MME */
config_get(p, sizeof(p)/sizeof(paramdef_t), "MMEs.[0]");
config_get(config_get_if(), p, sizeofArray(p), "MMEs.[0]");
if (enable_m3 != NULL && strcmp(enable_m3, "yes") == 0)
enabled = 1;
+7 -7
View File
@@ -73,14 +73,14 @@ int RCconfig_MME(void ) {
paramdef_t MMEParams[] = MME_NETPARAMS_DESC;
///* get number of active eNodeBs */
//config_get( ENBSParams,sizeof(ENBSParams)/sizeof(paramdef_t),NULL);
//num_enbs = ENBSParams[ENB_ACTIVE_ENBS_IDX].numelt;
//AssertFatal (num_enbs >0,
// "Failed to parse config file no active eNodeBs in %s \n", ENB_CONFIG_STRING_ACTIVE_ENBS);
//sprintf(gtpupath,"%s.[%i].%s",ENB_CONFIG_STRING_ENB_LIST,0,ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
// config_get( config_get_if(),ENBSParams,sizeofArray(ENBSParams),NULL);
// num_enbs = ENBSParams[ENB_ACTIVE_ENBS_IDX].numelt;
// AssertFatal (num_enbs >0,
// "Failed to parse config file no active eNodeBs in %s \n", ENB_CONFIG_STRING_ACTIVE_ENBS);
// sprintf(gtpupath,"%s.[%i].%s",ENB_CONFIG_STRING_ENB_LIST,0,ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
sprintf(mmepath,"%s.[%i].%s","MMEs",0,MME_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
//config_get( GTPUParams,sizeof(GTPUParams)/sizeof(paramdef_t),gtpupath);
config_get(MMEParams,sizeof(MMEParams)/sizeof(paramdef_t),mmepath);
// config_get(config_get_if(), GTPUParams,sizeofArray(GTPUParams),gtpupath);
config_get(config_get_if(), MMEParams, sizeofArray(MMEParams), mmepath);
//cidr = enb_ipv4_address_for_S1U;
cidr = mme_ipv4_address_for_m3c;
address = strtok(cidr, "/");
+2 -1
View File
@@ -2,9 +2,10 @@
#include <openair3/NAS/COMMON/NR_NAS_defs.h>
volatile int oai_exit;
configmodule_interface_t *uniqCfg = NULL;
int main(int argc, char **argv) {
if ( load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY) == NULL) {
if ((uniqCfg = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY)) == NULL) {
exit_fun("[SOFTMODEM] Error, configuration module init failed\n");
}
+2 -2
View File
@@ -73,8 +73,8 @@ uicc_t *init_uicc(char *sectionName) {
// here we call usim simulation, but calling actual usim is quite simple
// the code is in open-cells.com => program_uicc open source
// we can read the IMSI from the USIM
// key, OPc, sqn, amf don't need to be read from the true USIM
int ret = config_get( uicc_params,sizeof(uicc_params)/sizeof(paramdef_t),sectionName);
// key, OPc, sqn, amf don't need to be read from the true USIM
int ret = config_get(config_get_if(), uicc_params, sizeofArray(uicc_params), sectionName);
AssertFatal(ret >= 0, "configuration couldn't be performed for uicc name: %s", sectionName);
LOG_I(SIM,
"UICC simulation: IMSI=%s, IMEISV=%s, Ki=%s, OPc=%s, DNN=%s, SST=0x%02x, SD=0x%06x\n",