Commit Graph

19 Commits

Author SHA1 Message Date
Daniel Willmann af7398acff gbproxy: Ensure BVC0 is reset before handling PtP BVCs
Change-Id: I9c67f973f7bca00e8eb22a024ef2282c007dd84b
Related: SYS#5226
2020-11-30 18:30:35 +01:00
Daniel Willmann e50550e409 gbproxy: Add NSE peer that can have multiple gbproxy_peers
We want this level of indirection to support multiple BVCs per NSE. The
current code assumes that an NSE only has one BVC which breaks messages
on the signalling BVC which should only be sent once to an NSE
regardless of the number of BVCs it contains.

Change-Id: I97cc6c8f8c0f1b91577ab8f679c4ae217cc88076
Related: SYS#5226
2020-11-30 18:30:35 +01:00
Daniel Willmann 5f677fdedd gbproxy: Remove test testing NSVCI change
This was overlooked in commit 82182d which already removed lots of
NS-specific code in gbproxy_test.c

From that commit message:
"""
Since NS2 has a different abstraction we mock up the prim send/recv
functions and don't test NS like the old tests did.
"""

Change-Id: Ic1d7e646e633c9fa62812f5005ed10c0108a06f2
Related: SYS#5226
2020-11-30 18:26:38 +01:00
Daniel Willmann b655010d95 osmo-gbproxy: Free msgb in ns2 prim callback
Commit cce88282388f in libosmocore changed the msg ownership model - the
callback that the user registers is now responsible for freeing the msg.

Change-Id: Iee940aba7d94afefb5957dbe5f0b04dcf951b31c
Related: SYS#4998
2020-11-09 10:54:09 +00:00
Alexander Couzens 951e133d17 Port gbproxy to NS2
Since NS2 has a different abstraction we mock up the prim send/recv
functions and don't test NS like the old tests did.

Related: SYS#4998
Change-Id: Iecfd0408a35a11638d254c1db3c1d477b1a11524
2020-11-06 18:45:05 +01:00
Neels Hofmeyr 7facc86304 use new osmo_mobile_identity API everywhere
Depends: If4f7be606e54cfa1c59084cf169785b1cbda5cf5 (libosmocore)
Change-Id: I4cacb10bac419633ca0c14f244f9903f7f517b49
2020-06-18 11:23:35 +00:00
Neels Hofmeyr 17d6134a3c gbproxy_test.c: fix mobile identity test data
Fix the final nibble of all IMSI BCD digits to 0xf, since it is a filler digit.

The encoded IMSI has an even amount of digits (14) and must contain a 0xf
filler nibble at the end. The test data looked correct due to repeated '1'
digits.

wrong hex: 11 12 13 14 15 16 17 18
correct:   11 12 13 14 15 16 17 f8
order:     1T 32 54 76 98 ba dc Xe  T = type, X = filler, 1..e = 14 digits

This error was found when applying the new osmo_mobile_identity API.

Change-Id: Ia006a3da6779ad1984f642e8ea29790a4daeb8b9
2020-06-18 11:23:35 +00:00
Harald Welte 06f3d5ae8b gbproxy_test: Fix test expectations of gprs_ns_rcvmsg()
gprs_ns_rcvmsg() in old libosmocore returns "number of bytes transmitted
by any response PDU we sent as a result of the received message", while
modern libosmocore simply retunrs '0' for any successfully received
message.  Let's make sure any non-negative responses lead to a
reproducible test output with both old and new libosmocore.

Change-Id: I7a48d14aed19825b87a02ccf9ee9cbfe0853342c
2019-02-26 22:37:57 +01:00
Pau Espin d7b95e3a24 Update wrong references to bsc in sgsn code
Change-Id: I93f0dc721c2eff8a87fb9248882f24768f708713
2018-10-30 17:35:31 +01:00
Pau Espin 1877d8e9b2 Drop gprs_msgb_copy with libosmocore replacement
gprs_msgb_copy was introduced in libosmocore 0.94
(f78ec5ce0d0f6038147d9b9e14d81094309ba5d5) as bssgp_msgb_copy. Let's use
that one to avoid code duplication.

