This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
laforge gerrit-no-reply at lists.osmocom.orglaforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19436 )
Change subject: bsc CBSP: f_page2rsl: fix nr of blocks calculation
......................................................................
bsc CBSP: f_page2rsl: fix nr of blocks calculation
When dividing the payload by 22, the initial 6 header octets must also be taken
into account.
And, the last_block value indicates 4 as 0, which is not encoded correctly
before this patch. Add a separate f_cbsp_block_count_enc() to fix the
calculation.
Change-Id: I06cc144bd92e94d461dac3f56a738da8e055b73a
---
M bsc/BSC_Tests_CBSP.ttcn
1 file changed, 24 insertions(+), 4 deletions(-)
Approvals:
laforge: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/bsc/BSC_Tests_CBSP.ttcn b/bsc/BSC_Tests_CBSP.ttcn
index 207f340..2399c3a 100644
--- a/bsc/BSC_Tests_CBSP.ttcn
+++ b/bsc/BSC_Tests_CBSP.ttcn
@@ -289,17 +289,37 @@
last_block := lblock
}
+/* translate blocks count to RSL_CB_CMD_LASTBLOCK_1..4 values */
+private function f_cbsp_block_count_enc(integer num_blocks) return integer
+{
+ if (num_blocks < 1 or num_blocks > 4) {
+ setverdict(fail, "Invalid num_blocks: ", num_blocks);
+ mtc.stop;
+ }
+ if (num_blocks == 4) {
+ return 0;
+ }
+ return num_blocks;
+}
+
/* build a RSL_Message receive template from a CBSP page */
private function f_page2rsl(CBSP_IE page, uint16_t msg_id, uint16_t ser_no, boolean ext_cbch := false)
return template (present) RSL_Message
{
var template RSL_Message tr;
- var integer lblock := page.body.msg_content.user_len / 22;
+ var integer len;
+ var integer num_blocks;
var octetstring payload;
- if (page.body.msg_content.user_len mod 22 > 0) {
- lblock := lblock + 1;
- }
+
payload := int2oct(ser_no, 2) & int2oct(msg_id, 2) & '0011'O & page.body.msg_content.val;
+ len := lengthof(payload);
+ num_blocks := len / 22;
+ if (len mod 22 > 0) {
+ num_blocks := num_blocks + 1;
+ }
+
+ var integer lblock := f_cbsp_block_count_enc(num_blocks);
+
tr := tr_RSL_SMSCB_CMD(tr_RslCbCmdType(lblock), f_pad_oct(payload, 88, '00'O));
if (ext_cbch) {
tr.ies[3] := tr_RSL_IE(RSL_IE_Body:{smscb_chan_ind := 1});
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19436
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: I06cc144bd92e94d461dac3f56a738da8e055b73a
Gerrit-Change-Number: 19436
Gerrit-PatchSet: 4
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-CC: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200813/260bb09f/attachment.htm>