Commit Graph

896 Commits

Author SHA1 Message Date
Harald Welte 5e8573e9b7 NS_Emulation: Prepare NSConfiguration for non-IP providers
NSConfiguration currently contains parameters relevant only for IP
based transport.  Move IP/UDP parameters into a sub-structure in
anticipation of Frame Relay support.

Change-Id: I6904520d8c2f546327029777d68b1907611a8cf5
2020-09-27 09:15:32 +00:00
Harald Welte 9a7c512bbd NS_Emulation: Fix Tns-alive/Tns-test expiration detection
Change-Id: Icb7d076f57c166b498c1b3edd84edcf13ea9739d
2020-09-25 10:01:53 +00:00
Alexander Couzens 904f50115d Move RAW_NS to library to use it in SGSN NS tests
Change-Id: I5a0e62cc9f032c515188530c0ceee29061fe11d2
2020-09-25 01:31:44 +02:00
Pau Espin befd3aaca4 mgw: Introduce test TC_crcx_osmo_ign
Related: SYS#5063
Change-Id: I79415c385e89fe859854430bb20940f078fccea0
2020-09-22 19:32:11 +00:00
Vadim Yanitskiy befa21c5c9 {BTS,PCU}_Tests: bump default PCUIF version: 9 -> 10
Both osmo-bts and osmo-pcu are switching to PCUIFv10 soon, so let's
use the new version by default.  For older (latest) IUT versions
not supporting PCUIFv10, one would need to override this module
parameter in {BTS,PCU}_Tests.cfg.

Change-Id: I9350c4a54434c3d46ce9424f382ca0057e58d053
Related: SYS#4868, SYS#4915
2020-09-22 00:53:26 +07:00
Alexander Couzens 3ee8268e91 NS_Provider_IPL4: map the IPL4 port to the system port before using it
Change-Id: Ia588ff82764e531c14665454eed035cd17b047ad
2020-09-17 23:54:42 +02:00
Alexander Couzens e0f7c543b7 NS_Emulation: remove dependency on PCUIF_Types
The dependency of PCUIF_Types creates also a dependency on

Replace the PCU_AddrType by an unix like address family defined
in the Osmocom_Types to reduce the dependency.

Change-Id: I0b4fda96accef401ffc009010f9f5621583fd6dd
2020-09-17 23:29:16 +02:00
Harald Welte 013d65af1e NS_Emulation: Introduce NS_Provider underneath NS_Emulation
This is a step to prepare the NS_Emulation for operating on top of
Frame Relay, not just UDP/IP.  We replace the NS_CodecPort (mapping to
a IPL4asp) with a newly introduced NS_Provider_CT, specifically a
NS_Provider_IPL4_CT.

This change removes any IP specific bits from NS_Emulation and moves
it into the newly-created NS_ProvideR_IPL4.

Change-Id: I4d0b7ad0ed9447a038dd3eeee2b975146d10fba0
2020-09-17 15:26:52 +00:00
Harald Welte 07cb87a90c BSSGP_Emulation: Fix build without BSSGP_EM_L3
Change-Id: Ic58e2d6bc37cb8fd8f0235b8497f674db7cfdd85
2020-09-17 15:26:52 +00:00
Alexander Couzens efca79da05 PCUIF_Types: fix version 9 remote address
Change-Id: I8a337399632e11d8a376e7a7fa3ff7a2396a80b1
2020-09-16 18:41:27 +00:00
Pau Espin 563b3d013b mncc: Support IPv6 addresses (new version mncc 7)
Apparently commit 06b859ca31 forgot to
bump the MNCC_SOCK_VERSION field from 5 to 6.

Change-Id: I5448ff931ec33f24f4837a51376f1703fe97683b
2020-09-16 10:36:44 +00:00
Pau Espin 28aa466dd9 library: CBSP_Adapter: Improve robustness of rebind and reconnect
Change-Id: Ibafbc8496eeadd0ea1b97056ef3b8a92bc43e9f1
2020-09-16 10:24:40 +00:00
Vadim Yanitskiy 220fa204da fixup library/PCUIF_Types: version 10: do not add redundant padding
Unlike osmo-pcu, osmo-bts does check length of the messages received
over the PCU interface, so I7a532d7abff8af354e40c5d706bb882efc6f905f
caused all the related test cases in ttcn3-bts-test to fail.

