Commit Graph

6167 Commits

Author SHA1 Message Date
Alexander Couzens 2ddf399c5f debian: remove doublicated project name in example files
For example:
/usr/share/doc/osmo-bsc/examples/osmo-bsc/osmo-bsc.cfg -> usr/share/doc/osmo-bsc/examples/osmo-bsc.cfg

Change-Id: I8a9f45e72dd966ca3913b5483ff78039a3e472ea
2017-11-15 23:44:16 +01:00
Harald Welte 4a3b044ad7 osmo-bsc: Print NOTICE message on unimplemented BSSMAP UDT
When we receive unimplemented/unhandled message types, we shouldn't
simply silently discard them, but print a log message for the
benefit of the user.

Change-Id: I65489578b1c214f193b1ce0e9ba59432dcd42a3e
2017-11-12 14:36:11 +00:00
Philipp Maier 4aa2bac0bc mgcp: remove unused variable
The function handle_error asserts mgcp_ctx->conn to be non null,
but it does not access it otherwise.

remove unused variable conn

Change-Id: I09851c957395d1ddb2f9471b99ffc091bc250404
2017-11-12 14:22:46 +00:00
Philipp Maier 2a4c077fca mgcp: add missing out state
Even in the very early ST_CRCX_BTS phase, the error handler may
decide to go to ST_CALL in order to initate the termination of
a possibly half open connection.

Add ST_CALL to the out state list in ST_CRCX_BTS

Change-Id: Ic67aa7c67a4e98a38bff156be3ebf612012eb842
2017-11-12 14:22:46 +00:00
Philipp Maier 7cbea54544 cosmetic: replace term MGCP-GW with MGW
The term MGCP-GW is deprecated, use now MGW

Change-Id: Ibccda7e95c42267ce5f44e9fc4256a0083b6f68f
2017-11-12 14:22:46 +00:00
Philipp Maier 9b7678d65c cosmetic: reorder case list
the switch statement in fsm_send_assignment_complete() has the
default case at the beginning.

Move the default case to the end to match common coding style
rules

Change-Id: I360842fe899b95972c44da3cb74a3dc51b379fdc
2017-11-12 14:22:46 +00:00
Philipp Maier c9179fbcdd cosmetic: remove distracting newline
Change-Id: Iedc883b0f5760f004c51d7cf15328eb8c4d472db
2017-11-12 14:22:46 +00:00
Harald Welte f04e9c2f36 configure.ac/debian: Require libosmo-mgcp-client-dev >= 1.2.0
We recently started to use some symbols that were not available in
libosmo-mgcp-client-dev 1.0.0 or even 1.1.0.  Let's depend on a newly
tagged version of libosmo-mgcp-client.

Change-Id: Ic5d3add1c69181aabbdb684a01a6ba7bcea1fe2c
2017-11-11 23:24:16 +00:00
Neels Hofmeyr 7c980544f8 use osmo_sccp_inst_addr_name() instead of looking up ss7
Depends: libosmo-sccp I70ec5c8b42682a23f11a5820431c7e34e225709b
Change-Id: Idb451597c724ac87a391121cebd0b0a927dd49d1
2017-11-10 23:36:12 +00:00
Neels Hofmeyr 46e87509c5 osmo-bsc vty: be fatal for addressbook entry errors
So far, the config would log an error upon config parsing, and then continue to
use defaults, which is super easy to miss. On errors, return CMD_ERR_INCOMPLETE
to abort the program in a config parsing error.

Be fatal for non-existing addressbook entries and for using address book
entries from mismatching cs7 instances.

Though it is mixing in cosmetic changes, add "Error:" to the output and arrange
the erratic name to the end of the message, as is customary for error messages.

