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

March 2023

  • 1 participants
  • 3642 discussions
[S] Change in osmo-ttcn3-hacks[master]: .gitignore: sms.db-shm sbs.db-wal (when db is open)
by laforge 08 Mar '23

08 Mar '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31705 ) Change subject: .gitignore: sms.db-shm sbs.db-wal (when db is open) ...................................................................... .gitignore: sms.db-shm sbs.db-wal (when db is open) Change-Id: I788ebf15a1569584dd2f158be901bc6e9f7de177 --- M .gitignore 1 file changed, 11 insertions(+), 0 deletions(-) Approvals: laforge: Looks good to me, approved pespin: Looks good to me, but someone else must approve msuraev: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index 9d48551..e77dfa7 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,5 @@ *.d *.merged sms.db +sms.db-shm +sms.db-wal -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31705 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: I788ebf15a1569584dd2f158be901bc6e9f7de177 Gerrit-Change-Number: 31705 Gerrit-PatchSet: 2 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: .gitignore: sms.db-shm sbs.db-wal (when db is open)
by laforge 08 Mar '23

08 Mar '23
Attention is currently required from: neels. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31705 ) Change subject: .gitignore: sms.db-shm sbs.db-wal (when db is open) ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31705 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: I788ebf15a1569584dd2f158be901bc6e9f7de177 Gerrit-Change-Number: 31705 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Comment-Date: Wed, 08 Mar 2023 23:15:31 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in libosmocore[master]: GSMTAP: allow configuring src IP for log messages
by laforge 08 Mar '23

08 Mar '23
Attention is currently required from: osmith, fixeria, pespin, msuraev. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/31513 ) Change subject: GSMTAP: allow configuring src IP for log messages ...................................................................... Patch Set 12: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/31513 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I9000269ce5b3dce1e757271b7c42e77b68d38f25 Gerrit-Change-Number: 31513 Gerrit-PatchSet: 12 Gerrit-Owner: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: msuraev <msuraev(a)sysmocom.de> Gerrit-Comment-Date: Wed, 08 Mar 2023 23:14:56 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmocore[master]: gsm_08_58: Document IPAC RTP CSD modes in at least a few words
by laforge 08 Mar '23

