aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-msc/msc_main.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-03-22 14:50:20 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2018-03-22 16:52:27 +0100
commit7c075a2f740919344ff70ae440c0b69c872ac6cc (patch)
treee129b22a16f4a094dfe231b4329757c4a97753df /src/osmo-msc/msc_main.c
parentd6a769b51cb01f0a93fda9c792d7e1367e8e027b (diff)
dissolve libcommon,libcommon-cs: clean up vty definitions
From openbsc.git, we still have osmo-msc's VTY definitions spread across various places. Combine: - Move the go_parent_cb() and is_config_node() to msc_main.c, drop common_vty.c. - Move all of vty_interface_layer3.c into msc_vty.c. - Move all of common_cs_vty.c into msc_vty.c. - Move bsc_vty_init_extra() into msc_vty_init(). - Drop some unused definitions No functional nor cosmetic changes have been made in the moved code, plain copy-paste moving (even though the unidiff might look like edits in some places). I might have adjusted some blank lines though. Change-Id: Ia818c00ab613a19a34080b160d763b55c19f76b1
Diffstat (limited to 'src/osmo-msc/msc_main.c')
-rw-r--r--src/osmo-msc/msc_main.c51
1 files changed, 47 insertions, 4 deletions
diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c
index aba74b6a1..6de81dac9 100644
--- a/src/osmo-msc/msc_main.c
+++ b/src/osmo-msc/msc_main.c
@@ -267,13 +267,57 @@ static void db_sync_timer_cb(void *data)
osmo_timer_schedule(&db_sync_timer, DB_SYNC_INTERVAL);
}
-extern int bsc_vty_go_parent(struct vty *vty);
+static int msc_vty_go_parent(struct vty *vty)
+{
+ switch (vty->node) {
+ case GSMNET_NODE:
+ vty->node = CONFIG_NODE;
+ vty->index = NULL;
+ break;
+ case SMPP_ESME_NODE:
+ vty->node = SMPP_NODE;
+ vty->index = NULL;
+ break;
+ case SMPP_NODE:
+ case MSC_NODE:
+ case MNCC_INT_NODE:
+ vty->node = CONFIG_NODE;
+ vty->index = NULL;
+ break;
+ case SUBSCR_NODE:
+ vty->node = ENABLE_NODE;
+ vty->index = NULL;
+ break;
+ default:
+ osmo_ss7_vty_go_parent(vty);
+ }
+
+ return vty->node;
+}
+
+static int msc_vty_is_config_node(struct vty *vty, int node)
+{
+ /* Check if libosmo-sccp declares the node in
+ * question as config node */
+ if (osmo_ss7_is_config_node(vty, node))
+ return 1;
+
+ switch (node) {
+ /* add items that are not config */
+ case SUBSCR_NODE:
+ case CONFIG_NODE:
+ return 0;
+
+ default:
+ return 1;
+ }
+}
static struct vty_app_info msc_vty_info = {
.name = "OsmoMSC",
.version = PACKAGE_VERSION,
- .go_parent_cb = bsc_vty_go_parent,
- .is_config_node = bsc_vty_is_config_node,
+ .go_parent_cb = msc_vty_go_parent,
+ .is_config_node = msc_vty_is_config_node,
};
#ifdef BUILD_IU
@@ -396,7 +440,6 @@ int main(int argc, char **argv)
logging_vty_add_cmds(&log_info);
osmo_talloc_vty_add_cmds();
msc_vty_init(msc_network);
- bsc_vty_init_extra();
#ifdef BUILD_SMPP
if (smpp_openbsc_alloc_init(tall_msc_ctx) < 0)