Commit Graph

5445 Commits

Author SHA1 Message Date
Alexander Couzens 51fbc5f6e0 add .gitreview
A .gitreview file is required to use git review.
More information about git review
https://www.mediawiki.org/wiki/Gerrit/git-review

Change-Id: Ie7cdf16232181d4b8093e61f2d8a3faed9010d4f
2016-05-31 17:43:46 +02:00
Max 69e9c0dfc6 Make si2q scheduling optional
Previously si2quater SI messages were always scheduled. Check for
neighbor configuration and only schedule si2q when necessary. Add
corresponding unit test.

Change-Id: Ibe997803ffb894133fd4d838410fe735791d414f
Fixes: OS#1727
Reviewed-on: https://gerrit.osmocom.org/81
Tested-by: Jenkins Builder
Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-31 09:32:12 +00:00
Holger Hans Peter Freyther 82dd983dd8 bsc: Create minimal SI6 rest octets
In GSM R99 SI6 has mandatory SI6 rest octets and so far we did
not include them. Add minimal support to generate the right band
indicator.

Target a slightly older version of the SI6 rest octets as we neither
support MBMS nor Random bit stream but should include the band
indicator.

Change-Id: I417a40eb91f42a3416b4e07bb9fb4d7a01aaa36b
Fixes: OS#1698
Related: OS#1725
Reviewed-on: https://gerrit.osmocom.org/71
Tested-by: Jenkins Builder
Reviewed-by: Max <msuraev@sysmocom.de>
Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-30 21:28:40 +00:00
Neels Hofmeyr 307e40648e tweak db debug log: log TMSI as hex
Change-Id: I4564c99c145a35fb592c228c1fa84c61ec425fd3
Reviewed-on: https://gerrit.osmocom.org/94
Reviewed-by: Harald Welte <laforge@gnumonks.org>
Tested-by: Jenkins Builder
2016-05-27 10:48:04 +00:00
Holger Hans Peter Freyther 5b692d0a5c filter/nat: Fix the context for the imsi assignment
In c09f8a3b7f as part of a cleanup
I accidently changed the talloc context from "con" to "bsc". The
issue occurred at an earlier commit when assigning req.ctx to the
"wrong" context. The allocation needs to be scoped by the struct
nat_sccp_connection and not the connection from BSC to NAT.

Before we have a nat_sccp_connection we scope the copied imsi to
the bsc_connection and then steal it, but for the identity resp
we will always have a nat_sccp_connection and can already use the
right context.

Change-Id: I53789aad2809e19338ad3b2deb72c4757e7bd524
Related: OS#1733
Reviewed-on: https://gerrit.osmocom.org/102
Tested-by: Jenkins Builder
Reviewed-by: Harald Welte <laforge@gnumonks.org>
Reviewed-by: daniel <dwillmann@sysmocom.de>
Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-25 19:43:38 +00:00
Holger Hans Peter Freyther ddf4e1e114 debian: Make upgrading from debian SID easier
Make sure the version number of this sourcepackage is higher than
the one found in Debian SID.

Change-Id: I838632e9e90378a03235c2aebd5bc9ed06627ec8
Reviewed-on: https://gerrit.osmocom.org/113
Tested-by: Jenkins Builder
Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-25 19:41:19 +00:00
Harald Welte ed04fcc179 rtp_proxy.c: Ensure msgb_alloc is large enough for largest AMR frame
In AMR 12.2 (mode 7), the actual RTP payload is 33 bytes.  Howeerver,
as we store the length of the (dynamically-sized) AMR payload in the
first byte, our buffer needs at least 33+1 byte in size.

Change-Id: If1ad5d2d68c85733306c75ea62f67fe8fbc143b3
Reviewed-on: https://gerrit.osmocom.org/91
Tested-by: Jenkins Builder
Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-05-25 12:33:47 +00:00
Neels Hofmeyr aea28ceb27 gsm04_08_clear_request(): release loc with arg release=0
In gsm04_08_clear_request(), in_release == 1 anyway and
msc_release_connection() would exit immediately without any effect. Don't
confuse the reader by passing release=1 arg.

Change-Id: I5bf9eb4889d32ad5e42ac7d096bf62fa3a493e20
Reviewed-on: https://gerrit.osmocom.org/93
Reviewed-by: Holger Freyther <holger@freyther.de>
Tested-by: Jenkins Builder
2016-05-23 20:20:37 +00:00
Max ea8e983514 Fix copy-paste error in SI6
Fix error which prevented enabling DTX for half-rate channels.