Related: libosmo-sccp I2f71b9c4dd30f919d2054da81283dd7035f44f60
Change-Id: Ia4e58902a2d3757b266cf35ac89f256cfb8f0eec
2017-11-09 01:17:33 +00:00
Neels Hofmeyr d317d6d608 osmo-bsc: SCCP addrs: default only if unset, reject invalid
So far, if the user entered an invalid SCCP address in the config, the
osmo_bsc_sigtran_init() code simply replaced that with the default, i.e.
running with a completely different address than the user may intend.

Use the default SCCP addresses only when they are unset by the user.

Default MSC addr: set directly, do not detour via cs7 instance PC. The default
MSC SCCP addr is just a point code + SSN, deriving it from the cs7 instance
first is a confusing step. Just set the PC and SSN, and done.

Using default addresses does not constitute an "auto configuration": if we set
up a cs7 instance automatically, we do not want to have to create a second one
automatically, to prevent "auto-confusion", and want to bail instead. But for
each MSC on its own, using default SCCP addresses makes sense and is orthogonal
to automatic cs7 instance creation. Hence drop the auto config semantics from
the default SCCP address parts.

Always validate the SCCP addresses we will end up using, and bail immediately
if they are erratic. i.e. don't overwrite a non-empty invalid SCCP address with
defaults, but straight bail.

Beneficial side effects:
- Fix some grammar ultra confusion in log messages.
- Add context: log the MSC number the logging refers to.
- Drop code dup: since we're always logging the used SCCP addresses, might as
  well log those once, unconditionally, in the end.

Change-Id: Iadbc2e9740457e1b389b7e7ad9c94274e7d8cb11
2017-11-09 01:16:37 +00:00
Neels Hofmeyr 13fcdcf2ee osmo-bsc RESET FSM: use distinct struct names
Use distinctive struct names: s/fsm_/fsm_bsc_reset/. They only exist
in the static context and it works fine, but the mad fsm-to-dot.py script
breaks with identical struct names. Can't hurt to have unique names.

Change-Id: I986377a74ccd83ca3b52e7f058bbc9115f05f741
2017-11-09 01:14:09 +00:00
Harald Welte 49d4939355 debian: Increase required libosmo-legacy-mgcp-dev version
Use the same version requirement as in configure.ac.

Change-Id: I2dc21e89bd676a754bc24a6995c4f9c0c4727d57
2017-11-09 06:17:14 +09:00
Harald Welte ec6bba5b7f debian: Add dependency to libosmo-mgcp-client-dev
Since Change-Id Ia2882b7ca31a3219c676986e85045fa08a425d7a, osmo-bsc
uses osmo-mgw and utilizes libosmo-mgcp-client to talk to it, so
let's make sure the Debian control file states that dependency.

