Commit Graph

6400 Commits

Author SHA1 Message Date
Neels Hofmeyr 9abc652b5e vty: 'show bts': write '(none)' if none are found.
Change-Id: I77039824b85a14b9d7bdfe6d2f717679b6886915
2018-02-15 15:21:31 +01:00
Neels Hofmeyr 91004ab734 gsm_network: drop unused subscr_epxire_timer
Change-Id: I2e34ffb35e244472f8bfc993facc8d6e130f10d9
2018-02-14 12:55:45 +01:00
Neels Hofmeyr 28838e9aaa drop unused common.h
Change-Id: I7cf4076d7e36ae71d88e70a86d5c2d0640c1146f
2018-02-14 12:55:45 +01:00
Neels Hofmeyr d23ce86c25 drop libcommon-cs completely
Change-Id: I07d4a48af3154ee4d904686f230a51b8b8a94ff9
2018-02-14 12:55:45 +01:00
Neels Hofmeyr 92b9f2ecd4 common_cs.h: mv gsm_encr to gsm_data.h
This leaves common_cs.h practically empty. Leave its removal to the next patch,
which removes libcommon-cs entirely
(I07d4a48af3154ee4d904686f230a51b8b8a94ff9).

Change-Id: Ic3233f03580aa8c0ab178dfd33e68ecab5b9f042
2018-02-14 12:55:45 +01:00
Neels Hofmeyr 6dd5a9b017 libcommon-cs: move vty bits to libbsc/bsc_vty.c
The gsm_network VTY was partly shared between libmsc and libbsc in the old
openbsc.git; now osmo-bsc.git has its own copy, so merge all of it into
bsc_vty.c.

This leaves common_cs_vty.c practically empty; leave removal of the file to
later, when we drop the entire libcommon-cs in
I07d4a48af3154ee4d904686f230a51b8b8a94ff9.

Note that gsmnet_from_vty() is also already declared in bsc/vty.h.

Change-Id: I6f3a596f31762b48afed39a85a343c400826300f
2018-02-14 12:55:45 +01:00
Neels Hofmeyr b5400776d8 libcommon_cs: move gsm48 bits to libbsc
These functions were originally shared between libmsc and libbsc in the old
openbsc.git; now osmo-bsc.git has its own copies, so move them into libbsc.

Change-Id: Ie411c2ce8008accee54782a442d6361e50777a54
2018-02-14 12:55:45 +01:00
Neels Hofmeyr d85e4cb711 gsm_network: drop unused trans_list
Change-Id: I7910ce8098d5431e41409bf09429ae4221efb360
2018-02-14 12:55:45 +01:00
Neels Hofmeyr ab1b381d1b libcommon-cs: move gsm_network_init() into bsc_network_init()
Some part of the network init was common between libbsc and libmsc in the old
openbsc.git repository. Now osmo-bsc.git is independent with its own copy of
the gsm_network initialization. So move it over to libbsc.

Change-Id: I8968787a5f0b078619264f0cb42349a9bc7943af
2018-02-14 12:55:45 +01:00
Neels Hofmeyr f088e790f7 libcommon-cs: move a_reset.c into libbsc
a_reset.c was originally used by both libmsc and libbsc in the old openbsc.git
repository. Now osmo-msc.git has its own copy, and the idea of sharing
libcommon-cs is no longer applicable. Move it to libbsc where it belongs.

Change-Id: I30e4b5dab9c6d761d20a3a0e5b9ec2d65e64ebc5
2018-02-14 12:55:45 +01:00
Neels Hofmeyr 421059a2c0 drop libcommon completely, move remaining files to libbsc
Move gsm_data.c and handover_cfg.c to libbsc, where they belong.

This leaves libcommon utterly empty, drop it.

Change-Id: I6178061fa30c7e1a4c22c29d3c8f508b1033569f
2018-02-14 12:54:38 +01:00
Neels Hofmeyr 104851632d libcommon: join gsm_data_shared.* into gsm_data.*
The separation of gsm_data_shared.* from gsm_data.* historically allowed
compiling parts of it into osmo-bts, which we have dropped since (osmo-bts has
its own copy now). Even though gsm_data.* now becomes rather large by it,
remove the legacy separation to get rid of the "shared" naming, which is no
longer meaningful. A future patch might separate into meaningful smaller bits,
if we get the time.

