summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-03-04 13:36:12 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-03-04 14:58:09 +0100
commit15b1fce69cbc6ccd6eb83daab7ab5cd91ef0ea81 (patch)
tree35125cabd3252a735dd3a4193b3b3a4ebbc05a37
parent2f8117d2147b711669518bbacd24df6dd2a76124 (diff)
rename nitb vty config to cscn, move to cscn_vty.c
-rw-r--r--openbsc/include/openbsc/vty.h3
-rw-r--r--openbsc/src/libcommon/common_vty.c1
-rw-r--r--openbsc/src/libmsc/Makefile.am1
-rw-r--r--openbsc/src/libmsc/cscn_vty.c100
-rw-r--r--openbsc/src/libmsc/vty_interface_layer3.c68
-rw-r--r--openbsc/src/osmo-cscn/cscn_main.c1
6 files changed, 104 insertions, 70 deletions
diff --git a/openbsc/include/openbsc/vty.h b/openbsc/include/openbsc/vty.h
index 964f66bc1..1d8f8712d 100644
--- a/openbsc/include/openbsc/vty.h
+++ b/openbsc/include/openbsc/vty.h
@@ -32,7 +32,6 @@ enum bsc_vty_node {
TRUNK_NODE,
PGROUP_NODE,
MNCC_INT_NODE,
- NITB_NODE,
BSC_NODE,
SMPP_NODE,
SMPP_ESME_NODE,
@@ -47,6 +46,8 @@ struct log_info;
int bsc_vty_init(const struct log_info *cat, struct gsm_network *network);
int bsc_vty_init_extra(void);
+void cscn_vty_init(void);
+
struct gsm_network *gsmnet_from_vty(struct vty *vty);
#endif
diff --git a/openbsc/src/libcommon/common_vty.c b/openbsc/src/libcommon/common_vty.c
index 1bc66948d..0dcba3acb 100644
--- a/openbsc/src/libcommon/common_vty.c
+++ b/openbsc/src/libcommon/common_vty.c
@@ -108,7 +108,6 @@ int bsc_vty_go_parent(struct vty *vty)
case BSC_NODE:
case MSC_NODE:
case MNCC_INT_NODE:
- case NITB_NODE:
case CSCN_NODE:
default:
if (bsc_vty_is_config_node(vty, vty->node))
diff --git a/openbsc/src/libmsc/Makefile.am b/openbsc/src/libmsc/Makefile.am
index b4ce7f8f5..ac4654471 100644
--- a/openbsc/src/libmsc/Makefile.am
+++ b/openbsc/src/libmsc/Makefile.am
@@ -19,6 +19,7 @@ libmsc_a_SOURCES = auth.c \
token_auth.c \
ussd.c \
vty_interface_layer3.c \
+ cscn_vty.c \
transaction.c \
osmo_msc.c ctrl_commands.c meas_feed.c \
msc_api.c msc_ifaces.c iu_cs.c \
diff --git a/openbsc/src/libmsc/cscn_vty.c b/openbsc/src/libmsc/cscn_vty.c
new file mode 100644
index 000000000..31d8c3873
--- /dev/null
+++ b/openbsc/src/libmsc/cscn_vty.c
@@ -0,0 +1,100 @@
+/* MSC interface to quagga VTY */
+/* (C) 2016 by sysmocom s.m.f.c. GmbH <info@sysmocom.de>
+ * Based on OpenBSC interface to quagga VTY (libmsc/vty_interface_layer3.c)
+ * (C) 2009 by Harald Welte <laforge@gnumonks.org>
+ * (C) 2009-2011 by Holger Hans Peter Freyther
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+/* NOTE: I would have liked to call this the MSC_NODE instead of the CSCN_NODE,
+ * but MSC_NODE already exists to configure a remote MSC for osmo-bsc. */
+
+#include <osmocom/vty/command.h>
+#include <openbsc/vty.h>
+
+#include <openbsc/gsm_data.h>
+
+static struct cmd_node cscn_node = {
+ CSCN_NODE,
+ "%s(config-cscn)# ",
+ 1,
+};
+
+DEFUN(cfg_cscn, cfg_cscn_cmd,
+ "cscn", "Configure CSCN options")
+{
+ vty->node = CSCN_NODE;
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_cscn_subscr_create, cfg_cscn_subscr_create_cmd,
+ "subscriber-create-on-demand",
+ "Make a new record when a subscriber is first seen.\n")
+{
+ struct gsm_network *gsmnet = gsmnet_from_vty(vty);
+ gsmnet->create_subscriber = 1;
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_cscn_no_subscr_create, cfg_cscn_no_subscr_create_cmd,
+ "no subscriber-create-on-demand",
+ NO_STR "Make a new record when a subscriber is first seen.\n")
+{
+ struct gsm_network *gsmnet = gsmnet_from_vty(vty);
+ gsmnet->create_subscriber = 0;
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_cscn_assign_tmsi, cfg_cscn_assign_tmsi_cmd,
+ "assign-tmsi",
+ "Assign TMSI during Location Updating.\n")
+{
+ struct gsm_network *gsmnet = gsmnet_from_vty(vty);
+ gsmnet->avoid_tmsi = 0;
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_cscn_no_assign_tmsi, cfg_cscn_no_assign_tmsi_cmd,
+ "no assign-tmsi",
+ NO_STR "Assign TMSI during Location Updating.\n")
+{
+ struct gsm_network *gsmnet = gsmnet_from_vty(vty);
+ gsmnet->avoid_tmsi = 1;
+ return CMD_SUCCESS;
+}
+
+static int config_write_cscn(struct vty *vty)
+{
+ struct gsm_network *gsmnet = gsmnet_from_vty(vty);
+ vty_out(vty, "cscn%s", VTY_NEWLINE);
+ vty_out(vty, " %ssubscriber-create-on-demand%s",
+ gsmnet->create_subscriber ? "" : "no ", VTY_NEWLINE);
+ vty_out(vty, " %sassign-tmsi%s",
+ gsmnet->avoid_tmsi ? "no " : "", VTY_NEWLINE);
+ return CMD_SUCCESS;
+}
+
+
+void cscn_vty_init(void)
+{
+ install_element(CONFIG_NODE, &cfg_cscn_cmd);
+ install_node(&cscn_node, config_write_cscn);
+ install_element(CSCN_NODE, &cfg_cscn_subscr_create_cmd);
+ install_element(CSCN_NODE, &cfg_cscn_no_subscr_create_cmd);
+ install_element(CSCN_NODE, &cfg_cscn_assign_tmsi_cmd);
+ install_element(CSCN_NODE, &cfg_cscn_no_assign_tmsi_cmd);
+}
diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c
index 0aa212a4e..90872846a 100644
--- a/openbsc/src/libmsc/vty_interface_layer3.c
+++ b/openbsc/src/libmsc/vty_interface_layer3.c
@@ -1020,66 +1020,6 @@ DEFUN(logging_fltr_imsi,
return CMD_SUCCESS;
}
-static struct cmd_node nitb_node = {
- NITB_NODE,
- "%s(config-nitb)# ",
- 1,
-};
-
-DEFUN(cfg_nitb, cfg_nitb_cmd,
- "nitb", "Configure NITB options")
-{
- vty->node = NITB_NODE;
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_nitb_subscr_create, cfg_nitb_subscr_create_cmd,
- "subscriber-create-on-demand",
- "Make a new record when a subscriber is first seen.\n")
-{
- struct gsm_network *gsmnet = gsmnet_from_vty(vty);
- gsmnet->create_subscriber = 1;
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_nitb_no_subscr_create, cfg_nitb_no_subscr_create_cmd,
- "no subscriber-create-on-demand",
- NO_STR "Make a new record when a subscriber is first seen.\n")
-{
- struct gsm_network *gsmnet = gsmnet_from_vty(vty);
- gsmnet->create_subscriber = 0;
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_nitb_assign_tmsi, cfg_nitb_assign_tmsi_cmd,
- "assign-tmsi",
- "Assign TMSI during Location Updating.\n")
-{
- struct gsm_network *gsmnet = gsmnet_from_vty(vty);
- gsmnet->avoid_tmsi = 0;
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_nitb_no_assign_tmsi, cfg_nitb_no_assign_tmsi_cmd,
- "no assign-tmsi",
- NO_STR "Assign TMSI during Location Updating.\n")
-{
- struct gsm_network *gsmnet = gsmnet_from_vty(vty);
- gsmnet->avoid_tmsi = 1;
- return CMD_SUCCESS;
-}
-
-static int config_write_nitb(struct vty *vty)
-{
- struct gsm_network *gsmnet = gsmnet_from_vty(vty);
- vty_out(vty, "nitb%s", VTY_NEWLINE);
- vty_out(vty, " %ssubscriber-create-on-demand%s",
- gsmnet->create_subscriber ? "" : "no ", VTY_NEWLINE);
- vty_out(vty, " %sassign-tmsi%s",
- gsmnet->avoid_tmsi ? "no " : "", VTY_NEWLINE);
- return CMD_SUCCESS;
-}
-
int bsc_vty_init_extra(void)
{
osmo_signal_register_handler(SS_SCALL, scall_cbfn, NULL);
@@ -1125,13 +1065,5 @@ int bsc_vty_init_extra(void)
install_element(CFG_LOG_NODE, &log_level_sms_cmd);
install_element(CFG_LOG_NODE, &logging_fltr_imsi_cmd);
-
- install_element(CONFIG_NODE, &cfg_nitb_cmd);
- install_node(&nitb_node, config_write_nitb);
- install_element(NITB_NODE, &cfg_nitb_subscr_create_cmd);
- install_element(NITB_NODE, &cfg_nitb_no_subscr_create_cmd);
- install_element(NITB_NODE, &cfg_nitb_assign_tmsi_cmd);
- install_element(NITB_NODE, &cfg_nitb_no_assign_tmsi_cmd);
-
return 0;
}
diff --git a/openbsc/src/osmo-cscn/cscn_main.c b/openbsc/src/osmo-cscn/cscn_main.c
index 96ee0b3b0..279df0f50 100644
--- a/openbsc/src/osmo-cscn/cscn_main.c
+++ b/openbsc/src/osmo-cscn/cscn_main.c
@@ -357,6 +357,7 @@ int main(int argc, char **argv)
ctrl_vty_init(tall_cscn_ctx);
logging_vty_add_cmds(&log_info);
xsc_vty_init(cscn_network);
+ cscn_vty_init();
rc = vty_read_config_file(cscn_cmdline_config.config_file, NULL);
if (rc < 0) {
LOGP(DNM, LOGL_FATAL, "Failed to parse the config file: '%s'\n",