Add functions to pass struct osmo_sockaddr to the
osmo_sockaddr_str_{to,from}* API directly.
So far the interface to osmo_sockaddr_str_ is:
osmo_sockaddr_str_from_sockaddr(&my_sa_str, &my_osa->u.sas);
I'm working a lot with osmo_sockaddr at the moment, and the cumulated
time of forgetting to add 'u.sas' and having another compilation cycle
because of those is justifying this additional API.
Change-Id: I0df84b4bb8cb5d8434b735fa3a38e7f95be43e91
This reverts commit 7f1fb3ea81 - slightly
amended with the new log_cache_enalbe() function. The cache is hence
disabled by default, and applications can enable it, if they wish to
benefit from it.
Reason for the original revert was: some fallout expected due to log
manipulation in test code
Change-Id: I539872fc9e3c50b407e6bc388f1e091fa2c826c3
This function can be used by user code to obtain the currently-set io
operations, it's the inverse of osmo_io_set_ioops().
Change-Id: I03398c811b9534f50c6644b21eea89a04be29fb0
Add support osmo_io operations resembling sendmsg() and recvmsg() socket
operations. This is what will enable the implementation of higher-layer
functions like equivalents of sctp_recvmsg() and sctp_send() in
libosmo-netif and/or other users.
Change-Id: I89eb519b22d21011d61a7855b2364bc3c295df82
Related: OS#5751
This ensures multithreaded logging attempts, in particular ones that do
nothing, do not hold the lock just for checking the level, which
interferes with other logging attempts.
Closes: OS#5818
Change-Id: I35f8dd9127dd6e7feae392094fd6b3ce2d32558d
This is a convenience helper to reetrieve the whole set of remote
addresses and call getsockopt() on them, making it easy for users to
analyse the full set of remote addresses of a socket simply providing an
fd.
Related: SYS#6636
Change-Id: I3e1c84526b006baff435bbbca49dc6cf7d201cf5
An extra osmo_multiaddr_ip_and_port_snprintf() API is introduced which
is used by osmo_sock_multiaddr_get_name_buf() but which will also be
used by other app uers willing to use
osmo_sock_multiaddr_get_ip_and_port() according to its needs (eg. only
printing the local side).
Related: SYS#6636
Change-Id: I48950754ed6f61ee5ffa04a447fab8903f10acc0
This API will be used internally by osmo_sock_multiaddr_get_name_buf()
in a follow-up patch.
This API can also be used directly by user who wish to obtain a list of
local/remote IP addresses and port from an SCTP socket.
Related: SYS#6636
Related: OS#5581
Change-Id: I19d560ab4aadec18a4c0f94115675ec1d7ab14d7
Upcoming patch adopts osmo_strbuf in logging.c, which sometimes needs to
steal and re-add trailing newline characters, and also needs to let
ctime_r() write to the buffer before updating the osmo_strbuf state.
Related: OS#6284
Related: Ib577a5e0d7450ce93ff21f37ba3262704cbf4752
Change-Id: I997707c328eab3ffa00a78fdb9a0a2cbe18404b4
The function is basically a shortcut for getaddrinfo with storing the
output data into our 'struct osmo_sockaddr'.
Change-Id: I6b5c0bf8ca97e6358d992fb2ff45ffd53ba15197
Related: SYS#6657
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
- 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
Dequeue and free any excess messages, in case the new queue length
is shorter than the old.
Related: OS#5774
Change-Id: Ibfe51a2faf29f8ae160a9c330c9af0d09b5a9002
The OSMO_SOCK_F_SCTP_ASCONF_SUPPORTED flag was added recently to enable
use of ASCONF in osmo_sock_inti2_multiaddr. Since we didn't release yet,
we are still in time to get rid of this flag.
It turns out that we'll want to add more features which must be set
before SCTP INIT (connect()) time, like setsockopt SCTP_INITMSG, which
in turn contains a struct with several parameters.
Hence, adding flags for all those makes no sense.
Instead, add a new API which allows passing an extensible struct which
allows much more fine-grained setup from the caller.
The new struct "pars" parameter is non-const on purpose, in order to be
able to extend the struct in the future if we wish to get/obtain some
data from the socket.
Related: SYS#6501
Related: SYS#6558
Change-Id: I1f6fd09a79b0a2bd794e5669d933be25bbf1eeaa
Don't call write_enable() in osmo_iofd_register(). This was used to
detect whether a socket is connected or not, but would always be
enabled, even on unconnected sockets. Instead make this behaviour
explicit by calling osmo_iofd_notify_connected().
Change-Id: Ieed10bc94c8aad821c0a8f7764db0e05c054c1e3
This allows renaming the iofd at any later point in time. This is useful
for instance if the parent object holding the iofd changes its name.
Change-Id: If2772a3ccaa98616e0189862a49ab0243435e343
Added, because the field 'io_ops' of 'struct osmo_io_fd' is not a
reference, so subsequent changes to the osmo_io_ops structure that was
used to set it up aren't automatically reflected in the osmo_io_fd
structure that got its copy.
Change-Id: Ie45402ad8e86e3cecf75ad78a512c17e61e68b19
* make backend configurable for later
* segmentation callback for chunked streams
* logging target for osmo_io
* support partial writes
Change-Id: I50d73cf550d6ce8154bf827bf47408131cf5b0a0
Related: SYS#5094, OS#5751
Change 213fc420e broke osmo-qcdiag:
/usr/bin/ld: diagchar_hdlc.o: in function `osmo_crc16_ccitt_byte':
src/diagchar_hdlc.c:46: undefined reference to `osmo_crc16_ccitt_table'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
make: *** [Makefile:8: osmo-qcdiag-log] Error 1
Change-Id: I7e84546b484db4822554681b31625d0520617d2b
Fixes: 213fc420e "Add libosmocore.map"
Those functions were introduced in I51b3604ba79e42c474aa17007e7e308a12afcea8
but the recent introduction of libosmocore.map didn't list them
Change-Id: I4ac14aae13ff60c110444da989761cd1e86f8925
Fixes: I13169c00a59fb59513dfc598de5a71d094492422
These should not be used, but add them for backwards compatibility with
building older versions of osmo-bsc, osmo-iuh, osmo-pcap against current
libosmocore.
Fixes: 213fc420 ("Add libosmocore.map")
Change-Id: I4cfccf3622844d0923818bb8d8ce206f70e44a0d