Change-Id: Ie247bc492efb331871d970c56700595ad3f7e201
2018-02-14 12:15:40 +01:00
Neels Hofmeyr 87592b8967 ipaccess-proxy: don't redefine tall_bsc_ctx
Curiously, ipaccess-proxy.c is able to define its own tall_bsc_ctx even though
the same should already be linked from gsm_data.c. Declare it extern instead
and hence use the one from gsm_data.c.

A linking error actually occured as soon as I joined gsm_data_shared.c into
gsm_data.c, which is how my attention was drawn to this. I assume that linking
didn't necessarily pull in gsm_data.c before and a separate tall_bsc_ctx was
permitted. As soon as the next commit merges those files
(Ie247bc492efb331871d970c56700595ad3f7e201), it becomes impossible to define a
second tall_bsc_ctx in ipaccess-proxy.c.

Change-Id: I9c9c8540419876696e65a690717144d497d60fb2
2018-02-14 12:15:40 +01:00
Neels Hofmeyr cc6240aeb2 libcommon: eliminate talloc_ctx.c
Interestingly enough, talloc_ctx_init() actually had not a single caller.

While dropping it, see to it that the few contexts that are actually used in
osmo-bsc.git are indeed initialized in all the main scopes.

Also initialize two void* ctxts as NULL explicitly, to allocate under the NULL
context in case some main scope forgets to branch it off another root context.
(That's bsc, fle and paging, all others actually come in from other libraries.)

Change-Id: I344a3d07e146999e154824837ed95db2b9879356
2018-02-14 12:15:40 +01:00
Neels Hofmeyr 978f58cd2e libcommon: eliminate socket.c
Replace calls to make_sock() with osmo_sock_init_ofd().
Shame on me for not testing every single one in practice, I hope for peer
review to confirm that this should be correct... Read closely please!

The IPPROTO_GRE define seems to be unused (at least in osmo-bsc.git), drop it
completely.

Change-Id: Ia6e4e0e1eed3328fa25b3b90be376d532ad0e56b
2018-02-14 12:15:40 +01:00
Neels Hofmeyr 7997bf4bed libcommon: eliminate debug.c
Provide concise log categories for each main scope.

Move the complete log categories 1:1 to osmo_bsc_main.c.

In bsc_nat.c, omit obviously unused log categories.

In tests, omit almost all log categories, except for those explicitly tested as
the expected output.

Note: should any logging occur for a log category that is omitted by accident,
such will end up being logged as DLGLOBAL, so it will show up and we can fix
it, and it will not get lost silently.

Change-Id: Ib524e49ec211662e0dfde8161495a72aa8ad76cf
2018-02-14 12:15:40 +01:00
Neels Hofmeyr ec1bb16eef libcommon: eliminate common_vty.c
Move bsc_vty_go_parent() to osmo_bsc_main.c and bsc_nat.c, and drop those nodes
that aren't used in the respective main scope.

Change-Id: I22ebb76742e9c5ab9dd608ac089a5c558aceeb36
2018-02-14 12:15:13 +01:00
Neels Hofmeyr e161bca800 libcommon: eliminate bsc_version.c
Move the copyright string into osmo_bsc_main.c. No other users of it exist.

Change-Id: I7f48924f484e4e4b98be4ca8bee253e6ea9c0576
2018-02-14 11:27:53 +01:00
Harald Welte 2f4f4b8604 osmo-bsc: Add talloc context introspection via VTY
This requires libosmocore with Change-Id
I43fc42880b22294d83c565ae600ac65e4f38b30d or later.

Change-Id: I1245b6818eb54f5c0c8adddcd3a01ecc7363fb42
2018-02-14 00:56:07 +00:00
Stefan Sperling 73acbca50f Make RSL connection attempts time out.
If a BTS/TRX does not respond to the "IPA RSL Connect" command,
pretend that the BTS has sent a NACK for the connection.

To ensure that osmo_timer_del(&trx->rsl_connection_timeout) is not called
before this timer is initialized with osmo_timer_setup(), the E1 layer now
drops incoming RSL messages from a BTS/TRX in LOCKED administrative state.

We cancel the timeout if we receive an RSL Connect ACK or NACK from the BTS,
and if the underlying E1 link does down.

While here, add a missing message buffer free() in bts_isdn_sign_link().
The callers do not free it.

Change-Id: Ia72b65a0f15f47dcb8a6f944f6c3695a4a64b923
Related: OS#2716
2018-02-13 18:08:28 +01:00
Philipp Maier aa4adb8fbf abis_rsl: do not allow SACCH in MF mode on SAPI=0
osmo-msc does currently not check if an MS attemts to establish an
SACCH link on SAPI=0. This combination is not permitted and should
be dropped.

- Make sure that establish indication for SAPI=0 and channel-type=SACCH
  is not permitted

See also TTCN3 Testcase:
BSC_Tests.TC_rll_est_ind_inval_sacch

Change-Id: I12962072c0ea689d2b9b5c2899ffb59be9310dcb
Closes: OS#2750
2018-02-06 19:39:57 +01:00
Philipp Maier cc48efe400 abis_rsl: permit first EstablishInd only on SAPI=0
When the first EstablishInd (DCCH) is made by the MS, then it must by
definition happen on SAPI=0. The MS may establish multiple connection
on other SAPIs afterwards. At the moment osmo-bsc does not check the
SAPI when an EstablishInd message is received.

- For SAPIs other than 0, check if SAPI=0 has already been
  established

See also TTCN3 testcases:
BSC_Tests.TC_rll_est_ind_inval_sapi1
BSC_Tests.TC_rll_est_ind_inval_sapi3

Change-Id: Ibf4fca0bd42dfe5bc63e8b08754ebbe0a5e252c3
Closes: OS#2750
2018-02-06 19:39:57 +01:00
Stefan Sperling 81dc9e7455 Add stat items for the BTS's channel load average and T3122.
In addition to logging the current values of a BTS's channel load
average and T3122 override, maintain stat items for these values.
This allows for plotting these values over time, for instance.

These values show up in the VTY under 'show stats' like this:

base transceiver station:
 Channel load average.:       25 %
 T3122 IMMEDIATE ASSIGNMENT REJECT wait indicator.: 32 s

Change-Id: Icace0176e8b1d23d7c7b4816f7c67c65312844fa
Suggested-by: laforge
2018-02-05 22:36:54 +00:00
Harald Welte 5f45a4a825 vty: print RTP IP of lchan if actually bound; print remote (mgw) IP
Change-Id: I87840aa0f5b9c04d7736bf5f649142219853711a
2018-02-05 21:33:34 +01:00
Harald Welte d9cc21c48f gsm_data_shared.h: Remove unused sacch_deact member field
Change-Id: I806b957b7f6fbbb1206d29ceeccd401c98c26990
2018-02-05 20:45:15 +01:00
Stefan Sperling 6cee893a0f Make "waiting indicator" of IMMEDIATE ASSIGN REJECT dynamic.
The IMMEDIATE ASSIGN REJECT message contains a wait indicator which
tells an MS requesting a channel to wait for a specified amount of
time before trying to request a channel again, i.e. the wait indicator
controls the T3122 timeout value in the MS.

Previously, the wait indicator was fixed to 10 seconds.
This is not sufficient if there are a lot of MS requesting channels
because the MS will retry too soon. Instead of using a fixed value,
maintain a dynamic wait indicator value based on average channel load.

The load (used vs. available channels on a BTS) is sampled once per
second, and once 8 samples have been collected we update a BTS-specific
T3122 wait indicator based on the measured load.

While the wait indicator could go up to 255 seconds, this initial
implementation keeps it in the range from 10 to 128 seconds.

Further experimentation and testing will show whether higher wait
indicator values are desirable, if the sampling rate needs to change,
or if the function mapping the load measurement to a wait indicator
value should change (currently we map the load average linearly into
the range [10, 128] inclusive).

Change-Id: I57e38f6d6ba3b23cc6e1f9520b90261dbb1f1cec
Related: OS#2592
2018-02-05 13:58:17 +01:00
Harald Welte 068e2ecf88 update.gitignore with 'tags' files and 'deps' directory
Change-Id: I2b51bbb4dce9757be7f2430b83b7879e24aa0df1
2018-01-28 03:23:07 +01:00
Harald Welte b794887cab remove obsolete gsm_subscriber_connection.bts member
This member was merely a cache for conn->lchan->ts->trx->bts,
so let's avoid having to keep copies of the same data (which needs
to be kept up to date).

