Commit Graph

7249 Commits

Author SHA1 Message Date
Oliver Smith 93830d7fc4 timers: T->X: 23002, 23004, 23005, 23006
Make various internally used timers negative, to indicate that they are
Osmocom specific. A follow-up patch will make them configurable.

Change-Id: I6f8be40ea54a3083f4b21ab938cc1723fc67c2ef
2020-05-04 10:07:01 +02:00
Sylvain Munaut e55e76f4c7 om2k: Add VTY command to allow TX of arbitrary message for testing
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I5a385614fc670946f83ea79cc176c2d448675672
2020-04-28 09:50:59 +02:00
Sylvain Munaut d9fe61c43f om2k: Allow the CON configuration request to be triggered via VTY
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: Id1171a151773182bb5cdc14c023c3637fb9ad0bc
2020-04-28 09:50:59 +02:00
Sylvain Munaut 98c8985110 om2k: Allow TG and MCTR to be manipulated via VTY
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I3983ba9f06c48d515a7b739b00f05023af632267
2020-04-28 09:50:59 +02:00
Sylvain Munaut 63d7661147 om2k: Add definitions for the TG object
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I6d90554a54baa78f454281a486e4b5e95784fdee
2020-04-28 09:29:14 +02:00
Harald Welte 7463285994 handorer.h: Fix compilation with gcc-10
/usr/bin/ld: bsc_subscr_conn_fsm.o:/home/laforge/projects/git/osmo-bsc/src/osmo-bsc/../../include/osmocom/bsc/handover.h:26: multiple definition of `mr'; abis_rsl.o:/home/laforge/projects/git/osmo-bsc/src/osmo-bsc/../../include/osmocom/bsc/handover.h:26: first defined here

See also https://alioth-lists.debian.net/pipermail/debian-mobcom-maintainers/Week-of-Mon-20200413/000649.html

Change-Id: Ic21af84f2a6de48d220940f30dad02a0e7683ce8
2020-04-20 18:18:05 +00:00
Vadim Yanitskiy e981f17200 vty: clarify EGPRS Packet Channel Request message support
According to 3GPP TS 44.060, section 12.24, GPRS Cell Options IE
contains two parameters related to 11 bit Access Burst support:

  - ACCESS_BURST_TYPE - whether the 8 or 11 bit format shall be
    used in the PACKET CHANNEL REQUEST message, the PTCCH/U block,
    PACKET CONTROL ACKNOWLEDGMENT and the PS HANDOVER ACCESS
    messages on the PRACH (if present).

  - EGPRS_PACKET_CHANNEL_REQUEST - whether EGPRS capable MSs shall
    use EGPRS PACKET CHANNEL REQUEST message for Uplink TBF
    establishment on the RACH or on the PRACH (if present).

The VTY option 'gprs 11bit_rach_support_for_egprs' actually controls
the second parameter - EGPRS_PACKET_CHANNEL_REQUEST, though it may
be hard to understand this from its name and description.

This patch is actually a group of tightly related changes:

  - deprecate 'gprs 11bit_rach_support_for_egprs (0|1)':
    - update its description to avoid any possible confusion,
    - print a warning if it's used in non-EGPRS mode,
    - print a warning if it's still used;

  - introduce '[no] gprs egprs-packet-channel-request':
    - ensure that it can only set / printed in the EGPRS mode;

  - take a chance to clean-up / rename the related struct members:
    - 'supports_egprs_11bit_rach' -> bool 'egprs_pkt_chan_request',
    - remove 'supports_egprs_11bit_rach' from 'gprs_cell_options'
      because we already have 'ext_info.use_egprs_p_ch_req' there.

Change-Id: Ied5bd10a806aeeac65ef32339d4ab0e3700e5da9
2020-04-14 15:50:10 +00:00
Eric Wild 93920fa41b configure.ac: fix libtool issue with clang and sanitizer
As pointed out at https://github.com/libexpat/libexpat/issues/312
libtool does not play nice with clang sanitizer builds at all.
For those builds LD shoud be set to clang too (and LDFLAGS needs the
sanitizer flags as well), because the clang compiler driver knows how
linking to the sanitizer libs works, but then at a later stage libtool
fails to actually produce the shared libraries and the build fails. This
is fixed by this patch.

Addtionally LD_LIBRARY_PATH has no effect on conftest runs during
configure time, so the rpath needs to be set to the asan library path to
ensure the configure run does not fail due to a missing asan library,
i.e.:

SANS='-fsanitize=memory -fsanitize-recover=all -shared-libsan'
export CC=clang-10
ASANPATH=$(dirname `$CC -print-file-name=libclang_rt.asan-x86_64.so`)
export LDFLAGS="-Wl,-rpath,$ASANPATH $SANS $LDFLAGS"

Change-Id: If71654d87b375b4b882ab527e89353cd035f695b
2020-04-11 01:17:17 +02:00
Vadim Yanitskiy b6238b9375 vty: 'gprs 11bit_rach_support_for_egprs': clarify error message
Change-Id: I491d319f2829902a8c449db515f928cf7e480482
2020-04-06 19:00:05 +07:00
Vadim Yanitskiy 9a5b8bb031 vty: 'gprs 11bit_rach_support_for_egprs': drop redundant check
The VTY command parser would not allow values other than 0 or 1.

Change-Id: Ic29fac12414f1821702759a9f5260e941c9868b5
2020-04-06 19:00:05 +07:00
Vadim Yanitskiy 0c94d7257e rest_octets: cosmetic: fix alignment in gprs_cell_options
Change-Id: I344ea61df8cc910d9b524c9b2f0e03721eefe56c
2020-04-06 19:00:05 +07:00
Vadim Yanitskiy f06b9bf1c6 doc/manuals: remove deprecated DNAT from the VTY reference
Change-Id: Ib21c30041508a9ec9afda56bda95bddf4d665bc8
2020-04-05 00:39:45 +07:00
Vadim Yanitskiy 9077f1ab6c vty: fix: restore removed DNAT category as deprecated
This logging category has been removed in [1], what caused test
case execution failures on our Jenkins (since build #930). The
problem is that configuration files may still contain this
category in 'logging' section (see [2], [3], [4]), and
osmo-bsc would refuse to start because of that.

[1] Id965295dfe04f8bd5ce831db70c86f67b8dc290b
[2] Ie2afacfc15589c26238214cddc00baaf80e993c1
[3] I266d6f6ed54d1457b1ca63b87fc1c29f6dd40caf
[4] If02272c08ba2df37d1295d09c104d11f96abbe1e

Change-Id: I111362d19aba325889bada5a46eea62343c30033
2020-04-05 00:33:04 +07:00
Harald Welte 25e41af2d9 remove 'NAT' log category
This dates back to a time where osmo-bsc_nat was in the same repository,
which is a long time ago.

Change-Id: Id965295dfe04f8bd5ce831db70c86f67b8dc290b
2020-04-01 11:57:37 +02:00
Neels Hofmeyr 6ab7a52b67 manual: add SCCPlite section
Change-Id: I8eddc47353d6afd756865321a9e97f6cee4ce2d7
2020-03-30 15:57:57 +00:00
Neels Hofmeyr b5a25b0137 manual: add SCCP/M3UA section from common chapters
Link to the osmo-gsm-manuals/common/cs7-config.adoc chapter to fully explain
the 'cs7' client configuration.

Related: OS#2767
Depends: Ia2508d4c7b0fef9cdc57e7e122799a480e340bf7 (osmo-gsm-manuals)
Change-Id: I5b4973901f02046322b852fd9862517982d21bd9
2020-03-30 15:57:57 +00:00
Keith Whyte b6c6253038 Meas Tools, Avoid compiler format warnings
Change-Id: I8d807ffc4571f2954e3d1083da673dc1235e7687
2020-03-29 14:23:44 +00:00
Keith Whyte 2c92f3c44f Meas Tools: Avoid unusable terminal in case of error on osmo_sock_init
If, as before this patch we call initCDKScreen() before
attempting to bind the socket, then the socket bind fails,
we exit and the terminal needs a reset.

Attempt to open the socket before initCDKScreen()
so we don't end up with a messed up terminal if the socket
call fails.

Change-Id: Ia5148d9ef386df314bc2837b3cb672150250bd2a
2020-03-29 00:20:42 +00:00
Keith Whyte 85fe6104c5 Meas Tools: Avoid OSMO_ASSERT due to uninitialised logging.
The measurement tools use libosmocore socket functions that will
use logging if the socket cannot be opened, but the tools did
not initialise logging, resulting in

 Assert failed osmo_log_info logging.c:235
 backtrace() returned 9 addresses
 [.....]

Initialise logging so that we get a nicer and more informative
message, such as:

 unable to bind socket:(null):8888: Address already in use
 no suitable addr found for: (null):8888

Change-Id: Ib3b3558723682defcee22e7ea2d8bf5c2cff1278
2020-03-28 15:25:07 -05:00
Oliver Smith b5bfa71aa2 VTY: regenerate bsc_vty_reference.xml
Change-Id: I27bcde8d36dcf8daa9d24b4b581c9526b73cb35e
2020-03-27 10:29:51 +01:00
Oliver Smith da603f0aef VTY: let all descriptions end in \n
Change-Id: I00a183078679db50567286a78c9e4f9afa3466c6
2020-03-27 10:15:01 +01:00
Oliver Smith ba0a12233f VTY: add show bts failure report
Save OML failure reports from each BTS. Add a VTY command to display them
conveniently and optionally clear the list.

OsmoBSC> show bts 0 fail-rep
[2020-03-23 14:51:22] Type=processing failure, Severity=minor failure, Probable cause=Manufacturer specific values: Software warning, Additional text=test message sent from VTY
[2020-03-23 14:51:19] Type=processing failure, Severity=minor failure, Probable cause=Manufacturer specific values: Software warning, Additional text=test message sent from VTY

Related: OS#1605
Change-Id: I18aa17a721cd5eb1c98926dc2367229c0a50bc78
2020-03-27 09:55:30 +01:00
Oliver Smith cd1df9975c abis_nm: move fail report parsing to extra func
Separate raw input parsing from handling the failure report. A follow-up
patch will use the new parsing function to print saved failure reports
to the VTY.

While at it, put struct tlv_parsed inside struct nm_fail_rep_signal_data
instead of a pointer, so we don't need an additional alloc. Also add
error handling to the abis_nm_tlv_parse() call.

Related: OS#1605
Change-Id: Ia51004faf620aa4d40435d58c70d758c9d0054d8
2020-03-26 14:52:02 +01:00
Oliver Smith 33eca64211 abis_nm.c: rx_fail_evt_rep: fix sd.bts
Use the extra bts pointer instead of mb->trx->bts, which does not point
to an allocated bts.

Related: OS#1605
Change-Id: Ie61512f5690763fa380bdf0e7fb4763dbda019d2
2020-03-23 13:49:05 +01:00
Neels Hofmeyr 21a2c81da4 manual: add "Multiple Instances" section, akin to other manuals
Related: OS#2767
Change-Id: Ideb137f19d19144d35b05eb036098045bbb18d64
2020-03-22 19:23:55 +00:00
Oliver Smith a595db15ea main: exit on mutually exclusive codecs settings
Refuse to start with mutually exclusive codec settings, unless
allow-unusable-timeslots is set in the network section of the config.
The checks were already implemented and fill the error log if the config
is invalid.

Related: OS#3739
Change-Id: I3ccfc3b0a8641400cb97a23b24d7ed92d2ad25cd
2020-03-19 12:29:22 +01:00
Oliver Smith 5edae5d203 osmo-bsc-minimal.cfg: fix codec-list
All timeslots are configured for full rate, so the codec list must also
have a full rate codec. Fix this error on startup:
"Configuration contains mutually exclusive codec settings -- check configuration!"

All other example configs don't have mutually exclusive codec settings.

Related: OS#3739
Change-Id: Iddac13c7d644ed57b6d9e6a57d23d88c01bd8b8e
2020-03-17 14:40:05 +01:00
Oliver Smith 6e806907c6 osmo-bsc/bsc_vty: fail on get_amr_from_arg error
Fail parsing osmo-bsc.cfg if the AMR modes are not in order or not
unique.

Related: OS#4199
Change-Id: Ic2f3690396fb0425f6b358e1e21a8b8b56eb3ae0
2020-03-16 09:28:17 +00:00
Oliver Smith beb4af6ff8 osmo-bsc/bsc_vty: set default gprs cell bvci to 2
Do not use 0 as default, as it is reserved for signalling.

Related: OS#4408
Change-Id: I499272f16aadd89f3bdb5d749e3e4f9e07056c15
2020-03-12 12:00:24 +01:00
Oliver Smith 5291b6429e tests/Makefile.am: allow running only one VTY test
Add VTY_TEST variable, just like in osmo-hlr Change-Id
I4ad7ddb31b2bfb668b3540cfef658417dd442375.

Change-Id: Ieb08ae57bd8bb68c9a8593b3e1175eae9064ac57
2020-03-11 10:35:49 +01:00
Pau Espin 8ada920779 bssap: Avoid logging error if no optional Global Call Ref IE received
Also take the chance to simplify related code and print erroneous IE
data.

Change-Id: I27ee9c6112f96d6839b8b6141888ac8fe377db65
2020-02-12 16:38:12 +01:00
Harald Welte 2fa9763fb8 OM2000: Add some more message types and IEs we now understand
OM2000 is not only used for the venerable RBS2000 family, but also
for the more modern RBS6000 family, specifically the DUG 20 GSM
baseband unit.

In RBS6000, there are some protocol extensions which are not yet fully
understood. However, we are understanding some bits around the MCTR
(multi carrier transceiver?), a new MO that appears to be present for
every physical RUS (Radio Unit) attached to the DUG 20.

Let's add what we have learned so far.

Thanks to Sylvain Munaut for his help with this.

Change-Id: Ib868358eca12b94c4fcca58e94ec8ab1a4edfda2
2020-01-29 09:21:00 +01:00
Vadim Yanitskiy b84463e36a VTY: fix writing of custom timer values to a configuration file
Calling osmo_tdef_vty_write() twice: with and without the 'timer '
prefix definitely looks like a bug. After setting any timer to a
custom (non-default) value, config_write_net() would generate an
incorrect configuration file:

  $ osmo-bsc -c /tmp/osmo-bsc.cfg
  There is no such command.
  Error occurred during reading the below line:
    T10 10

Change-Id: I5cc893fb2077bb21f1f661e30a7ab2af1b9bd561
2020-01-18 05:54:43 +07:00
Philipp Maier 40e3f1e3d7 bsc_main: use higher default loglevels.
The loglevels of DNM, DFILTER and DPCU are set to low, lets set them all
to NOTICE

Change-Id: I03a5426b341e9908ffc89240f97d6d3ea791b4a8
Related: OS#2577
2020-01-15 13:23:01 +01:00
Harald Welte 35d07b7698 Introduce nm_fail_rep_signal_data for "SS_NM, S_NM_FAIL_REP" signal
Let's not just pass around the raw msgb, but also all other metadata,
such as the decoded parts of the TS 12.21 message.

As there's no current consumer of that signal, this creates no
compatibility issues.

Change-Id: I5d4d9d422b4e23348ffbe69c6e87a31d5574f90d
2020-01-06 10:28:18 +00:00
Pau Espin a1362ce8c2 Bump version: 1.5.0.43-e1f08-dirty → 1.6.0
Change-Id: I21556570e35d662bb902d5c1afc911b82d5eb1e6
2020-01-03 18:24:51 +01:00
Oliver Smith e1f0844afb debian, osmoappdesc.py, tests: switch to python 3
Make build and external tests work with python3, so we can drop
the python2 dependency.

This should be merged shortly after osmo-python-tests was migrated to
python3, and the jenkins build slaves were (automatically) updated to
have the new osmo-python-tests installed.

Related: OS#2819
Depends: osmo-python-tests I3ffc3519bf6c22536a49dad7a966188ddad351a7
Change-Id: I438ca0c4b8e7957d0f347a5b2f5c4cb93f9325e6
2019-12-11 09:31:40 +01:00
Harald Welte 01a3c2689c gsm_04_80: Avoid using deprecated API
gsm_04_80_utils.c: In function ‘bsc_send_ussd_release_complete’:
gsm_04_80_utils.c:37:9: warning: ‘gsm0480_create_ussd_release_complete’ is deprecated: Use gsm0480_create_release_complete() instead. [-Wdeprecated-declarations]
   37 |  struct msgb *msg = gsm0480_create_ussd_release_complete();
      |         ^~~~
  CC       gsm_data.o
In file included from gsm_04_80_utils.c:22:
/usr/local/include/osmocom/gsm/gsm0480.h:120:14: note: declared here
  120 | struct msgb *gsm0480_create_ussd_release_complete(void)
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The commit is not changing the existing logic/assumption: TID 0 should
not be in use by anything else at the point the USSD is generated.

Change-Id: I739158dec62cd5f0c2080fbb426af9c024baef87
2019-12-06 14:04:23 +00:00
Oliver Smith f659f5e5b0 doc: osmux: use generated svg instead of pychart
Replace python 2 code using pychart to draw a graph in
osmux-reference.adoc with the generated svg file. The upstream of
pychart is dead, there is no python 3 version, and python 2 is EOL at
the end of 2019.

This is the only time we ever made use of pychart in osmo-gsm-manuals,
so with this change, we can just drop the dependency.

I've generated the chart by saving the python code in chart.py, then:
$ ./chart.py --format=svg --font-size=3 > chart.svg

Related: OS#2819, OS#4193
Depends: osmo-ci I754b133d77743582bd84c33c74ecc9eb9ca4c0ef
Change-Id: I36b721f895caee9766528e14d854b6aa2a2fac85
2019-12-05 17:53:52 +01:00
Harald Welte 2ca002f4af exit(2) on unsupported positional arguments on command line
Change-Id: I3b8781e220326387f1c437c39aff8661326f1e0a
2019-12-03 21:49:31 +01:00
Vadim Yanitskiy a1d175ab66 abis_nm.c: fix RSL connection timeout for trx->nr > 0
After sending of NM_MT_IPACC_RSL_CONNECT message, we start a timer,
and stop it on receipt of NM_MT_IPACC_RSL_CONNECT_{ACK,NACK}. When
running a multi-trx setup, one can see the following warnings:

  DRSL NOTICE abis_nm.c:2852 (bts=0,trx=1) RSL connection request timed out
  DRSL NOTICE abis_nm.c:2852 (bts=0,trx=2) RSL connection request timed out

even despite NM_MT_IPACC_RSL_CONNECT is actually being acknowledged.

The problem is in abis_nm_rx_ipacc(): we cannot just use sign_link->trx,
because the message itself was received over the OML link, so this
pointer always gives us C0/TRX0. Instead, we must find a TRX by its
number from the FOH header using gsm_bts_trx_by_nr().

Change-Id: Ib4b9a198da11c88a51cfa78ffb7e7235a6365ef4
2019-12-02 08:46:10 +00:00
Harald Welte 5e4fdb23a4 Move a_reset_fsm regstration to __attribute__((contructor))
This way we can avoid the runtime overhead of checking whether or not
it is initialized over and over again.  It also brings this code more
in line with other users of osmo_fsm_register().

Change-Id: I3c7220491cf6ffb1361e7259c0344df64a013a0a
2019-12-01 15:43:40 +01:00
Harald Welte 16c8910c71 manual: Fix copy+paste error
Change-Id: I787c4bd4b30a6620a987efed4fd8b46e14a7ea64
2019-12-01 14:23:34 +01:00
Harald Welte 630cc6c229 check for osmo_ss7_init() error return value
Change-Id: I0297352e3cba5f01a971dc5924f0fcc67d1e6b32
2019-12-01 13:19:05 +01:00
Harald Welte 6d3d1c1019 check for osmo_fsm_register() error return value
Change-Id: I77e8ace007a3d6b9c40d3e158d1cdb7576aab77b
2019-12-01 13:18:20 +01:00
Neels Hofmeyr 4bf8df5c42 fsm: use deferred deallocation
Since osmo-bsc uses the MGCP client FSMs, it is required to enable this new
feature to guarantee safe operation. The issue is described in detail in commit
logs linked below.

Depends: Ief4dba9ea587c9b4aea69993e965fbb20fb80e78 (libosmocore),
         I0adc13a1a998e953b6c850efa2761350dd07e03a (libosmocore)
Related: I7df2e9202b04e7ca7366bb0a8ec53cf3bb14faf3 (osmo-mgw)
Change-Id: Ib7fce7b7d54dfb87af97544796680919e5929a50
2019-11-23 08:03:39 +00:00
Pau Espin f8d0389c70 bsc: Send MS Power Control msg upon max MS power change
Lots of times, the MS power class is unknown until after the first
channel has been activated, at which point the MS power class is
received in messages such as LU update or CM Service Requet.
Since the MS Power level is sent upon CHAN ACT, the only way to
communicate the change of maximum MS Power (based on MS power class)
after CHAN ACT is to send a MS Power Control msg. Let's do that.

Related: OS#4244
Change-Id: I3d6b75578e5cb9b2ad474a0ad01362d846ebe135
2019-11-20 15:35:05 +01:00
Vadim Yanitskiy 26adddf1bf abis_nm.c: replace magic numbers with NM_CHANC_* constants
Change-Id: I60b20d617bd8710a95977e41ae32a431af4402a9
2019-11-19 18:35:20 +00:00
Vadim Yanitskiy 7f4360bc83 abis_nm.c: fix error message in verify_chan_comb()
Change-Id: Ic72753d821c3ab72cda79be71aed1704beefe983
2019-11-19 18:35:20 +00:00
Pau Espin fec68adf3c cosmetic: bs11_config: clean trailing whitespace
Change-Id: I55f478c753c38baa576abc6ba53c4f6c9cbe61c0
2019-11-19 00:52:18 +00:00