Commit Graph

216 Commits

Author SHA1 Message Date
Harald Welte ff2c7ebc5c README.md: Improved markdown formatting; more links
Change-Id: I7e4f1c8c527a63f13ef9eaa26a00e1b2efca82ae
2024-03-23 18:48:09 +01:00
Harald Welte ef4d4aae27 Add funding link to github mirror
see https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/displaying-a-sponsor-button-in-your-repository

Change-Id: I4af5d8b94ef95f9187977a918d2ea9fe16360f94
2024-03-23 18:45:52 +01:00
Andreas Eversberg 174ad38ca5 Prevent memory leaks / double free of msgb in proto_clnt.c
Change-Id: Ic0c4c06ba7c1a405ec3c73100fe9e8476f4f5512
2024-01-19 18:23:01 +01:00
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 d5b99eb1bd Indicate change in received Sa bits
Change-Id: I4ea2a11e221629a90ed227a0df33576c8607881b
2024-01-19 18:23:01 +01:00
Andreas Eversberg e2cf7f119b Indicate remote alarm bit as remote alarm inidication
The flag that stores the current alarm is not cleared periodically.
Instead it is cleared when the alarm ceases.

Change-Id: Id6cd193c71330c350c27e02b3a692d2c7e0b3fbe
2024-01-19 18:23:01 +01:00
Andreas Eversberg 52e9c56f72 Indicate framing alignment error as loss of framing signal
Change-Id: Iaad3adb6afb9e1d8a002fa4a04ba4ab8e51671a3
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 6b0f9179b1 usb: Deal with truncated ISO IN transfers
It seems that in some circumstances, an ISO IN transfer can be
truncated by the bus / host.  In such situation we'd currently pass
a non-modulo-32 length to the mux_demux (deframer) code, and it ASSERTs
on that.  Let's try to handle this more gracefully by substituting
random garbage and letting higher layers deal with massive bit errors.

Related: OS#5490
Change-Id: Ic453325b93b0e12727625a1495a948d96df4b542
2023-12-17 22:48:00 +00:00
Harald Welte e74944f639 usb: Pass not just the actual transfer length but also the buffer size
Change-Id: I5088a5213d2945fdfaf3b242a63e35d0ed511914
2023-12-17 22:48:00 +00:00
Harald Welte eccfad2465 [cosmetic] e1oip.h: Update TODO comment (we have RTT, frame loss stats)
Change-Id: I837676cb3905c0113307ebc400974c3d8cf3a3c7
2023-12-03 12:22:15 +01:00
Andreas Eversberg e98a59c67e Use uniform log format for default config files
Related: OS#6272
Change-Id: I4a8cb558816534ac942bc38ff0b178849d610457
2023-12-01 12:39:24 +01:00
Pau Espin faedcec65c Bump version: 0.5.0.11-b7c9-dirty → 0.6.0
Change-Id: I8d5e3ffd928fa65bc3d3b43553fcd6774a7812dc
2023-09-12 13:30:07 +02: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
Harald Welte f07d38a6eb e1d-ts-pipe: Assert that osmo_fd_register() succeeds
Fixes: CID#307497: Unchecked return value (CHECKED_RETURN)
Change-Id: Ie2abd580e37d7d58c507d12105ec2130fb533ed9
2023-07-18 14:04:14 +02:00
Harald Welte 27cfff6ad0 octoi: Fix missing check of osmo_fsm_register() return value
Fixes: CID#307511: Unchecked return value (CHECKED_RETURN)
Change-Id: Ia474a6c078f1aec3d04be494a888ffe87b199f5a
2023-07-18 14:02:02 +02:00
Harald Welte 3dabaf3636 proto_srv: Fix file descriptor and memory leak in error paths
Fixes: CID#307517
Change-Id: I44e349eee5b0b54843762db8cadd6b9b1758faa4
2023-07-18 14:00:09 +02:00
Harald Welte 06ab6a991f Check return code of fcntl() in several plaaces
Fixes: CID#307539, CID#307533
Change-Id: I46843174eb4699a59421dc3f3b900a3894c67081
2023-07-18 13:57:21 +02:00
Oliver Smith cd813cde13 systemd: depend on networking-online.target
Related: SYS#6400
Change-Id: I29e547242b2ed1cfc4750c7d7e5f8636c2e8f3dc
2023-05-26 14:10:44 +02:00
Philipp Maier 580bb374ae proto_clnt: use osmo_fd_close to close the socket on connection loss
When the socket is closed due to a connection loss, we currently use
close(). This is not enough since this will not remove the file
descriptor from the select loop. Let's use osmo_fd_close.