Reverting it is not a solution, because we cannot maintain different
padding attributes for two different protocol versions.  Let's add
a wrapper function that would call enc_PCUIF_Message() and append
padding depending on the configured protocol version.  In addition,
let's add a module parameter that would allow us to (optionally)
disable padding for ttcn3-pcu-test.

This change makes all broken PCUIF specific test cases pass.

Change-Id: Ica9e0c49c8b16e7d585a481670762c6433c61118
2020-09-15 19:15:22 +07:00
Vadim Yanitskiy ca81392360 BTS_Tests: group hopping parameters into a separate record
Change-Id: Iedb5d858a2d4f5d5a45e7465ae6586b3ae4bbb72
Related: SYS#4868, OS#4708
2020-09-14 09:04:39 +00:00
Harald Welte 93331e736b BSSGP_Emulation: Make L3 (SM/GMM) decoding a compile-time option
This allows us to build low-level tests that don't require all of L3.

Change-Id: I7ef7e93e2cd1d37e7e4a62947ca8dfde30d93b95
2020-09-13 10:18:41 +02:00
Harald Welte 6ce47c3ea7 lib: Move ts_RaCapRec from RLCMAC_CSN1_Templates to L3_Templates
There is no reason whatsoevery why a L3_Templates.ttcn file should
ever include types from RLC/MAC.  This creates a dependency nightmare.

The type for which ts_RaCapRec is written (MSRACapabilityValuesRecord)
originates from titan.ProtocolModules.MobileL3 so it's completely
unclear how any of that ever related too RLC/MAC.

Change-Id: Ie1ccef090ad51e26ccae17998e4294c6e27cf9c8
2020-09-13 10:18:41 +02:00
Harald Welte 557c9f8cb8 move some key types from GSM_RR_Types to GSM_Types
This in turn means Osmocom_Gb_Types doesn't need to depend on
GSM_RR_Types anymore, which is particularly ugly as the latter
now depends on RLCMAC_*, creating a long chain of dependencies.

Change-Id: I8c8da7709695ff0023f71b3999291e2515b22e46
2020-09-13 10:18:41 +02:00
Alexander Couzens 4231de67fc library: Osmocom_Types: fix extra indention tab
The top level context doesn't have an indent.

Change-Id: Ib94fa74a7752f21ba8203a5de17ce2b10d800d16
2020-09-11 20:24:19 +02:00
Alexander Couzens 5e6ae79d0c library: GSM_Types: fix extra indention tab
The top level context doesn't have an indent.

Change-Id: Ifece2e9fa782f173665e10fa9174403cccac7eb6
2020-09-11 20:24:19 +02:00
Vadim Yanitskiy a93088ae64 library/PCUIF_Types: version 10: do not add redundant padding
Change-Id: I7a532d7abff8af354e40c5d706bb882efc6f905f
2020-09-11 12:58:00 +00:00
Alexander Couzens 1e5dc48213 library/PCUIF_Types: version 10: support IPv6 NSVC addr
Change-Id: I13b03c380edc2dc609c5e4053462a3cd6f78ce72
Tweaked-By: Vadim Yanitskiy <vyanitskiy@sysmocom.de>
Related: SYS#4915
2020-09-11 10:35:56 +00:00
Pau Espin 08005d7475 library/RTP_Emulation: Close previous socket after rebind
If test calls RTPEM_bind twice, the previous socket is kept open
(ConnId 1) while the new one is assigned to the the expected ConnId for
RTP/RTCP packets received (ConnId), however, if remote was already
sending packets, it may happen that the port still receives those with
ConnId=1, which may make test fail with message:
"Received unexpected type from RTP"

