diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-04-07 23:23:27 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-04-07 23:26:13 +0200 |
commit | 55ef5fb7ef0880544343e757c5614fdce2bba1a3 (patch) | |
tree | b477f90ff939af19a58f8b23ad21cbf793520bc4 | |
parent | 4b41746ce34806aa5fa47b2b5d076d18bfab7c3d (diff) |
bsc: Add the bsc-rf-socket command to master as well
Make it possible to specify the rf-socket path via the
vty configuration as well. The command line setting will
override it though.
-rw-r--r-- | openbsc/include/openbsc/osmo_msc_data.h | 1 | ||||
-rw-r--r-- | openbsc/src/osmo-bsc/osmo_bsc_main.c | 15 | ||||
-rw-r--r-- | openbsc/src/osmo-bsc/osmo_bsc_vty.c | 17 |
3 files changed, 27 insertions, 6 deletions
diff --git a/openbsc/include/openbsc/osmo_msc_data.h b/openbsc/include/openbsc/osmo_msc_data.h index 55b0a0f7c..6f437b756 100644 --- a/openbsc/include/openbsc/osmo_msc_data.h +++ b/openbsc/include/openbsc/osmo_msc_data.h @@ -61,6 +61,7 @@ struct osmo_msc_data { /* rf ctl related bits */ char *mid_call_txt; int mid_call_timeout; + char *rf_ctrl_name; struct osmo_bsc_rf *rf_ctl; /* ussd welcome text */ diff --git a/openbsc/src/osmo-bsc/osmo_bsc_main.c b/openbsc/src/osmo-bsc/osmo_bsc_main.c index 1937d3b00..872b9f116 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_main.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_main.c @@ -1,6 +1,6 @@ /* (C) 2008-2009 by Harald Welte <laforge@gnumonks.org> - * (C) 2009-2010 by Holger Hans Peter Freyther <zecke@selfish.org> - * (C) 2009-2010 by On-Waves + * (C) 2009-2011 by Holger Hans Peter Freyther <zecke@selfish.org> + * (C) 2009-2011 by On-Waves * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -179,6 +179,7 @@ static void signal_handler(int signal) int main(int argc, char **argv) { + struct osmo_msc_data *data; int rc; log_init(&log_info); @@ -215,9 +216,13 @@ int main(int argc, char **argv) } bsc_api_init(bsc_gsmnet, osmo_bsc_api()); - if (rf_ctl) { - struct osmo_msc_data *data = bsc_gsmnet->msc_data; - data->rf_ctl = osmo_bsc_rf_create(rf_ctl, bsc_gsmnet); + data = bsc_gsmnet->msc_data; + if (rf_ctl) + bsc_replace_string(data, &data->rf_ctrl_name, rf_ctl); + + if (data->rf_ctrl_name) { + data->rf_ctl = osmo_bsc_rf_create(data->rf_ctrl_name, + bsc_gsmnet); if (!data->rf_ctl) { fprintf(stderr, "Failed to create the RF service.\n"); exit(1); diff --git a/openbsc/src/osmo-bsc/osmo_bsc_vty.c b/openbsc/src/osmo-bsc/osmo_bsc_vty.c index 71e6db0ba..1fb1d6400 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_vty.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_vty.c @@ -1,5 +1,5 @@ /* Osmo BSC VTY Configuration */ -/* (C) 2009-2010 by Holger Hans Peter Freyther +/* (C) 2009-2011 by Holger Hans Peter Freyther * (C) 2009-2010 by On-Waves * All Rights Reserved * @@ -73,6 +73,9 @@ static int config_write_msc(struct vty *vty) vty_out(vty, " mid-call-timeout %d%s", data->mid_call_timeout, VTY_NEWLINE); if (data->ussd_welcome_txt) vty_out(vty, " bsc-welcome-text %s%s", data->ussd_welcome_txt, VTY_NEWLINE); + if (data->rf_ctrl_name) + vty_out(vty, " bsc-rf-socket %s%s", + data->rf_ctrl_name, VTY_NEWLINE); if (data->audio_length != 0) { int i; @@ -288,6 +291,17 @@ DEFUN(cfg_net_msc_welcome_ussd, return CMD_SUCCESS; } +DEFUN(cfg_net_rf_socket, + cfg_net_rf_socket_cmd, + "bsc-rf-socket PATH", + "Set the filename for the RF control interface.\n" "RF Control path\n") +{ + struct osmo_msc_data *data = osmo_msc_data(vty); + + bsc_replace_string(data, &data->rf_ctrl_name, argv[0]); + return CMD_SUCCESS; +} + int bsc_vty_init_extra(void) { install_element(CONFIG_NODE, &cfg_net_msc_cmd); @@ -306,6 +320,7 @@ int bsc_vty_init_extra(void) install_element(MSC_NODE, &cfg_net_msc_mid_call_text_cmd); install_element(MSC_NODE, &cfg_net_msc_mid_call_timeout_cmd); install_element(MSC_NODE, &cfg_net_msc_welcome_ussd_cmd); + install_element(MSC_NODE, &cfg_net_rf_socket_cmd); return 0; } |