diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2023-12-07 14:36:09 +0100 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2023-12-12 15:54:19 +0100 |
commit | bbecd572a01e45a301be49c4f29c9d1ea3598ae9 (patch) | |
tree | fe1a36b4588a6c5a0a5622b063b8d94d9aedb0f5 | |
parent | 6ad714de985a8c0ab60bbc5a56bce520e43538b1 (diff) |
vty: show cs7 instance asp: Swap columns SCTP Role and Remote Address list
The Remote Address is by far the potentially largest column, as well as
the one with more variable length, so move it to the end for better formatting.
Change-Id: I4854219f8898266ae47b9117ef79dbad30a5b0fd
-rw-r--r-- | TODO-RELEASE | 2 | ||||
-rw-r--r-- | src/osmo_ss7_vty.c | 10 | ||||
-rw-r--r-- | tests/vty/ss7_asp_test.vty | 62 |
3 files changed, 37 insertions, 37 deletions
diff --git a/TODO-RELEASE b/TODO-RELEASE index 2b15a91..c7771bd 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -9,4 +9,4 @@ #library what description / commit summary line libosmocore >1.9.0 osmo_sock_multiaddr_{add,del}_local_addr() libosmo-netif >1.4.0 osmo_stream_{srv,cli}_get_fd() -libosmocore >1.9,0 osmo_sock_multiaddr_get_ip_and_port(), osmo_multiaddr_ip_and_port_snprintf()
\ No newline at end of file +libosmocore >1.9.0 osmo_sock_multiaddr_get_ip_and_port(), osmo_multiaddr_ip_and_port_snprintf() diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 6c36768..39d5b3b 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -1149,9 +1149,9 @@ DEFUN(show_cs7_asp, show_cs7_asp_cmd, return CMD_WARNING; } - vty_out(vty, " Current Primary Link%s", VTY_NEWLINE); - vty_out(vty, "ASP Name AS Name State Type Role Remote IPaddr & Port SCTP Role%s", VTY_NEWLINE); - vty_out(vty, "------------ ------------ ------------- ---- ---- ----------------------- ---------%s", VTY_NEWLINE); + vty_out(vty, " Current Primary Link%s", VTY_NEWLINE); + vty_out(vty, "ASP Name AS Name State Type Role SCTP Role Remote Addresses%s", VTY_NEWLINE); + vty_out(vty, "------------ ------------ ------------- ---- ---- --------- -----------------------%s", VTY_NEWLINE); llist_for_each_entry(asp, &inst->asp_list, list) { if (asp->cfg.proto == OSMO_SS7_ASP_PROT_IPA && asp->cfg.remote.port == 0 && asp->server) { @@ -1163,14 +1163,14 @@ DEFUN(show_cs7_asp, show_cs7_asp_cmd, snprintf(buf, sizeof(buf), "%s:%s", hostbuf, portbuf); } else osmo_ss7_asp_peer_snprintf(buf, sizeof(buf), &asp->cfg.remote); - vty_out(vty, "%-12s %-12s %-13s %-4s %-4s %-23s %-9s%s", + vty_out(vty, "%-12s %-12s %-13s %-4s %-4s %-9s %-23s%s", asp->cfg.name, as_list_for_asp(asp, as_buf, sizeof(as_buf)), asp->fi? osmo_fsm_inst_state_name(asp->fi) : "uninitialized", get_value_string(osmo_ss7_asp_protocol_vals, asp->cfg.proto), osmo_str_tolower(get_value_string(osmo_ss7_asp_role_names, asp->cfg.role)), - buf, asp->cfg.is_server ? "server" : "client", + buf, VTY_NEWLINE); } return CMD_SUCCESS; diff --git a/tests/vty/ss7_asp_test.vty b/tests/vty/ss7_asp_test.vty index dcea4ca..73a13b5 100644 --- a/tests/vty/ss7_asp_test.vty +++ b/tests/vty/ss7_asp_test.vty @@ -256,27 +256,27 @@ ss7_asp_vty_test(config-cs7-asp)# no ? ss7_asp_vty_test(config-cs7-asp)# remote-ip 127.0.0.200 ss7_asp_vty_test(config-cs7-asp)# local-ip 127.0.0.100 ss7_asp_vty_test(config-cs7-asp)# do show cs7 instance 0 asp - Current Primary Link -ASP Name AS Name State Type Role Remote IPaddr & Port SCTP Role ------------- ------------ ------------- ---- ---- ----------------------- --------- -my-asp ? uninitialized m3ua sg 127.0.0.200:12345 server + Current Primary Link +ASP Name AS Name State Type Role SCTP Role Remote Addresses +------------ ------------ ------------- ---- ---- --------- ----------------------- +my-asp ? uninitialized m3ua sg server 127.0.0.200:12345 ss7_asp_vty_test(config-cs7-asp)# remote-ip 127.0.0.201 ss7_asp_vty_test(config-cs7-asp)# local-ip 127.0.0.101 ss7_asp_vty_test(config-cs7-asp)# do show cs7 instance 0 asp - Current Primary Link -ASP Name AS Name State Type Role Remote IPaddr & Port SCTP Role ------------- ------------ ------------- ---- ---- ----------------------- --------- -my-asp ? uninitialized m3ua sg (127.0.0.200|127.0.0.201):12345 server + Current Primary Link +ASP Name AS Name State Type Role SCTP Role Remote Addresses +------------ ------------ ------------- ---- ---- --------- ----------------------- +my-asp ? uninitialized m3ua sg server (127.0.0.200|127.0.0.201):12345 ss7_asp_vty_test(config-cs7-asp)# ! Mark as primary: ss7_asp_vty_test(config-cs7-asp)# remote-ip 127.0.0.201 primary ss7_asp_vty_test(config-cs7-asp)# ! 'local-ip 127.0.0.101 primary' cannot be tested here since output may be different based on sysctl available ss7_asp_vty_test(config-cs7-asp)# local-ip 127.0.0.101 ... ss7_asp_vty_test(config-cs7-asp)# do show cs7 instance 0 asp - Current Primary Link -ASP Name AS Name State Type Role Remote IPaddr & Port SCTP Role ------------- ------------ ------------- ---- ---- ----------------------- --------- -my-asp ? uninitialized m3ua sg (127.0.0.200|127.0.0.201*):12345 server + Current Primary Link +ASP Name AS Name State Type Role SCTP Role Remote Addresses +------------ ------------ ------------- ---- ---- --------- ----------------------- +my-asp ? uninitialized m3ua sg server (127.0.0.200|127.0.0.201*):12345 ss7_asp_vty_test(config-cs7-asp)# show running-config ... local-ip 127.0.0.100 @@ -289,10 +289,10 @@ ss7_asp_vty_test(config-cs7-asp)# ! Mark as non-primary: ss7_asp_vty_test(config-cs7-asp)# remote-ip 127.0.0.201 ss7_asp_vty_test(config-cs7-asp)# local-ip 127.0.0.101 ss7_asp_vty_test(config-cs7-asp)# do show cs7 instance 0 asp - Current Primary Link -ASP Name AS Name State Type Role Remote IPaddr & Port SCTP Role ------------- ------------ ------------- ---- ---- ----------------------- --------- -my-asp ? uninitialized m3ua sg (127.0.0.200|127.0.0.201):12345 server + Current Primary Link +ASP Name AS Name State Type Role SCTP Role Remote Addresses +------------ ------------ ------------- ---- ---- --------- ----------------------- +my-asp ? uninitialized m3ua sg server (127.0.0.200|127.0.0.201):12345 ss7_asp_vty_test(config-cs7-asp)# show running-config ... local-ip 127.0.0.100 @@ -361,26 +361,26 @@ ss7_asp_vty_test(config-cs7-as)# asp my-asp ss7_asp_vty_test(config-cs7-as)# routing-key 0 3.2.1 ss7_asp_vty_test(config-cs7-as)# do show cs7 instance 0 asp - Current Primary Link -ASP Name AS Name State Type Role Remote IPaddr & Port SCTP Role ------------- ------------ ------------- ---- ---- ----------------------- --------- -my-asp my-ass ASP_DOWN m3ua sg (127.0.0.200|127.0.0.201):12345 server + Current Primary Link +ASP Name AS Name State Type Role SCTP Role Remote Addresses +------------ ------------ ------------- ---- ---- --------- ----------------------- +my-asp my-ass ASP_DOWN m3ua sg server (127.0.0.200|127.0.0.201):12345 ss7_asp_vty_test(config-cs7-as)# exit ss7_asp_vty_test(config-cs7)# do show cs7 instance 0 asp - Current Primary Link -ASP Name AS Name State Type Role Remote IPaddr & Port SCTP Role ------------- ------------ ------------- ---- ---- ----------------------- --------- -my-asp my-ass ASP_DOWN m3ua sg (127.0.0.200|127.0.0.201):12345 server + Current Primary Link +ASP Name AS Name State Type Role SCTP Role Remote Addresses +------------ ------------ ------------- ---- ---- --------- ----------------------- +my-asp my-ass ASP_DOWN m3ua sg server (127.0.0.200|127.0.0.201):12345 ss7_asp_vty_test(config-cs7)# exit ss7_asp_vty_test(config)# do show cs7 instance 0 asp - Current Primary Link -ASP Name AS Name State Type Role Remote IPaddr & Port SCTP Role ------------- ------------ ------------- ---- ---- ----------------------- --------- -my-asp my-ass ASP_DOWN m3ua sg (127.0.0.200|127.0.0.201):12345 server + Current Primary Link +ASP Name AS Name State Type Role SCTP Role Remote Addresses +------------ ------------ ------------- ---- ---- --------- ----------------------- +my-asp my-ass ASP_DOWN m3ua sg server (127.0.0.200|127.0.0.201):12345 ss7_asp_vty_test(config)# do show cs7 instance 0 as all Routing Routing Key Cic Cic Traffic @@ -423,9 +423,9 @@ No ASP named 'unknown-asp' found ss7_asp_vty_test(config-cs7)# no asp my-asp ss7_asp_vty_test(config-cs7)# do show cs7 instance 0 asp - Current Primary Link -ASP Name AS Name State Type Role Remote IPaddr & Port SCTP Role ------------- ------------ ------------- ---- ---- ----------------------- --------- + Current Primary Link +ASP Name AS Name State Type Role SCTP Role Remote Addresses +------------ ------------ ------------- ---- ---- --------- ----------------------- ss7_asp_vty_test(config-cs7)# do show cs7 instance 0 as all Routing Routing Key Cic Cic Traffic |