Commit Graph

414 Commits

Author SHA1 Message Date
Harald Welte e3bd658abf bsc: reduce code duplication; add new test case on too short messages
Change-Id: I8232ee58c14a4358a01b5428ff2b4e559491b185
2018-01-31 23:37:14 +01:00
Harald Welte fbf9b5eafd bsc: Add TC_unsol_ho_fail test case for unsolicited handover failure
Change-Id: Ic3bd71d77d03cb7eebabdf98ba0bfbafd24ec0ea
2018-01-31 20:47:04 +01:00
Harald Welte 898113b838 bsc: Add TC_classmark to test RR CLASSMARK -> BSSMAP CLASSMARK conversion
Related: OS#2902
Change-Id: Idd86b5505e1a4fee666287680a20dc235970be93
2018-01-31 18:50:41 +01:00
Harald Welte 751d3eb19f BSC_Tests: Implement remaining missing paging tests
We now test all of the cell identification types specified in BSSMAP,
and also lists with a length != 1 entry.

Change-Id: I261f948d6054d0c90078c1dd0b2785a967b0a49b
2018-01-31 16:08:26 +01:00
Harald Welte 363cb0a394 bsc: Handle wildcard endpoint name in MGCP CRCX
MGCP permits for the CallAgent to send a wildcarded endpoint name,
at which point the MGW itself must allocate an endpoint name and
return it as SpecificEndpointId parameter in the CRCX response.

Change-Id: I704bbe4e11b27e83a6ae6a71aa6a715dc8301f34
2018-01-30 20:10:56 +01:00
Harald Welte 06e835fa6d MGCP_Emulation: Remove bogus mgcp_conn_id variable from MGCP_ConnHdlr
A given MGCP_ConnHdlr is handling multiple connections on one Endpoint
anyway, and the variable is not set or used anywhere.

Change-Id: If9eea3f665289a52915f114f0a69234aad28f322
2018-01-29 22:35:41 +01:00
Harald Welte 1909f464af bsc: Unregister old RSL channel number after assignment
Change-Id: I27d113391094f938ff92c4d6514172ee634f695c
2018-01-29 22:35:41 +01:00
Harald Welte ecb254b18a L3_Templates: Add ts_RRM_AssignmentComplete
Change-Id: I3ae33ea00496eaef5885a58cd5fbc491abe68c87
2018-01-29 21:35:13 +00:00
Harald Welte f70df65570 RSL_Emulation: Permit registration of explicit Channel Number
During assignment or hand-over, a given TTCN-3 component may be
interested in registering more than one channel number.  Add an explicit
procedure port with associated registration procedure, similar to what
we already do in GSUP, MNCC and others.

Change-Id: Iba37bf9541c779b79e179f995cdfa677633fadeb
2018-01-29 21:35:13 +00:00
Harald Welte 2c2e8c4e18 GSM_Types: Enable sub-slot templating in t_RslChanNr_Lm
Change-Id: I22dca2338ad66c81add5d161bd2a3b3e8e15bdcf
2018-01-29 21:35:12 +00:00
Harald Welte 6a8199dda3 RSL_Types: More templates, f_rsl_find_ie() for finding an IE in a message
Change-Id: Id7fa7d672c1fde97882fa44959501e8bf7b8dc0b
2018-01-29 21:35:12 +00:00
Harald Welte e540822967 RSL_Types: Make tr_RSL_MsgTypeDR match non-transparent RLL
There are quite a number of non-transparent RLL messages, such as
RLL_RELEASE_REQ.  Make sure we match those as intended.

Change-Id: I30260a57fc01613450e6ac66e0af97c29041b4fa
2018-01-29 21:35:12 +00:00
Harald Welte 1fe7481174 MGCP_Templates: Some more convenience extraction functions
Change-Id: I2fc121b1d90327c879a096773ecc5c04faad07d7
2018-01-29 21:35:12 +00:00
Daniel Willmann aeea76fe5d bsc: Reply to CRCX with ACK
Change-Id: Ieaea431a99241d8844b915e1b46b77c79fff24df
2018-01-29 21:35:12 +00:00
Pau Espin aea381feca library: Implement f_inet6_addr function
It can be used to parse IPv6 functions, since inet_addr supports IPv4
only.

Change-Id: Icb6dd38462501895d1b4409a3c530793917bd803
2018-01-29 15:18:19 +01:00
Harald Welte d95da56490 GSUP: Initialize ExpectTable
For some reason TITAN 6.1.0 requires the table to be explicitly
initialized, while 6.3.0 is happy without it.

Change-Id: I4f9ac98fb60ad16b98acd627efd617bfb4f6abcb
2018-01-27 21:55:34 +01:00
Harald Welte 473676b879 BSSMAP_Emulation: ispresent(bssap.pdu.bssmap) before accessing fields
This seems not to be required on TITAN 6.3.0 on my laptop, but the
older 6.1.0 on Debian 9 seems to need it.

Change-Id: I574d8b79ac43e0fceddb3f9815666aef0ed66a3f
2018-01-27 20:38:54 +01:00
Harald Welte 167458a5c1 msc: Add TC_gsup_cancel testing GSUP Location Cancel
Related: OS#2886
Change-Id: Ib962c4a1e71f926631503fe4b3459ca49360dfa4
2018-01-27 19:00:04 +01:00
Harald Welte 8a1dd53367 GSUP_Types: Add tr_GSUP_IMSI as helper for messages with IMSI as first IE
Change-Id: Ie1b9682d102da28fa7de4cb391d61aeb52f1676b
2018-01-27 19:00:04 +01:00
Harald Welte 6aa04e313b GSUP_Types: Use (value) annotation for send (ts_) templates
Change-Id: I5c74ad71e8a0966f10bddcdf800cd94226cd900d
2018-01-27 19:00:04 +01:00
Harald Welte 812f7a45e3 WIP: msc: First test case for mobile terminated call testing
We start the call from the MNCC side, match on the paging and then
pick it up from there.

It currently fails as the MNCC_Emulation cannot yet handle "ConnHdlr
originated" MNCC calls yet.

Change-Id: I28c465187fd8b1dcfd687180b373a47bb9ac6734
2018-01-27 12:45:39 +01:00
Harald Welte 3f95be8fff GSUP_Types: Make sure our MSISDN encoding agrees with OsmoMSC
OsmoMSC seems to have broken encoding of MSISDN which is not in-line
with the spec.  Let's adapt to it.