Related: OS#5983
Change-Id: I702b944baf2ebbcc84b6a211e245a4a41627bde6
2023-05-02 15:36:20 +02:00
Oliver Smith daaa2fedcb debian: set compat level to 10
Related: OS#5958
Change-Id: Id0f168a7d3c2ae6869121397e65ca1d0cfea30d3
2023-04-25 16:48:21 +02:00
Philipp Maier 9f55c47e7b proto_clnt: close osmo-e1d control socket on connection loss
When osmo-e1d is terminated the socket file descriptor on the client
side will get permanent POLLHUP events. This means that the registered
callback gets called with flags OSMO_FD_READ but the received data will
be of length zero. We must detect this situations and close the file
descriptor on connection loss. Otherwise we would get called over and
over again in an endless loop, resulting in 100% CPU usage.

Related: OS#5983
Change-Id: I3e1a29a9701a9432f58ef7cfedc32c916203017a
2023-04-20 14:38:17 +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
Pau Espin 7d2df40c69 Bump version: 0.4.0.26-8aba-dirty → 0.5.0
Change-Id: I178d34a67cba0359b16fe27fa30b2145703a2909
2023-02-07 11:57:43 +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
Christoph Lauter 632517011d Increasing max FIFO size for feature request 5875, adapting tests
Change-Id: Iae76d87cf436c80c005a2f8fce5a30f74f7e4545
2023-01-26 09:45:45 -07:00
arehbein ad15cf4397 osmo-e1d: Transition to use of 'telnet_init_default'
Related: OS#5809
Change-Id: I68fafc519d7c7ca9788bfcad7be1fadbb208cebe
2022-12-19 22:34:39 +01:00
Oliver Smith df67b3535a contrib/spec: add /etc/osmocom/osmo-e1d.cfg
Fix that the file only got installed to /usr/share as example, but not
to /etc/osmocom in the rpm packaging.

Related: OS#5817
Change-Id: I4ffa23f7ab26b7ed3cba04aed4f57eeaa3edca31
2022-12-08 15:59:47 +01:00
Oliver Smith f42b490064 doc/examples: only install osmo-e1d.cfg to /etc
Adjust OSMOCONF_FILES, so only osmo-e1d.cfg of the examples gets
installed to /etc/osmocom/. All other examples still get installed to
/usr/share, as it is intended.

Related: OS#5817
Change-Id: Ic449b7d38ed50add0164f056574d4da47530eb49
2022-12-08 15:59:28 +01:00
Harald Welte 4c81e74199 update .gitignore with files from manuals + doxygen
Change-Id: I952574e4b29db69ca767138b77b0aac4dbfd8973
2022-11-10 02:07:19 +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 e443318da4 jenkins.sh: Support for building + publishing the manual
Change-Id: Ic399662e6ac5e5e7f999e6e7127df9a9580a0627
2022-11-07 14:36:51 +01:00
Harald Welte 03d9c3215c Initial user manual for osmo-e1d
Still quite incomplete, but significantly better than nothing.

Change-Id: I42f8da1990092b5a3d8c63fde33e49978ad83281
2022-11-07 10:26:37 +00:00
Oliver Smith 533cf1e4d7 gitreview: new file
Change-Id: I32ef094163ad157c6174730fa4f0b51038280107
2022-11-07 10:20:17 +00:00
Harald Welte 1d4cf36e2a Add support of RPM package building via osmo-e1d.spec.in
Change-Id: If9d3d4b7b06aef156fd895415db3b30bdecd74b4
2022-11-07 11:03:29 +01:00
Harald Welte 5806606ce5 avoid segfault in 'show interface' of absent icE1usb
Don't segfault when processing a "show interfaces" for an interface
that is configured via VTY but not actually attached/found in the
system:

