In GSM 05.03 channel coding for EFR, there are 4 bits out of the
244-bit EFR codec frame that are triplicated before FR-like encoding,
and the decoder needs to apply a 2-out-of-3 majority voting function
to each of these triplicated bits after the FR-like decoding step.
For one of those 4 bits, this majority voting function was wrong
in the decoder implemented in gsm0503_tch_fr_decode() - fix it.
Change-Id: I47def75cdb066ed6372df4567404cc828589ed53
The original GSM-FR ECU implementation from 2017 exhibits a lot of
defects, as detailed in OS#6027. Replace it with a new implementation
based on Themyscira libgsmfrp (a complete Rx DTX handler for GSM-FR),
but reduced to just the ECU function, without the comfort noise
generator function. (These two functions are coupled together in the
classic GSM architecture, but not in libosmocodec ECU model.)
Related: OS#6027
Change-Id: I0200e423ca6165c1313ec9a4effc3f3047f5f032
The current FR codec ECU implementation consists of two parts:
there is a pair of functions that implement the actual functionality,
and these functions are also made public as a now-deprecated legacy
API - and there is the new ECU abstraction. If the FR ECU
implementation behind the generic ECU abstraction is to be changed
to a different one, the old implementation still has to be retained
for those public legacy osmo_ecu_fr_reset() and osmo_ecu_fr_conceal()
API functions to remain available and unbroken. Move this legacy
ECU implementation to its own C module in preparation for changing
the preferred ECU implementation.
Related: OS#6027
Change-Id: Ia169b8bcc6331227a11b78eb7ffca0c7ab838c69
This allows better control on how the counters are ticked.
For instance, since nowadays the writing in ns2_udp is done
asyncrhonously, most probable failures occur at a later point and not
when returning to the caller.
Change-Id: I8109cee07f157ebf1806f82a071f58de3a2dcc9c
Table 1 in section 6 of 3GPP TS 46.011 (FR codec, substitution and
muting of lost frames) specifies a silence frame in the form of
GSM 06.10 parameters - add a const datum to libosmocodec embodying
this GSM 06.11 silence frame in GSM-FR RTP encoding.
Related: OS#6027
Change-Id: Idf31051ea783435268944286a71d2b0ac342a4b5
* make backend configurable for later
* segmentation callback for chunked streams
* logging target for osmo_io
* support partial writes
Change-Id: I50d73cf550d6ce8154bf827bf47408131cf5b0a0
Related: SYS#5094, OS#5751
Recently added osmo_{fr,efr}_sid_classify() functions classify FR
(EFR) codec frames according to the rules of GSM 06.31 (06.81)
section 6.1.1. Both of these specs also define the term "accepted
SID frame", encompassing both valid and invalid SID frames, but not
regular speech frames. A boolean check for this wider category of
"accepted SID frame" is a useful function - many existing calls to
legacy osmo_{fr,efr}_check_sid() functions should be converted
to this "accepted SID frame" check for full correctness. Add wrapper
functions for convenience, and to allow this transition to be made
without adding bloat to every use instance.
Change-Id: I5e6e91baf18440af01dccc6ac0171476a8a5c71c
We have osmo_mobile_identity_decode_from_l3(), which takes a msgb as
argument, and decodes msg->l3h. Not all callers have their data in this
form. Offer a more flexible API for the same decoding.
For example, before the new function, osmo-hnbgw, which extracts a NAS
PDU from asn.1 packed data for CN pooling, would allocate a new msgb and
copy the NAS data just to pass a data pointer as argument.
Related: SYS#6412
Change-Id: I9bd99ccd01f0eedc091fe51687ff92ae1fdff60b
After this patch, most vty_go_parent() functions are really obsolete, as
originally intended: A vty_go_parent() is only needed if the program
requires an action to run on VTY node exit.
vty_transcript_test.vty shows the fixed behavior.
For details, see preceding patch
"vty: show bug in implicit go_parent_node"
I2472daed7436a1947655b06d34eb217e595bc7f3
Change-Id: Id408c678d18ba19b1c1394c3fb657536153d2094
Add test to show a problem in VTY node exiting.
Back in 2017 when I introduced VTY config file scopes by indenting [1],
I actually mistook the vty->priv for the vty->index that we use
everywhere to link to the state for our VTY nodes.
The intention was that each VTY node child level has its own object
linked to it by the vty->index pointer. When the config file leaves a
scope, the vty->index should reflect the parent object.
Instead I implemented that for the vty->priv pointer only, but we don't
use that.
Why did this bug not show? A problem happens only if:
- a node that uses vty->index is nested inside a node that also uses
vty->index.
- config sets parent node attributes after a child node.
- there is no legacy vty_go_parent() function that sets the correct
index via a switch().
[1]
"VTY: implicit node exit by de-indenting, not parent lookup"
4a31ffa2f0
I24cbb3f6de111f2d31110c3c484c066f1153aac9
Change-Id: I2472daed7436a1947655b06d34eb217e595bc7f3
The difference between the RFC5993 and the TS101318 format is only that
RFC5993 has one additional ToC (Table of contents) byte at the
beginning. However it can be difficult to remember which of the two
formats has the ToC byte at at the beginning and which hasn't.
Let's add a constant that defines the length for both formats so that we
can make it more clear in the code which format we are refering to.
Related: OS#5688
Change-Id: I125ef9cdab98c073971841c175b1a7dcd927f9c2
A commit was merged recently attempting to fix decoding of
TLV_TYPE_SINGLE_TV. It did mostly a good job, but missed updating the
o_tag pointer used to fill in the structures.
This commit fixes that specific part missing.
Fixes: 559a6ee683
Change-Id: Id619459c17976b77cd2c7e4179123bb06807285c
A commit was merged recently attempting to fix decoding of
TLV_TYPE_SINGLE_TV. It did mostly a good job, but missed updating the
o_tag pointer used to fill in the structures.
This new unit test showcases the mentioned problem.
A follow-up patch will fix the bug.
Change-Id: Ia17c84059a413f80c2bcf194034ebac586ecf7e1
The old name seems to describe that this function can only be used in
incoming message paths, but it can be used in transmitting context too,
so the param is actually a remote address.
Change-Id: I3f45a4ef339cadd47920ee3b36c38628b38221f6
Change 213fc420e broke osmo-qcdiag:
/usr/bin/ld: diagchar_hdlc.o: in function `osmo_crc16_ccitt_byte':
src/diagchar_hdlc.c:46: undefined reference to `osmo_crc16_ccitt_table'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
make: *** [Makefile:8: osmo-qcdiag-log] Error 1
Change-Id: I7e84546b484db4822554681b31625d0520617d2b
Fixes: 213fc420e "Add libosmocore.map"
Those network elements which receive a stream of codec frames that
may come from the uplink of GSM call A and which are responsible
for preparing the frame stream for the downlink of GSM call B
(OsmoMGW feeding TRAU-DL, or OsmoBTS receiving RTP and feeding DL
to its PHY) must be prepared for the possibility that their
incoming frame stream may contain corrupted SID frames, presumably
from bit errors on radio link A. Per the rules of section 6.1.1
of GSM 06.31 for FR and GSM 06.81 for EFR, SID frames with just one
errored bit are still to be accepted as valid, whereas frames with
more corrupted bits which are still recognizable as SID are classified
as invalid SID.
In the case of a TrFO call, the entity switching from leg A UL to
leg B DL is responsible for *not* transmitting invalid SID frames
on the destination leg (they should be treated like BFIs), and any
deemed-valid SID frames that are forwarded should be preened,
correcting that one bit error they may exhibit. The functions
added here provide that functionality.
Change-Id: Iec5c1f2619a82499f61cb3e5a7cd03ff0f020ad8
The existing osmo_{fr,efr}_check_sid() functions detect whether or not
the frame of bits passed to them constitutes an absolutely perfect
SID frame, with each of 95 SID code word bits set to 0 for FR or
1 for EFR. However, the rules of section 6.1.1 in GSM 06.31 & 06.81
allow up to one bit to be in error for the frame to be accepted as
valid SID, and the same rules also call out a third state (invalid SID)
in between valid SID frames and other frames that are classified as
speech. Support for these rules cannot be patched into those familiar
osmo_{fr,efr}_check_sid() functions because doing so would alter
behavior of existing programs, hence new functions need to be added.
The new functions that implement the exact rules of section 6.1.1 of
GSM 06.31 and 06.81 will need to be used if anyone needs to construct
an outgoing TRAU-UL frame (for example, as part of implementing
TS 28.062 TFO), and they are expected to be useful as part of more
sophisticated ECU implementations.
Change-Id: Ie91a52c6f04689082d8004311517d8ce0c544916
Upcoming patch I58c792dda3cbcf8618648ba4429c27fa398a9e15 aims to change
the timestamp configuration. Show current state before these changes.
Change-Id: I8e0a373496130004e453a2044c1091665fe02a05
There's not much point in deallocating memory in a test fixture
which is about to terminate anyway. Having talloc report though
is handy to make sure we're not leaking smth.
Change-Id: I5739bceb90d36164fd4cbf21242bbe26bd1e7075
Including this header just for TALLOC_CTX is an overkill, we use
'void *' for talloc contexts in nearly all other Osmocom projects.
Change-Id: I4b9ffd7a329081df3d2c0b0ee8698a3cf759e94e
Related: OS#5960
This is a partial revert of "9dca9027 coding: clean up Makefile.am".
Even though libosmocoding does not use talloc API, it still depends on
this library indirectly via libosmo{core,codec,gsm}. Furthermore, some
of libosmocore's header files do #include <osmocom/core/talloc.h>, and
thus #include <talloc.h> via this internal header.
Under Slackware 14.2 talloc.h header lives in /usr/include/samba-4.0,
and without $(TALLOC_CFLAGS) compilation of libmsocoding fails due
to the preprocessor failing to find this header. The culprit is my
recent patch 9dca9027 removing $(TALLOC_CFLAGS) and $(TALLOC_LIBS).
Put $(TALLOC_CFLAGS) back to AM_CFLAGS; it will likely be emply under
distributions having talloc.h header in the standard include dir. The
$(TALLOC_LIBS) does not need to be resurrected because libtool will
add '-ltalloc' automatically for each libosmo*.la in LIBADD.
Change-Id: Ic1bd82159a827af21fe36bea998f8f58f732473a
Related: OS#5960
Previously existing code provides osmo_fr_check_sid() and
osmo_hr_check_sid() functions for FR1 and HR1 codecs; these functions
are used by various RTP-touching programs in the Osmocom CNI suite
when they need to differentiate between speech and SID frames.
However, there was no corresponding function of this form for EFR
codec, with the result being that the same programs that handle
speech vs SID distinction correctly for FR1 and HR1 fail to do so
for EFR.
The present change adds an osmo_efr_check_sid() function to libosmocodec
that fully mirrors previously existing osmo_fr_check_sid() and
osmo_hr_check_sid(), providing the first step toward more correct
EFR handling in programs where a SID check may be needed.
Change-Id: Iab9fb60028f4135375287bc42f5da7ca7838b5f0
The convenience wrapper relieves the caller from manually resolving
the individual counter, and instead specify just the counter group
and the index.
Change-Id: If93e8b4fb0b86a87358f32d2b45438ca1887e9f3
The values are defined in 3GPP TS 44.018, section 10.5.2.6. Only the
radio interface rates for CSD (GSM48_CMODE_DATA_*) are given, but the
respective service rates can be found in 3GPP TS 45.003.
Change-Id: I716027f73ab6f20037f6de16e4a3740811aa38a2
Related: OS#1572
The decoding path of TLV_TYPE_SINGLE_TV is wrong, since it is not
shifting right the tag before using it. On the other hand, the encoding
path (tlv_encode_one) is doing that, so it is clear there's a bug.
It seems that in order to workaround the bug some IEs in gsm_04_08.h (TS
24.008 and TS 44.018) were defined incorrectly (eg 0x80) while the spec
clearly assigns eg. "8" to it, and makes sure no full byte IEI collides.
Some other IEIs like GSM48_IE_GMM_CIPH_CKSN which are also of the same
type were already correctly defined as 0x08.
Change-Id: I799e35dc8d4d153fa63bf50563a5482cdf4de2d7
Coverity warns that osmo_v110_sync_ra1_get_user_data_chunk_bitlen() may
return a negative value, which is used as loop boundary. Even though
this is unlikely, let's add an assert().
Change-Id: I0fc0e0bac74bd96351030432ef1b140b727acb0d
Fixes: CID#310968
Change-Id: I67dc578c62f89039f35856da1f29caab4b5db1d8
Fixes: fae779ac5 "GSMTAP: Import changes from Wireshark"
Fixes: f9b1e5556 "gsmtap.h: Introduce new GSMTAP type for LTE NAS messages"
Fixes: 161d42a61 "gsmtap: Add definitions for E1/T1 payload (LAPD, TRAU, FR) in GSMTAP"
Also mask hexadecimal without leading 0x. But take care to not match on
every letter a-f,A-F in normal words and names.
before:
10 map_rua(NffffNfNecN-example-com-RUA-N)[N]
10 map_sccp(NffffNfNecN-example-com-SCCP-N)[N]
17 map_rua(NffffNcN-example-com-RUA-N)[N]
17 map_sccp(NffffNcN-example-com-SCCP-N)[N]
18 map_rua(NffffNeNbN-example-com-RUA-N)[N]
18 map_sccp(NffffNeNbN-example-com-SCCP-N)[N]
82 map_rua(NffffNfNdN-example-com-RUA-N)[N]
82 map_sccp(NffffNfNdN-example-com-SCCP-N)[N]
85 map_rua(NffffNfN-example-com-RUA-N)[N]
85 map_sccp(NffffNfN-example-com-SCCP-N)[N]
224 struct hnbgw_context_map
after:
224 map_rua(N-example-com-RUA-N)[N]
224 map_sccp(N-example-com-SCCP-N)[N]
224 struct hnbgw_context_map
Change-Id: I1b42ce3e67c7ed2d38d3e5c9cbfa90ba185a07b7