pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/43157?usp=email )
Change subject: asp: vty: Explicitly test timer lm value ranges
......................................................................
asp: vty: Explicitly test timer lm value ranges
Validate the value to be set provided by user over VTY is actually
within the range of the specific tdef being set.
Mark all of them explicitly as min_val=1 in its tdef, since they are not
expected to be set to 0 (see also gen_asp_timer_lm_cmd_strs() defining a
VTY range <1..999999>).
Change-Id: I9b2c426a1eaceb6e7c5fbe35872ada324fef5733
---
M src/ss7_asp_vty.c
M src/xua_default_lm_fsm.c
M tests/vty/osmo_stp_test.vty
M tests/vty/ss7_asp_test.vty
4 files changed, 34 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/57/43157/1
diff --git a/src/ss7_asp_vty.c b/src/ss7_asp_vty.c
index 21d19d6..5136105 100644
--- a/src/ss7_asp_vty.c
+++ b/src/ss7_asp_vty.c
@@ -891,13 +891,27 @@
{
struct osmo_ss7_asp *asp = vty->index;
enum ss7_asp_lm_timer timer = get_string_value(ss7_asp_lm_timer_names, argv[0]);
+ int rc;
+ unsigned long new_val = atoi(argv[1]);
if (timer <= 0 || timer >= SS7_ASP_LM_TIMERS_LEN) {
vty_out(vty, "%% Invalid timer: %s%s", argv[0], VTY_NEWLINE);
return CMD_WARNING;
}
- osmo_tdef_set(asp->cfg.T_defs_lm, timer, atoi(argv[1]), OSMO_TDEF_S);
+ rc = osmo_tdef_set(asp->cfg.T_defs_lm, timer, new_val, OSMO_TDEF_S);
+ if (rc < 0) {
+ struct osmo_tdef *t = osmo_tdef_get_entry(asp->cfg.T_defs_lm, timer);
+ if (!t)
+ return CMD_WARNING;
+ if (!osmo_tdef_val_in_range(t, new_val)) {
+ char range_str[64];
+ osmo_tdef_range_str_buf(range_str, sizeof(range_str), t);
+ vty_out(vty, "%% Timer %s value %lu is out of range %s%s",
+ argv[0], new_val, range_str, VTY_NEWLINE);
+ }
+ return CMD_WARNING;
+ }
return CMD_SUCCESS;
}
diff --git a/src/xua_default_lm_fsm.c b/src/xua_default_lm_fsm.c
index 73c4fdc..db84e6e 100644
--- a/src/xua_default_lm_fsm.c
+++ b/src/xua_default_lm_fsm.c
@@ -102,13 +102,17 @@
const struct osmo_tdef ss7_asp_lm_timer_defaults[SS7_ASP_LM_TIMERS_LEN] = {
{ .T = SS7_ASP_LM_T_WAIT_ASP_UP, .default_val = 20, .unit = OSMO_TDEF_S,
- .desc = "Restart ASP after timeout waiting for ASP UP (SG role) / ASP UP ACK (ASP role) (s)" },
+ .desc = "Restart ASP after timeout waiting for ASP UP (SG role) / ASP UP ACK (ASP role) (s)",
+ .min_val = 1 },
{ .T = SS7_ASP_LM_T_WAIT_NOTIFY, .default_val = 2, .unit = OSMO_TDEF_S,
- .desc = "Restart ASP after timeout waiting for NOTIFY (s)" },
+ .desc = "Restart ASP after timeout waiting for NOTIFY (s)",
+ .min_val = 1 },
{ .T = SS7_ASP_LM_T_WAIT_NOTIY_RKM, .default_val = 20, .unit = OSMO_TDEF_S,
- .desc = "Restart ASP after timeout waiting for NOTIFY after RKM registration (s)" },
+ .desc = "Restart ASP after timeout waiting for NOTIFY after RKM registration (s)",
+ .min_val = 1 },
{ .T = SS7_ASP_LM_T_WAIT_RK_REG_RESP, .default_val = 10, .unit = OSMO_TDEF_S,
- .desc = "Restart ASP after timeout waiting for RK_REG_RESP (s)" },
+ .desc = "Restart ASP after timeout waiting for RK_REG_RESP (s)",
+ .min_val = 1 },
{}
};
diff --git a/tests/vty/osmo_stp_test.vty b/tests/vty/osmo_stp_test.vty
index 2dbd5b2..d52ae5f 100644
--- a/tests/vty/osmo_stp_test.vty
+++ b/tests/vty/osmo_stp_test.vty
@@ -415,6 +415,11 @@
... !timer xua beat 30
...
+OsmoSTP(config-cs7-asp)# timer lm ?
+ wait_asp_up Restart ASP after timeout waiting for ASP UP (SG role) / ASP UP ACK (ASP role) (s) (default: 20)
+ wait_notify Restart ASP after timeout waiting for NOTIFY (s) (default: 2)
+ wait_notify_rkm Restart ASP after timeout waiting for NOTIFY after RKM registration (s) (default: 20)
+ wait_rk_reg_resp Restart ASP after timeout waiting for RK_REG_RESP (s) (default: 10)
OsmoSTP(config-cs7-asp)# exit
% NOTE: Skipping automatic restart of ASP since an explicit '[no] shutdown' command was entered
diff --git a/tests/vty/ss7_asp_test.vty b/tests/vty/ss7_asp_test.vty
index f3193b6..5ea965b 100644
--- a/tests/vty/ss7_asp_test.vty
+++ b/tests/vty/ss7_asp_test.vty
@@ -432,6 +432,12 @@
... !timer xua beat 30
...
+ss7_asp_vty_test(config-cs7-asp)# timer lm ?
+ wait_asp_up Restart ASP after timeout waiting for ASP UP (SG role) / ASP UP ACK (ASP role) (s) (default: 20)
+ wait_notify Restart ASP after timeout waiting for NOTIFY (s) (default: 2)
+ wait_notify_rkm Restart ASP after timeout waiting for NOTIFY after RKM registration (s) (default: 20)
+ wait_rk_reg_resp Restart ASP after timeout waiting for RK_REG_RESP (s) (default: 10)
+
ss7_asp_vty_test(config-cs7-asp)# exit
% NOTE: Make sure to use '[no] shutdown' command in 'asp' node in order to restart the ASP for new configs to be applied.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/43157?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I9b2c426a1eaceb6e7c5fbe35872ada324fef5733
Gerrit-Change-Number: 43157
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Attention is currently required from: daniel, fixeria, laforge, lynxis lazus, pespin.
osmith has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43152?usp=email )
Change subject: stp: tcap: Avoid need of N_NOTICE.req
......................................................................
Patch Set 1:
(1 comment)
File stp/STP_Tests_TCAP.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43152/comment/00f0c447_d105… :
PS1, Line 212: private function f_asp_disconnect_mtp3_port(integer asp_idx := 0) runs on TCAP_CT
> Not really needed for the existing test, but since most of the complexity with all this is actually […]
Acknowledged
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43152?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ia1b7f487124584ab1720cb89bca5999cbb12392d
Gerrit-Change-Number: 43152
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Comment-Date: Mon, 03 Aug 2026 11:41:17 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: osmith <osmith(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Attention is currently required from: daniel, fixeria, laforge, lynxis lazus, osmith.
pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43152?usp=email )
Change subject: stp: tcap: Avoid need of N_NOTICE.req
......................................................................
Patch Set 1:
(1 comment)
File stp/STP_Tests_TCAP.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43152/comment/6fd5f0f1_b9e4… :
PS1, Line 212: private function f_asp_disconnect_mtp3_port(integer asp_idx := 0) runs on TCAP_CT
> do you need to call this somewhere?
Not really needed for the existing test, but since most of the complexity with all this is actually figureing out where/how to hook stuff in the big set of layers, I think it's a good idea to leave it here in case one needs to write more tests needing to send UDTS and then disconnecting to let the SCCP layer continue without the hook.
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43152?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ia1b7f487124584ab1720cb89bca5999cbb12392d
Gerrit-Change-Number: 43152
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Comment-Date: Mon, 03 Aug 2026 11:40:47 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: osmith <osmith(a)sysmocom.de>
Attention is currently required from: pespin.
osmith has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43155?usp=email )
Change subject: Revert "deps: use a fork of titan.ProtocolEmulations.SCCP"
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43155?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I4eb81e0ffc6500340199c4a23a7aabfee925c33b
Gerrit-Change-Number: 43155
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 03 Aug 2026 11:29:32 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: pespin.
osmith has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43154?usp=email )
Change subject: Revert "stp: add ASP_SCCP_N_NOTICE_req support and f_asp_tx_notice()"
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43154?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Iecce8999b72b363a7aa3f583beeb937e79fe215f
Gerrit-Change-Number: 43154
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 03 Aug 2026 11:29:16 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: pespin.
osmith has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43153?usp=email )
Change subject: Revert "stp: Add TCAP_N_NOTICE_req to send a UDTS with TCAP payload"
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43153?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I4e96d9f0ceaafb2b5883b0e1f2d8d9f6065fd415
Gerrit-Change-Number: 43153
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 03 Aug 2026 11:29:06 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43155?usp=email )
Change subject: Revert "deps: use a fork of titan.ProtocolEmulations.SCCP"
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
@vyanitskiy@sysmocom.de, once this is merged you/we can get rid of the fixeria/udts branch in our titan.ProtocoEmulations.SCCP fork.
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43155?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I4eb81e0ffc6500340199c4a23a7aabfee925c33b
Gerrit-Change-Number: 43155
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Mon, 03 Aug 2026 09:44:18 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No