sgsn init: pass sgsn_config pointer to sgsn_vty_init(), not sgsn_parse_config
In an upcoming commit, sgsn_vty_init() will require access to the global sgsn config struct to initialize a generic VTY command with the proper config destination address, see Change-Id I5b5b6a9678b458affa86800afb1ec726e66eed88. Change-Id: Ie6b6e5422987586531a898e0c5b867623dbecb0fchanges/10/3710/1
parent
ce4d88bd62
commit
66e5e3c328
|
@ -140,8 +140,8 @@ extern struct sgsn_instance *sgsn;
|
|||
|
||||
/* sgsn_vty.c */
|
||||
|
||||
int sgsn_vty_init(void);
|
||||
int sgsn_parse_config(const char *config_file, struct sgsn_config *cfg);
|
||||
int sgsn_vty_init(struct sgsn_config *cfg);
|
||||
int sgsn_parse_config(const char *config_file);
|
||||
|
||||
/* sgsn.c */
|
||||
|
||||
|
|
|
@ -350,7 +350,7 @@ int main(int argc, char **argv)
|
|||
vty_init(&vty_info);
|
||||
logging_vty_add_cmds(NULL);
|
||||
osmo_stats_vty_add_cmds(&gprs_log_info);
|
||||
sgsn_vty_init();
|
||||
sgsn_vty_init(&sgsn_inst.cfg);
|
||||
ctrl_vty_init(tall_bsc_ctx);
|
||||
#ifdef BUILD_IU
|
||||
iu_vty_init(&asn_debug);
|
||||
|
@ -382,7 +382,7 @@ int main(int argc, char **argv)
|
|||
sgsn_cdr_init(&sgsn_inst);
|
||||
/* FIXME: register signal handler for SS_L_NS */
|
||||
|
||||
rc = sgsn_parse_config(sgsn_inst.config_file, &sgsn_inst.cfg);
|
||||
rc = sgsn_parse_config(sgsn_inst.config_file);
|
||||
if (rc < 0) {
|
||||
LOGP(DGPRS, LOGL_FATAL, "Error in config file\n");
|
||||
exit(2);
|
||||
|
|
|
@ -1222,8 +1222,10 @@ DEFUN(cfg_comp_v42bisp, cfg_comp_v42bisp_cmd,
|
|||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
int sgsn_vty_init(void)
|
||||
int sgsn_vty_init(struct sgsn_config *cfg)
|
||||
{
|
||||
g_cfg = cfg;
|
||||
|
||||
install_element_ve(&show_sgsn_cmd);
|
||||
//install_element_ve(&show_mmctx_tlli_cmd);
|
||||
install_element_ve(&show_mmctx_imsi_cmd);
|
||||
|
@ -1285,11 +1287,12 @@ int sgsn_vty_init(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int sgsn_parse_config(const char *config_file, struct sgsn_config *cfg)
|
||||
int sgsn_parse_config(const char *config_file)
|
||||
{
|
||||
int rc;
|
||||
|
||||
g_cfg = cfg;
|
||||
/* make sure sgsn_vty_init() was called before this */
|
||||
OSMO_ASSERT(g_cfg);
|
||||
|
||||
g_cfg->timers.T3312 = GSM0408_T3312_SECS;
|
||||
g_cfg->timers.T3322 = GSM0408_T3322_SECS;
|
||||
|
|
Loading…
Reference in New Issue