Commit Graph

27 Commits

Author SHA1 Message Date
Pau Espin 6924ef7199 bts: Support passing PCUIF messages over IPA multiplex
Related: SYS#5303
Change-Id: I3cd0988cb654f1c5816d1c4717255a5e802d7925
2021-06-25 13:28:20 +02:00
Pau Espin 2dc137ccd1 IPA_Emulation: Support keeping server alive after first client disconnects
Change-Id: I4c133a889df0a5a060b5c52a1ca40fa9b8695c2e
2021-01-30 19:18:18 +00:00
Vadim Yanitskiy 11edf3cdba library/IPA_Emulation: server mode: expose IPA IDENTITY RESPONSE
Change-Id: I685c2697cdbe932572e1839420d0c74c8fa94ee2
Related: OS#4546
2020-05-26 18:00:26 +07:00
Vadim Yanitskiy 40ee56cbac library/IPA_Emulation: server mode: also request IPA UnitID
Change-Id: I195894d72cf40f081d286a6c0a6d2531e3d0a45c
Related: OS#4546
2020-05-26 18:00:26 +07:00
Vadim Yanitskiy ef9bcd21ba library/IPA_Emulation: handle optional conn_id in ASP_RSL_Unitdata
This would allow the RSL Emulation component to maintain several
transceiver connections in server mode. In order to send an RSL
message to a specific transceiver, its TCP/IP connection ID needs
to be included in the ASP_RSL_Unitdata message.

Change-Id: I5c48d043cd746aad03e4329d9ffd2a627b640f64
Related: OS#4546
2020-05-26 18:00:26 +07:00
Vadim Yanitskiy 6643e8d3c7 library/IPA_Emulation: server mode: handle multiple client connections
This change basically does two simple things:

  a) adds TCP connection identifier to ASP_IPA_Event,
  b) splits g_ipa_conn_id into g_self_conn_id and g_last_conn_id.

Change a) would let the upper layers of code (based on the IPA
emulation component) know which TCP/IP connection a given event
belongs/relates to.

Change b) solves the problem, happening in server mode when a new
client connects, and TCP/IP connection identifier of another
previously connected client gets overwritten.

With this change applied, g_self_conn_id holds TCP/IP connection
identifier of the client or server itself (depending on g_mode),
while g_last_conn_id is only used in server mode and holds
connection identifier of the last connected client.

Change-Id: I93c58c08cf296e5cea81d811650caa1a09b8a579
Related: OS#4546
2020-05-26 17:51:44 +07:00
Vadim Yanitskiy 9b4e356886 library/IPA_Emulation: assume TRX#0 in ASP_RSL_Unitdata templates
Change-Id: I93297680a2644516870222c2bb8eee03c6b575a9
2020-05-25 22:14:04 +07:00
Vadim Yanitskiy 6b4856dd17 library/IPA_Emulation: cosmetic: fix template restrictions
Change-Id: I375d1b50491ff0c848088277a86dc061be0a943b
2020-05-25 22:14:04 +07:00
Vadim Yanitskiy 44f0c48a3e library/IPA_Types: cosmetic: s/IPAC_IDTAG_UNIT/IPAC_IDTAG_UNITID/g
Change-Id: Iec9cbbea9d38813f0cd3b98fb6b252111d150220
2020-05-25 20:04:04 +07:00
Vadim Yanitskiy 61564be045 library/IPA: split t_ASP_IPA_EVT_UD into send / receive templates
Change-Id: Ib5494bff3f9aa0ac396b729c326e7b4a64c5a5dd
2020-05-18 20:47:14 +07:00
Vadim Yanitskiy 8701b273dd library/IPA: rename ASP_IPA_EventUpDown to ASP_IPA_EventType
The old name was a bit confusing, because this enumerated type
also contains ASP_IPA_EVENT_ID_ACK, among with UP/DOWN events.

Change-Id: I8f73a64de40d1c8e9b7f43f538d6b59dcede065f
2020-05-18 20:37:20 +07:00
Harald Welte 3286eb37c5 IPA_Emulation: Fix building without CTRL support
Back in JUne, Change-Id I4d1eca6b0008a395b7f7449e6ea3f9b6d41133c7
attempted to introduce compilation of IPA_Emulation without CTRL but
it failed to cover all references to CTRL with the correspondign
ifdef/endif blocks.  Let's fix this.

Change-Id: I68349b32f613aacced84011601121f2265243600
2019-08-18 19:40:42 +02:00
Pau Espin acc5119bac lib/IPA_Emulation: Build IPA_CTRL conditionally based on define
Change-Id: I4d1eca6b0008a395b7f7449e6ea3f9b6d41133c7
2019-06-13 16:33:49 +02:00
Pau Espin 76ba541efa bsc: Fix trailing whitespace
Change-Id: I97c6cc290d6cc23611ac38e7e370b5b0b88cca1d
2019-06-13 09:38:05 +00:00
Harald Welte 34b5a95d09 cosmetic: Update copyright statement, license notice and SPDX
Some of our files didn't have a copyright notice at all, let's add
it.  Also, update the notices in other files and ensure a SPDX
identifier is present in all but the most trivial files.

Change-Id: If7fa19ce484b415bc645e39b3d0d666b44b5f0fd
2019-05-27 10:00:06 +00:00
Max b7aae8b957 IPA: log host:port on listen errors
Change-Id: I0e25961698ab70a2822e2b2be5b514c3603981ca
2019-03-11 15:22:02 +01:00
Harald Welte c682666fea IPA_Emulation: Integrate OML decoding/encoding; add OML port
Change-Id: Id0dabe7eca4f81d22a60b346ac598be81533f53c
2019-02-17 14:29:21 +01:00
Harald Welte 7460a728fc IPA_Types/Emulation: Add RSPRO support
RSPRO is the protocol used by osmo-remsim.  It is embedded into an IPA
multiplex, and hence the TTCN-3 IPA code needs some extension to cover
support for it.