Change-Id: I73f4af4e590dd3958e3f4d1dba0496c0750d642d
2020-09-09 11:43:51 +00:00
Vadim Yanitskiy 43ccaf51f2 library/PCUIF_Types: version 10: add Mobile Allocation length field
My initial assumption was that we can skip redundant '0'B bits or
even '00'O octets in the Mobile Allocation IE, and thus reduce
the overall size of this element.  Unfortunately, this is wrong.

3GPP TS 44.018, section 10.5.2.21 clearly states that the Mobile
Allocation IE contains a bit-string of size NF, where NF is the
number of frequencies in the cell allocation.  If NF % 8 != 0,
then '0'B padding bits must be appended to make it octet-aligned.

In other words, if the cell allocation contains let's say 13
frequencies, but a hopping timeslot makes use of only a small
fraction of it (e.g. 4 first channels), we would still need to
transmit at least 13 bits (+padding), including all redundant
bits and octets.

In RLC/MAC frames though it's not required to make the bit-string
octet aligned, so we need to send exactly NF bits without padding.

In order to achieve that:

  a) add MA length field to INFO.ind (record PCUIF_InfoTrxTs);
  b) ajust the existing test cases to use this field.

It's safe to merge this change as the related patches have not
been merged to osmo-pcu and osmo-bts yet.

Change-Id: I2709673c90a0cd7d76de9db8b8ad82ac59ca84a0
Related: SYS#4868, OS#4547
2020-09-08 19:04:20 +00:00
Vadim Yanitskiy ac1a4fddc7 library/BSSAP_LE_Types: fix: add missing FIELDLENGTH attributes
Otherwise TITAN would refuse to decode any messages:

  Dynamic test case error: While RAW-decoding type
  '@BSSAP_LE_Types.PDU_BSSAP_LE': Can not decode type
  '@BSSAP_LE_Types.PDU_BSSAP_LE', because invalid message was received

Change-Id: I3db7e8784efd067ccf0bc7dbc234d9b4ff1c033c
Related: OS#4597
2020-09-08 18:26:19 +00:00
Pau Espin 6a846bca2c library: Add template helpers for AoIP Transport Layer Address
This way one can simply pass an IP addr in string format and return the
IE no matter the IP version.

Change-Id: I743dbb7c89e504762498b7f278c12e130352e5f0
2020-09-07 08:05:28 +00:00
Pau Espin 384e949cd2 library/MGCP_Templates: Apply MGCP AddressType based on provided address
Change-Id: I1212abd31f6a4758105675908a1b7cb841caa3dd
2020-09-07 08:05:28 +00:00
Alexander Couzens 9843b66952 Osmocom_Gb_Types: add a simple tr_NS_STATUS()
Change-Id: I0de6c483361a00a924a278a77151253450a0c1a2
2020-09-07 06:12:51 +02:00
Vadim Yanitskiy 5fec37c0d5 library/GSM_RR_Types: add minimalistic HandoverCommand
Similar to [1], the existing implementation [2] is unfriendly
to use, so let's work this around by defining a minimalistic
implementation of (RR) Handover Command.

[1] If1a5244a688abed6e6de2bf3f6e19e0e28129ea5
[2] titan.ProtocolModules.MobileL3_v13.4.0
    MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS

Change-Id: I08e6d33a725f99e2c92f93153b2369c4c764c012
Related: SYS#4868, OS#4545
2020-09-02 19:02:42 +07:00
Vadim Yanitskiy 480c2ac415 library/GSM_RR_Types: cosmetic: fix formatting in RrL3Union
Change-Id: I00bcc5ebb6e098f8ec4986a3dec7e6d7e31e12f8
2020-09-01 17:15:21 +07:00
Vadim Yanitskiy 27b3801bed library/GSM_RR_Types: add minimalistic AssignmentCommand
Unfortunately, the existing implementation [1] is somewhat
incomplete and unfriendly to build templates on:

  - some fields holding integer numbers defined as BITx,
    so we would have to do bit2int() / int2bit();

  - some bit-map fields defined as octetstrings;

  - some fields are not decoded at all (raw octetstrings).

Let's work this around by defining a minimalistic implementation
of (RR) Assignment Command with all mandatory and some optional
fields.  Reuse some IEs directly from MobileL3_RRM_Types.

