lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

February 2023

  • 1 participants
  • 2601 discussions
Change in osmo-ttcn3-hacks[master]: PCU_Tests: remove unnecessary valueof() in NACC TCs
by pespin 13 Feb '23

13 Feb '23
Attention is currently required from: fixeria. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31300 ) Change subject: PCU_Tests: remove unnecessary valueof() in NACC TCs ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31300 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: I86970bb422ad1693829fd20ecf5ee34ef77f30af Gerrit-Change-Number: 31300 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Mon, 13 Feb 2023 09:14:29 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in ...osmo-python-tests[master]: scripts/osmotestconfig.py: Fix tests failing due to attempted copy on...
by pespin 13 Feb '23

13 Feb '23
Attention is currently required from: arehbein. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/python/osmo-python-tests/+/30980 ) Change subject: scripts/osmotestconfig.py: Fix tests failing due to attempted copy on socket files ...................................................................... Patch Set 5: (1 comment) File scripts/osmotestconfig.py: https://gerrit.osmocom.org/c/python/osmo-python-tests/+/30980/comment/97c24… PS5, Line 80: ign = shutil.ignore_patterns('*.cfg', '*tmp_dummy_sock') > The files are created by the `ctrl_test_runner. […] It's the first time I actually realize the existence of this socket. I'm not even sure about its purpose :O In any case, this file name looks per-project specific. I'd maybe add a new optional param to copy_config which users inside each project can pass a list of patterns to ignore. -- To view, visit https://gerrit.osmocom.org/c/python/osmo-python-tests/+/30980 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Change-Id: I3a3cc7ed135b60b97eb901cfc20fdcb924e4f664 Gerrit-Change-Number: 30980 Gerrit-PatchSet: 5 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: arehbein <arehbein(a)sysmocom.de> Gerrit-Comment-Date: Mon, 13 Feb 2023 09:13:41 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: arehbein <arehbein(a)sysmocom.de> Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
Change in libosmo-sccp[master]: SS7: do not attempt transfer if AS is down
by pespin 13 Feb '23

13 Feb '23
Attention is currently required from: neels, laforge, msuraev. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/31295 ) Change subject: SS7: do not attempt transfer if AS is down ...................................................................... Patch Set 2: (2 comments) File src/osmo_ss7.c: https://gerrit.osmocom.org/c/libosmo-sccp/+/31295/comment/4937c4fe_64d96911 PS2, Line 1151: if (!as->fi) So now we enter the debate whether an unexisting as is down or not. Which in the end imho it doesn't make much sense (like comparing pears and apples). Hence, stop considering this case and simply OSMO_ASSERT(as), as it makes no sense to check if a NULL as is down. File src/osmo_ss7_hmrt.c: https://gerrit.osmocom.org/c/libosmo-sccp/+/31295/comment/430090f8_bd113aba PS2, Line 234: return -ENETDOWN; > ENETDOWN "Network is down" seems drastic? […] I'm fine with ENETDOWN, to me that's what's being cecked. -- To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/31295 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Change-Id: I0d5f3b6265e7fdaa79e32fbc30f829ef79e7dad1 Gerrit-Change-Number: 31295 Gerrit-PatchSet: 2 Gerrit-Owner: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: msuraev <msuraev(a)sysmocom.de> Gerrit-Comment-Date: Mon, 13 Feb 2023 09:06:37 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
Change in osmo-hnbgw[master]: UE state leak: when HNB re-registers, discard previous UE state
by pespin 13 Feb '23

13 Feb '23
Attention is currently required from: neels. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/31293 ) Change subject: UE state leak: when HNB re-registers, discard previous UE state ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/31293 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hnbgw Gerrit-Branch: master Gerrit-Change-Id: I7fa8a04cc3b2dfba263bda5b410961c77fbed332 Gerrit-Change-Number: 31293 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Comment-Date: Mon, 13 Feb 2023 08:50:55 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in libosmo-gprs[master]: sndcp: Add missing osmocom/core/endian.h include
by pespin 13 Feb '23

