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/+/18026 ) Change subject: library: fix enc_SystemInformation(): properly pad messages ...................................................................... library: fix enc_SystemInformation(): properly pad messages Due to a buggy nature of TITAN's padding attributes [1], we cannot apply them to individual fields of the records that are embedded into other structured types, like records and unions. Ensure that encoded System Information messages are padded to either 23 or 19 octets, depending on their type. In order to achieve this, rename and wrap the external encoding function. [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=562849 Change-Id: I3368df52985e576ad180c9a74d4925dd9c952b55 Signed-off-by: Vadim Yanitskiy <axilirator at gmail.com> --- M library/GSM_SystemInformation.ttcn 1 file changed, 25 insertions(+), 1 deletion(-) Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/GSM_SystemInformation.ttcn b/library/GSM_SystemInformation.ttcn index de1fcf7..758ad1c 100644 --- a/library/GSM_SystemInformation.ttcn +++ b/library/GSM_SystemInformation.ttcn @@ -228,9 +228,33 @@ other, OTHERWISE; )" }; - external function enc_SystemInformation(in SystemInformation si) return octetstring + external function enc_SystemInformationNoPad(in SystemInformation si) return octetstring with { extension "prototype(convert) encode(RAW)" }; external function dec_SystemInformation(in octetstring stream) return SystemInformation with { extension "prototype(convert) decode(RAW)" }; + /* Due to a buggy nature of TITAN's padding attributes, we have to apply padding manually. */ + function enc_SystemInformation(in SystemInformation si) return octetstring + { + var octetstring si_enc := enc_SystemInformationNoPad(si); + + /* Resulting message length depends on SI Type */ + select (si.header.message_type) { + case (SYSTEM_INFORMATION_TYPE_5, + SYSTEM_INFORMATION_TYPE_5bis, + SYSTEM_INFORMATION_TYPE_5ter) { + /* SACCH: no Rest Octets, return 'as-is' */ + return si_enc; + } + case (SYSTEM_INFORMATION_TYPE_6) { + /* SACCH: pad to 19 octets, leave room for L1/LAPDm headers */ + return f_pad_oct(si_enc, 19, '2B'O); + } + case else { + /* BCCH: pad to 23 octets */ + return f_pad_oct(si_enc, 23, '2B'O); + } + } + } + } with { encode "RAW"; variant "FIELDORDER(msb)" } -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18026 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: I3368df52985e576ad180c9a74d4925dd9c952b55 Gerrit-Change-Number: 18026 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <axilirator at gmail.com> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge at osmocom.org> Gerrit-Reviewer: pespin <pespin at sysmocom.de> Gerrit-MessageType: merged -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200505/69758f75/attachment.htm>