Commit Graph

6939 Commits

Author SHA1 Message Date
Vadim Yanitskiy a908b43e59 debian/control: change maintainer to the Osmocom team / mailing list
Change-Id: I8c4e1749e6b4903877962b2da87be472e63c8de0
2020-08-13 16:09:02 +07:00
Vadim Yanitskiy 817ad9054e vty: fix vsub reference counting: call vlr_subscr_put()
Otherwise, each time the 3GPP TS 44.014 MS test commands (TCH loop)
are invoked, both subscriber_mstest_{close,open} functions add +1
to the subscriber's reference count, but never revoke it.

Change-Id: I0cefa5b5a0cb712080ba2afd322db329f19608e3
2020-07-29 05:57:27 +07:00
Vadim Yanitskiy 72e0f09c03 gsm_04_14: fix off-by-one error in create_gsm0414_msg()
This byte is redundant, and must not be allocated in this function.
A consequence of this error is that the MS alwats interprets the
"Sub-channel" IE as test loop A regardless of the specified type.

Here is an example of malformed Close TCH loop (type C) message:

  0f 00 00 04
  x. .. .. ..  - Skip indicator (see 3GPP TS 24.007)
  .x .. .. ..  - Protocol discriminator (see 3GPP TS 24.007)
  .. xx .. ..  - Message type (CLOSE_TCH_LOOP_CMD)
  .. .. !! ..  - (!) Redundant byte from create_gsm0414_msg()
  .. .. .. xx  - (!) The actual "Sub-channel" IE (loop C, X=0)

Change-Id: Ia47225b884439dcd43be307e7351994e55fcd50d
2020-07-29 05:28:54 +07:00
Neels Hofmeyr d9fe7110ea Clear Command: set cause value to "Call Control"
So far, by failing to initialize the cause value, we always send a Clear
Command cause == 0, which actually means "Radio Interface Message Failure".
This is seen in all my logged network traces of osmo-msc lab testing.

"Call Control" seems to be the only cause value that remotely fits a normal
release procedure, even if it was not voice call related, see 3GPP TS 48.008
3.2.1.21.

Related: OS#4664
Change-Id: I1347ed72ae7d7ea73a557b866e764819c5ef8c42
2020-07-28 18:29:58 +02:00
Neels Hofmeyr 458fe3d789 manuals: generate vty reference xml at build time
Move 'doc' subdir further down to "make sure" the osmo-msc binary is built
before the docs.

Remove msc_vty_reference.xml from the source tree.

In manuals/Makefile.am use the new BUILT_REFERENCE_XML feature recently added
to osmo-gsm-manuals, and add a build target to generate the XML using the new
osmo-msc --vty-ref-xml cmdline switch.

Depends: I613d692328050a036d05b49a436ab495fc2087ba (osmo-gsm-manuals)
Change-Id: Ib872e7979c5b5a9da1347a3f326307844cf76536
2020-07-12 12:30:28 +00:00
Neels Hofmeyr 59de15614d is_reset_msg: use proper enum for rc value
Change-Id: I88b6204bc3ffac06f92bfc87639ce503b2da24bc
2020-07-09 01:20:19 +02:00
Neels Hofmeyr 5b36d13ba5 sgs_tx_loc_upd_resp_cb(): fix error handling for MI encoding
new_id_ptr should be passed as NULL if encoding the TMSI failed, so initialize
it accordingly.

Also add some bloat to better handle the case of an encoding error, even though
from code analysis that should not be possible here: there is enough buffer,
the MI is a TMSI encoded from a uint32_t...

The problem was introduced by Idfc8e576e10756aeaacf5569f6178068313eb7ea, before
which new_id_len was always 0 when no TMSI was present.

Related: CID#210894
Change-Id: I800c5dca3fdbdedf70a64d9fd5a1bdfd1397f431
2020-07-01 23:33:16 +02:00
Neels Hofmeyr b697274daa refactor: move RESET Osmux TLV parsing to ran_msg_a.c
ran_peer.c is not the proper place to parse messages, because it should be RAN
agnostic. All parsing and encoding belongs in ran_msg_a.c and ran_msg_iu.c.

Move the Osmux TLV parsing into the is_reset_msg op: add supports_osmux
out-parameter (and add a logging fi pointer). To be able to modify msg->l3h,
also make the msgb arg non-const.

In ranap_is_reset_msg(), always return non-support for Osmux.