Change-Id: I4892df63f1a135573dcac977f5eb0a79cbaffad3
Related: OS#2883
2018-01-27 12:45:39 +01:00
Harald Welte 17d2115ab8 BSSMAP: Add IMSI/TMSI mapping table to dispatch incoming paging
If we're emulating BSC/BTS/MS, then we must be able to dispatch
incoming paging requests based on their IMSI or TMSI to the right
ConnHdlr component.  This introduces a new table to facilitate that
dispatch.

Change-Id: I85c1ea3bcf8fb4a100f20cffdc991826b58e290b
2018-01-27 12:45:39 +01:00
Harald Welte 4017d55bbe msc: Make TC_lu_and_mo_call succeed with osmo-mg enabled osmo-msc
This is for patch https://gerrit.osmocom.org/#/c/4980 in osmo-msc

Change-Id: Ieec52d5e0da776d35d6a473bd726b368af9d5c66
2018-01-26 22:53:57 +01:00
Harald Welte be48a7c081 BSSMAP_Templates: tr_BSSMAP_AssignmentReq support for cic + aoip
Change-Id: I666e70d265d9d5dea7516640809b6081ddeecb88
2018-01-26 22:53:57 +01:00
Harald Welte b6e1d7ec31 BSSMAP_Templates: Make ts_BSSMAP_IE_AoIP_TLA also usable for receive
Change-Id: I8ef753e448453fcab845fbd2936e37a0c22075a0
2018-01-26 22:53:57 +01:00
Harald Welte b71901a52f msc: Rewrite TC_lu_and_mo_call() to be more modular
All relevant parameters are passed in in form of a CallParameters
record, and the bulk of the work has been moved to
BSC_ConnectionHandler.

Change-Id: I932c6c9f7a48b6a1f1ec399e8bba6a413c8bc69e
2018-01-26 22:53:57 +01:00
Harald Welte 9601c8106a MGCP_Emulation: Move from connetion-based to endpoint-based model
In the end, we will often see two connections that relate to one
endpoint, so let's dispatch based on the endpoint name and not based
on the connection identifier.

In the BSC case, we have
* two MGCP connections on one EP in case of RTP/IP based Abis
* one MGCP connectio on one EP in case of E1/T1 based Abis

In the MSC case, we have
* two MGCP connections on one EP: BSS and MSS/MNCC side

Change-Id: I8cd7395ee7b076a9a9ef513cc1b71f2db5009845
2018-01-26 22:53:57 +01:00
Harald Welte c2461d66a5 msc: Move f_sleep() to common Osmocom_Types.ttcn
Change-Id: Ic748e1dfe002cb6ee4d785e9b7f8dca34873e504
2018-01-26 22:53:57 +01:00
Harald Welte bb5a1212c8 MGCP_Emulation: More complete implementation
* re-introduce connection table
* introduce unitdata_cb for connectionless MGCP messages (like AUEP)
* rename MGCP_Emulation_CT members to avoid clashes with other similar
  component names when using "multiple inheritance"
* Use HostName/PortNumber types on MGCP_conn_parameters
* allow "bind to local UDP port only, permit any UDP source port" behavior
* implement expect matching criteria + expect matching only on CRCX
* add helper function f_create_mgcp_expect() like in other Emulations

Change-Id: I953a91e663648715fa4fe98acacca393c8747001
2018-01-26 10:42:53 +01:00
Harald Welte a02515f82f MGCP_Emulation: Add comment + license disclaimer
Change-Id: Ibf1a1ed80a99c8d8754cce3b47b11b5186b9c52d
2018-01-26 10:42:53 +01:00
Harald Welte b6c6ec15f2 BSSMAP_Templates: Permit tr_BSSMAP_AssignmentReq without CIC
Change-Id: Id0379fcb676698d92effce755dbc07c26a6a1101
2018-01-26 10:42:53 +01:00
Harald Welte 4b2b3a673a L3_Templates: ts_Bcap_voice(): Include speech version octets
Change-Id: Iff48bff6df6fa7dae3bc8467be4d75b0305f68ad
2018-01-26 10:42:53 +01:00
Daniel Willmann 166bbb3310 bsc: CRCX is answered with (malformed) ACK
Change-Id: I09c1ed467e95be236e0758d6a9c8bbef405c02eb
2018-01-26 10:42:53 +01:00
Harald Welte c27eaaeb8b MGCP library part of "bsc: Reply to CRCX with ACK"
Change-Id: I68b66d26dfbbba11e1b3a8c04435f08d095f68ed
2018-01-26 10:42:53 +01:00
Daniel Willmann 955627afed MGCP_Emulation part of "bsc: Register expect criteria for MGCP CRCX"
Change-Id: I466df816eef9863bf1664e785b996c0697dc04e3
2018-01-26 10:42:53 +01:00
Daniel Willmann 34e7dd0cca MGCP_CodecPort: Receive MGCP command or response
If we act as MGW we need to accept MGCP commands sent to us as well

Change-Id: I895cfb688a2923b278828f5ae918c73fda18636d
2018-01-26 10:42:53 +01:00
Daniel Willmann fa870f5e25 Add MGCP_Emulation
Change-Id: I5245be2b44e98e1c74b9519c610564667b980a67
2018-01-26 10:42:53 +01:00
Harald Welte 9182704cbc ggsn: Move random number helpers to Osmocom_Types.ttcn
Change-Id: I141289cbf1807e81d72f07ac1183fa48b2dc54af
2018-01-26 10:42:53 +01:00
Harald Welte 161142834f msc: TC_lu_imsi_auth_tmsi_encr_13_13
Add a first test for encryption (cipher mode command/complete)