13 Feb '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/31287 ) Change subject: sndcp: Add missing osmocom/core/endian.h include ...................................................................... sndcp: Add missing osmocom/core/endian.h include Header uses OSMO_IS_LITTLE_ENDIAN but it's not including the header conditionally definining it. Change-Id: Ie80bc320b0d31a4b8fc971a864094edd08b0e6dc --- M include/osmocom/gprs/sndcp/sndcp_private.h 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: fixeria: Looks good to me, approved msuraev: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/include/osmocom/gprs/sndcp/sndcp_private.h b/include/osmocom/gprs/sndcp/sndcp_private.h index 206b660..8943a78 100644 --- a/include/osmocom/gprs/sndcp/sndcp_private.h +++ b/include/osmocom/gprs/sndcp/sndcp_private.h @@ -9,6 +9,7 @@ #include <osmocom/core/linuxlist.h> #include <osmocom/core/msgb.h> #include <osmocom/core/logging.h> +#include <osmocom/core/endian.h> #include <osmocom/gprs/llc/llc.h> #include <osmocom/gprs/sndcp/sndcp.h> -- To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/31287 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-gprs Gerrit-Branch: master Gerrit-Change-Id: Ie80bc320b0d31a4b8fc971a864094edd08b0e6dc Gerrit-Change-Number: 31287 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-ttcn3-hacks[master]: library/DIAMETER_Emulation: initiate CER/CEA exchange in client mode
by pespin 13 Feb '23

13 Feb '23
Attention is currently required from: fixeria. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31292 ) Change subject: library/DIAMETER_Emulation: initiate CER/CEA exchange in client mode ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31292 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: I7537b306c2a569e2232597f21e15d3cf4ec9a12c Gerrit-Change-Number: 31292 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Mon, 13 Feb 2023 08:47:54 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-trx[master]: configure.ac: check if LIBTRXCON_DIR (submodule) exists
by pespin 13 Feb '23

13 Feb '23
Attention is currently required from: Hoernchen, laforge, fixeria. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-trx/+/30795 ) Change subject: configure.ac: check if LIBTRXCON_DIR (submodule) exists ...................................................................... Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/30795 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Change-Id: I06456c2087e160032f5bf8b36304477390f117d0 Gerrit-Change-Number: 30795 Gerrit-PatchSet: 3 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Mon, 13 Feb 2023 08:35:08 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in libosmocore[master]: gsm0808_enc/dec_channel_type: support data
by osmith 13 Feb '23

