Commit Graph

21 Commits

Author SHA1 Message Date
Harald Welte 6c8ca97546 Support building with -Werror=strict-prototypes / -Werror=old-style-definition
Unfortunately "-std=c99" is not sufficient to make gcc ignore cold that
uses constructs of earlier C standards, which were abandoned in C99.

See https://lwn.net/ml/fedora-devel/Y1kvF35WozzGBpc8@redhat.com/ for
some related discussion.

Change-Id: Ic92aa70d569778a776f4c5d24c455f71fd50b61b
2022-11-10 00:28:46 +00:00
Oliver Smith 2b6c58fddb Cosmetic: fix desc of neighbor_ident_add_neighbor
Change-Id: I6d78220156f8a4a4b246f9fcc5e9d066c2a90bbb
2022-10-27 14:07:40 +02:00
Philipp Maier 085a92584f heighbor_ident: add/del neighbor cells via ctrl interface
The VTY allows flexible control over the neighbor cell information via
the neighbor command, which can be found in the configure terminal under
the bts node. Lets add pendant of this command on the control interface
as well.

Change-Id: I343a40e18fa9b91e6c381912c0426a002841e079
Related: SYS#5641
2021-11-03 17:25:28 +00:00
Pau Espin 506aa70d77 Support Neighbor Address Resolution over PCUIF IPA multiplex
While NACC was initially developed, it became clear there was need for
a way to interact PCU<->BSC in order resolve ARFCN+BSIC into CGI-PS
for later RIM usage.
Hence, this resolution was first (until today) implemented using an out
of bands RPC system using the CTRL interface, which required specific
config to be written and matches in osmo-pcu and osmo-bsc VTY (ip+port
of the CTRL interface to use).
However, this has several shortcomings:
* As explained above, specific configuration is required
* Since recently, we do support BSC redundancy in osmo-bts. Hence the BTS
  may switch to a BSC other than first one. If that happened, that'd mean
  the CTRL interface would still point to the initially configured one,
  which may not be the same currently serving the PCU.

During recent development of ANR related features, a similar need for
PCU<->BSC was required, but this time it was decided to extend the IPA
multiplex of the Abis OML connection to pass PCUIF messages,
transparently forwarded to each side by the BTS.
This has the advantage that connection PCU<->BTS is handled by BTS and
both sides send messages transparently.

Let's switch by default to using this new interface, while still
maintaing the old way for a while (announcing them as deprecated) to
avoid breaking existing deployments until they are upgraded to new
versions of osmo-pcu and osmo-bsc.

Change-Id: I9073a121564503f483c84263ac72476041e47c03
Related: SYS#4971
2021-09-13 16:04:05 +02:00
Pau Espin 8831160631 Revert "update neighbor ARFCNs on startup and config changes"
This patch caused major breakage in my setup, with BSC printing at
startup: "(bts=0,trx=0) Failed to generate System Information".

And bts-trx printing all the time:
"sysinfo.c:162 PH-RTS-IND: Unable to determine actual BS_AG_BLKS_RES
value as SI3 is not available yet, fallback to 1"

This reverts commit c1a5310a3e.

Change-Id: I5da365c93aedc6668a77b82ee9b68cbec64967e3
2021-04-23 13:38:58 +02:00
Neels Hofmeyr c1a5310a3e update neighbor ARFCNs on startup and config changes
The effects of the neighbor configuration depend on the LAC, Cell
Identity, ARFCN, BSIC configuration of neighbor cells. Make sure that
the neighbor ARFCN list in the System Information is updated.

This may seem rather aggressive: updating the SI of all BTS if only one
config item changed. But indeed even modifying one config item of one
BTS may cause a change in the neighbor relations that many other BTS may
have to the changed BTS. For example, if many BTS configure a
'neighbor lac-ci 42 23', and this cell's config changes to LAC 43, all
of those other BTS need to update their neighbor ARFCNs.

Also update the system information even before the BTS are connected and
started up. The main benefit here is that the VTY 'show bts N' command
then already lists the correct neighbor ARFCNs.

In gsm_bts_trx_set_system_infos(), make sure that the updated SI is only
sent to TRXes that are actually usable, otherwise abis_rsl_sendmsg()
spams the log with complaints that a message's dst == NULL. Still return
an error rc in case a TRX is not connected, so that the CTRL command
bts.N.send-new-system-informations accurately returns whether SI were
actually sent to all TRXes.