Change-Id: I7d41df0068783c8fb33ddeeab1d1dcf63c2c259f
Reviewed-on: https://gerrit.osmocom.org/101
Tested-by: Jenkins Builder
Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-23 16:24:40 +00:00
Harald Welte 7184bd088e subscr_name(): Handle case for subscr == NULL
subscr_name() was called from several places:
* either without a check for subscr being NULL, which for example
  was causing a segfault if we hand-over a channel before identifying the
  subscriber
* or with an explicit NULL check and the ternary operator (?).

We now simplify the code by checking for the NULL Subscriber in subscr_name()
itself.

Change-Id: Ide09f4a515222eb2ec6c25e7a6a8c5f6cc2ffd4b
Reviewed-on: https://gerrit.osmocom.org/92
Tested-by: Jenkins Builder
Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-22 11:51:18 +00:00
Neels Hofmeyr 8495e03588 drop unneccessary duplicate linking: tests/gsm0408
Change-Id: I8b6fb27d1db0157cb7d61f18b03f33c4f3168946
Reviewed-on: https://gerrit.osmocom.org/90
Tested-by: Jenkins Builder
Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-22 10:46:42 +00:00
Neels Hofmeyr 5493d87f95 drop unneccessary duplicate linking: osmo-nitb
Change-Id: I430adbb1e0c6382317da282bcf5ef73cf9496f80
Reviewed-on: https://gerrit.osmocom.org/89
Tested-by: Jenkins Builder
Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-21 15:54:36 +00:00
Neels Hofmeyr 2fa7d8464f drop unneccessary duplicate/unused linking: ipaccess
Drop unused linking of libmsc, and drop duplicate linking of libbsc.

Change-Id: If2d63adb832c72ff1a22c25a78e06b0c244628d2
Reviewed-on: https://gerrit.osmocom.org/88
Tested-by: Jenkins Builder
Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-21 15:20:47 +00:00
Neels Hofmeyr 63081fe34d drop unneccessary duplicate linking: osmo-bsc
Change-Id: Ia227abcaa7b1f808646aadb9f53ee2a669699c51
Reviewed-on: https://gerrit.osmocom.org/87
Tested-by: Jenkins Builder
Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-21 15:02:55 +00:00
Max e21cf38da4 Make extending subscriber creation easier
* rename variable controlling subscriber creation
* use enum for subscriber creation policy
* move check for subscriber creation policy into separate static
  function

Related: OS#1658, OS#1647
Change-Id: I3b10a9a764fd3a7bb96717a990e52caae16266da
Reviewed-on: https://gerrit.osmocom.org/42
Tested-by: Jenkins Builder
Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-20 16:32:37 +00:00
Max 8a4d2e756d Use proper measurement for handover
Previously *FULL measurements were always used for handover
decisions. Those are incorrect in case of DTX - check if it was enabled
and use *SUB instead.

Note: *SUB values have higher variance so there might be more "bad"
values compared to *FULL although real quality remains the same.

Change-Id: I95e8e544047a83a256e057a47458678f40a19a15
Related: OS#1701
Reviewed-on: https://gerrit.osmocom.org/66
Tested-by: Jenkins Builder
Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-05-20 16:26:33 +00:00
Max c08ee71bff Move DTX settings to BTS
* Add per-BTS DTX settings
* Configure Uplink and Downlink DTX separately
* Deprecate global DTX option (it was never tested/used anyway)
* Use libosmocore function for DTX indicator in System
  Information (previously it was incorrectly assigned for half-rate
  channels)

Related: OS#22
Change-Id: I3d55168475ad47044b6238b55846ea22bdd518a4
Reviewed-on: https://gerrit.osmocom.org/40
Tested-by: Jenkins Builder
Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-17 16:17:54 +00:00
Max 9a7e25b9c3 Cleanup db test
Move copy-pasted code into separate function to make writing more tests
easier.

