aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libcommon/common_vty.c
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2017-06-23 10:13:27 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-06-28 01:24:32 +0200
commita494d00c2fe76c00003f9bd196a04386c5c974aa (patch)
tree0a5e4f3963e573b09a494da9cb6ebfbc2a9abd15 /openbsc/src/libcommon/common_vty.c
parent155d638af04627e5512f3bad27c10b33fc3b90e7 (diff)
wip: vty: make msc sccp addressesconfigurable
Currently all sccp addresses on the msc (and bsc) side are hardcoded. Prepare the msc code to make the associated BSCs configurble. Make the compiler link libosmo-sccp properly and start using the sccp addressbook feature of libosmoc-sccp. Change-Id: I0171da40cfc2d90a4ca8e423b51cf7275c3d5571
Diffstat (limited to 'openbsc/src/libcommon/common_vty.c')
-rw-r--r--openbsc/src/libcommon/common_vty.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/openbsc/src/libcommon/common_vty.c b/openbsc/src/libcommon/common_vty.c
index 6e1c10b00..fcda91841 100644
--- a/openbsc/src/libcommon/common_vty.c
+++ b/openbsc/src/libcommon/common_vty.c
@@ -34,6 +34,7 @@
#include <osmocom/vty/command.h>
#include <osmocom/vty/buffer.h>
#include <osmocom/vty/vty.h>
+#include <osmocom/sigtran/osmo_ss7.h>
int bsc_vty_go_parent(struct vty *vty)
@@ -108,6 +109,7 @@ int bsc_vty_go_parent(struct vty *vty)
vty->node = SMPP_NODE;
vty->index = NULL;
break;
+
case SMPP_NODE:
case MGCP_NODE:
case GBPROXY_NODE:
@@ -117,13 +119,15 @@ int bsc_vty_go_parent(struct vty *vty)
case MSC_NODE:
case MNCC_INT_NODE:
case NITB_NODE:
- default:
- if (bsc_vty_is_config_node(vty, vty->node))
- vty->node = CONFIG_NODE;
- else
- vty->node = ENABLE_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;
@@ -131,6 +135,11 @@ int bsc_vty_go_parent(struct vty *vty)
int bsc_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 OML_NODE:
@@ -138,7 +147,6 @@ int bsc_vty_is_config_node(struct vty *vty, int node)
case SUBSCR_NODE:
case CONFIG_NODE:
return 0;
-
default:
return 1;
}