AgeCommit message (Collapse)AuthorFilesLines
2020-01-21examples/sccp_test_server: Log primitive name instead of valuePau Espin Pedrol1-6/+6
Change-Id: I956fa5989ca2dea46b2eaaf4e562c7962aa8be9d
2020-01-21osmo_sccp_simple_server(): use sccp instance index 0 instead of 1Pau Espin Pedrol1-1/+1
When using osmo_sccp_simple_client(), it will create an sccp instance if none exists. The sccp instance identifier starts with 0. The implicit created instance should use sccp instance 0 (the first connection). This is basically a counterpart of much older commit 3884eb68d9322967340d4f04e7382b2147ec7a2e, were same logic was applied to osmo_sccp_simple_client(). Change-Id: I85d2680ac65a552d7b2824ec41cd8fc669782079
2020-01-21examples/sccp_demo_user: Support reading log/vty config from filePau Espin Pedrol1-5/+27
Passing a config file is still optional, and both client and server work out of the box with providing any. It's still goot allowing to pass a config file to be able to configure easily stuff like logging, VTY ip address binding, etc. Change-Id: Ie75d004a0e9f24309060f241f22209df1bbe358e
2020-01-21example/sccp_demo_user: Use osmocom logging system instead of printfPau Espin Pedrol3-16/+27
Change-Id: I211eee8abdb332161be7a31e2864f254d1f51c66
2020-01-18sccp: Fix wrong param type in osmo_sccp_pnc_name()Pau Espin Pedrol1-1/+1
Wrong type was used when the function was introduced a few commits ago. Fixes: 5a7eb34f735e0ae93a74da3bc8361454457e49cdi Closes: CID#207712 Change-Id: Ie9b89483158dd6b988e4c34b497bf3b231c15cd3
2020-01-17sccp: Log missing user and router failure pathsPau Espin Pedrol2-0/+6
Change-Id: I36374e4419474c5ab43c9cca1b59f3054f93180b
2020-01-17sccp2sua.c: Log malformed SUA messagePau Espin Pedrol1-1/+4
Change-Id: Ie04371d27426011e1a1a4f9136e0b28bf33df03b
2020-01-17sccp: Support receiving messages with no optional paramsPau Espin Pedrol1-0/+6
Change-Id: I745bd32c62763ba2d88e74de8644c171ef506b37
2020-01-17sccp: Improve logging in sccp_to_xua_opt()Pau Espin Pedrol3-5/+40
Change-Id: Icb3f18f34ecfe0602c6e491b61107a30287dcafb
2020-01-17sccp: Convert ifelse to switch statementPau Espin Pedrol1-7/+8
Change-Id: I1f3129f5b949fc70913e8103ef17c696002b8ed2
2020-01-17examples/sccp_demo_user: log category name instead of its hex valuePau Espin Pedrol1-0/+2
Change-Id: I57afb4cacdb3c118c7570d924caa23144d192aa8
2020-01-17examples/sccp_test_server.c: Fix typo in log messagePau Espin Pedrol1-1/+1
Change-Id: I8456893b77624402645728ce9403847065a662eb
2020-01-17sccp: Avoid memleak of xua_msg receiving malformed sccp messagePau Espin Pedrol1-10/+49
first, xua_msg is allocated internally in the function. Then depending on msg type different functions are called. All of those functions either return the same input xua msg pointer or NULL. If they return NULL due to parsing failure, we need to free the internally allocated xua pointer. Change-Id: I4189fbd66e7e05ce466b3e716a357c56d788b64c
2020-01-17sccp: Add value_string for SCCP message typesPau Espin Pedrol4-1/+36
Change-Id: Ibf3ee4be88a4ca633a01fad08d4c714bfa9008bc
2020-01-16sccp: Fix null ptr access on malformed or unsupported msg receivedPau Espin Pedrol1-0/+6
Detected while running a TTCN3 sending malformed SCCP message in SCCP_Tests_RAW.ttcn: sccp_user.c:174:12: runtime error: member access within null pointer of type 'struct xua_msg' ASAN:DEADLYSIGNAL ================================================================= ==6==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000008 (pc 0x7f2a11f93c5c bp 0x7ffefcf05c50 sp 0x7ffefcf05c10 T0) #0 0x7f2a11f93c5b in mtp_user_prim_cb /tmp/libosmo-sccp/src/sccp_user.c:174 #1 0x7f2a11fb48f9 in deliver_to_mtp_user /tmp/libosmo-sccp/src/osmo_ss7_hmrt.c:94 #2 0x7f2a11fb4c8a in hmdt_message_for_distribution /tmp/libosmo-sccp/src/osmo_ss7_hmrt.c:133 #3 0x7f2a11fb5c90 in m3ua_hmdc_rx_from_l2 /tmp/libosmo-sccp/src/osmo_ss7_hmrt.c:275 #4 0x7f2a11f6f5c2 in m3ua_rx_xfer /tmp/libosmo-sccp/src/m3ua.c:586 #5 0x7f2a11f70480 in m3ua_rx_msg /tmp/libosmo-sccp/src/m3ua.c:739 #6 0x7f2a11faee35 in xua_srv_conn_cb /tmp/libosmo-sccp/src/osmo_ss7.c:1623 #7 0x7f2a0f46d082 (/usr/lib/x86_64-linux-gnu/libosmonetif.so.8+0xb082) #8 0x7f2a1186c0be (/usr/lib/x86_64-linux-gnu/libosmocore.so.12+0xc0be) #9 0x7f2a1186c735 in osmo_select_main (/usr/lib/x86_64-linux-gnu/libosmocore.so.12+0xc735) #10 0x557378718219 in main /tmp/libosmo-sccp/examples/sccp_demo_user.c:264 #11 0x7f2a105ad2e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0) #12 0x557378717059 in _start (/usr/local/bin/sccp_demo_user+0x6059) Change-Id: Idafa8c9693d98ecd214b62155372e4db69e2a4a4
2020-01-16sccp_demo_user: Bind VTY to -l local address cmdline argPau Espin Pedrol1-1/+1
Change-Id: Id93db4ea2865f3f2dbfc89890389ebd02fa8172b
2020-01-13ss7: Improve checks in osmo_ss7_asp_peer_add_host()Pau Espin Pedrol1-11/+17
* Introduce check to make sure we don't write out of peer->host bounds. * Clean up any/specific address checks, it should be more clear now. Change-Id: I3ecb94267acbec6ecf2134b08110f24f131cd8cf
2020-01-13ss7: Fix sccp_simple_server rejecting connectionsPau Espin Pedrol1-0/+12
Server addresses (and remote added ones) were not being copied to the ASP and hence connections were not matches against the ASP when connecting: osmo_ss7.c:1820 (r=<->l= m3ua connection without matching ASP definition and no dynamic registration enabled, terminating Related: OS#4355 Change-Id: I77d4f4d733cb46eaaacc7dc32259c9851c79d78e
2020-01-13ss7: Set ASP addresses using asp_peer APIsPau Espin Pedrol3-31/+14
Change-Id: I4736cb107a1987dab123744b98fb2b06a5e1167a
2020-01-13ss7: Introduce APIs to manage asp_peer hostsPau Espin Pedrol2-37/+67
The code managing addresses is decoupled from xua_server since they will also be used to manage addresses for ASPs. Change-Id: I4af2a6915ac57c7baa67343bd9414c65154d67f7
2020-01-13ss7: Return value from child function in osmo_ss7_xua_server_set_local_hostPau Espin Pedrol1-2/+1
It doesn't really change old behavior since it's impossible the child function returned an error with current implementation, but let's better return the return code in case new error paths are added. Change-Id: I24747578b3412b385c1ea1a14922f543f9023a27
2020-01-10sccp_demo_user: Change prompt to not include any '-' symbolsHarald Welte1-1/+1
It seems that our TTCN3 VTY/Telnet module no longer supports '-' inside prompts. Let's make sure the SCCP_Tests can again be executed by removing them from our promt name here. Change-Id: I4b6d7dd6fdf7521a4a9071e50ac1dcb2993c74bb
2020-01-09configure.ac: Check for sctp_recvmsg instead of sctp_sendPau Espin Pedrol1-2/+2
sctp_send is not used at all in libosmo-sccp. sctp_recvmsg is used though. Change-Id: Iac90c5f531a136fb3535404a6fdfd4c2d7a594aa
2020-01-08sua.c: Avoid double free in sua_rx_msg()->...->mtp_user_prim_cb()Pau Espin Pedrol2-12/+5
Old commit of mine successfully fixed a memory leak, but apparently after some more investigation it seems to have introduced a double free of xua object in other code paths. Nowadays, it seems scrc_rx_mtp_xfer_ind_xua() is called from 3 different places: mtp_user_prim_cb() sua_rx_cl() sua_rx_co() Before present patch, first caller is not freeing the xua message and my old commit made scrc_rx_mtp_xfer_ind_xua() free it (by passing ownsership of the object). But the other 2 callers do free the xua object afterwards (actually the grandparent caller sua_rx_msg() does it), which means it would double-free the xua object. Let's move ownership out of scrc_rx_mtp_xfer_ind_xua() and let the caller free the xua object (only changes need on the first caller). This way everybody is happy and we keep the free() closer to the alloc(). Change-Id: Ia550b781b97adbdc0a0ad58a1075e5467e056f1e Related: OS#4348 Fixes: 9c3baa89fb6b3fc1ef588930f361d013f98a1e39
2020-01-08Revert "fix memleaks in mtp_user_prim_cb()"neels2-1/+2
This reverts commit ffb248dd787eb854e049d990afc40f0e604268f2. Reason for revert: ttcn-msc-tests fail, apparently there are lots more xua_msg_free() in scrc_rx_mtp_xfer_ind_xua() that need to be dropped Change-Id: I008bcb6d5bad9e6347e7cd670159816f51331189
2020-01-07fix memleaks in mtp_user_prim_cb()Neels Hofmeyr2-2/+1
After dispatching to scrc_rx_mtp_xfer_ind_xua(), free the xua_msg. Do not free the xua_msg in any of the code paths triggered within scrc_rx_mtp_xfer_ind_xua(), i.e. remove xua_msg_free() from: sccp_scoc_rx_from_scrc() +->sccp_scoc_rx_unass_local_ref() +->tx_coerr_from_xua() +->tx_relco_from_xua() Before this, some code paths would free the xua_msg, while most code paths would not, causing mem leaks. Change-Id: I72b3c6a6f57ba32d9ba191af33b4b236492174e0
2020-01-02Bump version: → Espin Pedrol7-16/+101
Change-Id: Ibab643b971f80e3774c393ff3988a765dc081196
2020-01-02debian: Drop patches directory containing old patch not longer requiredPau Espin Pedrol2-30/+0
Change-Id: I8e518a28cc54f42ff3e7e9205eefbce3a1d67d9d
2019-12-17ASP: Stop re-transmitting un-acknowledged messages on SCTP down eventHarald Welte1-0/+2
We don't want to attempt to re-transmit if we lost the connection: DLSS7 <000c> xua_asp_fsm.c:251 XUA_ASP(asp-client0){ASP_DOWN}: T(ack) callback: re-transmitting event ASPSM-ASP_UP DLSS7 <000c> osmo_ss7.c:1833 0: asp-asp-client0: Cannot transmit, asp->client not connected DLSS7 <000c> xua_asp_fsm.c:251 XUA_ASP(asp-client0){ASP_DOWN}: T(ack) callback: re-transmitting event ASPSM-ASP_UP DLSS7 <000c> osmo_ss7.c:1833 0: asp-asp-client0: Cannot transmit, asp->client not connected DLSS7 <000c> xua_asp_fsm.c:251 XUA_ASP(asp-client0){ASP_DOWN}: T(ack) callback: re-transmitting event ASPSM-ASP_UP DLSS7 <000c> osmo_ss7.c:1833 0: asp-asp-client0: Cannot transmit, asp->client not connected DLSS7 <000c> xua_asp_fsm.c:251 XUA_ASP(asp-client0){ASP_DOWN}: T(ack) callback: re-transmitting event ASPSM-ASP_UP DLSS7 <000c> osmo_ss7.c:1833 0: asp-asp-client0: Cannot transmit, asp->client not connected DLSS7 <000c> xua_asp_fsm.c:251 XUA_ASP(asp-client0){ASP_DOWN}: T(ack) callback: re-transmitting event ASPSM-ASP_UP Change-Id: Ic8da646d22d3120121d9af43a890762a879f9d74
2019-12-17ASP FSM: Permit DOWN -> DOWN "transition"Harald Welte1-1/+2
let's avoid messages like DLSS7 <000c> xua_asp_fsm.c:600 XUA_ASP(asp-client0){ASP_DOWN}: transition to state ASP_DOWN not permitted! Change-Id: Iabbcf92e3022a4c3f165ce19be929915f92b455c
2019-12-17stp: exit(2) on unsupported positional arguments on command lineHarald Welte1-0/+5
Change-Id: I70390948943fe42469b8c6d63babc232e857e60c
2019-12-12osmoappdesc.py, tests: switch to python 3Oliver Smith2-17/+17
Make build and external tests work with python3, so we can drop the python2 dependency. This should be merged shortly after osmo-python-tests was migrated to python3, and the jenkins build slaves were (automatically) updated to have the new osmo-python-tests installed. Related: OS#2819 Depends: osmo-python-tests I3ffc3519bf6c22536a49dad7a966188ddad351a7 Change-Id: I344c49001fba23bdcfdef06ab174c52b60edd01c
2019-12-11gitignore: add various generated doc filesOliver Smith1-0/+3
Change-Id: I14eac5a1e7bc5ff202fc57d76c1b84d4e0050ca8
2019-12-02xua_asp_fsm: Ensure xUA client includes routing contexts in ASPAC/ASPIAHarald Welte1-0/+26
If we are running in ASP (client) role, and we are about to transmit an ASPAC or ASPIA to the SG, we must make sure to include any applicable routing contexts. Change-Id: Iee4f0d553d6845a9ae08cb5e4f57fdec443e4ef9 Related: OS#4285
2019-12-02xua_asp_fsm: Ensure xUA client includes traffic-mode if configuredHarald Welte1-0/+31
When a client (ASP) sends an ASPAC to the server (SG), it should include the traffic-mode configured for it's ASs, if any. Change-Id: Ia850df22df529dab74959e8666f85976002c482c Related: OS#4285
2019-12-01check for osmo_fsm_register() failures and propagate errorHarald Welte5-9/+22
Change-Id: Id8861144e4880383a173b7e6ae7860beebac09d9
2019-11-28Skip dynamic ASPs when writing the list of ASPs in an ASHarald Welte1-0/+3
we handle this correctly in not writing the actual "asp" configuration, but we have a bug when writing the list of asps within one "as". Let's make sure to skip the dynamically-created ASPs there, too. Change-Id: I1a184f3ddec2e91ced8c95ada224da8b490407a8 Closes: OS#4284
2019-11-20xua: Implement traffic mode broadcastPau Espin Pedrol1-3/+21
Change-Id: I4358965f0ff0aa05c5082a2745159da766e9a4e7
2019-11-19fix generating asp-role that can be parsed when re-opening config fileHarald Welte1-1/+1
The ASP role must be saved in lowercas as the parser during config file reading only understands it in lowercase. Change-Id: I38b8e4d73121f8bf001037fdd2dd164113544d94 Closes: OS#4270
2019-11-19asp: Don't override ASP and SCTP role when re-entering asp nodeHarald Welte1-5/+8
The code to set the default role (SG) and default SCTP role (server) must only be executed when the ASP node is first created. Subsequent times entering the pre-existing ASP node should not overwrite those role settings [or any other configuration for that matter] Change-Id: I068996a5e0d870043b652fb69a3c300adc6fda7c Closes: OS#4271
2019-11-19osmo_ss7: Add osmo_ss7_asp_find()Harald Welte2-0/+22
This is like osmo_ss7_asp_find_and_create(), i.e. it's doing a full match for an ASP within the specified SS7 instance, of the specified port numbers. It just doesn't create it if it is missing. Change-Id: I1ed3cf2b69ee622d6f9d8b50487f392fe913ae90 Related: OS#4271
2019-11-19Don't forget to store the sctp-role during writing config fileHarald Welte1-0/+2
Related to Change-Id I7452a862d45da35dcd58654ca17222eb52d26f1f Related: OS#2005 Change-Id: I14835a7cf137e9d1fe9757a4ec57358dc578446e
2019-11-14osmo_ss7_vty.c: implement 'active' filter for show_cs7_as_cmdVadim Yanitskiy6-9/+20
Change-Id: I356d90642a500be6a70f60c8240ce1211fd0d934
2019-11-12xua: Avoid multiline log in xua_msg_dump()Pau Espin Pedrol2-54/+15
In general we want to avoid multiline log messages since they make parsing more difficult. Also output in VTY over telnet looks strange (indentation incremented at each new line). Change-Id: Id9084d0e0f976bb374186db93d6ff8062b99e238
2019-11-12ss7: Set correct local addr and port during dynamic ASP creationPau Espin Pedrol1-2/+5
Change-Id: I54aada351d5fb74f5015fdfe691d0b237354743c
2019-11-12ss7: Improve log formatting during ASP restartPau Espin Pedrol1-2/+2
Since it may act sometimes as a server and sometimes as a client, let's better use one more neutral (2-side arrow) connector, and mark which address is the local and which is the remote. We already use same formatting in other osmocom code. Change-Id: I42feaa16790f02b98bcda65281de8cd9295ddcb6
2019-11-12xua: ipa_asp_fsm: Allow receiving IPA ID ACK before IPA ID RESPPau Espin Pedrol1-1/+16
Since there's no official spec for IPA and some implementations seem to like sending the IPA ID ACK before the IPA ID RESP, let's catch it and feed it after we receive the IPA ID RESP and we are in correct state. Otherwise the connection would deadlock during the initial handshake. That's the case with our TTCN3 IPA implementation running STP_Tests suite. Change-Id: I99f5346a3854ca07979020245897334197f3cd3b
2019-11-12xua: ipa_asp_fsm: Allow moving ASP to inactive statePau Espin Pedrol1-1/+26
If AS is configured with Traffic Mode Override, then if a new ASP becomes active, all previous ASPs are considered to be inactive and new data is sent to the newly activated ASP. Remark: It's still unclear which methodology/implementation will follow when the last activated ASP becomes inactive/shutdown. Then probably another one should be activated at that time, but that logic is not there implemented as far as I know. Change-Id: I4ff246b2f899aaa3cf63bbdb3f3d317dc89b3d15
2019-11-08xua: Don't send NOTIFY messages to IPA ASPsPau Espin Pedrol1-2/+4
Change-Id: Ice3d948e4d2f57a8f52cfb93792d5f4d23284b96
2019-11-08ss7: Set ASP default remote addr to if none set in VTYPau Espin Pedrol1-0/+5
Similar to what we do with local address. Should fix creating the stream when no remote address is provided on an ASP configured through VTY. Related: OS#4260 Change-Id: I33672e76a51a5d5a483906749d30e4c4e08b66ce