Related: OS#1658
Change-Id: I9e39af85718514dd0f081d41c234c9dda77c4b27
Reviewed-on: https://gerrit.osmocom.org/43
Tested-by: Jenkins Builder
Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-17 16:14:06 +00:00
Vadim Yanitskiy a8d8e93086 db.c: implemented incremental migration
In the past, normal migration was possible only if the actual
schema version differed from the version used in DB by 1. For
example, if DB uses an old version 3 and you need to use it
with the code written for version 5, the check_db_revision()
will convert it to 4 and DB will still use incompatible schema
version during Osmo-NITB running time. After next run it will
be converted to version 5.

This patch replaces a set of 'else-if' checks by a 'switch'
without 'break' statements between 'case' labels (waterfall).
It makes you able to migrate from current version to the
latest despite any difference between them.

Change-Id: Ia9c2aa86f96b88ad8a710d0a23879ce219bc82dc
Reviewed-on: https://gerrit.osmocom.org/62
Tested-by: Jenkins Builder
Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-15 19:31:18 +00:00
Max 34e2b09278 Ignore extended test leftovers
Change-Id: If9e3522d934611f631cbfde6e6db52251babc37f
Reviewed-on: https://gerrit.osmocom.org/41
Reviewed-by: Harald Welte <laforge@gnumonks.org>
Reviewed-by: Neels Hofmeyr <nhofmeyr@sysmocom.de>
Tested-by: Holger Freyther <holger@freyther.de>
Reviewed-on: https://gerrit.osmocom.org/56
Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-12 12:24:23 +00:00
Harald Welte cd5e52605c sgsn_test: Adapt test case to now-existing InsertSubscriberData
We recently implementd InsertSubscriberData in the SGSN, adapt the test
to reflect that.
2016-05-06 13:49:20 +02:00
Harald Welte 7c55ede8b1 Add human-readable name of SGSN_AUTH_AUTHENTICATE
In commit 4adb136da6 we introduced
a new authentication state SGSN_AUTH_AUTHENTICATE, but we didn't
add that to auth_state_names[] resulting in log messages printing
it abut 'unknown 0x1' rather than something more useful.
2016-05-05 18:31:37 +02:00
Harald Welte 5f2524fe3d sgsn/GSUP: Support MAP-style nested LU/ISD
The existing GSUP code expected the subscriber data to be piggy-backed
onto the location update response, rather than a separate (and nested)
insert subscriber data request/response phase.

With this patch we should now support both the nested as well as the
piggy-backed version.
2016-05-05 18:25:12 +02:00
Harald Welte 5d547a4358 osmo_oap_decode(): Use common argument ordering
In general, if a function generates output data like a msgb (or in this
case filling an osmo_oap_message structure), the output argument
precedes the source.  This is what we use all over libosmo*, and it is
modelled after memcpy(), where dst is the first argument, before src.

Let's align osmo_oap_decode().  Intestingly, osmo_oap_encode was already
correct, so the encode/decode functions used different conventions
before.
2016-04-29 13:10:37 +02:00
Harald Welte d8aa412c46 OAP: Various coding style fixes
* we always declare stack variables at the top of the function / block
* 'switch' is not a function, so there's space ahead of the opening (
2016-04-29 13:10:37 +02:00
Harald Welte 564c06525b OAP: use osmo_oap_ prefix for OAP, rather than plain oap_
this is in preparation of moving related code to libosmocore.
2016-04-29 13:10:37 +02:00
Harald Welte 31760a1f60 oap_message.h: Remove dependency to openbsc include
This is a first step to moving oap_messages.h to libosmocore
2016-04-29 13:10:37 +02:00
Harald Welte 23d77d56ea Move osmo_gsup_messages.[ch] to libosmocore
This requires the corresponding commit in libosmocore.
2016-04-29 13:10:37 +02:00
Harald Welte 50f1c0af56 move utils.h functions to libosmocore
This needs the corresponding commit in libosmocore which imports
the related functions
2016-04-29 13:10:37 +02:00
Harald Welte eff215a8bb osmo_gsup_messge.[ch] documentation update (doxygen) 2016-04-29 13:10:37 +02:00
Harald Welte 7ca035deca gsup_messages: Add UMTS AKA related encoding/decoding support 2016-04-29 13:10:37 +02:00
Harald Welte 85234a32db move osmo_shift_* / osmo_match_shift_* to libosmogsm 2016-04-29 13:10:37 +02:00
Harald Welte 842674b8b3 rename gprs_shift_*() to osmo_shift_*()
This rename is the first step of moving the associated functions into
libosmocore.

