aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src
AgeCommit message (Collapse)AuthorFilesLines
2016-06-02gprs_gmm.c: Perform LLME operations only if we have oneHarald Welte1-5/+7
In case the GMM message did not arrive over a Gb interface, there is no LLME (and thus the associated pointer is NULL). Don't try to perform operations on a NULL LLME. Change-Id: If7f24161cd2826f8ee238d4bc1090adf555cea4e
2016-06-02gprs_gmm.c: Make TLLI handling specific to Gb interfaceHarald Welte1-36/+60
Soem of the operations we perform in the GMM layer are specific to the GPRS/EDGE radio access network and its Gb interface. Let's make them conditional to that in preparation of supporting an Iu interface. Change-Id: I3efb7c5087afe8e2331ec17bd9fac5029f4bee6c
2016-06-02gprs_gmm.c: Don't try to de-reference NULL mmctxNeels Hofmeyr1-0/+32
There was a comment in the code that certain GMM messages require a valid mmctx pointer. However, nothing actually checked if that pointer was in fact non-NULL. We plainly crashed if a MS would send us the wrong message in the wrong state. Original patch by Harald Welte, but it broke message validity checking, resulting in sgsn_test failure. This re-implements the NULL check in a different way, as explained by in-code comment. Change-Id: I7908de65bec91599f7042549b832cbbd7ae5a9a8
2016-06-02rename gsm0408_gprs_rcvmsg() to gsm0408_gprs_rcvmsg_gb()Harald Welte2-3/+3
This is the entry point for GMM from Gb. We will create a new one for Iu, so let's be explicit rather than implicit. Change-Id: I93c074bf99db041117c0dc03dc8255879845a875
2016-06-01create_pdp_conf(): factor out PDP context accept dispatch as ↵Daniel Willmann1-9/+14
send_act_pdp_cont_acc() Change-Id: Ibf60e18707ff4aa2e60291e5595386ddda8d8190
2016-06-01prepare sgsn_mm_ctx for Gb and Iu mode (UMTS)Harald Welte6-46/+47
Explicitly mark those sgsn_mm_ctx members that apply for Gb mode and (upcoming) Iu mode, respectively. Add some comments in sgsn_mm_ctx. Change-Id: Ife9b02549f284e2547f16117cf43d7a36948fc4b Tweaked-By: Neels Hofmeyr <nhofmeyr@sysmocom.de>
2016-05-31gprs: use new uint8_t * for kv in gprs_cipher_run()Alexander Couzens1-2/+2
libosmocore changed in bf990bb8 Update internal GPRS cipher API from uint_64 to uint8_t*. Fix a warning. Change-Id: Ib5bfe1fb05c693347b11ff4faadd3fc2205ebd76
2016-05-31Make si2q scheduling optionalMax1-1/+9
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-30bsc: Create minimal SI6 rest octetsHolger Hans Peter Freyther2-1/+42
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-27tweak db debug log: log TMSI as hexNeels Hofmeyr1-1/+1
Change-Id: I4564c99c145a35fb592c228c1fa84c61ec425fd3 Reviewed-on: https://gerrit.osmocom.org/94 Reviewed-by: Harald Welte <laforge@gnumonks.org> Tested-by: Jenkins Builder
2016-05-25filter/nat: Fix the context for the imsi assignmentHolger Hans Peter Freyther1-1/+1
In c09f8a3b7fb94ccef41e33c32bfe2bff1ffe0e44 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-25rtp_proxy.c: Ensure msgb_alloc is large enough for largest AMR frameHarald Welte1-1/+1
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-23gsm04_08_clear_request(): release loc with arg release=0Neels Hofmeyr1-1/+1
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-23Fix copy-paste error in SI6Max1-1/+1
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-22subscr_name(): Handle case for subscr == NULLHarald Welte3-6/+6
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-21drop unneccessary duplicate linking: osmo-nitbNeels Hofmeyr1-1/+0
Change-Id: I430adbb1e0c6382317da282bcf5ef73cf9496f80 Reviewed-on: https://gerrit.osmocom.org/89 Tested-by: Jenkins Builder Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-21drop unneccessary duplicate/unused linking: ipaccessNeels Hofmeyr1-5/+0
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-21drop unneccessary duplicate linking: osmo-bscNeels Hofmeyr1-1/+0
Change-Id: Ia227abcaa7b1f808646aadb9f53ee2a669699c51 Reviewed-on: https://gerrit.osmocom.org/87 Tested-by: Jenkins Builder Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-20Make extending subscriber creation easierMax3-11/+17
* 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-20Use proper measurement for handoverMax1-5/+12
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-17Move DTX settings to BTSMax5-22/+91
* 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-15db.c: implemented incremental migrationVadim Yanitskiy1-18/+35
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-05Add human-readable name of SGSN_AUTH_AUTHENTICATEHarald Welte1-0/+1
In commit 4adb136da63a1d3ed523ad85e12fd99fc62f5701 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-05sgsn/GSUP: Support MAP-style nested LU/ISDHarald Welte1-0/+22
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-04-29osmo_oap_decode(): Use common argument orderingHarald Welte2-3/+3
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-29OAP: Various coding style fixesHarald Welte1-13/+14
* 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-29OAP: use osmo_oap_ prefix for OAP, rather than plain oap_Harald Welte2-10/+10
this is in preparation of moving related code to libosmocore.
2016-04-29oap_message.h: Remove dependency to openbsc includeHarald Welte2-1/+2
This is a first step to moving oap_messages.h to libosmocore
2016-04-29Move osmo_gsup_messages.[ch] to libosmocoreHarald Welte3-474/+2
This requires the corresponding commit in libosmocore.
2016-04-29move utils.h functions to libosmocoreHarald Welte5-67/+9
This needs the corresponding commit in libosmocore which imports the related functions
2016-04-29osmo_gsup_messge.[ch] documentation update (doxygen)Harald Welte1-0/+10
2016-04-29gsup_messages: Add UMTS AKA related encoding/decoding supportHarald Welte1-0/+46
2016-04-29move osmo_shift_* / osmo_match_shift_* to libosmogsmHarald Welte2-174/+0
2016-04-29rename gprs_shift_*() to osmo_shift_*()Harald Welte4-47/+86
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-29Rename gprs_gsup_* to osmo_gsup_*Harald Welte3-108/+108
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-29use new libosmocore gsm_23_003.h for IMEI/IMSI lengthHarald Welte7-9/+12
... 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-29move gsm_04_08_gprs.h to libosmocoreHarald Welte13-152/+10
This requres the corresponding commit in libosmocore.
2016-04-29Start to use struct osmo_auth_vector from gsm_auth_tupleHarald Welte8-61/+61
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-29Disconnect calls with incompatible channel types / modesMax1-1/+45
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-29Adjust si2quater rangesMax1-5/+6
Change ranges of arguments for si2quater neighbor lists to proper values according to 3GPP spec.
2016-04-29Fix comment typoMax1-1/+1
2016-04-23Add missing includeMax1-0/+1
2016-04-22Add extra debug output with channel mode and typeMax4-9/+27
This provides helpful information for debugging internal MNCC handler.
2016-04-22Add vty check for max si2quater sizeMax2-9/+35
Explicitly check if added (U|E)ARFCN will fit into available si2quater message.
2016-04-22Add basic UARFCN supportMax3-21/+262
* add data structures, generation functions * vty interface for neightbor UARFCNs specific to SI2quater * vty test * unit test Fixes: OS#1666
2016-04-22Fix earfcn deletionMax1-2/+2
* fix typo in arg index * fix sign in error reporting * add vty test
2016-04-22Fix documentation for command parametersMax1-1/+2
2016-04-16nat/vty: Do not print token update statementHolger Hans Peter Freyther1-4/+1
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-16Add basic SI2quater supportMax5-3/+302
* 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-16Refactor SI-related codeMax2-20/+19
Move define to header file. Use inline functions where appropriate. Change int variables which are used as boolean into actual bool to make code easier to follow.