Change-Id: I536d6843b3e65b3ee35fbbcd6353e0fb0ce21c8e
2018-10-10 20:42:44 +00:00
Stefan Sperling 6a90be4bae improve connection failure message in IPA emulation
Show addresses and ports which were attempted in the IPA
connection failure message.

Example output:
Verdict: fail reason: Could not connect IPA socket from "" port -1 \
	to "127.0.0.1" port 4238; check your configuration

Change-Id: I828fe67d66bcd668aa14922b89a2feac56dc2d9a
2018-08-31 15:07:40 +02:00
Neels Hofmeyr 3bf31d216a fix SCCPlite BSC tests: send IPA ID ACK, not GET
From libosmo-sccp.git Icffda98579e676ab6ca63c9c22cf5d151c4fe95f on, we expect
an IPA ID ACK upon first connecting, not an IPA ID GET. This might be specific
to the one MSC tested so far, but it's the status quo.

Make the IPA server in IPA_Emulation configurable, to conform and send the IPA
ID ACK upon connecting.  This fixes the ttcn3-bsc-tests,SCCPlite suite, broken
by above libosmo-sccp commit.

For other IPA clients, it is so far required to send the IPA ID GET, so only
configure the SCCPlite server in BSSAP_Adapter.ttcn to send IPA ID ACK, and
leave the others unchanged.

Related: OS#3500 OS#3498
Related: Icffda98579e676ab6ca63c9c22cf5d151c4fe95f (libosmo-sccp)
Change-Id: I34b6296a1a408729802a9659c6524c0f67a2f4fe
2018-08-24 18:29:48 +02:00
Harald Welte 95686e0bd7 IPA_Emulation: Add missing zero byte to strings in IPA CCM ID RESP
Change-Id: I3fdc0f47381d5ba1763197d5f264696f04d0396f
2018-08-02 15:14:03 +02:00
Daniel Willmann e4ff537f9b library: Ensure setverdict(fail) is followed by mtc.stop
This will prevent subsequent failures from overwriting the verdict so we
can easily see the root cause of the test failure.

Using testcase.stop instead for errors internal to our test
infrastructure to mark them as test errors instead of failed.

Change-Id: Idc6819aaf0b01e70c38fad828dd44dcec6bdd778
2018-07-24 09:54:18 +00:00
Harald Welte 2e32e4321b BSSAP/IPA integration: Wait for SCCPLite to be established
Before this patch, we had some problems related to synchronization
between the IPA transport, SCCP emulation and BSSAP layer in SCCPlite
configurations.

This code ensures that f_bssap_init() will block until the IPA
connection (client or server) is established, and then start the SCCP
and BSSAP emulation components in the right order.

This in turn ensures that the initial BSSMAP RESET that we're sending
from the TTCN-3 side is only sent once the IPA connection is fully
established, and the CCM Identity handshake has happened before.

Change-Id: I483ddd45c1cf631a5a9d8f862b6ca728b38bdc14
Related: OS#2544
2018-05-24 20:02:55 +02:00
Harald Welte 9220f6336e Print more self-explanatory error message on bind/connect failures
When sockets cannot be bound or connected, the existing TTCN-3 code prints
the following rather cryptic error messages:

"IPA-CTRL-IPA(47)@f70ff1fd5cfd: Dynamic test case error: Using the value of an optional field containing omit. (Transport endpoint is not connected)"

The "Transport endpoint is not connected" sort-of gives it away, but
let's make it more explicit by introducing explicit checks for the
res.connId and manual setverdict(fail) statements with proper error
message.

Change-Id: Id22a1b5189d81c4fca03d5e7aff60ffdd1ad56bf
2018-05-23 20:27:02 +02:00
Harald Welte 2d86affc8c IPA: Fix wrong CCM ID_ACK logic; disable CCM on CTRL interface
Our TTCN3 implementation of the IPA multiplex with CCM handshaking
has been based on some wrong assumptions about the protocol logic.

To make the code stricter, we
* send an ID_ACK immediately after connecting TCP in a client
* separate client and server CCM responder logic
* always respond with ID_ACK to ID_RESP (we accept any identity)

Also, as the Osmocom CTRL interface uses an IPA multiplex but no CCM,
we introduce a boolean variable (and function argument) to clearly
enable/disable CCM support in a given IPA_Emulation component.  The
CTRL_Adapter has been modified to use this flag to disable CCM.

This also removes the need of cherry-picking
	"HACK: Work around IPA CCM bug in OsmoBSC"
	Change-Id: I304535d28a165f76a0a140dc0a15dd81a9db28c8
from the laforge/bsc-workaround branch.

Change-Id: I6d9eaf0d69457caacc03b9049a8bc57976480617
2018-04-17 19:52:30 +00:00
Harald Welte 3bc387f41a IPA_Emulation: Don't log IPAC_MSGT_ID_RESP as "Unknown/unsupported"
Change-Id: I6ea3855a1f3d1cba6ac173b0f9cf9052d5d028fc
2018-02-21 12:20:30 +01:00
Harald Welte df277258f1 IPA_Emulation: Make dependencies to RSL/MGCP/SCCP/GSUP conditional
Let's use the preprocessor to avoid IPA_Emulation pulling *all*
dependencies into each and any of our projects.  The code readability
suffers a bit from the many #ifdefs, but compilation speed increases
if we don't have to pull in all those (recursive) dependencies.

After all, a BTS test case will never need SCCP, GSUP or MGCP.

Change-Id: Ic0231adbd2171214de133d26b3fbf36130ee8aa0
2018-02-20 16:17:17 +01:00