From 00170f0ebf50bd4d04b54a2ffe3b64d06419590e Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Wed, 26 Sep 2018 22:45:22 +0200 Subject: vty: install 'show cs7' for sccp addrs on _ve nodes The 'show cs7 instance 0 sccp-addressbook' command should not be inside the 'cs7' node. That defies the point of naming the instance again, and it falls out of place of all the other 'show cs7' commands on the VIEW and ENABLE nodes. Drop the old command within the 'cs7' node without substitution or deprecation. At the same time, drop dash from 'show cs7 i 0 sccp-addressbook' There are various other show cs7 commands already defined in sccp_vty.c, which have 'sccp' as a separate string. Conform to that. Change-Id: I80e0bc0a91bcd3fb75372045db34592d2d663d41 --- src/osmo_ss7_vty.c | 8 +++++--- tests/vty/ss7_asp_test.vty | 10 ++++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 1e2f437..14539b6 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -39,6 +39,7 @@ #include "xua_internal.h" #include +#include "sccp_internal.h" #define XUA_VAR_STR "(sua|m3ua|ipa)" @@ -1164,8 +1165,9 @@ static void write_sccp_addressbook(struct vty *vty, /* List all addressbook entries */ DEFUN(cs7_show_sccpaddr, cs7_show_sccpaddr_cmd, - "show cs7 instance <0-15> sccp-addressbook", - SHOW_STR CS7_STR INST_STR INST_STR "List all SCCP addressbook entries\n") + "show cs7 instance <0-15> sccp addressbook", + SHOW_STR CS7_STR INST_STR INST_STR SCCP_STR + "List all SCCP addressbook entries\n") { struct osmo_ss7_instance *inst; struct osmo_sccp_addr_entry *entry; @@ -1727,7 +1729,7 @@ int osmo_ss7_is_config_node(struct vty *vty, int node) static void vty_init_addr(void) { install_node(&sccpaddr_node, NULL); - install_element(L_CS7_NODE, &cs7_show_sccpaddr_cmd); + install_element_ve(&cs7_show_sccpaddr_cmd); install_element(L_CS7_NODE, &cs7_sccpaddr_cmd); install_element(L_CS7_NODE, &cs7_sccpaddr_del_cmd); install_element(L_CS7_SCCPADDR_NODE, &cs7_sccpaddr_pc_del_cmd); diff --git a/tests/vty/ss7_asp_test.vty b/tests/vty/ss7_asp_test.vty index f96e0c0..fee97b3 100644 --- a/tests/vty/ss7_asp_test.vty +++ b/tests/vty/ss7_asp_test.vty @@ -4,6 +4,7 @@ ss7_asp_vty_test> list show cs7 (sua|m3ua|ipa) [<0-65534>] show cs7 instance <0-15> asp show cs7 instance <0-15> as (active|all|m3ua|sua) + show cs7 instance <0-15> sccp addressbook show cs7 instance <0-15> sccp users show cs7 instance <0-15> sccp ssn <0-65535> show cs7 instance <0-15> sccp connections @@ -16,6 +17,7 @@ ss7_asp_vty_test# list show cs7 (sua|m3ua|ipa) [<0-65534>] show cs7 instance <0-15> asp show cs7 instance <0-15> as (active|all|m3ua|sua) + show cs7 instance <0-15> sccp addressbook show cs7 instance <0-15> sccp users show cs7 instance <0-15> sccp ssn <0-65535> show cs7 instance <0-15> sccp connections @@ -51,6 +53,7 @@ ss7_asp_vty_test# show cs7 instance 0 as ? sua Display all SUA ASs ss7_asp_vty_test# show cs7 instance 0 sccp ? + addressbook List all SCCP addressbook entries users Show List of SCCP Users registered ssn Show List of SCCP Users registered connections Show List of SCCP Users registered @@ -74,7 +77,6 @@ ss7_asp_vty_test(config-cs7)# list no asp NAME as NAME (sua|m3ua|ipa) no as NAME - show cs7 instance <0-15> sccp-addressbook sccp-address NAME no sccp-address NAME @@ -176,7 +178,11 @@ ss7_asp_vty_test(config-cs7-sccpaddr)# ? ss7_asp_vty_test(config-cs7-sccpaddr)# point-code 1.2.3 ss7_asp_vty_test(config-cs7-sccpaddr)# do show cs7 instance 0 sccp addressbook -% Unknown command. + +Name RI: PC: SSN: GT: +------------ --- --------- ---------- --------------------------------------- +foo PC 1.2.3 (none) (none) + ss7_asp_vty_test(config-cs7-sccpaddr)# exit ss7_asp_vty_test(config-cs7)# sccp-address foobarfoobarfoobarfoobarfoobarfoobar -- cgit v1.2.3