Change-Id: I8a8a5c55d87bb251896664679920b96f678673a0
2018-01-24 23:05:35 +01:00
Harald Welte c638f4dbe9 msc: TC_lu_auth_2G_fail: Test auth failure in 2G auth
Change-Id: I54ef4137c0b95658b1e844ac1bb13729f27fd0d1
2018-01-24 23:05:35 +01:00
Harald Welte 0195ab1ab1 msc: Add TC_cm_reest_req_reject: Expect CM RE-EST REQ to be rejected
Change-Id: I7d15b935caed2dacf39d66a33ff933a9b8c443d9
2018-01-24 23:05:35 +01:00
Harald Welte 6ed6bf9773 MSC_Tests: Use enum instead of magic numbers for CM_SERVICE_TYPE
Change-Id: Ic90b4a0aa47821877a2d3566606b9c9dd5919968
2018-01-24 23:05:32 +01:00
Harald Welte ae1362544f f_enc_IMSI_L3: Fix filler digit in *even* case
We actually need to add the filler digit 'F' if the number of digits
is even.  It is absent when the number of digits is odd.

Change-Id: Ic1353f4ea09bba3151636b94a99c8559e0289ffd
2018-01-24 22:42:25 +01:00
Harald Welte 2f562b1a70 GSUP: Fix handling of odd-length IMSI and 0xF filler digit
Change-Id: I4e0a9f1236504ce6026c6e34fd97fda6fefa832c
2018-01-24 22:42:25 +01:00
Harald Welte 553f655035 Osmocom_VTY_Functions: Make prompt configurable
We want to use this code also for OsmoMSC testing, so let's make the
prefix configurable as module parameter.

Change-Id: Iec846227e88b3dc0d3be9474b8b926719161c9ee
2018-01-24 18:53:32 +01:00
Harald Welte 45164da2bc MSC_Tests: More CM SERVICE REQ and EMERGENCY CALL related tests
Change-Id: I04ca21824f66ad90d9dac2c25000ecd724aa4528
2018-01-24 17:29:15 +01:00
Harald Welte ba7b6d940e msc: Add test case for LU with MI=IMEI (which is illegal)
Change-Id: Ie3c91a0ff212a70a8e03e0579f240a10bc4356f4
2018-01-24 17:29:15 +01:00
Harald Welte bc881789bd msc: Test closing BSSAP connection of LU by ClearCommand
Change-Id: I9194da2f9324ee17c920458cb920a6fa718ac739
2018-01-24 17:29:15 +01:00
Harald Welte 071ed736c8 msc: Add tests for HLR SAI timeout and HLR SAI error
Change-Id: I7f8c8ff9ccadd7b7b14cba12a34cebe6855a5367
2018-01-24 17:29:15 +01:00
Harald Welte 77a8ebaceb GSUP/L3: Add templates related to authentication
Change-Id: Id9566e3e075a8837e2e77a7c2b9d8f0f6e9b7554
2018-01-24 17:29:15 +01:00
Harald Welte 2bb825fc71 WIP: MSC: Add MO call testing
Change-Id: If32cb359b3cf732c4752856538552595dbbf2a8a
2018-01-24 17:29:15 +01:00
Harald Welte ef9fa87ac9 msc: Prepare authentication support
Change-Id: I930bed1907fd0faf61788cf14e75f2b2337572f4
2018-01-22 03:01:27 +01:00
Harald Welte d748a0519a msc: More MNCC and L3 templates towards voice testing
Change-Id: I3132a856175fc9421e1a0bfd37620d6b1625574b
2018-01-22 03:01:27 +01:00
Harald Welte 515f5d11e7 MNCC: Properly terminate speech version array
MNCC has this weird encoding that the speech version array must
be terminated with one element '-1' at the end.  Let's make sure
our default complies to this rule.

Change-Id: I2e06ed1b558c58a62a00ea8d3573bb31c0c3e750
Related: OS#2853
2018-01-22 03:01:27 +01:00
Harald Welte ec3d065b59 MNCC_Types: Define '0' in various enums for unused value
it seems the decoder is using '0' in positions where we have
not defined any enum value for '0'.  Work around that.

Change-Id: I6bf0540f7ddd4dbe3b6c6ac06421a933126a7e17
2018-01-22 03:01:27 +01:00
Harald Welte 5c2622cafb MSC_Tests: Implement early classmark sending in LU
Change-Id: I019d51703c60203c7cb83a77dc7ca4b3d6623e24
2018-01-22 03:01:27 +01:00
Harald Welte 71b693365d BSSMAP_Emulation: Introduce new MSC_CONN_PRIM_CONF_IND
If the ConnHdlr initiates an outbound connection, it needs to know
once that connection is established if it wants to send further
data. Transform the N-CONNECT.confirm into a MSC_CONN_PRIM_CONF_IND
and send it to the ConnHdlr.

Make use of it from the MSC_Tests when issuing a Complete L3 Info.

Change-Id: I7293a9f4993d13c90316224eb9f13e10130388ef
2018-01-22 03:01:27 +01:00
Harald Welte 6ff81909fd More GSUP and L3 Templates
Change-Id: I0e9136fc3b8f171934f054ec149d8dd344faa034
2018-01-21 19:31:09 +01:00
Harald Welte 0b476066b9 BSSMAP_Emulation: Decode DTAP
It's quite cumbersome if the user of the BSSMAP_Emulation (the ConnHdlr)
will have to manually decode the DTAP in every BSSAP/DTAP message he
receives (and encode on the transmit side).  Let's introduce a new
optional mode in which the DTAP messages are already decoded for
more convenient matching inside the ConnHdlr.

Change-Id: I35cd4ea78aca0ce7c7d745e082d7289882c11e81
2018-01-21 19:31:09 +01:00
Harald Welte 0e5aad201f Add new GSUP Emulation module, dispatching GSUP based on IMSI
Change-Id: I6d06280fa5729ee921d319854a9b11636cf83495
2018-01-21 19:31:09 +01:00
Harald Welte cb6cc33521 L3_Templates: Template for tr_CM_SERV_REJ and ts_ML3_MO_LU_Req
Change-Id: Iad1596a3b80de16a9b0e2d644cf9a0fe2c51ad21
2018-01-21 19:31:09 +01:00
Harald Welte ae8ce238cd BSSMAP_Templates: Fix + enable ts_CellId_CGI
Change-Id: Icafe6415b3f896176edcac604a0945e83126db09
2018-01-21 19:31:09 +01:00
Harald Welte 0a6835c6f2 BSSMAP_Templates: Make ts_BSSAP_DTAP usable
A send template with '?' is broken.  Also, allow caller to specify DTAP
payload as well as optionally a DLCI.

