[L] Change in libosmocore[master]: gsm: new struct and en/decoding functions for BC-IE
Attention is currently required from: fixeria, pespin. falconia has posted comments on this change by falconia. ( https://gerrit.osmocom.org/c/libosmocore/+/44192?usp=email ) Change subject: gsm: new struct and en/decoding functions for BC-IE ...................................................................... Patch Set 2: (13 comments) Patchset: PS2:
Agreeing with Pau here. In this case, where should the low-level struct definitions go? Also inside `gsm48_ie.c`?
PS2:
Thanks for your contribution! The code looks good in general, but I found a few potential issues. […] Note in TODO-RELEASE: what should it say?
Unit tests: I agree they are necessary, but I don't have enough spare cycles at the present moment. Would it be acceptable to merge the patches once the remaining issues are resolved, with a plan to add unit tests later? If we get the patches merged, I'll start using the new structs and functions right away in hera-msc-be (see https://gitea.osmocom.org/themwi/hera-msc-be), as opposed to having to maintain a local parallel version, resulting in real usage and thus real testing. Then maybe I'll make some time for unit tests after my osmo-msc patches for MNCC raw mode are lifted out of WIP, reviewed and merged. Commit Message: https://gerrit.osmocom.org/c/libosmocore/+/44192/comment/00e07e2d_cd120572?u... : PS2, Line 7: gsm: new struct and en/decoding functions for BC-IE
Oh, good to see someone is working on this! […] I assigned the ticket to myself.
File include/osmocom/gsm/gsm48_ie.h: https://gerrit.osmocom.org/c/libosmocore/+/44192/comment/e975cc4d_130b78ec?u... : PS2, Line 25: #define OSMO_BCAP_MAX_SPEECH_VER 9
It probably makes sense to leave some extra unsued just in case more are ever added? We are about to head into 2027, and the specs for GSM have been frozen for what, two decades now? But if you would like me to add more octets here (yes, I understand that it is an ABI-affected struct), please tell me how many.
https://gerrit.osmocom.org/c/libosmocore/+/44192/comment/1c026d65_65e3f2d4?u... : PS2, Line 141: int osmo_gsm48_decode_bcap_ll(struct osmo_bcap_ll *lld, uint8_t ie_len,
We usually put the buffer then the length when they are separate params. OK, I will flip them in the next iteration of this patch. I did it this way because I was trying to stay close to the old function that takes a pointer to LV, where L comes before V.
File src/gsm/gsm48_ie.c: https://gerrit.osmocom.org/c/libosmocore/+/44192/comment/ed07e810_5ac39c39?u... : PS2, Line 341: if (cp >= endp) : return -EINVAL;
Shouldn't we check the coding bit (number 7) here? […] Thanks for the catch! I will definitely fix it.
https://gerrit.osmocom.org/c/libosmocore/+/44192/comment/35c4dc03_17be186f?u... : PS2, Line 443: hld->v120_params = lld->octet_5_ext[1];
You should mask the extension bit here: […] Acknowledged
https://gerrit.osmocom.org/c/libosmocore/+/44192/comment/6961a01d_e91e40fb?u... : PS2, Line 630: for (n = 0; n < lld->speech.num_vers; n++) {
Maybe add an `assert()` before the loop to make sure that `lld->speech. […] Acknowledged
https://gerrit.osmocom.org/c/libosmocore/+/44192/comment/22bce14b_3e5eb2ff?u... : PS2, Line 647: for (n = 0; n < lld->data.extent_of_5; n++)
Likewise here (see my comment above): it may be a good idea to check if `lld->data. […] Acknowledged
https://gerrit.osmocom.org/c/libosmocore/+/44192/comment/6875f126_1d5ef688?u... : PS2, Line 650: for (n = 0; n < lld->data.extent_of_6; n++)
Likewise here (see my comment above): it may be a good idea to check if `lld->data. […] Acknowledged
https://gerrit.osmocom.org/c/libosmocore/+/44192/comment/fc139f5d_7bbe6d9b?u... : PS2, Line 658: if (lv_only)
It's worth checking `msgb_tailroom()` here first, since the `msg` comes from a caller and is not gua […] Acknowledged
https://gerrit.osmocom.org/c/libosmocore/+/44192/comment/d60c8700_a6218909?u... : PS2, Line 665: bcap_enc_trim_6d_6f
AFAICS, this function also handles octet 6g, so maybe rename to `bcap_enc_trim_6d_6g()` or `bcap_enc […] Good catch: 6d through 6g was my intent.
https://gerrit.osmocom.org/c/libosmocore/+/44192/comment/c5fd3e76_3d86dc97?u... : PS2, Line 715: if (hld->other_ra == GSM48_BCAP_OTHER_RA_V120) {
`GSM48_BCAP_OTHER_RA_V120` is defined as 0, so `hld->other_ra` indicates V. […] Good catch once again - I must have been too sleepy when I wrote this code.
-- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/44192?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ie864734fe1dfd1587bafddd4248ce69a7e066525 Gerrit-Change-Number: 44192 Gerrit-PatchSet: 2 Gerrit-Owner: falconia <falcon@freecalypso.org> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: fixeria <vyanitskiy@sysmocom.de> Gerrit-CC: pespin <pespin@sysmocom.de> Gerrit-Attention: pespin <pespin@sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy@sysmocom.de> Gerrit-Comment-Date: Mon, 30 Nov 2026 16:08:52 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: fixeria <vyanitskiy@sysmocom.de> Comment-In-Reply-To: pespin <pespin@sysmocom.de>
participants (1)
-
falconia