In bssmap_is_reset_msg(), return 0 if no TLVs were parsed, 1/-1 if an Osmux TLV
was present/not present.

Update the osmux support flag directly where the ConnectionLess message is
received, so that there is only one place responsible for that.

Related: OS#4595
Change-Id: I1ad4a3f9356216dd4bf8c48fba29fd23438810a7
2020-07-01 23:33:16 +02:00
Neels Hofmeyr 1139ca352b make vty-transcrip-test: use $VTY_TEST var like osmo-bsc
Adopt the same way to run manual vty transcript tests as in
osmo-bsc/test/Makefile.am.

There are different ways to select a specific test to run in osmo-bsc and here
in osmo-msc. The osmo-bsc way is more convenient when building outside the src
tree, because it does not need the full absolute path of the test file.

Change-Id: If1e2abfa321a5e9fb60358d1f0e4e448b33184af
2020-06-25 20:08:58 +00:00
Neels Hofmeyr 83cf10c8a6 propagate Compl L3 Info Cell ID to the VLR subscriber record
As soon as the subscriber is authenticated, update the VLR entry with the
MSC-A's full CGI, including the Cell Id received from the Complete Layer 3
Information.

Thus the Cell Id will be shown by vty 'show subscriber cache' and 'show
connection'.

This is tested by osmo-ttcn3-hacks Ie410714a96353f74a52a104c56fa0a08683e0004.

Related: OS#4627
Change-Id: Iee1781985fb25b21ce27526c6a3768bf70d4dc9a
2020-06-24 19:22:30 +02:00
Neels Hofmeyr 41c0333730 vty 'show connection': show msc_a->via_cell instead of vsub->cgi
For 'show subscriber cache', we print vsub->cgi. For 'show connection', it
makes more sense to print msc_a->via_cell.

This is tested by osmo-ttcn3-hacks Ie410714a96353f74a52a104c56fa0a08683e0004.

Related: OS#4627
Change-Id: I194271af2acb37b4f8cc2d106ab2fd2b0d443589
2020-06-24 19:21:40 +02:00
Neels Hofmeyr 68f50dad76 add comments to clarify some complete l3 details
Change-Id: I6e289900d38d97c346d615b71d36656254e6f2b5
2020-06-24 14:22:52 +02:00
Harald Welte a4a45252df osmo-msc.spec.in: Use %config(noreplace) to retain current config file
Change-Id: I00c3152b774a826230a112eae93b0e7c4d4f4c7a
2020-06-23 20:07:56 +00:00
Neels Hofmeyr a509a22b9e add osmo-msc --vty-ref-xml: dump VTY ref XML to stdout
Add only a long option to not clutter the cmdline namespace.

To add a long option without a short letter is slightly complex: use the 'flag'
and 'val' mechanism as in 'man 3 getopt' to write an option index to
long_option.

Make sure that all VTY commands have been added before parsing cmdline options:
move various VTY init further above. For msc_vty_init(), the global msc_network
already needs to be allocated, so also move that.

Depends: Ic74bbdb6dc5ea05f03c791cc70184861e39cd492 (libosmocore)
Change-Id: I9146d5a44427509265420f52ae6540ad93eb14fc
2020-06-23 12:39:29 +00:00
Philipp Maier 7da956e4c6 msc_ho: fix CALL IDENTIFIER in HANDOVER REQUEST
When msc_ho_send_handover_request() generates the HANDOVER REQUEST
message, it does not populate the call_id struct member.

In ran_msg_a.c the struct member call_id is used, but the
call_id_present flag is not set, which also prevents the call_id being
added to the message

Change-Id: I6b1b55b3f5a3092d9557dc2512020c766a9ff744
Related: OS#4582
2020-06-22 16:00:04 +00:00
Philipp Maier f34d945f4f msc_a: add callref as call id to ASSIGNMENT REQ.
The BSSMAP message ASSIGNMENT REQUEST may contain an optional CALL
IDENTIFIER IE. While this IE is optional some BSC implementions may
require it.

Change-Id: I4288f47e4a6d61ec672f431723f6e72c7c6b0799
Related: OS#4582
2020-06-22 16:00:04 +00:00
Harald Welte 53a5ff7da9 remove empty + unused ran_up_l2.c
Change-Id: I5a0fa6a78dd8f32912afc69f4b154caad44a9e78
2020-06-22 14:22:22 +02:00
Neels Hofmeyr 9aac5c2d21 add rudimentary NRI support for MSC pooling
This patch served for a manual testing counterpart for osmo-bsc to implement
MSC pooling.

