pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34498?usp=email )
Change subject: PCUIF_Components: ensure clean IMSI string
......................................................................
PCUIF_Components: ensure clean IMSI string
When receiving an IMSI from PCUIF (see type record PCUIF_pch), it is
represented as a null terminated string. The field is set to be 17
characters wide with a pdding of zeros at the end (as it ought to be
for a null terminated string). Unfortunately TTCN3 will not chop off
the trailing zeros, and also include them when the string length is
determined using lengthof(). This means we must take care of this
ourselves.
Let's use a regular expression to make sure any non numerical digits
are trimmed off before passing the IMSI string on to higher layers.
Related: OS#5927
Change-Id: I7bfea59a306e75211856e4e80985ebf000c42224
---
M pcu/PCUIF_Components.ttcn
1 file changed, 24 insertions(+), 1 deletion(-)
Approvals:
pespin: Looks good to me, approved
fixeria: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/pcu/PCUIF_Components.ttcn b/pcu/PCUIF_Components.ttcn
index 01638b1..d417995 100644
--- a/pcu/PCUIF_Components.ttcn
+++ b/pcu/PCUIF_Components.ttcn
@@ -542,6 +542,8 @@
var octetstring data;
var PCUIF_pch pch;
var PCUIF_agch agch;
+ var charstring imsi_filter_regexp := "(\d*)"; /* numbers only */
+
/* On PCH the payload is prefixed with paging group (3 octets): skip it.
* TODO: add an additional template parameter, so we can match it. */
if (pcu_msg.u.data_req.sapi == PCU_IF_SAPI_PCH) {
@@ -555,7 +557,7 @@
if (pcu_msg_rr.raw.sapi == PCU_IF_SAPI_PCH_2) {
pch := dec_PCUIF_pch(pcu_msg_rr.raw.data);
pcu_msg_rr.msg_id := pch.msg_id;
- pcu_msg_rr.imsi := pch.imsi;
+ pcu_msg_rr.imsi := regexp(pch.imsi, imsi_filter_regexp, 0);
pcu_msg_rr.rr_msg := dec_GsmRrMessage(pch.data);
pcu_msg_rr.confirm := pch.confirm;
} else if (pcu_msg_rr.raw.sapi == PCU_IF_SAPI_AGCH_2) {
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34498?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I7bfea59a306e75211856e4e80985ebf000c42224
Gerrit-Change-Number: 34498
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34500?usp=email )
Change subject: GPRS_Components: confirm only when requested
......................................................................
GPRS_Components: confirm only when requested
We currently send a confirmation back when the SAPI was PCH. This is no
longer correct. We now have to check if the receiving end has actually
requested a confirmation.
Related: OS#5927
Change-Id: I339dfd0c057d957d2ace24fd6821e54c25fe8eb2
---
M pcu/GPRS_Components.ttcn
1 file changed, 22 insertions(+), 4 deletions(-)
Approvals:
pespin: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/pcu/GPRS_Components.ttcn b/pcu/GPRS_Components.ttcn
index aaec6d3..849a251 100644
--- a/pcu/GPRS_Components.ttcn
+++ b/pcu/GPRS_Components.ttcn
@@ -1070,8 +1070,10 @@
t_imm_ass)) -> value data_msg {
rr_imm_ass := data_msg.rr_msg;
log("Rx Immediate Assignment: ", rr_imm_ass);
- /* Send DATA.cnf back to the IUT (only needed for PCH) */
- f_pcuif_tx_data_cnf(data_msg);
+ /* Send DATA.cnf back to the IUT */
+ if (ispresent(data_msg.confirm) and data_msg.confirm) {
+ f_pcuif_tx_data_cnf(data_msg);
+ }
setverdict(pass);
}
}
@@ -1187,8 +1189,10 @@
f_shutdown(__BFILE__, __LINE__);
}
- /* Send DATA.cnf back to the IUT (only needed for PCH) */
- f_pcuif_tx_data_cnf(data_msg);
+ /* Send DATA.cnf back to the IUT */
+ if (ispresent(data_msg.confirm) and data_msg.confirm) {
+ f_pcuif_tx_data_cnf(data_msg);
+ }
return rr_pag_req1;
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34500?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I339dfd0c057d957d2ace24fd6821e54c25fe8eb2
Gerrit-Change-Number: 34500
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: dexter.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34500?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: GPRS_Components: confirm only when requested
......................................................................
GPRS_Components: confirm only when requested
We currently send a confirmation back when the SAPI was PCH. This is no
longer correct. We now have to check if the receiving end has actually
requested a confirmation.
Related: OS#5927
Change-Id: I339dfd0c057d957d2ace24fd6821e54c25fe8eb2
---
M pcu/GPRS_Components.ttcn
1 file changed, 22 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/00/34500/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34500?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I339dfd0c057d957d2ace24fd6821e54c25fe8eb2
Gerrit-Change-Number: 34500
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newpatchset