Commit Graph

34 Commits

Author SHA1 Message Date
Vadim Yanitskiy 0e065be375 {examples,stp}/Makefile.am: fix typo in $(COVERAGE_[C]FLAGS)
Change-Id: I8dc7119765df97f44a6f2c5d6eecec847fcc46dc
2023-03-13 10:54:34 +00:00
arehbein 41089524a3 Transition to use of 'telnet_init_default'
Related: OS#5809
Change-Id: Icc57c68337d55c6594c1c36e9bf41624d11dab0a
2023-02-28 10:32:07 +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
Pau Espin 685816f97f stp: generate coredump and exit upon SIGABRT received
Previous code relied on abort() switching sigaction to SIG_FDL +
retriggering SIGABRT in case the signal handler returns, which would
then generate the coredump + terminate the process.
However, if a SIGABRT is received from somewhere else (kill -SIGABRT),
then the process would print the talloc report and continue running,
which is not desired.

Change-Id: Idca8e360968cb6998591737348ce520954e251b2
Fixes: OS#4865
2021-02-23 17:40:46 +01:00
Harald Welte 6d8d9b3ced main: add --vty-ref-mode, use vty_dump_xml_ref_mode()
Change-Id: Ia5abf7457ee7e97ec3fcd5520e5ef82ef808667a
Related: OS#5041
Depends: Ie2022a7f9e167e5ceacf15350c037dd43768ff40
2021-02-23 17:20:08 +01:00
Harald Welte 48e2988539 update VTY / copyright message
* extend year to 2020
* Pau and Vadim have contributed significatnly
* fix typo (ot -> to)

Change-Id: I5c23e704dd958faf450b2427ff706ac65d4848f4
2020-11-11 20:46:45 +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
Harald Welte 6e054bf661 stp: exit(2) on unsupported positional arguments on command line
Change-Id: I70390948943fe42469b8c6d63babc232e857e60c
2019-12-17 15:02:28 +01:00
Harald Welte a4555c3430 check for osmo_fsm_register() failures and propagate error
Change-Id: Id8861144e4880383a173b7e6ae7860beebac09d9
2019-12-01 17:36:50 +01:00
Pau Espin 38ae954da5 Defer xua server binding until exit of VTY node
Commit 10d4815bb1 already fixed the issue
where binding was done during L_CS7_XUA_NODE (listen) done, meaning
local-ip inside it had no effect. In that comment, binding was moved to
happen during "local-ip" VTY cmd. Furthermore, that commit added a new
osmo_ss7_bind_all_instances() and related APIs to allow osmo-stp to have
all xua servers bound if no "local-ip" was provided.
These APIs have only been used so far by osmo-stp (which lays in the
same git repo that libosmo-sccp) since it's the only program using the
xua server features.

In the present commit, let's drop the APIs added by commit described
above, and instead let libosmo-sccp code to internally bind the xua
server upon exit of the VTY node. As a result, the previously introduced
APIs can be dropped (not used by anyone anymore) and it will provide
ways to support multiple "local-ip" commands in the future, hence
supporting SCTP multi-home features.

It's recommended to require libosmocore.git Ia6d88c0e63d94ba99e950da6efbc4c1871070012
since it fixes a bug where go_parent_cb was not called for nodes at the
end of the file.

Related: OS#3608
Change-Id: I2cff17b5e2e2fbfd4591e23a416e510e94e173d6
2019-10-22 19:38:53 +00:00
Pau Espin 2728abf9d9 Remove undefined param passed to {logging,osmo_stats}_vty_add_cmds
Since March 15th 2017, libosmocore API logging_vty_add_cmds() had its
parameter removed (c65c5b4ea075ef6cef11fff9442ae0b15c1d6af7). However,
definition in C file doesn't contain "(void)", which means number of
parameters is undefined and thus compiler doesn't complain. Let's remove
parameters from all callers before enforcing "(void)" on it.

Related: OS#4138
Change-Id: Iedd11f816002b686f0ddb54c0cf7ba4e229e21e3
2019-08-05 14:47:06 +02:00
Kira Obrezkova 2164784670 This patch fixes typos on which Lintian complains
Change-Id: I657c694a9a7474182a97f90aa8424403ca9c58db
2019-07-17 10:56:37 +00:00
Vadim Yanitskiy 5227207506 osmo-stp: expose root talloc context to the VTY code
In Id0789c4946929b783c54220de439958001f94992 I introduced the VTY
commands for talloc-context introspection, but forgot to expose
the root talloc-context.