This enables a basic MSC pooling setup, but for a production setup, osmo-msc
would still lack various features related to unloading subscribers to another
MSC as explained in 3GPP TS 23.236.

Change-Id: Iafe0878a0a2c8669080d757b34a398ea75fced36
2020-06-19 03:58:13 +02:00
Neels Hofmeyr 46d526a3df use new osmo_mobile_identity API everywhere
Depends: Ic3f969e739654c1e8c387aedeeba5cce07fe2307 (libosmocore)
Change-Id: Idfc8e576e10756aeaacf5569f6178068313eb7ea
2020-06-19 03:58:13 +02:00
Philipp Maier 20a6641a3f msc_vty: remove emergency-call command from network
when the VTY write the config file ist prints the configuration line
for emergency-call in network and in msc, however the presence of the
configuration line in network leads to a parsing error on msc startup.
The vty command probably got moved to node msc and it was forgotten
to remove the printing from network.

Change-Id: I4f3dac27723e7852f8f049fcfca5cccdc027734d
Related: OS#4548
2020-06-18 11:55:52 +00:00
Neels Hofmeyr 0ec7b23ee3 msc_vlr_test_gsm_ciph.c: fix IMEISV MI: even number of digits, clear odd bit
There is an invalid Mobile Identity in the msc_vlr_test_gsm_ciph test data.
This became apparent when applying the new osmo_mobile_identity API (in a
following patch). Current Mobile Identity API ignores the error.

Change-Id: Ib1d54c59acc8b716de471ca275f54f9d22da3574
2020-06-15 03:14:03 +02:00
Harald Welte 5c38c817f2 contrib/osmo-msc.spec.in: Enable SMPP in RPM builds
The SPEC file already included a build dependency to libsmpp34, but
then the compilation of osmo-msc didn't actually pass --enable-smpp
along, resulting in binaries without SMPP support - unlike the Debian
binaries, which do contain that part.

Change-Id: I223be7a735e97b32f7c0ff246cf826f109b0f686
2020-06-13 14:40:32 +00:00
Neels Hofmeyr a40adf78c3 vlr_subscr_rx_id_resp(): dont assert on received MI type
The Mobile Identity type is received on the wire, we asserting on its type
constitutes a DoS vector.

