aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc
AgeCommit message (Collapse)AuthorFilesLines
2016-06-23debug log: log all lchan state transitionsNeels Hofmeyr1-0/+3
Change-Id: Ic70aca65b3796c90ba1a88ea67ac7a2ad9190b69
2016-06-23vty: show lchan summary: also show lchan->stateNeels Hofmeyr1-2/+5
Change-Id: If7ae92b8d501b51bbe8a165c223734e169a8bb97
2016-06-21dyn PDCH: enable PDCH only after release due to errorNeels Hofmeyr1-1/+6
In rsl_rx_rf_chan_rel_ack(), only activate PDCH when in NONE state. For the case of REL_ERR state, do the PDCH activation in the error timeout callback after T3111 is done. Change-Id: I4c55479b252a12039bb3d8c30a9cbf0199ca410e
2016-06-16dyn PDCH: set lchan->state after PDCH DEACT / before PDCH ACTNeels Hofmeyr2-23/+12
Do the PDCH DE/ACT before we set the lchan->state to De-/Activation Requested. It makes more sense semantically to change PDCH mode while the lchan is still in NONE status. Thus slightly move some invocations: PDCH ACT: Free the lchan before PDCH activation. Hence remove the lchan_free() call from the rsl_rx_pdch_act_ack() code path; it used to do the PDCH activation first and call lchan_free() in the callback. PDCH DEACT: Set the (TCH) Activation Requested state only within rsl_chan_activate_lchan(), after the PDCH deact is complete. Channel allocator: don't pick channels that have a PDCH PENDING flag set, to avoid using channels that are still in PDCH switchover (despite their state being NONE). The lchan_may_change_pdch() sanity checks are becoming a lot simpler. Change-Id: I4206dd4808e21c3e59393ea7f5ab4f438afff066
2016-06-16dyn PDCH: add lchan sanity checks in PDCH DE/ACT ACKNeels Hofmeyr1-0/+54
Change-Id: I0456cfb88860823c37c14688673e9cbc8d0085d8
2016-06-16dyn PDCH: track pending PDCH de-/activationNeels Hofmeyr1-2/+18
Set and clear pending flags on the TS according to PDCH de-/activation. This will allow changing the time we set the channel state to after PDCH DEACT and before PDCH ACT, in a subsequent commit. Also add a sanity check on whether we're sending conflicting or superfluous PDCH de-/activations on the same TS. Change-Id: Ieae73271df749ded3d90585116aae01f3ad4ee74
2016-06-16dyn PDCH: fix: clear PDCH flags on TS reconnect (e.g. BTS re-connect)Neels Hofmeyr1-0/+2
Change-Id: I89a0ef1794f343fdd06a62237f5732e73f4d2704
2016-06-16dyn PDCH: TS flags: rename one, add three, as enumNeels Hofmeyr2-4/+4
Rename TS_F_PDCH_MODE to TS_F_PDCH_ACTIVE, to more accurately reflect the truth value's meaning. Add TS_F_PDCH_ACT_PENDING and TS_F_PDCH_DEACT_PENDING for sysmoBTS (and possibly other BTS implementations) to remember what to do when the PCU replies with a channel de/activation. Also add TS_F_PDCH_PENDING_MASK to test for both. Change from #define to an enum. Note: These flags are also used in the upcoming osmo-bts-sysmo dyn PDCH commits, so osmo-bts submission depends on this commit. Change-Id: I391a103ab599648b0c5d4f3ad613a6d7c48834b3
2016-06-14Make random extension range configurableMax1-1/+2
Previously if subscriber was automatically created it got assigned random MSISDN number between 20000 and 49999. Make it configurable with new vty command "subscriber-create-on-demand random" and expand vty tests to check it. Change-Id: I040a1d227b0c7a1601dc7c33eccb0007941408a6 Related: OS#1658
2016-06-14dyn PDCH: send PDCH ACT for each TCH/F_PDCH on TS EnableNeels Hofmeyr4-4/+48
Add dyn_pdch_init() in new file bsc_dyn_pdch.c (new file to avoid linking issues; bsc_init.c would create undefined references, and putting in a new file is the easiest solution). Call dyn_pdch_init() from nm_statechg_event() whenever a TS is enabled. Revert the |= TS_F_PDCH_MODE chunk from previous commit, since this flag will now be set after dyn_pdch_init() sent out the PDCH ACT and when subsequently the PDCH ACT ACK messages are received in rsl_rx_pdch_act_ack(). Change-Id: I0cad93dec59d546b3f3b19e332e0833496031575
2016-06-14dyn PDCH: Automatically deactivate/activate PDCH on TCH/F+PDCH channelAndreas Eversberg2-3/+39
Handle shared TCH/F+PDCH channels as regular TCH/F channels. Prior to activation, deactivate PDCH mode. After deactivation, restore PDCH mode. Change-Id: I59712b8769cc3959ef114a6e12e77801816fe8b6
2016-06-12dyn PDCH: allow allocating TCH/F on TCH/F_PDCH slotsNeels Hofmeyr1-9/+29
Remove check for dyn PDCH in _lc_find_trx(), instead call _lc_find_trx() via _lc_find_bts() several times, so that pure TCH/F is preferred to TCH/F_PDCH. Add this logic next to the other channel match decisions in chan_alloc(). BTW, the removed check in _lc_find_trx() whether PDCH is active is not necessary, as described in the added comment for lchan_alloc(). Original patch idea by jolly, but split in two and implemented differently by nhofmeyr. Change-Id: I0c728b922656be03588b775638b610a93f8187d5
2016-06-12dyn PDCH: Fix free slot search for chan_alloc_reverse == trueAndreas Eversberg1-2/+14
For chan_alloc_reverse, _lc_find_trx() should return the last free slot instead of the first. Original patch by jolly, but split in two by nhofmeyr. Change-Id: Iff980242b9b5cb39345aaad0350ee368537677cd
2016-06-07lchan_alloc(): on alloc failure, report original typeNeels Hofmeyr1-4/+8
In lchan_alloc(), there are several decisions to fall back to another type of channel, followed by setting the channel type to the fall back type. So far, this was set regardless of allocation success or failure. If such fall back type is not available, do not modify the local type variable and thus report an S_CHALLOC_ALLOC_FAIL on the type originally requested (report is at the end of lchan_alloc()). Change-Id: Ie3d4cb74f91db0b8c4f5e595a963099de339ad1a
2016-06-06Add warning for unsupported DTX configurationsMax1-2/+6
libosmo-abis do not consider DTX bits while processing TRAU frames. As I do not have equipment to test it, I'm not sure if/how non-IP BTS will work in case of DTX - warn users about it. Change-Id: I94ee69cd309fc343a428ddc66942cd57f2a34c05 Related: OS#22
2016-06-05debug log: cosmetic fixesNeels Hofmeyr1-2/+2
Drop erroneous C from a DEBUGPC, should be on a new line. Drop underscores from IPAC_PDCH_[DE]ACT: all other log messages for IPAC PDCH are without underscores -- git grep "P(.*IPAC.PDCH.*ACT" Change-Id: I8fb7a1c1beabb1f4388517383fd0bdc082d557ca
2016-06-05comment tweak for bsc_handover_start()Neels Hofmeyr1-3/+3
Have a comment only in the .c file to remove dup, tweak wording, use doxygen style. Change-Id: If054dad877a1ca750cd72be9c9d90bcf087bf741
2016-06-05Add regexp authorization policy for IMSIMax1-3/+26
* extend "auth policy" vty command with new option "regexp" * add vty command "authorized-regexp" for setting arbitrary POSIX regular expression * add basic vty test * add optional "regexp" argument to subscriber-create-on-demand vty command With those in place we can now set the regexp against which MS's IMSI will be matched. If IMSI match the regexp than MS is allowed to access the network. If subscriber is already marked as authorized in HLR than it'll be allowed regardless of IMSI matching. The same way we can decide whether to create subscribers on-demand basesd on IMSI regexp match. Similar to authorization this restriction can be overridden by manually creating subscriber via vty, ctrl interface or directly in HLR. Change-Id: I525f4b80676de47d1d422686da2ca012301b0129 Fixes: OS#1647
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-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 Welte1-1/+1
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-20Make extending subscriber creation easierMax1-1/+1
* 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 BTSMax4-20/+87
* 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-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 typeMax1-2/+4
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-16Add basic SI2quater supportMax4-3/+297
* 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.
2016-04-16Add SI2quater support to SI3Max3-1/+17
Advertise SI2 quater presence and location (if available) using SI3 according to 3GPP TS 44.018 ยง 10.5.2.34
2016-04-12Remove trivial wrapper functionMax1-13/+2
Rename gsm48_tx_chan_mode_modify() to gsm48_lchan_modify() and remove corresponding wrapper code.
2016-04-11Fix segfault with broken configMax1-0/+3
Fixes OS#1691
2016-04-01bsc: Add parameter to restart a btsHolger Hans Peter Freyther1-1/+11
The ip.access nanoBTS seems to have severe issues with BSSGP when changing the country code and/or network code. It is unlikely that the proprietary code is getting fixed so we extend the parameter for the apply-configuration command to carry the 'restart' param.
2016-04-01bsc: Add code to send ip.access reboot command to nanoBTSHolger Hans Peter Freyther1-0/+39
The nanoBTS continues to be buggy and seems to have broken BSSGP when changing SIs across new OML connections. Add an easy command to force the reboot of the system through OML.
2016-04-01abis: Send the message without enforcing to wait for a responseHolger Hans Peter Freyther1-1/+1
The user might issue restarts while no BTS is connected and we should not block the abis queue because of these messages.
2016-03-1504.08: apply new bitmask functions, fix bitmask useNeels Hofmeyr1-3/+5
Replace hardcoded protocol discriminator and message type bitmasks with function calls recently introduced in libosmocore. Note that the release 98 bitmasks slightly differ from the release 99 bitmasks. This patch uses the "default" gsm48_hdr_msg_type invocation, thus it depends on libosmocore whether 98 or 99 bitmasks are used. In some places, use of the bitmask was erratic. Fix these implicitly by employing the bitmask functions: * silent_call.c: silent_call_reroute(): add missing bitmask for MM. * bsc_msg_filter.c: bsc_msg_filter_initial(): RR vs. MM messages. * osmo_bsc_filter.c: bsc_find_msc() and bsc_scan_bts_msg(): RR vs. MM messages. * bsc_nat_rewrite.c: bsc_nat_rewrite_msg(): SMS vs. CC messages. * bsc_ussd.c: no bitmask is applicable for the message types used here. * gb_proxy.c: gbproxy_imsi_acquisition(): missing bit mask for pdisc. In gprs_gb_parse.c: gprs_gb_parse_dtap(), add a log notice for unexpected message types.
2016-02-25enable ctrl bind config for various programsNeels Hofmeyr1-2/+4
Add ctrl_vty_init() calls and feed the ctrl_vty_get_bind_addr() return value to ctrl_interface_setup() in the following programs: osmo-bsc osmo-bsc_nat osmo-nitb osmo-sgsn For osmo-sgsn, move the control interface setup invocation below the config parsing, so that the ctrl_vty_get_bind_addr() can return the configured address.
2016-02-25enable telnet VTY bind address config for various programsNeels Hofmeyr1-1/+5
Following the 'line vty'/'bind A.B.C.D' command added in libosmocore, use the configured address to set the telnet bind for the VTY line. It is now possible to publish the VTY on a specific local interface (including 0.0.0.0 aka "any"). Implement in all of: osmo-gbproxy osmo-gtphub osmo-sgsn osmo-bsc osmo-bsc_nat osmo-bsc_mgcp osmo-nitb In some of these main programs, move the telnet initialization below the configuration parsing. Historically, this was not a good idea for programs using bsc_init.c (aka bsc_bootstrap_network()), since they expected a gsm_network struct pointer in ((struct telnet_connection*)vty->priv)->priv, so that telnet had to be either initialized or replaced by a dummy struct. In the meantime, the gsm_network struct is not actually looked up in a priv pointer but in the static bsc_vty.c scope (bsc_gsmnet), so this limitation is mere legacy (even though said legacy is still there in an "#if 0" chunk). In the other binaries I have briefly looked at the init sequence dependencies and found no reason to initialize telnet above the config file parsing. In any case, I have tested every single one of abovementioned binaries to verify that they still parse the example config successfully and launch, allowing VTY connections on the configured address(es). I hope this suffices. In all of the above, log VTY address and port. LOGL_INFO is disabled by default in some of the logging scopes, and since it is a single log message right at program launch, I decided for the slightly more aggressive LOGL_NOTICE.
2016-02-24minor fixes in bsc_vty.c and bsc_nat.cNeels Hofmeyr1-1/+0
Remove unused talloc.h from bsc_vty.c. In bsc_nat.c, use OSMO_CTRL_PORT_BSC_NAT instead of hardcoding port number, and include ctrl/ports.h for that. Fix comment typo "COMAMND"
2016-01-30gsm0408: Provide unique strings for the gsm 04.08 messageHolger Hans Peter Freyther1-8/+8
At Rhizomatica we see that some GSM 04.08 messages are leaked and have no other indication if that is Call Control, SMS or something else.
2016-01-28fix bsc_vty out: timeslot indented too deeply.Neels Hofmeyr1-8/+8
In 'show running-config', timeslot appears as a sub-element of rsl, but it is a direct child of trx. Fix the timeslot section in vty_out by removing one space of idention. Adjust various config examples. Rationale: it's not relevant for function, but confuses human operators. Fixing it will save the next hacker some time.
2015-12-12indicate the GSM 04.08 channel mode in 'show lchan'Harald Welte1-0/+16
2015-11-20vty: Print NCC/BCC and not just integer value of BSICHarald Welte1-1/+2
2015-11-20Fix TSC/BSIC handling bug and remove bts->tscHarald Welte2-27/+8
This fixes a bug in the following circumstances: * BSIC is set to 0 in the config file * No TSC is explicitly specified at the BST level in the config file In this case, we ended up using BSIC=0 and TSC=7, as TSC=7 is our default initialization value. The TSC of the CCCH/BCCH must always be the BCC, which is the lower 3 bits of the BSIC. Having configuration options for both the BSIC _and_ the TSC at the BTS level therefore makes no sense, as it only adds ways in which users can configure non-oprational configurations. So we remove the bts->tsc member, and keep only the ts->tsc members that allow us to configure a timeslot-specific TSC that's different from the BTS TSC (= BCC).