08 Mar '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/31690 ) ( 1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: gsm_08_58: Document IPAC RTP CSD modes in at least a few words ...................................................................... gsm_08_58: Document IPAC RTP CSD modes in at least a few words Let's clarify what those modes mean Change-Id: I77fc7b24ccd387f54a7c7edad666737252af6bd9 --- M include/osmocom/gsm/protocol/gsm_08_58.h 1 file changed, 15 insertions(+), 4 deletions(-) Approvals: fixeria: Looks good to me, approved osmith: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/protocol/gsm_08_58.h b/include/osmocom/gsm/protocol/gsm_08_58.h index 67b76f8..e932ff8 100644 --- a/include/osmocom/gsm/protocol/gsm_08_58.h +++ b/include/osmocom/gsm/protocol/gsm_08_58.h @@ -744,10 +744,10 @@ /* RSL_IE_IPAC_RTP_CSD_FMT, lower four bits */ enum rsl_ipac_rtp_csd_format_d { - RSL_IPAC_RTP_CSD_EXT_TRAU = 0, - RSL_IPAC_RTP_CSD_NON_TRAU = 1, - RSL_IPAC_RTP_CSD_TRAU_BTS = 2, - RSL_IPAC_RTP_CSD_IWF_FREE = 3, + RSL_IPAC_RTP_CSD_EXT_TRAU = 0, /*!< TRAU-like RTP format, without leading zero-bits */ + RSL_IPAC_RTP_CSD_NON_TRAU = 1, /*!< packed 16k (252/288 bit) / 8k (126 bit) in RTP */ + RSL_IPAC_RTP_CSD_TRAU_BTS = 2, /*!< TRAU in BTS; V.110 in RTP/CLEARMODE */ + RSL_IPAC_RTP_CSD_IWF_FREE = 3, /*!< unknown proprietary IWF-free BTS-BTS data */ }; /* RSL_IE_IPAC_RTP_CSD_FMT, upper four bits */ enum rsl_ipac_rtp_csd_format_ir { -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/31690 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I77fc7b24ccd387f54a7c7edad666737252af6bd9 Gerrit-Change-Number: 31690 Gerrit-PatchSet: 2 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[L] Change in libosmocore[master]: gsm: TS 44.021 modified V.110 frame encoding/decoding support
by laforge 08 Mar '23

08 Mar '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/31668 ) Change subject: gsm: TS 44.021 modified V.110 frame encoding/decoding support ...................................................................... gsm: TS 44.021 modified V.110 frame encoding/decoding support 3GPP TS 44.021 specifies the format for modified V.110 frames as used on the GSM air (radio) interface. Implement encoders and decoders for this modified V.110 format. Related: OS#1572 Change-Id: I60a2f2690459359437df20cf4da9043fa7c3ad11 --- M include/osmocom/gsm/Makefile.am A include/osmocom/gsm/gsm44021.h M src/gsm/Makefile.am A src/gsm/gsm44021.c M src/gsm/libosmogsm.map M tests/Makefile.am A tests/gsm44021/test_frame_csd.c A tests/gsm44021/test_frame_csd.ok M tests/testsuite.at 9 files changed, 472 insertions(+), 1 deletion(-) Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/Makefile.am b/include/osmocom/gsm/Makefile.am index 2c59e55..f840a27 100644 --- a/include/osmocom/gsm/Makefile.am +++ b/include/osmocom/gsm/Makefile.am @@ -29,6 +29,7 @@ gsm23003.h \ gsm23236.h \ gsm29118.h \ + gsm44021.h \ gsm48.h \ gsm48_arfcn_range_encode.h \ gsm48_ie.h \ diff --git a/include/osmocom/gsm/gsm44021.h b/include/osmocom/gsm/gsm44021.h new file mode 100644 index 0000000..8f89c56 --- /dev/null +++ b/include/osmocom/gsm/gsm44021.h @@ -0,0 +1,8 @@ +#pragma once +#include <osmocom/isdn/v110.h> + +int osmo_csd_12k_6k_decode_frame(struct osmo_v110_decoded_frame *fr, const ubit_t *ra_bits, size_t n_bits); +int osmo_csd_12k_6k_encode_frame(ubit_t *ra_bits, size_t ra_bits_size, const struct osmo_v110_decoded_frame *fr); +int osmo_csd_3k6_decode_frame(struct osmo_v110_decoded_frame *fr, const ubit_t *ra_bits, size_t n_bits); +int osmo_csd_3k6_encode_frame(ubit_t *ra_bits, size_t ra_bits_size, const struct osmo_v110_decoded_frame *fr); +void osmo_csd_ubit_dump(FILE *outf, const ubit_t *fr, size_t in_len); diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am index 79c5f04..ce0b1f4 100644 --- a/src/gsm/Makefile.am +++ b/src/gsm/Makefile.am @@ -33,7 +33,7 @@ gsup.c gsup_sms.c gprs_gea.c gsm0503_conv.c oap.c gsm0808_utils.c \ gsm23003.c gsm23236.c mncc.c bts_features.c oap_client.c \ gsm29118.c gsm48_rest_octets.c cbsp.c gsm48049.c \ - gad.c bsslap.c bssmap_le.c kdf.c iuup.c + gad.c bsslap.c bssmap_le.c kdf.c iuup.c gsm44021.c libgsmint_la_LDFLAGS = -no-undefined libgsmint_la_LIBADD = $(top_builddir)/src/core/libosmocore.la $(top_builddir)/src/isdn/libosmoisdn.la diff --git a/src/gsm/gsm44021.c b/src/gsm/gsm44021.c new file mode 100644 index 0000000..5e9d5ab --- /dev/null +++ b/src/gsm/gsm44021.c @@ -0,0 +1,303 @@ +/************************************************************************* + * GSM CSD modified V.110 frame decoding/encoding (ubits <-> struct with D/S/X/E bits) + *************************************************************************/ + +/* (C) 2022 by Harald Welte <laforge(a)osmocom.org> + * + * SPDX-License-Identifier: GPL-2.0+ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include <errno.h> +#include <osmocom/core/bits.h> +#include <osmocom/isdn/v110.h> + +/*! Decode a 60-bit GSM 12kbit/s CSD frame present as 60 ubits into a struct osmo_v110_decoded_frame. + * \param[out] caller-allocated output data structure, filled by this function + * \param[in] ra_bits One V.110 frame as 60 unpacked bits. */ +int osmo_csd_12k_6k_decode_frame(struct osmo_v110_decoded_frame *fr, const ubit_t *ra_bits, size_t n_bits) +{ + /* 3GPP TS 44.021 Section 8.1.2 / 8.1.3 + D1 D2 D3 D4 D5 D6 S1 + D7 D8 D9 D10 D11 D12 X + D13 D14 D15 D16 D17 D18 S3 + D19 D20 D21 D22 D23 D24 S4 + E4 E5 E6 E7 D25 D26 D27 + D28 D29 D30 S6 D31 D32 D33 + D34 D35 D36 X D37 D38 D39 + D40 D41 D42 S8 D43 D44 D45 + D46 D47 D48 S9 */ + + if (n_bits < 60) + return -EINVAL; + + /* X1 .. X2 */ + fr->x_bits[0] = ra_bits[1 * 7 + 6]; + fr->x_bits[1] = ra_bits[6 * 7 + 3]; + + /* S1, S3, S4, S6, S8, S9 */ + fr->s_bits[0] = ra_bits[0 * 7 + 6]; + fr->s_bits[2] = ra_bits[2 * 7 + 6]; + fr->s_bits[3] = ra_bits[3 * 7 + 6]; + fr->s_bits[5] = ra_bits[5 * 7 + 3]; + fr->s_bits[7] = ra_bits[7 * 7 + 3]; + fr->s_bits[8] = ra_bits[8 * 7 + 3]; + + /* E1 .. E3 must be set by out-of-band knowledge! */ + + /* E4 .. E7 */ + memcpy(fr->e_bits+3, ra_bits + 4 * 7 + 0, 4); + + /* D-bits */ + memcpy(fr->d_bits + 0 * 6 + 0, ra_bits + 0 * 7 + 0, 6); + memcpy(fr->d_bits + 1 * 6 + 0, ra_bits + 1 * 7 + 0, 6); + memcpy(fr->d_bits + 2 * 6 + 0, ra_bits + 2 * 7 + 0, 6); + memcpy(fr->d_bits + 3 * 6 + 0, ra_bits + 3 * 7 + 0, 6); + memcpy(fr->d_bits + 4 * 6 + 0, ra_bits + 4 * 7 + 4, 3); + memcpy(fr->d_bits + 4 * 6 + 3, ra_bits + 5 * 7 + 0, 3); + memcpy(fr->d_bits + 5 * 6 + 0, ra_bits + 5 * 7 + 4, 3); + memcpy(fr->d_bits + 5 * 6 + 3, ra_bits + 6 * 7 + 0, 3); + memcpy(fr->d_bits + 6 * 6 + 0, ra_bits + 6 * 7 + 4, 3); + memcpy(fr->d_bits + 6 * 6 + 3, ra_bits + 7 * 7 + 0, 3); + memcpy(fr->d_bits + 7 * 6 + 0, ra_bits + 7 * 7 + 4, 3); + memcpy(fr->d_bits + 7 * 6 + 3, ra_bits + 8 * 7 + 0, 3); + + return 0; +} + +int osmo_csd_12k_6k_encode_frame(ubit_t *ra_bits, size_t ra_bits_size, const struct osmo_v110_decoded_frame *fr) +{ + if (ra_bits_size < 60) + return -EINVAL; + + /* X1 .. X2 */ + ra_bits[1 * 7 + 6] = fr->x_bits[0]; + ra_bits[6 * 7 + 3] = fr->x_bits[1]; + + /* S1, S3, S4, S6, S8, S9 */ + ra_bits[0 * 7 + 6] = fr->s_bits[0]; + ra_bits[2 * 7 + 6] = fr->s_bits[2]; + ra_bits[3 * 7 + 6] = fr->s_bits[3]; + ra_bits[5 * 7 + 3] = fr->s_bits[5]; + ra_bits[7 * 7 + 3] = fr->s_bits[7]; + ra_bits[8 * 7 + 3] = fr->s_bits[8]; + + /* E1 .. E3 are dropped */ + + /* E4 .. E7 */ + memcpy(ra_bits + 4 * 7 + 0, fr->e_bits+3, 4); + + /* D-bits */ + memcpy(ra_bits + 0 * 7 + 0, fr->d_bits + 0 * 6 + 0, 6); + memcpy(ra_bits + 1 * 7 + 0, fr->d_bits + 1 * 6 + 0, 6); + memcpy(ra_bits + 2 * 7 + 0, fr->d_bits + 2 * 6 + 0, 6); + memcpy(ra_bits + 3 * 7 + 0, fr->d_bits + 3 * 6 + 0, 6); + memcpy(ra_bits + 4 * 7 + 4, fr->d_bits + 4 * 6 + 0, 3); + memcpy(ra_bits + 5 * 7 + 0, fr->d_bits + 4 * 6 + 3, 3); + memcpy(ra_bits + 5 * 7 + 4, fr->d_bits + 5 * 6 + 0, 3); + memcpy(ra_bits + 6 * 7 + 0, fr->d_bits + 5 * 6 + 3, 3); + memcpy(ra_bits + 6 * 7 + 4, fr->d_bits + 6 * 6 + 0, 3); + memcpy(ra_bits + 7 * 7 + 0, fr->d_bits + 6 * 6 + 3, 3); + memcpy(ra_bits + 7 * 7 + 4, fr->d_bits + 7 * 6 + 0, 3); + memcpy(ra_bits + 8 * 7 + 0, fr->d_bits + 7 * 6 + 3, 3); + + return 60; +} + +/*! Decode a 36-bit GSM 3k6kbit/s CSD frame present as 36 ubits into a struct osmo_v110_decoded_frame. + * \param[out] caller-allocated output data structure, filled by this function + * \param[in] ra_bits One V.110 frame as 36 unpacked bits. */ +int osmo_csd_3k6_decode_frame(struct osmo_v110_decoded_frame *fr, const ubit_t *ra_bits, size_t n_bits) +{ + + /* 3GPP TS 44.021 Section 8.1.4 + D1 D2 D3 S1 D4 D5 D6 X + D7 D8 D9 S3 D10 D11 D12 S4 + E4 E5 E6 E7 D13 D14 D15 S6 + D16 D17 D18 X D19 D20 D21 S8 + D22 D23 D24 S9 + */ + + if (n_bits < 36) + return -EINVAL; + + /* X1 .. X2 */ + fr->x_bits[0] = ra_bits[0 * 8 + 7]; + fr->x_bits[1] = ra_bits[3 * 8 + 3]; + + /* S1, S3, S4, S6, S8, S9 */ + fr->s_bits[0] = ra_bits[0 * 8 + 3]; + fr->s_bits[2] = ra_bits[1 * 8 + 3]; + fr->s_bits[3] = ra_bits[1 * 8 + 7]; + fr->s_bits[5] = ra_bits[2 * 8 + 7]; + fr->s_bits[7] = ra_bits[3 * 8 + 7]; + fr->s_bits[8] = ra_bits[4 * 8 + 3]; + + /* E1 .. E3 must be set by out-of-band knowledge! */ + + /* E4 .. E7 */ + memcpy(fr->e_bits+3, ra_bits + 2 * 8 + 0, 4); + + /* D-bits */ + unsigned int d_idx = 0; + fr->d_bits[d_idx++] = ra_bits[0 * 8 + 0]; /* D1 */ + fr->d_bits[d_idx++] = ra_bits[0 * 8 + 0]; /* D1 */ + fr->d_bits[d_idx++] = ra_bits[0 * 8 + 1]; /* D2 */ + fr->d_bits[d_idx++] = ra_bits[0 * 8 + 1]; /* D2 */ + fr->d_bits[d_idx++] = ra_bits[0 * 8 + 2]; /* D3 */ + fr->d_bits[d_idx++] = ra_bits[0 * 8 + 2]; /* D3 */ + fr->d_bits[d_idx++] = ra_bits[0 * 8 + 4]; /* D4 */ + fr->d_bits[d_idx++] = ra_bits[0 * 8 + 4]; /* D4 */ + fr->d_bits[d_idx++] = ra_bits[0 * 8 + 5]; /* D5 */ + fr->d_bits[d_idx++] = ra_bits[0 * 8 + 5]; /* D5 */ + fr->d_bits[d_idx++] = ra_bits[0 * 8 + 6]; /* D6 */ + fr->d_bits[d_idx++] = ra_bits[0 * 8 + 6]; /* D6 */ + + fr->d_bits[d_idx++] = ra_bits[1 * 8 + 0]; /* D7 */ + fr->d_bits[d_idx++] = ra_bits[1 * 8 + 0]; /* D7 */ + fr->d_bits[d_idx++] = ra_bits[1 * 8 + 1]; /* D8 */ + fr->d_bits[d_idx++] = ra_bits[1 * 8 + 1]; /* D8 */ + fr->d_bits[d_idx++] = ra_bits[1 * 8 + 2]; /* D9 */ + fr->d_bits[d_idx++] = ra_bits[1 * 8 + 2]; /* D9 */ + fr->d_bits[d_idx++] = ra_bits[1 * 8 + 4]; /* D10 */ + fr->d_bits[d_idx++] = ra_bits[1 * 8 + 4]; /* D10 */ + fr->d_bits[d_idx++] = ra_bits[1 * 8 + 5]; /* D11 */ + fr->d_bits[d_idx++] = ra_bits[1 * 8 + 5]; /* D11 */ + fr->d_bits[d_idx++] = ra_bits[1 * 8 + 6]; /* D12 */ + fr->d_bits[d_idx++] = ra_bits[1 * 8 + 6]; /* D12 */ + + fr->d_bits[d_idx++] = ra_bits[2 * 8 + 4]; /* D13 */ + fr->d_bits[d_idx++] = ra_bits[2 * 8 + 4]; /* D13 */ + fr->d_bits[d_idx++] = ra_bits[2 * 8 + 5]; /* D14 */ + fr->d_bits[d_idx++] = ra_bits[2 * 8 + 5]; /* D14 */ + fr->d_bits[d_idx++] = ra_bits[2 * 8 + 6]; /* D15 */ + fr->d_bits[d_idx++] = ra_bits[2 * 8 + 6]; /* D15 */ + + fr->d_bits[d_idx++] = ra_bits[3 * 8 + 0]; /* D16 */ + fr->d_bits[d_idx++] = ra_bits[3 * 8 + 0]; /* D16 */ + fr->d_bits[d_idx++] = ra_bits[3 * 8 + 1]; /* D17 */ + fr->d_bits[d_idx++] = ra_bits[3 * 8 + 1]; /* D17 */ + fr->d_bits[d_idx++] = ra_bits[3 * 8 + 2]; /* D18 */ + fr->d_bits[d_idx++] = ra_bits[3 * 8 + 2]; /* D18 */ + fr->d_bits[d_idx++] = ra_bits[3 * 8 + 4]; /* D19 */ + fr->d_bits[d_idx++] = ra_bits[3 * 8 + 4]; /* D19 */ + fr->d_bits[d_idx++] = ra_bits[3 * 8 + 5]; /* D20 */ + fr->d_bits[d_idx++] = ra_bits[3 * 8 + 5]; /* D20 */ + fr->d_bits[d_idx++] = ra_bits[3 * 8 + 6]; /* D21 */ + fr->d_bits[d_idx++] = ra_bits[3 * 8 + 6]; /* D21 */ + + fr->d_bits[d_idx++] = ra_bits[4 * 8 + 0]; /* D22 */ + fr->d_bits[d_idx++] = ra_bits[4 * 8 + 0]; /* D22 */ + fr->d_bits[d_idx++] = ra_bits[4 * 8 + 1]; /* D23 */ + fr->d_bits[d_idx++] = ra_bits[4 * 8 + 1]; /* D23 */ + fr->d_bits[d_idx++] = ra_bits[4 * 8 + 2]; /* D24 */ + fr->d_bits[d_idx++] = ra_bits[4 * 8 + 2]; /* D24 */ + + OSMO_ASSERT(d_idx == 48); + + return 0; +} + +int osmo_csd_3k6_encode_frame(ubit_t *ra_bits, size_t ra_bits_size, const struct osmo_v110_decoded_frame *fr) +{ + if (ra_bits_size < 36) + return -EINVAL; + + /* X1 .. X2 */ + ra_bits[0 * 8 + 7] = fr->x_bits[0]; + ra_bits[3 * 8 + 3] = fr->x_bits[1]; + + /* S1, S3, S4, S6, S8, S9 */ + ra_bits[0 * 8 + 3] = fr->s_bits[0]; + ra_bits[1 * 8 + 3] = fr->s_bits[2]; + ra_bits[1 * 8 + 7] = fr->s_bits[3]; + ra_bits[2 * 8 + 7] = fr->s_bits[5]; + ra_bits[3 * 8 + 7] = fr->s_bits[7]; + ra_bits[4 * 8 + 3] = fr->s_bits[8]; + + /* E1 .. E3 are ignored */ + + /* E4 .. E7 */ + memcpy(ra_bits + 2 * 8 + 0, fr->e_bits+3, 4); + + /* D-bits */ + unsigned int d_idx = 0; + ra_bits[0 * 8 + 0] = fr->d_bits[d_idx]; d_idx += 2; + ra_bits[0 * 8 + 1] = fr->d_bits[d_idx]; d_idx += 2; + ra_bits[0 * 8 + 2] = fr->d_bits[d_idx]; d_idx += 2; + ra_bits[0 * 8 + 4] = fr->d_bits[d_idx]; d_idx += 2; + ra_bits[0 * 8 + 5] = fr->d_bits[d_idx]; d_idx += 2; + ra_bits[0 * 8 + 6] = fr->d_bits[d_idx]; d_idx += 2; + + ra_bits[1 * 8 + 0] = fr->d_bits[d_idx]; d_idx += 2; + ra_bits[1 * 8 + 1] = fr->d_bits[d_idx]; d_idx += 2; + ra_bits[1 * 8 + 2] = fr->d_bits[d_idx]; d_idx += 2; + ra_bits[1 * 8 + 4] = fr->d_bits[d_idx]; d_idx += 2; + ra_bits[1 * 8 + 5] = fr->d_bits[d_idx]; d_idx += 2; + ra_bits[1 * 8 + 6] = fr->d_bits[d_idx]; d_idx += 2; + + ra_bits[2 * 8 + 4] = fr->d_bits[d_idx]; d_idx += 2; + ra_bits[2 * 8 + 5] = fr->d_bits[d_idx]; d_idx += 2; + ra_bits[2 * 8 + 6] = fr->d_bits[d_idx]; d_idx += 2; + + ra_bits[3 * 8 + 0] = fr->d_bits[d_idx]; d_idx += 2; + ra_bits[3 * 8 + 1] = fr->d_bits[d_idx]; d_idx += 2; + ra_bits[3 * 8 + 2] = fr->d_bits[d_idx]; d_idx += 2; + ra_bits[3 * 8 + 4] = fr->d_bits[d_idx]; d_idx += 2; + ra_bits[3 * 8 + 5] = fr->d_bits[d_idx]; d_idx += 2; + ra_bits[3 * 8 + 6] = fr->d_bits[d_idx]; d_idx += 2; + + ra_bits[4 * 8 + 0] = fr->d_bits[d_idx]; d_idx += 2; + ra_bits[4 * 8 + 1] = fr->d_bits[d_idx]; d_idx += 2; + ra_bits[4 * 8 + 2] = fr->d_bits[d_idx]; d_idx += 2; + + OSMO_ASSERT(d_idx == 48); + + return 36; +} + +/*! Print a encoded "CSD modififed V.110" frame in the same table-like structure as the spec. + * \param outf output FILE stream to which to dump + * \param[in] fr unpacked bits to dump + * \param[in] in_len length of unpacked bits available at fr. */ +void osmo_csd_ubit_dump(FILE *outf, const ubit_t *fr, size_t in_len) +{ + switch (in_len) { + case 60: + for (unsigned int septet = 0; septet < 9; septet++) { + if (septet < 8) { + fprintf(outf, "%d\t%d\t%d\t%d\t%d\t%d\t%d\n", fr[septet * 7 + 0], + fr[septet * 7 + 1], fr[septet * 7 + 2], fr[septet * 7 + 3], + fr[septet * 7 + 4], fr[septet * 7 + 5], fr[septet*7 + 6]); + } else { + fprintf(outf, "%d\t%d\t%d\t%d\n", fr[septet * 7 + 0], + fr[septet * 7 + 1], fr[septet * 7 + 2], fr[septet * 7 + 3]); + } + } + break; + case 36: + for (unsigned int octet = 0; octet < 5; octet++) { + if (octet < 4) { + fprintf(outf, "%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\n", + fr[octet * 8 + 0], fr[octet * 8 + 1], fr[octet * 8 + 2], + fr[octet * 8 + 3], fr[octet * 8 + 4], fr[octet * 8 + 5], + fr[octet * 8 + 6], fr[octet * 8 + 7]); + } else { + fprintf(outf, "%d\t%d\t%d\t%d\n", fr[octet * 8 + 0], + fr[octet * 8 + 1], fr[octet * 8 + 2], fr[octet * 8 + 3]); + } + } + break; + default: + fprintf(outf, "invalid input data length: %zu\n", in_len); + } +} diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 6ad363f..6795c57 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -791,5 +791,11 @@ osmo_iuup_rnl_prim_alloc; osmo_iuup_tnl_prim_alloc; +osmo_csd_12k_6k_decode_frame; +osmo_csd_12k_6k_encode_frame; +osmo_csd_3k6_decode_frame; +osmo_csd_3k6_encode_frame; +osmo_csd_ubit_dump; + local: *; }; diff --git a/tests/Makefile.am b/tests/Makefile.am index f0c80d5..275cf5f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -52,6 +52,7 @@ auth/xor2g_test \ v110/test_frame \ v110/test_ra1 \ + gsm44021/test_frame_csd \ $(NULL) if ENABLE_MSGFILE @@ -347,6 +348,11 @@ v110_test_ra1_SOURCES = v110/test_ra1.c v110_test_ra1_LDADD = $(LDADD) $(top_builddir)/src/isdn/libosmoisdn.la +gsm44021_test_frame_csd_SOURCES = gsm44021/test_frame_csd.c +gsm44021_test_frame_csd_LDADD = $(LDADD) $(top_builddir)/src/isdn/libosmoisdn.la \ + $(top_builddir)/src/gsm/libosmogsm.la + + # The `:;' works around a Bash 3.2 bug when the output is not writeable. $(srcdir)/package.m4: $(top_srcdir)/configure.ac :;{ \ @@ -447,6 +453,7 @@ smscb/cbsp_test.ok \ v110/test_frame.ok \ v110/test_ra1.ok \ + gsm44021/test_frame_csd.ok \ $(NULL) if ENABLE_LIBSCTP @@ -654,6 +661,8 @@ >$(srcdir)/v110/test_frame.ok v110/test_ra1 \ >$(srcdir)/v110/test_ra1.ok + gsm44021/test_frame_csd \ + >$(srcdir)/gsm44021/test_frame_csd.ok check-local: atconfig $(TESTSUITE) [ -e /proc/cpuinfo ] && cat /proc/cpuinfo diff --git a/tests/gsm44021/test_frame_csd.c b/tests/gsm44021/test_frame_csd.c new file mode 100644 index 0000000..98efdac --- /dev/null +++ b/tests/gsm44021/test_frame_csd.c @@ -0,0 +1,93 @@ +#include <stdio.h> +#include <stdlib.h> +#include <stdint.h> +#include <unistd.h> + +#include <osmocom/core/bits.h> +#include <osmocom/isdn/v110.h> +#include <osmocom/gsm/gsm44021.h> + + +static void fill_v110_frame(struct osmo_v110_decoded_frame *fr) +{ + unsigned int i; + + memset(fr, 0, sizeof(*fr)); + + /* we abuse the fact that ubit_t is 8bit so we can actually + * store integer values to clearly identify which bit ends up where */ + + /* D1..D48: 101..148 */ + for (i = 0; i < ARRAY_SIZE(fr->d_bits); i++) + fr->d_bits[i] = 101 + i; + /* E1..E7: 201..207 */ + for (i = 0; i < ARRAY_SIZE(fr->e_bits); i++) + fr->e_bits[i] = 201 + i; + /* S1..S9: 211..219 */ + for (i = 0; i < ARRAY_SIZE(fr->s_bits); i++) + fr->s_bits[i] = 211 + i; + /* X1..X2: 221..222 */ + for (i = 0; i < ARRAY_SIZE(fr->x_bits); i++) + fr->x_bits[i] = 221 + i; +} + + +static void test_frame_enc_12k_6k(void) +{ + struct osmo_v110_decoded_frame fr; + ubit_t bits[60]; + + printf("Testing Frame Encoding for 12k/6k radio interface rate\n"); + + fill_v110_frame(&fr); + + /* run encoder and dump to stdout */ + memset(bits, 0xff, sizeof(bits)); + osmo_csd_12k_6k_encode_frame(bits, sizeof(bits), &fr); + osmo_csd_ubit_dump(stdout, bits, sizeof(bits)); + + /* run decoder on what we just encoded */ + memset(&fr, 0, sizeof(fr)); + osmo_csd_12k_6k_decode_frame(&fr, bits, sizeof(bits)); + + /* re-encode and dump again 'expout' will match it. */ + memset(bits, 0xff, sizeof(bits)); + osmo_csd_12k_6k_encode_frame(bits, sizeof(bits), &fr); + osmo_csd_ubit_dump(stdout, bits, sizeof(bits)); +} + +static void test_frame_enc_3k6(void) +{ + struct osmo_v110_decoded_frame fr; + ubit_t bits[36]; + + printf("Testing Frame Encoding for 3.6k radio interface rate\n"); + + fill_v110_frame(&fr); + /* different D-bit numbering for 3k6, see TS 44.021 Section 8.1.4 */ + for (unsigned int i = 0; i < ARRAY_SIZE(fr.d_bits); i++) + fr.d_bits[i] = 101 + i/2; + + /* run encoder and dump to stdout */ + memset(bits, 0xff, sizeof(bits)); + osmo_csd_3k6_encode_frame(bits, sizeof(bits), &fr); + osmo_csd_ubit_dump(stdout, bits, sizeof(bits)); + + /* run decoder on what we just encoded */ + memset(&fr, 0, sizeof(fr)); + osmo_csd_3k6_decode_frame(&fr, bits, sizeof(bits)); + + /* re-encode and dump again 'expout' will match it. */ + memset(bits, 0xff, sizeof(bits)); + osmo_csd_3k6_encode_frame(bits, sizeof(bits), &fr); + osmo_csd_ubit_dump(stdout, bits, sizeof(bits)); +} + + +int main(int argc, char **argv) +{ + test_frame_enc_12k_6k(); + printf("\n"); + test_frame_enc_3k6(); +} + diff --git a/tests/gsm44021/test_frame_csd.ok b/tests/gsm44021/test_frame_csd.ok new file mode 100644 index 0000000..1a5d3f2 --- /dev/null +++ b/tests/gsm44021/test_frame_csd.ok @@ -0,0 +1,31 @@ +Testing Frame Encoding for 12k/6k radio interface rate +101 102 103 104 105 106 211 +107 108 109 110 111 112 221 +113 114 115 116 117 118 213 +119 120 121 122 123 124 214 +204 205 206 207 125 126 127 +128 129 130 216 131 132 133 +134 135 136 222 137 138 139 +140 141 142 218 143 144 145 +146 147 148 219 +101 102 103 104 105 106 211 +107 108 109 110 111 112 221 +113 114 115 116 117 118 213 +119 120 121 122 123 124 214 +204 205 206 207 125 126 127 +128 129 130 216 131 132 133 +134 135 136 222 137 138 139 +140 141 142 218 143 144 145 +146 147 148 219 + +Testing Frame Encoding for 3.6k radio interface rate +101 102 103 211 104 105 106 221 +107 108 109 213 110 111 112 214 +204 205 206 207 113 114 115 216 +116 117 118 222 119 120 121 218 +122 123 124 219 +101 102 103 211 104 105 106 221 +107 108 109 213 110 111 112 214 +204 205 206 207 113 114 115 216 +116 117 118 222 119 120 121 218 +122 123 124 219 diff --git a/tests/testsuite.at b/tests/testsuite.at index 39cf54a..60aa74d 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -502,3 +502,9 @@ cat $abs_srcdir/v110/test_ra1.ok > expout AT_CHECK([$abs_top_builddir/tests/v110/test_ra1], [], [expout],[]) AT_CLEANUP + +AT_SETUP([gsm44021_test_frame_csd]) +AT_KEYWORDS([gsm44021_test_frame_csd]) +cat $abs_srcdir/gsm44021/test_frame_csd.ok > expout +AT_CHECK([$abs_top_builddir/tests/gsm44021/test_frame_csd], [], [expout],[]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/31668 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I60a2f2690459359437df20cf4da9043fa7c3ad11 Gerrit-Change-Number: 31668 Gerrit-PatchSet: 5 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
[XL] Change in libosmocore[master]: isdn: Add V.110 encoder/decoder
by laforge 08 Mar '23

08 Mar '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/30762 ) Change subject: isdn: Add V.110 encoder/decoder ...................................................................... isdn: Add V.110 encoder/decoder V.110 defines a B-channel protocol for transmission of synchronous and asynchronous serial data of V-series interfaces via terminal adapters over ISDN. Let's add (unoptimized but easy to debug) functions for encoding and decoding of V.110 frames for various bit-rates. Related: OS#1572 Change-Id: I1b5fd3847d3bfb0a0f763e0574893962ec699680 --- M include/osmocom/isdn/Makefile.am A include/osmocom/isdn/v110.h M src/isdn/Makefile.am M src/isdn/libosmoisdn.map A src/isdn/v110.c M tests/Makefile.am M tests/testsuite.at A tests/v110/test_frame.c A tests/v110/test_frame.ok A tests/v110/test_ra1.c A tests/v110/test_ra1.ok 11 files changed, 1,047 insertions(+), 1 deletion(-) Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/isdn/Makefile.am b/include/osmocom/isdn/Makefile.am index bf33623..ad2d8dd 100644 --- a/include/osmocom/isdn/Makefile.am +++ b/include/osmocom/isdn/Makefile.am @@ -1,6 +1,7 @@ osmoisdn_HEADERS = \ i460_mux.h \ lapd_core.h \ + v110.h \ $(NULL) osmoisdndir = $(includedir)/osmocom/isdn diff --git a/include/osmocom/isdn/v110.h b/include/osmocom/isdn/v110.h new file mode 100644 index 0000000..4c1214c --- /dev/null +++ b/include/osmocom/isdn/v110.h @@ -0,0 +1,50 @@ +#pragma once + +#include <osmocom/core/bits.h> + +/* See Section 5.1.2.1 of ITU-T V.110 */ +#define MAX_D_BITS 48 +#define MAX_E_BITS 7 +#define MAX_S_BITS 9 +#define MAX_X_BITS 2 + +/*! a 'decoded' representation of a single V.110 frame. contains unpacket D, E, S and X bits */ +struct osmo_v110_decoded_frame { + ubit_t d_bits[MAX_D_BITS]; + ubit_t e_bits[MAX_E_BITS]; + ubit_t s_bits[MAX_S_BITS]; + ubit_t x_bits[MAX_X_BITS]; +}; + +int osmo_v110_decode_frame(struct osmo_v110_decoded_frame *fr, const ubit_t *ra_bits, size_t n_bits); +int osmo_v110_encode_frame(ubit_t *ra_bits, size_t n_bits, const struct osmo_v110_decoded_frame *fr); + +void osmo_v110_ubit_dump(FILE *outf, const ubit_t *fr, size_t in_len); + + +/*! enum for each supported V.110 synchronous RA1 function (one for each user bitrate) */ +enum osmo_v100_sync_ra1_rate { + OSMO_V110_SYNC_RA1_600, + OSMO_V110_SYNC_RA1_1200, + OSMO_V110_SYNC_RA1_2400, + OSMO_V110_SYNC_RA1_4800, + OSMO_V110_SYNC_RA1_7200, + OSMO_V110_SYNC_RA1_9600, + OSMO_V110_SYNC_RA1_12000, + OSMO_V110_SYNC_RA1_14400, + OSMO_V110_SYNC_RA1_19200, + OSMO_V110_SYNC_RA1_24000, + OSMO_V110_SYNC_RA1_28800, + OSMO_V110_SYNC_RA1_38400, + _NUM_OSMO_V110_SYNC_RA1 +}; + +int osmo_v110_sync_ra1_get_user_data_chunk_bitlen(enum osmo_v100_sync_ra1_rate rate); +int osmo_v110_sync_ra1_get_user_data_rate(enum osmo_v100_sync_ra1_rate rate); +int osmo_v110_sync_ra1_get_intermediate_rate(enum osmo_v100_sync_ra1_rate rate); + +int osmo_v110_sync_ra1_user_to_ir(enum osmo_v100_sync_ra1_rate rate, struct osmo_v110_decoded_frame *fr, + const ubit_t *d_in, size_t in_len); + +int osmo_v110_sync_ra1_ir_to_user(enum osmo_v100_sync_ra1_rate rate, ubit_t *d_out, size_t out_len, + const struct osmo_v110_decoded_frame *fr); diff --git a/src/isdn/Makefile.am b/src/isdn/Makefile.am index 2aed0bf..3bb7b04 100644 --- a/src/isdn/Makefile.am +++ b/src/isdn/Makefile.am @@ -13,7 +13,7 @@ noinst_LTLIBRARIES = libisdnint.la lib_LTLIBRARIES = libosmoisdn.la -libisdnint_la_SOURCES = i460_mux.c lapd_core.c +libisdnint_la_SOURCES = i460_mux.c lapd_core.c v110.c libisdnint_la_LDFLAGS = -no-undefined libisdnint_la_LIBADD = $(top_builddir)/src/core/libosmocore.la diff --git a/src/isdn/libosmoisdn.map b/src/isdn/libosmoisdn.map index 5ac65c9..3269771 100644 --- a/src/isdn/libosmoisdn.map +++ b/src/isdn/libosmoisdn.map @@ -21,5 +21,14 @@ osmo_i460_subchan_count; osmo_i460_ts_init; +osmo_v110_decode_frame; +osmo_v110_encode_frame; +osmo_v110_ubit_dump; +osmo_v110_sync_ra1_get_user_data_chunk_bitlen; +osmo_v110_sync_ra1_get_user_data_rate; +osmo_v110_sync_ra1_get_intermediate_rate; +osmo_v110_sync_ra1_user_to_ir; +osmo_v110_sync_ra1_ir_to_user; + local: *; }; diff --git a/src/isdn/v110.c b/src/isdn/v110.c new file mode 100644 index 0000000..4d13547 --- /dev/null +++ b/src/isdn/v110.c @@ -0,0 +1,582 @@ +/* V.110 frames according to ITU-T V.110 + * + * This code implements the following functionality: + * - parsing/encoding of osmo_v110_decoded_frame from/to actual 80-bit V.110 frame + * - synchronous rate adapting of user bit rate to V.110 D-bits as per Table 6 + * + * It is (at least initially) a very "naive" implementation, as it first and foremost + * aims to be functional and correct, rather than efficient in any way. Hence it + * operates on unpacked bits (ubit_t, 1 bit per byte), and has various intermediate + * representations and indirect function calls. If needed, a more optimized variant + * can always be developed later on. + */ + +/* (C) 2022 by Harald Welte <laforge(a)osmocom.org> + * + * SPDX-License-Identifier: GPL-2.0+ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include <stdint.h> +#include <errno.h> + +#include <osmocom/core/bits.h> + +#include <osmocom/isdn/v110.h> + +/************************************************************************* + * V.110 frame decoding/encoding (ubits <-> struct with D/S/X/E bits) + *************************************************************************/ + +/*! Decode a 80-bit V.110 frame present as 80 ubits into a struct osmo_v110_decoded_frame. + * \param[out] fr caller-allocated output data structure, filled by this function + * \param[in] ra_bits One V.110 frame as 80 unpacked bits. + * \param[in] n_bits number of unpacked bits provided in ra_bits + * \returns 0 in case of success; negative on error. */ +int osmo_v110_decode_frame(struct osmo_v110_decoded_frame *fr, const ubit_t *ra_bits, size_t n_bits) +{ + if (n_bits < 80) + return -EINVAL; + + /* X1 .. X2 */ + fr->x_bits[0] = ra_bits[2 * 8 + 7]; + fr->x_bits[1] = ra_bits[7 * 8 + 7]; + + /* S1, S3, S4, S6, S8, S9 */ + fr->s_bits[0] = ra_bits[1 * 8 + 7]; + fr->s_bits[2] = ra_bits[3 * 8 + 7]; + fr->s_bits[3] = ra_bits[4 * 8 + 7]; + fr->s_bits[5] = ra_bits[6 * 8 + 7]; + fr->s_bits[7] = ra_bits[8 * 8 + 7]; + fr->s_bits[8] = ra_bits[9 * 8 + 7]; + + /* E1 .. E7 */ + memcpy(fr->e_bits, ra_bits + 5 * 8 + 1, 7); + + /* D-bits */ + memcpy(fr->d_bits + 0 * 6, ra_bits + 1 * 8 + 1, 6); + memcpy(fr->d_bits + 1 * 6, ra_bits + 2 * 8 + 1, 6); + memcpy(fr->d_bits + 2 * 6, ra_bits + 3 * 8 + 1, 6); + memcpy(fr->d_bits + 3 * 6, ra_bits + 4 * 8 + 1, 6); + + memcpy(fr->d_bits + 4 * 6, ra_bits + 6 * 8 + 1, 6); + memcpy(fr->d_bits + 5 * 6, ra_bits + 7 * 8 + 1, 6); + memcpy(fr->d_bits + 6 * 6, ra_bits + 8 * 8 + 1, 6); + memcpy(fr->d_bits + 7 * 6, ra_bits + 9 * 8 + 1, 6); + + return 0; +} + +/*! Encode a struct osmo_v110_decoded_frame into an 80-bit V.110 frame as ubits. + * \param[out] ra_bits caller-provided output buffer at leat 80 ubits large + * \param[in] n_bits length of ra_bits. Must be at least 80. + * \param[in] input data structure + * \returns number of bits written to ra_bits */ +int osmo_v110_encode_frame(ubit_t *ra_bits, size_t n_bits, const struct osmo_v110_decoded_frame *fr) +{ + if (n_bits < 80) + return -ENOSPC; + + /* alignment pattern */ + memset(ra_bits+0, 0, 8); + for (int i = 1; i < 10; i++) + ra_bits[i*8] = 1; + + /* X1 .. X2 */ + ra_bits[2 * 8 + 7] = fr->x_bits[0]; + ra_bits[7 * 8 + 7] = fr->x_bits[1]; + + /* S1, S3, S4, S6, S8, S9 */ + ra_bits[1 * 8 + 7] = fr->s_bits[0]; + ra_bits[3 * 8 + 7] = fr->s_bits[2]; + ra_bits[4 * 8 + 7] = fr->s_bits[3]; + ra_bits[6 * 8 + 7] = fr->s_bits[5]; + ra_bits[8 * 8 + 7] = fr->s_bits[7]; + ra_bits[9 * 8 + 7] = fr->s_bits[8]; + + /* E1 .. E7 */ + memcpy(ra_bits + 5 * 8 + 1, fr->e_bits, 7); + + /* D-bits */ + memcpy(ra_bits + 1 * 8 + 1, fr->d_bits + 0 * 6, 6); + memcpy(ra_bits + 2 * 8 + 1, fr->d_bits + 1 * 6, 6); + memcpy(ra_bits + 3 * 8 + 1, fr->d_bits + 2 * 6, 6); + memcpy(ra_bits + 4 * 8 + 1, fr->d_bits + 3 * 6, 6); + + memcpy(ra_bits + 6 * 8 + 1, fr->d_bits + 4 * 6, 6); + memcpy(ra_bits + 7 * 8 + 1, fr->d_bits + 5 * 6, 6); + memcpy(ra_bits + 8 * 8 + 1, fr->d_bits + 6 * 6, 6); + memcpy(ra_bits + 9 * 8 + 1, fr->d_bits + 7 * 6, 6); + + return 10 * 8; +} + +/*! Print a encoded V.110 frame in the same table-like structure as the spec. + * \param outf output FILE stream to which to dump + * \param[in] fr unpacked bits to dump + * \param[in] in_len length of unpacked bits available at fr. */ +void osmo_v110_ubit_dump(FILE *outf, const ubit_t *fr, size_t in_len) +{ + if (in_len < 80) + fprintf(outf, "short input data\n"); + + for (unsigned int octet = 0; octet < 10; octet++) { + fprintf(outf, "%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\n", + fr[octet * 8 + 0], fr[octet * 8 + 1], fr[octet * 8 + 2], fr[octet * 8 + 3], + fr[octet * 8 + 4], fr[octet * 8 + 5], fr[octet * 8 + 6], fr[octet * 8 + 7]); + } +} + +/************************************************************************* + * RA1 synchronous rate adaptation + *************************************************************************/ + +/* I actually couldn't find any reference as to the value of F(ill) bits */ +#define F 1 + +/*! Adapt from 6 synchronous 600bit/s input bits to a decoded V.110 frame. + * \param[out] fr caller-allocated output frame to which E+D bits are stored + * \param[in] d_in input user bits + * \param[in] in_len number of bits in d_in. Must be 6. + * \returns 0 on success; negative in case of error. */ +static int v110_adapt_600_to_IR8000(struct osmo_v110_decoded_frame *fr, const ubit_t *d_in, size_t in_len) +{ + if (in_len != 6) + return -EINVAL; + + /* Table 6a / V.110 */ + fr->e_bits[0] = 1; + fr->e_bits[1] = 0; + fr->e_bits[2] = 0; + for (int i = 0; i < 6; i++) + memset(fr->d_bits + i*8, d_in[i], 8); + + return 0; +} + +static int v110_adapt_IR8000_to_600(ubit_t *d_out, size_t out_len, const struct osmo_v110_decoded_frame *fr) +{ + if (out_len < 6) + return -ENOSPC; + + if (fr->e_bits[0] != 1 || fr->e_bits[1] != 0 || fr->e_bits[2] != 0) + return -EINVAL; + + for (int i = 0; i < 6; i++) { + /* we only use one of the bits, not some kind of consistency check or majority vote */ + d_out[i] = fr->d_bits[i*8]; + } + + return 6; +} + +/*! Adapt from 12 synchronous 1200bit/s input bits to a decoded V.110 frame. + * \param[out] fr caller-allocated output frame to which E+D bits are stored + * \param[in] d_in input user bits + * \param[in] in_len number of bits in d_in. Must be 12. + * \returns 0 on success; negative in case of error. */ +static int v110_adapt_1200_to_IR8000(struct osmo_v110_decoded_frame *fr, const ubit_t *d_in, size_t in_len) +{ + if (in_len != 12) + return -EINVAL; + + /* Table 6b / V.110 */ + fr->e_bits[0] = 0; + fr->e_bits[1] = 1; + fr->e_bits[2] = 0; + for (int i = 0; i < 12; i++) + memset(fr->d_bits + i*4, d_in[i], 4); + + return 0; +} + +static int v110_adapt_IR8000_to_1200(ubit_t *d_out, size_t out_len, const struct osmo_v110_decoded_frame *fr) +{ + if (out_len < 12) + return -ENOSPC; + + if (fr->e_bits[0] != 0 || fr->e_bits[1] != 1 || fr->e_bits[2] != 0) + return -EINVAL; + + for (int i = 0; i < 12; i++) { + /* we only use one of the bits, not some kind of consistency check or majority vote */ + d_out[i] = fr->d_bits[i*4]; + } + + return 12; +} + +/*! Adapt from 24 synchronous 2400bit/s input bits to a decoded V.110 frame. + * \param[out] fr caller-allocated output frame to which E+D bits are stored + * \param[in] d_in input user bits + * \param[in] in_len number of bits in d_in. Must be 24. + * \returns 0 on success; negative in case of error. */ +static int v110_adapt_2400_to_IR8000(struct osmo_v110_decoded_frame *fr, const ubit_t *d_in, size_t in_len) +{ + if (in_len != 24) + return -EINVAL; + + /* Table 6c / V.110 */ + fr->e_bits[0] = 1; + fr->e_bits[1] = 1; + fr->e_bits[2] = 0; + for (int i = 0; i < 24; i++) { + fr->d_bits[i*2 + 0] = d_in[i]; + fr->d_bits[i*2 + 1] = d_in[i]; + } + + return 0; +} + +static int v110_adapt_IR8000_to_2400(ubit_t *d_out, size_t out_len, const struct osmo_v110_decoded_frame *fr) +{ + if (out_len < 24) + return -ENOSPC; + + if (fr->e_bits[1] != 1 || fr->e_bits[1] != 1 || fr->e_bits[2] != 0) + return -EINVAL; + + for (int i = 0; i < 24; i++) { + /* we only use one of the bits, not some kind of consistency check or majority vote */ + d_out[i] = fr->d_bits[i*2]; + } + + return 24; +} + +/*! Adapt from 36 synchronous N x 3600bit/s input bits to a decoded V.110 frame. + * \param[out] fr caller-allocated output frame to which E+D bits are stored + * \param[in] d_in input user bits + * \param[in] in_len number of bits in d_in. Must be 36. + * \returns 0 on success; negative in case of error. */ +static int v110_adapt_Nx3600_to_IR(struct osmo_v110_decoded_frame *fr, const ubit_t *d_in, size_t in_len) +{ + int d_idx = 0; + + if (in_len != 36) + return -EINVAL; + + /* Table 6d / V.110 */ + fr->e_bits[0] = 1; + fr->e_bits[1] = 0; + fr->e_bits[2] = 1; + + memcpy(fr->d_bits + d_idx, d_in + 0, 10); d_idx += 10; /* D1..D10 */ + memset(fr->d_bits + d_idx, F, 2); d_idx += 2; + memcpy(fr->d_bits + d_idx, d_in + 10, 2); d_idx += 2; /* D11..D12 */ + memset(fr->d_bits + d_idx, F, 2); d_idx += 2; + memcpy(fr->d_bits + d_idx, d_in + 12, 2); d_idx += 2; /* D13..D14 */ + memset(fr->d_bits + d_idx, F, 2); d_idx += 2; + memcpy(fr->d_bits + d_idx, d_in + 14, 14); d_idx += 14; /* D15..D28 */ + memset(fr->d_bits + d_idx, F, 2); d_idx += 2; + memcpy(fr->d_bits + d_idx, d_in + 28, 2); d_idx += 2; /* D29..D30 */ + memset(fr->d_bits + d_idx, F, 2); d_idx += 2; + memcpy(fr->d_bits + d_idx, d_in + 30, 2); d_idx += 2; /* D31..D32 */ + memset(fr->d_bits + d_idx, F, 2); d_idx += 2; + memcpy(fr->d_bits + d_idx, d_in + 32, 4); d_idx += 4; /* D33..D36 */ + + OSMO_ASSERT(d_idx == 48); + + return 0; +} + +static int v110_adapt_IR_to_Nx3600(ubit_t *d_out, size_t out_len, const struct osmo_v110_decoded_frame *fr) +{ + int d_idx = 0; + + if (out_len < 36) + return -ENOSPC; + + if (fr->e_bits[0] != 1 || fr->e_bits[1] != 0 || fr->e_bits[2] != 1) + return -EINVAL; + + memcpy(d_out + 0, fr->d_bits + d_idx, 10); d_idx += 10; /* D1..D10 */ + d_idx += 2; + memcpy(d_out + 10, fr->d_bits + d_idx, 2); d_idx += 2; /* D11..D12 */ + d_idx += 2; + memcpy(d_out + 12, fr->d_bits + d_idx, 2); d_idx += 2; /* D13..D14 */ + d_idx += 2; + memcpy(d_out + 14, fr->d_bits + d_idx, 14); d_idx += 14;/* D15..D28 */ + d_idx += 2; + memcpy(d_out + 28, fr->d_bits + d_idx, 2); d_idx += 2; /* D29..D30 */ + d_idx += 2; + memcpy(d_out + 30, fr->d_bits + d_idx, 2); d_idx += 2; /* D31..D32 */ + d_idx += 2; + memcpy(d_out + 32, fr->d_bits + d_idx, 4); d_idx += 4; /* D33..D36 */ + + OSMO_ASSERT(d_idx == 48); + + return 36; +} + + +/*! Adapt from 48 synchronous N x 4800bit/s input bits to a decoded V.110 frame. + * \param[out] fr caller-allocated output frame to which E+D bits are stored + * \param[in] d_in input user bits + * \param[in] in_len number of bits in d_in. Must be 48. + * \returns 0 on success; negative in case of error. */ +static int v110_adapt_Nx4800_to_IR(struct osmo_v110_decoded_frame *fr, const ubit_t *d_in, size_t in_len) +{ + if (in_len != 48) + return -EINVAL; + + /* Table 6e / V.110 */ + fr->e_bits[0] = 0; + fr->e_bits[1] = 1; + fr->e_bits[2] = 1; + + memcpy(fr->d_bits, d_in, 48); + + return 0; +} + +static int v110_adapt_IR_to_Nx4800(ubit_t *d_out, size_t out_len, const struct osmo_v110_decoded_frame *fr) +{ + if (out_len < 48) + return -ENOSPC; + + if (fr->e_bits[0] != 0 || fr->e_bits[1] != 1 || fr->e_bits[2] != 1) + return -EINVAL; + + memcpy(d_out, fr->d_bits, 48); + + return 48; +} + +/*! Adapt from 30 synchronous N x 12000bit/s input bits to a decoded V.110 frame. + * \param[out] fr caller-allocated output frame to which E+D bits are stored + * \param[in] d_in input user bits + * \param[in] in_len number of bits in d_in. Must be 30. + * \returns 0 on success; negative in case of error. */ +static int v110_adapt_Nx12000_to_IR(struct osmo_v110_decoded_frame *fr, const ubit_t *d_in, size_t in_len) +{ + int d_idx = 0; + + if (in_len != 30) + return -EINVAL; + + /* Table 6f / V.110 */ + fr->e_bits[0] = 0; + fr->e_bits[1] = 0; + fr->e_bits[2] = 1; + + memcpy(fr->d_bits + d_idx, d_in + 0, 10); d_idx += 10; /* D1..D10 */ + memset(fr->d_bits + d_idx, F, 2); d_idx += 2; + memcpy(fr->d_bits + d_idx, d_in + 10, 2); d_idx += 2; /* D11..D12 */ + memset(fr->d_bits + d_idx, F, 2); d_idx += 2; + memcpy(fr->d_bits + d_idx, d_in + 12, 2); d_idx += 2; /* D13..D14 */ + memset(fr->d_bits + d_idx, F, 2); d_idx += 2; + fr->d_bits[d_idx++] = d_in[14]; /* D15 */ + memset(fr->d_bits + d_idx, F, 3); d_idx += 3; + memcpy(fr->d_bits + d_idx, d_in + 15, 10); d_idx += 10; /* D16..D25 */ + memset(fr->d_bits + d_idx, F, 2); d_idx += 2; + memcpy(fr->d_bits + d_idx, d_in + 25, 2); d_idx += 2; /* D26..D27 */ + memset(fr->d_bits + d_idx, F, 2); d_idx += 2; + memcpy(fr->d_bits + d_idx, d_in + 27, 2); d_idx += 2; /* D28..D29 */ + memset(fr->d_bits + d_idx, F, 2); d_idx += 2; + fr->d_bits[d_idx++] = d_in[29]; /* D30 */ + memset(fr->d_bits + d_idx, F, 3); d_idx += 3; + + OSMO_ASSERT(d_idx == 48); + + return 0; +} + +static int v110_adapt_IR_to_Nx12000(ubit_t *d_out, size_t out_len, const struct osmo_v110_decoded_frame *fr) +{ + int d_idx = 0; + + if (out_len < 30) + return -ENOSPC; + + if (fr->e_bits[0] != 0 || fr->e_bits[1] != 0 || fr->e_bits[2] != 1) + return -EINVAL; + + memcpy(d_out + 0, fr->d_bits + d_idx, 10); d_idx += 10; /* D1..D10 */ + d_idx += 2; + memcpy(d_out + 10, fr->d_bits + d_idx, 2); d_idx += 2; /* D11..D12 */ + d_idx += 2; + memcpy(d_out + 12, fr->d_bits + d_idx, 2); d_idx += 2; /* D13..D14 */ + d_idx += 2; + d_out[14] = fr->d_bits[d_idx++]; /* D15 */ + d_idx += 3; + memcpy(d_out + 15, fr->d_bits + d_idx, 10); d_idx += 10;/* D16..D25 */ + d_idx += 2; + memcpy(d_out + 25, fr->d_bits + d_idx, 2); d_idx += 2; /* D26..D27 */ + d_idx += 2; + memcpy(d_out + 27, fr->d_bits + d_idx, 2); d_idx += 2; /* D28..D29 */ + d_idx += 2; + d_out[29] = fr->d_bits[d_idx++]; /* D30 */ + d_idx += 3; + + OSMO_ASSERT(d_idx == 48); + + return 30; +} + +/* definition of a synchronous V.110 RA1 rate adaptation. There is one for each supported tuple + * of user data rate and intermediate rate (IR). */ +struct osmo_v110_sync_ra1 { + unsigned int data_rate; + unsigned int intermediate_rate; + unsigned int user_data_chunk_bits; + /*! RA1 function in user bitrate -> intermediate rate direction */ + int (*adapt_user_to_ir)(struct osmo_v110_decoded_frame *fr, const ubit_t *d_in, size_t in_len); + /*! RA1 function in intermediate rate -> user bitrate direction */ + int (*adapt_ir_to_user)(ubit_t *d_out, size_t out_len, const struct osmo_v110_decoded_frame *fr); +}; + +/* all of the synchronous data signalling rates; see Table 1/V.110 */ +static const struct osmo_v110_sync_ra1 osmo_v110_sync_ra1_def[_NUM_OSMO_V110_SYNC_RA1] = { + [OSMO_V110_SYNC_RA1_600] = { + .data_rate = 600, + .intermediate_rate = 8000, + .user_data_chunk_bits = 6, + .adapt_user_to_ir = v110_adapt_600_to_IR8000, + .adapt_ir_to_user = v110_adapt_IR8000_to_600, + }, + [OSMO_V110_SYNC_RA1_1200] = { + .data_rate = 1200, + .intermediate_rate = 8000, + .user_data_chunk_bits = 12, + .adapt_user_to_ir = v110_adapt_1200_to_IR8000, + .adapt_ir_to_user = v110_adapt_IR8000_to_1200, + }, + [OSMO_V110_SYNC_RA1_2400] = { + .data_rate = 2400, + .intermediate_rate = 8000, + .user_data_chunk_bits = 24, + .adapt_user_to_ir = v110_adapt_2400_to_IR8000, + .adapt_ir_to_user = v110_adapt_IR8000_to_2400, + }, + [OSMO_V110_SYNC_RA1_4800] = { + .data_rate = 4800, + .intermediate_rate = 8000, + .user_data_chunk_bits = 48, + .adapt_user_to_ir = v110_adapt_Nx4800_to_IR, + .adapt_ir_to_user = v110_adapt_IR_to_Nx4800, + }, + [OSMO_V110_SYNC_RA1_7200] = { + .data_rate = 7200, + .intermediate_rate = 16000, + .user_data_chunk_bits = 36, + .adapt_user_to_ir = v110_adapt_Nx3600_to_IR, + .adapt_ir_to_user = v110_adapt_IR_to_Nx3600, + }, + [OSMO_V110_SYNC_RA1_9600] = { + .data_rate = 9600, + .intermediate_rate = 16000, + .user_data_chunk_bits = 48, + .adapt_user_to_ir = v110_adapt_Nx4800_to_IR, + .adapt_ir_to_user = v110_adapt_IR_to_Nx4800, + }, + [OSMO_V110_SYNC_RA1_12000] = { + .data_rate = 12000, + .intermediate_rate = 32000, + .user_data_chunk_bits = 30, + .adapt_user_to_ir = v110_adapt_Nx12000_to_IR, + .adapt_ir_to_user = v110_adapt_IR_to_Nx12000, + }, + [OSMO_V110_SYNC_RA1_14400] = { + .data_rate = 14400, + .intermediate_rate = 32000, + .user_data_chunk_bits = 36, + .adapt_user_to_ir = v110_adapt_Nx3600_to_IR, + .adapt_ir_to_user = v110_adapt_IR_to_Nx3600, + }, + [OSMO_V110_SYNC_RA1_19200] = { + .data_rate = 19200, + .intermediate_rate = 32000, + .user_data_chunk_bits = 48, + .adapt_user_to_ir = v110_adapt_Nx4800_to_IR, + .adapt_ir_to_user = v110_adapt_IR_to_Nx4800, + }, + [OSMO_V110_SYNC_RA1_24000] = { + .data_rate = 24000, + .intermediate_rate = 64000, + .user_data_chunk_bits = 30, + .adapt_user_to_ir = v110_adapt_Nx12000_to_IR, + .adapt_ir_to_user = v110_adapt_IR_to_Nx12000, + }, + [OSMO_V110_SYNC_RA1_28800] = { + .data_rate = 28800, + .intermediate_rate = 64000, + .user_data_chunk_bits = 36, + .adapt_user_to_ir = v110_adapt_Nx3600_to_IR, + .adapt_ir_to_user = v110_adapt_IR_to_Nx3600, + }, + [OSMO_V110_SYNC_RA1_38400] = { + .data_rate = 38400, + .intermediate_rate = 64000, + .user_data_chunk_bits = 48, + .adapt_user_to_ir = v110_adapt_Nx4800_to_IR, + .adapt_ir_to_user = v110_adapt_IR_to_Nx4800, + }, +}; + +/*! obtain the size (in number of bits) of the user data bits in one V.110 + * frame for specified RA1 rate */ +int osmo_v110_sync_ra1_get_user_data_chunk_bitlen(enum osmo_v100_sync_ra1_rate rate) +{ + if (rate < 0 || rate >= _NUM_OSMO_V110_SYNC_RA1) + return -EINVAL; + + return osmo_v110_sync_ra1_def[rate].user_data_chunk_bits; +} + +/*! obtain the user data rate (in bits/s) for specified RA1 rate */ +int osmo_v110_sync_ra1_get_user_data_rate(enum osmo_v100_sync_ra1_rate rate) +{ + if (rate < 0 || rate >= _NUM_OSMO_V110_SYNC_RA1) + return -EINVAL; + + return osmo_v110_sync_ra1_def[rate].data_rate; +} + +/*! obtain the intermediate rate (in bits/s) for specified RA1 rate */ +int osmo_v110_sync_ra1_get_intermediate_rate(enum osmo_v100_sync_ra1_rate rate) +{ + if (rate < 0 || rate >= _NUM_OSMO_V110_SYNC_RA1) + return -EINVAL; + + return osmo_v110_sync_ra1_def[rate].intermediate_rate; +} + +/*! perform V.110 RA1 function in user rate -> intermediate rate direction. + * \param[in] rate specification of the user bitrate + * \param[out] fr caller-allocated output buffer for the [decoded] V.110 frame generated + * \param[in] d_in input user data (unpacked bits) + * \param[in] in_len length of user input data (in number of bits) + * \returns 0 on success; negative in case of error */ +int osmo_v110_sync_ra1_user_to_ir(enum osmo_v100_sync_ra1_rate rate, struct osmo_v110_decoded_frame *fr, + const ubit_t *d_in, size_t in_len) +{ + if (rate < 0 || rate >= _NUM_OSMO_V110_SYNC_RA1) + return -EINVAL; + + return osmo_v110_sync_ra1_def[rate].adapt_user_to_ir(fr, d_in, in_len); +} + +/*! perform V.110 RA1 function in intermediate rate -> user rate direction. + * \param[in] rate specification of the user bitrate + * \param[out] d_out caller-allocated output user data (unpacked bits) + * \param[out] out_len length of d_out output buffer + * \param[in] fr [decoded] V.110 frame used as input + * \returns number of unpacked bits written to d_out on success; negative in case of error */ +int osmo_v110_sync_ra1_ir_to_user(enum osmo_v100_sync_ra1_rate rate, ubit_t *d_out, size_t out_len, + const struct osmo_v110_decoded_frame *fr) +{ + if (rate < 0 || rate >= _NUM_OSMO_V110_SYNC_RA1) + return -EINVAL; + + return osmo_v110_sync_ra1_def[rate].adapt_ir_to_user(d_out, out_len, fr); +} diff --git a/tests/Makefile.am b/tests/Makefile.am index eeefd3e..f0c80d5 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -50,6 +50,8 @@ smscb/gsm0341_test \ smscb/cbsp_test \ auth/xor2g_test \ + v110/test_frame \ + v110/test_ra1 \ $(NULL) if ENABLE_MSGFILE @@ -339,6 +341,12 @@ iuup_iuup_test_SOURCES = iuup/iuup_test.c iuup_iuup_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la +v110_test_frame_SOURCES = v110/test_frame.c +v110_test_frame_LDADD = $(LDADD) $(top_builddir)/src/isdn/libosmoisdn.la + +v110_test_ra1_SOURCES = v110/test_ra1.c +v110_test_ra1_LDADD = $(LDADD) $(top_builddir)/src/isdn/libosmoisdn.la + # The `:;' works around a Bash 3.2 bug when the output is not writeable. $(srcdir)/package.m4: $(top_srcdir)/configure.ac :;{ \ @@ -437,6 +445,8 @@ smscb/smscb_test.ok \ smscb/gsm0341_test.ok \ smscb/cbsp_test.ok \ + v110/test_frame.ok \ + v110/test_ra1.ok \ $(NULL) if ENABLE_LIBSCTP @@ -640,6 +650,10 @@ >$(srcdir)/time_cc/time_cc_test.ok iuup/iuup_test \ >$(srcdir)/iuup/iuup_test.ok + v110/test_frame \ + >$(srcdir)/v110/test_frame.ok + v110/test_ra1 \ + >$(srcdir)/v110/test_ra1.ok check-local: atconfig $(TESTSUITE) [ -e /proc/cpuinfo ] && cat /proc/cpuinfo diff --git a/tests/testsuite.at b/tests/testsuite.at index e447cdc..39cf54a 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -490,3 +490,15 @@ cat $abs_srcdir/iuup/iuup_test.ok > expout AT_CHECK([$abs_top_builddir/tests/iuup/iuup_test], [0], [expout], [ignore]) AT_CLEANUP + +AT_SETUP([v110_test_frame]) +AT_KEYWORDS([v110_test_frame]) +cat $abs_srcdir/v110/test_frame.ok > expout +AT_CHECK([$abs_top_builddir/tests/v110/test_frame], [], [expout],[]) +AT_CLEANUP + +AT_SETUP([v110_test_ra1]) +AT_KEYWORDS([v110_test_ra1]) +cat $abs_srcdir/v110/test_ra1.ok > expout +AT_CHECK([$abs_top_builddir/tests/v110/test_ra1], [], [expout],[]) +AT_CLEANUP diff --git a/tests/v110/test_frame.c b/tests/v110/test_frame.c new file mode 100644 index 0000000..ebc617c --- /dev/null +++ b/tests/v110/test_frame.c @@ -0,0 +1,54 @@ +#include <stdio.h> +#include <stdlib.h> +#include <stdint.h> +#include <unistd.h> + +#include <osmocom/core/bits.h> +#include <osmocom/isdn/v110.h> + + +static void test_frame_enc(void) +{ + struct osmo_v110_decoded_frame fr; + ubit_t bits[80]; + unsigned int i; + + memset(&fr, 0, sizeof(fr)); + + /* we abuse the fact that ubit_t is 8bit so we can actually + * store integer values to clearly identify which bit ends up where */ + + /* D1..D48: 101..148 */ + for (i = 0; i < ARRAY_SIZE(fr.d_bits); i++) + fr.d_bits[i] = 101 + i; + /* E1..E7: 201..207 */ + for (i = 0; i < ARRAY_SIZE(fr.e_bits); i++) + fr.e_bits[i] = 201 + i; + /* S1..S9: 211..219 */ + for (i = 0; i < ARRAY_SIZE(fr.s_bits); i++) + fr.s_bits[i] = 211 + i; + /* X1..X2: 221..222 */ + for (i = 0; i < ARRAY_SIZE(fr.x_bits); i++) + fr.x_bits[i] = 221 + i; + + /* run encoder and dump to stdout */ + memset(bits, 0xff, sizeof(bits)); + osmo_v110_encode_frame(bits, sizeof(bits), &fr); + osmo_v110_ubit_dump(stdout, bits, sizeof(bits)); + + /* run decoder on what we just encoded */ + memset(&fr, 0, sizeof(fr)); + osmo_v110_decode_frame(&fr, bits, sizeof(bits)); + + /* re-encode and dump again 'expout' will match it. */ + memset(bits, 0xff, sizeof(bits)); + osmo_v110_encode_frame(bits, sizeof(bits), &fr); + osmo_v110_ubit_dump(stdout, bits, sizeof(bits)); +} + + +int main(int argc, char **argv) +{ + test_frame_enc(); +} + diff --git a/tests/v110/test_frame.ok b/tests/v110/test_frame.ok new file mode 100644 index 0000000..ecefaa8 --- /dev/null +++ b/tests/v110/test_frame.ok @@ -0,0 +1,20 @@ +0 0 0 0 0 0 0 0 +1 101 102 103 104 105 106 211 +1 107 108 109 110 111 112 221 +1 113 114 115 116 117 118 213 +1 119 120 121 122 123 124 214 +1 201 202 203 204 205 206 207 +1 125 126 127 128 129 130 216 +1 131 132 133 134 135 136 222 +1 137 138 139 140 141 142 218 +1 143 144 145 146 147 148 219 +0 0 0 0 0 0 0 0 +1 101 102 103 104 105 106 211 +1 107 108 109 110 111 112 221 +1 113 114 115 116 117 118 213 +1 119 120 121 122 123 124 214 +1 201 202 203 204 205 206 207 +1 125 126 127 128 129 130 216 +1 131 132 133 134 135 136 222 +1 137 138 139 140 141 142 218 +1 143 144 145 146 147 148 219 diff --git a/tests/v110/test_ra1.c b/tests/v110/test_ra1.c new file mode 100644 index 0000000..775ec4b --- /dev/null +++ b/tests/v110/test_ra1.c @@ -0,0 +1,71 @@ +#include <stdio.h> +#include <stdlib.h> +#include <stdint.h> +#include <unistd.h> + +#include <osmocom/core/bits.h> +#include <osmocom/isdn/v110.h> + + +static void test_ra1(enum osmo_v100_sync_ra1_rate rate) +{ + int user_rate = osmo_v110_sync_ra1_get_user_data_rate(rate); + int user_data_chunk_bits = osmo_v110_sync_ra1_get_user_data_chunk_bitlen(rate); + struct osmo_v110_decoded_frame fr; + ubit_t user_bits[48]; + ubit_t bits[80]; + unsigned int i; + int rc; + + printf("\n======= User data rate %u\n", user_rate); + + /* we abuse the fact that ubit_t is 8bit so we can actually + * store integer values to clearly identify which bit ends up where */ + memset(user_bits, 0xFE, sizeof(user_bits)); + for (i = 0; i < user_data_chunk_bits; i++) + user_bits[i] = 101 + i; + + printf("user_bits: "); + for (i = 0; i < user_data_chunk_bits; i++) + printf("%03d ", user_bits[i]); + printf("\n"); + + /* generate the decoded v.110 frame */ + memset(&fr, 0, sizeof(fr)); + rc = osmo_v110_sync_ra1_user_to_ir(rate, &fr, user_bits, user_data_chunk_bits); + OSMO_ASSERT(rc == 0); + + /* run encoder and dump to stdout */ + memset(bits, 0xff, sizeof(bits)); + osmo_v110_encode_frame(bits, sizeof(bits), &fr); + printf("dumping %u encoded bits in V.110 frame:\n", user_data_chunk_bits); + osmo_v110_ubit_dump(stdout, bits, sizeof(bits)); + + /* run decoder on what we just encoded */ + memset(&fr, 0, sizeof(fr)); + osmo_v110_decode_frame(&fr, bits, sizeof(bits)); + printf("dumping re-decoded V.110 frame:\n"); + printf("E-bits: %s\n", osmo_hexdump(fr.e_bits, sizeof(fr.e_bits))); + printf("S-bits: %s\n", osmo_hexdump(fr.s_bits, sizeof(fr.s_bits))); + + /* re-encode and dump again 'expout' will match it. */ + memset(user_bits, 0xff, sizeof(user_bits)); + rc = osmo_v110_sync_ra1_ir_to_user(rate, user_bits, sizeof(user_bits), &fr); + if (rc != user_data_chunk_bits) { + fprintf(stderr, "ERROR: adapt_ir_to_user() returned %d, expected %u\n", rc, + user_data_chunk_bits); + exit(23); + } + fprintf(stdout, "re-decoded user bits: "); + for (i = 0; i < user_data_chunk_bits; i++) + printf("%03d ", user_bits[i]); + printf("\n"); +} + + +int main(int argc, char **argv) +{ + for (int i = 0; i < _NUM_OSMO_V110_SYNC_RA1; i++) + test_ra1(i); +} + diff --git a/tests/v110/test_ra1.ok b/tests/v110/test_ra1.ok new file mode 100644 index 0000000..8a61fc3 --- /dev/null +++ b/tests/v110/test_ra1.ok @@ -0,0 +1,216 @@ + +======= User data rate 600 +user_bits: 101 102 103 104 105 106 +dumping 6 encoded bits in V.110 frame: +0 0 0 0 0 0 0 0 +1 101 101 101 101 101 101 0 +1 101 101 102 102 102 102 0 +1 102 102 102 102 103 103 0 +1 103 103 103 103 103 103 0 +1 1 0 0 0 0 0 0 +1 104 104 104 104 104 104 0 +1 104 104 105 105 105 105 0 +1 105 105 105 105 106 106 0 +1 106 106 106 106 106 106 0 +dumping re-decoded V.110 frame: +E-bits: 01 00 00 00 00 00 00 +S-bits: 00 00 00 00 00 00 00 00 00 +re-decoded user bits: 101 102 103 104 105 106 + +======= User data rate 1200 +user_bits: 101 102 103 104 105 106 107 108 109 110 111 112 +dumping 12 encoded bits in V.110 frame: +0 0 0 0 0 0 0 0 +1 101 101 101 101 102 102 0 +1 102 102 103 103 103 103 0 +1 104 104 104 104 105 105 0 +1 105 105 106 106 106 106 0 +1 0 1 0 0 0 0 0 +1 107 107 107 107 108 108 0 +1 108 108 109 109 109 109 0 +1 110 110 110 110 111 111 0 +1 111 111 112 112 112 112 0 +dumping re-decoded V.110 frame: +E-bits: 00 01 00 00 00 00 00 +S-bits: 00 00 00 00 00 00 00 00 00 +re-decoded user bits: 101 102 103 104 105 106 107 108 109 110 111 112 + +======= User data rate 2400 +user_bits: 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 +dumping 24 encoded bits in V.110 frame: +0 0 0 0 0 0 0 0 +1 101 101 102 102 103 103 0 +1 104 104 105 105 106 106 0 +1 107 107 108 108 109 109 0 +1 110 110 111 111 112 112 0 +1 1 1 0 0 0 0 0 +1 113 113 114 114 115 115 0 +1 116 116 117 117 118 118 0 +1 119 119 120 120 121 121 0 +1 122 122 123 123 124 124 0 +dumping re-decoded V.110 frame: +E-bits: 01 01 00 00 00 00 00 +S-bits: 00 00 00 00 00 00 00 00 00 +re-decoded user bits: 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 + +======= User data rate 4800 +user_bits: 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 +dumping 48 encoded bits in V.110 frame: +0 0 0 0 0 0 0 0 +1 101 102 103 104 105 106 0 +1 107 108 109 110 111 112 0 +1 113 114 115 116 117 118 0 +1 119 120 121 122 123 124 0 +1 0 1 1 0 0 0 0 +1 125 126 127 128 129 130 0 +1 131 132 133 134 135 136 0 +1 137 138 139 140 141 142 0 +1 143 144 145 146 147 148 0 +dumping re-decoded V.110 frame: +E-bits: 00 01 01 00 00 00 00 +S-bits: 00 00 00 00 00 00 00 00 00 +re-decoded user bits: 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 + +======= User data rate 7200 +user_bits: 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 +dumping 36 encoded bits in V.110 frame: +0 0 0 0 0 0 0 0 +1 101 102 103 104 105 106 0 +1 107 108 109 110 1 1 0 +1 111 112 1 1 113 114 0 +1 1 1 115 116 117 118 0 +1 1 0 1 0 0 0 0 +1 119 120 121 122 123 124 0 +1 125 126 127 128 1 1 0 +1 129 130 1 1 131 132 0 +1 1 1 133 134 135 136 0 +dumping re-decoded V.110 frame: +E-bits: 01 00 01 00 00 00 00 +S-bits: 00 00 00 00 00 00 00 00 00 +re-decoded user bits: 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 + +======= User data rate 9600 +user_bits: 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 +dumping 48 encoded bits in V.110 frame: +0 0 0 0 0 0 0 0 +1 101 102 103 104 105 106 0 +1 107 108 109 110 111 112 0 +1 113 114 115 116 117 118 0 +1 119 120 121 122 123 124 0 +1 0 1 1 0 0 0 0 +1 125 126 127 128 129 130 0 +1 131 132 133 134 135 136 0 +1 137 138 139 140 141 142 0 +1 143 144 145 146 147 148 0 +dumping re-decoded V.110 frame: +E-bits: 00 01 01 00 00 00 00 +S-bits: 00 00 00 00 00 00 00 00 00 +re-decoded user bits: 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 + +======= User data rate 12000 +user_bits: 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 +dumping 30 encoded bits in V.110 frame: +0 0 0 0 0 0 0 0 +1 101 102 103 104 105 106 0 +1 107 108 109 110 1 1 0 +1 111 112 1 1 113 114 0 +1 1 1 115 1 1 1 0 +1 0 0 1 0 0 0 0 +1 116 117 118 119 120 121 0 +1 122 123 124 125 1 1 0 +1 126 127 1 1 128 129 0 +1 1 1 130 1 1 1 0 +dumping re-decoded V.110 frame: +E-bits: 00 00 01 00 00 00 00 +S-bits: 00 00 00 00 00 00 00 00 00 +re-decoded user bits: 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 + +======= User data rate 14400 +user_bits: 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 +dumping 36 encoded bits in V.110 frame: +0 0 0 0 0 0 0 0 +1 101 102 103 104 105 106 0 +1 107 108 109 110 1 1 0 +1 111 112 1 1 113 114 0 +1 1 1 115 116 117 118 0 +1 1 0 1 0 0 0 0 +1 119 120 121 122 123 124 0 +1 125 126 127 128 1 1 0 +1 129 130 1 1 131 132 0 +1 1 1 133 134 135 136 0 +dumping re-decoded V.110 frame: +E-bits: 01 00 01 00 00 00 00 +S-bits: 00 00 00 00 00 00 00 00 00 +re-decoded user bits: 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 + +======= User data rate 19200 +user_bits: 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 +dumping 48 encoded bits in V.110 frame: +0 0 0 0 0 0 0 0 +1 101 102 103 104 105 106 0 +1 107 108 109 110 111 112 0 +1 113 114 115 116 117 118 0 +1 119 120 121 122 123 124 0 +1 0 1 1 0 0 0 0 +1 125 126 127 128 129 130 0 +1 131 132 133 134 135 136 0 +1 137 138 139 140 141 142 0 +1 143 144 145 146 147 148 0 +dumping re-decoded V.110 frame: +E-bits: 00 01 01 00 00 00 00 +S-bits: 00 00 00 00 00 00 00 00 00 +re-decoded user bits: 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 + +======= User data rate 24000 +user_bits: 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 +dumping 30 encoded bits in V.110 frame: +0 0 0 0 0 0 0 0 +1 101 102 103 104 105 106 0 +1 107 108 109 110 1 1 0 +1 111 112 1 1 113 114 0 +1 1 1 115 1 1 1 0 +1 0 0 1 0 0 0 0 +1 116 117 118 119 120 121 0 +1 122 123 124 125 1 1 0 +1 126 127 1 1 128 129 0 +1 1 1 130 1 1 1 0 +dumping re-decoded V.110 frame: +E-bits: 00 00 01 00 00 00 00 +S-bits: 00 00 00 00 00 00 00 00 00 +re-decoded user bits: 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 + +======= User data rate 28800 +user_bits: 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 +dumping 36 encoded bits in V.110 frame: +0 0 0 0 0 0 0 0 +1 101 102 103 104 105 106 0 +1 107 108 109 110 1 1 0 +1 111 112 1 1 113 114 0 +1 1 1 115 116 117 118 0 +1 1 0 1 0 0 0 0 +1 119 120 121 122 123 124 0 +1 125 126 127 128 1 1 0 +1 129 130 1 1 131 132 0 +1 1 1 133 134 135 136 0 +dumping re-decoded V.110 frame: +E-bits: 01 00 01 00 00 00 00 +S-bits: 00 00 00 00 00 00 00 00 00 +re-decoded user bits: 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 + +======= User data rate 38400 +user_bits: 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 +dumping 48 encoded bits in V.110 frame: +0 0 0 0 0 0 0 0 +1 101 102 103 104 105 106 0 +1 107 108 109 110 111 112 0 +1 113 114 115 116 117 118 0 +1 119 120 121 122 123 124 0 +1 0 1 1 0 0 0 0 +1 125 126 127 128 129 130 0 +1 131 132 133 134 135 136 0 +1 137 138 139 140 141 142 0 +1 143 144 145 146 147 148 0 +dumping re-decoded V.110 frame: +E-bits: 00 01 01 00 00 00 00 +S-bits: 00 00 00 00 00 00 00 00 00 +re-decoded user bits: 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/30762 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I1b5fd3847d3bfb0a0f763e0574893962ec699680 Gerrit-Change-Number: 30762 Gerrit-PatchSet: 11 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <axilirator(a)gmail.com> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
[XL] Change in libosmocore[master]: isdn: Add V.110 encoder/decoder
by laforge 08 Mar '23

08 Mar '23
Attention is currently required from: jolly, fixeria. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/30762 ) Change subject: isdn: Add V.110 encoder/decoder ...................................................................... Patch Set 11: (3 comments) File src/isdn/v110.c: https://gerrit.osmocom.org/c/libosmocore/+/30762/comment/150c264a_3f57c19e PS10, Line 14: /* (C) 2022 by Harald Welte <laforge(a)osmocom.org> > Missing license header. Done https://gerrit.osmocom.org/c/libosmocore/+/30762/comment/49e81271_0376690e PS10, Line 30: \param[out] caller-allocated > `\param[out] fr ... […] Done https://gerrit.osmocom.org/c/libosmocore/+/30762/comment/069bbaeb_21530aa1 PS10, Line 31: * \param[in] ra_bits One V.110 frame as 80 unpacked bits. */ > Missing `\param` for `n_bits`, also missing `\returns`. Done -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/30762 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I1b5fd3847d3bfb0a0f763e0574893962ec699680 Gerrit-Change-Number: 30762 Gerrit-PatchSet: 11 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <axilirator(a)gmail.com> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: fixeria <axilirator(a)gmail.com> Gerrit-Comment-Date: Wed, 08 Mar 2023 23:14:01 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[L] Change in libosmocore[master]: gsm: TS 44.021 modified V.110 frame encoding/decoding support
by laforge 08 Mar '23

08 Mar '23
Attention is currently required from: jolly, fixeria. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/31668 ) Change subject: gsm: TS 44.021 modified V.110 frame encoding/decoding support ...................................................................... Patch Set 5: (1 comment) File src/gsm/gsm44021.c: https://gerrit.osmocom.org/c/libosmocore/+/31668/comment/a08cedad_e8d1558a PS4, Line 1: > Missing license header. Done -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/31668 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I60a2f2690459359437df20cf4da9043fa7c3ad11 Gerrit-Change-Number: 31668 Gerrit-PatchSet: 5 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Wed, 08 Mar 2023 23:13:44 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmocom-bb[master]: trxcon: move l1ctl_proto.h to 'include/osmocom/bb/'
by fixeria 08 Mar '23