Change-Id: I2b2e25ef8e878e91a165018ba49f1609cfb5cbd0
2020-06-03 15:40:39 +00:00
Neels Hofmeyr 346a3b956f manual: link to new common cs7-config.adoc, remove some dup of that
Related: OS#2767
Depends: Ia2508d4c7b0fef9cdc57e7e122799a480e340bf7 (osmo-gsm-manuals)
Change-Id: Ie88dd2c7f7318a31ae04fbd6930346d92141fde5
2020-06-03 12:51:38 +00:00
Neels Hofmeyr 92b0246301 manual: Multiple Instances: tweak MNCC, add missing SGs doc
Change-Id: Ice610e3db132dc50b7ddc3f3e324e8ad1bba5864
2020-05-26 23:14:01 +02:00
Oliver Smith 201372616f Makefile.am: EXTRA_DIST: debian, contrib/*.spec.in
Change-Id: I83cf6ee3f974733e45b01c79242214fa32479416
2020-05-22 13:42:12 +02:00
Oliver Smith 0314593aa7 contrib: integrate RPM spec
Remove OpenSUSE bug report link, set version to @VERSION@, make it build
with CentOS 8 etc.

Related: OS#4550
Change-Id: If5499e11d872e629a018fc77d5adf5d0cb863d48
2020-05-20 08:50:18 +00:00
Pau Espin 3694631c1a ran_msg_iu.c: Avoid redefining osmo-iuh global variables
From ASAn on gcc 10.1.0:
+=================================================================
+==269368==ERROR: AddressSanitizer: odr-violation (0x559114a5b880):
+  [1] size=4 'asn1_xer_print' /git/osmo-msc/src/libmsc/ran_msg_iu.c:50:5
+  [2] size=4 'asn1_xer_print' /git/osmo-iuh/src/iu_client.c:85:5
+These globals were registered at these points:
+  [1]:
+    #0 0x7f6208d3869a in __asan_register_globals /build/gcc/src/gcc/libsanitizer/asan/asan_globals.cpp:341
+    #1 0x55911456d221 in _sub_I_00099_1 (/build/new/tmpdir/osmo-msc/tests/msc_vlr/msc_vlr_test_hlr_timeout+0x48d221)
+    #2 0x5591145e8e9c in __libc_csu_init (/build/new/tmpdir/osmo-msc/tests/msc_vlr/msc_vlr_test_hlr_timeout+0x508e9c)
+
+  [2]:
+    #0 0x7f6208d3869a in __asan_register_globals /build/gcc/src/gcc/libsanitizer/asan/asan_globals.cpp:341
+    #1 0x7f6207d8db91 in _sub_I_00099_1 (/build/new/out/lib/libosmo-ranap.so.3+0x47db91)
+    #2 0x7f62096eb0f1 in call_init.part.0 (/lib64/ld-linux-x86-64.so.2+0x110f1)
+
+==269368==HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_odr_violation=0
+SUMMARY: AddressSanitizer: odr-violation: global 'asn1_xer_print' at /git/osmo-msc/src/libmsc/ran_msg_iu.c:50:5
+==269368==ABORTING

Related: OS#4556
Change-Id: I702e9748eaaf2279c3764ba67f80f00ae9f2526f
2020-05-19 20:32:18 +00:00
Oliver Smith b092589ed1 contrib: import RPM spec
Copy the RPM spec file from:
https://build.opensuse.org/project/show/home:mnhauke:osmocom:nightly

Related: OS#4550
Change-Id: Ief0917ad6e7ce193a54fd0d2a5e665b56ff8bbea
2020-05-14 11:48:32 +02:00
Pau Espin c95c0b6dd6 Use OSMO_FD_* instead of deprecated BSC_FD_*
New define is available since libosmocore 1.1.0, and we already require
1.3.0, so no need to update dependenices.
Let's change it to avoid people re-using old BSC_FD_* symbols when
copy-pasting somewhere else.

Change-Id: Ifc89fffac0443d94f3e49555684975b293ef90fb
2020-05-09 19:18:40 +02:00
Vadim Yanitskiy 3c8fc13b39 SMS-over-GSUP: notify sender in case of RPL delivery failure
Change-Id: I8436601c4314395e28829960dc753778c37b1125
2020-04-26 23:55:48 +07:00
Vadim Yanitskiy 4547cf1c99 SMS-over-GSUP: notify sender about malformed GSUP messages
Change-Id: I27f00e69ff045cbf641ef21adf44fcd55cb8f889
2020-04-26 23:55:48 +07:00
Vadim Yanitskiy b1e46b17f7 SMS-over-GSUP: notify sender about unhandled GSUP messages
Change-Id: I7970349bd9d5c56a64c409e619e8b581682fef0b
2020-04-26 23:55:48 +07:00
Vadim Yanitskiy b6ec0999f0 SMS-over-GSUP: respond with error if net->sms_over_gsup is false
Change-Id: If14f8a394e691f86e0acbffb283c3862fe62ffd2
2020-04-26 23:55:48 +07:00
Vadim Yanitskiy 531d3a4b11 SMS-over-GSUP: move net->sms_over_gsup check to gsm411_gsup_rx()
Change-Id: I89988b7148b164af304ecae1f53b74f322fdc7bd
2020-04-26 23:55:48 +07:00
Vadim Yanitskiy 46b0f80e69 SMS-over-GSUP: clarify error message about unexpected MO/MT SMS
Change-Id: I34b25764f9ce9b09ccd28cf23fea01028d0828e0
2020-04-26 14:45:29 +00:00
Harald Welte 61ec0295fc vlr_auth_fsm: Fix compilation with gcc-10
See also: https://alioth-lists.debian.net/pipermail/debian-mobcom-maintainers/Week-of-Mon-20200413/000650.html

Change-Id: If3fdbfa20dec02ba57c582700dff12ebbb7d9439
2020-04-20 18:18:18 +00:00
Philipp Maier 72b8c38287 doc: do not use random ip-address for MGW
The example configs suggest to use a random ip-address as MGW address.
Lets use a loopback address here. This will suit the usual case where
MGW and MSC run together on the same machine.

Change-Id: Ie2b2094fdcfed45353d9ba22cb07eed626fd143c
2020-04-14 13:14:35 +00:00
Eric Wild b73ecbfab1 configure.ac: fix libtool issue with clang and sanitizer
As pointed out at https://github.com/libexpat/libexpat/issues/312
libtool does not play nice with clang sanitizer builds at all.
For those builds LD shoud be set to clang too (and LDFLAGS needs the
sanitizer flags as well), because the clang compiler driver knows how
linking to the sanitizer libs works, but then at a later stage libtool
fails to actually produce the shared libraries and the build fails. This
is fixed by this patch.

Addtionally LD_LIBRARY_PATH has no effect on conftest runs during
configure time, so the rpath needs to be set to the asan library path to
ensure the configure run does not fail due to a missing asan library,
i.e.:

SANS='-fsanitize=memory -fsanitize-recover=all -shared-libsan'
export CC=clang-10
ASANPATH=$(dirname `$CC -print-file-name=libclang_rt.asan-x86_64.so`)
export LDFLAGS="-Wl,-rpath,$ASANPATH $SANS $LDFLAGS"

Change-Id: I17d95c416e26dae6ca8bec57df01d3e7b7061058
2020-04-11 01:19:12 +02:00
Neels Hofmeyr d233104a04 manual: add missing mention of MGCP in "Multiple instances"
Change-Id: I91d06921e4dca08428bf45fc1a3fd6e124599371
2020-03-18 01:12:42 +01:00
Neels Hofmeyr ebf55f4b31 fix segfault: unsolicited Paging Response
Do not crash when a Paging Response could not be associated with a VLR
subscriber.

Related: OS#4449
Change-Id: Ie117949dd6da86afaa1a0a6ac57bf2111f6cff43
2020-03-09 21:02:31 +01:00
Vadim Yanitskiy 40b11c9ba4 libmsc/sdp: cosmetic: fix less-than-zero comparison of an unsigned value
Change-Id: I57ed17d8457ada69a3c22233f30339d2c0f65bce
Fixes: CID#206075
2020-02-09 04:05:08 +07:00
Vadim Yanitskiy ef830ef225 osmo-msc: use stderr to print error messages, not stdout
Change-Id: I702dd054d2e881b526f701ca482ec0f64ba8da28
2020-01-29 00:18:23 +07:00
Vadim Yanitskiy 2c889056f5 libmsc/gsm_04_11.h: remove unused sms_deliver definition
Change-Id: Icd4b0c45d994dd02d9118890eb5a1261a2008eca
2020-01-29 00:03:40 +07:00
Vadim Yanitskiy 5b19f6ed1e libmsc/gsm_04_08: use DRR in gsm48_rx_rr_pag_resp(), not DMM
Change-Id: I006c2b4c684dc6b96e98dbb82063a0aa37e33c66
2020-01-27 18:21:08 +00:00
Vadim Yanitskiy 6a9a3a779f libmsc/gsm_04_08: make use of msc_a in gsm48_rx_rr_app_info()
Change-Id: I2a0991c9bbf86b7eb248d74334f9472c56a3c964
2020-01-27 18:21:08 +00:00
Vadim Yanitskiy 9b56cd893b VTY: cosmetic: make struct cmd_node for GSMNET_NODE static
We don't need to expose it anyway.

Change-Id: Icbaed6b3b15aa719a19bb4be8fed347073025a22
2020-01-27 18:21:08 +00:00
Vadim Yanitskiy 064a1e0c54 msc/sccp_ran.h: fix: do not pass -1 to osmo_rat_type_name()
The problem is that osmo_rat_type_name() calls get_value_string(),
so we first cast -1 to 'const enum osmo_rat_type' and then to
'uint32_t'. Let's rather use OSMO_RAT_UNKNOWN.

Found by GCC with -Wextra in CFLAGS:

  warning: operand of ?: changes signedness from ‘int’ to
	   ‘const enum osmo_rat_type’ due to unsignedness
	   of other operand [-Wsign-compare]

Change-Id: I63ba355102d3cc035ba90121e06aba7cf1776aa0
2020-01-27 18:21:08 +00:00
Vadim Yanitskiy 601af0ca00 vlr_sgs_fsm: add missing break, do not call to_null() twice
Change-Id: Ib5d1d7633ca6c32d7d63bb1481f51355c97b90fb
2020-01-27 18:21:08 +00:00
Vadim Yanitskiy 3daf0c2786 vlr: remove unused parameter 'log_level' of auth_fsm_start()
We unconditionally use logging level of the parent FSM anyway.
All callers of auth_fsm_start() always pass fi->log_level.

Change-Id: If2fdf2564eb56d3d94ec3800bdcb0aabcad4e48d
2020-01-27 18:21:08 +00:00