Change-Id: I42a65fd8e4045fafadf5694f2d8d0c5e7ab350a0
2018-08-15 13:53:50 +02:00
Stefan Sperling 99dc488f72 finish gbproxy_parse_bssgp_unitdata test
The message this test is trying to parse is indeed invalid.
Add a comment showing the message in decoded form, and assert
that the parser rejects it.

Also, add a missing call to cleanup_test().

Change-Id: I2a86432d080c38d3c95626372a0129499d7146dd
Related: OS#3178
2018-06-23 16:51:30 +02:00
Stefan Sperling 606fb89fb4 add a test for OS#3178 (invalid unitdata message)
Add a test which reproduces the parsing problem. Whether this problem
is due to an invalid message or a parser bug is yet to be determined.
Until then, this test helps with analyzing the problem further.

Change-Id: I39189701a57c785ffdacc3ae26d7aa93bb06cde6
Related: OS#3178
2018-06-07 19:12:25 +02:00
Neels Hofmeyr 8de6b8677d use osmo_init_logging2(), fix regression test memleaks
Particularly gbproxy_test.c had various mem leaks, which (will) show up with
gcc (Debian 7.3.0-15) 7.3.0 address sanitizer. Fix those leaks to verify that
we don't have memleaks in the production code.

Change-Id: Ia4204c8b3d895b42c103edecb61b99d3d22bd36f
2018-04-16 01:03:48 +02:00
Neels Hofmeyr 6179f0ca36 implement support for 3-digit MNC with leading zeros
Add 3-digit flags and use the new RAI and LAI API from libosmocore throughout
the code base to be able to handle an MNC < 100 that has three digits (leading
zeros).

Note that in gbproxy_test.ok, 0-0 changes to 000-000 instead of 000-00, because
the parsed ra buffer is 000000 which results in 000-000, while 00f000 would
result in 000-00. IOW this is expected.

Change-Id: I7437dfaa586689e2bef0d4be6537e5577a8f6c26
2018-03-15 19:18:14 +01:00
Max 9f13b1401e Use gsm48_encode_ra() for RAI encoding
It has stricter type signature which increase the chance of spotting
misuse either via compiler warning or with automated scan. This also
paves the way for gsm48_construct_ra() deprecation in libosmocore.

Change-Id: I2c0f082dc7214ed57a40dad0788e34b838dfac97
Related: OS#1640
2018-01-19 15:11:00 +00:00
Max ca7be8a5c2 Migrate from OpenSSL to osmo_get_rand_id()
This avoids potential licensing incompatibility and makes integration of
Debian packaging patches easier.

The libosmocore version requirements are fine already but for jenkins
tests to pass we have to have Ic77866ce65acf524b768882c751a4f9c0635740b
merged into libosmocore master.

Related: OS#1694
Change-Id: I2b687b7f07ef05bbd861b8479cad5a958a3dde92
2017-12-27 11:10:42 +00:00
Neels Hofmeyr 4b4c586f03 move include/openbsc to include/osmocom/sgsn
Change-Id: I281ef585fffc2644682c8282224fb1c2da5ca795
2017-09-06 16:47:47 +02:00
Neels Hofmeyr 62507c5b8d split off osmo-sgsn: remove files, apply build
Change-Id: I5d27ff93e56cd13e0e70edd15e2080201e35e91f
2017-08-30 14:14:58 +02:00
Neels Hofmeyr d31c3fbaea move openbsc/* to repos root
This is the first step in creating this repository from the legacy openbsc.git.

Like all other Osmocom repositories, keep the autoconf and automake files in
the repository root. openbsc.git has been the sole exception, which ends now.

Change-Id: I9c6f2a448d9cb1cc088cf1cf6918b69d7e69b4e7
2017-08-27 17:40:52 +02:00