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

December 2022

  • 1 participants
  • 1979 discussions
Change in osmo-hlr[master]: Vty: Add missing param to config write
by keith 19 Dec '22

19 Dec '22
keith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hlr/+/30699 ) Change subject: Vty: Add missing param to config write ...................................................................... Vty: Add missing param to config write The mslookup client timeout parameter was not being written back to the config. This commit also add a define for the default timeout value. Change-Id: Ibb60e74a0803f05f37ac13ca529d77b4cb736025 --- M include/osmocom/hlr/dgsm.h M src/dgsm.c M src/dgsm_vty.c 3 files changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/99/30699/1 diff --git a/include/osmocom/hlr/dgsm.h b/include/osmocom/hlr/dgsm.h index cc8f3d2..1114fbe 100644 --- a/include/osmocom/hlr/dgsm.h +++ b/include/osmocom/hlr/dgsm.h @@ -25,6 +25,7 @@ #include <osmocom/gsupclient/cni_peer_id.h> #include <osmocom/gsupclient/gsup_req.h> +#define OSMO_DGSM_DEFAULT_RESULT_TIMEOUT_MS 2000 #define LOG_DGSM(imsi, level, fmt, args...) \ LOGP(DDGSM, level, "(IMSI-%s) " fmt, imsi, ##args) diff --git a/src/dgsm.c b/src/dgsm.c index cdd82a2..f96bca6 100644 --- a/src/dgsm.c +++ b/src/dgsm.c @@ -170,7 +170,7 @@ g_hlr->mslookup.server.local_attach_max_age = 60 * 60; - g_hlr->mslookup.client.result_timeout_milliseconds = 2000; + g_hlr->mslookup.client.result_timeout_milliseconds = OSMO_DGSM_DEFAULT_RESULT_TIMEOUT_MS; g_hlr->gsup_unit_name.unit_name = "HLR"; g_hlr->gsup_unit_name.serno = "unnamed-HLR"; diff --git a/src/dgsm_vty.c b/src/dgsm_vty.c index 00a60ea..6598045 100644 --- a/src/dgsm_vty.c +++ b/src/dgsm_vty.c @@ -475,6 +475,10 @@ vty_out(vty, " mdns domain-suffix %s%s", g_hlr->mslookup.client.mdns.domain_suffix, VTY_NEWLINE); + if (g_hlr->mslookup.client.result_timeout_milliseconds != OSMO_DGSM_DEFAULT_RESULT_TIMEOUT_MS) + vty_out(vty, " timeout %u%s", + g_hlr->mslookup.client.result_timeout_milliseconds, + VTY_NEWLINE); } return CMD_SUCCESS; -- To view, visit https://gerrit.osmocom.org/c/osmo-hlr/+/30699 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Change-Id: Ibb60e74a0803f05f37ac13ca529d77b4cb736025 Gerrit-Change-Number: 30699 Gerrit-PatchSet: 1 Gerrit-Owner: keith <keith(a)rhizomatica.org> Gerrit-MessageType: newchange
1 0
0 0
Change in libosmo-netif[master]: amr: Support all SID and NO_DATA amr formats
by pespin 19 Dec '22

19 Dec '22
Attention is currently required from: pespin. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmo-netif/+/30697 to look at the new patch set (#2). Change subject: amr: Support all SID and NO_DATA amr formats ...................................................................... amr: Support all SID and NO_DATA amr formats Related: SYS#6161 Change-Id: I0e766b3231f03ea87d89fad6ecdce3bd14769054 --- M include/osmocom/netif/amr.h M src/amr.c M tests/amr/amr_test.c M tests/amr/amr_test.ok 4 files changed, 93 insertions(+), 58 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/97/30697/2 -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30697 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I0e766b3231f03ea87d89fad6ecdce3bd14769054 Gerrit-Change-Number: 30697 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
Change in libosmo-netif[master]: amr: Support all SID and NO_DATA amr formats
by Jenkins Builder 19 Dec '22

19 Dec '22
Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30697 ) Change subject: amr: Support all SID and NO_DATA amr formats ...................................................................... Patch Set 1: (3 comments) File src/amr.c: Robot Comment from checkpatch (run ID jenkins-gerrit-lint-2084): https://gerrit.osmocom.org/c/libosmo-netif/+/30697/comment/e22a3909_24c1c80a PS1, Line 36: * 12 NOT USED please, no space before tabs Robot Comment from checkpatch (run ID jenkins-gerrit-lint-2084): https://gerrit.osmocom.org/c/libosmo-netif/+/30697/comment/d99b874c_297353a9 PS1, Line 37: * 13 NOT USED please, no space before tabs Robot Comment from checkpatch (run ID jenkins-gerrit-lint-2084): https://gerrit.osmocom.org/c/libosmo-netif/+/30697/comment/3d161b8b_75094211 PS1, Line 38: * 14 NOT USED please, no space before tabs -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30697 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I0e766b3231f03ea87d89fad6ecdce3bd14769054 Gerrit-Change-Number: 30697 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Mon, 19 Dec 2022 18:42:39 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
Change in libosmo-netif[master]: osmux: Allow forwarding AMR NO_DATA frames
by pespin 19 Dec '22

