Allow one or more TRX to configure via VTY

This commit is contained in:
Andreas Eversberg 2013-04-07 13:11:50 +02:00 committed by Harald Welte
parent 2e4a26a0e9
commit c2ee307fd4
4 changed files with 7 additions and 5 deletions

View File

@ -15,7 +15,7 @@ extern struct cmd_element ournode_end_cmd;
enum node_type bts_vty_go_parent(struct vty *vty);
int bts_vty_is_config_node(struct vty *vty, int node);
int bts_vty_init(struct gsm_bts *bts, const struct log_info *cat);
int bts_vty_init(struct gsm_bts *bts, int trx_num, const struct log_info *cat);
extern struct vty_app_info bts_vty_info;

View File

@ -140,8 +140,9 @@ static struct cmd_node trx_node = {
1,
};
static char cfg_bts_trx_cmd_string[16];
DEFUN(cfg_bts_trx, cfg_bts_trx_cmd,
"trx <0-0>",
cfg_bts_trx_cmd_string,
"Select a TRX to configure\n" "TRX number\n")
{
int trx_nr = atoi(argv[0]);
@ -762,7 +763,7 @@ DEFUN(no_bts_t_t_l_loopback,
return CMD_SUCCESS;
}
int bts_vty_init(struct gsm_bts *bts, const struct log_info *cat)
int bts_vty_init(struct gsm_bts *bts, int trx_num, const struct log_info *cat)
{
cfg_trx_gsmtap_sapi_cmd.string = vty_cmd_string_from_valstr(bts, gsmtap_sapi_names,
"gsmtap-sapi (",
@ -802,6 +803,7 @@ int bts_vty_init(struct gsm_bts *bts, const struct log_info *cat)
install_element(BTS_NODE, &cfg_trx_no_gsmtap_sapi_cmd);
/* add and link to TRX config node */
sprintf(cfg_bts_trx_cmd_string, "trx <0-%d>", trx_num - 1);
install_element(BTS_NODE, &cfg_bts_trx_cmd);
install_node(&trx_node, config_write_dummy);
install_default(TRX_NODE);

View File

@ -320,7 +320,7 @@ int main(int argc, char **argv)
bts = gsm_bts_alloc(tall_bts_ctx);
vty_init(&bts_vty_info);
e1inp_vty_init();
bts_vty_init(bts, &bts_log_info);
bts_vty_init(bts, 1, &bts_log_info);
handle_options(argc, argv);

View File

@ -310,7 +310,7 @@ int main(int argc, char **argv)
vty_init(&bts_vty_info);
e1inp_vty_init();
bts_vty_init(bts, &bts_log_info);
bts_vty_init(bts, trx_num, &bts_log_info);
if (bts_init(bts) < 0) {
fprintf(stderr, "unable to to open bts\n");