Unfortuantely, this still won't make the osmo-bsc debian package
build again, as in fact the above commit uses symbols not even present
in 1.0.0 or 1.1.0 releases of libosmo-mgcp-client :(  So we first
need a new release of that library, and we need to update the
configure.ac and debian/control version requirements in osmo-bsc
before this is fixed.  This needs to be automatized in the future.

Change-Id: I41a0378d069f5383904cf92cc415c19beba26168
2017-11-09 06:15:36 +09:00
Neels Hofmeyr 6a12c76196 fix build: bssap test broke by undefined references
After the bssap test in Ie934c5d229140a89763bf2efff86d6a3766cd351, the
subsequent commit Ia2882b7ca31a3219c676986e85045fa08a425d7a was not tested
against the latest head, and its breaking bssap_test was not caught.

Fix current master of osmo-bsc's 'make check' target: add osmo_bsc_mgcp.c and
libosmo-mgcp-client dependencies to bssap_test linkage.

Change-Id: I28719d267452f66d65581c43433e24a9f46cf7dc
2017-11-07 23:02:08 +01:00
Philipp Maier 39c609b7c9 mgcp: use osmo-mgw to switch RTP streams
osmo-bsc currently negotiates the RTP stream directly with the
BTS and reports back the RTP IP/Port on the BTS. This works fine
for a single BTS, but for Handover the port/ip pointing to the
MSC side must not change, so an entity in between the BTSs and
the MSC is required.

Integrate the mgcp-client and use osmo-mgw to switch the RTP
streams.

Depends: osmo-mgw Ib5fcc72775bf72b489ff79ade36fb345d8d20736
Depends: osmo-mgw I44b338b09de45e1675cedf9737fa72dde72e979a
Depends: osmo-mgw I29c5e2fb972896faeb771ba040f015592487fcbe

Change-Id: Ia2882b7ca31a3219c676986e85045fa08a425d7a
2017-11-07 20:57:51 +00:00
Neels Hofmeyr 9eb208fcfb bssap: paging: page entire BSS for unimplemented cell id list
3GPP TS § 08.08 defines various types of Cell Identifier List IEs, but we only
implement "entire BSS" and "one LAC". If the MSC sends a Cell Identifier List
that we don't implement, it is best for interoperability to page the entire BSS
and post a log message instead of rejecting the paging altogether. Apart from
resource management, it is not harmful to page more than the MSC requested; if
use of resources becomes an issue, the log message will guide towards the
solution of providing an actually implemented Cell Identifier List IE.

Upon IE length that is other than we expect, log the error, but also fall back
to paging the entire BSS. Overall message length correctness has been checked
earlier.

The particular case observed is that a Huwaei MSC sends a LAI for Cell
Identifier List (MCC+MNC in bcd, followed by a LAC), parsing of which we may
want to add later.

Improve logging: identify the subscriber that is being paged.

Coding style: use a switch() statement to clarify flow and provide a place to
add more implementations later.

Add regression test bssap_test.c: fabricates BSSAP Paging messages with the two
implemented Cell Identifier List IEs as well as the unimplemented LAI
identifier, verify the resulting paging LAC in wrapped function and stderr.

Change-Id: Ie934c5d229140a89763bf2efff86d6a3766cd351
2017-11-07 04:08:44 +01:00
Max 36bf7974ab Check OML state per-BTS
To properly decide if a given OML link is degraded we have to use
BTS-specific information about MO state.

* move check function into BTS-specific part
* add generic wrapper

Related: OS#2486
Change-Id: Iddc7a4d20fbb95a6566eed1487a12733e5adb9e2
2017-11-02 15:58:08 +01:00
Neels Hofmeyr 848e1a566f vty: skip installing cmds now always installed by default
vty_install_default() and install_default() will soon be deprecated.

Depends: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b
Change-Id: If2edf59a687a78d6db6bc73117a27509374b0fc6
2017-11-01 00:48:52 +01:00
Harald Welte f3fb5f3ddf Bump version: 1.1.1.2-52cd → 1.1.2
Change-Id: I76a9ff8eb43b1038213f69a78985444e8b694e40
2017-10-29 09:03:34 +01:00
Harald Welte 52cde006f5 debian/control: Specify versions of packages we depend upon
Change-Id: Ide71f5029b14293ceda56ea5da715cd91a00c70f
2017-10-29 08:54:40 +01:00
Harald Welte 4c87cfe681 Debian: depend on libosmo-sigtran (bsc) and libosmo-sccp (bsc-nat)
Change-Id: I59c959a977b8ad4312766d86be879b16b34587cf
2017-10-28 22:00:09 +02:00
Harald Welte d1225f3f0c Bump version: 1.1.0.2-0ae59 → 1.1.1
Change-Id: I6aefde159b83608679000239cc1603ef076db219
2017-10-28 21:49:01 +02:00
Harald Welte 0ae59c2ffe Debian: re-introduce missing build dependency to libssl-dev
In Change-Id  I469909ad7c597cde3d7a7d2ec86101a9f41d3aa6 we accidentially
also removed the libssl-dev dependency.  osmo-bsc_nat still uses
RAND_getbytes directly, so we have to keep it for now, until we switch
to a future libosmocore-based mechanism that's in the works.

Change-Id: I3be26c566baf05278ba51b835a72e14ce6ecf3d0
2017-10-28 17:27:34 +02:00
Neels Hofmeyr c752351c5c jenkins: use osmo-clean-workspace.sh before and after build
See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale.

Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93
Change-Id: I9b6afb59f0a8037d1510a7fddb63927f10d653e5
2017-10-28 15:08:27 +00:00
Harald Welte 9bce2bd0ec Tag/Release Version 1.1.0
Change-Id: I61661b7f392a5485172d2f7087b4eb8b82607f43
2017-10-28 13:34:45 +02:00
Harald Welte 689ebadd49 Debian: osmo-bsc-dbg should cover only the osmo-bsc package
Change-Id: I3d2e7ce589e78bb4da6de3567462a6be4194174e
2017-10-28 13:34:45 +02:00
Harald Welte 4703991e72 Debian: Split off osmo-bsc-{bs11,ipaccess}-utils sub-packages
The names and descriptions have been imported/inherited from openbsc.git

Change-Id: Ia32e3645807ecf148f22cba3cab92f728074b20e
2017-10-28 13:30:01 +02:00
Harald Welte 322254f762 Don't link osmo-bsc_nat against libosmoabis
This fixes the following dpkg-shlibdeps warning:

Change-Id: Iea00c209652e8070a59942504bef660db0999e86
dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/osmo-bsc-nat/usr/bin/osmo-bsc_nat was not linked against libosmoabis.so.6 (it uses none of the library's symbols)
2017-10-28 13:29:29 +02:00
Harald Welte c233447271 Debian: Package osmo-bsc systemd service
Change-Id: I29cb5f2132047e05448f1a4f261ef5976936be29
2017-10-28 13:29:29 +02:00
Harald Welte 82ab3c8bab Debian: Don't package osmo-bsc_nat
We don't want to pacakge osmo-bsc_nat from osmo-bsc.git at this
point yet.  It only suports SCCPlite, which is not yet fully supported
by osmo-bsc.

Rather, we continue to package osmo-bsc_nat from openbsc.git like we did
so far.

Also, the osmo-bsc_nat binary really doesn't belong into the osmo-bsc
package at all.

Change-Id: Icf0bf80d61141ec060b6d2efcf3e65e2ef1ac2d6
2017-10-28 13:27:46 +02:00
Harald Welte 2d4e976dcc osmo-bsc_nat: Don't link against libosmonetif
This fixes the following dpkg-shlibdeps warning:

Change-Id: I31af5fb8b52ef1fd5effb139d9cdea1ebe9a41b4
dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/osmo-bsc/usr/bin/osmo-bsc_nat was not linked against libosmonetif.so.4 (it uses none of the library's symbols)
2017-10-28 13:14:24 +02:00
Harald Welte b069f6548c connfigure.ac: Depend on latest versions of libosmo-*
We are using quite a number of symbols that are definitely *not*
yet present in the respective library versions that we stated as
dependency. Rather than figuring this out individually, simply
require the latest releases.

Change-Id: Iecda06d206c24390bb10f3a8f8a70ef3036381e2
2017-10-28 13:14:24 +02:00
Harald Welte 6268987c5d Debian: Remove obsolete build dependencies
Those dependencies were introduced at a different time, when GPRS
related code was still in this repository

Change-Id: I469909ad7c597cde3d7a7d2ec86101a9f41d3aa6
2017-10-28 12:58:16 +02:00
Philipp Maier 718b0c72a0 log: output hexdump of transmitted sccp messages
We output a hexdump for each sccp message we receive, but not when
sending.

Also log the hexdump of sccp messages when sending.

Change-Id: Ibfe52a0b7dbca4c569c603a008d73d0d99d1c345
2017-10-26 16:08:00 +02:00
Philipp Maier df78e48eb0 log: log the sccp message type of messages sent
We already log the message type of sccp messages we receive, but
for transmitting the log output is missing.

Also log the message type for tramsitted sccp messages.

Change-Id: I6736f15ddc03e5f70c3504abffbae6cbf766c9d7
2017-10-26 16:08:00 +02:00
Harald Welte 5de728564c Rename osmo_fsm to avoid illegal space in name + more meaningful name
A FSM doesn't need "FSM" in its name, as it is obvious that it is a
FSM.  Also, having two that are called RESET is confusing, so let's
try to come up with better names.

Also, after Change-Id I9ef59432f43a3cdb94e4cbb0c44ac3f9b2aac0f2 in
libosmocore, we now enforce that no FSM identifiers contain spaces
or other illegal characters.

Change-Id: I1b44d26cebc4a47094d7b8b3983e5737b88bf003
2017-10-24 18:23:36 +02:00
Harald Welte 7b1d59c3c4 osmo-bsc: Initialize logging before initializing rate_ctr
The library code for rate counter initialization, which is called
from the descendants of bsc_network_alloc() might already want to
log something (particularly after Change-Id
Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 in libosmocore), so the
logging framework must be initialized before.

Change-Id: I1e893c97e023e63489fe8c46539b5e507d3cec8f
2017-10-24 18:23:36 +02:00
Harald Welte f2b04c65f4 nanobts_omlattra_test: Initialize logging before executing tests
... the library code we call could want to log something, after all.

Change-Id: Ic01e9bfb63d7b6def9432103e744c23c90f0f6b9
2017-10-24 18:10:33 +02:00
Harald Welte 824b27452f Fix nanobts_omlattr unit test
The test clearly fails unless bts->network is set correctly.  Not sure
why this hasn't shown up before?

Change-Id: I47786ed06ff610213d7a0b56d0ebf1c537cd7568
2017-10-24 18:10:33 +02:00
Pau Espin d1bec34ea3 bsc_vty: Improve description of mid-call-text cmd
Change-Id: I367b7734390daf39160de6462e9b2210368666f4
2017-10-23 16:24:12 +00:00
Pau Espin f6e8e6692c libbsc: Use correct printf formatting for uint64_t
unsigned long can be 32 bits on some arch/OS, while "current" field is
always 64 bit because it's a uint64_t.

Change-Id: Ibad1e4f09cf912cb654dbe3687a3f2182e2060f5
2017-10-23 14:52:15 +02:00
Pau Espin 73ab3f070a bsc_api: Fix NULL secondary_lchan access in handle_ass_fail
Related: OW#3893

Program terminated with signal SIGSEGV, Segmentation fault.
0  gsm_lchan_name (lchan=lchan@entry=0x0) at gsm_data_shared.c:342
(gdb) bt
0  gsm_lchan_name (lchan=lchan@entry=0x0) at gsm_data_shared.c:342
1  0x0805ab80 in lchan_release (lchan=0x0, sacch_deact=sacch_deact@entry=0, mode=mode@entry=RSL_REL_LOCAL_END)
    at chan_alloc.c:410
2  0x0805c1dd in handle_ass_fail (msg=0x94142b8, conn=0x9251048) at bsc_api.c:459
3  dispatch_dtap (msg=0x94142b8, link_id=0 '\000', conn=0x9251048) at bsc_api.c:598
4  gsm0408_rcvmsg (msg=msg@entry=0x94142b8, link_id=0 '\000') at bsc_api.c:658
5  0x08058ca2 in abis_rsl_rx_rll (msg=0x94142b8) at abis_rsl.c:1686
6  abis_rsl_rcvmsg (msg=0x94142b8) at abis_rsl.c:2097
7  0xb7e8cf9a in handle_ts1_read (bfd=0x94e8e08) at input/ipaccess.c:271
8  ipaccess_fd_cb (bfd=0x94e8e08, what=1) at input/ipaccess.c:386
9  0xb7ee8434 in osmo_select_main (polling=polling@entry=0) at select.c:158
10 0x0804bd7c in main (argc=6, argv=0xbfc27144) at osmo_bsc_main.c:272
(gdb) print lchan
$2 = (const struct gsm_lchan *) 0x0

Possible scenario in which this crash can appear:
1- gsm0808_assign_req() calls handle_new_assignment() which sends an CHAN
ACTIVATE msg and arms T10 timer.
2- ACTIVATE ACK is received (handle_chan_ack), which calls
gsm48_send_rr_ass_cmd() which sends an ASSIGNMENT CMD, and doesn't
disable/modify T10 timer.
3- T10 timeout is triggered (assignment_t10_timeout()), which sets
conn->secondary_lchan = NULL
4- Immediately after, the ASSIGNMENT FAILURE message (which might have been
already queued) is processed in handle_ass_fail, and then the crash occurs.

This race condition is not an issue for handle_ass_compl() path because there's
this check there which would trigger most probably if secondary_lchan is NULL:
"if (conn->secondary_lchan != msg->lchan)"

Change-Id: I3798b36c628f75d4e8bc7b0996c27d695d53fbb1
2017-10-17 10:10:44 +02:00
Alexander Couzens 4fe3ee79a9 debian/rules: show testsuite.log when tests are failing
Change-Id: I373b26c9d5eb32b1155e6405c6305ac870061887
2017-10-11 08:14:12 +00:00
Max 39999a7dcf SI1q: fix EARFCN appender
Previously if we ran out of space while adding EARFCN, we simply return
which might result in malformed SI2q. Fix it by proper rollback of
entire EARFCN. While at it, let's be paranoid and introduce extra checks
against integer overflow in budget calculations.

Change-Id: I4b2aa3825e9affb6dfeadecdf24dd1a43a92b7b7
Related: OS#2357
2017-10-11 01:28:50 +00:00
Max 25cc407c5b ctrl: add oml-uptime command
Expose OML link uptime available via vts's "sh bts 0" command with the
new "bts.0.oml-uptime" ctrl command. To avoid code duplication, move
uptime computation into separate function and use it for both.

Change-Id: Iec405aa949d6a38a9c8e64cd7ee4b49fd416835d
Related: OS#2486
2017-10-11 01:28:10 +00:00
Max e1ceb6f767 Remove pkg-config file
It wasn't used anyway because OsmoBTS relied on OpenBSC only. As of
ec33b0397f5d71248c5834513d4be7b9b0e46366 in OsmoBTS it does not need any
shared includes anymore.

Change-Id: Ia689c7f2163dd23e429ee9d17177345b5c9470c7
2017-10-10 12:30:04 +00:00
Max 7d73cc797a SI2q: fix generation for multiple UARFCNs
* fix insert routine to keep the list sorted by UARFCN
* fix rest octets generator to properly account for offset
* adjust test results accordingly

Change-Id: I443c5c5f937b490578354f3c8a0c5b92629f2794
Related: OS#2357
2017-10-10 11:39:31 +00:00
Max 3d049d27f5 OML: consider RSL link state
OML link state is available via vty ("sh bts 0" command) and
ctrl ("oml-connection-state" RO variable).

When showing OML link state, take into consideration RSL link state as
well: if OML is up but RSL is missing show it as degraded.

That's implemented via BTS model-specific functions (currently Sysmo- and
Nano- BTS only)

Change-Id: I5952fc59e4d82e0aa627ad91d20f964d9559a4c4
Related: OS#2486
2017-10-09 18:42:15 +02:00
Max 081cebaa6d SI2q: cleanup UARFCN addition
* expand comments, fix typos
* constify parameter
* move try-add-adjust routine into separate function to facilitate
  further modifications
* remove excessive checks and unnecessary return values
* move (UARFCN, Scrambling Code) tuple uniqueness check into separate
  function and use it early

Change-Id: Ia72f848dec40723510ca56868e08081804227d47
Related: OS#2357
2017-10-09 10:08:16 +00:00