Change-Id: Id2bf6cdae112f9791c93411c1837de488cab9ee3
2019-05-11 00:20:02 +07:00
Vadim Yanitskiy efcaff0b80 osmo-stp: register VTY commands for talloc context introspection
Change-Id: Id0789c4946929b783c54220de439958001f94992
2019-05-10 03:06:54 +07:00
Harald Welte d6cc1294e2 stp: Ensure telnet uses STP talloc context, not NULL context
Change-Id: I38a9538dc93cdcecbeb236f0eadc3d675cf20b5d
2019-05-09 10:34:23 +02:00
Max 5b5c1ed63c OsmoSTP: enable statsd support
Change-Id: I5309ae44e5b9eda1a5dd1bbf10db5ffdff1fa9cd
2019-02-18 13:33:28 +01:00
Neels Hofmeyr b5188f0169 osmo-stp: add SCCP related VTY commands
Call osmo_sccp_vty_init(), so far forgotten.

This adds the various 'show cs7 instance N sccp *' commands, as well as making
the SCCP timers configurable.

See Id941b8e31d3b4cfdb3f912beedc1e7af321a0113 for a diff of the VTY reference,
showing what commands are enabled by this patch.

Change-Id: I66e97706de0c546db3c6ff77fb5e6ac6e32bff55
2018-11-18 20:06:37 +00:00
Pau Espin 7e3476dc76 use osmo_init_logging2
Change-Id: I0d45b9381125c496a691ac5da68190b7b3479fc3
2018-04-17 14:22:36 +02:00
Neels Hofmeyr d23e38020f typo: osmo-stp main: 'Erro'
Change-Id: Ibb28f48b46a4b86c62770b4d22dcf735717aeadb
2017-12-24 20:32:03 +01:00
Pau Espin 10d4815bb1 ss7: Re-bind xUA server socket after setting new IP
In osmo-stp, cmd "local-ip" inside node "listen m3ua 2905" was actually
not being applied, because the server was created + bound at "listen" command
time using NULL as IP, and at "local-ip" time the IP was changed but the
server was not re-bound using the new IP, so it kept listening at
0.0.0.0.

With this patch, we defer binding the socket to "local-ip" cmd time,
after the IP has been applied.

As a result, if no "local-ip" command is provided, then the bind never
happens, which means it is now mandatory that users of osmo_ss7_xua_server_create
API not using osmo_ss7_xua_server_set_local_host call new provided API
osmo_ss7_xua_server_bind. Another new API osmo_ss7_bind_all_instances is
provided to easily make sure all servers are bound after configuration
process. This is specially important for servers which doesn't contain
the "local-ip" parameter.

Users of osmo_sccp_simple_server API are not affected by this change,
and they not requrie to call any new API.

Furthermore, using osmo_ss7_xua_server_bind in VTY code ensures the xUA
server is automatically bound to the new address if the operator changes
the "local-ip" cmd at runtime.

Related: OS#2647

Change-Id: I79738963d633bec70705ff159c5b2127cd498aa2
2017-12-20 16:04:08 +00:00
Harald Welte 3c1e65023a osmo-stp: Align prompt formatting with other Osmocom programs
In all other Programs we have the VTY like OsmoBSC, OsmoMSC, etc.
so let's make sure osmo-stp also uses OsmoSTP and not osmo-stp.

Change-Id: Ic91010779ad22c41e28ed4cf43c2e3ab679214b5
2017-11-12 08:21:54 +09:00
Harald Welte d8552d7011 osmo-stp: Fix process termination on SIGINT+SIGTERM
In commit eed8c1bfae we introduced
some singal handling code for (among others) SIGINT and SIGTERM.

This code causes the process to hang rather than terminate, as it
only dispatches a signal that nobody handles yet in libosmo-sccp.

Until a proper implementation is made, let's terminate the process
as expected.

Change-Id: Iff79c8ac0b347660333912c9258073a013ea799b
2017-08-31 20:25:52 +02:00
Harald Welte eed8c1bfae OsmoSTP: Install our default set of signal handlers
Change-Id: Id5e37dc35923fd689e2cecd9923154774efd7f51
2017-08-20 20:57:09 +02:00
Neels Hofmeyr 41b6803fd5 osmo_ss7_vty_init: ensure a talloc ctx is set by user
Drop the separate osmo_ss7_set_vty_alloc_ctx() because we are likely to forget
calling it. Instead, incorporate into osmo_ss7_vty_init_*() with a new ctx arg,
and set the static context var in vty_init_shared().

