Commit Graph

34 Commits

Author SHA1 Message Date
Max e7228dbdd2 examples: update vty code
* document optional data parameter
* use argc to check for optional parameter presence

Related: OS#5579
Change-Id: I52d0823b7843aa61594e728a0fac19d884ff78fe
2022-08-22 20:33:12 +07:00
Max bb760c5915 SIGTRAN: add osmo_sccp_tx_disconn_data() helper
SCCP RLSD message might have up to 130 bytes of optional data according to ITU-T Rec Q.713 §4.5 - add helper which
allows sending it and use it in example code.

Related: OS#5579
Change-Id: I92ae22d2cab5863245fba3d904a300055fda34fe
2022-08-22 20:33:12 +07:00
Max 196ddcbb05 SIGTRAN: add function to check connection existence
Add convenience helper to check if particular connection ID exists and use it to
properly report errors when attempting to send messages over non-existent connections.

Change-Id: Iffedf55b4c292ee6b2f97bcdeef6dc13c050ce01
2022-08-22 18:36:51 +07:00
Max 43d7455089 Add basic readme for example code
Related: OS#5579
Change-Id: I4c76a48a76ca9afc960ea2f08229bacc79b6fe77
2022-08-21 21:53:40 +07:00
Max 12e76b8859 cosmetic: improve usage help of example code
* document -C option for example server
* move misplaced comma
* drop empty #define from example code

Change-Id: I342dc227afbfe6c3540eb3285677c568d2fe3166
2022-08-17 11:27:25 +07:00
Harald Welte 218789e833 sccp_demo_user: enable stats / rate_counter timers
Change-Id: I135704d401de2cf439e51882e22323b31db14a2a
2022-02-24 20:40:24 +01:00
Harald Welte a1bf0c96ec sccp_demo_user: Allow user to specify logmask on command line
Change-Id: Ie1cf37b3501e26330b038b7ee17a5273d81c92d8
2022-02-24 20:40:24 +01:00
Harald Welte 3424c5ed99 sccp_demo_user: make sure the command-line specified point codes are used
Change-Id: I983066199e5d8f056895fdad370e3b4439b4dba4
2022-02-24 20:40:24 +01:00
Harald Welte d8c7a40a60 sccp_demo_user: Add 'show stats' to VTY
this allows us to inspect statistics of the demo user via VTY

Change-Id: Ica48d4e0c9cedb9adb94ae08c5201207b8836e1c
2022-02-24 20:40:24 +01:00
Harald Welte d0cd3157b7 sccp_demo_user: Add command line argument to specify protocol (m3ua/ipa)
Change-Id: Iecb03df43709903b1cfe248e68d6624b995c563d
2022-02-21 22:27:57 +01:00
Pau Espin c6a04b17a2 examples/sccp_test_server: Log disconnect indication in echo service
Change-Id: I221519e75800c8bfbe68e24d04913b0c385c521d
2020-01-21 10:53:34 +01:00
Pau Espin 7c441e2067 examples/sccp_test_server: Log primitive name instead of value
Change-Id: I956fa5989ca2dea46b2eaaf4e562c7962aa8be9d
2020-01-21 10:53:32 +01:00
Pau Espin 5663db37a3 examples/sccp_demo_user: Support reading log/vty config from file
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-21 10:52:47 +01:00
Pau Espin ed1a2b3680 example/sccp_demo_user: Use osmocom logging system instead of printf
Change-Id: I211eee8abdb332161be7a31e2864f254d1f51c66
2020-01-21 10:52:39 +01:00
Pau Espin 4b3cbccae7 examples/sccp_demo_user: log category name instead of its hex value
Change-Id: I57afb4cacdb3c118c7570d924caa23144d192aa8
2020-01-17 14:38:26 +01:00
Pau Espin 4706c40ef6 examples/sccp_test_server.c: Fix typo in log message
Change-Id: I8456893b77624402645728ce9403847065a662eb
2020-01-17 14:38:26 +01:00
Pau Espin 07b79bd91e sccp_demo_user: Bind VTY to -l local address cmdline arg
Change-Id: Id93db4ea2865f3f2dbfc89890389ebd02fa8172b
2020-01-16 15:33:09 +01:00
Harald Welte ebf7fba8dd sccp_demo_user: Change prompt to not include any '-' symbols
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-10 12:53:52 +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
Stefan Sperling b3d32cd25e remove unused -p option from getopt() call in sccp_demo_user
Change-Id: I31f30d8c855cb5faf3173987bfe5b36f5a585d02
Depends: I7432e6fc2617e0fd77a098fcd7d14abc40db7229
2018-07-20 13:41:00 +02:00
Stefan Sperling 118fc8a708 sccp_demo_user: use point code 23 for server and 1 for client
Fix previous commit 4dc9088cab which
broke this by using -1 for local and 23 for remote PC, for both
server and client.

