Commit Graph

22 Commits

Author SHA1 Message Date
Andreas Eversberg d397129eba Add command and client function to change transmitted Sa bits
Change-Id: I2608af7bbb8092fddd68d4f3bb36b10a1100ce0f
2024-01-19 18:23:01 +01:00
Andreas Eversberg cd7d8a96a2 Add functions for events from server to client
The client may register a callback function to receive events.

Because there is no relation between the connected client and the
interface, all events are broadcasted to all clients that are
connected to the server.

Change-Id: I5ee3268f8349b611c3cf3fa0572dc5eab280ab2e
2024-01-19 18:23:01 +01:00
Andreas Eversberg 69459b0a03 Add new protocol command and events for Sa bits and line states
Change-Id: I4c20ec19fa3d9cce82c8199b38d173aa272fb07d
2024-01-19 18:23:01 +01:00
Andreas Eversberg 8d65c3ff4d Add option to automatically reset RIFO on underrun/overflow
Whenever the RIFO buffer fill drifts away from its target, it can be
automatically reset and filled to the initial prefill_frame_count value.
The average fill is measured over several seconds. A given deviation
in percent of the prefill_frame_count is used to trigger that reset.
If the deviation is not set (0), this feature is deactivated.

There are two reasons for this to happen: The GPS clock is missing, so
the receiving interface is not in sync with the transmitting interface.
The delay changes significantly, due to congestion on the path between
both peers. (poor internet connection)

Change-Id: Id7ccbfbdb288990c01f185dec79a1022a68b4748
2024-01-19 18:23:01 +01:00
Harald Welte b7c963f209 octoi: Add force-send-all-ts mode
This new mode (can be enabled per account) will force the E1OIP
protocol to always send all timeslots, i.e. not do any of the
suppression of timeslots that do not exhibit any change to the
previous E1 frame.

Change-Id: I6d17d3829b2c1c62e701a1d8c021d93d93593613
2023-08-14 07:54:10 +02:00
Philipp Maier 28c437675f proto_clnt: fix function prototype
The function prototype for osmo_e1dp_client_destroy has a different
parameter name in its signature in proto_clnt.h than in prto_clnt.c,
let's rename it so that both are coherent. (srv -> clnt)

Change-Id: I8bd4fbdf2bda332870da1b915a7898c396a85b0f
2023-04-20 14:34:46 +02:00
Oliver Smith d20d82442a Run struct_endianness.py
Ensure there is no diff to prepare to run this in CI.

Related: OS#5884
Change-Id: If070a3204d47f71d47e01276fe16323f8af8cb4a
2023-02-20 10:46:00 +01:00
Harald Welte 8aba31092f DAHDI trunkdev support
DAHDI trunkdev is a newly-introduced 'virtual trunk' character device
which is used instead of a real hardware driver. This means that an
application (such as osmo-e1d) can implement a virtual E1 trunk and
receive and transmit E1 frame data which is exposed to DAHDI users
just like the data from a real physical E1 span.

In order to build DAHDI trunkdev support into osmo-e1d, you will need
a special fork of dahdi containing the required support, currently
the laforge/trunkdev branch of the following repository:
	https://gitea.osmocom.org/retronetworking/dahdi-linux

Change-Id: Ib15a7313fcd63e1ed9f2f5b349df967bc4335ec2
2023-02-01 11:24:49 +01:00
Harald Welte 20419bdf55 doxygen API documentation for libosmo-e1d
If we actually expect 3rd party applications to use libosmo-e1d to talk
to osmo-e1d, we'd better add some basic documentation on how this API
shall be used.

Change-Id: Ib4a97045bca276fbd3892f801898a436de7dc39b
2022-11-07 14:43:53 +01:00
Harald Welte 61e4d2c4ac e1oip: Make batching-factor and prefill-frame-count configurable
This adds VTY commands at the 'account' level to configure those
settings.  They will only become active on the next [re]connect
of the line.

Change-Id: Ic455ef0ef82867db512e2ffdff24d9dd42d47eeb
2022-05-08 09:40:43 +02:00
Harald Welte e8e62c4b31 octoi: Support setting IP DSCP and socket priority via VTY
Let's allow setting IP DSCP and socket priority via the VTY.