[1] titan.ProtocolModules.MobileL3_v13.4.0
    MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS

Change-Id: If1a5244a688abed6e6de2bf3f6e19e0e28129ea5
Related: SYS#4868, OS#4545
2020-09-01 14:43:33 +07:00
Neels Hofmeyr 1393d02d0d comment: Osmocom_CTRL: fix example for f_counter_name_vals_list_add()
Change-Id: I2ff77176267058ced3639a42127f0063bed2fd60
2020-08-31 16:40:11 +00:00
Vadim Yanitskiy e02dbcce9f library/RSL_Types: add missing Channel Identification IE
Change-Id: I4698fd15a14ee55aa4004d80e65912531f78cf06
2020-08-31 15:05:57 +00:00
Vadim Yanitskiy c3156ed104 library/GSM_RR_Types: add receive templates tr_ChanDesc{H0,H1}
Change-Id: I1ff98c97f2670e47be5e03f3540a4e2ec8e4c373
2020-08-31 15:05:57 +00:00
Vadim Yanitskiy 7d6eef3a72 library/GSM_RR_Types: restrict Mobile Allocation length
Change-Id: I8333900949c0f39dc1cb777904e207ed1e212440
2020-08-31 15:05:57 +00:00
Vadim Yanitskiy 27057e0e23 library/Osmocom_Types: fix f_rnd_ra_cs(): ensure non-emergency RA
Change-Id: Idbb2a2c7c2024adea5ff5ee639aeca6eab8ebb3b
2020-08-31 15:05:57 +00:00
Vadim Yanitskiy 146efe6391 library/Osmocom_Types: fix: '10111111'B is a valid emergency RA
Most likely, the second part of the condition was copy-pasted
from ra_is_ps(), where the specs. require that at least one
of the three LSB's shall be zero.  This requirement does not
apply to emergency RA values in range '101xxxxx'B.

Change-Id: I4c923682edfeee9c6bf3aeeeb67438809a54109f
2020-08-31 15:05:57 +00:00
Harald Welte a803b72488 library: Add BSSLAP_LE_{CodecPort,Emulation}
Those two modules are analogous to BSSAP/BSSMAP CodecPort and Emulation,
but for the Lb interface (BSC-SMLC) instead of the A interface.

Change-Id: I92fd91056731abb8d3c01560f80c01c6a48a6fc9
2020-08-30 16:07:00 +00:00
Harald Welte f7c2b20741 TTCN-3 definitions for BSSMAP-LE and BSSLAP protocols
Both are part of GSM LCS and are spoken between BSC and SMLC

Change-Id: If31830be2c8e1b624579f6663e74955763db9d0e
2020-08-30 16:07:00 +00:00
Pau Espin c03eb12b58 pcu: Test Downlink UNIT_DATA messages from SGSN containing IMSI IE
osmo-pcu.git 0052051c07af63da98137c9f8e3b3119642eb587 introduced a bug
(fixed in 1d68cdff928f32941aff36c70e4543203c283d15) where no MS could
GMM attach to the network, but no test showed the issue.
This couple test verifies both correct behavior and also ensures wrong
IMSI is detected and reported.

