Otherwise when configuring ss7 instances in numerical order in the VTY
and then printing the VTY configuration they end up ordered this way:
cs7 instance 2
cs7 instance 1
cs7 instance 0
Related: SYS#5912
Change-Id: Id4d0a20cc5b0811b505b2d1051d496f8bd17d54c
When introducing rate_couters, I forgot to call
rate_ctr_group_free(). I thought free'ing the parent object
via talloc is sufficient, but that obviously misses the point that
rate_counters have an internal linked list from which they must be
unlinked.
Change-Id: I8d27f025c22776d0153d867e36c073ef716eb974
This avoids log messages like
DLGLOBAL <0016> rate_ctr.c:92 'sigtran.as' is not a valid counter group identifier
Change-Id: I08666a1c3c1345cd3b0e55d544f6ac4a6df62fbf
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
Allow user apps to relay the decision of proper default local/remote
hosts values to the library. Proper configuration of these addresses can
be quite cumbersome to get correctly, or confusing at least. That's due
to the multi-homing feature of SCTP where both IPv4 and IPv6 are
involved.
We were already doing this kind of automatic setup in
osmo_ss7_vty_go_parent(), where we do validations and assign addresses
based on IPv6 availability.
On the other hand, apps using osmo_sccp_simple_client_on_ss7_id() API
usually pass "localhost" as default address. In Linux, when IPv6 is enabled
localhost is resolved as "::1", and "127.0.0.1" when IPv6 is disabled.
Let's instead allow apps to relay the setup to the lib, so same addresses
can be applied both during VTY command as well as if there was no VTY
setup at all.
Related: OS#5186
Change-Id: I82e203612571b7651d758d8148661f706a1642ba
It's confusing to keep around a string representation of what peer the
socket was previously connected to.
Change-Id: I00d47fc355bfe24915653767ad75c1f491c060d5
Otherwise we run into the problem that a route with mask 0xffffff
differs from one with a mask of 0x3fff despite having only 14 bit
point code length and them being logically equal.
Change-Id: I5d5c828de45724d93a0461bb0dd7858fd8378acd
Related: SYS#5422
The xua_srv_conn_closed_cb() function is shared/generic. Let's simply
write "connection closed" to avoid any confusion. As the ASP name is
printed, it should be clear which L4 protocol was used.
Change-Id: I506ccc2665a6b0af0fde3961e7e7937af7a81219
A DUPU message in SUA and M3UA indicates the unavailability of
a (MTP-level) user, i.e. the entire SCCP, ISUP, ... is not available.
If we receive a DUPU (destination user part unavailable) message in ASP
role, then we must
* distribute it to any other ASPs for which we operate in SG mode
* pass it as MTP-STATUS.ind to SCCP, which can then generates
N-PCSTATE.ind to the SCCP User
Change-Id: I1559ed0f761a8495b222df48c6bd43798e220471
Until now, host list validation was only taking into account a set of
ipv4-only addresses. As a set can contain now IPv4 and Ipv6 addresses at
the same time, we need to do ANYADDAR validation against addresses of
that specific version inside the set.
Change-Id: I18f3cc59149d478259d7afc456bdc5213c1406e5
In I9b3ae6dfcf6efeabb7fb6c33503d1d7924fec2fa we fixed some problems
regarding rapid open/close cycles of inbound M3UA client connections.
Unfortunately the fix now triggered another bug.
xua_srv_conn_closed_cb() is called by libosmo-netif stream code whenever
a connection (socket) is closed. As the stream_server is de-allocated
right after this call-back, the call-back must make sure to remove
any pending references to the stream_server.
Change-Id: I2464cf524f1f91bfad10ff1861a03bf1461dfed8
Related: OS#4625
When a client closes and instantaneously re-opens a SCTP socket for an
M3UA connection, there is a chance that both the "shutdwon event" (old
connection socket becomes readable for sctp event) and the "init event"
(listen-fd becomes readable) happen during the same scheduler interval /
select() cycle. As there is no guaranteed order by which we call our
file descriptor callbacks, it means that we may end up processing
then new connection (accept) before we get the notification that the
old one is dead.
The fact that the fd number of the accept-fd is mostly lower than the fd
number of the individual per-client connection actually makes it likely
that the order is exactly the opposite of what would feel "logical".
As the ASP is identified by the tuple of (src-port, src-ip, dst-port, dst-ip),
both the old connection and the new connection map to the same ASP
object. So we need to handle this situation gracefully: If we get a
new connection for a tuple that we already [think we still] have one,
close the old one and use the new.
Change-Id: I9b3ae6dfcf6efeabb7fb6c33503d1d7924fec2fa
Closes: OS#4625
* 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
The code managing addresses is decoupled from xua_server since they will
also be used to manage addresses for ASPs.
Change-Id: I4af2a6915ac57c7baa67343bd9414c65154d67f7
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
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
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
Most likely, we want all dynamically allocated ASPs to play the SG
role by default. Otherwise when using the following configuration:
cs7 instance 0
xua rkm routing-key-allocation dynamic-permitted
listen m3ua 2905
accept-asp-connections dynamic-permitted
both OsmoMSC and OsmoBSC fail to establish connections.
Change-Id: Ib904ecf0e5d192a1024863f6f0fdf79301055655
Fixes: I2df9cd9747ad5c9a05d567d9a71bab6184c53674
Related: OS#4247
So far, we had a static role model:
* SCTP servers (listening, such as OsmoSTP) are role SGW
* SCTP clients (connecting, such as OsmoMSC) are role ASP
While this is customary, it is not actually required by the
specification. The SGW can establish the SCTP connection to an ASP
but still remain "SG" role.
Let's make things more flexible by having the role configurable.
Related: OS#2005
Change-Id: I2df9cd9747ad5c9a05d567d9a71bab6184c53674
If the AS is e.g. configured as broadcast, then individual ASPs cannot
be activated in loadshare or override. Everyone must agree.
Change-Id: Ic73410fbc88d50710202453f759fa132ce14db4c
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
This function is used for both actual SIGTRAN (M3UA, SUA over SCTP)
as well as for IPA/SCCPLITE (over TCP). Having a static "SCTP"
string in the log lines is confusing.
Change-Id: Ic34ddbcd528cd871d9772665e1d0863896f33203
If no IP addr is assigned yet, until know it'd print "(:3456". Let's
print ":34456" in that scenario.
Change-Id: Iae85d231093b6f3ce6b969324699858e525c14ea
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