Change-Id: Id3bff8b18425ef5d45eb460ac9eb620023013ba0
2018-01-28 03:23:00 +01:00
Harald Welte 720de68cb0 bssmap_handle_assignm_req(): Decode channel type as first step
The decision on how to further process the request depends significantly
on the contents of the only mandatory IE of the ASSIGNMENT REQ.  Let's
decode it first.

Change-Id: I030b5ad6f4fc33da9155c8a6061fd982312b20fb
2018-01-28 03:07:21 +01:00
Harald Welte c751513c04 cosmetic: Remove data/len variables in bssmap_handle_assignm_req()
There's nothing wrong with passing the TLVP_VAL/TLVP_LEN directly into
the gsm0808 decoder functions, let's avoid variables that get assigned
and used only once - particularly with such generic names.

Change-Id: I8557b4a9ff4de28b76c7d618631a4700176a8669
2018-01-28 03:07:16 +01:00
Stefan Sperling 56dd9815eb Improve an error message in page_lai_and_lac()
This error message is now contained in a loop, and the current iteration
does not know whether paging will fail entirely or if later iterations
will succeed. Update the error message accordingly.
This also makes the error message consistent with the one in page_cgi().

Change-Id: I8ec229702343343dedcbb242b6d0ed170c858511
2018-01-26 02:29:32 +00:00
Stefan Sperling 774020a843 Remove an unused variable.
Local variable is_lu in rsl_rx_chan_rqd() has been unused
since commit 6082a377f5.

