Change in ...osmo-ttcn3-hacks[master]: library/PCUIF_CodecPort.ttcn: strip padding bytes from PCUIF_data
fixeria has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15571 ) Change subject: library/PCUIF_CodecPort.ttcn: strip padding bytes from PCUIF_data .. library/PCUIF_CodecPort.ttcn: strip padding bytes from PCUIF_data In Ieefa61232eb215a19a02e490255332e28e23b8f8, I had to revert I5808954b5c67c3239e795e43ae77035152d359ef, because that change broke encoding of messages on the PCU interface. Since we cannot use 'PADDING' attribute until its implementation is fixed in TITAN, let's work this around by stripping padding bytes manually in UD_to_PCUIF(). Change-Id: Ibd698094c897d395208e80189457444a91018beb --- M library/PCUIF_CodecPort.ttcn 1 file changed, 10 insertions(+), 0 deletions(-) Approvals: laforge: Looks good to me, approved pespin: Looks good to me, but someone else must approve osmith: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/library/PCUIF_CodecPort.ttcn b/library/PCUIF_CodecPort.ttcn index 3d6ceac..4b2a8ce 100644 --- a/library/PCUIF_CodecPort.ttcn +++ b/library/PCUIF_CodecPort.ttcn @@ -26,9 +26,19 @@ pout.data := enc_PCUIF_Message(pin.data); } with { extension "prototype(fast)" }; +private function fix_padding(inout PCUIF_data data) { + data.data := substr(data.data, 0, data.len); +} + private function UD_to_PCUIF(in UD_send_data pin, out PCUIF_send_data pout) { pout.id := pin.id; pout.data := dec_PCUIF_Message(pin.data); + + /* HACK: fix padding in decoded message. Due to a bug in TITAN, we +* cannot just use its 'PADDING' attribute because it breaks decoding. */ + if (ischosen(pout.data.u.data_req)) { fix_padding(pout.data.u.data_req); } + if (ischosen(pout.data.u.data_cnf)) { fix_padding(pout.data.u.data_cnf); } + if (ischosen(pout.data.u.data_ind)) { fix_padding(pout.data.u.data_ind); } } with { extension "prototype(fast)" }; type port PCUIF_CODEC_PT message { -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15571 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: Ibd698094c897d395208e80189457444a91018beb Gerrit-Change-Number: 15571 Gerrit-PatchSet: 3 Gerrit-Owner: fixeria Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: laforge Gerrit-Reviewer: osmith Gerrit-Reviewer: pespin Gerrit-MessageType: merged
Change in ...osmo-ttcn3-hacks[master]: library/PCUIF_CodecPort.ttcn: strip padding bytes from PCUIF_data
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15571 ) Change subject: library/PCUIF_CodecPort.ttcn: strip padding bytes from PCUIF_data .. Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15571 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: Ibd698094c897d395208e80189457444a91018beb Gerrit-Change-Number: 15571 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: laforge Gerrit-Reviewer: osmith Gerrit-Reviewer: pespin Gerrit-Comment-Date: Thu, 26 Sep 2019 19:22:51 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in ...osmo-ttcn3-hacks[master]: library/PCUIF_CodecPort.ttcn: strip padding bytes from PCUIF_data
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15571 ) Change subject: library/PCUIF_CodecPort.ttcn: strip padding bytes from PCUIF_data .. Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/15571/2/library/PCUIF_CodecPort.ttcn File library/PCUIF_CodecPort.ttcn: https://gerrit.osmocom.org/#/c/15571/2/library/PCUIF_CodecPort.ttcn@38 PS2, Line 38:* cannot just use its 'PADDING' attribute because it breaks decoding. */ > Can you provide a reference to the mentioned TITAN bug? Otherwise it's > difficult to know when will i […] Unfortunately I still have not reported it. -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15571 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: Ibd698094c897d395208e80189457444a91018beb Gerrit-Change-Number: 15571 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: laforge Gerrit-Reviewer: osmith Gerrit-Reviewer: pespin Gerrit-Comment-Date: Thu, 26 Sep 2019 12:05:40 + Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: pespin Gerrit-MessageType: comment
Change in ...osmo-ttcn3-hacks[master]: library/PCUIF_CodecPort.ttcn: strip padding bytes from PCUIF_data
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15571 ) Change subject: library/PCUIF_CodecPort.ttcn: strip padding bytes from PCUIF_data .. Patch Set 2: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/15571/2/library/PCUIF_CodecPort.ttcn File library/PCUIF_CodecPort.ttcn: https://gerrit.osmocom.org/#/c/15571/2/library/PCUIF_CodecPort.ttcn@38 PS2, Line 38:* cannot just use its 'PADDING' attribute because it breaks decoding. */ Can you provide a reference to the mentioned TITAN bug? Otherwise it's difficult to know when will it be fixed. -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15571 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: Ibd698094c897d395208e80189457444a91018beb Gerrit-Change-Number: 15571 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: laforge Gerrit-Reviewer: osmith Gerrit-Reviewer: pespin Gerrit-Comment-Date: Thu, 26 Sep 2019 10:36:13 + Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in ...osmo-ttcn3-hacks[master]: library/PCUIF_CodecPort.ttcn: strip padding bytes from PCUIF_data
osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15571 ) Change subject: library/PCUIF_CodecPort.ttcn: strip padding bytes from PCUIF_data .. Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15571 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: Ibd698094c897d395208e80189457444a91018beb Gerrit-Change-Number: 15571 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: laforge Gerrit-Reviewer: osmith Gerrit-Comment-Date: Thu, 26 Sep 2019 09:15:17 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in ...osmo-ttcn3-hacks[master]: library/PCUIF_CodecPort.ttcn: strip padding bytes from PCUIF_data
Hello laforge, osmith, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15571 to look at the new patch set (#2). Change subject: library/PCUIF_CodecPort.ttcn: strip padding bytes from PCUIF_data .. library/PCUIF_CodecPort.ttcn: strip padding bytes from PCUIF_data In Ieefa61232eb215a19a02e490255332e28e23b8f8, I had to revert I5808954b5c67c3239e795e43ae77035152d359ef, because that change broke encoding of messages on the PCU interface. Since we cannot use 'PADDING' attribute until its implementation is fixed in TITAN, let's work this around by stripping padding bytes manually in UD_to_PCUIF(). Change-Id: Ibd698094c897d395208e80189457444a91018beb --- M library/PCUIF_CodecPort.ttcn 1 file changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/71/15571/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15571 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: Ibd698094c897d395208e80189457444a91018beb Gerrit-Change-Number: 15571 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: laforge Gerrit-Reviewer: osmith Gerrit-MessageType: newpatchset
Change in ...osmo-ttcn3-hacks[master]: library/PCUIF_CodecPort.ttcn: strip padding bytes from PCUIF_data
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15571 ) Change subject: library/PCUIF_CodecPort.ttcn: strip padding bytes from PCUIF_data .. Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/15571/1/library/PCUIF_CodecPort.ttcn File library/PCUIF_CodecPort.ttcn: https://gerrit.osmocom.org/#/c/15571/1/library/PCUIF_CodecPort.ttcn@32 PS1, Line 32: for (var integer i := 0; i < data.len; i := i + 1) { : res[i] := data.data[i]; : } there is a builtin substring function called 'substr' which we use in various places of osmo-ttcn3-hacks already. So please replace the above with "res := substr(data.data, 0, data.len)" -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15571 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: Ibd698094c897d395208e80189457444a91018beb Gerrit-Change-Number: 15571 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: laforge Gerrit-Reviewer: osmith Gerrit-Comment-Date: Fri, 20 Sep 2019 15:26:07 + Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
Change in ...osmo-ttcn3-hacks[master]: library/PCUIF_CodecPort.ttcn: strip padding bytes from PCUIF_data
osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15571 ) Change subject: library/PCUIF_CodecPort.ttcn: strip padding bytes from PCUIF_data .. Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15571 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: Ibd698094c897d395208e80189457444a91018beb Gerrit-Change-Number: 15571 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: laforge Gerrit-Reviewer: osmith Gerrit-Comment-Date: Thu, 19 Sep 2019 08:27:53 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in ...osmo-ttcn3-hacks[master]: library/PCUIF_CodecPort.ttcn: strip padding bytes from PCUIF_data
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15571 Change subject: library/PCUIF_CodecPort.ttcn: strip padding bytes from PCUIF_data .. library/PCUIF_CodecPort.ttcn: strip padding bytes from PCUIF_data In Ieefa61232eb215a19a02e490255332e28e23b8f8, I had to revert I5808954b5c67c3239e795e43ae77035152d359ef, because that change broke encoding of messages on the PCU interface. Since we cannot use 'PADDING' attribute until its implementation is fixed in TITAN, let's work this around by stripping padding bytes manually in UD_to_PCUIF(). Change-Id: Ibd698094c897d395208e80189457444a91018beb --- M library/PCUIF_CodecPort.ttcn 1 file changed, 16 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/71/15571/1 diff --git a/library/PCUIF_CodecPort.ttcn b/library/PCUIF_CodecPort.ttcn index 3d6ceac..caeceb2 100644 --- a/library/PCUIF_CodecPort.ttcn +++ b/library/PCUIF_CodecPort.ttcn @@ -26,9 +26,25 @@ pout.data := enc_PCUIF_Message(pin.data); } with { extension "prototype(fast)" }; +private function fix_padding(inout PCUIF_data data) { + var octetstring res; + + for (var integer i := 0; i < data.len; i := i + 1) { + res[i] := data.data[i]; + } + + data.data := res; +} + private function UD_to_PCUIF(in UD_send_data pin, out PCUIF_send_data pout) { pout.id := pin.id; pout.data := dec_PCUIF_Message(pin.data); + + /* HACK: fix padding in decoded message. Due to a bug in TITAN, we +* cannot just use its 'PADDING' attribute because it breaks decoding. */ + if (ischosen(pout.data.u.data_req)) { fix_padding(pout.data.u.data_req); } + if (ischosen(pout.data.u.data_cnf)) { fix_padding(pout.data.u.data_cnf); } + if (ischosen(pout.data.u.data_ind)) { fix_padding(pout.data.u.data_ind); } } with { extension "prototype(fast)" }; type port PCUIF_CODEC_PT message { -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15571 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: Ibd698094c897d395208e80189457444a91018beb Gerrit-Change-Number: 15571 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria Gerrit-MessageType: newchange