Change-Id: I641ee8ce5e5ae70b514342cf68cdc79b1926c4d0
2018-01-21 19:31:09 +01:00
Harald Welte dfe94dd5f7 GSUP_Types: Templates for UpdateLocation + ISD
Change-Id: If7a5a1159f098645652114e0c36fea98f63f946c
2018-01-21 19:31:09 +01:00
Harald Welte 049ca642aa BSSMAP_Templates: tr_BSSAP_BSSMAP / tr_BSSAP_DTAP: DLCI may be present
Change-Id: I98b313e354b31fae8c1fea9e61a838970d575d69
2018-01-21 19:31:09 +01:00
Harald Welte b0ec4eec33 BSSAP_Adapter: Always perform BSSMAP Reset on start-up
Change-Id: I1f8834be3409348b3a30b1489f5faa4d1c47b086
2018-01-21 19:31:09 +01:00
Harald Welte 0cf76ad9f7 Move BSSAP_Adapter.ttcn to library so it can be reused
Change-Id: I6ecb1a4823ee036b65d4e4e8ebc23c1db4915a42
2018-01-21 19:31:09 +01:00
Harald Welte ffe55fcc83 bsc test: Abstract out CTRL handling so it can be re-used from MSC test
We create a new Osmocom_CTRL_Adapter module which can be used by
test suites using the 'extends' functionality.

Change-Id: I3ef6cfaa738900e008155013a05b8ccf3d4b7aeb
2018-01-21 19:31:09 +01:00
Harald Welte 876bf9d474 MNCC_Emulation: Similar to BSSMAP_Emulation but for MNCC
Dispatches MNCC to individual ConnHldr's based on IMSI.

Change-Id: I850b49ce6a6c894b413b8905008452ce91d2cdb0
2018-01-21 19:28:59 +01:00
Harald Welte ca519981aa BSSMAP_Emulation: Add missing procedure port to client/ConnHdlr
Change-Id: I2925f74d5dcc18f37d48ec8a38a308c1adeef3cc
2018-01-21 19:28:26 +01:00
Harald Welte fe75a20163 MNCC_Types: Add enumerated for cause location + cause coding
Change-Id: If67691a7a18cdde726dfcab48fdfc7b29bd518b4
2018-01-17 13:34:58 +00:00
Harald Welte 8a10e8656d MNCC: Make sure all unused fields are set to omit, not 'unbound'
Change-Id: I0ef3afa19d4ad5e011a7c0d86f8367461608e163
2018-01-17 13:34:58 +00:00
Harald Welte 251b52b71c MNCC: Add some useful templates / helper functions
Change-Id: I59374f9f17600bd405b52dd3a0bcdb39b9ac9adc
2018-01-17 13:34:58 +00:00
Harald Welte 8b2a258808 MNCC_Types: Add templates for most MNCC messages
This adds templates for sending and receiving MNCC messages from
the external MNCC handler point of view, i.e. as required for MSC
testing.  The inverse templates will be needed if we want to implement
emulation of the MSC side of MNCC.

Change-Id: I77665aaf589bdaa9dc0aa6a5daa431fafdc2b383
2018-01-17 13:34:58 +00:00
Daniel Willmann d47106b337 BSSMAP_Emulation: Initialize ExpectTable before use
The assignment_fr_* tests now go through to the point where the BSC
sends a CRCX to the mgw.

Change-Id: Ic5a128861ae7b1a4cf8158e43c59c52ebd2a20ba
2018-01-17 13:12:19 +01:00
Daniel Willmann 17f970fc65 RSL_Emulation: Initialize the ConnectionTable
By default all the elements in the conn table seem to be considered
<unbound>.
f_cid_create() manages to set ra, ra_fn and comp_ref in the
ConnectionData element, but checking for
ispresent(ConnectionTable[i].ra) still returns false while
log(ConnectionTable[i].ra) returns 23. Setting every optional element to
omit as f_cid_clear() does before using the connection table seems to
solve this issue.

The assignment_fr_* tests now continue after receiving the Immediate
Assignment, but still fail after receiving the CM Service Request.

Change-Id: I24205425c5b6ae5b8a0f6288ba89ea5a1dc4669d
2018-01-17 13:11:57 +01:00
Stefan Sperling 6d9309b8a4 Fix f_enc_mcc_mnc() to return a properly encoded MCC/MNC triple octet.
With help from Daniel Willmann.

Change-Id: I99a5317e425d15acd463aa94c683676cacd54e0b
Related: OS#2754
2018-01-11 14:43:16 +00:00
Harald Welte 474fd7d11a Add a MNCC Socket implementation for TTCN-3
Change-Id: I8c334d4c2e630b2b779e73404c44a8df3278c614
2018-01-03 21:09:35 +01:00
Harald Welte 35bb716610 Add comments with short module description on top of each file
Change-Id: Id934d7a763b619d52cbec7de439b3708225b81f3
2018-01-03 21:09:29 +01:00
Harald Welte df32723446 GSUP Support and first test against OsmoHLR
Change-Id: Idd7a6aca1ab193da39294f49a3adc4c1cd7cecff
2017-12-28 23:17:24 +01:00
Harald Welte 8098164721 RTP_Emulation: Integrate IuUP support
Change-Id: I46de7fb9c324654275a27aa5f8c1be70340e3229
2017-12-25 00:03:07 +01:00
Harald Welte 3f6f48f4c1 RTP_Emulation: Add RtpemConfig / RTPEM_configure() call
Change-Id: Ie60b750fc009a3d8aa044e4fd450873aa19086bb
2017-12-25 00:00:58 +01:00
Harald Welte 46a38f1669 RTP_Emulation: Fix calculation of timer + timestamp increment
Change-Id: I3ba0d31ad571f42721f208a40f7dcbd8fb2c6e88
2017-12-25 00:00:58 +01:00
Harald Welte 8a4d3954b6 RTP_Emulation: Fix encoding of timestamp; int2bit counts in bits!
Change-Id: I8e8b8faff362536c46b188eb9bbb77bf0ceb866d
2017-12-25 00:00:58 +01:00
Harald Welte c676c68de6 Add 3GPP TS 25.415 IuUP encoder/decoder
Change-Id: Ie04438d8ec2b796e9e56b1937fa024a5299457dd
2017-12-25 00:00:58 +01:00
Harald Welte 73cd271a56 BSC_Tests: Implement ecnryption related procedures
Let's verify the operation of the CIPHERING MODE COMMAND as issued
by MSC, performed by BSC and implemented by simulated BTS/MS.

