Commit Graph

28 Commits

Author SHA1 Message Date
Harald Welte 9257cd896e xua + ipa: Add support for I/O in OSMO_IO mode
This switches osmo_stream_{cli,srv} over to using the OSMO_IO
mode instead of the classic OSMO_FD mode.  The difference is that
we no longer read/write directly to a file descriptor, but we pass
message buffers to/from the library.

This in turn allows the library to use more efficient I/O mechanisms
as osmo_io backend, for example the Linux kernel io_uring.

This re-introduces Change-Id: I7d02037990f4af405839309510dc6c04e36c3369
which was previously reverted due to regressions caused by a missing
change in libosmo-netif.

Depends: libosmo-netif.git I6cf5bad5f618e71c80017960c38009b089dbd6a1
Depends: libosmocore.git I89eb519b22d21011d61a7855b2364bc3c295df82
Closes: OS#5752
Change-Id: Ia1910f3b99d918ec2a34d5304c3f40ba015c25c9
2024-03-13 22:18:36 +01:00
Harald Welte c72c2d383c Revert "xua + ipa: Add support for I/O in OSMO_IO mode"
This reverts commit d4ec8e7f9f
which caused severe regressions in the TTCN-3 tests: All STP_Tests_M3UA
are failing, as are STP_Tests.* and SCCP_Tests_RAW.TC_process_rx_ludt

Change-Id: I708a5fe0481b14e1b0cdc86149ffc86ee7b5be59
2024-03-07 08:49:30 +01:00
Harald Welte d4ec8e7f9f xua + ipa: Add support for I/O in OSMO_IO mode
This switches osmo_stream_{cli,srv} over to using the OSMO_IO
mode instead of the classic OSMO_FD mode.  The difference is that
we no longer read/write directly to a file descriptor, but we pass
message buffers to/from the library.

This in turn allows the library to use more efficient I/O mechanisms
as osmo_io backend, for example the Linux kernel io_uring.

Change-Id: I7d02037990f4af405839309510dc6c04e36c3369
Depends: libosmo-netif.git I6cf5bad5f618e71c80017960c38009b089dbd6a1
Depends: libosmocore.git I89eb519b22d21011d61a7855b2364bc3c295df82
Closes: OS#5752
2024-03-06 16:14:16 +01:00
Vadim Yanitskiy 22929b1c04 Implement M3UA-over-TCP (in addition to SCTP)
RFC 4666 section 1.3.1 states that "TCP MAY be used as the underlying
common transport protocol" under certain scenarios.  There is even
IANA-allocated TCP port 2905 for that purpose (see section 1.4.8).

Since TCP is a stream oriented protocol, so we need to handle message
boundaries ourselves by reading the M3UA header to know the PDU length.

Change-Id: I8c76d271472befacbeb998a93bbdc9e8660d9b5d
Related: SYS#5424
2024-02-27 00:45:31 +07:00
Pau Espin 00ec53c057 vty: Introduce show cs7 instance asp-assoc-status
Change-Id: I96ef4c0500991c9b86ab5991fb338ea20a18ff33
Depends: libosmocore.git Change-Id I3e1c84526b006baff435bbbca49dc6cf7d201cf5
Depends: libosmo-netif.git Change-Id I78a0bd8279a04f4011c7273e0f542981308e482f
Related: SYS#6636
2023-12-12 16:07:46 +01:00
Pau Espin c86bdae6f5 vty: Introduce show cs7 instance asp-remaddr
Depends: libosmocore.git Change-Id I3e1c84526b006baff435bbbca49dc6cf7d201cf5
Depends: libosmo-netif.git Change-Id I78a0bd8279a04f4011c7273e0f542981308e482f
Related: SYS#6636
Change-Id: Ie5ac1d0ee74d2b977b1f5319cd88566df7994fd0
2023-12-12 16:07:46 +01:00
Pau Espin bbecd572a0 vty: show cs7 instance asp: Swap columns SCTP Role and Remote Address list
The Remote Address is by far the potentially largest column, as well as
the one with more variable length, so move it to the end for better formatting.

Change-Id: I4854219f8898266ae47b9117ef79dbad30a5b0fd
2023-12-12 15:54:19 +01:00
Pau Espin 6ad714de98 vty: Retrieve IP addr set from sk when dumping xUA server
Until now we simply printed back the configured set of IP addresses, not
the one retrieved from the socket at the time, because we didn't have
any easy means to retrieve multiple addresses from a socket.
This is possible since recently using libosmocore APIs. Use them.

Depends: libosmo-netif.git Change-Id I1bd3f790d93af74c150938a59108b882ad2820f3
Depends: libosmocore.git Change-Id I18a0e1a652a3e8ef3e97154355eb1d07a14ef0bd
Related: SYS#6636
Change-Id: I331b6e2fe11cd97e286b7ba684d4a17b8055f9d4
2023-12-12 15:54:13 +01:00
Harald Welte 04ca01eaeb port from osmo_stream_*_get_ofd() to osmo_stream_srv_get_fd()
The existing/old osmo_stream_{srv,cli}_get_ofd() API functions are
only compatible with OSMO_FD mode of libosmo-netif/stream.  In the
OSMO_IO mode, there is no osmo_fd involved, and hence those functions
are illegal to call.

Let's instead migrate over to the new osmo_stream_{srv,cli}_get_fd()
which directly return the file descriptor integer value.

Change-Id: I12c66badfb4bdfdfe71f1716de960d353d3548b1
Related: OS#5752
2023-11-25 17:28:59 +01:00
Pau Espin c5a4b772b1 asp: Support removing local & remote addresses
The local address is removed dynamically from the socket if it is
already created. For remote addresses, it doesn't make any sense (and
there's no API to do so) because the remote address list passed to it is
only used at connect() time, when the socket is created. During the
initial hanshake, the remote provides its own list of remote addresses.

Related: OS#6077
Related: OS#4607
Depends: libosmocore.git Change-Id Ifc6e7d643c2a0c53f479bfd0d5c36d08c0c01953

Change-Id: I554aee92285bd72eb90c6daf47b37055cb3067aa
2023-10-04 11:21:05 +00:00
Pau Espin f8aaa75852 asp: Support adding new local addresses after the ASP was started
Related: OS#6077
Depends: libosmocore.git Change-Id Ifc6e7d643c2a0c53f479bfd0d5c36d08c0c01953
Change-Id: I8318d2693f3a9c479b18ab1d660431c1ec77c004
2023-10-02 13:15:51 +02:00
Pau Espin 15efbbdba4 Bump version: 1.7.0.56-abf26-dirty → 1.8.0
Change-Id: I563bba2eaca7f569a5216fb8268122c0f55ef48b
2023-09-12 14:03:25 +02:00
Pau Espin 13a341e813 asp,xua_srv: Use new osmo_stream API to request sockopt SCTP AUTH/ASCONF SUPPORTED
Support to enable AUTH/ASCONF in the SCTP socket was added recently in
libosmocore and libosmo-netif, in order to support the Peer Primary
Address features used by the libosmo-sccp code.
The code to request the AUTH/ASCONF support through setsockopt() was
internally applied transparently by lisbosmo-netif's osmo_stream. This
is not 100% disarable since other users of the library may not need/want
that behavior.
As a result, libosmo-netif's osmo_stream no longer enables the SCTP
AUTH/ASCONF support by default, but it must be enabled through
the new osmo_stream_{cli,srv_link}_set_param() API.

This change in behavior of the API/implementation can be done because
all these new features are pretty new and no release of
libosmocore/libosmo-netif/libosmo-sccp has been released yet.

Related: SYS#6501
Related: SYS#6558
Depends: libosmo-netif.git Change-Id I2607c1c926a625986cd851adc65dd8b4de83d6ab
Change-Id: I16c97fc148792aa3e39b7414899660990c39dfff
2023-09-08 18:14:37 +02:00
Pau Espin 8b8458d153 asp: Allow setting IP address as SCTP primary upon conn establishment
This is an initial implementation to set the local SCTP Primary address
as well as the peer's Primary Address (through SCTP ASCONF messages).
The Primary address is only set upon conn establishment (after connect()
 for clients, or accept() for severs), which means no logic is
introduced to make sure that primary address is kept during the entire
operation of the SCTP association (for instance if the Primary address
becomes unavailable and the stack changes the primary, and later on that
address becomes available again, the primary addres won't be set back to
the initially configured one).

Related: OS#6076
Change-Id: I4a9fc1a4ad82ed20ece328bc53fca58299d744ca
2023-08-21 12:23:52 +02:00
Pau Espin 58fd289443 ss7: Use libosmo-netif's osmo_stream_{cli,srv}_recv() APIs
Since libosmo-netif.git Change-Id
I4cb94d264109f1b763cccd44c6ba049cc7509319, we receive SCTP notifications
in both client and srv, so there's no real need to use sctp_recvmsg()
directly.

Change-Id: If3d78b636e8e224aa9c8597d0b242e29d3e3c84e
2023-08-07 19:58:14 +02:00
Pau Espin 1470379c27 Set stream_cli/srv name to contain ASP + sockname
Upon connect/accept, update the name to contain both the ASP and the
sockname of the established socked. This allows easily identifying the
stream based on IP layer as well as upper xUA layer.

Example logs:
"""
stream.c:1193 SRV(m3ua,::1:2905) accept()ed new link from ::1 to port 2905
stream.c:1672 SRVCONN(asp-dyn-0,(r=::1:43568<->l=::1:2905)) connected read/write (what=0x1)
stream.c:1589 SRVCONN(asp-dyn-0,(r=::1:43568<->l=::1:2905)) message received
"""
"""
stream.c:521 CLICONN(asp0){CONNECTING} connection established
stream.c:552 CLICONN(asp0,(r=::1:2905<->l=::ffff:127.0.0.2:35911)){CONNECTED} connected read
stream.c:401 CLICONN(asp0,(r=::1:2905<->l=::ffff:127.0.0.2:35911)){CONNECTED} message received
"""

Depends: libosmo-netif.git I539a0d29d11348efe702f971965a55cf56db5c59
Change-Id: I05bc5f6c7795f62c1814c1c774287b41ee85a475
2023-06-20 19:52:46 +02:00
Pau Espin af768c716a Add osmo_ss7_asp getters for name and proto
Some apps such as osmo-bsc are accessing some of those fields, so better
add a getter API to make it easier to update the struct contents.

Change-Id: If9acfca1abc9ab7eb6d2388f548d7ee577b9c5ac
2023-06-20 14:11:46 +02:00
Pau Espin 5d30f648f4 Forbid partial VTY configurations of ASPs with name asp-clnt-*
A recent commit (83db938859) changed the
behavior of default "sctp-role" and "role" values of ASPs named
asp-clnt-* which are used by osmo_sccp_simple_client_on_ss7_id(), in
order to avoid having different default values when than function is
used, which is totally confusing for end users.

As it was already informed when submitting the mentioned commit, it
changes the behavior on that specific case, and that made some users
start having problems without a proper "your config is wrong!" error.

This commit addresses it by basically forbiding that exact use case,
that is, partially defining an asp-clnt-* ASP through VTY without
explicitly configuring a "role" and "sctp-role". With this patch,
function osmo_sccp_simple_client_on_ss7_id() will print a proper error
informing the user and will return NULL, potentially triggering an early
program exit which can then easily be fixed by using proper
configuration.

Related: SYS#6486
Change-Id: I65b5fad2ec06a9d9c521f1e3ce8aab633da95a47
2023-06-16 18:18:35 +02:00
Neels Hofmeyr f9b0746d7d fixup for: add osmo_scu_prim_name_c() / _buf()
I would like to tweak the names for the recently added functions, so
that they are more clear -- quickly before we release it or anyone uses
these.

Depends: libosmocore I9f43428af654a5674ac3035fe4db1394aac7a7af
Related: I4c1998fd7fee7282d107846dae2cff4b5ceb3a7b
Change-Id: If381f537ab91af1feef7f0e51921217f27e18e6a
2023-02-22 16:02:51 +01:00
Pau Espin 1032df2d88 Bump version: 1.5.0.20-e9cc-dirty → 1.6.0
Change-Id: Ibe4efb64b8de506a007559e2fcf13cc9dc0d9d60
2022-06-28 18:22:14 +02:00
Pau Espin 77700b6eb5 ss7: Use sctp value_string from libosmo-netif
Depends: libosmo-netif Change-Id Ica6f01851fb94e31f4ef097494bb1b8a95597ba6
Change-Id: I42323eb5d02d4f67daac7b0a4365f5f6f6057666
2021-11-23 15:50:04 +01:00
Pau Espin 6304393363 Bump version: 1.3.0.51-6858-dirty → 1.4.0
Change-Id: I017147905ffb69829d010f3e8416c8c5d80e7040
2021-02-23 17:57:33 +01:00
Pau Espin 002197560d Support setting rt-prio and cpu-affinity mask through VTY
Depends: libosmocore.git Change-Id If76a4bd2cc7b3c7adf5d84790a944d78be70e10a
Depends: osmo-gsm-masnuals.git Change-Id Icd75769ef630c3fa985fc5e2154d5521689cdd3c
Related: SYS#4986
Change-Id: Ib9faa68c1cd09a026909c792a1fd5557c9893fe3
2020-08-20 08:41:36 +00:00
Pau Espin 5e4643f4bc Bump version: 1.1.0.71-bb75-dirty → 1.2.0
Change-Id: Ibab643b971f80e3774c393ff3988a765dc081196
2020-01-02 21:24:11 +01:00
Pau Espin 2b139a65f0 ss7: Only override traffic mode from recv REG REQ if not set by VTY
RFC 4666 (SS7/MTP3/M3UA) states in isection 4.3.4.3 ASP Active Procedures:
"""
If the traffic handling mode of the Application Server is not already known via
configuration data, then the traffic handling mode indicated in the
first ASP Active message causing the transition of the Application
Server state to AS-ACTIVE MAY be used to set the mode.
"""

In section 3.6.1 Registration Request (REG REQ), no related information
is provided on how to handle it, but still makes sense to apply same
behavior as in 4.3.4.3.

Related: OS#4220
Change-Id: Iaebe3a93ad8d2d84ae01e41b02674f8ece9dfc95
2019-10-24 13:23:09 +02:00
Pau Espin 3eae8ec9ef ss7: Implement AS traffic mode loadshare using round robin ASP selection
Related: OS#4220
Change-Id: I98144dde237672df2e78c7c92923e6f4cb77a271
2019-10-24 13:23:09 +02:00
Pau Espin 80b1355819 ss7: Support multiple addresses in SCTP connections
After this patch, Several "local-ip" and "remote-ip" lines are accepted
under "listen" and "asp" VTY nodes, allowing to configure an SCTP
connection with multiple connections, hence allowing control of SCTP
multi-homing features.
libosmo-sccp clients such as osmo-bsc and osmo-msc also gain support for
this feature with this commit.

Related: OS#3608
Depends: libosmocore.git Ic8681d9e093216c99c6bca4be81c31ef83688ed1
Depends: libosmo-netif.git I0fe62f518e195db4e34f3b0ad1762bb57ba9d92a
Change-Id: Ibd15de7a4e00dbec78ff2e2dd6a686b0f3af22de
2019-10-22 19:38:53 +00:00
Max 02e029708a Use release helper from libosmocore
See
https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release
for details.

Change-Id: I39b3bfa8a1ccf376215a3ce220cb3cf7a85471cb
Related: OS#1861
2017-08-29 12:48:21 +00:00