From b0802866746f302f636b707c8eec11fc2d06313c Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 13 Jun 2020 16:02:49 +0200 Subject: Add "no traffic-mode" configuration to AS As per RFC4666 it is optional whether or not a traffic-mode IE is part of ASPAC requests from ASP to SG. We implemented that so far by having none as default, unless the user specified an explicit traffic-mode in the VTY. However, we had no command to remove that explicit configuration and return to the implicit one. Change-Id: Ibe2b298dd76dc4b02521dc411ae9d570eaf5a9a2 --- src/osmo_ss7_vty.c | 12 ++++++++++++ tests/vty/ss7_asp_test.vty | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 9a2f8bb..9c31c00 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -878,6 +878,17 @@ DEFUN(as_traf_mode, as_traf_mode_cmd, return CMD_SUCCESS; } +DEFUN(as_no_traf_mode, as_no_traf_mode_cmd, + "no traffic-mode", + NO_STR "Remove explicit traffic mode of operation of this AS\n") +{ + struct osmo_ss7_as *as = vty->index; + + as->cfg.mode = 0; + as->cfg.mode_set_by_vty = false; + return CMD_SUCCESS; +} + DEFUN(as_recov_tout, as_recov_tout_cmd, "recovery-timeout <1-2000>", "Specifies the recovery timeout value in milliseconds\n" @@ -1931,6 +1942,7 @@ static void vty_init_shared(void *ctx) install_element(L_CS7_AS_NODE, &as_asp_cmd); install_element(L_CS7_AS_NODE, &as_no_asp_cmd); install_element(L_CS7_AS_NODE, &as_traf_mode_cmd); + install_element(L_CS7_AS_NODE, &as_no_traf_mode_cmd); install_element(L_CS7_AS_NODE, &as_recov_tout_cmd); install_element(L_CS7_AS_NODE, &as_qos_class_cmd); install_element(L_CS7_AS_NODE, &as_rout_key_cmd); diff --git a/tests/vty/ss7_asp_test.vty b/tests/vty/ss7_asp_test.vty index 9bafb02..7411b1f 100644 --- a/tests/vty/ss7_asp_test.vty +++ b/tests/vty/ss7_asp_test.vty @@ -250,6 +250,7 @@ ss7_asp_vty_test(config-cs7-as)# list asp NAME no asp NAME traffic-mode (broadcast | loadshare | roundrobin | override) + no traffic-mode recovery-timeout <1-2000> qos-class <0-255> routing-key RCONTEXT DPC @@ -271,7 +272,8 @@ ss7_asp_vty_test(config-cs7-as)# ? point-code Point Code Specific Features ss7_asp_vty_test(config-cs7-as)# no ? - asp Specify ASP to be removed from this AS + asp Specify ASP to be removed from this AS + traffic-mode Remove explicit traffic mode of operation of this AS ss7_asp_vty_test(config-cs7-as)# do show cs7 instance 0 as all Routing Routing Key Cic Cic Traffic -- cgit v1.2.3