08 Mar '23
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/31333 ) Change subject: trxcon: move l1ctl_proto.h to 'include/osmocom/bb/' ...................................................................... trxcon: move l1ctl_proto.h to 'include/osmocom/bb/' The upcoming l1gprs library will be using this header too. Change-Id: I2101b20637f837038115497873bd905f95a3d0c2 --- M src/host/trxcon/include/osmocom/bb/Makefile.am A src/host/trxcon/include/osmocom/bb/l1ctl_proto.h M src/host/trxcon/include/osmocom/bb/trxcon/Makefile.am D src/host/trxcon/include/osmocom/bb/trxcon/l1ctl_proto.h M src/host/trxcon/src/l1ctl.c 5 files changed, 17 insertions(+), 3 deletions(-) Approvals: pespin: Looks good to me, but someone else must approve neels: Looks good to me, but someone else must approve Jenkins Builder: Verified fixeria: Looks good to me, approved diff --git a/src/host/trxcon/include/osmocom/bb/Makefile.am b/src/host/trxcon/include/osmocom/bb/Makefile.am index c26db00..127a2c7 100644 --- a/src/host/trxcon/include/osmocom/bb/Makefile.am +++ b/src/host/trxcon/include/osmocom/bb/Makefile.am @@ -2,3 +2,7 @@ l1sched \ trxcon \ $(NULL) + +noinst_HEADERS = \ + l1ctl_proto.h \ + $(NULL) diff --git a/src/host/trxcon/include/osmocom/bb/l1ctl_proto.h b/src/host/trxcon/include/osmocom/bb/l1ctl_proto.h new file mode 120000 index 0000000..ee19b80 --- /dev/null +++ b/src/host/trxcon/include/osmocom/bb/l1ctl_proto.h @@ -0,0 +1 @@ +../../../../../../include/l1ctl_proto.h \ No newline at end of file diff --git a/src/host/trxcon/include/osmocom/bb/trxcon/Makefile.am b/src/host/trxcon/include/osmocom/bb/trxcon/Makefile.am index bd9324a..ad1e89a 100644 --- a/src/host/trxcon/include/osmocom/bb/trxcon/Makefile.am +++ b/src/host/trxcon/include/osmocom/bb/trxcon/Makefile.am @@ -1,5 +1,4 @@ noinst_HEADERS = \ - l1ctl_proto.h \ l1ctl_server.h \ l1ctl.h \ phyif.h \ diff --git a/src/host/trxcon/include/osmocom/bb/trxcon/l1ctl_proto.h b/src/host/trxcon/include/osmocom/bb/trxcon/l1ctl_proto.h deleted file mode 120000 index 7ab0f41..0000000 --- a/src/host/trxcon/include/osmocom/bb/trxcon/l1ctl_proto.h +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../include/l1ctl_proto.h \ No newline at end of file diff --git a/src/host/trxcon/src/l1ctl.c b/src/host/trxcon/src/l1ctl.c index b0516cd..ec98f82 100644 --- a/src/host/trxcon/src/l1ctl.c +++ b/src/host/trxcon/src/l1ctl.c @@ -39,8 +39,8 @@ #include <osmocom/gsm/protocol/gsm_04_08.h> #include <osmocom/gsm/protocol/gsm_08_58.h> +#include <osmocom/bb/l1ctl_proto.h> #include <osmocom/bb/trxcon/logging.h> -#include <osmocom/bb/trxcon/l1ctl_proto.h> #include <osmocom/bb/trxcon/trxcon.h> #include <osmocom/bb/trxcon/trxcon_fsm.h> -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/31333 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I2101b20637f837038115497873bd905f95a3d0c2 Gerrit-Change-Number: 31333 Gerrit-PatchSet: 3 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmocom-bb[master]: trxcon: move l1ctl_proto.h to 'include/osmocom/bb/'
by fixeria 08 Mar '23

08 Mar '23
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/31333 ) Change subject: trxcon: move l1ctl_proto.h to 'include/osmocom/bb/' ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/31333 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I2101b20637f837038115497873bd905f95a3d0c2 Gerrit-Change-Number: 31333 Gerrit-PatchSet: 3 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Wed, 08 Mar 2023 21:15:47 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 250
  • 251
  • 252
  • 253
  • 254
  • 255
  • 256
  • ...
  • 365
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.