Note that you must still manually add a kernel egress QoS map from
socket priority to IEEE P802.1p PCP (Priority Code Point) like this:

	ip link set dev eth0.7 type vlan egress-qos-map 0:0 1:1 5:5 6:6 7:7

This will create 1:1 mappings for socket priorities 0, 1, 5, 6 and 7 to
the respective IEEE PCP.  A higher PCP typically means higher priority,
where voice is traditionally using "5".

Change-Id: Ic5a6c5a0ec67beb40be4ca95326aca5072a28958
2022-04-21 09:14:42 +02:00
Harald Welte e324507676 OCTOI: initial support for E1oIP forwarding
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
2022-03-28 12:26:09 +02:00
Harald Welte 50b121cfc4 Introduce a #define for the maximum HDLC buffer size (264)
The purpose of turning the magic number into a #define is to allow
clients to use it.

Change-Id: I9281a4cd85d79823d06860ffaaa09b6d67bc0de3
2021-12-31 16:47:12 +01:00
Harald Welte 9e137aff1d make sure a given timeslot can only be opened once (by default)
Align the behavior of osmo-e1d with that of DAHDI:  If a timeslot is
opened once, it cannot be opened again by anyone until it is closed
by the current owner.  This way we'd have the same failure semantics
in DAHDI vs. osmo-e1d, which is very useful in case of misconfiguration
when osmo-bsc + osmo-mgw would "fight" over a timeslot.

Add a osmo_e1dp_client_ts_open_force() function that allows to override
and get back the original behavior.

Closes: OS#4654
Change-Id: Ib25adf827ec41e74de15e0e4fdcfc9bcc9a32e58
2020-09-20 11:55:14 +02:00
Harald Welte 569726a72f make RAW read buffer size configurable (instead of hard-coded 160)
When opening a timeslot, the client can now specify the (from
application perspective) timeslot read buffer size.  This breaks
ABI, but then we're still at a point where only prototype hardware
exists, so we can get away with it.

Change-Id: I6d603778cce14c5d72fe5f54904905ea7e66d7ff
2020-07-22 09:42:56 +02:00
Harald Welte 79cda368ac add comment about first byte of E1DP_MAGIC
Change-Id: I7b0a59211521ec631512e6cac7a65e2a2172d538
2020-07-22 09:42:56 +02:00
Harald Welte 5d5e47ff3b Add new E1DP_CMD_LINE_CONFIG for switching channelized/superchannel
This adds the related code to the server and client side of the CTL
interface to switch a line between CHANNELIZED and SUPERCHANNEL.

Change-Id: I765b5c3bc9e07b2353f8647e8260ff95df3727e6
2020-07-15 10:26:15 +00:00
Harald Welte 6473bf0fe0 introduce concept of superchannel to data structures
We treat the superchannel as an extra, separate timeslot.  Initially
I thought of simply re-using TS1, but keeping the superchannel
separate ensures that it doesn't inherit any state (like half-sent
HDLC frames) from another timeslot when we switch between the modes
at runtime.

Change-Id: I0aacf251e155de2bb6ad03ffc4181067b22f1c90
2020-07-14 14:40:09 +02:00
Harald Welte 9c8ee9361f proto*.[ch]: Don't refer to GPL if license is LGPL
while at it, also change from physical address to URL.

Change-Id: I60a25f802a7b4535f7d47bb04b9f36194ea4e290
2020-07-01 08:07:03 +00:00
Harald Welte 54e9773d34 proto.h: Share default socket path between client and daemon
This way clients and daemon don't have to be manually configured
to use the same default socket path.

Change-Id: Ibc5bc1bc59056ebaf0f6072de0ff08c2f3bb5457
2020-06-29 22:14:05 +02:00
Harald Welte 0b621b43e7 libosmo-e1d: Add value_string for msg_type and mode
Change-Id: I72807f8eb2dcfaaba2819969c7aa62a4a1a79966
2020-06-29 17:19:14 +02:00
Sylvain Munaut cf189940be Initial code import
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2019-05-11 22:31:12 +02:00