Change-Id: I67594afcfa4104e91352d50f40ae9f2bc20f4cd1
2018-01-25 16:09:33 +01:00
Max 537b655b99 cosmetic: log prim operation as text
When logging SCCP error, log failed primitive operation as text.

Change-Id: I91f739cea9f518a24fff6870f7dceab8175c9646
Related: OS#2851
2018-01-24 14:10:51 +01:00
Andreas Eversberg 084b421fba HO: Add a penalty timer list to the subscriber connection entity
This penalty timer is used to temporarily block cells where handover
or assignment failed or where handover is not allowed. This is usefull
to prevent repeated handover attempts to broken cells or cells that have
limited allowed distance.

Change-Id: I95cb7e3211b2470b773965e7aa94d8eb6c8c1a3a
2018-01-22 01:57:50 +00:00
Andreas Eversberg 83594847a8 Fix: meas_rep.c will only use valid DL measurement reports
When averaging measurements, only the valid reports are used. If there is
no valid report in the averaging window at all, an error is returned.

Change-Id: I33056225ead788340755e98113d72e1cbf3ebce6
2018-01-21 19:06:58 +00:00
Andreas Eversberg 935e5d76dd HO: add queue to cache DTAP messages during handover/assignment
Add ho_dtap_cache to gsm_subscriber_connection, a stock msgb queue to be used
with msgb_enqueue() and msgb_dequeue().

Keep a counter of queue length, to enforce a sane maximum counter for cached
messages. So far a hardcoded maximum of 23 messages will be cached.

Have balanced ho_dtap_cache_add() and ho_dtap_cache_flush() functions.

The original patch was by jolly, but I have basically completely replaced it
with the simpler msgb queue pattern.

