aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libcommon
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2017-06-30 13:53:40 +0200
committerPhilipp Maier <pmaier@sysmocom.de>2017-06-30 13:53:40 +0200
commitfc515efb41e4674c09f438a9664028f5b8da804d (patch)
tree733dcc93408f5fc94c552210a506876b546d7281 /openbsc/src/libcommon
parentd6ec7a4ab5e307152a94f513a3f218cda5ef8482 (diff)
common-vty: add ss7 nodes commands to VTY
The current VTY implementation has no knowledge about the libosmo-sccp nodes and therefor can not resolve parent nodes, nor decide if we deal with a config node.
Diffstat (limited to 'openbsc/src/libcommon')
-rw-r--r--openbsc/src/libcommon/common_vty.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/openbsc/src/libcommon/common_vty.c b/openbsc/src/libcommon/common_vty.c
index 6e1c10b00..1443791f0 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)
@@ -117,13 +118,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 +134,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: