aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2024-03-15patch2jolly/testingAndreas Eversberg1-12/+0
2024-03-15patch 1Harald Welte1-0/+12
2024-03-14cosmetic: rename ss7_asp_*_conn_cb to ss7_asp_*_conn_rx_cbHarald Welte3-10/+10
The old/existing name says it is a connection call-back, but not what kind of all-back; let's introduce 'rx' to indicate it is a receive call-back. Change-Id: Iaaef8128d4a26ea75fbce7067a8ab935a319beb4
2024-03-13xua + ipa: Add support for I/O in OSMO_IO modeHarald Welte4-228/+68
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-07Revert "xua + ipa: Add support for I/O in OSMO_IO mode"Harald Welte4-68/+228
This reverts commit d4ec8e7f9f90c99e3d01765ee63d21a158ec67dd 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-06xua + ipa: Add support for I/O in OSMO_IO modeHarald Welte4-228/+68
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-04xua_accept_cb(): distinguish ASPs using different trans_protoVadim Yanitskiy3-3/+5
This fixes a problem found by TTCN-3 testcases: two ASPs can have identical socket address/port, but different transport protocols. We need to take this into account in ss7_asp_find_by_socket_addr(). Change-Id: I28aab37e8967de51ad2714543fd235d407e304c5 Related: osmo-ttcn3-hacks.git I1e2a887aa22f317783b3207494fd707d7b426439 Related: SYS#5424
2024-02-29fix regression in sctp-role / transport-roleHarald Welte2-2/+5
We saw some fall-out in automatic testing where configs with sctp-role would suddenly save as transport-role. Let's avoid this by keeping sctp-role for users of SCTP. Change-Id: Ic666b62948880445e030c637298d4e369b4c7e8e Fixes: 4d7e201 "VTY: rename 'sctp-role' to 'transport-role', add an alias" Related: SYS#5424, OS#6380
2024-02-27VTY: rename 'sctp-role' to 'transport-role', add an aliasVadim Yanitskiy4-27/+35
Now that we're adding support for M3UA-over-TCP, the transport layer role is no longer an SCTP specific paremeter, but rather a generic one. This is also the case for the OSMO_SS7_ASP_PROT_IPA, which employs TCP, and for which we can also choose between the client and server role. The 'sctp-role' now becomes an alias to 'transport-role', so that we keep backwards compatibility with old config files. Change-Id: Iab6c898181d79a5ed2bea767ee90e55bc3af16a5 Related: SYS#5424
2024-02-27Implement M3UA-over-TCP (in addition to SCTP)Vadim Yanitskiy10-110/+575
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-27osmo_ss7_asp_find_by_name(): improve docs and coding styleVadim Yanitskiy2-7/+8
Change-Id: Ia90776c9c3efc3402d59c4f10e5f2cf26274b3f8 Related: SYS#5424
2024-02-27xua_asp_send_xlm_prim(): use LOGPFSML() to print more contextVadim Yanitskiy1-2/+2
The LOGPFSML() prints current state of an ASP FSM instance, which is useful for debugging. Change-Id: I28f3f89a8158bbedc224922a6ec151b1bbd6c7c0
2024-02-27cosmetic: reduce nesting in osmo_ss7_as_find_by_proto()Vadim Yanitskiy1-10/+9
Change-Id: I16e460b91f57bea6606c111335257d717d5423d0 Related: SYS#5424
2024-02-27cosmetic: xua_cli_connect_cb(): fix typo in a commentVadim Yanitskiy1-1/+1
Change-Id: I8fb57dc60c34ed3db2ea5394c3c452604217de91
2024-02-19examples/sccp_demo_user: fix default ASP protocol in helpVadim Yanitskiy1-1/+1
We actually use OSMO_SS7_ASP_PROT_M3UA by default. Change-Id: I8481fd8707ed7985071c5c64ee621d210fb4d493
2024-02-16fix xua_msg_dump(): convert message length to the host's byte orderVadim Yanitskiy1-1/+1
This fixes bogus messages like this one: Received MGMT_ERR 'Invalid Routing Context': HDR=(MGMT:ERROR,V=1,LEN=268435456), PART(T=Error Code,L=4,D=00000019) ^^^^^^^^^^^^^ Change-Id: I516e486fb7b51a25e33965ed5a0f12ab4488d240
2024-02-15return CMD_WARNING if osmo_ss7_xua_server_create() failsVadim Yanitskiy1-1/+1
Change-Id: I12bbfd48e16166c0f508ccbf2ed4fa786e786082 Related: SYS#5424
2024-02-10vty_test_runner: Don't wait for more than 10s when connecting to socketsHarald Welte1-0/+4
Change-Id: Iadb437ce0bafb28baa978d287dbb1006ec97f236
2024-02-10vty_test_runner: Avoid bogus erro messages like "AssertionError: False is ↵Harald Welte1-2/+2
not true" "self.assertTrue(False)" is abusing python unittests. If you want to fail, either call the fail() method, or simply raise an exception... Change-Id: Ib683d6e166a9fca22dd2eb26e066e47034cda750
2024-02-10Add new "cs7 instance <0-15> asp NAME disconnect" VTY commandHarald Welte2-0/+27
This allows the user to administratively disconnect the current transport connection of a given ASP. If issued on the client side, the default layer manager will trigger an automatic re-connect. If issued on the server side, we expect the client will re-connect. Change-Id: I2077121ab860fafb70951454d029c3afa9ee2818
2024-02-10xua_asp_fsm: Log ERROR message when we send a MGMT:ERR messageHarald Welte1-0/+2
We've always been logging received MGMT:ERR messages, but we somehow didn't log the transmission of them. So whenever osmo-stp generates some error to a connected peer, the peer would show it, but not osmo-stp itself. Let's fix that. Change-Id: I50c05409646fd47e70d904fb95bbc2fa15703b3e
2024-01-26build: include README.md into the release tarballVadim Yanitskiy1-0/+1
Change-Id: I4ffd3738b3230d7b2cb4f8ebfa5d59f9e6dca27f
2023-12-12ipa: Use ASP name as ipa_unit_name on dynamic ASPsPau Espin Pedrol3-8/+43
A recent patch fixed a long problem where the ASP name (instead of expected AS name) was used as ipa_unit_name in IPA based ASPs. For server side it doesn't matter much, sense anyway the ipa_unit_name is actually restored on the struct with what's received in IPA GET_RESP message (see ipa_asp_fsm_wait_id_resp()). So the fix was actually for the client side in the scenario where a non-dynamic ASP with an assigned AS was configured in the VTY. However, dynamic ASPs usually have no assigned AS (because in general it is really not created/configured, as the ASP is created on the flight). As a result, the recent patch (see "Fixes" below), broke dynamic ASPs case because from then one ipa_asp_fsm_start() would fail and terminate the FSM because ipa_find_as_for_asp() was returning NULL. So improve the recent patch by applying the previous logic for dynamic ASPs: * On the server side, it really doesn't matter since as mentioned, the field will be repopulated later on, but allows the code to avoid terminating the FSM and hence be brought up and be ready to receive clients. * On the client case, this is how dynamic IPA ASPs were ment to be used when they were introduced anyway (use ASP as ipa_unit_id, meaning "AS name" == "ASP name"). Furthermore, on the client side, the non-dynamic IPA ASPs need their bring up be delayed until assigned to an AS, because the AS name is sent in ipa_unit_name field in Tx IPA ID RESP. This usually happens at a later point than ASP (FSM) creation, because first the ASP object is created (through VTY or API) and then assigned to an AS through osmo_ss7_as_add_asp() usually from a later "asp" vty command in the "as" node. Fixes: 65741dca056e3a16973ad156dd4c09760a6a945b Change-Id: I0a741449450c998253b1e44a76a3b7fc224e0903 Related: SYS#5914
2023-12-12cosmetic: Fix typo in function docPau Espin Pedrol1-1/+1
Change-Id: I1c4fe7d1b3a5cdd4c2c9c942e292a7135467d9e2
2023-12-12vty: Introduce show cs7 instance asp-assoc-statusPau Espin Pedrol3-7/+170
Change-Id: I96ef4c0500991c9b86ab5991fb338ea20a18ff33 Depends: libosmocore.git Change-Id I3e1c84526b006baff435bbbca49dc6cf7d201cf5 Depends: libosmo-netif.git Change-Id I78a0bd8279a04f4011c7273e0f542981308e482f Related: SYS#6636
2023-12-12vty: Introduce show cs7 instance asp-remaddrPau Espin Pedrol3-5/+192
Depends: libosmocore.git Change-Id I3e1c84526b006baff435bbbca49dc6cf7d201cf5 Depends: libosmo-netif.git Change-Id I78a0bd8279a04f4011c7273e0f542981308e482f Related: SYS#6636 Change-Id: Ie5ac1d0ee74d2b977b1f5319cd88566df7994fd0
2023-12-12vty: Introduce cmd 'show cs7 instance asp name ASP_NAME'Pau Espin Pedrol2-30/+71
Allow printing only a specific asp by name. Useful when user is only interested in a uniqe ASP and there's lots of them configured. Related: SYS#6636 Change-Id: I08426272069ce5f3c8403b08dcaf686547bee336
2023-12-12vty: show cs7 instance asp: Print loc and rem addr retrieved from socketPau Espin Pedrol4-46/+85
Until now, we were in general printing the list of remote addresses that were stored in config, because we didn't have an easy way to retrieve the addresses from the socket. Since recently some libosmocore APIs make that easy, so use them now. If the socket is not yet created, then log the addrress list from the config. Furthermore, take the chance to print now both local and remote addresses. Related: SYS#6636 Change-Id: I607e4c2dd37f07bf1c07c88681918184e92202ea
2023-12-12vty: show cs7 instance asp: Swap columns SCTP Role and Remote Address listPau Espin Pedrol3-37/+37
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-12vty: Retrieve IP addr set from sk when dumping xUA serverPau Espin Pedrol2-4/+27
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-07ipa: Fix client setting unit_id with ASP name instead of ASPau Espin Pedrol3-3/+10
This was broken since ever. The client was submitting the ASP name in the unit_id field during IPA handshake, and the server was expecting it to contain the AS, so it failed with message: "Cannot find any definition for IPA Unit Name '%s'" in ipa_asp_fsm_wait_id_resp(). Fixes: 5f0a8df34cae20455a520c3a85cf94124f486bf2 Change-Id: I249964e171f578726439c40e01ae85aa447afada
2023-11-25port from osmo_stream_*_get_ofd() to osmo_stream_srv_get_fd()Harald Welte4-34/+56
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-10-31sccp_scoc: Fix remote PC not assigned preventing RSLD to be sent in st ↵Pau Espin Pedrol1-0/+7
WAIT_CONN_CONF Scenario: RUA Connect triggers SCCP CR towards peer, and we move to CONN_PEND_OUT state where we expect to receive CC. However, if some timer (like X31) times out before we receive CC (eg because CC takes a long time to come), we end up in state WAIT_CONN_CONF. In that state, according to Figure C.2/Q.714 (sheet 2 of 7), among other possibilite we wait for CC, and if it arrives, we send an RLSD to the peer to inform him that we released the conn, and wait for the peer to ack the RLSD, then release all state. Given the scenario above, scoc_fsm_wait_conn_conf() was not assigning the received OPC from the CC to the conn->remote_pc (unlike scoc_fsm_conn_pend_out() which does it properly). As a result, when trying to send teh RLSD it would fail and never transmit RLSD, taking then a long time to release through T(rel) (10-20 seconds), and probably longer in the peer (T(iar) or similar?). Rua Connect triggers tx of SCCP CC: Received SCCP User Primitive (N-CONNECT.request) XUA_AS(as-clnt-msc-0)[0x55f11c7df980]{AS_ACTIVE}: Received Event AS-TRANSFER.req //Tx CC SCCP-SCOC(929)[0x55f11c909c90]{IDLE}: State change to CONN_PEND_OUT (no timeout) ... X31 timeout triggers state change: map_sccp(...-SCCP-929)[0x55f11c909820]{wait_cc}: Timeout of X31 SCCP-SCOC(929)[0x55f11c909c90]{CONN_PEND_OUT}: Received Event N-DISCONNECT.req SCCP-SCOC(929)[0x55f11c909c90]{CONN_PEND_OUT}: State change to WAIT_CONN_CONF (no timeout) ... CC arrives, but conn_remote_pc is not properly assigned and tx of RLSD fails: SCCP-SCOC(929)[0x55f11c909c90]{WAIT_CONN_CONF}: Received Event RCOC-CONNECT_CONFIRM.ind MTP-TRANSFER.req from SCCP without DPC?!? called=RI=0 // PROBLEM HERE!!!! SCCP-SCOC(929)[0x55f11c909c90]{WAIT_CONN_CONF}: State change to DISCONN_PEND (no timeout) ... SCCP-SCOC(929)[0x55f11c909c90]{DISCONN_PEND}: Received Event T(rel)_expired Related: SYS#6616 Change-Id: I9f9f78c92dd95f38af7b03037e60a1c993d7e5b0
2023-10-31cosmetic: add spec referenceMax1-4/+6
Related: OS#5579 Change-Id: I4d6bf9d0e681db779770b2fb815f7f9c5e608b15
2023-10-30sccp_demo_user: Allow initiating conns from vty in server modePau Espin Pedrol1-0/+1
This allows starting SCCP conns from within sccp_demo_user, which in turn allows testing more scenarios in osmo-ttcn3-hacks.git SCCP_RAW_Tests testsuite. Related: SYS#6616 Change-Id: I7d5b3534c496dca8a3f3e66025af554bbe860c04
2023-10-17Fix counting received IPA packets in server modeHarald Welte1-1/+1
When operating an IPA ASP in server mode, we were not counting the packets using the related stat item: For example: OsmoSTP# show stats Ungrouped counters: SIGTRAN Application Server Process (6)('asp-dyn-5'): Total number of packets received: 0 (0/s 0/m 0/h 0/d) Total number of packets transmitted: 235370503 (129/s 7682/m 442447/h 11342653/d) This patch adds the missing counter increment. Change-Id: I75881d115b5c2c2567c4731bcf2cabe11f367117 Closes: SYS#6600
2023-10-04xua_server: asp: Support removing local addressesPau Espin Pedrol3-0/+29
The socket is reconfigured (and hence reopened) upon VTY node exit if changes were stored in the address list of the xua_server (osmo_stream_srv_link). Related: OS#4607 Change-Id: I942edff7695efeea7753f22e31c2098c201290ff
2023-10-04asp: Support removing local & remote addressesPau Espin Pedrol7-2/+143
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-04sccp: Drop unused local variablePau Espin Pedrol1-3/+0
Change-Id: I7f829f1c285d01faeaad317262ddd51f39e42886
2023-10-02asp: Support adding new local addresses after the ASP was startedPau Espin Pedrol4-1/+37
Related: OS#6077 Depends: libosmocore.git Change-Id Ifc6e7d643c2a0c53f479bfd0d5c36d08c0c01953 Change-Id: I8318d2693f3a9c479b18ab1d660431c1ec77c004
2023-09-29asp: Apply SCTP peer primary address changes after the ASP was startedPau Espin Pedrol1-0/+17
Related: OS#6077 Change-Id: I088b9a59ebfd85f3ce4a26f28bf41472d9b9da60
2023-09-29asp: Apply SCTP primary address changes after the ASP was startedPau Espin Pedrol3-0/+27
Related: OS#6077 Change-Id: I2beb597b2e98d8983177fb21882a461219b3aa58
2023-09-29Split osmo_ss7_as functionalities to its own filePau Espin Pedrol4-171/+215
Change-Id: I6e39dcb594ffe918ba117fce08cae7b5a6fd2dcc
2023-09-29Factor our osmo_ss7_as allocation to its own functionPau Espin Pedrol2-15/+35
This makes it easier to find out where the AS struct is allocated, plus also split between inst code looking up + checking + allocating and the code doing the allocation and initialization of the AS. Change-Id: Ie237ec8ac4b2e15b76fce3b3a56f47a59fdcc76e
2023-09-29Split osmo_ss7_asp_peer functionalities to its own filePau Espin Pedrol4-190/+238
Change-Id: I4fe457dc0ee1e904e05423557cfba2505b315a75
2023-09-29asp: Factor out helper function to match host in asp_peerPau Espin Pedrol1-25/+17
Change-Id: I6f13b285be09982ec83107ff96ade4dabf843815
2023-09-29cosmetic: src/Makefile: reformat to one item per linePau Espin Pedrol1-10/+43
Change-Id: I9efb883d2a56723300a66b7e13c7aa079f2e4600
2023-09-21sccp: Introduce initial support for SCCP LUDT + LUDTS messagesHarald Welte8-47/+433
* LUDT/LUDTS is now properly received and passed along to the app. * LUDT/LUDTS is now used if the data to transmit spans more than 255 bytes. Related: SYS#6566 Change-Id: Ic91abfc921f5e4f36045bfa325333112cddd9fa6
2023-09-21cosmetic: sccp_types.h: Fix typo in commentPau Espin Pedrol1-1/+1
Change-Id: Ia75502874e3a07dbd6b685a6721adaedb429e904
2023-09-21sccp2sua: Produce smaller output if msg contains no optional sectionPau Espin Pedrol3-6/+19
Change-Id: I5c8fcb30b76ac7bafd4a99bc3004049644e7e3f9