The desire to have the ARFCNs listed in the VTY before starting up BTSes
came during analysis for Ifb54d9a91e9bca032c721f12c873c6216733e7b1,
which fixes a bug that is now much easier to verify being fixed.

Change-Id: I2222e029fc225152e124ed1e8887f1ffd4a107ef
2021-04-22 18:50:32 +00:00
Neels Hofmeyr 764449ec2e fix/refactor neighbor config
The neighbor configuration storage is fundamentally broken: it requires
all local cells to be configured before being able to list them as
neighbors of each other. Upon config write-back, the neighbor config
however is placed back inline with the other config, and hence a
written-out neighbor config no longer works on program restart.

The cause of this problem is that the config is stored as explicit
pointers between local cells (struct gsm_bts), which of course requires
the pointer to exist before being able to reference it.

Instead, store the actual configuration that the user entered as-is,
without pointers or references to objects that need to be ready. Resolve
the neighbors every time a neighbor is needed.

Hence the user may enter any config at any place in the config file,
even non-working config (like a BTS number that doesn't exist), and the
relation to actual local or remote neighbor cells is made at runtime.

Abort program startup if the initial neighbor configuration contains
errors.

Related: OS#5018
Change-Id: I9ed992f8bfff888b3933733c0576f92d50f2625b
2021-03-24 21:22:21 +01:00
Pau Espin Pedrol 55a015dddf Introduce Neighbor Resolution Service
This new CTRL interface allows users of this BSC (such as attached PCU)
to gather neighbor information.

This interface is needed for PCU to translate ARFCN+BSIC keys provided
by MS in the Um side into CGI + RAC keys used to identify target cells
in RIM procedures against SGSNs on the Gb interface.

This patch extends the already existing neighbor information storage in
the VTY by allowing storage of CGI + RAC (RAC couldn't be stored
beforehand).

Related: SYS#4909
Depends: libosmocore.git Change-Id If48f412c32e8e5a3e604a78d12b74787a4786374
Change-Id: Ib07c9d23026332a207d4b7a0f7b4e76c0094e379
2021-01-13 17:14:09 +01:00
Pau Espin 388ed58482 Move struct gsm_bts: gsm_data.* => bts.*
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-18 21:45:32 +00:00
Martin Hauke a29affda98 Fix some typos
Fix typos and common misspellings in code comments and in the manual.

Change-Id: I46fc9d424620c77ae9ccf78b58081bd303386d7c
2019-11-13 22:10:41 +01:00
Neels Hofmeyr 91a202d488 neighbor config: allow re-using ARFCN+BSIC pairs
Fix neighbor config to match OsmoBSC manual: implement the plan for neighbor
configuration that was so far only described in the manual without actually
being in operation.

This first allows re-using ARFCN+BSIC pairs in and across BSS.

So far the handover_start() code always looked for handover target cells across
*all* local cells, even if they were not listed as neighbors to a source cell.
Imply all cells as neighbors only as long as there are no explicit neighbors
configured. As soon as the first 'neighbor' line appears in a 'bts' config,
only the listed neighbors are regarded as handover target cells. (The
'neighbor-list' commands are not related to this, only the relatively new
'neighbor (bts|lac|cgi|...)' commands affect actual handover procedures.)

TTCN3 tests TC_ho_neighbor_config_1 thru _7 play through the various aspects of
neighbor configuration: both the legacy implicit all-cells-are-neighbors as
well as allowing only explicit neighbors by config.

Related: OS#4056
Related: osmo-ttcn3-hacks Ia4ba0e75abd3d45a3422b2525e5f938cdc5a04cc
Change-Id: I29bca59ab232eddc74e0d4698efb9c9992443983
2019-08-13 23:47:23 +02:00
Neels Hofmeyr 12224e7ca7 add vty 'no neighbors' to remove all HO targets
This is required for an upcoming TTCN3 test that plays through various neighbor
configurations.

Related: OS#4056
	 Ia4ba0e75abd3d45a3422b2525e5f938cdc5a04cc (osmo-ttcn3-hacks)
Change-Id: I8623ab581639e9f8af6a9ff1eca990518d1b1211
2019-08-13 21:45:34 +00:00
Neels Hofmeyr acd29192de remote-BSS neighbors: allow only one cell ID
I believe I have initially misinterpreted the idea behind sending a Cell
Identifier List in BSSMAP Handover Required messages. Instead of associating N
Cell Identifiers with one ARFCN+BSIC, the idea is to add up N separate
ARFCN+BSIC's Cell Identifiers into a list. To keep the door open for future
code simplification, make sure to allow only one Cell Identifier per remote
ARFCN+BSIC on the VTY UI.

Related: OS#3656
Change-Id: Ifb9212fede2333ad68db94188b5cda4fcabe02f8
2018-10-16 15:07:57 +02:00
Neels Hofmeyr 8afdeee22e vty: write local neighbors by bts nr, not lac-ci
Change-Id: I35783f9624eacbdffccdb59a0179ffda54a26990
2018-09-27 03:32:35 +02:00
Neels Hofmeyr 0812db27bb neighbor vty: allow setting local neighbors by CGI
Add missing item in the landscape of VTY commands: allow identifying a local
cell by CGI (besides BTS nr, LAC or LAC+CI, which already exist).

Change-Id: I2d03de6b695904c4a86025bf250358d04f6e47de
2018-09-27 03:32:35 +02:00
Neels Hofmeyr 20482c730f neighbor vty: rather 'no neighbor', not 'neighbor del'
Now the scheme nicely matches:

 bts 0
  neighbor bts 1
  no neighbor bts 1

Change-Id: Ib6015b8b48c1f6b98a02cb5a68e568083466e0d5
2018-09-27 03:32:35 +02:00
Neels Hofmeyr c7365aef65 neighbor vty: drop keyword 'add'
When writing the neighbor configuration documentation, I noticed that 'neighbor
add' and 'neighbor del' make sense from an interactive VTY POV, but when
looking at a static config file, it makes more sense to simply name the
neighbors without the 'add' keyword, and to use the 'no' prefix instead of the
'del' keyword. It still makes sense to tweak cosmetics like this before
inter-bsc handover is used anywhere.

First, remove 'add' from all 'neighbor add ...' commands.

Instead, prepend "Add" to the doc string for the cell identification argument
in commands that add a neighbor:

  -OsmoBSC(config-net-bts)# neighbor add ?
  -  bts     Neighbor cell by local BTS number
  +OsmoBSC(config-net-bts)# neighbor ?
  +  bts     Add Neighbor cell by local BTS number

(A subsequent patch will rename 'neighbor del' to 'no neighbor'.)

Change-Id: I143f21f6069d1a86096cc8240cf69eb7ea9c8ac8
2018-09-27 03:32:35 +02:00
Neels Hofmeyr 4122c15ea9 neighbor_ident_vty.c: fix CI format, should be 16bit
In the 'lac-ci' and 'cgi' neighbor identity VTY parameters, fix the CI part to
<0-65535>.

Use 65535 as CI in the neighbor_ident.vty test to verify the range.

Change-Id: Ie93bfe176b9d2d9445966e4ab0b928b9aa62a77f
2018-08-29 02:00:33 +02:00
Neels Hofmeyr a7b88414fb cosmetic: neighbor_ident_vty.c: add and use common string defs
The "bts", "lac" and "lac-ci" VTY parameters and documentation are used more
than once in this file. Define once and re-use.

Prepares cosmetically for a fix of the CI format in upcoming
Ie93bfe176b9d2d9445966e4ab0b928b9aa62a77f.

Change-Id: I88a377c6d77c5f18877343f84f7a26f851a427ff
2018-08-27 00:48:26 +02:00
Neels Hofmeyr 431e085736 inter-BSC HO: neighbor_ident API: drop 9bit BSIC
9-bit BSIC exist in the 3GPP specs, but we don't use them anywhere. Rather
remove that choice from the API and UI.

Change-Id: I29b92f47da2636d3a19f073755f9382fa98f9010
2018-07-28 12:18:23 +02:00
Neels Hofmeyr 19bed23065 inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells
Depends: Ia71ba742108b5ff020997bfb612ad5eb30d04fcd (libosmocore)
Change-Id: I0153d7069817fba9146ddc11214de2757d7d37bf
2018-07-28 12:18:23 +02:00