Related: OS#4729
Change-Id: I5072d80b7ed9945a6083cdf3254efb8b8f119c54
2020-08-29 07:56:46 +00:00
Vadim Yanitskiy 4806396589 BSSMAP_Templates: add tr_BSSMAP_IE_Cause and tr_BSSMAP_SAPInReject
Change-Id: Ibf80419df4d198a1aa6f52087bd9356231de65f5
Related: SYS#5047, OS#4728
2020-08-28 18:18:11 +07:00
Vadim Yanitskiy 8352af7502 library/BSSAP_CodecPort: turn conn_id into a template param
Change-Id: I9b9ccee970b3a5bf608f2bdba51b317e35e678c7
2020-08-28 18:17:55 +07:00
Vadim Yanitskiy 6f9f7d2662 library/Osmocom_Types: share RA generation helpers from BTS_Tests
Change-Id: I7c9c3d243b39bbd3d521009d23c1043df729ee10
2020-08-28 05:56:39 +07:00
Vadim Yanitskiy 74e1f6b5d6 library/GSM_SystemInformation: move 'MobileAllocationT' to GSM_RR_Types
Change-Id: I149cf58c4bc1a8e08c69c52eb567706a0de4f9f1
2020-08-28 05:55:58 +07:00
Vadim Yanitskiy 3b464a9812 library/GSM_RR_Types: s/MobileAllocation/MobileAllocationLV/g
Change-Id: Ica803221e885b4746fd42c17cd2828c0ef35a6aa
2020-08-28 05:55:58 +07:00
Vadim Yanitskiy d8051724ff library/PCUIF_Types: fixup: keep PCUIF_InfoV10Trx aligned
Change-Id: I92ba84c5d1f77c86f7871c488965f6345c2dbbe2
Related: SYS#4868, OS#4547
2020-08-22 02:33:26 +07:00
Vadim Yanitskiy 0d59080469 library/PCUIF_Types: fix typo: s/local_pprt/local_port/g
Change-Id: Ic81469107d16c47f02db93a4fe9c35b7825d74b5
2020-08-21 11:59:00 +00:00
Harald Welte bae6be8acc GSM_RR_Types: Fix compiler warning
GSM_RR_Types.ttcn: In TTCN-3 module `GSM_RR_Types':
 GSM_RR_Types.ttcn:957.2-983.2: In template definition `ts_IMM_ASS':
  GSM_RR_Types.ttcn:957.2-983.2: While checking template restriction `value':
   GSM_RR_Types.ttcn:146.14-16: warning: Inadequate restriction on the referenced template parameter `len', this may cause a dynamic test case error at runtime
   GSM_RR_Types.ttcn:145.44-63: note: Referenced template parameter is here

Change-Id: I0d17102294430d23eb683e16d5ac66abe806f2c1
2020-08-21 13:17:59 +02:00
Harald Welte bd98295fcb L3_Templates: Fix compiler warning about missing qualifier
L3_Templates.ttcn: In TTCN-3 module `L3_Templates':
 L3_Templates.ttcn:120.1-125.1: In template definition `tr_MI_IMSI':
  L3_Templates.ttcn:122.25-124.2: In template for record field `oddEvenInd_identity':
   L3_Templates.ttcn:123.11-28: In template for union field `imsi':
    L3_Templates.ttcn:123.23-28: In actual parameter list of function `@L3_Templates.f_tr_MI_IMSI':
     L3_Templates.ttcn:123.24-27: In parameter #1 for `digits':
      L3_Templates.ttcn:123.24-27: warning: Inadequate restriction on the referenced template parameter `imsi', this may cause a dynamic test case error at runtime
      L3_Templates.ttcn:120.37-59: note: Referenced template parameter is here

Change-Id: Ia6979dff7d3c58f8609ebe55de2550446c3f1781
2020-08-21 13:17:58 +02:00
Harald Welte 9bf43cc30d L3_Templates: fix compiler warning
L3_Templates.ttcn:1099.1-1108.1: In template definition `ts_ML3_MO_CC':
  L3_Templates.ttcn:1099.53-1108.1: warning: Field `msgs' is missing from template for record type `@MobileL3_Types.PDU_ML3_MS_NW'

Change-Id: Id131274ae7832846df6c09cbe6763b9e147ef372
2020-08-21 13:17:58 +02:00
Harald Welte 88ee36088c RAN_Emulation: Fix compiler warnings about unreachable code
RAN_Emulation.ttcn: In TTCN-3 module `RAN_Emulation':
 RAN_Emulation.ttcnpp:1294.1-1343.1: In function definition `ExpectedCreateCallback':
  RAN_Emulation.ttcnpp:1309.4-1313.2: In else statement:
   RAN_Emulation.ttcnpp:1312.3-12: warning: Control never reaches this statement
  RAN_Emulation.ttcnpp:1342.2-11: warning: Control never reaches this statement

Change-Id: I4e7cc0a7e6bff5c5e569458548fa70e814bd200c
2020-08-21 13:17:58 +02:00