13 Feb '23
osmith has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/31265 ) Change subject: gsm0808_enc/dec_channel_type: support data ...................................................................... gsm0808_enc/dec_channel_type: support data Related: OS#4393 Change-Id: Ib7b75c9d86aace329decf20003b68de459021c64 --- M include/osmocom/gsm/protocol/gsm_08_08.h M src/gsm/gsm0808_utils.c M tests/gsm0808/gsm0808_test.c 3 files changed, 245 insertions(+), 20 deletions(-) Approvals: laforge: Looks good to me, but someone else must approve osmith: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index a33b01a..eacb954 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -500,6 +500,42 @@ GSM0808_PERM_HR6 = 0x45, /*!< OHR AMR */ }; +/* 3GPP TS 48.008 3.2.2.11 Channel Type + * Transparent: Data Rate */ +enum gsm0808_data_rate_transp { + GSM0808_DATA_RATE_TRANSP_32000 = 0x3a, + GSM0808_DATA_RATE_TRANSP_28800 = 0x39, + GSM0808_DATA_RATE_TRANSP_14400 = 0x18, + GSM0808_DATA_RATE_TRANSP_09600 = 0x10, + GSM0808_DATA_RATE_TRANSP_04800 = 0x11, + GSM0808_DATA_RATE_TRANSP_02400 = 0x12, + GSM0808_DATA_RATE_TRANSP_01200 = 0x13, + GSM0808_DATA_RATE_TRANSP_00600 = 0x14, + GSM0808_DATA_RATE_TRANSP_01200_75 = 0x15, +}; + +/* 3GPP TS 48.008 3.2.2.11 Channel Type + * Non-Transparent: Radio Interface Data Rate (preferred) */ +enum gsm0808_data_rate_non_transp { + GSM0808_DATA_RATE_NON_TRANSP_12000_6000 = 0x00, + GSM0808_DATA_RATE_NON_TRANSP_43500 = 0x34, + GSM0808_DATA_RATE_NON_TRANSP_29000 = 0x31, + GSM0808_DATA_RATE_NON_TRANSP_14500 = 0x14, + GSM0808_DATA_RATE_NON_TRANSP_12000 = 0x10, + GSM0808_DATA_RATE_NON_TRANSP_06000 = 0x11, +}; + +/* 3GPP TS 48.008 3.2.2.11 Channel Type + * Non-Transparent: Allowed Radio Interface Data Rate (all possible allowed) */ +enum gsm0808_data_rate_allowed_r_if { + GSM0808_DATA_RATE_NON_TRANSP_ALLOWED_43500 = 0x40, + GSM0808_DATA_RATE_NON_TRANSP_ALLOWED_32000 = 0x20, + GSM0808_DATA_RATE_NON_TRANSP_ALLOWED_29000 = 0x10, + GSM0808_DATA_RATE_NON_TRANSP_ALLOWED_14500 = 0x08, + GSM0808_DATA_RATE_NON_TRANSP_ALLOWED_12000 = 0x02, + GSM0808_DATA_RATE_NON_TRANSP_ALLOWED_06000 = 0x01, +}; + extern const struct value_string gsm0808_permitted_speech_names[]; static inline const char *gsm0808_permitted_speech_name(enum gsm0808_permitted_speech val) { return get_value_string(gsm0808_permitted_speech_names, val); } @@ -658,13 +694,32 @@ uint8_t len; }; +/* 3GPP TS 48.008 3.2.2.11 Channel Type + * Asymmetry Preference (used for data, non-transparent service) */ +enum gsm0808_channel_type_asym_pref { + GSM0808_CT_ASYM_PREF_NOT_APPLICABLE = 0, + GSM0808_CT_ASYM_PREF_UL = 1, + GSM0808_CT_ASYM_PREF_DL = 2, + GSM0808_CT_ASYM_PREF_SPARE = 3, +}; + /* 3GPP TS 48.008 3.2.2.11 Channel Type */ #define CH_TYPE_PERM_SPCH_MAXLEN 9 struct gsm0808_channel_type { uint8_t ch_indctr; uint8_t ch_rate_type; + + /* Speech only */ uint8_t perm_spch[CH_TYPE_PERM_SPCH_MAXLEN]; unsigned int perm_spch_len; + + /* Data only */ + bool data_transparent; + uint8_t data_rate; + bool data_rate_allowed_is_set; + uint8_t data_rate_allowed; + bool data_asym_pref_is_set; + enum gsm0808_channel_type_asym_pref data_asym_pref; }; /* 3GPP TS 48.008 3.2.2.10 Encryption Information */ diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index 83d2ce7..4993539 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -499,12 +499,6 @@ OSMO_ASSERT(ct->perm_spch_len <= CHANNEL_TYPE_ELEMENT_MAXLEN - 2); - /* FIXME: Implement encoding support for Data - * and Speech + CTM Text Telephony */ - if ((ct->ch_indctr & 0x0f) != GSM0808_CHAN_SPEECH - && (ct->ch_indctr & 0x0f) != GSM0808_CHAN_SIGN) - OSMO_ASSERT(false); - msgb_put_u8(msg, GSM0808_IE_CHANNEL_TYPE); tlv_len = msgb_put(msg, 1); old_tail = msg->tail; @@ -512,12 +506,44 @@ msgb_put_u8(msg, ct->ch_indctr & 0x0f); msgb_put_u8(msg, ct->ch_rate_type); - for (i = 0; i < ct->perm_spch_len; i++) { - byte = ct->perm_spch[i]; + switch (ct->ch_indctr) { + case GSM0808_CHAN_DATA: + byte = ct->data_rate; - if (i < ct->perm_spch_len - 1) - byte |= 0x80; + if (ct->data_transparent) + byte |= 0x40; /* Set T/NT */ + + if (ct->data_rate_allowed_is_set) { + OSMO_ASSERT(!ct->data_transparent); + byte |= 0x80; /* Set ext */ + msgb_put_u8(msg, byte); + + byte = ct->data_rate_allowed; + if (ct->data_asym_pref_is_set) { + byte |= 0x80; /* Set ext */ + msgb_put_u8(msg, byte); + + /* Set asymmetry indication, rest is spare */ + byte = ct->data_asym_pref << 5; + } + } msgb_put_u8(msg, byte); + break; + case GSM0808_CHAN_SPEECH: + case GSM0808_CHAN_SPEECH_CTM_TEXT_TELEPHONY: + for (i = 0; i < ct->perm_spch_len; i++) { + byte = ct->perm_spch[i]; + + if (i < ct->perm_spch_len - 1) + byte |= 0x80; + msgb_put_u8(msg, byte); + } + break; + case GSM0808_CHAN_SIGN: + /* Octet 5 is spare */ + break; + default: + OSMO_ASSERT(false); } *tlv_len = (uint8_t) (msg->tail - old_tail); @@ -549,17 +575,57 @@ ct->ch_rate_type = (*elem) & 0x0f; elem++; - for (i = 0; i < ARRAY_SIZE(ct->perm_spch); i++) { - if (elem - old_elem >= len) - return -EOVERFLOW; - + switch (ct->ch_indctr) { + case GSM0808_CHAN_DATA: byte = *elem; elem++; - ct->perm_spch[i] = byte & 0x7f; - if ((byte & 0x80) == 0x00) - break; + ct->data_transparent = byte & 0x40; /* T/NT */ + ct->data_rate = byte & 0x3f; + + /* Optional extension for non-transparent service */ + if (byte & 0x80) { + if (ct->data_transparent) + return -EINVAL; + if (elem - old_elem >= len) + return -EOVERFLOW; + byte = *elem; + elem++; + + ct->data_rate_allowed_is_set = true; + ct->data_rate_allowed = byte & 0x7f; + + /* Optional extension */ + if (byte & 0x80) { + if (elem - old_elem >= len) + return -EOVERFLOW; + byte = *elem; + elem++; + + ct->data_asym_pref_is_set = true; + ct->data_asym_pref = byte & 0x60 >> 5; + } + } + break; + case GSM0808_CHAN_SPEECH: + case GSM0808_CHAN_SPEECH_CTM_TEXT_TELEPHONY: + for (i = 0; i < ARRAY_SIZE(ct->perm_spch); i++) { + if (elem - old_elem >= len) + return -EOVERFLOW; + + byte = *elem; + elem++; + ct->perm_spch[i] = byte & 0x7f; + if ((byte & 0x80) == 0x00) + break; + } + ct->perm_spch_len = i + 1; + break; + case GSM0808_CHAN_SIGN: + /* Octet 5 is spare */ + break; + default: + return -ENOTSUP; } - ct->perm_spch_len = i + 1; return (int)(elem - old_elem); } diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c index a9f1311..a03f276 100644 --- a/tests/gsm0808/gsm0808_test.c +++ b/tests/gsm0808/gsm0808_test.c @@ -1086,6 +1086,88 @@ msgb_free(msg); } +static void test_gsm0808_enc_dec_channel_type_data(void) +{ + struct gsm0808_channel_type enc_ct = { + .ch_indctr = GSM0808_CHAN_DATA, + .ch_rate_type = GSM0808_DATA_HALF_PREF, + + .data_transparent = true, + .data_rate = GSM0808_DATA_RATE_TRANSP_04800, + }; + struct gsm0808_channel_type dec_ct = {}; + struct msgb *msg; + uint8_t ct_enc_expected[] = { GSM0808_IE_CHANNEL_TYPE, + 0x03, 0x02, 0x0b, 0x51, + }; + uint8_t rc_enc; + int rc_dec; + + msg = msgb_alloc(1024, "output buffer"); + rc_enc = gsm0808_enc_channel_type(msg, &enc_ct); + OSMO_ASSERT(rc_enc == 5); + if (memcmp(ct_enc_expected, msg->data, msg->len)) { + printf(" got: %s\n", osmo_hexdump(msg->data, msg->len)); + printf("expect: %s\n", osmo_hexdump(ct_enc_expected, sizeof(ct_enc_expected))); + OSMO_ASSERT(false); + } + + rc_dec = gsm0808_dec_channel_type(&dec_ct, msg->data + 2, msg->len - 2); + OSMO_ASSERT(rc_dec == 3); + OSMO_ASSERT(dec_ct.ch_indctr == enc_ct.ch_indctr); + OSMO_ASSERT(dec_ct.ch_rate_type == enc_ct.ch_rate_type); + OSMO_ASSERT(dec_ct.data_transparent == enc_ct.data_transparent); + OSMO_ASSERT(dec_ct.data_rate == enc_ct.data_rate); + OSMO_ASSERT(dec_ct.data_rate_allowed_is_set == enc_ct.data_rate_allowed_is_set); + OSMO_ASSERT(dec_ct.data_asym_pref_is_set == enc_ct.data_asym_pref_is_set); + + msgb_free(msg); +} + +static void test_gsm0808_enc_dec_channel_type_data_asym_pref(void) +{ + struct gsm0808_channel_type enc_ct = { + .ch_indctr = GSM0808_CHAN_DATA, + .ch_rate_type = GSM0808_DATA_HALF_PREF, + + .data_transparent = false, + .data_rate = GSM0808_DATA_RATE_NON_TRANSP_06000, + .data_rate_allowed_is_set = true, + .data_rate_allowed = GSM0808_DATA_RATE_NON_TRANSP_ALLOWED_06000 + | GSM0808_DATA_RATE_NON_TRANSP_ALLOWED_12000 + | GSM0808_DATA_RATE_NON_TRANSP_ALLOWED_14500, + .data_asym_pref_is_set = true, + .data_asym_pref = GSM0808_CT_ASYM_PREF_UL, + }; + struct gsm0808_channel_type dec_ct = {}; + struct msgb *msg; + uint8_t ct_enc_expected[] = { GSM0808_IE_CHANNEL_TYPE, + 0x05, 0x02, 0x0b, 0x91, 0x8b, 0x20, + }; + uint8_t rc_enc; + int rc_dec; + + msg = msgb_alloc(1024, "output buffer"); + rc_enc = gsm0808_enc_channel_type(msg, &enc_ct); + OSMO_ASSERT(rc_enc == 7); + if (memcmp(ct_enc_expected, msg->data, msg->len)) { + printf(" got: %s\n", osmo_hexdump(msg->data, msg->len)); + printf("expect: %s\n", osmo_hexdump(ct_enc_expected, sizeof(ct_enc_expected))); + OSMO_ASSERT(false); + } + + rc_dec = gsm0808_dec_channel_type(&dec_ct, msg->data + 2, msg->len - 2); + OSMO_ASSERT(rc_dec == 5); + OSMO_ASSERT(dec_ct.ch_indctr == enc_ct.ch_indctr); + OSMO_ASSERT(dec_ct.ch_rate_type == enc_ct.ch_rate_type); + OSMO_ASSERT(dec_ct.data_transparent == enc_ct.data_transparent); + OSMO_ASSERT(dec_ct.data_rate == enc_ct.data_rate); + OSMO_ASSERT(dec_ct.data_rate_allowed_is_set == enc_ct.data_rate_allowed_is_set); + OSMO_ASSERT(dec_ct.data_asym_pref_is_set == enc_ct.data_asym_pref_is_set); + + msgb_free(msg); +} + static void test_gsm0808_enc_dec_channel_type_speech(void) { struct gsm0808_channel_type enc_ct = { @@ -1122,9 +1204,29 @@ struct gsm0808_channel_type ct; int rc; + /* Unknown channel indicator */ + const uint8_t hex1[] = { 0x05, 0x0b, 0xa1, 0x25 }; + rc = gsm0808_dec_channel_type(&ct, hex1, sizeof(hex1)); + OSMO_ASSERT(rc == -ENOTSUP); + + /* Data: ext in Octet 5 with transparent service */ + const uint8_t hex2[] = { 0x02, 0x0b, 0xc0, 0x00 }; + rc = gsm0808_dec_channel_type(&ct, hex2, sizeof(hex2)); + OSMO_ASSERT(rc == -EINVAL); + + /* Data: ext in Octet 5, but too short */ + const uint8_t hex3[] = { 0x02, 0x0b, 0x80 }; + rc = gsm0808_dec_channel_type(&ct, hex3, sizeof(hex3)); + OSMO_ASSERT(rc == -EOVERFLOW); + + /* Data: ext in Octet 5a, but too short */ + const uint8_t hex4[] = { 0x02, 0x0b, 0x80, 0x80 }; + rc = gsm0808_dec_channel_type(&ct, hex4, sizeof(hex4)); + OSMO_ASSERT(rc == -EOVERFLOW); + /* Speech: extension bit is set in last byte */ - const uint8_t hex[] = { 0x01, 0x0b, 0xa1, 0xa5 }; - rc = gsm0808_dec_channel_type(&ct, hex, sizeof(hex)); + const uint8_t hex5[] = { 0x01, 0x0b, 0xa1, 0xa5 }; + rc = gsm0808_dec_channel_type(&ct, hex5, sizeof(hex5)); OSMO_ASSERT(rc == -EOVERFLOW); } @@ -2579,6 +2681,8 @@ test_gsm0808_enc_dec_speech_codec_with_cfg(); test_gsm0808_enc_dec_speech_codec_list(); test_gsm0808_enc_dec_empty_speech_codec_list(); + test_gsm0808_enc_dec_channel_type_data(); + test_gsm0808_enc_dec_channel_type_data_asym_pref(); test_gsm0808_enc_dec_channel_type_speech(); test_gsm0808_dec_channel_type_err(); test_gsm0808_enc_dec_encrypt_info(); -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/31265 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ib7b75c9d86aace329decf20003b68de459021c64 Gerrit-Change-Number: 31265 Gerrit-PatchSet: 4 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in libosmocore[master]: gsm0808_enc/dec_channel_type: support data
by osmith 13 Feb '23

13 Feb '23
Attention is currently required from: pespin. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/31265 ) Change subject: gsm0808_enc/dec_channel_type: support data ...................................................................... Patch Set 3: Code-Review+2 (1 comment) Patchset: PS3: review comments addressed, adding previous +1 and combining => +2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/31265 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ib7b75c9d86aace329decf20003b68de459021c64 Gerrit-Change-Number: 31265 Gerrit-PatchSet: 3 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Mon, 13 Feb 2023 08:09:44 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-bsc[master]: pcu_sock: set direct TLLI flag in info indication
by neels 13 Feb '23

13 Feb '23
Attention is currently required from: dexter. neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31196 ) Change subject: pcu_sock: set direct TLLI flag in info indication ...................................................................... Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31196 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Ib804143a57824632e5435f7ba68f2e94f5f3fb21 Gerrit-Change-Number: 31196 Gerrit-PatchSet: 3 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Mon, 13 Feb 2023 03:35:31 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • ...
  • 261
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.