diff options
author | Philipp Maier <pmaier@sysmocom.de> | 2017-06-30 13:53:40 +0200 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2017-07-12 23:42:47 +0200 |
commit | d534d6ef1cd97f68e731f3710233362bfb022c66 (patch) | |
tree | e0e2a40ad1e59ea03a5cec65816506fa0c6aae88 | |
parent | 67c7356ba5e7490554cf462d2f812eb41d845b56 (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.
Change-Id: I815a57ed6270bd55c25ee9a8f45026d4aaad9004
-rw-r--r-- | src/gprs/Makefile.am | 2 | ||||
-rw-r--r-- | src/libcommon/common_vty.c | 20 | ||||
-rw-r--r-- | src/osmo-bsc_mgcp/Makefile.am | 1 |
3 files changed, 17 insertions, 6 deletions
diff --git a/src/gprs/Makefile.am b/src/gprs/Makefile.am index cb0997902..e05eb79ff 100644 --- a/src/gprs/Makefile.am +++ b/src/gprs/Makefile.am @@ -34,6 +34,7 @@ OSMO_LIBS = \ $(LIBOSMOCTRL_LIBS) \ $(LIBOSMOGB_LIBS) \ $(LIBGTP_LIBS) \ + $(LIBOSMOSIGTRAN_LIBS) \ $(NULL) bin_PROGRAMS = \ @@ -128,5 +129,6 @@ osmo_gtphub_LDADD = \ $(LIBOSMOVTY_LIBS) \ $(LIBCARES_LIBS) \ $(LIBGTP_LIBS) \ + $(LIBOSMOSIGTRAN_LIBS) \ -lrt \ $(NULL) diff --git a/src/libcommon/common_vty.c b/src/libcommon/common_vty.c index 6e1c10b00..1443791f0 100644 --- a/src/libcommon/common_vty.c +++ b/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: diff --git a/src/osmo-bsc_mgcp/Makefile.am b/src/osmo-bsc_mgcp/Makefile.am index a19a4ebc0..b4e0d8564 100644 --- a/src/osmo-bsc_mgcp/Makefile.am +++ b/src/osmo-bsc_mgcp/Makefile.am @@ -31,5 +31,6 @@ osmo_bsc_mgcp_LDADD = \ $(LIBOSMONETIF_LIBS) \ $(LIBBCG729_LIBS) \ $(LIBRARY_GSM) \ + $(LIBOSMOSIGTRAN_LIBS) \ -lrt \ $(NULL) |