The T200 timer is started when the current frame is polled at
PH-READY-TO-SEND event.
A flag is used to enable this feature. The user of LAPD core must track
frame numbers to check the timeout condition. Then it must call the
external timeout function.
Related: OS#4074
Change-Id: Ib961b5a44911b99b0487641533301749c0286995
The current code does not check the value range of the 'mode' parameter
and would later run into OSMO_ASSERT(), rather than rejecting such a
mode from the very beginning.
Change-Id: I10dd612487638f456d0ad59c2cca203f1e098da3
Related: OS#5751
The two functions of the SCTP socket interface we use in osmo-* are
sctp_send() and sctp_recvmsg(). We do not use sctp_sendmsg() at all,
so let's make sure the mode is named correctly.
Change-Id: Ie2d1c7ce6f211dbe025a0e843ad733443102ea15
Related: OS#5751
The function is basically a shortcut for getaddrinfo with storing the
output data into our 'struct osmo_sockaddr'.
Change-Id: I6b5c0bf8ca97e6358d992fb2ff45ffd53ba15197
Related: SYS#6657
Currently calling this function with n_ubits == 0 would result in
requesting one character from the application (via the .tx_cb()),
but not actually transmitting anything. Make it return early.
Change-Id: Icbf99a9f2f6fa64dd71a5f37922f9001577c6c97
Related: OS#4396
As can be seen, pulling a small number of bits at a time (smaller
than a single UART frame would fit into) results in calling the
.tx_cb() with a msgb having no room at all, and thus pulling the
stop bits instead of the actual data.
Change-Id: Icfee378f0fdc5e32fe9ce0afab5f75bc278653a9
Related: OS#4396
Whenever we encounter a parity and/or a framing error, we should
call the .rx_cb() immediately, even if this was the first
character in the receive buffer.
Change-Id: I73fab1a5c196d2dbdfe98b0c20d8dadbd22f4f64
Related: OS#4396
Let the API user pass their own default config when allocating
a soft-UART. Make the default config publicly accessible.
Change-Id: I7e78d60c747a8805064d5e4bacfd47a30bc65cba
Related: OS#4396
The problem with a single function controlling both Rx and Tx is
that enabling/disabling one of the directions requires knowing
state of the other one. In other words, disabling Tx requires
knowing the state of Rx, which may be inconvenient.
Change-Id: Ieacc7e639304eeb14fdb298c7e14d772c136ca6e
Related: OS#4396
This patch brings a Work-in-Progress implementation of the software
UART (Universal Asynchronous Receiver/Transmitter) to libosmocore.
Not only it will be useful in the context of retro-networking, but
also it's needed for the MS-side CSD implementation (see OS#4396).
It should be noted that the definition of struct osmo_soft_uart
is intentionally kept private, since the API is not stable yet.
Currently, the following limitations apply:
* Only the receiver part is implemented, the transmitter is TBD.
* Parity checking is not implemented in the receiver part.
* Software flow control is not implemented.
These missing components will be addressed in subsequent patches.
Change-Id: I2ca95963fd5852ddb89bdd35b86b31489127fe84
- Instead of using the osmo_fd API to call read() on the socket's file
descriptor each time (unused) data is received, simply open the
socket and never read
Related: OS#6213
Change-Id: I4025920d5f62d17133e9b5fe81cd34a88c4f20b5
The outcome of the update function is still used to indicate if an RR
frame must be sent or not. Only if there is no I frame in the TX queue,
RR frame must be sent.
Related: OS#4074
Change-Id: I71676c709878105bfd18b9370fecc61b92796a6f
In case of a busy condition or a reject (sequence error) from the remove
peer, the messages in the TX queue are obsolete and will be flushed.
Related: OS#4074
Change-Id: Iaaf9aaabb958ef889e252ddd0026ff82cfac981f
When RTS is used, lapd_send_i() is called very frequently. (for every
PH-READY-TO-SEND primitive) The logging output can be suppressed in this
case.
As there is no complete lctx (lapd context) when calling lapd_send_i()
at RTS, take the stored lctx.
Related: OS#4074
Change-Id: I3109b7aa15c0f75f4a7458fc1c5d0ce633100f76
- Adapt decl. of 'struct gsmtap_inst' for usage of Osmo IO while maintaining backwards compatibility
- Maintain legacy behavior without any message queues if osmo_io_mode is zero
Related: OS#6213
Change-Id: Iadbbef74e3add7001d84dd6b68f51eac293e44d0
This avoids an infinite recursion when sending a gsmtap log message
causes a log message.
Temporarily set target->loglevel higher than LOGL_FATAL, which
effectively disables logging for that target. Other targets like stderr
will still log this message so there is still an indication that
something went wrong.
Change-Id: I19203cadbad6019a3834793b8ac816d903fe088e
Related: OS#6213
This fixes multi-line color clobbering in logging daemons like
systemd-journald, which work with single-lines only.
Change-Id: Ia7de9d88aa5ac48ec0d5c1a931a89d21c02c5433
Closes: OS#6249
After T200 expires N200+1 times, the link establishment or relase
fails. The counting must be performed prior check.
Related: OS#5970
Change-Id: Icf44e26420fc91312e7c8972a2f3ed475e42fc48
Outgoing CSD calls were previously encoded with the
Bearer Capability 1 - Octet 4 "Structure" field set to
3 - Unstructured. Many Nokia, Sony Ericsson and Huawei devices
won't accept incoming CSD calls with these bits set.
Set them to 0 - Service data unit integrity for now, which
seems to work and make all tested devices happy.
Change-Id: Ieb5bca3d3578abd28e18808752e1c312ce7c4ce0
GSM48_BCAP_ITCAP_3k1_AUDIO should be handled just like fax or
unregistricted digital CSD calls. The transfer capability just
indicates that an (external) interworking function should convert
the call into an analog modem call on the network edge.
The CSD call is still regular V.110/RLP non-transparent data.
Change-Id: I44b76be0f6a891bc1d8f55ede1ef140ea0a19e3d
- Use forward decl. of struct gsmtap_inst in header
- Remove 'static inline' attributes from gsmtap_inst_fd() declaration,
move function definition to gsmtap_util.c and mark it as deprecated
- Add gsmtap_inst_fd2() as replacement for gsmtap_inst_fd()
Related: OS#6213
Change-Id: Ibe1a51205a6df764571b6d074e365825555609a5
These APIs are used to bind or unbind an active socket adding or
removing addresses from the existing set.
Related: OS#6077
Change-Id: Ifc6e7d643c2a0c53f479bfd0d5c36d08c0c01953
- Remove osmo_io_init() from header, since it has no function definition
- Add osmo_iofd_init() to header
Change-Id: I77f7ae2b211507f420d87c484ec75ee054fceb63
Allow the callbacks to be NULL, but then sending/receiving is disabled.
There are some cases where we only care about writing to or reading from
an fd.
Change-Id: I11ce072510b591f7881d09888524426579bd0169
Avoid uninitialized read, found with valgrind
Syscall param recvmsg(msg) points to uninitialised byte(s)
at 0x49FD865: __recvmsg_syscall (recvmsg.c:27)
by 0x49FD865: recvmsg (recvmsg.c:41)
by 0x4891FAE: iofd_poll_ofd_cb_recvmsg_sendmsg (osmo_io_poll.c:66)
by 0x48921B2: iofd_poll_ofd_cb_dispatch (osmo_io_poll.c:119)
by 0x48941F1: poll_disp_fds (select.c:419)
by 0x4894299: _osmo_select_main (select.c:457)
by 0x4894304: osmo_select_main (select.c:496)
by 0x10DC3E: test_segm_ipa_stream_srv_run (stream_test.c:628)
by 0x10E2A5: main (stream_test.c:879)
Address 0x1ffefffa68 is on thread 1's stack
in frame #1, created by iofd_poll_ofd_cb_recvmsg_sendmsg (osmo_io_poll.c:45)
Change-Id: I21114ad57784126cfdeb4a932ed44dbf23946fbe