For both OCTOI client + server FSM, whenever we enter the ACCEPTED
state (we disconnect), let's reset the RIFO/FIFO state. This makes
sure no left-over frames from some earlier connection are present,
and also ensures our initial frame number expectations are correct.
Change-Id: I9e721b5dbf22728cb2361ed121d12def7016dcc2
Only frames withing a certain window are even accepted for processing
the rest is dropped since it could corrupt our state.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I25b2e150d924aa8c714b766cb92e9e23e67cfa4c
We don't want useless identifiers like 'E1oIP line 5518' but something
that we can understand, like the user account name, or in absence
of that, at least the IP/port.
Change-Id: Ibd98b9606a1d9d5b76d63be83eb3df9e431ab3ad
There use to be a stat_item for the depth of the E1-terminated FIFO, as
in a FIFO this is very easy to determine. When we switched to RIFO, it
was lost. Let's re-introduce it with the approximate depth of the RIFO.
Change-Id: I960cbf196ae930b1b72745b8bfe9c2a21fd53325
frame_rifo_in would previously return -ERANGE when a frame was written
which was at the edge of the wrap-around of the frame number (because
the maximum value was already across the boundary)
Also: fixed some typos
Change-Id: I88abfc77543d5c64b01f40944b2914e03e57d08f
In the past, we used a FIFO structure (first in, first out) - which
obviously cannot deal with packet re-ordering on the IP side.
This patch introduces a new "RIFO" as a replacement for the FIFO.
The RIFO is able to reconstruct E1 frame ordering by using the
reduced frame number from the TDMoIP messages, at least as long
as the related frame number range is within the current RIFO depth.
Change-Id: I22256870114cb85e4e10932554478be7061e086b
This introduces initial support for operation as OCTOI (Osmocom
Community TDMoIP) server and client operation.
Various features are still absent (user authentication, support for
re-ordered packets), but this version is already able to provide
services to clients with dynamic IP addresses as well as servers.
The bulk of the OCTOI / E1oIP code is implemented as a shared library,
to facilitate the development of other servers and clients in the
future, and also to minimize the impact on the existing osmo-e1d code
base.
More information is available at https://osmocom.org/projects/octoi/wiki
Change-Id: I05f5ff697ca8f7dccdcf89660f12089babfcc92e