Commit Graph

12 Commits

Author SHA1 Message Date
Max 6e8241356b SS7: do not attempt transfer if AS is down
The attempt to route message via AS which is down will fail anyway:
let's make it explicit.

Add osmo_ss7_as_down() and use it to check AS state before transferring the message.

Change-Id: I0d5f3b6265e7fdaa79e32fbc30f829ef79e7dad1
2023-02-21 08:51:22 +00:00
Harald Welte ff7404c742 stp: Add basic RX/TX rate counters on AS and ASP level
This adds some very basic rx/px rate counters to the SS7 AS and ASP

OsmoSTP> show rate-counters
SIGTRAN Application Server 0 (as-rkm-1):
             rx:msu:total:      86078 (1888/s 86078/m 0/h 0/d)
             tx:msu:total:          0 (0/s 0/m 0/h 0/d)
SIGTRAN Application Server Process 0 (asp-dyn-0):
         rx:packets:total:      86081 (1888/s 86081/m 0/h 0/d)
         tx:packets:total:          5 (0/s 5/m 0/h 0/d)

Change-Id: Idb811ca81adfe47152d484f6b981e661dc569e15
2021-11-15 18:05:01 +01:00
Neels Hofmeyr 16676cf05a cosmetic: hmrt_message_for_routing(): use osmo_ss7_route_name()
Change-Id: Iae524c38cd91383a59c64bf7919d94ba7ff350bd
2017-12-24 21:21:55 +01:00
Neels Hofmeyr 8800b7cf9f add osmo_ss7_route_name()
There is a naming dilemma: though the osmo_ prefix is now reserved for
libosmocore, all surrounding API already has the osmo_ prefix.

This will be used by osmo-hnbgw's VTY 'show cnlink' command.

Change-Id: Ia0d15a2814b08bc3f052a1ed12dbb68bade55309
2017-12-24 20:32:03 +01:00
Harald Welte b393b3f4cc Add SPDX-License-Identifier + missing copyright statements
Change-Id: I113232bbeaa7a835871df7f9b883ba573d8a2534
2017-11-13 01:25:47 +09:00
Neels Hofmeyr 3468d5dce4 add/tweak various logging to help figure out complex routing
Add function osmo_ss7_point_code_print2() to be able to print two point codes
in the same log message.

Change signatures of two static functions to aid logging:
add invalid ref arg to sccp_scoc_rx_inval_src_ref(),
pass conn instead of inst to sccp_scoc_rx_inval_opc().

Change-Id: Ia3243606d6cad7721f7da7f6caba2caa90ae2bbd
2017-06-25 22:35:01 +02:00
Harald Welte 023d4f962b m3ua_to_xfer_ind(): don't use data_ie without checking it exists
Change-Id: I5f7551e49c1b4ea417bee3516da1b2ece5ee0699
Fixes: coverity CID#166941
2017-04-27 12:06:23 +02:00
Harald Welte 48c72f1f5c deliver_to_mtp_user(): Fix null pointer dereference
We had used + derefernced the 'prim' pointer before checking its
validity.

Change-Id: I0ca5026091e91926924b297f9342bda5f9fd38c9
Fixes: coverity CID#166946
2017-04-27 11:50:51 +02:00
Harald Welte 5f0a8df34c Add IPA/SCCPlite support as SIGTRAN alternative
This tries as good as possible to fit the IPA/SCCPlite stacking into the
existing SIGTRAN/SS7 code architecture/model.  To the user, the IPA
protocol looks like yet another protocol on the same level as the choice
between SUA and M3AU.  On the inside, things are obviously quite
different.

We need to handle TCP with IPA framing instead of SCTP for both server
and client.  We also implement an alternative "ASP FSM" for IPA, which
takes care of the CCM handshake (ID_REQ/ID_RESP/ID_ACK/ID_ACK2) for both
client and server mode.

In server mode, we use the 'unit name' as identifier to look up the AS,
similar to how we use a routing context to look up the AS in the xUA
case.

We also have to bypass activating the default layer manager in the
simple client to make sure we don't run into even more complexity.

What's missing right now is some way to manually override/set the point
codes.  As IPA/SCCPlite is missing any routing label, we currently
simply generate one with SPC=0/DPC=0, which will obviously not work in
most configurations.

Change-Id: I9098574cddeba10fcf8f1b6c196a7069a6805c56
2017-04-18 10:08:25 +00:00
Harald Welte 3a09645ca6 m3ua: Generalize + Export function to generate MTP-TRANSFER xua_msg
Change-Id: If82956317ec703341514ad81057eceb3d0714f47
2017-04-15 23:01:13 +02:00
Harald Welte c860f9a41e sigtran: fix various memory leaks (msgb and xua_msg)
The general rule for 'struct xua_msg' is now that it is free'd by the
function that also allocates it in the first place.  Any downstream
consumer of the xua_msg may interpret it, but not hold any references or
free() it.

Change-Id: I708505d129da5824c69b31a13a9c93201929bada
2017-04-10 11:48:35 +02:00
Harald Welte 2d3a709527 Add new 'osmo_ss7' SS7 core code with M3UA, ASP/AS FSM, ...
This is what aims to be a rather complete/proper implementation of the
SIGTRAN + SS7 protocol suite.  It has proper abstraction between the
layers with primitives, finite state machines for things like the AS and
ASP state machines, support for point code routing, etc.

What's not implemented at this point:
* re-integration of pre-existing SUA (pending)
* actual MTP2 and physical E1/T1 link support
* different trafic modes like broadcast/fail-over/load-balance

Change-Id: I375eb80f01acc013094851d91d1d3333ebc12bc7
2017-04-10 10:41:16 +02:00