Change-Id: I6e4d93628befb3d97e5cee0343cd9f8ba0b8620c
2018-01-19 22:09:19 +00:00
Neels Hofmeyr 2660c0412d HO: make bts_by_arfcn_bsic() public
Change-Id: Ie746f76433f6b46a71a91b7714cc034c4355d993
2018-01-19 22:09:19 +00:00
Neels Hofmeyr 1c251f0c9f HO: rename gsm_bts_neighbor() to bts_by_arfcn_bsic()
The name sounds like it is looking up neighbors, instead it simply traverses
the global list of BTSes. Rename to reflect what it does.

Move FIXME comment to its logical place: at the invocation of
bts_by_arfcn_bsic().

Change-Id: I063870d09f782a4f18e85d87c7cd17fe660cb3fd
2018-01-19 22:09:19 +00:00
Andreas Eversberg df65c9afee HO: Count number of free timeslot on a given BTS
This is needed for handover algorithm to balance free slots and to prevent
congestion of one cell, while other cells still have free capacities.

Change-Id: Ic8bee8a515ee8aa9a99af71756fe60b8dd8f868b
2018-01-19 18:19:00 +01:00
Andreas Eversberg 81260a6795 HO: Change debug category at handover decision: DHO -> DHODEC
Change-Id: I7322b790f647b681bfe3a9c95b04516fbc7cbf88
2018-01-19 16:03:16 +01:00
Neels Hofmeyr 87b5eb667b HO: add handover algo 2 parameters; skip HO 1 if HO 2 is configured
Change-Id: I8811ee8a75be09048042b511ee4bd9bc1de63976
2018-01-19 16:03:16 +01:00
Neels Hofmeyr c561515ae0 HO: enable handover by initializing at startup; rename init function
Change-Id: I224884c84895ebf6c8cf498c16616214cb2b5779
2018-01-19 16:03:16 +01:00
Andreas Eversberg 9869203f65 HO: fix: increase the number of measurement report history to 10
If we want to average over up to 10 measurement reports (as configurable
at VTY), we need a history of at least 10 measurements.

Change-Id: Ia7cfac073bdc464092ca3e51dec319ac30401dd1
2018-01-19 16:03:16 +01:00
Andreas Eversberg 30b6df607e Correctly set T3105 for ipaccess BTS type
The given value is 10 * ms, so 13 is used instead of 128.

If T3105 is set at config to something greater 0, it is used instead of
the default value.

Adjusst nanobts_omlattr_test.c accordingly.

Change-Id: I3d9687619ba4de35f5d2eff3026d903534b2bbd4
2018-01-19 16:03:16 +01:00
Andreas Eversberg 5d45c0732a Allow assignment to TCH channel with signalling only mode
This makes sense, if silent call is used. Assignment allows to change from
SDCCH (or whatever was available) to given TCH rate.

Change-Id: I2efe9d7ab429e902581ebb9e0e006f2aec6d8972
2018-01-19 16:03:16 +01:00
Andreas Eversberg 3106c16b4f Do not perform assignment, if the new channel equals the current one
This can happen, if a TCH/H was requested, but because it is not available,
a TCH/F is allocated. If the old channel was TCH/F already, it makes no
sense to assign it.

Change-Id: I284125483fc14b8f82e32ee61aa3866746238eae
2018-01-19 16:03:16 +01:00
Andreas Eversberg 7df80d38f3 HO: Add handover decision debugging category
Change-Id: Iaf99d4e9ae08c38bf364dbb37d42098f976f6b8c
2018-01-19 16:03:16 +01:00
Andreas Eversberg e0cba56dad HO: If handover logic is used to do assignment, signal assignment result
Change-Id: I465caef03626e67d9b3a21bdf730589b9852c211
2018-01-19 16:03:16 +01:00
Andreas Eversberg 869121c09a HO: Always update rqd_ta after receiving measurement report
The up-to-date rqd_ta is required for assignment command. If the phone
moves, the timing advance might change. The rqd_ta will be updated by
each measurement report.

Change-Id: If1a592e590cfed55ff3dca5be89e2946e8017a22
2018-01-19 16:03:16 +01:00
Andreas Eversberg 7c41cd1ac5 HO: Changed availablilty of ts_is_usable() from static to extern
Change-Id: I3471e38327c4b98490faed9b604fb76438ba9954
2018-01-19 16:03:16 +01:00