Commit Graph

12 Commits

Author SHA1 Message Date
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 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
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
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
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
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 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 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 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
Sylvain Munaut cf189940be Initial code import
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2019-05-11 22:31:12 +02:00