Change-Id: I7432e6fc2617e0fd77a098fcd7d14abc40db7229
Related: OS#2666
2018-07-20 13:38:51 +02:00
Stefan Sperling 97db03a682 rename m3ua_example to sccp_demo_user
The new name allows for more natural naming of variables in TTCN3
code when this program is used as a TTCN3 test component.
Consider e.g. "SCCP_DEMO_USER_VTY" vs. "M3UA_EXAMPLE_VTY".

Change-Id: I92b5e16e765a1ac36371a16933389903628f8dfe
Related: OS#2666
2018-06-14 13:55:07 +02:00
Stefan Sperling 4dc9088cab make it possible to pass parameters to m3ua_example
There are plans to use the m3ua_example tool as an SCCP peer
for a TTCN3 test suite. Make it possible to pass paramters to
this tool so the user can override hard-coded default values
of IP addresses, ports, and point codes.

Change-Id: I52243ae926c76020de41c8dfc7263517c7263d7e
2018-06-12 19:00:10 +02:00
Pau Espin 7e3476dc76 use osmo_init_logging2
Change-Id: I0d45b9381125c496a691ac5da68190b7b3479fc3
2018-04-17 14:22:36 +02:00
Neels Hofmeyr 87fe4d66ea vty: skip installing cmds now always installed by default
vty_install_default() and install_default() will soon be deprecated.

Depends: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b
Change-Id: I185aa3a11cb63c893ed80f326f852bde95217321
2017-11-01 00:47:19 +01:00
Harald Welte 769e9354ab sccp_sap.h: Fix SSN for BSSAP and BSSAP-LE
* BSSAP is 254 on both MSC and BSC side: Add missing define
* BSSAP-LE (LCS Extension) has 250/251, adjust name to add -LE suffix

Change-Id: Iccec75cfc0cf16bd717a9bd4606d1e772c332ccc
2017-09-03 21:20:32 +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 f04e2f31ea sccp_test_vty: Fix compilation warning: Unused variable
Instead of removing the variable, leave it there with unused attribute
set because it is an example and gives extra information to potential
readers of the function (it provides you with the actual type of void* _scu).

Change-Id: Id5fddf261a7a75ee1d6e9aff0734065ebf8551ab
2017-06-22 06:23:04 +00:00
Harald Welte 04dee2f9e1 m3ua_example: Add SS7 and SCCP VTY
Change-Id: Id03d2f94d22445ada01917356a5ec5a8e4fa3fca
2017-04-14 20:25:50 +02:00
Harald Welte 9692449599 sccp_test_server: Don't use '0' as local reference
the '0' confuses the Ericsson SCCP code for Eclipse Titan, even though
the spec considers it permitted.

Change-Id: I21269a7d610a4bf52555ffcef4f8acc55824515e
2017-04-13 15:59:52 +02:00
Harald Welte 9ecb11bd6d Allow clients to specify local IP/port
Change-Id: Ief7ce8181442fd0f51c34cf598269ed3a6beacea
2017-04-10 11:48:36 +02:00
Harald Welte 07903bb2ad m3ua_example: Add talloc reporting
This can be used to check for memory leaks while running the example
code.

Change-Id: I87caa76a2be3c92c93e419242595107d744bad97
2017-04-10 11:48:35 +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 996defec17 Add example program how to use M3UA+SCCP client and server
This is an example tool that can be run either as server (SG) or as
client (ASP) with a SCCP+M3UA stacking, and communicate via
connectionless and connection-oriented primitives over it

Change-Id: Id698ce2da5726e304dfa1773b794671dc80d853c
2017-04-10 11:48:34 +02:00