Change-Id: Ibc06bd2177c63837a794a0ca1f54ebef17499e78
2017-12-17 13:24:39 +01:00
Harald Welte 15166144ae L3_Templates: Add ts_RRM_ModeModifyAck template
Change-Id: Iec607577aff1c65cb208c20a4c4169b5b4569892
2017-12-17 13:24:39 +01:00
Harald Welte 71b5ec8c57 RSL_Types: Fix message type of ts_RSL_IPA_MDCX_ACK()
Change-Id: I8ce0c96d66c3027d68542b3f58d9a732fb42517d
2017-12-17 13:24:39 +01:00
Harald Welte 7794d5b7ea RSL_Types: Handle IPA specific messages in tr_RSL_MsgTypeDR()
They all are related to a dedicated channel and carry a channel number
as first information element.

Change-Id: Ic3fdc029a96c34a9d2d9ec669b789526c8325637
2017-12-17 13:24:39 +01:00
Harald Welte f307500caa RSL_Types: Fix RSL Message Type enumerated definition
Change-Id: I9096f8a579ee245fb193e0fd53144056bc4a23a8
2017-12-17 13:24:39 +01:00
Harald Welte 624f963393 BSC_Tests: Prepare for tests based on {RSL,BSSMAP}_Emulation
The existing tests were implemented directly on top of the BSSMAP
and RSL CodecPorts.  If we loop in the RSL_Emulation and
BSSMAP_Emulation components, we can properly multiplex/demultiplex
multiple MS (radio channels) on both the RSL and the MSC (SCCP
connection) side.

In order to have a single component that handles both the RSL and the
BSSAP side of a given channel/subscriber/call, we introduce the concept
of BSSMAP "Expects", where the test csse can register the L3 INFO that
it sends in the RLL ESTablish INDication on the RSL side, so the BSSMAP
handler cna route the BSC-originated SCCP connection with that L3 INFO
back to the same component.  This is a bit inspired "in spirit" of the
"expect" mechanism of netfilter connection tracking.

Change-Id: I71f777cd4f290422fa68897952b6505875e35f0e
2017-12-17 13:24:35 +01:00
Harald Welte 004f5fbca3 BSSMAP_Emulation: use BSSAP_CodecPort
So far, BSSMAP_Emulation used the SCCPasp_SP_PORT directly, explicitly
calling BSSAP encode/decode functions while processing the primitives.

Let's clean this up and use the BSSAP_CodecPort which has meanwhile
been developed as a dual-faced port that can be stacked between SCCPasp
and the user to avoid any manual encode/decode function calls.

Change-Id: Icded789d18f3469f74e16f552df2c7ac44ac4294
2017-12-17 11:04:32 +01:00
Harald Welte f1b64e208f BSC_Tests: Ensure MSC passes SpeechCodecList in AoIP ASSIGNMENT
Change-Id: I66deffc50b5adcc8707747c0baa2e65ee36bf18e
2017-12-15 14:56:48 +01:00
Harald Welte 235ebf1b9c BSC_Tests: Add whole bunch of new assignment tests
Change-Id: Ia7304f2e2265c2ebd92575a9403b082579397656
2017-12-15 14:19:10 +01:00
Harald Welte 4bf5fc97fb BSSMAP_Templates: Define various ASSIGNMENT related templates/constants
Change-Id: Id4f98120dbedf1a4fd5fb34df0d638eb08d7c3cb
2017-12-15 14:19:10 +01:00
Harald Welte b69533d153 BSSMAP_Templates: Define enum with 08.08 cause values
Change-Id: I2fc122a510403d0da8da04ca323687065347c96a
2017-12-15 14:19:10 +01:00
Harald Welte cfe2c962a7 BSC_Tests: Add TC_outbound_connect to test if BSC rejects inbound SCCP connections
Change-Id: Ie9087df9ff9b48c8be242b1ae66cbca936b07121
2017-12-15 14:19:10 +01:00
Harald Welte cc7e4dc40e BSSMAP_Templates: Enable use for AoIP, not just E1-CIC
Change-Id: I421ade4ae1c0c19c9c2b1172cdcf8d6c4cd55205
2017-12-15 14:19:10 +01:00
Harald Welte 9958a4d7c8 RSL_Types: Add various IPA / Abis-IP specific IEs + templates
Change-Id: I683e7c23b217a993e0d8f079e5bf1a10403420bb
2017-12-15 14:19:10 +01:00
Harald Welte 16a4adfa5f BSC_Tests: Add TC_assignment_cic_only (AoIP Assign. must fail with only CIC)
Change-Id: Iee7202841ad8466a65b5d54679262be100863e39
2017-12-15 14:19:10 +01:00
Harald Welte a8ed906866 BSC_Tests / RSL_Types: Add enumerated for RSL Cause value
this looks much more human-readable in the logs...

Change-Id: I2bc3de37a3059cc16c6293df45e5c4d620422502
2017-12-14 09:46:01 +01:00
Harald Welte 5d1a2209f2 bsc: Run three virtual BTSs (2 in one lac, 1 in another)
This allows us to verify if the BSC pages *only* where it is supposed
to page based on the cell identity list in the 08.08 PAGING.

Change-Id: I53ffe44279a7b83e045b3fdb25da64529955d457
2017-12-13 19:51:29 +01:00
Harald Welte 067d66ed5b Add RTP_Emulation (stream source/sink) on top of RTP_CodecPort
Change-Id: Ic0750bdc025cd6f16094843550429d976fb44f4f
2017-12-13 17:24:03 +01:00
Harald Welte 1a9b35dd3e Add missing RTP_CodecPort_CtrlFunct TTCN and C++ files
Change-Id: Ic5499a0b5f635a93214cbb5e641d2fd8d37f38d6
2017-12-13 15:42:31 +01:00
Harald Welte 152c38c765 move RTP_CodecPort.ttcn to library
Change-Id: I67343f016757c23a85db6b526b6f60476e91ffc3
2017-12-13 13:19:26 +01:00
Harald Welte 16979760b2 Osmocom_CTRL_Types.ttcn: workaround to compile on TITAN 6.1.0
I have no clue why, but this seems to work?