Also, rename gprs_match_* to osmo_match_shift_* to indicate that it is
not just matching the TLV, but also shifting the data portion.
2016-04-29 13:10:37 +02:00
Harald Welte 28903a99ea Rename gprs_gsup_* to osmo_gsup_*
This is a preparation to move the related code to libosmocore, whilst
at the same time generalizing it from GPRS Subscriber Update Protocol
to the Osmocom Generic Subscriber Update Protoco.
2016-04-29 13:10:37 +02:00
Harald Welte d3fa84dbba use new libosmocore gsm_23_003.h for IMEI/IMSI length
... rather than our private definitions everwhere.  As an added benefit,
gprs_gsup_messages.h is now free of any header dependencies within
openbsc.
2016-04-29 13:10:37 +02:00
Harald Welte 53373bca8f move gsm_04_08_gprs.h to libosmocore
This requres the corresponding commit in libosmocore.
2016-04-29 13:10:37 +02:00
Harald Welte 121e9a4164 Start to use struct osmo_auth_vector from gsm_auth_tuple
Rather than having a 'private' structure for kc, sres and rand, we
now finally (with 4 years delay) use osmo_auth_vector from libosmogsm,
which encapsulates authentication vectors that can be either GSM
triplets or UMTS quintuples or a combination of both.

gsm_auth_tuple becomes a wrapper around osmo_auth_vector, adding
use_count and key_seq to it.

key_seq is no longer initialized inside gprs_gsup_messages.c, as there
is no CKSN / key_seq inside the message anyway.  If a usre of the code
needs key_seq, they need to manage it themselves.
2016-04-29 13:10:37 +02:00
Max 3ffce19cb4 Disconnect calls with incompatible channel types / modes
In case both TCH/H and TCH/F or different codecs are configured and
internal MNCC handler is used we might end up in a situation where call
legs with incompatible channel types or codecs would be connected
resulting in a broken audio.  Disconnect such calls with appropriate
error message.

Fixes: OS#1663
2016-04-29 13:10:00 +02:00
Max 35697b9a10 Adjust si2quater ranges
Change ranges of arguments for si2quater neighbor lists to proper values
according to 3GPP spec.
2016-04-29 12:57:53 +02:00
Max 299a999465 Fix comment typo 2016-04-29 12:57:53 +02:00
Max e01f5050ef Add missing include 2016-04-23 18:12:01 +02:00
Max 8db12e4263 Add extra debug output with channel mode and type
This provides helpful information for debugging internal MNCC handler.
2016-04-22 15:53:51 +02:00
Max aafff96c40 Add vty check for max si2quater size
Explicitly check if added (U|E)ARFCN will fit into available si2quater
message.
2016-04-22 14:56:06 +02:00
Max 26679e0475 Add basic UARFCN support
* add data structures, generation functions
* vty interface for neightbor UARFCNs specific to SI2quater
* vty test
* unit test

Fixes: OS#1666
2016-04-22 14:55:33 +02:00
Max 27c3e76aa7 Cleanup shared data structure
* remove unused variable.
* lower max number of (e|u)arfcns to more realistic value.
2016-04-22 14:54:39 +02:00
Max 0c1bc26b64 Fix earfcn deletion
* fix typo in arg index
* fix sign in error reporting
* add vty test
2016-04-22 14:50:42 +02:00
Max 36212f2850 Fix documentation for command parameters 2016-04-22 14:50:29 +02:00
Holger Hans Peter Freyther 3a434f8e8c nat/ussd: Add an example of the USSD gateway side-channel
This adds a very basic, use once example in python on how to connect
and deal with the app specific payload and messages. The code is not
complete as the invokeId should be patched according to the initial
invoke. This excercise is left to future readers of that code.
2016-04-16 15:56:13 -04:00
Holger Hans Peter Freyther e43f8e0400 nat/vty: Do not print token update statement
On start this would print one line per BSC and this doesn't add
a lot of value. Let's just remove this logging message.
2016-04-16 15:56:13 -04:00
Max 59a1bf3dae Add basic SI2quater support
* support for sending arbitrary static SI2quater.
* vty interface for neightbor EARFCNs specific to SI2quater.
* dynamic generation of SI2quater messages.
* unit test for SI2quater messages.

Fixes: OS#1630
2016-04-16 13:47:56 +02:00