usb.c:693:29: runtime error: member access within null pointer of type 'struct e1_usb_intf_data'

Depends: https://gerrit.osmocom.org/c/osmo-gsm-manuals/+/30019
Depends: https://gerrit.osmocom.org/c/osmo-gsm-manuals/+/30020
Change-Id: I2ce990bb57f6ae4edb3a99a4b7bf26a49f362410
2022-11-05 22:26:07 +01:00
Harald Welte 7f204ac42a osmo-e1d: Add the usual '-V' / '--version' command line argument
Change-Id: Ie2d79c44e580ffa6555f87b969206047ffb7eb6f
2022-11-03 10:18:54 +01:00
Harald Welte 81546e6773 Differentiate between icE1usb and e1-tracer in log/vty output
Now that we support the e1-tracer in addition to icE1usb, let's
differentiate in the log output.

Change-Id: Iea647b12d86c97cfacbc3df43010b9b94f0a97c7
2022-11-02 09:42:04 +01:00
Harald Welte 7533197639 usb.c: Bail out of e1-tracer doesn't accept set_configuration(2)
This likely means it's not an e1-tracer after all, or it's an old
firmware that doesn't yet expose the e1d-compatible USB configuration.

Related: OS#5734
Change-Id: If5a9bc20084d84885d5d97b4f982e94801612d24
2022-11-01 18:24:29 +01:00
Harald Welte cfe7ab300e osmo-e1d-pipe: Add command line option for --force open of timeslot
This exposes the existing capability of force-opening a timeslot via a
command-line argument.

Related: OS#5735
Change-Id: Ieefc89f2e48e9124ae744a587739ff3948110944
2022-11-01 18:09:17 +01:00
Harald Welte 5077657f57 ctl: Prevent clients from opening TS0
This doesn't work, as the mux_demux.c code doesn't pass the TS0 bitstream
to users anyway.  So let's reject clients attempting this.

Change-Id: Idb2d20da7de72dad38ae2fccdd7630677d0f0cc8
2022-11-01 17:01:48 +01:00
Harald Welte 64e1889f99 support for e1-tracer hardware
Recent work on the e1-tracer firmware is introducing a set of USB
descriptors (as configuration 2) that are mostly compatible to how
osmo-e1d talks to icE1usb.

The main difference is that there's only one ISO IN endpoint per USB
interface, and no ISO OUT or ISU FB endpoints.  So we introduce some
minor adjustments here to accommodate that.

Related: OS#5733
Closes: OS#5734
Change-Id: I855e18c0f229bd473123f96303e60ab2de90677f
2022-11-01 17:00:25 +01:00
Sylvain Munaut 56a79f60e1 usb: Claim and set interface alt-setting only for used lines
If a line is not auto-created, there is no point on claiming the
matching interface and even less point setting the alt setting that
will try to use USB isoc bandwith.

With this you can no use only line 1 and not line 0 of a ice1usb
for instance. While previously it would still "enable" line 0 and
then line 1 would fail because on BW issues most of the case.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: Iea5d72272f11875e7a32c78b60c188590deda831
2022-10-12 22:18:02 +02:00
Sylvain Munaut 6005fb3ea8 octoi: Prevent segfault on 'show octoi-clients if a client has no line
This can happen if the specified device in the config isn't plugged
in for instance, no line is created ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I594463591f2945a04ccd708f16788034cc1dfc57
2022-10-12 22:16:12 +02:00
Sylvain Munaut 9d45233337 vty: Add option to disable GPS-DO loop and use manual tuning values
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I8668fe42e4c399f08696e497887120e501341f5a
2022-10-06 10:44:18 +02:00
Sylvain Munaut a810249f9a usb: Fix ICE1USB_INTF_SET_GPSDO_MODE request parameter
This call takes its argument in wValue rather than as payload

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: Ibeebe3184a4744bd0cd9f5a19db84c12fab18806
2022-10-06 10:44:18 +02:00
Sylvain Munaut f3e77ceed9 usb: Fix the length field of ICE1USB_INTF_SET_GPSDO_TUNE request
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: Ibf1b1440696902757f4b1c1d9c4d80c1da453a36
2022-10-06 10:44:18 +02:00