Change-Id: Id4e7f47979001f7856b0b3665c9e94982e75e490
2017-08-07 16:04:39 +02:00
Pau Espin 2abc1d5c7f stp_main.c: Add missing header
stp_main uses osmo_fsm_vty_add_cmds which is defined in /osmocom/vty/misc.h

Fixes 'implicit declaration of function' compilation warning.

Change-Id: I3cc9543fcb908eeb172d36fa472a19b01bf52c46
2017-06-22 06:23:04 +00:00
Harald Welte 65daa7f064 stp: Install VTY commands for FSM introspection
Change-Id: I4ee881715e874eaed3cca6ac42db21260123306a
2017-04-27 10:12:56 +02:00
Harald Welte 975a2c81e0 osmo-stp: Add command line options and daemonize functionality
Change-Id: I267fbe2e5c774960f0b63cfdd9f60df121b4934d
2017-04-14 17:11:21 +02:00
Harald Welte bc4257867b osmo-stp: Remove hack to always enable debug logging
... and rather use the config file based logging configuration, like
other osmocom programs, too.

Change-Id: I7e0fb869bd778d8c276dc8afd16ecd7f1965b74a
2017-04-14 17:11:21 +02:00
Harald Welte acb914d54b stp: Add copyright notice
Change-Id: I4e074f570eac2e6a0a761f9f5f9c35fa4afa0315
2017-04-14 17:11:21 +02:00
Harald Welte 8b282e954a move osmo_ss7_vty.c [back] into libosmo-sigtran
Now that the VTY has no static dependencies like a global ss7_instance
anymore, we can move it back to libosmo-sigtran and make use of it in
other programs outside osmo-stp.

This requires Change-Id I184a7e3187b48c15c71bf773f86e188fe1daad15 in
libosmocore

Change-Id: I2e549f1eadbfb28dde79f620b130cbf022312c42
2017-04-14 14:53:59 +02:00
Harald Welte 355bee1345 osmo_ss7_vty: Merge the SUA and M3UA VTY nodes
The xUA servers have pretty much everything in common, there's no point
in introducing a separate VTY note for each xUA flavor.

Change-Id: I5b842b7f10d94957398cf0c0406c440c495a0bdc
2017-04-14 14:53:59 +02:00
Harald Welte 57620b6b98 STP: re-structure VTY interface; introduce 'cs7 instance' node
This properly integrates the concept of multiple SS7 instances (each
with their own point code format, address indicator, ...) into the VTY.
At the same time, this also removes the stp-global "g_s7i" instance
that existed so far, moving the VTY code more into the direction of also
being able to be used outside the STP - which is underlined by splitting
the vty commands between those generally useful, and those useful only
for a STP or only for a simpla ASP (client).

Change-Id: I30966fbf2e143318cd9127eb8c17cccb24407106
2017-04-14 14:53:59 +02:00
Harald Welte 51302c883c osmo_ss7_vty: 'show' commands for AS, ASP, route
Change-Id: Ideb74c9396e5385f6a7c30ff8608d34ededa1f4d
2017-04-13 18:05:13 +02:00
Harald Welte 9654e65feb Add osmo-stp executable as new "Osmocom Signaling Transfer Point"
osmo-stp is able to define multiple M3UA and/or SUA application servers
(AS) as well as application server processes (ASPs).  Clients can then
connect via M3UA or SUA, perform the respective ASPSM / ASPTM state
changes and finally exchange MTP signaling such as ISUP or SCCP on top
of it.  Routing is currently only based on point codes (PC).  Routing table
is fully configurable with Destination PC and mask.

Shortcomings:
* xUA: only "override" traffic mode supported, no load-balance or broadcast
* xUA: no SNM supported, i.e. DAVA/DUNA/... messages are neither parsed
  nor generated
* SCCP: no Global Title based Routing (GTR) yet
* SCCP: no Global Title Translation (GTT) yet
* no M2PA / M2UA sigtran dialects
* no classic CS7 based signaling links(E1/T1 TDM)

Change-Id: If32227b8d3127c6178e4ee45527ce65f69bc7b1e
2017-04-13 18:05:01 +02:00