19 Dec '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30698 ) Change subject: osmux: Allow forwarding AMR NO_DATA frames ...................................................................... osmux: Allow forwarding AMR NO_DATA frames Related: SYS#6161 Change-Id: If8baebc532090ba9808af7f3dd0afec86f40a7d6 --- M src/osmux_input.c M src/osmux_output.c 2 files changed, 9 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/98/30698/1 diff --git a/src/osmux_input.c b/src/osmux_input.c index 284f08e..120f95f 100644 --- a/src/osmux_input.c +++ b/src/osmux_input.c @@ -196,9 +196,11 @@ link->osmuxh->amr_f = state->amrh->f; link->osmuxh->amr_q = state->amrh->q; - memcpy(state->out_msg->tail, osmo_amr_get_payload(state->amrh), - state->amr_payload_len); - msgb_put(state->out_msg, state->amr_payload_len); + if (state->amr_payload_len > 0) { + memcpy(state->out_msg->tail, osmo_amr_get_payload(state->amrh), + state->amr_payload_len); + msgb_put(state->out_msg, state->amr_payload_len); + } /* Update circuit state of last transmitted incoming RTP seqnum/ts: */ state->circuit->last_transmitted_rtp_seq = rtp_seqnum; diff --git a/src/osmux_output.c b/src/osmux_output.c index c240578..f48e1c9 100644 --- a/src/osmux_output.c +++ b/src/osmux_output.c @@ -158,8 +158,10 @@ msgb_put(out_msg, sizeof(struct amr_hdr)); /* add AMR speech data */ - memcpy(out_msg->tail, payload, payload_len); - msgb_put(out_msg, payload_len); + if (payload_len > 0) { + memcpy(out_msg->tail, payload, payload_len); + msgb_put(out_msg, payload_len); + } /* bump last RTP sequence number and timestamp that has been used */ h->rtp_seq++; -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30698 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: If8baebc532090ba9808af7f3dd0afec86f40a7d6 Gerrit-Change-Number: 30698 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in libosmo-netif[master]: amr: Add struct definition for AMR BWE header
by pespin 19 Dec '22

19 Dec '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30695 ) Change subject: amr: Add struct definition for AMR BWE header ...................................................................... amr: Add struct definition for AMR BWE header Change-Id: I4b44257605bc5967d862ee29076ea6260d9a6bd8 --- M include/osmocom/netif/amr.h 1 file changed, 28 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/95/30695/1 diff --git a/include/osmocom/netif/amr.h b/include/osmocom/netif/amr.h index 382c66a..c7ca5bb 100644 --- a/include/osmocom/netif/amr.h +++ b/include/osmocom/netif/amr.h @@ -15,6 +15,34 @@ */ /* + * 4.3. Bandwidth-Efficient Mode: + * + * Summary from 4.3.4: Same as Octet aligned (see below) but without padding after header and ToC: + * 0 1 + * 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | CMR |F| FT |Q|X X X X X X| + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * + * X means AMR payload (padding in case of FT=NO_DATA). + */ +struct amr_hdr_bwe { +#if OSMO_IS_LITTLE_ENDIAN + uint8_t ft_hi:3, /* coding mode highest part */ + f:1, + cmr:4; /* Codec Mode Request */ + uint8_t data_start:6, + q:1, /* OK (not damaged) at origin? */ + ft_lo:1; /* coding mode lowest bit */ +#elif OSMO_IS_BIG_ENDIAN +/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */ + uint8_t cmr:4, f:1, ft_hi:3; + uint8_t ft_lo:1, q:1, data_start:6; +#endif + uint8_t data[0]; +} __attribute__((packed)); + +/* * 4.4. Octet-aligned Mode: * * 4.4.1. The Payload Header: -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30695 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I4b44257605bc5967d862ee29076ea6260d9a6bd8 Gerrit-Change-Number: 30695 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in libosmo-netif[master]: tests/amr: Add test case for unused FT=14
by pespin 19 Dec '22