Change-Id: I49750709e50d16a9fabec3e754ae8381832e6104
2017-12-13 00:46:31 +01:00
Harald Welte 4c5ef5b3e1 IPA_Types: Add ts_PDU_IPA (selftest fixup 2017-12-12 15:53:40 +01:00
Harald Welte 735dd07b38 RSL_Types: Work around (perceived) shortcoming of TITAN RAW encoder 2017-12-12 14:55:17 +01:00
Harald Welte 3e6ad89a2b IPA_Emulation: Call f_IPL4_setGetMsgLen for both client and server
So far, only the IPA client was instructing the IPL4asp to use
the message-desegmentation function.  The server didn't use it, leading
to inconsistent behaviour.
2017-12-12 14:39:46 +01:00
Harald Welte 72cecfa26c BSSMAP_Templates: Add templates for various PAGING options 2017-12-11 19:51:00 +01:00
Harald Welte 51d74101b8 RSL_Types: Fix coding of RSL_IE_ChanNeeded and matching if PAGING_CMD 2017-12-10 23:05:02 +01:00
Harald Welte fdfa046803 Osmocom_CTRL: Fix matching on incoming trap; avoid generating error verdicts in functions 2017-12-10 18:09:40 +01:00
Harald Welte 346658df4b BSSAP_CodecPort: respondingAddress is optional in BSSAP_N_DISCONNECT_ind 2017-12-10 14:10:25 +01:00
Harald Welte 510a287a5e BSSAP_CodecPort: Don't dereference optional fields unconditionally 2017-12-10 13:48:17 +01:00
Harald Welte e8a5ab1122 RSL_Types: New tr_RSL_REL_REQ and tr_RSL_DEACT_SACCH templates 2017-12-09 22:34:57 +01:00
Harald Welte 6efa8e3940 RSL_Types: Fix RSL_IE_Cause (missing length octet) 2017-12-09 22:34:06 +01:00
Harald Welte cfa79adb83 BSSMAP_Templates: Add tr_BSSMAP_ClearRequest 2017-12-09 22:33:47 +01:00
Harald Welte 36975c8ef7 add missing BSSAP_CodecPort file 2017-12-09 21:39:57 +01:00
Harald Welte 4a267365fd RSL_Types: Add ts_RSL_RF_CHAN_REL_ACK and ts_RSL_MsgDiscType 2017-12-09 17:49:32 +01:00
Harald Welte 3ec493f9bc Osmocom_CTRL_Fucntions: Add f_ctrl_get_ratectr_abs and f_ctrl_get_exp_ratectr_abs 2017-12-09 16:25:29 +01:00
Harald Welte 0ac4667870 Osmocom_CTRL_Types: Permit * (wildcard) and fix pattern syntax 2017-12-09 14:19:58 +01:00
Harald Welte 852a384e5c Osmocom_CTRL_Functions: Add f_ctrl_get_exp() function to GET + match expected 2017-12-09 14:19:36 +01:00
Harald Welte 95a478172f Osmocom_CTRL_Functions: Make TRAP resistant (ignore TRAPs) 2017-12-09 14:19:03 +01:00
Harald Welte 5819b554ad IPA_Emulation: Don't send events to unconnected ports 2017-12-09 03:13:36 +01:00
Harald Welte 03c0e5600e IPA_Emulation: Send ASP_IPA_EVENT_UP even in client mode 2017-12-09 03:13:32 +01:00
Harald Welte a76c4bb7b9 Extend IPA_Emulation with support for CTRL 2017-12-09 02:06:07 +01:00
Harald Welte bdb63706b7 IPA_Emulation: Add comments 2017-12-09 01:15:44 +01:00
Harald Welte bc330beab7 RSL_Emulation: Move templates into RSL_Types 2017-12-09 00:56:36 +01:00
Harald Welte 7ae019e1a0 IPA_Emulation: split t_ASP_RSL_UD in send and receive template 2017-12-09 00:54:15 +01:00
Harald Welte f8a0bdaad5 BSSMAP_Templates: Add parameters to tr_BSSMAP_ComplL3 for better matching 2017-12-09 00:53:17 +01:00
Harald Welte 714ded9e75 library: Add RSL_Emulation.ttcn
This emulates the RSL part of a BTS towards a BSC
2017-12-08 14:00:22 +01:00
Harald Welte 9c0bddf293 General_Types: Make it work with TITAN 6.3.0
Somehow the TITAN 6.3.0 compiler is stricter...
2017-12-08 13:58:08 +01:00
Harald Welte 0d846a7e37 IPA_Emulation: Add support for RSL port
In addition to the MGCP and SCCP ports, we now also have a RSL port
through which other components can transceive RSL messages via IPA
2017-12-07 17:58:28 +01:00
Harald Welte da9d36c73e IPA_Types: Define IpaStreamId for up to 4 TRX 2017-12-07 17:57:17 +01:00
Harald Welte 101fbed2de RSL_Types: ts_RSL_CHAN_RQD needs access delay 2017-12-07 17:56:38 +01:00
Harald Welte 7ae931488f RSL_Types: Add RACH and PAGING LOAD templates 2017-12-07 17:56:15 +01:00
Harald Welte f4b068b3a0 RSL_Types: tr_RSL_MsgType() now accepts template as message discriminator
... avoids tiresome valueof() at every caller site
2017-12-07 17:54:55 +01:00
Harald Welte c287775e35 RSL_Types: add tr_RSL_PAGING_CMD / tr_RSL_IMM_ASSIGN templates 2017-12-07 17:54:35 +01:00
Harald Welte fff6930765 RSL_Types: ms_identity, full_imm_ass_info IE types 2017-12-07 17:53:42 +01:00
Harald Welte d5f521ef5c RSL_Types: Define RACH Load IE 2017-12-07 17:53:06 +01:00
Harald Welte 8f2c21d815 RSL_Types: Channel Mode contains a length byte 2017-12-07 17:52:40 +01:00
Harald Welte 15bb5b53db RSL_Types: L3_INFO has TL16V type, not TLV (i.e. 16bit length) 2017-12-07 17:52:04 +01:00
Harald Welte 319be826cb RSL_Types: Define each enumerated member
TTCN-3 enumerated seems to behave different than C enums, so you cannot
simply assume that the next element will have the previous element
value+1.
2017-12-07 17:50:26 +01:00
Harald Welte e09921fef2 IPA_Emulation: Change default params to const, export them and use empty string
This means we rather return an empty string in CCM_IDTAG responses,
rather than crashing due to non-defined record members.
2017-12-07 17:49:00 +01:00
Harald Welte 3b2ce0217f GSM_Types: Label some templates as (value) templates 2017-12-07 17:47:00 +01:00
Harald Welte e21096dbaf IPA_Emulation: Allow client/server to specify CCM parameters 2017-12-04 20:45:12 +01:00
Harald Welte 71a36023dc ggsn: Verify presence of DNS addresses in IPCP of PCO
If we request DNS in IPCP in PCO, we also expect a corresponding result.
2017-12-04 19:04:24 +01:00
Daniel Willmann 961e5c9d3b MGCP_Templates: Accept 200 and 250 as ACK for DLCX
Both codes are valid as response to a DLCX, see RFC3661 Ch 2.2:
"""
The 250 response code can be used to acknowledge a successful completion
of a DeleteConnection command.  However, a 200 response code is also
appropriate.
"""
2017-11-30 16:43:36 +01:00
Daniel Willmann fbef714394 MGCP_Templates: Change channel codec to AMR since this is how it's used 2017-11-30 16:43:11 +01:00
Harald Welte e98bb2e153 BSSMAP: Ignore RSPI for unknown endpoint/CIC 2017-11-29 12:09:48 +01:00
Harald Welte 1218883e15 IPA_Emulation: Properly dissect multiple IPA messages in one TCP segment 2017-11-29 12:03:32 +01:00
Harald Welte 26595451b3 IPA_CodecPort: Wrap f_IPL4_setGetMsgLen function 2017-11-29 11:46:24 +01:00
Harald Welte 92e9816df8 IPA: Add support for IPAC_IDTAG_OSMO_RAND
this is a non-standard RAND value used by osmo-bsc_nat.  The change
requires us to also properly define the individual IpaCcmGetPart
with a one-byte length value at its start.
2017-11-29 11:09:13 +01:00
Harald Welte a1f0cbcfbe ipa: PDU_IPA_CCM: Missing CROSSTAG to decode get/resp/other 2017-11-29 11:04:40 +01:00
Harald Welte 643e2a60b0 add RSL_Types.ttcn - untested definitions defining GSM A-bis RSL 2017-11-27 15:03:18 +01:00
Harald Welte 28d943ef35 ts_BSSMAP_HandoReq: Hand in raw list as argument, not IE type
Also, add new ts_BSSMAP_Paging() template.
2017-11-25 15:01:16 +01:00
Harald Welte 92632e1dce ipa: Enable configuration on whether MGCP should use old or new IPA stream ID 2017-11-25 02:31:20 +01:00
Harald Welte 1dd8f3713b IPA_Emulation: Introduce template for ASP_IPA_Unitdata 2017-11-25 02:25:27 +01:00
Harald Welte 5aa1803ef9 Move MGCP_CodecPort to library directory 2017-11-25 02:05:04 +01:00
Harald Welte 9ca9eb1648 BSSMAP_Emulation: Set verdict to 'fail' in various lookup error paths 2017-11-25 00:50:43 +01:00
Harald Welte 0a4317a805 ipa: Close SCCP Connection from MSC side; set verdict on BSC side 2017-11-25 00:50:31 +01:00
Harald Welte be620f6da6 ipa: Give all components proper names to aid log interpretation 2017-11-25 00:23:54 +01:00
Harald Welte 66fecd46a8 MSC_ConnectionHandler: Fix E1 timeslots to be monotonically incrementing 2017-11-24 23:54:44 +01:00
Harald Welte c859df518f BSC_MS_ConnectionHandler: implement MGCP request->response handling 2017-11-24 23:41:41 +01:00
Harald Welte 525a9c118d BSSMAP_Emulation: Fix regex for extraction of MGW endpoint number
Don't use perl regex syntax ".*' but simply "*"
2017-11-24 23:40:41 +01:00
Harald Welte 1b2748eb7b BSSMAP_Emulation: CIC extraction must happen on BSC side, not MSC side 2017-11-24 23:40:16 +01:00
Harald Welte 9002957584 MGCP_Templates: More templates (for the MGW side) 2017-11-24 23:39:50 +01:00
Harald Welte 4c11d56f2d move MGCP utility functions from MSC_ConnectionHandler to MGCP_Templates 2017-11-24 23:39:00 +01:00
Harald Welte 7dc5d37b33 MGC_Types: Add work-around for failure to distinguish between Cmd + Resp 2017-11-24 20:52:06 +01:00
Harald Welte 51f34ada61 MGCP_Templates: Add missing 'any' for trans_id in tr_CRCX_ACK 2017-11-24 20:52:06 +01:00
Harald Welte c82eef458d ipa: Further progress on the bsc-nat test suite 2017-11-24 20:52:06 +01:00
Harald Welte 19ad52b3b9 IPA_Types: Fix length encoding during transmission of OSMO_EXT packets
The extra byte for further demuxing must be included when computing
the payload length from the (classic) IPA header point of view.
2017-11-24 20:52:06 +01:00
Harald Welte 4029e8cd03 Move MGCP_Types.ttcn to library; extract MGCP_Templates.ttcn to library 2017-11-24 20:52:06 +01:00
Harald Welte 2a8f847f6f WIP: attempt at IPA extended StreamID support 2017-11-24 20:52:06 +01:00
Harald Welte 7ed2b08006 BSSMAP_Templates: fix unbound rR_Cause member in Assignment Complete 2017-11-23 18:52:13 +01:00
Harald Welte 5cc4aa2f06 BSSMAP_Emulation: Fix handling of userData
We cannot pass an unbound octetstring record member into a template
argument of a function :/
2017-11-23 18:51:28 +01:00
Harald Welte ab05d6cf97 BSSMAP_Templates: Correct name is AssignmentReq, not AssignmentCmd 2017-11-23 18:50:52 +01:00
Harald Welte b3414b2172 ipa: First version that emulates both MSC and BSC up to ASSIGNMENT REQ 2017-11-23 18:23:38 +01:00
Harald Welte 365f4edbd8 IPA/MSC/BSC Emulation: Framework for handling multiple SCCP connections 2017-11-23 00:00:43 +01:00
Harald Welte c76f29f094 ipa: Pull everything together: L3->BSSAP->SCCP->IPA 2017-11-22 12:46:46 +01:00
Harald Welte d86cdc6811 Expand IPA emulaitpn code + example to include CCM and SCCP binding 2017-11-22 00:45:07 +01:00
Harald Welte 00566f55f0 initial import of new IPA test port 2017-11-21 16:43:49 +01:00
Harald Welte 04d74cdcde Add ASP_ConnId_ReadyToRelease in all translation ports using IPL4asp
This is required after update to IPL4asp R.29.A of 2017-Oct-17
2017-11-19 09:29:51 +01:00
Harald Welte 244cd8acf7 sysinfo: Fix the TC_telnet test case VTY command order 2017-08-26 09:25:20 +02:00
Harald Welte b26cfffeda LAPDm_RAW_PT: Use default L1CTL socket
The L1CTL socket path can be configured as module parameter of
the L1CTL_PortType module, so there's no need in repeating that
configuration inside LAPDm_RAW_PT
2017-08-25 09:56:47 +02:00
Harald Welte f68765d2e5 L1CTL_PortType: Make osmocom_l2 socket configurable as module parameter 2017-08-20 22:54:57 +02:00
Harald Welte f97649269a sysinfo: Fix compilation 2017-08-20 22:47:44 +02:00
Harald Welte 303c19ad63 Add Native_Functions module for inet_addr / inet_ntoa 2017-08-19 13:52:36 +02:00
Harald Welte ddeecbb4ed GGSN_Tests: Make SGSN and GGSN addresses configurable via modulepar 2017-08-19 11:50:08 +02:00
Harald Welte 9d3485243a RLCMAC: Integrate encoding/decoding of Control Message Payload
Rlcmac{Dl,Ul}CtrlBlock now contain Rlcmac{Dl,Ul}CtrlMsg rather
than an octetstring payload.
2017-08-01 00:27:39 +02:00
Harald Welte 422f072176 RLCMAC_CSN1: Add "other" for not-yet-implemented message types 2017-08-01 00:27:06 +02:00
Harald Welte 4b6c772b15 LAPDm_RAW_PT: Add support for TBF mode (GPRS) 2017-08-01 00:07:12 +02:00
Harald Welte 1dcc371539 Add Definitions for GPRS coding schemes 2017-08-01 00:05:52 +02:00
Harald Welte 2072ab6698 RLCMAC: enc__RlcmacUlDataBlock: fix 'omit' for PFI / TLLI
It's not sufficient to check if the value is bound; we must also make
sure that the value is not OMIT.
2017-07-31 18:33:35 +02:00
Harald Welte 78a1af6782 RLCMAC: Fix encoding/decoding of 'union' types
We must supply hand-written C++ functions for encoding/decoding
the union types.
2017-07-31 17:33:56 +02:00
Harald Welte 5aa500791e move LAPDm_types to library + make lapdm executable compile again 2017-07-31 16:15:56 +02:00
Harald Welte efbc2fca24 RLCMAC: Add Rlcmac{Ul,Dl}Block unions to cover both Control + Data blocks 2017-07-31 00:19:13 +02:00
Harald Welte cf28881687 move LAPDm_RAW_PT.ttcn to library 2017-07-30 22:52:27 +02:00
Harald Welte 43e060a50d Add hand-written encoder/decoder for RLC/MAC UL/DL data blocks
Their format is simply too complex to be used with the automatic RAW
encoder/decoder.  Let's implement it by hand, using the automatic
coder whenever possible.
2017-07-30 22:38:03 +02:00
Harald Welte 88849c61b2 L1CTL_Types: Split t_IMM_ASS() off t_RR_IMM_ASS()
It's useful to have a separat template only for the IM_ASS part, without
RR header.
2017-07-30 17:19:41 +02:00
Harald Welte b3c226ebde L1CTL_Types: Add support for L1CTL_DATA_TBF_{REQ,CONF}
Those two L1CTL primitives are extensions of L1CTL for GPRS operation
2017-07-30 17:19:24 +02:00
Harald Welte 6f3c223b9a GSM_Types: Fix RSL Chanenl number encoding; Add OSMO_PDCH extension 2017-07-30 17:17:12 +02:00
Harald Welte 1b9b77096d GSM_RR_Types: Parse PacketChannelDescription 2017-07-30 04:19:14 +02:00
Harald Welte 9419c8aff7 Split RR portion of GSM_Types into GSM_RR_Types 2017-07-30 04:07:35 +02:00
Harald Welte d335cbcdb9 L1CTL_Types: Make t_RR_IMM_ASS match also TBF assignments 2017-07-30 00:51:23 +02:00
Harald Welte 00d4dace72 L1CTL_Types: Add upcoming L1CTL_TBF_CFG_{REQ,CONF}
Related primitives are used to configure L1 for GPRS / TBF operation
2017-07-30 00:50:32 +02:00
Harald Welte c84d847f01 GSM_Types: Fix encoding of RSL Channel numbers 2017-07-30 00:49:56 +02:00
Harald Welte bda65a31f5 GSM_Types: Fix MobileIdentity 2017-07-30 00:49:04 +02:00
Harald Welte d1209a6f04 Move "connect to L1CTL and RESET" function from LAPDm_RAW_PT to L1CTL_PortType 2017-07-29 12:55:06 +02:00
Harald Welte 484160bf21 library: Initial work on GPRS RLC/MAC encoder/decoder
For Downlink and Uplink RLC/MAC Control blocks this is already working
quite nicely.  Data blocks is not working, as their encoding cannot be
expressed in TTCN-3 RAW syntax, and a mixture of C++/native and
RAW-generated coder will be required.
2017-07-28 13:30:24 +02:00
Harald Welte 5b1ce8c4f4 move L1CTL modules to library for easier sharing with other test suites 2017-07-19 20:16:54 +02:00
Harald Welte 8542cefb8e Move VTY utility functions to new Osmocom_VTY_Functions module
... so it can be reused from other Testsuites/modules
2017-07-19 20:06:26 +02:00
Harald Welte 3b8bdd6358 Introduce 'library' directory for modules shared by multiple test cases 2017-07-19 19:57:26 +02:00