aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/osmo_bsc_msc.c
AgeCommit message (Collapse)AuthorFilesLines
2022-03-04add counter for inter-BSC incoming Handover RequestNeels Hofmeyr1-0/+1
Related: SYS#5864 Change-Id: Icdde2bb339a5e367a4d297802214a1ef3f36eefa
2021-09-04osmo_bsc_msc: do not initalize MGCP proxy for AoIP MSCsPhilipp Maier1-0/+4
The MGCP proxy which is built into osmo-bsc is used to tunnel MGCP messages through an SCCP-lite link. This is an SCCP-lite specific implementation detail that is not present in SCCP/AoIP. Change-Id: Id3a8c45ae38d6b9d9c106a9e83b3cbfff919650d Related: SYS#5091
2021-08-27stat_item desc: add explicit indexes for clarityNeels Hofmeyr1-2/+2
Add explicit indexes like [BSC_STAT_NUM_BTS_TOTAL] = { ... BSC_STAT_NUM_BTS_TOTAL == 0 and the first item of bsc_stat_desc of course has index 0, but when grepping the code, it looks like BSC_STAT_NUM_BTS_TOTAL is missing a name definition. Same for MSC_STAT_MSC_LINKS_ACTIVE and MSC_STAT_MSC_LINKS_TOTAL. Related: SYS#5542 Change-Id: Ie47e0857c41d517a9b37be96f6669d1825d24a6d
2020-10-16drop features 'core-location-area-code' and 'core-cell-identity'Neels Hofmeyr1-4/+2
This feature apparently assigned a fixed LAC and CI to a specific MSC, but looking at the implementation was obviously not useful. Keep the vty commands for legacy compat, now without effect besides logging an error via vty_out(). Related: OS#4751 Change-Id: I6bee704e7e5d5b6b86473323bae1fa9fce9241ee
2020-10-09LCS: implement the bulk of Location ServicesNeels Hofmeyr1-0/+6
Depends: I4d7302a4853518916b6b425e710c10568eb2ffe5 (libosmocore) Change-Id: I28314ba97df86a118497e9b2770e2e6e2484e872
2020-09-07Fix creating MGCP proxy socket if MGW listens on an IPv6 addressPau Espin Pedrol1-2/+2
If for instance "mgw remote-ip ::1" is configured, the MGCP IPA proxy socket towards the MGW will use ::1 as the destination address, but it was being created as AF_INET. Let's use AF_UNSPEC instead and let osmo_sock_init2 decide the best socket type to create. Moreover, change the default local address from "0.0.0.0" to NULL to also let osmo_sock_init2 pick an IPv6 address if necessary. Change-Id: Ide88c7358a38702ef11c84145518794e75870ef8
2020-08-17Implement support for receiving BSSMAP CommonID from MSCHarald Welte1-0/+1
The MSC may at any time send a BSSMAP CommonID message via a SCCP connection to inform us of the IMSI of the subscriber. Let's make use of that information by associating a related bsc_subscr and updating the identity of the bsc_subscr_conn_fsm for improved logging / filtering. Closes: OS#2969 Change-Id: I52c43fb940f0db796adf4c0adb2260321c721c39
2020-07-18Move struct gsm_bts: gsm_data.* => bts.*Pau Espin Pedrol1-0/+1
Place all code related to the object into the related file. Having all the data model in one file made sense in early stage of development to make progress quickly, but nowadays it hurts more than helps, due to constantly growing size and more and more bits being added to the model, gaining in complexity. Currently, having lots of different objects mixed up in gsm_data.h is a hole of despair, where nobody can make any sense were to properly put new stuff in, ending up with functions related to same object in different files or with wrong prefixes, declarations of non-existing functions, etc. because people cannot make up their mind on strict relation to objects in the data model. Splitting them in files really helps finding code operating on a specific object and helping with logically splitting in the future. Change-Id: I00c15f5285b5c1a0109279b7ab192d5467a04ece
2020-07-15Use OSMO_FD_* instead of deprecated BSC_FD_*Pau Espin Pedrol1-1/+1
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: Ia5a656567d212fa265aef1375d714d0c5fee5dd6
2020-06-23fix crashes due to OSMO_ASSERT(conn->lchan)Vadim Yanitskiy1-0/+4
Starting from ttcn3-bsc-test-sccplite build #777, it was noticed that osmo-bsc crashes with the following message: Assert failed conn->lchan include/osmocom/bsc/gsm_data.h:1376 The cause of this is a recently merged patch that calls conn_get_bts() during assignment_fsm rate counter dispatch: "Count assignment rates per BTS as well" commit b5ccf09fc4042c7fb1fdaaa6263961c40b32564e Change-Id I0009e51d4caf68e762138d98e2e23d49acc3cc1a The root cause being that the assignment_fsm attempts to count an Assignment event for a BTS after the lchan has already been released and disassociated from the conn. The assertion is found in conn_get_bts(), which is used in various places. In fact, each caller is a potential DoS risk -- though most are in code paths that are guaranteed to have an lchan and bts present, having an OSMO_ASSERT() on the relatively volatile presence of an lchan is not a good idea for osmo-bsc's stability and error resilience. - Change conn_get_bts() to return NULL in the lack of an lchan. - Adjust all callers of conn_get_bts() to gracefully handle a NULL return val. - Same for cgi_for_msc() and callers, closely related. Here is a backtrace: Program received signal SIGABRT pwndbg> bt 0x0000555555be6e52 in conn_get_bts (conn=0x622000057160) at include/osmocom/bsc/gsm_data.h:1376 0x0000555555c1edc8 in assignment_fsm_timer_cb (fi=0x612000060220) at assignment_fsm.c:758 0x00007ffff72b1104 in fsm_tmr_cb (data=0x612000060220) at libosmocore/src/fsm.c:325 0x00007ffff72ab062 in osmo_timers_update () at libosmocore/src/timer.c:257 0x00007ffff72ab5d2 in _osmo_select_main (polling=0) at libosmocore/src/select.c:260 0x00007ffff72abd2f in osmo_select_main_ctx (polling=<optimized out>) at libosmocore/src/select.c:291 0x0000555555e1b81b in main (argc=3, argv=0x7fffffffe1b8) at osmo_bsc_main.c:953 0x00007ffff6752002 in __libc_start_main () from /usr/lib/libc.so.6 0x0000555555b61bbe in _start () In the case of the assignment_fsm counter, we now miss a chance to increase a BTS counter for a failed Assignment, but this is a separate problem. The main point of this patch is that osmo-bsc must not crash. Related: OS#4620, OS#4619 Patch-by: fixeria Tweaked-by: neels Fixes: I0009e51d4caf68e762138d98e2e23d49acc3cc1a Change-Id: Id681dfb0ad654bdb4b71805d1ad4f39a8bf6bbd1
2020-06-17MSC pooling: add rate countersNeels Hofmeyr1-0/+28
Tests for these counters are added in I2006f1def5352b4b73d0159bfcaa2da9c64bfe3f (osmo-ttcn3-hacks). Change-Id: I2ded757958dfa62b502efbab765203bcadf899e2
2020-06-17MSC pooling: add 'no allow-attach' for MSC off-loadingNeels Hofmeyr1-0/+1
As in 3GPP TS 23.236, to offload an MSC, the BSC must be able to avoid attaching new subscribers to it: 4.5a.1: "UEs being moved from one CN node are stopped from registering to the same CN node again by an O&M command in BSCs and RNCs connected to the pool." Change-Id: I6249201c15d0f6565aca643c21d2375c9ca58584
2020-06-17MSC pooling: make NRI mappings VTY configurableNeels Hofmeyr1-0/+3
Use the osmo_nri_ranges API to manage each MSC's NRI ranges by VTY configuration. Change-Id: I6c251f2744d7be26fc4ad74adefc96a6a3fe08b0
2020-05-29flatten: move network->bsc_data->* to network->*Neels Hofmeyr1-2/+2
The separate struct osmo_bsc_data is like another separate struct gsm_network for no reason. It is labeled "per-BSC data". These days, all of this is a single BSC and there will not be different sets of osmo_bsc_data. Drop struct osmo_bsc_data, move its members directly into gsm_network. Some places tested 'if (net->bsc_data)', which is always true. Modify those cases to rather do checks like 'if (net->rf_ctrl)', which are also always true AFAICT, to keep as much unmodified logic as possible in this patch. Change-Id: Ic7ae65e3b36e6e4b279eb01ad594f1226b5929e0
2020-05-19deprecate 'msc' / 'ip.access rtp-base <port>'Neels Hofmeyr1-1/+0
The bsc_msc_data->rtp_base has been unused ever since we introduced the exernal MGW in osmo-bsc [1]. The vty command also still exists. Deprecate the vty command, remove the member. [1] "mgcp: use osmo-mgw to switch RTP streams" commit 39c609b7c924524172ad311bdf89f92b7ccf175a Change-Id Ia2882b7ca31a3219c676986e85045fa08a425d7a Change-Id: Id14fa3066ca5d472a817593074a6222f159168a8
2020-05-19bssap: Handle BSSMAP CONFUSION message.Alexander Chemeris1-0/+1
We decode the mesage and print it to the log files at ERROR log level. We also count it in the BSSMAP message counters. There is not much else we could do about it. Depends: If8afd2d096fb66c6c2f255a08fc1129de3d09cec (libosmocore) Change-Id: Ib4cd94f185f751b2384842222678ff671ac413c4
2020-05-11stats: Rename BSSMAP Rx message counters to match Tx ones.Alexander Chemeris1-14/+14
Change-Id: I29e42687ac084a60007f0b1ec6ec0a102fb4007f
2020-05-11stats: Add counters for Tx BSSMAP messages.Alexander Chemeris1-0/+41
We already have counters for Rx side, now we also count Tx side. See comments in the msc_ctr_description array implementation for the details. Change-Id: I89a173f6bdd9a3c21233fe01d07ab2ff0442bb10
2020-05-09stats: Fix Rx DTAP error stat descriptionAlexander Chemeris1-1/+1
Change-Id: Ie6debad36a49005676ff47eda644c90eee5dc461
2020-05-09stats: Add counters for received BSSMAP messages.Alexander Chemeris1-0/+13
Change-Id: I3f08d71b58b4e8d6f61376d85c2051e194aa8e43
2020-05-09stats: Add a stats gauge for the MSC links count.Alexander Chemeris1-0/+37
Change-Id: Ibe4b29056ba704a27b925cfdba49f343ee34f428
2019-08-12bsc_msc_data: remove unused member is_authenticatedPhilipp Maier1-7/+0
The struct member struct bsc_msc_data->is_authenticated is set to true permanently. This is a leftover from the sccplite implementation and can be removed now. Change-Id: I966a48b383c85345c92c9a1fec791150e96cd7b9 Related: OS#3112
2019-06-18Re-introduce support for IPA-encapsulated MGCPHarald Welte1-2/+29
Old osmo-bsc-sccplite already supported this, but in the migration over to libosmo-sigtran and to real 3GPP AoIP, this functionality got lost. We now create a UDP proxy socket. Any MGCP commands received via IPA from MSC (or rather: bsc_nat) are retransmitted to the MGW via UDP on this socket. Any responses back from the MGW received on the UDP socket are retransmitted back to MSC/bsc_nat as MGCP inside the IPA multiplex. Closes: OS#2536 Change-Id: I38ad8fa645c08900e0e1f1b4b96136bc6d96b3ab
2019-05-15Make sure to default to AMR octet-aligned modeHarald Welte1-0/+1
In Change-Id If6d40b2407b87aad2227ea7f15533ef01a3771b3 we introduced the support for both octet-aligned and bandwidth-efficient mode, and added a related VTY option about it. However, we accidentially also changed the default behavior. Without any explicit configuration, we should behave just like we behaved all those years before: Continue with octet-aligned mode. Change-Id: I8b6fd8bec05b35d84ad16275d84f9d363e238d2b Closes: OS#4002
2019-03-14Move msc related code from gsm_data to bsc_mscPau Espin Pedrol1-0/+15
This way ipaccess utils can be built without requiring libosmo-sigtran. Change-Id: I508188896be58ddc3bd4e9c3c661c258c06866f4
2018-10-05osmo_bsc_msc: Set reasonable codec list defaultsPhilipp Maier1-0/+22
When the user sets no codec-list in the msc node, the configuration will end up with an empty codec list. This is a useless configuration. There should be a sane default setting. - Set all possible codecs as default for codec-list Change-Id: I3749a65828c788f38c22f0a5314533f4516da3ed Related: OS#3625
2018-05-27Remove 'struct bsc_msc_connection' + fix IPA-encapsulated CTRLHarald Welte1-10/+2
The bsc_msc_connection dates back to the old pre-libosmo-sigtran days, and 90% of the field members weren't used at all (even the new sigtran specific ones!). Let's merge what remains into struct bsc_msc_data. As a side effect, the already dysfunctional "dest A.B.C.D" VTY command has been removed from the MSC node. There's quite a bit of fall-out in the CTRL interface, which was the code with strongest ties to bsc_msc_connection. This was resolved by properly porting CTRL handling over to libosmo-sigtran, meaning that an IPA/SCCPlite connected MSC can now again send CTRL GET/SET commands, and can also receive those selective few TRAPs that old osmo-bsc-sccplite also sent to its MSC[s]. Change-Id: I6b7354f3b23a26bb4eab12213ca3d3b614c8154f Related: OS#2012
2018-05-27remove remaining bits of osmo-bsc_natHarald Welte1-1/+0
osmo-bsc_nat is too heavily tied into legacy SCCPlite code, as it is not using libosmo-sigtran/osmo_ss7 so far. It's also full of customer-specific code and it's shared use of some libbsc code here has been complicating osmo-bsc development. The current plan is to continue to use osmo-bsc_nat from openbsc.git for those legacy users that need it, and not use osmo-bsc_nat in new 3GPP AoIP setups. Should we ever get a strong demand for an AoIP based bsc_nat, we can still revisit this later. Change-Id: Ia05dc76336a64a7f08962843b9a7cc19f2c83387
2018-05-25vty: Permit selection of other ASP protocol than M3UAHarald Welte1-0/+1
We used to have hard-coded M3UA. Let's allow the user to configure this per MSC using a new "asp-protocol (m3ua|sua|ipa)" VTY command. For SUA this should just work 1:1 without any trouble. For IPA, this of course only changes the underlying transport without reflecting the various differences in terms of BSSMAP ASSIGNMENT, MGCP handling, etc. Change-Id: I0800c709e574cedd7f5dd98be81c78782245cd13 Related: OS#2544
2018-04-02cosmetic: Add fixme note for OS#3112Philipp Maier1-0/+5
Change-Id: I0c3ffb567aff08014f8fb96928077afb8c2f229c
2018-04-02cosmetic: remove dead codePhilipp Maier1-498/+0
There is a lot of dead code in osmo_bsc_msc.c that used to handle the IPA multiplexed SSCP lite A interface. - remove portions of the dead code - remove IPA Ping related VTY commands Change-Id: I5cf3fec31cc774c902f3cfe6d16fb85ef301694a
2018-03-07implement support for 3-digit MNC with leading zerosNeels Hofmeyr1-2/+4
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). The changes to abis_test and gsm0408_test show that this code now handles 3-digit MNC correctly, by not dropping the leading zero as 0xf in the encoded PLMN. Re-implement CTRL commands 'mcc', 'mnc' and 'mcc-mnc-apply' to preserve the presence of the third digit of the MNC. Always reply with all leading zeros. Adjust the expected results in ctrl_test_runner.py, to show that it works. In VTY and CTRL, the parsing of MCC and MNC is inherently made stricter by use of osmo_{mcc,mnc}_from_str() -- they will no longer allow surplus characters and detect errno returned by strtol() (in contrast to atoi()). Depends: Id2240f7f518494c9df6c8bda52c0d5092f90f221 (libosmocore), Ib7176b1d65a03b76f41f94bc9d3293a8a07d24c6 (libosmocore), I020a4f11791c61742a3d795f782805f7b7e8733e (libosmocore) Change-Id: I8e722103344186fde118b26d8353db95a4581daa
2017-12-19remove libosmo-sccp dependency for osmo-bscHarald Welte1-2/+0
libosmo-sccp is the old sccp-lite-focused SCCP implementation that we used before libosmo-sigtran was created. The new osmo-bsc in this repository is using libosmo-sigtran and shouldn't be using parts of libosmo-sccp anymore. We only keep it around in configure.ac and Makefile.am for osmo-bsc_nat, which is not even built in this repository anymore (or 'again yet'?) Change-Id: I8f274be7d196cd7a5b1ec9ada949130fb06e984d
2017-09-06move include/openbsc to include/osmocom/bscNeels Hofmeyr1-6/+6
Change-Id: I39e7b882caa98334636d19ccd104fd83d07d5055
2017-08-30Implement AoIP, port to M3UA SIGTRAN (large addition and refactoring)Philipp Maier1-24/+38
This was originally a long series of commits converging to the final result seen in this patch. It does not make much sense to review the smaller steps' trial and error, we need to review this entire change as a whole. Implement AoIP in osmo-msc and osmo-bsc. Change over to the new libosmo-sigtran API with support for proper SCCP/M3UA/SCTP stacking, as mandated by 3GPP specifications for the IuCS and IuPS interfaces. From here on, a separate osmo-stp process is required for SCCP routing between OsmoBSC / OsmoHNBGW <-> OsmoMSC / OsmoSGSN jenkins.sh: build from libosmo-sccp and osmo-iuh master branches now for new M3UA SIGTRAN. Patch-by: pmaier, nhofmeyr, laforge Change-Id: I5ae4e05ee7c57cad341ea5e86af37c1f6b0ffa77
2017-08-27move openbsc/* to repos rootNeels Hofmeyr1-0/+586
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