19 Dec '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30696 ) Change subject: tests/amr: Add test case for unused FT=14 ...................................................................... tests/amr: Add test case for unused FT=14 FT=15 will be accepted in follow-up patch, so keep a tests checking the invalid FT code path. Change-Id: I5872921f5d4a909261e770ddecf048329200724b --- M tests/amr/amr_test.c M tests/amr/amr_test.ok 2 files changed, 11 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/96/30696/1 diff --git a/tests/amr/amr_test.c b/tests/amr/amr_test.c index d332eaa..593723c 100644 --- a/tests/amr/amr_test.c +++ b/tests/amr/amr_test.c @@ -48,7 +48,8 @@ "0004f89d67f1160935bde1996840", "0004633cc7f0630439ffe0000000", "0004eb81fc0758973b9edc782550", - "a078ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00fc", /* sample with invalid FT, will be detected as bandwith-efficient */ + "a070ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00fc", /* sample with invalid FT=14, will be detected as bandwith-efficient */ + "a078ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00fc", /* sample with invalid FT=15, will be detected as bandwith-efficient */ "END", }; diff --git a/tests/amr/amr_test.ok b/tests/amr/amr_test.ok index 02e36d9..8aee2d3 100644 --- a/tests/amr/amr_test.ok +++ b/tests/amr/amr_test.ok @@ -157,6 +157,13 @@ rc: 14 Sample No.: 22 + octet aligned: a070ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00fc + 101000000111000011111111000000001111111100000000111111110000000011111111000000001111111100000000111111110000000011111111000000001111111100000000111111110000000011111111000000001111111100000000111111110000000011111111000000001111111100000000111111110000000011111100 + bw-efficient: + (no data) + rc: -1 + +Sample No.: 23 octet aligned: a078ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00fc 101000000111100011111111000000001111111100000000111111110000000011111111000000001111111100000000111111110000000011111111000000001111111100000000111111110000000011111111000000001111111100000000111111110000000011111111000000001111111100000000111111110000000011111100 bw-efficient: @@ -310,6 +317,7 @@ Sample No.: 20... AMR mode: 0, OA: 14 bytes, BE: 14 bytes, OA: 14 bytes Sample No.: 21... AMR mode: 0, OA: 14 bytes, BE: 14 bytes, OA: 14 bytes Sample No.: 22... skipping a sample with a wrong FT +Sample No.: 23... skipping a sample with a wrong FT Testing conversion from IuUP to bw-efficient and inverse: @@ -342,6 +350,7 @@ Sample No.: 20 ==>octet aligned Sample No.: 21 ==>octet aligned Sample No.: 22 ==>bandwith efficient +Sample No.: 23 ==>bandwith efficient Sample No.: 0 ==>bandwith efficient Sample No.: 1 ==>bandwith efficient Sample No.: 2 ==>bandwith efficient -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30696 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I5872921f5d4a909261e770ddecf048329200724b Gerrit-Change-Number: 30696 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in libosmo-netif[master]: amr: Support all SID and NO_DATA amr formats
by pespin 19 Dec '22

19 Dec '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30697 ) Change subject: amr: Support all SID and NO_DATA amr formats ...................................................................... amr: Support all SID and NO_DATA amr formats Related: SYS#6161 Change-Id: I0e766b3231f03ea87d89fad6ecdce3bd14769054 --- M include/osmocom/netif/amr.h M src/amr.c M tests/amr/amr_test.c M tests/amr/amr_test.ok 4 files changed, 93 insertions(+), 58 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/97/30697/1 diff --git a/include/osmocom/netif/amr.h b/include/osmocom/netif/amr.h index c7ca5bb..0eb26e2 100644 --- a/include/osmocom/netif/amr.h +++ b/include/osmocom/netif/amr.h @@ -99,31 +99,41 @@ /* AMR voice frame type identifiers * See also 3GPP TS 26.101, Table 1a: Interpretation of Frame Type, Mode * Indication and Mode Request fields */ -#define AMR_FT_0 0 /* 4.75 */ -#define AMR_FT_1 1 /* 5.15 */ -#define AMR_FT_2 2 /* 5.90 */ -#define AMR_FT_3 3 /* 6.70 */ -#define AMR_FT_4 4 /* 7.40 */ -#define AMR_FT_5 5 /* 7.95 */ -#define AMR_FT_6 6 /* 10.2 */ -#define AMR_FT_7 7 /* 12.2 */ -#define AMR_FT_SID 8 /* SID */ -#define AMR_FT_MAX 9 +#define AMR_FT_0 0 /* 4.75 */ +#define AMR_FT_1 1 /* 5.15 */ +#define AMR_FT_2 2 /* 5.90 */ +#define AMR_FT_3 3 /* 6.70 */ +#define AMR_FT_4 4 /* 7.40 */ +#define AMR_FT_5 5 /* 7.95 */ +#define AMR_FT_6 6 /* 10.2 */ +#define AMR_FT_7 7 /* 12.2 */ +#define AMR_FT_SID 8 /* AMR SID */ +#define AMR_FT_GSM_EFR_SID 9 /* GSM-EFR SID */ +#define AMR_FT_TDMA_EFR_SID 10 /* TDMA-EFR SID */ +#define AMR_FT_PDC_EFR_SID 11 /* PDC-EFR SID */ +/* version 16.0.0 Release 16: 12-14 for future use */ +#define AMR_FT_NO_DATA 15 /* NO_DATA */ +#define AMR_FT_MAX 16 /* INTERNAL, NO NOT USE OUTSIDE libosmo-netif */ /* AMR voice frame length (in bits). * See also RFC 3267, chapter 3.6. * * NOTE: These constants refer to the length of one AMR speech frame-block, * not counting CMR, TOC. */ -#define AMR_FT_0_LEN_BITS 95 /* 4.75 */ -#define AMR_FT_1_LEN_BITS 103 /* 5.15 */ -#define AMR_FT_2_LEN_BITS 118 /* 5.90 */ -#define AMR_FT_3_LEN_BITS 134 /* 6.70 */ -#define AMR_FT_4_LEN_BITS 148 /* 7.40 */ -#define AMR_FT_5_LEN_BITS 159 /* 7.95 */ -#define AMR_FT_6_LEN_BITS 204 /* 10.2 */ -#define AMR_FT_7_LEN_BITS 244 /* 12.2 */ -#define AMR_FT_SID_LEN_BITS 39 /* SID */ +#define AMR_FT_0_LEN_BITS 95 /* 4.75 */ +#define AMR_FT_1_LEN_BITS 103 /* 5.15 */ +#define AMR_FT_2_LEN_BITS 118 /* 5.90 */ +#define AMR_FT_3_LEN_BITS 134 /* 6.70 */ +#define AMR_FT_4_LEN_BITS 148 /* 7.40 */ +#define AMR_FT_5_LEN_BITS 159 /* 7.95 */ +#define AMR_FT_6_LEN_BITS 204 /* 10.2 */ +#define AMR_FT_7_LEN_BITS 244 /* 12.2 */ +#define AMR_FT_SID_LEN_BITS 39 /* SID */ +#define AMR_FT_GSM_EFR_SID_LEN_BITS 43 /* GSM-EFR SID */ +#define AMR_FT_TDMA_EFR_SID_LEN_BITS 38 /* TDMA-EFR SID */ +#define AMR_FT_PDC_EFR_SID_LEN_BITS 37 /* PDC-EFR SID */ +/* version 16.0.0 Release 16: 12-14 for future use */ +#define AMR_FT_NO_DATA_LEN_BITS 0 /* NO_DATA */ /* AMR voice frame length (in bytes, rounded). * @@ -138,6 +148,11 @@ #define AMR_FT_6_LEN ((AMR_FT_6_LEN_BITS+7)/8) /* 10.2 */ #define AMR_FT_7_LEN ((AMR_FT_7_LEN_BITS+7)/8) /* 12.2 */ #define AMR_FT_SID_LEN ((AMR_FT_SID_LEN_BITS+7)/8) /* SID */ +#define AMR_FT_GSM_EFR_SID_LEN 43 /* GSM-EFR SID */ +#define AMR_FT_TDMA_EFR_SID_LEN 38 /* TDMA-EFR SID */ +#define AMR_FT_PDC_EFR_SID_LEN 37 /* PDC-EFR SID */ +/* version 16.0.0 Release 16: 12-14 for future use */ +#define AMR_FT_NO_DATA_LEN 0 /* NO_DATA */ int osmo_amr_ft_valid(uint8_t amr_ft); size_t osmo_amr_bytes(uint8_t amr_cmr); diff --git a/src/amr.c b/src/amr.c index a40e496..6971427 100644 --- a/src/amr.c +++ b/src/amr.c @@ -18,7 +18,7 @@ #include <osmocom/core/utils.h> #include <osmocom/netif/amr.h> -/* According to TS 26.101: +/* According to TS 26.101 Table A.1b: * * Frame type AMR code bits bytes * 0 4.75 95 12 @@ -29,19 +29,33 @@ * 5 7.95 159 20 * 6 10.20 204 26 * 7 12.20 244 31 - * 8 SID 39 5 + * 8 AMR SID 39 5 + * 9 GSM-EFR SID 43 5 + * 10 TDMA-EFR SID 38 5 + * 11 PDC-EFR SID 37 5 + * 12 NOT USED + * 13 NOT USED + * 14 NOT USED + * 15 NO DATA 0 0 */ -static size_t amr_ft_to_bits[AMR_FT_MAX] = { - [AMR_FT_0] = AMR_FT_0_LEN_BITS, - [AMR_FT_1] = AMR_FT_1_LEN_BITS, - [AMR_FT_2] = AMR_FT_2_LEN_BITS, - [AMR_FT_3] = AMR_FT_3_LEN_BITS, - [AMR_FT_4] = AMR_FT_4_LEN_BITS, - [AMR_FT_5] = AMR_FT_5_LEN_BITS, - [AMR_FT_6] = AMR_FT_6_LEN_BITS, - [AMR_FT_7] = AMR_FT_7_LEN_BITS, - [AMR_FT_SID] = AMR_FT_SID_LEN_BITS, +static int amr_ft_to_bits[AMR_FT_MAX] = { + [AMR_FT_0] = AMR_FT_0_LEN_BITS, + [AMR_FT_1] = AMR_FT_1_LEN_BITS, + [AMR_FT_2] = AMR_FT_2_LEN_BITS, + [AMR_FT_3] = AMR_FT_3_LEN_BITS, + [AMR_FT_4] = AMR_FT_4_LEN_BITS, + [AMR_FT_5] = AMR_FT_5_LEN_BITS, + [AMR_FT_6] = AMR_FT_6_LEN_BITS, + [AMR_FT_7] = AMR_FT_7_LEN_BITS, + [AMR_FT_SID] = AMR_FT_SID_LEN_BITS, + [AMR_FT_GSM_EFR_SID] = AMR_FT_GSM_EFR_SID_LEN_BITS, + [AMR_FT_TDMA_EFR_SID] = AMR_FT_TDMA_EFR_SID_LEN_BITS, + [AMR_FT_PDC_EFR_SID] = AMR_FT_PDC_EFR_SID_LEN_BITS, + [12] = 0, /* for future use */ + [13] = 0, /* for future use */ + [14] = 0, /* for future use */ + [AMR_FT_NO_DATA] = AMR_FT_NO_DATA_LEN_BITS, }; static size_t amr_ft_to_bytes[AMR_FT_MAX] = { @@ -54,6 +68,13 @@ [AMR_FT_6] = AMR_FT_6_LEN, [AMR_FT_7] = AMR_FT_7_LEN, [AMR_FT_SID] = AMR_FT_SID_LEN, + [AMR_FT_GSM_EFR_SID] = AMR_FT_GSM_EFR_SID_LEN, + [AMR_FT_TDMA_EFR_SID] = AMR_FT_TDMA_EFR_SID_LEN, + [AMR_FT_PDC_EFR_SID] = AMR_FT_PDC_EFR_SID_LEN, + [12] = 0, /* for future use */ + [13] = 0, /* for future use */ + [14] = 0, /* for future use */ + [AMR_FT_NO_DATA] = AMR_FT_NO_DATA_LEN, }; size_t osmo_amr_bits(uint8_t amr_ft) @@ -72,30 +93,20 @@ { int ft; - for (ft = 0; ft < AMR_FT_MAX; ft++) { + for (ft = 0; ft < AMR_FT_PDC_EFR_SID; ft++) { if (amr_ft_to_bytes[ft] == bytes) return ft; } + /* 12-14 not used, jump to 15 (AMR_FT_NO_DATA): */ + if (amr_ft_to_bytes[AMR_FT_NO_DATA] == bytes) + return AMR_FT_NO_DATA; + return -1; } int osmo_amr_ft_valid(uint8_t amr_ft) { - /* - * Extracted from RFC3267: - * - * "... with a FT value in the range 9-14 for AMR ... the whole packet - * SHOULD be discarded." - * - * "... packets containing only NO_DATA frames (FT=15) SHOULD NOT be - * transmitted." - * - * So, let's discard frames with a AMR FT >= 9. - */ - if (amr_ft >= AMR_FT_MAX) - return 0; - - return 1; + return amr_ft <= AMR_FT_PDC_EFR_SID || amr_ft == AMR_FT_NO_DATA; } /*! Check if an AMR frame is octet aligned by looking at the padding bits. diff --git a/tests/amr/amr_test.c b/tests/amr/amr_test.c index 593723c..bc18554 100644 --- a/tests/amr/amr_test.c +++ b/tests/amr/amr_test.c @@ -49,7 +49,7 @@ "0004633cc7f0630439ffe0000000", "0004eb81fc0758973b9edc782550", "a070ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00fc", /* sample with invalid FT=14, will be detected as bandwith-efficient */ - "a078ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00fc", /* sample with invalid FT=15, will be detected as bandwith-efficient */ + "a078", /* sample with FT=15 NO_DATA */ "END", }; @@ -72,6 +72,7 @@ "f3c381bc7061c9f8507f6029de6115c16e5fa470c243b21b6e35dbb48bd84c00", "73c901b7a2004be7f85284b6ab7142acfe6872b1ae1c107d0588b551de7be650", "a7bfc03fc03fc03fc03fc03fc03fc03fc03fc03fc03fc03fc03fc03fc03fc03f", /* sample with invalid FT */ + "4780", /* FT=15 NO_DATA */ "END", }; diff --git a/tests/amr/amr_test.ok b/tests/amr/amr_test.ok index 8aee2d3..24cbd6a 100644 --- a/tests/amr/amr_test.ok +++ b/tests/amr/amr_test.ok @@ -164,11 +164,11 @@ rc: -1 Sample No.: 23 - octet aligned: a078ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00fc - 101000000111100011111111000000001111111100000000111111110000000011111111000000001111111100000000111111110000000011111111000000001111111100000000111111110000000011111111000000001111111100000000111111110000000011111111000000001111111100000000111111110000000011111100 - bw-efficient: - (no data) - rc: -1 + octet aligned: a078 + 1010000001111000 + bw-efficient: a780 + 1010011110000000 + rc: 2 Testing conversion from bw-efficient to octet-aligned: @@ -288,9 +288,16 @@ Sample No.: 16 bw-efficient: a7bfc03fc03fc03fc03fc03fc03fc03fc03fc03fc03fc03fc03fc03fc03fc03f 1010011110111111110000000011111111000000001111111100000000111111110000000011111111000000001111111100000000111111110000000011111111000000001111111100000000111111110000000011111111000000001111111100000000111111110000000011111111000000001111111100000000111111 - octet aligned: - (no data) - rc: -1 + octet aligned: a078 + 1010000001111000 + rc: 2 + +Sample No.: 17 + bw-efficient: 4780 + 0100011110000000 + octet aligned: 4078 + 0100000001111000 + rc: 2 Testing conversion from octet-aligned to bw-efficient and inverse: @@ -317,7 +324,7 @@ Sample No.: 20... AMR mode: 0, OA: 14 bytes, BE: 14 bytes, OA: 14 bytes Sample No.: 21... AMR mode: 0, OA: 14 bytes, BE: 14 bytes, OA: 14 bytes Sample No.: 22... skipping a sample with a wrong FT -Sample No.: 23... skipping a sample with a wrong FT +Sample No.: 23... AMR mode: 15, OA: 2 bytes, BE: 2 bytes, OA: 2 bytes Testing conversion from IuUP to bw-efficient and inverse: @@ -350,7 +357,7 @@ Sample No.: 20 ==>octet aligned Sample No.: 21 ==>octet aligned Sample No.: 22 ==>bandwith efficient -Sample No.: 23 ==>bandwith efficient +Sample No.: 23 ==>octet aligned Sample No.: 0 ==>bandwith efficient Sample No.: 1 ==>bandwith efficient Sample No.: 2 ==>bandwith efficient @@ -368,4 +375,5 @@ Sample No.: 14 ==>bandwith efficient Sample No.: 15 ==>bandwith efficient Sample No.: 16 ==>bandwith efficient +Sample No.: 17 ==>bandwith efficient OK: Test passed -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30697 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I0e766b3231f03ea87d89fad6ecdce3bd14769054 Gerrit-Change-Number: 30697 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in libosmo-netif[master]: amr: osmo_amr_bwe_to_oa(): Modify loop to allow osmo_amr_bytes()=0 (N...
by pespin 19 Dec '22

19 Dec '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30693 ) Change subject: amr: osmo_amr_bwe_to_oa(): Modify loop to allow osmo_amr_bytes()=0 (NO_DATA) ...................................................................... amr: osmo_amr_bwe_to_oa(): Modify loop to allow osmo_amr_bytes()=0 (NO_DATA) oa_payload_len can be 2 if osmo_amr_bytes() returns 0 (it will return 0 when FT NO_DATA is supported). In tha case, the loop condition (oa_payload_len - 3) (signed) is compared against unsigned i which ends up accessing i=256. Change-Id: I1e513f493d7883a03acbfa3d9744ec63657810b3 --- M src/amr.c 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/93/30693/1 diff --git a/src/amr.c b/src/amr.c index 1b750eb..8cd856d 100644 --- a/src/amr.c +++ b/src/amr.c @@ -214,11 +214,11 @@ return -1; oa_payload_len = 2 + osmo_amr_bytes(oa_hdr->ft); - for (i = 0; i < oa_payload_len - 3; i++) { - buf[i + 2] = payload[i + 1] << 2; - buf[i + 2] |= payload[i + 2] >> 6; + for (i = 2; i < oa_payload_len - 1; i++) { + buf[i] = payload[i - 1] << 2; + buf[i] |= payload[i] >> 6; } - buf[i + 2] = payload[i + 1] << 2; + buf[i] = payload[i - 1] << 2; memcpy(payload, buf, oa_payload_len); return oa_payload_len; -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30693 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I1e513f493d7883a03acbfa3d9744ec63657810b3 Gerrit-Change-Number: 30693 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in libosmo-netif[master]: amr.h: Fix missing include dependencies
by pespin 19 Dec '22

19 Dec '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30692 ) Change subject: amr.h: Fix missing include dependencies ...................................................................... amr.h: Fix missing include dependencies Needed for size_t uint8_t, etc. Change-Id: Ia808c2b6c426de79db5c88784dd7bce6096179aa --- M include/osmocom/netif/amr.h 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/92/30692/1 diff --git a/include/osmocom/netif/amr.h b/include/osmocom/netif/amr.h index 47be122..382c66a 100644 --- a/include/osmocom/netif/amr.h +++ b/include/osmocom/netif/amr.h @@ -1,6 +1,9 @@ #ifndef _OSMO_AMR_H_ #define _OSMO_AMR_H_ +#include <stddef.h> +#include <stdint.h> + #include <osmocom/core/endian.h> /* As defined by RFC3267: Adaptive Multi-Rate (AMR) */ -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30692 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: Ia808c2b6c426de79db5c88784dd7bce6096179aa Gerrit-Change-Number: 30692 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in libosmo-netif[master]: amr: osmo_amr_bwe_to_oa() define variable as unsigned
by pespin 19 Dec '22

19 Dec '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30694 ) Change subject: amr: osmo_amr_bwe_to_oa() define variable as unsigned ...................................................................... amr: osmo_amr_bwe_to_oa() define variable as unsigned There's no need to have the variable as signed anymore since the loop was modified in the previous patch. osmo_amr_bytes() returns a size_t (unsigned). Change-Id: I8aa6b5f6d3334e152a62b7c28aac3f881f027894 --- M src/amr.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/94/30694/1 diff --git a/src/amr.c b/src/amr.c index 8cd856d..a40e496 100644 --- a/src/amr.c +++ b/src/amr.c @@ -194,7 +194,7 @@ /* The header is only valid after shifting first two bytes to OA mode */ struct amr_hdr *oa_hdr; unsigned int i; - int oa_payload_len; + unsigned int oa_payload_len; memset(buf, 0, sizeof(buf)); -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30694 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I8aa6b5f6d3334e152a62b7c28aac3f881f027894 Gerrit-Change-Number: 30694 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • ...
  • 198
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.